import{E as A,h as J,G as K,H as T,q as R,I as N,J as V,K as tt,L as et,i as st,M as nt,g as q,w as ot,N as ct,O as rt,P as ut}from"./runtime-dom.esm-bundler-Dxy_DEvW.js";let B;const p=t=>B=t,z=Symbol();function x(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var E;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(E||(E={}));function yt(){const t=A(!0),o=t.run(()=>J({}));let s=[],e=[];const r=K({install(u){p(r),r._a=u,u.provide(z,r),u.config.globalProperties.$pinia=r,e.forEach(a=>s.push(a)),e=[]},use(u){return this._a?s.push(u):e.push(u),this},_p:s,_a:null,_e:t,_s:new Map,state:o});return r}const G=()=>{};function H(t,o,s,e=G){t.add(o);const r=()=>{t.delete(o)&&e()};return!s&&tt()&&et(r),r}function j(t,...o){t.forEach(s=>{s(...o)})}const at=t=>t(),M=Symbol(),k=Symbol();function L(t,o){t instanceof Map&&o instanceof Map?o.forEach((s,e)=>t.set(e,s)):t instanceof Set&&o instanceof Set&&o.forEach(t.add,t);for(const s in o){if(!o.hasOwnProperty(s))continue;const e=o[s],r=t[s];x(r)&&x(e)&&t.hasOwnProperty(s)&&!R(e)&&!N(e)?t[s]=L(r,e):t[s]=e}return t}const ft=Symbol();function lt(t){return!x(t)||!Object.prototype.hasOwnProperty.call(t,ft)}const{assign:h}=Object;function it(t){return!!(R(t)&&t.effect)}function ht(t,o,s,e){const{state:r,actions:u,getters:a}=o,P=s.state.value[t];let S;function b(){P||(s.state.value[t]=r?r():{});const y=nt(s.state.value[t]);return h(y,u,Object.keys(a||{}).reduce((v,d)=>(v[d]=K(q(()=>{p(s);const _=s._s.get(t);return a[d].call(_,_)})),v),{}))}return S=Q(t,b,o,s,e,!0),S}function Q(t,o,s={},e,r,u){let a;const P=h({actions:{}},s),S={deep:!0};let b,y,v=new Set,d=new Set,_;const m=e.state.value[t];!u&&!m&&(e.state.value[t]={}),J({});let W;function D(c){let n;b=y=!1,typeof c=="function"?(c(e.state.value[t]),n={type:E.patchFunction,storeId:t,events:_}):(L(e.state.value[t],c),n={type:E.patchObject,payload:c,storeId:t,events:_});const f=W=Symbol();st().then(()=>{W===f&&(b=!0)}),y=!0,j(v,n,e.state.value[t])}const U=u?function(){const{state:n}=s,f=n?n():{};this.$patch(w=>{h(w,f)})}:G;function X(){a.stop(),v.clear(),d.clear(),e._s.delete(t)}const F=(c,n="")=>{if(M in c)return c[k]=n,c;const f=function(){p(e);const w=Array.from(arguments),g=new Set,I=new Set;function Z(l){g.add(l)}function $(l){I.add(l)}j(d,{args:w,name:f[k],store:i,after:Z,onError:$});let C;try{C=c.apply(this&&this.$id===t?this:i,w)}catch(l){throw j(I,l),l}return C instanceof Promise?C.then(l=>(j(g,l),l)).catch(l=>(j(I,l),Promise.reject(l))):(j(g,C),C)};return f[M]=!0,f[k]=n,f},Y={_p:e,$id:t,$onAction:H.bind(null,d),$patch:D,$reset:U,$subscribe(c,n={}){const f=H(v,c,n.detached,()=>w()),w=a.run(()=>ot(()=>e.state.value[t],g=>{(n.flush==="sync"?y:b)&&c({storeId:t,type:E.direct,events:_},g)},h({},S,n)));return f},$dispose:X},i=T(Y);e._s.set(t,i);const O=(e._a&&e._a.runWithContext||at)(()=>e._e.run(()=>(a=A()).run(()=>o({action:F}))));for(const c in O){const n=O[c];if(R(n)&&!it(n)||N(n))u||(m&&lt(n)&&(R(n)?n.value=m[c]:L(n,m[c])),e.state.value[t][c]=n);else if(typeof n=="function"){const f=F(n,c);O[c]=f,P.actions[c]=n}}return h(i,O),h(V(i),O),Object.defineProperty(i,"$state",{get:()=>e.state.value[t],set:c=>{D(n=>{h(n,c)})}}),e._p.forEach(c=>{h(i,a.run(()=>c({store:i,app:e._a,pinia:e,options:P})))}),m&&u&&s.hydrate&&s.hydrate(i.$state,m),b=!0,y=!0,i}function vt(t,o,s){let e;const r=typeof o=="function";e=r?s:o;function u(a,P){const S=ut();return a=a||(S?rt(z,null):null),a&&p(a),a=B,a._s.has(t)||(r?Q(t,o,e,a):ht(t,e,a)),a._s.get(t)}return u.$id=t,u}function dt(t){const o=V(t),s={};for(const e in o){const r=o[e];r.effect?s[e]=q({get:()=>t[e],set(u){t[e]=u}}):(R(r)||N(r))&&(s[e]=ct(t,e))}return s}export{yt as c,vt as d,dt as s};
//# sourceMappingURL=pinia-C4Yr3Hdu.js.map
