"use strict";const S=require("react"),C=require("react/jsx-runtime");function P(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const u=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,u.get?u:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=P(S);function h(e,n){const t=c.createContext(n),u=s=>{const{children:o,...r}=s,i=c.useMemo(()=>r,Object.values(r));return C.jsx(t.Provider,{value:i,children:o})};u.displayName=e+"Provider";function a(s){const o=c.useContext(t);if(o)return o;if(n!==void 0)return n;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[u,a]}function j(e,n=[]){let t=[];function u(s,o){const r=c.createContext(o),i=t.length;t=[...t,o];const x=f=>{const{scope:l,children:d,...p}=f,b=l?.[e]?.[i]||r,v=c.useMemo(()=>p,Object.values(p));return C.jsx(b.Provider,{value:v,children:d})};x.displayName=s+"Provider";function m(f,l){const d=l?.[e]?.[i]||r,p=c.useContext(d);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[x,m]}const a=()=>{const s=t.map(o=>c.createContext(o));return function(r){const i=r?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...r,[e]:i}}),[r,i])}};return a.scopeName=e,[u,_(a,...n)]}function _(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const u=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const o=u.reduce((r,{useScope:i,scopeName:x})=>{const f=i(s)[`__scope${x}`];return{...r,...f}},{});return c.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return t.scopeName=n.scopeName,t}function g(e){const n=c.useRef(e);return c.useEffect(()=>{n.current=e}),c.useMemo(()=>(...t)=>n.current?.(...t),[])}var y=globalThis?.document?c.useLayoutEffect:()=>{};exports.createContext2=h;exports.createContextScope=j;exports.useCallbackRef=g;exports.useLayoutEffect2=y;
//# sourceMappingURL=index-kcwFA4Dv.js.map
