import{a as o}from"./react-CXoDaX02.js";import"./use-sync-external-store-B2sVtNX1.js";function C(t){t()}function m(){let t=null,n=null;return{clear(){t=null,n=null},notify(){C(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){const r=[];let s=t;for(;s;)r.push(s),s=s.next;return r},subscribe(r){let s=!0;const e=n={callback:r,next:null,prev:n};return e.prev?e.prev.next=e:t=e,function(){!s||t===null||(s=!1,e.next?e.next.prev=e.prev:n=e.prev,e.prev?e.prev.next=e.next:t=e.next)}}}}var v={notify(){},get:()=>[]};function w(t,n){let r,s=v,e=0,u=!1;function c(g){b();const h=s.subscribe(g);let d=!1;return()=>{d||(d=!0,h(),p())}}function a(){s.notify()}function i(){l.onStateChange&&l.onStateChange()}function f(){return u}function b(){e++,r||(r=t.subscribe(i),s=m())}function p(){e--,r&&e===0&&(r(),r=void 0,s.clear(),s=v)}function S(){u||(u=!0,b())}function x(){u&&(u=!1,p())}const l={addNestedSub:c,notifyNestedSubs:a,handleChangeWrapper:i,isSubscribed:f,trySubscribe:S,tryUnsubscribe:x,getListeners:()=>s};return l}var E=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",N=E(),L=()=>typeof navigator<"u"&&navigator.product==="ReactNative",M=L(),O=()=>N||M?o.useLayoutEffect:o.useEffect,R=O();function y(t,n){return t===n?t!==0||n!==0||1/t===1/n:t!==t&&n!==n}function q(t,n){if(y(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;const r=Object.keys(t),s=Object.keys(n);if(r.length!==s.length)return!1;for(let e=0;e<r.length;e++)if(!Object.prototype.hasOwnProperty.call(n,r[e])||!y(t[r[e]],n[r[e]]))return!1;return!0}var U=Symbol.for("react-redux-context"),k=typeof globalThis<"u"?globalThis:{};function P(){if(!o.createContext)return{};const t=k[U]??=new Map;let n=t.get(o.createContext);return n||(n=o.createContext(null),t.set(o.createContext,n)),n}var I=P();function T(t){const{children:n,context:r,serverState:s,store:e}=t,u=o.useMemo(()=>{const i=w(e);return{store:e,subscription:i,getServerState:s?()=>s:void 0}},[e,s]),c=o.useMemo(()=>e.getState(),[e]);R(()=>{const{subscription:i}=u;return i.onStateChange=i.notifyNestedSubs,i.trySubscribe(),c!==e.getState()&&i.notifyNestedSubs(),()=>{i.tryUnsubscribe(),i.onStateChange=void 0}},[u,c]);const a=r||I;return o.createElement(a.Provider,{value:u},n)}var K=T;export{K as P,q as s};
