import{c as a}from"./d404898a-8ea9-4024-96e6-9f06abfa33b3.0Z0pQ5H2.js";const S=t=>{let e;const n=new Set,o=(s,u)=>{const c=typeof s=="function"?s(e):s;if(!Object.is(c,e)){const g=e;e=u??(typeof c!="object"||c===null)?c:Object.assign({},e,c),n.forEach(f=>f(e,g))}},i=()=>e,r={setState:o,getState:i,getInitialState:()=>l,subscribe:s=>(n.add(s),()=>n.delete(s))},l=e=t(o,i,r);return r},d=t=>t?S(t):S,I=t=>t;function j(t,e=I){const n=a.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getInitialState()));return a.useDebugValue(n),n}const b=t=>{const e=d(t),n=o=>j(e,o);return Object.assign(n,e),n},x=t=>t?b(t):b;export{x as c};
