import{n as e,o as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";var r,i;function a(){return(a=e((()=>{r=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},i=(e=>e?r(e):r)})))()}function o(e,t=c){let n=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(n),n}var s,c,l,u;function d(){return(d=e((()=>{s=t(n(),1),a(),c=e=>e,l=e=>{let t=i(e),n=e=>o(t,e);return Object.assign(n,t),n},u=(e=>e?l(e):l)})))()}export{a,i,d as n,o as r,u as t};