"use strict";var E=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var s in t)E(e,s,{get:t[s],enumerable:!0})},V=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of j(t))!K.call(e,i)&&i!==s&&E(e,i,{get:()=>t[i],enumerable:!(o=O(t,i))||o.enumerable});return e};var $=e=>V(E({},"__esModule",{value:!0}),e);var B={};L(B,{clear:()=>w,createSignal:()=>G,defineOptionsStore:()=>b,defineSetupStore:()=>C,defineStore:()=>z,track:()=>A,trigger:()=>R,useComputed:()=>y,useEffect:()=>a,useMemo:()=>P,useReactive:()=>l,watch:()=>q});module.exports=$(B);var d=Symbol("READ"),m=Symbol("DELETE"),h={};function S(e){return typeof e=="object"&&e!==null}function v(e){return S(e)?Reflect.ownKeys(e):[]}var M=0;function I(){return String(M++)}function G(e,t){if(!t)throw new Error("path can not be empty");let s=t.split(".");function o(i=d,f=!1){let n=[...s],r=n.pop(),c=n.reduce((u,p)=>u[p],h);return i===d?c[r]:i===m?delete c[r]:f&&S(i)&&S(c[r])?Object.assign(c[r],i):c[r]=i}return o(e),o}var x=[],g=[];function w(){for(;g.length;)a(g.shift())}function A(e){if(x.length){let t=x[x.length-1];if(e.has(t))return!1;e.add(t)}return!0}function R(e){for(let t of e)g.includes(t)||g.push(t);w()}function a(e,...t){x.push(e);let s=e(...t);return x.pop(),s}function l(e){return D(e,I())}function D(e,t){let s=new Set,o=new Map,i=G(e,t);return new Proxy(i,{get(f,n,r){let c=f();if(!(typeof c=="object"&&c!==null))return;if(n in f)return Reflect.get(f,n);if(Reflect.has(c,n)){let p=Reflect.get(c,n);if(typeof p=="function")return(...T)=>{let F=p.call(f(),...T);return r(f()),F}}if(o.has(n))return o.get(n);if(n==="then"&&!Reflect.has(c,n))return;let u=D(Reflect.get(c,n),`${t}.${String(n)}`);return o.set(n,u),u},apply(f,n,r){r=r.length?r:[d];let c=Reflect.apply(f,n,r);if(r[0]===d)A(s);else if(r[0]===m){R(s);return}else{let u=new Set(v(c));for(let p of o.keys()){let T=o.get(p);u.has(p)?T(Reflect.get(c,p)):T(m)&&o.delete(p)}R(s)}return c}})}function y(e){let t=l(null);if(typeof e=="function")a(()=>t(e()));else{let{get:s,set:o}=e;a(()=>t(s())),a(()=>o(t()))}return t}function P(e){let t=y(e);return()=>t()}function q(e,t){let s=t.map(o=>o());a(()=>{let o=t.map(i=>i());e(o,s),s=o})}function z(e){return typeof e=="function"?C(e):b(e)}function b(e,t){let{id:s,state:o,getters:i={},actions:f={}}=e,n=t||l({});n(o,!0),n.$id=s;for(let r in i)n[r]=y(i[r].bind(n));for(let r in f)n[r]=f[r].bind(n);return n}function C(e){let t=l({});return b(e(t),t)}0&&(module.exports={clear,createSignal,defineOptionsStore,defineSetupStore,defineStore,track,trigger,useComputed,useEffect,useMemo,useReactive,watch});