"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3992],{17247:(t,e,i)=>{i.d(e,{z:()=>L});var s,r,n,a,h,o,l,u,c,d,p,f,Z,v,b,w,y,O,g,k,R,C,m,S=i(14409);i(72455);var W=i(45520),E=i(14665);i(74384),i(14402);var M=i(9666),j=i(65765),P=i(364),N=i(11805),T=i(21252);function U(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,s)}return i}function D(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?U(Object(i),!0).forEach(function(e){(0,S.Z)(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):U(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function _(t,e){F(t,e),e.add(t)}function Q(t,e,i){F(t,e),e.set(t,i)}function F(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function x(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw TypeError("Private element is not present on this object")}var L=(s=new WeakMap,r=new WeakMap,n=new WeakMap,a=new WeakMap,h=new WeakMap,o=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakMap,Z=new WeakMap,v=new WeakMap,b=new WeakSet,w=new WeakSet,y=new WeakSet,O=new WeakSet,g=new WeakSet,k=new WeakSet,R=new WeakSet,C=new WeakSet,m=new WeakSet,class extends N.l{constructor(t,e){super(),_(this,m),_(this,C),_(this,R),_(this,k),_(this,g),_(this,O),_(this,y),_(this,w),_(this,b),Q(this,s,{writable:!0,value:void 0}),Q(this,r,{writable:!0,value:void 0}),Q(this,n,{writable:!0,value:void 0}),Q(this,a,{writable:!0,value:void 0}),Q(this,h,{writable:!0,value:void 0}),Q(this,o,{writable:!0,value:void 0}),Q(this,l,{writable:!0,value:void 0}),Q(this,u,{writable:!0,value:void 0}),Q(this,c,{writable:!0,value:void 0}),Q(this,d,{writable:!0,value:void 0}),Q(this,p,{writable:!0,value:void 0}),Q(this,f,{writable:!0,value:void 0}),Q(this,Z,{writable:!0,value:void 0}),Q(this,v,{writable:!0,value:new Set}),this.options=e,(0,E.Z)(this,s,t),(0,E.Z)(this,l,null),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(((0,W.Z)(this,r).addObserver(this),$((0,W.Z)(this,r),this.options))?(x(b,this),I).call(this):this.updateResult(),(x(g,this),z).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G((0,W.Z)(this,r),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G((0,W.Z)(this,r),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,(x(k,this),V).call(this),(x(R,this),B).call(this),(0,W.Z)(this,r).removeObserver(this)}setOptions(t,e){let i=this.options,n=(0,W.Z)(this,r);if(this.options=(0,W.Z)(this,s).defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,M.Nc)(this.options.enabled,(0,W.Z)(this,r)))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");(x(C,this),J).call(this),(0,W.Z)(this,r).setOptions(this.options),i._defaulted&&!(0,M.VS)(this.options,i)&&(0,W.Z)(this,s).getQueryCache().notify({type:"observerOptionsUpdated",query:(0,W.Z)(this,r),observer:this});let a=this.hasListeners();a&&X((0,W.Z)(this,r),n,this.options,i)&&(x(b,this),I).call(this),this.updateResult(e),a&&((0,W.Z)(this,r)!==n||(0,M.Nc)(this.options.enabled,(0,W.Z)(this,r))!==(0,M.Nc)(i.enabled,(0,W.Z)(this,r))||(0,M.KC)(this.options.staleTime,(0,W.Z)(this,r))!==(0,M.KC)(i.staleTime,(0,W.Z)(this,r)))&&(x(w,this),K).call(this);let h=(x(y,this),q).call(this);a&&((0,W.Z)(this,r)!==n||(0,M.Nc)(this.options.enabled,(0,W.Z)(this,r))!==(0,M.Nc)(i.enabled,(0,W.Z)(this,r))||h!==(0,W.Z)(this,Z))&&(x(O,this),A).call(this,h)}getOptimisticResult(t){let e=(0,W.Z)(this,s).getQueryCache().build((0,W.Z)(this,s),t),i=this.createResult(e,t);return(0,M.VS)(this.getCurrentResult(),i)||((0,E.Z)(this,a,i),(0,E.Z)(this,o,this.options),(0,E.Z)(this,h,(0,W.Z)(this,r).state)),i}getCurrentResult(){return(0,W.Z)(this,a)}trackResult(t,e){let i={};return Object.keys(t).forEach(s=>{Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),null==e||e(s),t[s])})}),i}trackProp(t){(0,W.Z)(this,v).add(t)}getCurrentQuery(){return(0,W.Z)(this,r)}refetch(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},(function(t){if(null==t)throw TypeError("Cannot destructure "+t)}(t),t));return this.fetch(D({},e))}fetchOptimistic(t){let e=(0,W.Z)(this,s).defaultQueryOptions(t),i=(0,W.Z)(this,s).getQueryCache().build((0,W.Z)(this,s),e);return i.isFetchingOptimistic=!0,i.fetch().then(()=>this.createResult(i,e))}fetch(t){var e;return(x(b,this),I).call(this,D(D({},t),{},{cancelRefetch:null===(e=t.cancelRefetch)||void 0===e||e})).then(()=>(this.updateResult(),(0,W.Z)(this,a)))}createResult(t,e){let i;let s=(0,W.Z)(this,r),p=this.options,f=(0,W.Z)(this,a),Z=(0,W.Z)(this,h),v=(0,W.Z)(this,o),b=t!==s?t.state:(0,W.Z)(this,n),{state:w}=t,y=D({},w),O=!1;if(e._optimisticResults){let i=this.hasListeners(),r=!i&&$(t,e),n=i&&X(t,s,e,p);(r||n)&&(y=D(D({},y),(0,T.z)(w.data,t.options))),"isRestoring"===e._optimisticResults&&(y.fetchStatus="idle")}let{error:g,errorUpdatedAt:k,status:R}=y;if(e.select&&void 0!==y.data){if(f&&y.data===(null==Z?void 0:Z.data)&&e.select===(0,W.Z)(this,u))i=(0,W.Z)(this,c);else try{(0,E.Z)(this,u,e.select),i=e.select(y.data),i=(0,M.oE)(null==f?void 0:f.data,i,e),(0,E.Z)(this,c,i),(0,E.Z)(this,l,null)}catch(t){(0,E.Z)(this,l,t)}}else i=y.data;if(void 0!==e.placeholderData&&void 0===i&&"pending"===R){let t;if(null!=f&&f.isPlaceholderData&&e.placeholderData===(null==v?void 0:v.placeholderData))t=f.data;else{var C;if(t="function"==typeof e.placeholderData?e.placeholderData(null===(C=(0,W.Z)(this,d))||void 0===C?void 0:C.state.data,(0,W.Z)(this,d)):e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),(0,E.Z)(this,l,null)}catch(t){(0,E.Z)(this,l,t)}}void 0!==t&&(R="success",i=(0,M.oE)(null==f?void 0:f.data,t,e),O=!0)}(0,W.Z)(this,l)&&(g=(0,W.Z)(this,l),i=(0,W.Z)(this,c),k=Date.now(),R="error");let m="fetching"===y.fetchStatus,S="pending"===R,j="error"===R,P=S&&m,N=void 0!==i;return{status:R,fetchStatus:y.fetchStatus,isPending:S,isSuccess:"success"===R,isError:j,isInitialLoading:P,isLoading:P,data:i,dataUpdatedAt:y.dataUpdatedAt,error:g,errorUpdatedAt:k,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>b.dataUpdateCount||y.errorUpdateCount>b.errorUpdateCount,isFetching:m,isRefetching:m&&!S,isLoadingError:j&&!N,isPaused:"paused"===y.fetchStatus,isPlaceholderData:O,isRefetchError:j&&N,isStale:Y(t,e),refetch:this.refetch}}updateResult(t){let e=(0,W.Z)(this,a),i=this.createResult((0,W.Z)(this,r),this.options);if((0,E.Z)(this,h,(0,W.Z)(this,r).state),(0,E.Z)(this,o,this.options),void 0!==(0,W.Z)(this,h).data&&(0,E.Z)(this,d,(0,W.Z)(this,r)),(0,M.VS)(i,e))return;(0,E.Z)(this,a,i);let s={};(null==t?void 0:t.listeners)!==!1&&(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,i="function"==typeof t?t():t;if("all"===i||!i&&!(0,W.Z)(this,v).size)return!0;let s=new Set(null!=i?i:(0,W.Z)(this,v));return this.options.throwOnError&&s.add("error"),Object.keys((0,W.Z)(this,a)).some(t=>(0,W.Z)(this,a)[t]!==e[t]&&s.has(t))})()&&(s.listeners=!0),(x(m,this),H).call(this,D(D({},s),t))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&(x(g,this),z).call(this)}});function I(t){(x(C,this),J).call(this);let e=(0,W.Z)(this,r).fetch(this.options,t);return null!=t&&t.throwOnError||(e=e.catch(M.ZT)),e}function K(){(x(k,this),V).call(this);let t=(0,M.KC)(this.options.staleTime,(0,W.Z)(this,r));if(M.sk||(0,W.Z)(this,a).isStale||!(0,M.PN)(t))return;let e=(0,M.Kp)((0,W.Z)(this,a).dataUpdatedAt,t);(0,E.Z)(this,p,setTimeout(()=>{(0,W.Z)(this,a).isStale||this.updateResult()},e+1))}function q(){var t;return null!==(t="function"==typeof this.options.refetchInterval?this.options.refetchInterval((0,W.Z)(this,r)):this.options.refetchInterval)&&void 0!==t&&t}function A(t){(x(R,this),B).call(this),(0,E.Z)(this,Z,t),!M.sk&&!1!==(0,M.Nc)(this.options.enabled,(0,W.Z)(this,r))&&(0,M.PN)((0,W.Z)(this,Z))&&0!==(0,W.Z)(this,Z)&&(0,E.Z)(this,f,setInterval(()=>{(this.options.refetchIntervalInBackground||P.j.isFocused())&&(x(b,this),I).call(this)},(0,W.Z)(this,Z)))}function z(){(x(w,this),K).call(this),(x(O,this),A).call(this,(x(y,this),q).call(this))}function V(){(0,W.Z)(this,p)&&(clearTimeout((0,W.Z)(this,p)),(0,E.Z)(this,p,void 0))}function B(){(0,W.Z)(this,f)&&(clearInterval((0,W.Z)(this,f)),(0,E.Z)(this,f,void 0))}function J(){let t=(0,W.Z)(this,s).getQueryCache().build((0,W.Z)(this,s),this.options);if(t===(0,W.Z)(this,r))return;let e=(0,W.Z)(this,r);(0,E.Z)(this,r,t),(0,E.Z)(this,n,t.state),this.hasListeners()&&(null==e||e.removeObserver(this),t.addObserver(this))}function H(t){j.V.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t((0,W.Z)(this,a))}),(0,W.Z)(this,s).getQueryCache().notify({query:(0,W.Z)(this,r),type:"observerResultsUpdated"})})}function $(t,e){return!1!==(0,M.Nc)(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)||void 0!==t.state.data&&G(t,e,e.refetchOnMount)}function G(t,e,i){if(!1!==(0,M.Nc)(e.enabled,t)){let s="function"==typeof i?i(t):i;return"always"===s||!1!==s&&Y(t,e)}return!1}function X(t,e,i,s){return(t!==e||!1===(0,M.Nc)(s.enabled,t))&&(!i.suspense||"error"!==t.state.status)&&Y(t,i)}function Y(t,e){return!1!==(0,M.Nc)(e.enabled,t)&&t.isStaleByTime((0,M.KC)(e.staleTime,t))}},107:(t,e,i)=>{i.d(e,{_:()=>n}),i(74384);var s=i(37963);i(12505);var r=s.createContext(function(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}()),n=()=>s.useContext(r)},93658:(t,e,i)=>{i.d(e,{pf:()=>r,KJ:()=>a,JN:()=>n});var s=i(37963);i(74384);var r=(t,e)=>{(t.suspense||t.throwOnError)&&!e.isReset()&&(t.retryOnMount=!1)},n=t=>{s.useEffect(()=>{t.clearReset()},[t])},a=t=>{let{result:e,errorResetBoundary:i,throwOnError:s,query:r}=t;return e.isError&&!i.isReset()&&!e.isFetching&&r&&function(t,e){return"function"==typeof t?t(...e):!!t}(s,[e.error,r])}},36600:(t,e,i)=>{i.d(e,{S:()=>n});var s=i(37963),r=s.createContext(!1),n=()=>s.useContext(r);r.Provider},94786:(t,e,i)=>{i.d(e,{A8:()=>r,Ct:()=>s,SB:()=>a,Z$:()=>n,j8:()=>h});var s=(t,e)=>void 0===e.state.data,r=t=>{t.suspense&&("number"!=typeof t.staleTime&&(t.staleTime=1e3),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3)))},n=(t,e)=>t.isLoading&&t.isFetching&&!e,a=(t,e)=>(null==t?void 0:t.suspense)&&e.isPending,h=(t,e,i)=>e.fetchOptimistic(t).catch(()=>{i.clearReset()})},34301:(t,e,i)=>{i.d(e,{r:()=>u}),i(72455),i(74384);var s=i(37963),r=i(65765),n=i(107),a=i(91582),h=i(36600),o=i(93658),l=i(94786);function u(t,e,i){var u,c,d,p;let f=(0,a.NL)(i),Z=(0,h.S)(),v=(0,n._)(),b=f.defaultQueryOptions(t);null===(u=f.getDefaultOptions().queries)||void 0===u||null===(c=u._experimental_beforeQuery)||void 0===c||c.call(u,b),b._optimisticResults=Z?"isRestoring":"optimistic",(0,l.A8)(b),(0,o.pf)(b,v),(0,o.JN)(v);let[w]=s.useState(()=>new e(f,b)),y=w.getOptimisticResult(b);if(s.useSyncExternalStore(s.useCallback(t=>{let e=Z?()=>void 0:w.subscribe(r.V.batchCalls(t));return w.updateResult(),e},[w,Z]),()=>w.getCurrentResult(),()=>w.getCurrentResult()),s.useEffect(()=>{w.setOptions(b,{listeners:!1})},[b,w]),(0,l.SB)(b,y))throw(0,l.j8)(b,w,v);if((0,o.KJ)({result:y,errorResetBoundary:v,throwOnError:b.throwOnError,query:f.getQueryCache().get(b.queryHash)}))throw y.error;return null===(d=f.getDefaultOptions().queries)||void 0===d||null===(p=d._experimental_afterQuery)||void 0===p||p.call(d,b,y),b.notifyOnChangeProps?y:w.trackResult(y)}}}]);