import{r as d}from"./CTjT7uj6.js";class M{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const n={listener:t};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const q=typeof window>"u"||"Deno"in window;function ae(){}function he(e,t){return typeof e=="function"?e(t):e}function ye(e){return typeof e=="number"&&e>=0&&e!==1/0}function de(e,t){return e.filter(n=>!t.includes(n))}function pe(e,t,n){const r=e.slice(0);return r[t]=n,r}function ve(e,t){return Math.max(e+(t||0)-Date.now(),0)}function we(e,t,n){return b(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function be(e,t,n){return b(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function me(e,t,n){return b(e)?[{...t,queryKey:e},n]:[e||{},t]}function Ee(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:c,stale:f}=e;if(b(c)){if(r){if(t.queryHash!==$(c,t.options))return!1}else if(!R(t.queryKey,c))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||typeof i<"u"&&i!==t.state.fetchStatus||s&&!s(t))}function Se(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:s}=e;if(b(s)){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(s))return!1}else if(!R(t.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function $(e,t){return((t==null?void 0:t.queryKeyHashFn)||x)(e)}function x(e){return JSON.stringify(e,(t,n)=>O(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function R(e,t){return g(e,t)}function g(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!g(e[n],t[n])):!1}function D(e,t){if(e===t)return e;const n=L(e)&&L(t);if(n||O(e)&&O(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),s=i.length,c=n?[]:{};let f=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!P(n)||!n.hasOwnProperty("isPrototypeOf"))}function P(e){return Object.prototype.toString.call(e)==="[object Object]"}function b(e){return Array.isArray(e)}function k(e){return new Promise(t=>{setTimeout(t,e)})}function K(e){k(0).then(e)}function xe(){if(typeof AbortController=="function")return new AbortController}function Oe(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?D(e,t):t}class J extends M{constructor(){super(),this.setup=t=>{if(!q&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const G=new J,Q=["online","offline"];class W extends M{constructor(){super(),this.setup=t=>{if(!q&&window.addEventListener){const n=()=>t();return Q.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Q.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const N=new W;function X(e){return Math.min(1e3*2**e,3e4)}function Y(e){return(e??"online")==="online"?N.isOnline():!0}class U{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Fe(e){return e instanceof U}function je(e){let t=!1,n=0,r=!1,i,s,c;const f=new Promise((u,l)=>{s=u,c=l}),a=u=>{r||(m(new U(u)),e.abort==null||e.abort())},y=()=>{t=!0},o=()=>{t=!1},h=()=>!G.isFocused()||e.networkMode!=="always"&&!N.isOnline(),_=u=>{r||(r=!0,e.onSuccess==null||e.onSuccess(u),i==null||i(),s(u))},m=u=>{r||(r=!0,e.onError==null||e.onError(u),i==null||i(),c(u))},F=()=>new Promise(u=>{i=l=>{const v=r||!h();return v&&u(l),v},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),E=()=>{if(r)return;let u;try{u=e.fn()}catch(l){u=Promise.reject(l)}Promise.resolve(u).then(_).catch(l=>{var v,j;if(r)return;const w=(v=e.retry)!=null?v:3,S=(j=e.retryDelay)!=null?j:X,B=typeof S=="function"?S(n,l):S,H=w===!0||typeof w=="number"&&n{if(h())return F()}).then(()=>{t?m(l):E()})})};return Y(e.networkMode)?E():F().then(E),{promise:f,cancel:a,continue:()=>(i==null?void 0:i())?f:Promise.resolve(),cancelRetry:y,continueRetry:o}}function Z(){let e=[],t=0,n=o=>{o()},r=o=>{o()};const i=o=>{let h;t++;try{h=o()}finally{t--,t||f()}return h},s=o=>{t?e.push(o):K(()=>{n(o)})},c=o=>(...h)=>{s(()=>{o(...h)})},f=()=>{const o=e;e=[],o.length&&K(()=>{r(()=>{o.forEach(h=>{n(h)})})})};return{batch:i,batchCalls:c,schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o}}}const Le=Z();var z={exports:{}},I={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var p=d;function ee(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var te=typeof Object.is=="function"?Object.is:ee,ne=p.useState,re=p.useEffect,ie=p.useLayoutEffect,se=p.useDebugValue;function oe(e,t){var n=t(),r=ne({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return ie(function(){i.value=n,i.getSnapshot=t,C(i)&&s({inst:i})},[e,n,t]),re(function(){return C(i)&&s({inst:i}),e(function(){C(i)&&s({inst:i})})},[e]),se(n),n}function C(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!te(e,n)}catch{return!0}}function ue(e,t){return t()}var ce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ue:oe;I.useSyncExternalStore=p.useSyncExternalStore!==void 0?p.useSyncExternalStore:ce;z.exports=I;var le=z.exports;const Pe=le.useSyncExternalStore,A=d.createContext(void 0),T=d.createContext(!1);function V(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=A),window.ReactQueryClientContext):A)}const Ke=({context:e}={})=>{const t=d.useContext(V(e,d.useContext(T)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qe=({client:e,children:t,context:n,contextSharing:r=!1})=>{d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=V(n,r);return d.createElement(T.Provider,{value:!n&&r},d.createElement(i.Provider,{value:e},t))};function Ae(e,t){return typeof e=="function"?e(...t):!!e}export{R as A,le as B,Qe as Q,M as S,Pe as a,Ae as b,q as c,de as d,je as e,Y as f,Oe as g,ae as h,ye as i,xe as j,Fe as k,$ as l,me as m,Le as n,Ee as o,be as p,Se as q,pe as r,Ce as s,ve as t,Ke as u,G as v,N as w,we as x,he as y,x as z};