You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

5 lines
12 KiB

import{c as B,w as x,r as K,L as W}from "./vue.runtime.esm.js";/*!
* vuex v4.0.2
* (c) 2021 Evan You
* @license MIT
*/var A="store";function ft(e){return e===void 0&&(e=null),B(e!==null?e:A)}function _(e,t){Object.keys(e).forEach(function(i){return t(e[i],i)})}function $(e){return e!==null&&typeof e=="object"}function z(e){return e&&typeof e.then=="function"}function Y(e,t){return function(){return e(t)}}function G(e,t,i){return t.indexOf(e)<0&&(i&&i.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function T(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var i=e.state;y(e,i,[],e._modules.root,!0),C(e,i,t)}function C(e,t,i){var r=e._state;e.getters={},e._makeLocalGettersCache=Object.create(null);var n=e._wrappedGetters,o={};_(n,function(a,c){o[c]=Y(a,e),Object.defineProperty(e.getters,c,{get:function(){return o[c]()},enumerable:!0})}),e._state=K({data:t}),e.strict&&Z(e),r&&i&&e._withCommit(function(){r.data=null})}function y(e,t,i,r,n){var o=!i.length,a=e._modules.getNamespace(i);if(r.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=r),!o&&!n){var c=O(t,i.slice(0,-1)),u=i[i.length-1];e._withCommit(function(){c[u]=r.state})}var l=r.context=X(e,a,i);r.forEachMutation(function(s,f){var h=a+f;q(e,h,s,l)}),r.forEachAction(function(s,f){var h=s.root?f:a+f,d=s.handler||s;J(e,h,d,l)}),r.forEachGetter(function(s,f){var h=a+f;Q(e,h,s,l)}),r.forEachChild(function(s,f){y(e,t,i.concat(f),s,n)})}function X(e,t,i){var r=t==="",n={dispatch:r?e.dispatch:function(o,a,c){var u=b(o,a,c),l=u.payload,s=u.options,f=u.type;return(!s||!s.root)&&(f=t+f),e.dispatch(f,l)},commit:r?e.commit:function(o,a,c){var u=b(o,a,c),l=u.payload,s=u.options,f=u.type;(!s||!s.root)&&(f=t+f),e.commit(f,l,s)}};return Object.defineProperties(n,{getters:{get:r?function(){return e.getters}:function(){return L(e,t)}},state:{get:function(){return O(e.state,i)}}}),n}function L(e,t){if(!e._makeLocalGettersCache[t]){var i={},r=t.length;Object.keys(e.getters).forEach(function(n){if(n.slice(0,r)===t){var o=n.slice(r);Object.defineProperty(i,o,{get:function(){return e.getters[n]},enumerable:!0})}}),e._makeLocalGettersCache[t]=i}return e._makeLocalGettersCache[t]}function q(e,t,i,r){var n=e._mutations[t]||(e._mutations[t]=[]);n.push(function(a){i.call(e,r.state,a)})}function J(e,t,i,r){var n=e._actions[t]||(e._actions[t]=[]);n.push(function(a){var c=i.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},a);return z(c)||(c=Promise.resolve(c)),e._devtoolHook?c.catch(function(u){throw e._devtoolHook.emit("vuex:error",u),u}):c})}function Q(e,t,i,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(o){return i(r.state,r.getters,o.state,o.getters)})}function Z(e){x(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function O(e,t){return t.reduce(function(i,r){return i[r]},e)}function b(e,t,i){return $(e)&&e.type&&(i=t,t=e,e=e.type),{type:e,payload:t,options:i}}var tt="vuex bindings",N="vuex:mutations",E="vuex:actions",g="vuex",et=0;function rt(e,t){W({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[tt]},function(i){i.addTimelineLayer({id:N,label:"Vuex Mutations",color:D}),i.addTimelineLayer({id:E,label:"Vuex Actions",color:D}),i.addInspector({id:g,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),i.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===g)if(r.filter){var n=[];V(n,t._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[P(t._modules.root,"")]}),i.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===g){var n=r.nodeId;L(t,n),r.state=ot(ct(t._modules,n),n==="root"?t.getters:t._makeLocalGettersCache,n)}}),i.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===g){var n=r.nodeId,o=r.path;n!=="root"&&(o=n.split("/").filter(Boolean).concat(o)),t._withCommit(function(){r.set(t._state.data,o,r.state.value)})}}),t.subscribe(function(r,n){var o={};r.payload&&(o.payload=r.payload),o.state=n,i.notifyComponentUpdate(),i.sendInspectorTree(g),i.sendInspectorState(g),i.addTimelineEvent({layerId:N,event:{time:Date.now(),title:r.type,data:o}})}),t.subscribeAction({before:function(r,n){var o={};r.payload&&(o.payload=r.payload),r._id=et++,r._time=Date.now(),o.state=n,i.addTimelineEvent({layerId:E,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:o}})},after:function(r,n){var o={},a=Date.now()-r._time;o.duration={_custom:{type:"duration",display:a+"ms",tooltip:"Action duration",value:a}},r.payload&&(o.payload=r.payload),o.state=n,i.addTimelineEvent({layerId:E,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:o}})}})})}var D=8702998,it=6710886,nt=16777215,k={label:"namespaced",textColor:nt,backgroundColor:it};function R(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function P(e,t){return{id:t||"root",label:R(t),tags:e.namespaced?[k]:[],children:Object.keys(e._children).map(function(i){return P(e._children[i],t+i+"/")})}}function V(e,t,i,r){r.includes(i)&&e.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:t.namespaced?[k]:[]}),Object.keys(t._children).forEach(function(n){V(e,t._children[n],i,r+n+"/")})}function ot(e,t,i){t=i==="root"?t:t[i];var r=Object.keys(t),n={state:Object.keys(e.state).map(function(a){return{key:a,editable:!0,value:e.state[a]}})};if(r.length){var o=at(t);n.getters=Object.keys(o).map(function(a){return{key:a.endsWith("/")?R(a):a,editable:!1,value:S(function(){return o[a]})}})}return n}function at(e){var t={};return Object.keys(e).forEach(function(i){var r=i.split("/");if(r.length>1){var n=t,o=r.pop();r.forEach(function(a){n[a]||(n[a]={_custom:{value:{},display:a,tooltip:"Module",abstract:!0}}),n=n[a]._custom.value}),n[o]=S(function(){return e[i]})}else t[i]=S(function(){return e[i]})}),t}function ct(e,t){var i=t.split("/").filter(function(r){return r});return i.reduce(function(r,n,o){var a=r[n];if(!a)throw new Error('Missing module "'+n+'" for path "'+t+'".');return o===i.length-1?a:a._children},t==="root"?e:e.root._children)}function S(e){try{return e()}catch(t){return t}}var p=function(t,i){this.runtime=i,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=(typeof r=="function"?r():r)||{}},F={namespaced:{configurable:!0}};F.namespaced.get=function(){return!!this._rawModule.namespaced};p.prototype.addChild=function(t,i){this._children[t]=i};p.prototype.removeChild=function(t){delete this._children[t]};p.prototype.getChild=function(t){return this._children[t]};p.prototype.hasChild=function(t){return t in this._children};p.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)};p.prototype.forEachChild=function(t){_(this._children,t)};p.prototype.forEachGetter=function(t){this._rawModule.getters&&_(this._rawModule.getters,t)};p.prototype.forEachAction=function(t){this._rawModule.actions&&_(this._rawModule.actions,t)};p.prototype.forEachMutation=function(t){this._rawModule.mutations&&_(this._rawModule.mutations,t)};Object.defineProperties(p.prototype,F);var m=function(t){this.register([],t,!1)};m.prototype.get=function(t){return t.reduce(function(i,r){return i.getChild(r)},this.root)};m.prototype.getNamespace=function(t){var i=this.root;return t.reduce(function(r,n){return i=i.getChild(n),r+(i.namespaced?n+"/":"")},"")};m.prototype.update=function(t){H([],this.root,t)};m.prototype.register=function(t,i,r){var n=this;r===void 0&&(r=!0);var o=new p(i,r);if(t.length===0)this.root=o;else{var a=this.get(t.slice(0,-1));a.addChild(t[t.length-1],o)}i.modules&&_(i.modules,function(c,u){n.register(t.concat(u),c,r)})};m.prototype.unregister=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1],n=i.getChild(r);!n||!n.runtime||i.removeChild(r)};m.prototype.isRegistered=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1];return i?i.hasChild(r):!1};function H(e,t,i){if(t.update(i),i.modules)for(var r in i.modules){if(!t.getChild(r))return;H(e.concat(r),t.getChild(r),i.modules[r])}}function lt(e){return new v(e)}var v=function(t){var i=this;t===void 0&&(t={});var r=t.plugins;r===void 0&&(r=[]);var n=t.strict;n===void 0&&(n=!1);var o=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new m(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._devtools=o;var a=this,c=this,u=c.dispatch,l=c.commit;this.dispatch=function(h,d){return u.call(a,h,d)},this.commit=function(h,d,U){return l.call(a,h,d,U)},this.strict=n;var s=this._modules.root.state;y(this,s,[],this._modules.root),C(this,s),r.forEach(function(f){return f(i)})},w={state:{configurable:!0}};v.prototype.install=function(t,i){t.provide(i||A,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&rt(t,this)};w.state.get=function(){return this._state.data};w.state.set=function(e){};v.prototype.commit=function(t,i,r){var n=this,o=b(t,i,r),a=o.type,c=o.payload,u={type:a,payload:c},l=this._mutations[a];!l||(this._withCommit(function(){l.forEach(function(f){f(c)})}),this._subscribers.slice().forEach(function(s){return s(u,n.state)}))};v.prototype.dispatch=function(t,i){var r=this,n=b(t,i),o=n.type,a=n.payload,c={type:o,payload:a},u=this._actions[o];if(!!u){try{this._actionSubscribers.slice().filter(function(s){return s.before}).forEach(function(s){return s.before(c,r.state)})}catch{}var l=u.length>1?Promise.all(u.map(function(s){return s(a)})):u[0](a);return new Promise(function(s,f){l.then(function(h){try{r._actionSubscribers.filter(function(d){return d.after}).forEach(function(d){return d.after(c,r.state)})}catch{}s(h)},function(h){try{r._actionSubscribers.filter(function(d){return d.error}).forEach(function(d){return d.error(c,r.state,h)})}catch{}f(h)})})}};v.prototype.subscribe=function(t,i){return G(t,this._subscribers,i)};v.prototype.subscribeAction=function(t,i){var r=typeof t=="function"?{before:t}:t;return G(r,this._actionSubscribers,i)};v.prototype.watch=function(t,i,r){var n=this;return x(function(){return t(n.state,n.getters)},i,Object.assign({},r))};v.prototype.replaceState=function(t){var i=this;this._withCommit(function(){i._state.data=t})};v.prototype.registerModule=function(t,i,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),this._modules.register(t,i),y(this,this.state,t,this._modules.get(t),r.preserveState),C(this,this.state)};v.prototype.unregisterModule=function(t){var i=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var r=O(i.state,t.slice(0,-1));delete r[t[t.length-1]]}),T(this)};v.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)};v.prototype.hotUpdate=function(t){this._modules.update(t),T(this,!0)};v.prototype._withCommit=function(t){var i=this._committing;this._committing=!0,t(),this._committing=i};Object.defineProperties(v.prototype,w);var dt=M(function(e,t){var i={};return j(t).forEach(function(r){var n=r.key,o=r.val;i[n]=function(){var c=this.$store.state,u=this.$store.getters;if(e){var l=I(this.$store,"mapState",e);if(!l)return;c=l.context.state,u=l.context.getters}return typeof o=="function"?o.call(this,c,u):c[o]},i[n].vuex=!0}),i}),ht=M(function(e,t){var i={};return j(t).forEach(function(r){var n=r.key,o=r.val;i[n]=function(){for(var c=[],u=arguments.length;u--;)c[u]=arguments[u];var l=this.$store.commit;if(e){var s=I(this.$store,"mapMutations",e);if(!s)return;l=s.context.commit}return typeof o=="function"?o.apply(this,[l].concat(c)):l.apply(this.$store,[o].concat(c))}}),i}),vt=M(function(e,t){var i={};return j(t).forEach(function(r){var n=r.key,o=r.val;o=e+o,i[n]=function(){if(!(e&&!I(this.$store,"mapGetters",e)))return this.$store.getters[o]},i[n].vuex=!0}),i});function j(e){return st(e)?Array.isArray(e)?e.map(function(t){return{key:t,val:t}}):Object.keys(e).map(function(t){return{key:t,val:e[t]}}):[]}function st(e){return Array.isArray(e)||$(e)}function M(e){return function(t,i){return typeof t!="string"?(i=t,t=""):t.charAt(t.length-1)!=="/"&&(t+="/"),e(t,i)}}function I(e,t,i){var r=e._modulesNamespaceMap[i];return r}export{ht as a,dt as b,lt as c,vt as m,ft as u};