1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7633],{7633:function(e,t,r){let s;r.d(t,{a:function(){return useQuery}});var i=r(6474),n=r(7037),u=r(6888),a=r(7506),h=r(3820),o=r(4139),c=class extends a.l{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#r=(0,h.O)(),this.options.experimental_prefetchInRender||this.#r.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#e;#s=void 0;#i=void 0;#n=void 0;#u;#a;#r;#t;#h;#o;#c;#l;#d;#p;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#s.addObserver(this),shouldFetchOnMount(this.#s,this.options)?this.#y():this.updateResult(),this.#R())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.#s,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.#s,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#Q(),this.#s.removeObserver(this)}setOptions(e){let t=this.options,r=this.#s;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,o.Nc)(this.options.enabled,this.#s))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#v(),this.#s.setOptions(this.options),t._defaulted&&!(0,o.VS)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#s,observer:this});let s=this.hasListeners();s&&shouldFetchOptionally(this.#s,r,this.options,t)&&this.#y(),this.updateResult(),s&&(this.#s!==r||(0,o.Nc)(this.options.enabled,this.#s)!==(0,o.Nc)(t.enabled,this.#s)||(0,o.KC)(this.options.staleTime,this.#s)!==(0,o.KC)(t.staleTime,this.#s))&&this.#m();let i=this.#O();s&&(this.#s!==r||(0,o.Nc)(this.options.enabled,this.#s)!==(0,o.Nc)(t.enabled,this.#s)||i!==this.#p)&&this.#g(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return(0,o.VS)(this.getCurrentResult(),r)||(this.#n=r,this.#a=this.options,this.#u=this.#s.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),Reflect.get(e,r))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#s}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#y({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#y(e){this.#v();let t=this.#s.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.ZT)),t}#m(){this.#b();let e=(0,o.KC)(this.options.staleTime,this.#s);if(o.sk||this.#n.isStale||!(0,o.PN)(e))return;let t=(0,o.Kp)(this.#n.dataUpdatedAt,e);this.#l=setTimeout(()=>{this.#n.isStale||this.updateResult()},t+1)}#O(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#s):this.options.refetchInterval)??!1}#g(e){this.#Q(),this.#p=e,!o.sk&&!1!==(0,o.Nc)(this.options.enabled,this.#s)&&(0,o.PN)(this.#p)&&0!==this.#p&&(this.#d=setInterval(()=>{(this.options.refetchIntervalInBackground||i.j.isFocused())&&this.#y()},this.#p))}#R(){this.#m(),this.#g(this.#O())}#b(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#Q(){this.#d&&(clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let r;let s=this.#s,i=this.options,n=this.#n,a=this.#u,c=this.#a,l=e!==s,d=l?e.state:this.#i,{state:p}=e,f={...p},y=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&shouldFetchOnMount(e,t),a=r&&shouldFetchOptionally(e,s,t,i);(n||a)&&(f={...f,...(0,u.z)(p.data,e.options)}),"isRestoring"===t._optimisticResults&&(f.fetchStatus="idle")}let{error:R,errorUpdatedAt:b,status:Q}=f;r=f.data;let v=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===Q){let e;n?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=n.data,v=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#c?.state.data,this.#c):t.placeholderData,void 0!==e&&(Q="success",r=(0,o.oE)(n?.data,e,t),y=!0)}if(t.select&&void 0!==r&&!v){if(n&&r===a?.data&&t.select===this.#h)r=this.#o;else try{this.#h=t.select,r=t.select(r),r=(0,o.oE)(n?.data,r,t),this.#o=r,this.#t=null}catch(e){this.#t=e}}this.#t&&(R=this.#t,r=this.#o,b=Date.now(),Q="error");let m="fetching"===f.fetchStatus,O="pending"===Q,g="error"===Q,I=O&&m,C=void 0!==r,S={status:Q,fetchStatus:f.fetchStatus,isPending:O,isSuccess:"success"===Q,isError:g,isInitialLoading:I,isLoading:I,data:r,dataUpdatedAt:f.dataUpdatedAt,error:R,errorUpdatedAt:b,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdate
1Count:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:m,isRefetching:m&&!O,isLoadingError:g&&!C,isPaused:"paused"===f.fetchStatus,isPlaceholderData:y,isRefetchError:g&&C,isStale:isStale(e,t),refetch:this.refetch,promise:this.#r};if(this.options.experimental_prefetchInRender){let finalizeThenableIfPossible=e=>{"error"===S.status?e.reject(S.error):void 0!==S.data&&e.resolve(S.data)},recreateThenable=()=>{let e=this.#r=S.promise=(0,h.O)();finalizeThenableIfPossible(e)},t=this.#r;switch(t.status){case"pending":e.queryHash===s.queryHash&&finalizeThenableIfPossible(t);break;case"fulfilled":("error"===S.status||S.data!==t.value)&&recreateThenable();break;case"rejected":("error"!==S.status||S.error!==t.reason)&&recreateThenable()}}return S}updateResult(){let e=this.#n,t=this.createResult(this.#s,this.options);this.#u=this.#s.state,this.#a=this.options,void 0!==this.#u.data&&(this.#c=this.#s),(0,o.VS)(t,e)||(this.#n=t,this.#I({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#f.size)return!0;let s=new Set(r??this.#f);return this.options.throwOnError&&s.add("error"),Object.keys(this.#n).some(t=>{let r=this.#n[t]!==e[t];return r&&s.has(t)})})()}))}#v(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#s)return;let t=this.#s;this.#s=e,this.#i=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#R()}#I(e){n.Vr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#s,type:"observerResultsUpdated"})})}};function shouldFetchOnMount(e,t){return!1!==(0,o.Nc)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)||void 0!==e.state.data&&shouldFetchOn(e,t,t.refetchOnMount)}function shouldFetchOn(e,t,r){if(!1!==(0,o.Nc)(t.enabled,e)){let s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&isStale(e,t)}return!1}function shouldFetchOptionally(e,t,r,s){return(e!==t||!1===(0,o.Nc)(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&isStale(e,r)}function isStale(e,t){return!1!==(0,o.Nc)(t.enabled,e)&&e.isStaleByTime((0,o.KC)(t.staleTime,e))}var l=r(7294),d=r(202);r(5893);var p=l.createContext((s=!1,{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s})),useQueryErrorResetBoundary=()=>l.useContext(p);function noop(){}var ensurePreventErrorBoundaryRetry=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&!t.isReset()&&(e.retryOnMount=!1)},useClearResetErrorBoundary=e=>{l.useEffect(()=>{e.clearReset()},[e])},getHasError=({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:i})=>{var n;return e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&void 0===e.data||(n=[e.error,s],"function"==typeof r?r(...n):!!r))},f=l.createContext(!1),useIsRestoring=()=>l.useContext(f);f.Provider;var ensureSuspenseTimers=e=>{let t=e.staleTime;e.suspense&&(e.staleTime="function"==typeof t?(...e)=>Math.max(t(...e),1e3):Math.max(t??1e3,1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))},willFetch=(e,t)=>e.isLoading&&e.isFetching&&!t,shouldSuspend=(e,t)=>e?.suspense&&t.isPending,fetchOptimistic=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function useQuery(e,t){return function(e,t,r){let s=(0,d.NL)(r),i=useIsRestoring(),u=useQueryErrorResetBoundary(),a=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=i?"isRestoring":"optimistic",ensureSuspenseTimers(a),ensurePreventErrorBoundaryRetry(a,u),useClearResetErrorBoundary(u);let h=!s.getQueryCache().get(a.queryHash),[c]=l.useState(()=>new t(s,a)),p=c.getOptimisticResult(a),f=!i&&!1!==e.subscribed;if(l.useSyncExternalStore(l.useCallback(e=>{let t=f?c.subscribe(n.Vr.batchCalls(e)):noop;return c.updateResult(),t},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),l.useEffect(()=>{c.setOptions(a)},[a,c]),shouldSuspend(a,p))throw fetchOptimistic(a,c,u);if(getHasError({result:p,errorResetBoundary:u,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw p.error;if(s.getDefaultOptions().queries?._experimental_afterQuery?.(a,p),a.experimental_prefetchInRender&&!o.sk&&willFetch(p,i)){let e=h?fetchOptimistic(a,c,u):s.getQueryCache().get(a.queryHash)?.promise;e?.catch(noop).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?p:c.trackResult(p)}(e,c,t)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.