PageSourceSearch

https://www.baopals.com/_next/static/chunks/2qte33w3kt2q-.js?dpl=dpl_3qa7ZnDoVBzyyN5yCeNqh1i1vdq6

js baopals.com collected 2026-10-01 23:43:21 UTC 73,385 bytes, 8 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="11b30d66-f52d-cba7-26e8-b6c8147cff82")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,310955,e=>{"use strict";let t,r,s,i,n,a,o,u,l;e.i(247167);var c,h,d=e.i(843476),p=e.i(482568),f=e.i(839980),y=e.i(912598);function m(e){let t={subscribe(t){let r=null,s=!1,i=!1,n=!1;function a(){if(null===r){n=!0;return}!i&&(i=!0,"function"==typeof r?r():r&&r.unsubscribe())}return r=e({next(e){s||t.next?.(e)},error(e){s||(s=!0,t.error?.(e),a())},complete(){s||(s=!0,t.complete?.(),a())}}),n&&a(),{unsubscribe:a}},pipe:(...e)=>e.reduce(b,t)};return t}function b(e,t){return t(e)}function g(e){return m(t=>(function t(r=0,s=e.op){let i=e.links[r];if(!i)throw Error("No more links to execute - did you forget to add an ending link?");return i({op:s,next:e=>t(r+1,e)})})().subscribe(t))}Symbol();var v=e.i(15241);e.i(972468),e.i(685447),e.i(9070),Symbol(),Symbol("ping"),Symbol();var w=e.i(877485);function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.i(195742),e.i(754555),e.i(37367);class C extends Error{static from(e,t={}){return e instanceof C?(t.meta&&(e.meta={...e.meta,...t.meta}),e):(0,v.isObject)(e)&&(0,v.isObject)(e.error)&&"number"==typeof e.error.code&&"string"==typeof e.error.message?new C(e.error.message,{...t,result:e}):new C("string"==typeof e?e:(0,v.isObject)(e)&&"string"==typeof e.message?e.message:"Unknown error",{...t,cause:e})}constructor(e,t){const r=t?.cause;super(e,{cause:r}),O(this,"cause",void 0),O(this,"shape",void 0),O(this,"data",void 0),O(this,"meta",void 0),this.meta=t?.meta,this.cause=r,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,C.prototype)}}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class S{$request(e){return g({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(e=>{let t=0,r=null,s=[];return m(i=>(t++,s.push(i),r||(r=e.subscribe({next(e){for(let t of s)t.next?.(e)},error(e){for(let t of s)t.error?.(e)},complete(){for(let e of s)e.complete?.()}})),{unsubscribe(){if(0==--t&&r){let e=r;r=null,e.unsubscribe()}let e=s.findIndex(e=>e===i);e>-1&&s.splice(e,1)}}))})}async requestAsPromise(e){try{let t,r=this.$request(e);return(await (t=new AbortController,new Promise((e,s)=>{let i=!1;function n(){i||(i=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{s(t.signal.reason)});let a=r.subscribe({next(t){i=!0,e(t),n()},error(e){s(e)},complete(){t.abort(),n()}})}))).result.data}catch(e){throw C.from(e)}}query(e,t,r){return this.requestAsPromise({type:"query",path:e,input:t,context:r?.context,signal:r?.signal})}mutation(e,t,r){return this.requestAsPromise({type:"mutation",path:e,input:t,context:r?.context,signal:r?.signal})}subscription(e,t,r){return this.$request({type:"subscription",path:e,input:t,context:r.context,signal:r.signal}).subscribe({next(e){switch(e.result.type){case"state":r.onConnectionStateChange?.(e.result);break;case"started":r.onStarted?.({context:e.context});break;case"stopped":r.onStopped?.();break;case"data":case void 0:r.onData?.(e.result.data)}},error(e){r.onError?.(e)},complete(){r.onComplete?.()}})}constructor(e){P(this,"links",void 0),P(this,"runtime",void 0),P(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}}var R=e.i(94802);let Q=Symbol.for("trpc_untypedClient"),E={query:"query",mutate:"mutation",subscribe:"subscription"};function q(e){let t=(0,R.createRecursiveProxy)(({path:t,args:r})=>{let s=[...t],i=E[s.pop()],n=s.join(".");return e[i](n,...r)});return(0,R.createFlatProxy)(r=>r===Q?e:t[r])}function x(e){return q(new S(e))}let k=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function T(e){let t=null,r=null;function s(){let s=function(t){let r=[[]],s=0;for(;;){let i=t[s];if(!i)break;let n=r[r.length-1];if(i.aborted){i.reject?.(Error("Aborted")),s++;continue}if(e.validate(n.concat(i).map(e=>e.key))){n.push(i),s++;continue}if(0===n.length){i.reject?.(Error("Input is too big for a single dispatch")),s++;continue}r.push([])}return r}(t);for(let i of(clearTimeout(r),r=null,t=null,s)){if(!i.length)continue;let t={items:i};for(let e of i)e.batch=t;e.fetch(t.items.map(e=>e.key)).then(async e=>{for(let r of(await Promise.all(e.map(async(e,r)=>{let s=t.items[r];try{let t=await Promise.resolve(e);s.resolve?.(t)}catch(e){s.reject?.(e)}s.batch=null,s.reject=null,s.resolve=null})),t.items))r.reject?.(Error("Missing result")),r.batch=null}).catch(e=>{for(let r of t.items)r.reject?.(e),r.batch=null})}}return{load:function(e){let i={aborted:!1,key:e,batch:null,resolve:k,reject:k},n=new Promise((e,r)=>{i.reject=r,i.resolve=e,t??(t=[]),t.push(i)});return r??(r=setTimeout(s)),n}}}function D(e){var t;return{url:e.url.toString(),fetch:e.fetch,transformer:(t=e.transformer)?"input"in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}},methodOverride:e.methodOverride}}let I={query:"GET",mutation:"POST",subscription:"PATCH"};function M(e){return"input"in e?e.transformer.input.serialize(e.input):function(e){let t={};for(let r=0;r<e.length;r++){let s=e[r];t[r]=s}return t}(e.inputs.map(t=>e.transformer.input.serialize(t)))}let A=e=>{let t=e.url.split("?"),r=t[0].replace(/\/$/,"")+"/"+e.path,s=[];if(t[1]&&s.push(t[1]),"inputs"in e&&s.push("batch=1"),"query"===e.type||"subscription"===e.type){let t=M(e);void 0!==t&&"POST"!==e.methodOverride&&s.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return s.length&&(r+="?"+s.join("&")),r},F=e=>{if("query"===e.type&&"POST"!==e.methodOverride)return;let t=M(e);return void 0!==t?JSON.stringify(t):void 0},U=e=>L({...e,contentTypeHeader:"application/json",getUrl:A,getBody:F});
2class j extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}}async function K(e){var t=e.signal;if(t?.aborted){if(t.throwIfAborted?.(),"u">typeof DOMException)throw new DOMException("AbortError","AbortError");throw new j}let r=e.getUrl(e),s=e.getBody(e),{type:i}=e,n=await (async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...n};return(function(e){if(e)return e;if("u">typeof window&&"function"==typeof window.fetch)return window.fetch;if("u">typeof globalThis&&"function"==typeof globalThis.fetch)return globalThis.fetch;throw Error("No fetch implementation found")})(e.fetch)(r,{method:e.methodOverride??I[i],signal:e.signal,body:s,headers:a})}async function L(e){let t={},r=await K(e);t.response=r;let s=await r.json();return t.responseJSON=s,{json:s,meta:t}}function N(e){let t=D(e),r=e.maxURLLength??1/0,s=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(r===1/0&&s===1/0)return!0;if(e.length>s)return!1;let n=e.map(e=>e.path).join(","),a=e.map(e=>e.input);return A({...t,type:i,path:n,inputs:a,signal:null}).length<=r},async fetch(r){let s=r.map(e=>e.path).join(","),n=r.map(e=>e.input),a=function(...e){let t=new AbortController,r=e.length,s=0,i=()=>{++s===r&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener("abort",i,{once:!0});return t.signal}(...r.map(e=>e.signal)),o=await U({...t,path:s,inputs:n,type:i,headers:()=>e.headers?"function"==typeof e.headers?e.headers({opList:r}):e.headers:{},signal:a});return(Array.isArray(o.json)?o.json:r.map(()=>o.json)).map(e=>({meta:o.meta,json:e}))}}),n={query:T(i("query")),mutation:T(i("mutation"))};return({op:e})=>m(r=>{let s;if("subscription"===e.type)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");return n[e.type].load(e).then(e=>{s=e;let i=(0,w.transformResult)(e.json,t.transformer.output);i.ok?(r.next({context:e.meta,result:i.result}),r.complete()):r.error(C.from(i.error,{meta:e.meta}))}).catch(e=>{r.error(C.from(e,{meta:s?.meta}))}),()=>{}})}}let _=(e,...t)=>"function"==typeof e?e(...t):e;async function z(e){let t=await _(e.url);if(!e.connectionParams)return t;let r=t.includes("?")?"&":"?";return t+`${r}connectionParams=1`}async function H(e){return JSON.stringify({method:"connectionParams",data:await _(e)})}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class G{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++G.connectCount;let e=z(this.urlOptions).then(e=>new this.WebSocketPonyfill(e));this.openPromise=e.then(async e=>{this.ws=e,e.addEventListener("message",function({data:e}){"PING"===e&&this.send("PONG")}),this.keepAliveOpts.enabled&&function(e,{intervalMs:t,pongTimeoutMs:r}){let s,i;function n(){s=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},r)},t)}e.addEventListener("open",n),e.addEventListener("message",({data:e})=>{clearTimeout(s),n(),"PONG"===e&&(clearTimeout(i),clearTimeout(s),n())}),e.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}(e,this.keepAliveOpts),e.addEventListener("close",()=>{this.ws===e&&(this.ws=null)}),await function(e){let t,r,{promise:s,resolve:i,reject:n}={promise:new Promise((e,s)=>{t=e,r=s}),resolve:t,reject:r};return e.addEventListener("open",()=>{e.removeEventListener("error",n),i()}),e.addEventListener("error",n),s}(e),this.urlOptions.connectionParams&&e.send(await H(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(e){if(B(this,"id",++G.connectCount),B(this,"WebSocketPonyfill",void 0),B(this,"urlOptions",void 0),B(this,"keepAliveOpts",void 0),B(this,"wsObservable",function(){let e=null,t=[],r=m(r=>
2(void 0!==e&&r.next(e),t.push(r),()=>{t.splice(t.indexOf(r),1)}));return r.next=r=>{if(e!==r)for(let s of(e=r,t))s.next(r)},r.get=()=>e,r}()),B(this,"openPromise",null),this.WebSocketPonyfill=e.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}}B(G,"connectCount",0),e.i(516943);let V={query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},W={query:["\x1b[30;46m","\x1b[97;46m"],mutation:["\x1b[30;45m","\x1b[97;45m"],subscription:["\x1b[30;42m","\x1b[97;42m"]},$={query:["\x1b[1;30;46m","\x1b[1;97;46m"],mutation:["\x1b[1;30;45m","\x1b[1;97;45m"],subscription:["\x1b[1;30;42m","\x1b[1;97;42m"]};function J(e){return Array.isArray(e)?e:[e]}function X(e){return t=>{let r=J(e.true).map(e=>e(t)),s=J(e.false).map(e=>e(t));return t=>m(i=>{let n=e.condition(t.op)?r:s;return g({op:t.op,links:n}).subscribe(i)})}}var Z=e.i(619273);function Y(e,t,r){let s=e.flatMap(e=>e.split("."));if(!t&&(!r||"any"===r))return s.length?[s]:[];if("infinite"===r&&(0,v.isObject)(t)&&("direction"in t||"cursor"in t)){let{cursor:e,direction:r,...i}=t;return[s,{input:i,type:"infinite"}]}return[s,{...void 0!==t&&t!==Z.skipToken&&{input:t},...r&&"any"!==r&&{type:r}}]}function ee(e){return Y(e,void 0,"any")}var et=e.i(271645);let er=["client","ssrContext","ssrState","abortOnUnmount"],es=et.createContext?.(null);var ei=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},en=new class extends ei{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!Z.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}},ea=(t=[],r=0,s=e=>{e()},i=e=>{e()},n=e=>setTimeout(e,0),{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{i(()=>{e.forEach(e=>{s(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{s(e)})},setNotifyFunction:e=>{s=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{n=e}}),eo=new class extends ei{#s=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!Z.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#s!==e&&(this.#s=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#s}},eu=e.i(793803);function el(e){return Math.min(1e3*2**e,3e4)}function ec(e){return(e??"online")!=="online"||eo.isOnline()}var eh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ed(e){return e instanceof eh}function ep(e){let t,r=!1,s=0,i=!1,n=(0,eu.pendingThenable)(),a=()=>en.isFocused()&&("always"===e.networkMode||eo.isOnline())&&e.canRun(),o=()=>ec(e.networkMode)&&e.canRun(),u=r=>{i||(i=!0,e.onSuccess?.(r),t?.(),n.resolve(r))},l=r=>{i||(i=!0,e.onError?.(r),t?.(),n.reject(r))},c=()=>new Promise(r=>{t=e=>{(i||a())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,i||e.onContinue?.()}),h=()=>{let t;if(i)return;let n=0===s?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(u).catch(t=>{if(i)return;let n=e.retry??3*!Z.isServer,o=e.retryDelay??el,u="function"==typeof o?o(s,t):o,d=!0===n||"number"==typeof n&&s<n||"function"==typeof n&&n(s,t);
2r||!d?l(t):(s++,e.onFail?.(s,t),(0,Z.sleep)(u).then(()=>a()?void 0:c()).then(()=>{r?l(t):h()}))})};return{promise:n,cancel:t=>{i||(l(new eh(t)),e.abort?.())},continue:()=>(t?.(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?h():c().then(h),n)}}var ef=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,Z.isValidTimeout)(this.gcTime)&&(this.#i=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Z.isServer?1/0:3e5))}clearGcTimeout(){this.#i&&(clearTimeout(this.#i),this.#i=void 0)}},ey=class extends ef{#n;#a;#o;#u;#l;#c;#h;constructor(e){super(),this.#h=!1,this.#c=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#o=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#n=function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#n,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){this.options={...this.#c,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#o.remove(this)}setData(e,t){let r=(0,Z.replaceData)(this.state.data,e,this.options);return this.#d({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#d({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(Z.noop).catch(Z.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#n)}isActive(){return this.observers.some(e=>!1!==(0,Z.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Z.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,Z.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,Z.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#o.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#d({type:"invalidate"})}fetch(e,t){let r;if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,s.signal)})},n=()=>{let e,r=(0,Z.ensureQueryFn)(this.options,t),s=(i(e={client:this.#u,queryKey:this.queryKey,meta:this.meta}),e);return(this.#h=!1,this.options.persister)?this.options.persister(r,s,this):r(s)},a=(i(r={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:n}),r);this.options.behavior?.onFetch(a,this),this.#a=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#d({type:"fetch",meta:a.fetchOptions?.meta});let o=e=>{ed(e)&&e.silent||this.#d({type:"error",error:e}),ed(e)||(this.#o.config.onError?.(e,this),this.#o.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#l=ep({initialPromise:t?.initialPromise,fn:a.fetchFn,abort:s.abort.bind(s),onSuccess:e=>{if(void 0===e)return void o(Error(`${this.queryHash} data is undefined`));try{this.setData(e)}catch(e){o(e);return}this.#o.config.onSuccess?.(e,this),this.#o.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:o,onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#l.start()}#d(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...em(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;if(ed(r)&&r.revert&&this.#a)return{...this.#a,fetchStatus:"idle"};
2return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),ea.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#o.notify({query:this,type:"updated",action:e})})}};function em(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ec(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var eb=class extends ei{constructor(e,t){super(),this.options=t,this.#u=e,this.#p=null,this.#f=(0,eu.pendingThenable)(),this.options.experimental_prefetchInRender||this.#f.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#u;#y=void 0;#m=void 0;#b=void 0;#g;#v;#f;#p;#w;#O;#C;#P;#S;#R;#Q=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#y.addObserver(this),eg(this.#y,this.options)?this.#E():this.updateResult(),this.#q())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ev(this.#y,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ev(this.#y,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#k(),this.#y.removeObserver(this)}setOptions(e){let t=this.options,r=this.#y;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,Z.resolveEnabled)(this.options.enabled,this.#y))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#T(),this.#y.setOptions(this.options),t._defaulted&&!(0,Z.shallowEqualObjects)(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#y,observer:this});let s=this.hasListeners();s&&ew(this.#y,r,this.options,t)&&this.#E(),this.updateResult(),s&&(this.#y!==r||(0,Z.resolveEnabled)(this.options.enabled,this.#y)!==(0,Z.resolveEnabled)(t.enabled,this.#y)||(0,Z.resolveStaleTime)(this.options.staleTime,this.#y)!==(0,Z.resolveStaleTime)(t.staleTime,this.#y))&&this.#D();let i=this.#I();s&&(this.#y!==r||(0,Z.resolveEnabled)(this.options.enabled,this.#y)!==(0,Z.resolveEnabled)(t.enabled,this.#y)||i!==this.#R)&&this.#M(i)}getOptimisticResult(e){var t,r;let s=this.#u.getQueryCache().build(this.#u,e),i=this.createResult(s,e);return t=this,r=i,(0,Z.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#b=i,this.#v=this.options,this.#g=this.#y.state),i}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),Reflect.get(e,r))})}trackProp(e){this.#Q.add(e)}getCurrentQuery(){return this.#y}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#E({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#E(e){this.#T();let t=this.#y.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Z.noop)),t}#D(){this.#x();let e=(0,Z.resolveStaleTime)(this.options.staleTime,this.#y);if(Z.isServer||this.#b.isStale||!(0,Z.isValidTimeout)(e))return;let t=(0,Z.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#P=setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#I(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#y):this.options.refetchInterval)??!1}#M(e){this.#k(),this.#R=e,!Z.isServer&&!1!==(0,Z.resolveEnabled)(this.options.enabled,this.#y)&&(0,Z.isValidTimeout)(this.#R)&&0!==this.#R&&(this.#S=setInterval(()=>{(this.options.refetchIntervalInBackground||en.isFocused())&&this.#E()},this.#R))}#q(){this.#D(),this.#M(this.#I())}#x(){this.#P&&(clearTimeout(this.#P),this.#P=void 0)}#k(){this.#S&&(clearInterval(this.#S),this.#S=void 0)}createResult(e,t){let r,s=this.#y,i=this.options,n=this.#b,a=this.#g,o=this.#v,u=e!==s?e.state:this.#m,{state:l}=e,c={...l},h=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&eg(e,t),a=r&&ew(e,s,t,i);(n||a)&&(c={...c,...em(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:f}=c;r=c.data;let y=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===f){let e;n?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=n.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#C?.state.data,this.#C):t.placeholderData,void 0!==e&&(f="success",r=(0,Z.replaceData)(n?.data,e,t),h=!0)}if(t.select&&void 0!==r&&!y)if(n&&r===a?.data&&t.select===this.#w)r=this.#O;else try{this.#w=t.select,r=t.select(r),r=(0,Z.replaceData)(n?.data,r,t),this.#O=r,this.#p=null}catch(e){this.#p=e}this.#p&&(d=this.#p,r=this.#O,p=Date.now(),f="error");let m="fetching"===c.fetchStatus,b="pending"===f,g="error"===f,v=b&&m,w=void 0!==r,O={status:f,fetchStatus:c.fetchStatus,isPending:b,isSuccess:"success"===f,isError:g,isInitialLoading:v,isLoading:v,data:r,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdate
2Count:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!b,isLoadingError:g&&!w,isPaused:"paused"===c.fetchStatus,isPlaceholderData:h,isRefetchError:g&&w,isStale:eO(e,t),refetch:this.refetch,promise:this.#f};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===O.status?e.reject(O.error):void 0!==O.data&&e.resolve(O.data)},r=()=>{t(this.#f=O.promise=(0,eu.pendingThenable)())},i=this.#f;switch(i.status){case"pending":e.queryHash===s.queryHash&&t(i);break;case"fulfilled":("error"===O.status||O.data!==i.value)&&r();break;case"rejected":("error"!==O.status||O.error!==i.reason)&&r()}}return O}updateResult(){let e=this.#b,t=this.createResult(this.#y,this.options);if(this.#g=this.#y.state,this.#v=this.options,void 0!==this.#g.data&&(this.#C=this.#y),(0,Z.shallowEqualObjects)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#Q.size)return!0;let s=new Set(r??this.#Q);return this.options.throwOnError&&s.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&s.has(t))};this.#A({listeners:r()})}#T(){let e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#y)return;let t=this.#y;this.#y=e,this.#m=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#q()}#A(e){ea.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#u.getQueryCache().notify({query:this.#y,type:"observerResultsUpdated"})})}};function eg(e,t){return!1!==(0,Z.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&ev(e,t,t.refetchOnMount)}function ev(e,t,r){if(!1!==(0,Z.resolveEnabled)(t.enabled,e)&&"static"!==(0,Z.resolveStaleTime)(t.staleTime,e)){let s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&eO(e,t)}return!1}function ew(e,t,r,s){return(e!==t||!1===(0,Z.resolveEnabled)(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&eO(e,r)}function eO(e,t){return!1!==(0,Z.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,Z.resolveStaleTime)(t.staleTime,e))}function eC(e){return{onFetch:(t,r)=>{let s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],a=t.state.data?.pageParams||[],o={pages:[],pageParams:[]},u=0,l=async()=>{let r=!1,l=(0,Z.ensureQueryFn)(t.options,t.fetchOptions),c=async(e,s,i)=>{let n;if(r)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);let a=(Object.defineProperty(n={client:t.client,queryKey:t.queryKey,pageParam:s,direction:i?"backward":"forward",meta:t.options.meta},"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),n),o=await l(a),{maxPages:u}=t.options,c=i?Z.addToStart:Z.addToEnd;return{pages:c(e.pages,o,u),pageParams:c(e.pageParams,s,u)}};if(i&&n.length){let e="backward"===i,t={pages:n,pageParams:a},r=(e?eS:eP)(s,t);o=await c(t,r,e)}else{let t=e??n.length;do{let e=0===u?a[0]??s.initialPageParam:eP(s,o);if(u>0&&null==e)break;o=await c(o,e),u++}while(u<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function eP(e,{pages:t,pageParams:r}){let s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function eS(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var eR=class extends eb{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:eC()})}getOptimisticResult(e){return e.behavior=eC(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var r,s;let{state:i}=e,n=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:u,isRefetchError:l}
2=n,c=i.fetchMeta?.fetchMore?.direction,h=u&&"forward"===c,d=a&&"forward"===c,p=u&&"backward"===c,f=a&&"backward"===c;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:!!(r=i.data)&&null!=eP(t,r),hasPreviousPage:!!(s=i.data)&&!!t.getPreviousPageParam&&null!=eS(t,s),isFetchNextPageError:h,isFetchingNextPage:d,isFetchPreviousPageError:p,isFetchingPreviousPage:f,isRefetchError:l&&!h&&!p,isRefetching:o&&!d&&!f}}},eQ=et.createContext((o=!1,{clearReset:()=>{o=!1},reset:()=>{o=!0},isReset:()=>o})),eE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&!t.isReset()&&(e.retryOnMount=!1)},eq=e=>{et.useEffect(()=>{e.clearReset()},[e])},ex=({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&void 0===e.data||(0,Z.shouldThrowError)(r,[e.error,s])),ek=et.createContext(!1);ek.Provider;var eT=(e,t)=>void 0===t.state.data,eD=e=>{if(e.suspense){let t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}},eI=(e,t)=>e.isLoading&&e.isFetching&&!t,eM=(e,t)=>e?.suspense&&t.isPending,eA=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function eF(e,t,r){let s=et.useContext(ek),i=et.useContext(eQ),n=(0,y.useQueryClient)(r),a=n.defaultQueryOptions(e);
2n.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=s?"isRestoring":"optimistic",eD(a),eE(a,i),eq(i);let o=!n.getQueryCache().get(a.queryHash),[u]=et.useState(()=>new t(n,a)),l=u.getOptimisticResult(a),c=!s&&!1!==e.subscribed;if(et.useSyncExternalStore(et.useCallback(e=>{let t=c?u.subscribe(ea.batchCalls(e)):Z.noop;return u.updateResult(),t},[u,c]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),et.useEffect(()=>{u.setOptions(a)},[a,u]),eM(a,l))throw eA(a,u,i);if(ex({result:l,errorResetBoundary:i,throwOnError:a.throwOnError,query:n.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw l.error;if(n.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!Z.isServer&&eI(l,s)){let e=o?eA(a,u,i):n.getQueryCache().get(a.queryHash)?.promise;e?.catch(Z.noop).finally(()=>{u.updateResult()})}return a.notifyOnChangeProps?l:u.trackResult(l)}var eU=class extends ef{#F;#U;#l;constructor(e){super(),this.mutationId=e.mutationId,this.#U=e.mutationCache,this.#F=[],this.state=e.state||ej(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#F.includes(e)||(this.#F.push(e),this.clearGcTimeout(),this.#U.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#F=this.#F.filter(t=>t!==e),this.scheduleGc(),this.#U.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#F.length||("pending"===this.state.status?this.scheduleGc():this.#U.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#d({type:"continue"})};this.#l=ep({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#d({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#d({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#U.canRun(this)});let r="pending"===this.state.status,s=!this.#l.canStart();try{if(r)t();else{this.#d({type:"pending",variables:e,isPaused:s}),await this.#U.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#d({type:"pending",context:t,variables:e,isPaused:s})}let i=await this.#l.start();return await this.#U.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#U.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#d({type:"success",data:i}),i}catch(t){try{throw await this.#U.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#U.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#d({type:"error",error:t})}}finally{this.#U.runNext(this)}}#d(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),ea.batch(()=>{this.#F.forEach(t=>{t.onMutationUpdate(e)}),this.#U.notify({mutation:this,type:"updated",action:e})})}};function ej(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var eK=class extends ei{#u;#b=void 0;#j;#K;constructor(e,t){super(),this.#u=e,this.setOptions(t),this.bindMethods(),this.#L()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#u.defaultMutationOptions(e),(0,Z.shallowEqualObjects)(this.options,t)||this.#u.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#j,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,Z.hashKey)(t.mutationKey)!==(0,Z.hashKey)(this.options.mutationKey)?this.reset():this.#j?.state.status==="pending"&&this.#j.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#j?.removeObserver(this)}onMutationUpdate(e){this.#L(),this.#A(e)}getCurrentResult(){return this.#b}reset(){this.#j?.removeObserver(this),this.#j=void 0,this.#L(),this.#A()}mutate(e,t){return this.#K=t,this.#j?.removeObserver(this),this.#j=this.#u.getMutationCache().build(this.#u,this.options),this.#j.addObserver(this),this.#j.execute(e)}#L(){let e=this.#j?.state??ej();this.#b={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#A(e){ea.batch(()=>
2{if(this.#K&&this.hasListeners()){let t=this.#b.variables,r=this.#b.context;e?.type==="success"?(this.#K.onSuccess?.(e.data,t,r),this.#K.onSettled?.(e.data,null,t,r)):e?.type==="error"&&(this.#K.onError?.(e.error,t,r),this.#K.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach(e=>{e(this.#b)})})}};function eL(e,t){let r=new Set(t);return e.filter(e=>!r.has(e))}var eN=class extends ei{#u;#N;#_;#z;#F;#H;#B;#G;#V=[];constructor(e,t,r){super(),this.#u=e,this.#z=r,this.#_=[],this.#F=[],this.#N=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#F.forEach(e=>{e.subscribe(t=>{this.#W(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#F.forEach(e=>{e.destroy()})}setQueries(e,t){this.#_=e,this.#z=t,ea.batch(()=>{let e=this.#F,t=this.#$(this.#_);this.#V=t,t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let r=t.map(e=>e.observer),s=r.map(e=>e.getCurrentResult()),i=r.some((t,r)=>t!==e[r]);e.length===r.length&&!i||(this.#F=r,this.#N=s,this.hasListeners()&&(eL(e,r).forEach(e=>{e.destroy()}),eL(r,e).forEach(e=>{e.subscribe(t=>{this.#W(e,t)})}),this.#A()))})}getCurrentResult(){return this.#N}getQueries(){return this.#F.map(e=>e.getCurrentQuery())}getObservers(){return this.#F}getOptimisticResult(e,t){let r=this.#$(e),s=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[s,e=>this.#J(e??s,t),()=>this.#X(s,r)]}#X(e,t){return t.map((r,s)=>{let i=e[s];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#J(e,t){return t?(this.#H&&this.#N===this.#G&&t===this.#B||(this.#B=t,this.#G=this.#N,this.#H=(0,Z.replaceEqualDeep)(this.#H,t(e))),this.#H):e}#$(e){let t=new Map(this.#F.map(e=>[e.options.queryHash,e])),r=[];return e.forEach(e=>{let s=this.#u.defaultQueryOptions(e),i=t.get(s.queryHash);i?r.push({defaultedQueryOptions:s,observer:i}):r.push({defaultedQueryOptions:s,observer:new eb(this.#u,s)})}),r}#W(e,t){let r=this.#F.indexOf(e);if(-1!==r){var s;let e;this.#N=(s=this.#N,(e=s.slice(0))[r]=t,e),this.#A()}}#A(){if(this.hasListeners()){let e=this.#H,t=this.#X(this.#N,this.#V);e!==this.#J(t,this.#z?.combine)&&ea.batch(()=>{this.listeners.forEach(e=>{e(this.#N)})})}}};function e_({queries:e,...t},r){let s=(0,y.useQueryClient)(r),i=et.useContext(ek),n=et.useContext(eQ),a=et.useMemo(()=>e.map(e=>{let t=s.defaultQueryOptions(e);return t._optimisticResults=i?"isRestoring":"optimistic",t}),[e,s,i]);a.forEach(e=>{eD(e),eE(e,n)}),eq(n);let[o]=et.useState(()=>new eN(s,a,t)),[u,l,c]=o.getOptimisticResult(a,t.combine),h=!i&&!1!==t.subscribed;et.useSyncExternalStore(et.useCallback(e=>h?o.subscribe(ea.batchCalls(e)):Z.noop,[o,h]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),et.useEffect(()=>{o.setQueries(a,t)},[a,t,o]);let d=u.some((e,t)=>eM(a[t],e))?u.flatMap((e,t)=>{let r=a[t];if(r){let t=new eb(s,r);if(eM(r,e))return eA(r,t,n);eI(e,i)&&eA(r,t,n)}return[]}):[];if(d.length>0)throw Promise.all(d);let p=u.find((e,t)=>{let r=a[t];return r&&ex({result:e,errorResetBoundary:n,throwOnError:r.throwOnError,query:s.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(p?.error)throw p.error;return l(c())}function ez(e,t,r){let s=e[0],i=e[1]?.input;return r&&(i={...i??{},...r.pageParam?{cursor:r.pageParam}:{},direction:r.direction}),[s.join("."),i,t?.trpc]}function eH(e){return{path:e.path.join(".")}}function eB(e){let t=eH(e);return et.useMemo(()=>t,[t])}async function eG(e,t,r){let s=t.getQueryCache().build(t,{queryKey:r});s.setState({data:[],status:"success"});let i=[];for await(let t of e)i.push(t),s.setState({data:[...i]});return i}function eV(e){let t=e instanceof S?e:e[Q];return(0,R.createRecursiveProxy)(e=>{let r=e.path,s=r.join("."),[i,n]=e.args;return{queryKey:Y(r,i,"query"),queryFn:()=>t.query(s,i,n?.trpc),...n}})}let eW=(e,t)=>new Proxy(e,{get:(e,r)=>(t(r),e[r])});class e${constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class eJ{constructor(e){this.generateIdentifier=e,this.kv=new e$}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class eX extends eJ{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){"object"==typeof t?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function eZ(e,t){Object.entries(e).forEach(([e,r])=>t(r,e))}function eY(e,t){return -1!==e.indexOf(t)}function e0(e,t){for(let r=0;r<e.length;r++){let s=e[r];if(t(s))return s}}class e1{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return function(e,t){let r=function(e){if("values"in Object)return Object.values(e);let t=[];for(let r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}(e);if("find"in r)return r.find(t);for(let e=0;e<r.length;e++){let s=r[e];if(t(s))return s}}(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}}let e3=e=>void 0===e,e4=e=>"object"==typeof e&&null!==e&&e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype),e7=e=>e4(e)&&0===Object.keys(e).length,e5=e=>Array.isArray(e),e2=e=>e instanceof Map,e9=e=>e instanceof Set,e8=e=>"Symbol"===Object.prototype.toString.call(e).slice(8,-1),e6=e=>"number"==typeof e&&isNaN(e),te=e=>e.replace(/\./g,"\\."),tt=e=>e.map(String).map(te).join("."),tr=e=>{let t=[],r="";for(let s=0;s<e.length;s++){let i=e.charAt(s);if("\\"===i&&"."===e.charAt(s+1)){r+=".",s++;continue}
2if("."===i){t.push(r),r="";continue}r+=i}let s=r;return t.push(s),t};function ts(e,t,r,s){return{isApplicable:e,annotation:t,transform:r,untransform:s}}let ti=[ts(e3,"undefined",()=>null,()=>void 0),ts(e=>"bigint"==typeof e,"bigint",e=>e.toString(),e=>"u">typeof BigInt?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),ts(e=>e instanceof Date&&!isNaN(e.valueOf()),"Date",e=>e.toISOString(),e=>new Date(e)),ts(e=>e instanceof Error,"Error",(e,t)=>{let r={name:e.name,message:e.message};return t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r},(e,t)=>{let r=Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r}),ts(e=>e instanceof RegExp,"regexp",e=>""+e,e=>new RegExp(e.slice(1,e.lastIndexOf("/")),e.slice(e.lastIndexOf("/")+1))),ts(e9,"set",e=>[...e.values()],e=>new Set(e)),ts(e2,"map",e=>[...e.entries()],e=>new Map(e)),ts(e=>e6(e)||e===1/0||e===-1/0,"number",e=>e6(e)?"NaN":e>0?"Infinity":"-Infinity",Number),ts(e=>0===e&&1/e==-1/0,"number",()=>"-0",Number),ts(e=>e instanceof URL,"URL",e=>e.toString(),e=>new URL(e))];function tn(e,t,r,s){return{isApplicable:e,annotation:t,transform:r,untransform:s}}let ta=tn((e,t)=>!!e8(e)&&!!t.symbolRegistry.getIdentifier(e),(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{let s=r.symbolRegistry.getValue(t[1]);if(!s)throw Error("Trying to deserialize unknown symbol");return s}),to=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),tu=tn(e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{let r=to[t[1]];if(!r)throw Error("Trying to deserialize unknown typed array");return new r(e)});function tl(e,t){return!!e?.constructor&&!!t.classRegistry.getIdentifier(e.constructor)}let tc=tn(tl,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};let s={};return r.forEach(t=>{s[t]=e[t]}),s},(e,t,r)=>{let s=r.classRegistry.getValue(t[1]);if(!s)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(s.prototype),e)}),th=tn((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{let s=r.customTransformerRegistry.findByName(t[1]);if(!s)throw Error("Trying to deserialize unknown custom value");return s.deserialize(e)}),td=[tc,ta,th,tu],tp=(e,t)=>{let r=e0(td,r=>r.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};let s=e0(ti,r=>r.isApplicable(e,t));if(s)return{value:s.transform(e,t),type:s.annotation}},tf={};ti.forEach(e=>{tf[e.annotation]=e});let ty=(e,t)=>{if(t>e.size)throw Error("index out of bounds");let r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function tm(e){if(eY(e,"__proto__"))throw Error("__proto__ is not allowed as a property");if(eY(e,"prototype"))throw Error("prototype is not allowed as a property");if(eY(e,"constructor"))throw Error("constructor is not allowed as a property")}let tb=(e,t,r)=>{if(tm(t),0===t.length)return r(e);let s=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(e5(s))s=s[+r];else if(e4(s))s=s[r];else if(e9(s))s=ty(s,+r);else if(e2(s)){if(e===t.length-2)break;let i=+r,n=0==+t[++e]?"key":"value",a=ty(s,i);switch(n){case"key":s=a;break;case"value":s=s.get(a)}}}let i=t[t.length-1];if(e5(s)?s[+i]=r(s[+i]):e4(s)&&(s[i]=r(s[i])),e9(s)){let e=ty(s,+i),t=r(e);e!==t&&(s.delete(e),s.add(t))}if(e2(s)){let e=ty(s,+t[t.length-2]);switch(0==+i?"key":"value"){case"key":{let t=r(e);s.set(t,s.get(e)),t!==e&&s.delete(e);break}case"value":s.set(e,r(s.get(e)))}}return e},tg=(e,t,r,s,i=[],n=[],a=new Map)=>{let o=(e=>"boolean"==typeof e||null===e||e3(e)||"number"==typeof e&&!isNaN(e)||"string"==typeof e||e8(e))(e);if(!o){let r;(r=t.get(e))?r.push(i):t.set(e,[i]);let n=a.get(e);if(n)return s?{transformedValue:null}:n}if(!(e4(e)||e5(e)||e2(e)||e9(e)||tl(e,r))){let t=tp(e,r),s=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return o||a.set(e,s),s}if(eY(n,e))return{transformedValue:null};let u=tp(e,r),l=u?.value??e,c=e5(l)?[]:{},h={};eZ(l,(o,u)=>{if("__proto__"===u||"constructor"===u||"prototype"===u)throw Error(`Detected property ${u}. This is a prototype pollution risk, please remove it from your object.`);let l=tg(o,t,r,s,[...i,u],[...n,e],a);c[u]=l.transformedValue,e5(l.annotations)?h[u]=l.annotations:e4(l.annotations)&&eZ(l.annotations,(e,t)=>{h[te(u)+"."+t]=e})});let d=e7(h)?{transformedValue:c,annotations:u?[u.type]:void 0}:{transformedValue:c,annotations:u?[u.type,h]:h};return o||a.set(e,d),d};function tv(e){return Object.prototype.toString.call(e).slice(8,-1)}function tw(e){return"Array"===tv(e)}class tO{constructor({dedupe:e=!1}={}){this.classRegistry=new eX,this.symbolRegistry=new eJ(e=>e.description??""),this.customTransformerRegistry=new e1,this.allowedErrorProps=[],this.dedupe=e}serialize(e){var t;let r,s,i=new Map,n=tg(e,i,this,this.dedupe),a={json:n.transformedValue};n.annotations&&(a.meta={...a.meta,values:n.annotations});let o=(t=this.dedupe,r={}
2,(i.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...n]=e;0===i.length?s=n.map(tt):r[tt(i)]=n.map(tt)}),s)?e7(r)?[s]:[s,r]:e7(r)?void 0:r);return o&&(a.meta={...a.meta,referentialEqualities:o}),a}deserialize(e){var t,r,s;let{json:i,meta:n}=e,a=function e(t,r={}){return tw(t)?t.map(t=>e(t,r)):!function(e){if("Object"!==tv(e))return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}(t)?t:[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)].reduce((s,i)=>{var n;let a;if(tw(r.props)&&!r.props.includes(i))return s;let o=e(t[i],r);return n=r.nonenumerable,"enumerable"==(a=({}).propertyIsEnumerable.call(t,i)?"enumerable":"nonenumerable")&&(s[i]=o),n&&"nonenumerable"===a&&Object.defineProperty(s,i,{value:o,enumerable:!1,writable:!0,configurable:!0}),s},{})}(i);return n?.values&&(t=a,r=n.values,s=this,function e(t,r,s=[]){if(!t)return;if(!e5(t))return void eZ(t,(t,i)=>e(t,r,[...s,...tr(i)]));let[i,n]=t;n&&eZ(n,(t,i)=>{e(t,r,[...s,...tr(i)])}),r(i,s)}(r,(e,r)=>{t=tb(t,r,t=>((e,t,r)=>{if(e5(t))switch(t[0]){case"symbol":return ta.untransform(e,t,r);case"class":return tc.untransform(e,t,r);case"custom":return th.untransform(e,t,r);case"typed-array":return tu.untransform(e,t,r);default:throw Error("Unknown transformation: "+t)}{let s=tf[t];if(!s)throw Error("Unknown transformation: "+t);return s.untransform(e,r)}})(t,e,s))}),a=t),n?.referentialEqualities&&(a=function(e,t){function r(t,r){let s=((e,t)=>{tm(t);for(let r=0;r<t.length;r++){let s=t[r];if(e9(e))e=ty(e,+s);else if(e2(e)){let i=+s,n=0==+t[++r]?"key":"value",a=ty(e,i);switch(n){case"key":e=a;break;case"value":e=e.get(a)}}else e=e[s]}return e})(e,tr(r));t.map(tr).forEach(t=>{e=tb(e,t,()=>s)})}if(e5(t)){let[s,i]=t;s.forEach(t=>{e=tb(e,tr(t),()=>e)}),i&&eZ(i,r)}else eZ(t,r);return e}(a,n.referentialEqualities)),a}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}tO.defaultInstance=new tO,tO.serialize=tO.defaultInstance.serialize.bind(tO.defaultInstance),tO.deserialize=tO.defaultInstance.deserialize.bind(tO.defaultInstance),tO.stringify=tO.defaultInstance.stringify.bind(tO.defaultInstance),tO.parse=tO.defaultInstance.parse.bind(tO.defaultInstance),tO.registerClass=tO.defaultInstance.registerClass.bind(tO.defaultInstance),tO.registerSymbol=tO.defaultInstance.registerSymbol.bind(tO.defaultInstance),tO.registerCustom=tO.defaultInstance.registerCustom.bind(tO.defaultInstance),tO.allowErrorProps=tO.defaultInstance.allowErrorProps.bind(tO.defaultInstance),tO.serialize,tO.deserialize,tO.stringify,tO.parse,tO.registerClass,tO.registerCustom,tO.registerSymbol,tO.allowErrorProps;var tC=e.i(372775),tP=class extends ei{constructor(e={}){super(),this.config=e,this.#Z=new Set,this.#Y=new Map,this.#ee=0}#Z;#Y;#ee;build(e,t,r){let s=new eU({mutationCache:this,mutationId:++this.#ee,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){this.#Z.add(e);let t=tS(e);if("string"==typeof t){let r=this.#Y.get(t);r?r.push(e):this.#Y.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#Z.delete(e)){let t=tS(e);if("string"==typeof t){let r=this.#Y.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#Y.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=tS(e);if("string"!=typeof t)return!0;{let r=this.#Y.get(t),s=r?.find(e=>"pending"===e.state.status);return!s||s===e}}runNext(e){let t=tS(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#Y.get(t)?.find(t=>
2t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){ea.batch(()=>{this.#Z.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#Z.clear(),this.#Y.clear()})}getAll(){return Array.from(this.#Z)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,Z.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,Z.matchMutation)(e,t))}notify(e){ea.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ea.batch(()=>Promise.all(e.map(e=>e.continue().catch(Z.noop))))}};function tS(e){return e.options.scope?.id}var tR=class extends ei{constructor(e={}){super(),this.config=e,this.#_=new Map}#_;build(e,t,r){let s=t.queryKey,i=t.queryHash??(0,Z.hashQueryKeyByOptions)(s,t),n=this.get(i);return n||(n=new ey({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(n)),n}add(e){this.#_.has(e.queryHash)||(this.#_.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#_.get(e.queryHash);t&&(e.destroy(),t===e&&this.#_.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ea.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#_.get(e)}getAll(){return[...this.#_.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,Z.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,Z.matchQuery)(e,t)):t}notify(e){ea.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ea.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ea.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},tQ=class{#et;#U;#c;#er;#es;#ei;#en;#ea;constructor(e={}){this.#et=e.queryCache||new tR,this.#U=e.mutationCache||new tP,this.#c=e.defaultOptions||{},this.#er=new Map,this.#es=new Map,this.#ei=0}mount(){this.#ei++,1===this.#ei&&(this.#en=en.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#et.onFocus())}),this.#ea=eo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#et.onOnline())}))}unmount(){this.#ei--,0===this.#ei&&(this.#en?.(),this.#en=void 0,this.#ea?.(),this.#ea=void 0)}isFetching(e){return this.#et.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#U.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#et.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#et.build(this,t),s=r.state.data;return void 0===s?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,Z.resolveStaleTime)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#et.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let s=this.defaultQueryOptions({queryKey:e}),i=this.#et.get(s.queryHash),n=i?.state.data,a=(0,Z.functionalUpdate)(t,n);if(void 0!==a)return this.#et.build(this,s).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return ea.batch(()=>this.#et.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#et.get(t.queryHash)?.state}removeQueries(e){let t=this.#et;ea.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#et;return ea.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(ea.batch(()=>this.#et.findAll(e).map(e=>e.cancel(r)))).then(Z.noop).catch(Z.noop)}invalidateQueries(e,t={}){return ea.batch(()=>(this.#et.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(ea.batch(()=>this.#et.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(Z.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(Z.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#et.build(this,t);return r.isStaleByTime((0,Z.resolveStaleTime)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Z.noop).catch(Z.noop)}fetchInfiniteQuery(e){return e.behavior=eC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Z.noop).catch(Z.noop)}ensureInfiniteQueryData(e){return e.behavior=eC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return eo.isOnline()?this.#U.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#et}getMutationCache(){return this.#U}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#er.set((0,Z.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#er.values()],r={};return t.forEach(t=>{(0,Z.partialMatchKey)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#es.set((0,Z.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#es.values()],r={};return t.forEach(t=>{(0,Z.partialMatchKey)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,Z.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Z.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#et.clear(),this.#U.clear()}};let tE=!1;function tq(e){let t;if(window.location.pathname.startsWith("/auth/")||tE||!("u"<typeof document)&&(document.cookie.includes("next-auth.session-token")||document.cookie.includes("__Secure-next-auth.session-token")||document.cookie.includes("__Secure-authjs.session-token")||document.cookie.includes("authjs.session-token"))||function(){if("u"<typeof navigator)return!1;let e=window.Capacitor;return e?.isNativePlatform?.()===!0||/Android.*wv\)/.test(navigator.userAgent)}()||!("u"<typeof navigator)&&!("u"<typeof document)&&/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)&&!(document.cookie.includes("next-auth.session-token")||document.cookie.includes("__Secure-next-auth.session-token")||document.cookie.includes("__Secure-authjs.session-token")||document.cookie.includes("authjs.session-token"))||"
2UNAUTHORIZED"!==e?.data?.code)return;tE=!0;let r=window.location.pathname+window.location.search;window.location.href=(t=new URLSearchParams({callbackUrl:function(e,t="/"){let r,s="string"==typeof(r=Array.isArray(e)?e[0]:e)&&r.length>0?r:void 0;return"string"==typeof s&&s.startsWith("/")&&!s.startsWith("//")?s:t}(r)}),`/auth/login?${t.toString()}`)}let tx=(h=c=function(e){let t=e?.overrides?.useMutation?.onSuccess??(e=>e.originalFn()),r=e?.context??es;function s(){let e=et.useContext(r);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function i(e,t){let{queryClient:r,ssrState:i}=s();return i&&"mounted"!==i&&r.getQueryCache().find({queryKey:e})?.state.status==="error"?{retryOnMount:!1,...t}:t}let n={data:void 0,error:null,status:"idle"},a={data:void 0,error:null,status:"connecting"};return{Provider:e=>{let{abortOnUnmount:t=!1,queryClient:s,ssrContext:i}=e,[n,a]=et.useState(e.ssrState??!1),o=e.client instanceof S?e.client:e.client[Q],u=et.useMemo(()=>(function(e){let{client:t,queryClient:r}=e,s=t instanceof S?t:t[Q];return{infiniteQueryOptions:(e,t,r)=>{let i=t[1]?.input===Z.skipToken,n=async e=>{let i={...r,trpc:{...r?.trpc,...r?.trpc?.abortOnUnmount?{signal:e.signal}:{signal:null}}};return await s.query(...ez(t,i,{direction:e.direction,pageParam:e.pageParam}))};return Object.assign({...r,initialData:r?.initialData,queryKey:t,queryFn:i?Z.skipToken:n,initialPageParam:r?.initialCursor??null},{trpc:eH({path:e})})},queryOptions:(e,t,i)=>{let n=t[1]?.input===Z.skipToken,a=async e=>{let n={...i,trpc:{...i?.trpc,...i?.trpc?.abortOnUnmount?{signal:e.signal}:{signal:null}}},a=await s.query(...ez(t,n));return(0,v.isAsyncIterable)(a)?eG(a,r,t):a};return Object.assign({...i,initialData:i?.initialData,queryKey:t,queryFn:n?Z.skipToken:a},{trpc:eH({path:e})})},fetchQuery:(e,t)=>r.fetchQuery({...t,queryKey:e,queryFn:()=>s.query(...ez(e,t))}),fetchInfiniteQuery:(e,t)=>r.fetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:r,direction:i})=>s.query(...ez(e,t,{pageParam:r,direction:i})),initialPageParam:t?.initialCursor??null}),prefetchQuery:(e,t)=>r.prefetchQuery({...t,queryKey:e,queryFn:()=>s.query(...ez(e,t))}),prefetchInfiniteQuery:(e,t)=>r.prefetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:r,direction:i})=>s.query(...ez(e,t,{pageParam:r,direction:i})),initialPageParam:t?.initialCursor??null}),ensureQueryData:(e,t)=>r.ensureQueryData({...t,queryKey:e,queryFn:()=>s.query(...ez(e,t))}),invalidateQueries:(e,t,s)=>r.invalidateQueries({...t,queryKey:e},s),resetQueries:(e,t,s)=>r.resetQueries({...t,queryKey:e},s),refetchQueries:(e,t,s)=>r.refetchQueries({...t,queryKey:e},s),cancelQuery:(e,t)=>r.cancelQueries({queryKey:e},t),setQueryData:(e,t,s)=>r.setQueryData(e,t,s),setQueriesData:(e,t,s,i)=>r.setQueriesData({...t,queryKey:e},s,i),getQueryData:e=>r.getQueryData(e),setInfiniteQueryData:(e,t,s)=>r.setQueryData(e,t,s),getInfiniteQueryData:e=>r.getQueryData(e),setMutationDefaults:(t,i)=>{let n=t[0];return r.setMutationDefaults(t,"function"==typeof i?i({canonicalMutationFn:t=>s.mutation(...ez([n,{input:t}],e))}):i)},getMutationDefaults:e=>r.getMutationDefaults(e),isMutating:e=>r.isMutating({...e,exact:!0})}})({client:o,queryClient:s}),[o,s]),l=et.useMemo(()=>({abortOnUnmount:t,queryClient:s,client:o,ssrContext:i??null,ssrState:n,...u}),[t,o,u,s,i,n]);return et.useEffect(()=>{a(e=>!!e&&"mounted")},[]),et.createElement(r.Provider,{value:l},e.children)},createClient:x,useContext:s,useUtils:s,useQuery:function(t,r,n){let{abortOnUnmount:a,client:o,ssrState:u,queryClient:l,prefetchQuery:c}=s(),h=Y(t,r,"query"),d=l.getQueryDefaults(h),p=r===Z.skipToken;!("u"<typeof window)||"prepass"!==u||n?.trpc?.ssr===!1||(n?.enabled??d?.enabled)===!1||p||l.getQueryCache().find({queryKey:h})||c(h,n);let f=i(h,{...d,...n}),y=n?.trpc?.abortOnUnmount??e?.abortOnUnmount??a,m=eF({...f,queryKey:h,queryFn:p?r:async e=>{let t={...f,trpc:{...f?.trpc,...y?{signal:e.signal}:{signal:null}}},r=await o.query(...ez(h,t));return(0,v.isAsyncIterable)(r)?eG(r,l,h):r}},eb,l);return m.trpc=eB({path:t}),m},usePrefetchQuery:function(t,r,i){var n;let a,o=s(),u=Y(t,r,"query"),l=r===Z.skipToken,c=i?.trpc?.abortOnUnmount??e?.abortOnUnmount??o.abortOnUnmount;n={...i,queryKey:u,queryFn:l?r:e=>{let t={trpc:{...i?.trpc,...c?{signal:e.signal}:{}}};return o.client.query(...ez(u,t))}},(a=(0,y.useQueryClient)(void 0)).getQueryState(n.queryKey)||a.prefetchQuery(n)},useSuspenseQuery:function(t,r,i){var n,a;let o=s(),u=Y(t,r,"query"),l=i?.trpc?.abortOnUnmount??e?.abortOnUnmount??o.abortOnUnmount,c=(n={...i,queryKey:u,queryFn:e=>{let t={...i,trpc:{...i?.trpc,...l?{signal:e.signal}:{signal:null}}};return o.client.query(...ez(u,t))}},a=o.queryClient,eF({...n,enabled:!0,suspense:!0,throwOnError:eT,placeholderData:void 0},eb,a));return c.trpc=eB({path:t}),[c.data,c]},useQueries:(e,t)=>{let{ssrState:r,queryClient:i,prefetchQuery:n,client:a}=s(),o=e(eV(a));if("u"<typeof window&&"prepass"===r)for(let e of o)e.trpc?.ssr===!1||i.getQueryCache().find({queryKey:e.queryKey})||n(e.queryKey,e);return e_({queries:o.map(e=>({...e,queryKey:e.queryKey})),combine:t?.combine},i)},useSuspenseQueries:e=>{var t;let{queryClient:r,client:i}=s(),n=(t={queries:e(eV(i)).map(e=>({...e,queryFn:e.queryFn,queryKey:e.queryKey}))},e_({...t,queries:t.queries.map(e=>({...e,suspense:!0,throwOnError:eT,enabled:!0,placeholderData:void 0}))},r));return[n.map(e=>e.data),n]},useMutation:function(e,r){let{client:i,queryClient:n}=s(),a=ee(e),o=n.defaultMutationOptions(n.getMutationDefaults(a)),u=function(e,t){let r=(0,y.useQueryClient)(t),[s]=et.useState(()=>new eK(r,e));et.useEffect(()=>{s.setOptions(e)},[s,e]);let i=et.useSyncExternalStore(et.useCallback(e=>s.subscribe(ea.batchCalls(e)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),n=et.useCallback((e,t)=>{s.mutate(e,t).catch(Z.noop)},[s]);if(i.error&&(0,Z.shouldThrowError)(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}({...r,mutationKey:a,mutationFn:t=>i.mutation(...ez([e,{input:t}],r)),onSuccess:(...e)=>t({originalFn:()=>r?.onSuccess?.(...e)??o?.onSuccess?.(...e),queryClient:n,meta:r?.meta??o?.meta??{}})},n);return u.trpc=eB({path:e}),u},useSubscription:function(e,t,r){let i=r?.enabled??t!==Z.skipToken,o=(0,Z.hashKey)(Y(e,t,"any")),{client:u}=s(),l=et.useRef(r);et.useEffect(()=>{l.current=r});let[c]=et.useState(new Set([])),h=et.useCallback(e=>{c.add(e)},[c]),d=et.useRef(null),p=et.useCallback(e=>{let t=y.current,r=y.current=e(t),s=!1;for(let e of c)if(t[e]!==r[e]){s=!0;break}s&&b(eW(r,h))},[h,c]),f=et.useCallback(()=>{(d.current?.unsubscribe(),i)?(p(()=>({...a,reset:f})),d.current=u.subscription(e.join("."),t??void 0,{onStarted:()=>{l.current.onStarted?.(),p(e=>({...e,status:"pending",error:null}))},onData:e=>{l.current.onData?.(e),p(t=>({...t,status:"pending",data:e,error:null}))},onError:e=>{l.current.onError?.(e),p(t=>({...t,status:"error",error:e}))},onConnectionStateChange:e=>{p(t=>{switch(e.state){case"idle":return{...t,status:e.state,error:null,data:void 0};case"connecting":return{...t,error:e.error,status:e.state};
2case"pending":return t}})},onComplete:()=>{l.current.onComplete?.(),p(e=>({...e,status:"idle",error:null,data:void 0}))}})):p(()=>({...n,reset:f}))},[u,o,i,p]);et.useEffect(()=>(f(),()=>{d.current?.unsubscribe()}),[f]);let y=et.useRef(i?{...a,reset:f}:{...n,reset:f}),[m,b]=et.useState(eW(y.current,h));return m},useInfiniteQuery:function(e,t,r){let{client:n,ssrState:a,prefetchInfiniteQuery:o,queryClient:u,abortOnUnmount:l}=s(),c=Y(e,t,"infinite"),h=u.getQueryDefaults(c),d=t===Z.skipToken;!("u"<typeof window)||"prepass"!==a||r?.trpc?.ssr===!1||(r?.enabled??h?.enabled)===!1||d||u.getQueryCache().find({queryKey:c})||o(c,{...h,...r});let p=i(c,{...h,...r}),f=r?.trpc?.abortOnUnmount??l,y=eF({...p,initialPageParam:r.initialCursor??null,persister:r.persister,queryKey:c,queryFn:d?t:e=>{let t={...p,trpc:{...p?.trpc,...f?{signal:e.signal}:{signal:null}}};return n.query(...ez(c,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}},eR,u);return y.trpc=eB({path:e}),y},usePrefetchInfiniteQuery:function(e,t,r){var n;let a,o=s(),u=Y(e,t,"infinite"),l=o.queryClient.getQueryDefaults(u),c=t===Z.skipToken,h=i(u,{...l,...r}),d=r?.trpc?.abortOnUnmount??o.abortOnUnmount;n={...r,initialPageParam:r.initialCursor??null,queryKey:u,queryFn:c?t:e=>{let t={...h,trpc:{...h?.trpc,...d?{signal:e.signal}:{}}};return o.client.query(...ez(u,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}},(a=(0,y.useQueryClient)(void 0)).getQueryState(n.queryKey)||a.prefetchInfiniteQuery(n)},useSuspenseInfiniteQuery:function(e,t,r){var n,a;let o=s(),u=Y(e,t,"infinite"),l=o.queryClient.getQueryDefaults(u),c=i(u,{...l,...r}),h=r?.trpc?.abortOnUnmount??o.abortOnUnmount,d=(n={...r,initialPageParam:r.initialCursor??null,queryKey:u,queryFn:e=>{let t={...c,trpc:{...c?.trpc,...h?{signal:e.signal}:{}}};return o.client.query(...ez(u,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}},a=o.queryClient,eF({...n,enabled:!0,suspense:!0,throwOnError:eT},eR,a));return d.trpc=eB({path:e}),[d.data,d]}}}(void 0),l=(0,R.createRecursiveProxy)(({path:e,args:t})=>{let r=[...e],s=r.pop();if("useMutation"===s)return h[s](r,...t);if("_def"===s)return{path:r};let[i,...n]=t,a=n[0]??{};return h[s](r,i,a)}),(0,R.createFlatProxy)(e=>"useContext"===e||"useUtils"===e?()=>{let e=c.useUtils();return et.useMemo(()=>{let t,r;return t=q(e.client),r=(0,R.createRecursiveProxy)(t=>{let r=[...t.path],s=r.pop(),i=[...t.args],n=i.shift(),a=Y(r,n,(e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}})(s));return({infiniteQueryOptions:()=>e.infiniteQueryOptions(r,a,i[0]),queryOptions:()=>e.queryOptions(r,a,...i),fetch:()=>e.fetchQuery(a,...i),fetchInfinite:()=>e.fetchInfiniteQuery(a,i[0]),prefetch:()=>e.prefetchQuery(a,...i),prefetchInfinite:()=>e.prefetchInfiniteQuery(a,i[0]),ensureData:()=>e.ensureQueryData(a,...i),invalidate:()=>e.invalidateQueries(a,...i),reset:()=>e.resetQueries(a,...i),refetch:()=>e.refetchQueries(a,...i),cancel:()=>e.cancelQuery(a,...i),setData:()=>{e.setQueryData(a,i[0],i[1])},setQueriesData:()=>e.setQueriesData(a,i[0],i[1],i[2]),setInfiniteData:()=>{e.setInfiniteQueryData(a,i[0],i[1])},getData:()=>e.getQueryData(a),getInfiniteData:()=>e.getInfiniteQueryData(a),setMutationDefaults:()=>e.setMutationDefaults(ee(r),n),getMutationDefaults:()=>e.getMutationDefaults(ee(r)),isMutating:()=>e.isMutating({mutationKey:ee(r)})})[s]()}),(0,R.createFlatProxy)(s=>"client"===s?t:er.includes(s)?e[s]:r[s])},[e])}:c.hasOwnProperty(e)?c[e]:l[e])),tk=f.env.NEXT_PUBLIC_APP_VERSION,tT=new Set(["ecommerce.search.search"]);function tD(e){return"query"===e.type&&tT.has(e.path)}function tI(){return window.location.origin}function tM(){let e=new Headers;return e.set("x-trpc-source","nextjs-react"),p.Capacitor.isNativePlatform()&&(e.set("x-app-platform",p.Capacitor.getPlatform()),e.set("x-app-version",tk)),e}e.s(["TRPCReactProvider",0,function(e){let t=u??=new tQ({queryCache:new tR({onError:tq}),mutationCache:new tP({onError:tq}),defaultOptions:{queries:{staleTime:3e5,placeholderData:e=>e},dehydrate:{serializeData:tO.serialize,shouldDehydrateQuery:e=>(0,tC.defaultShouldDehydrateQuery)(e)||"pending"===e.state.status},hydrate:{deserializeData:tO.deserialize}}}),[r]=(0,et.useState)(()=>{var e;let t;return tx.createClient({links:[function(e={}){let{enabled:t=()=>!0}=e,r=e.colorMode??("u"<typeof window?"ansi":"css"),s=e.withContext??"css"===r,{logger:i=(({c:e=console,colorMode:t="css",withContext:r})=>s=>{let i=s.input,n=!("u"<typeof FormData)&&i instanceof FormData?Object.fromEntries(i):i,{parts:a,args:o}=function(e){let{direction:t,type:r,withContext:s,path:i,id:n,input:a}=e,o=[],u=[];
2if("none"===e.colorMode)o.push("up"===t?">>":"<<",r,`#${n}`,i);else if("ansi"===e.colorMode){let[e,s]=W[r],[a,u]=$[r];o.push("up"===t?e:s,"up"===t?">>":"<<",r,"up"===t?a:u,`#${n}`,i,"\x1b[0m")}else{let[e,s]=V[r],a=`
3    background-color: #${"up"===t?e:s};
4    color: ${"up"===t?"black":"white"};
5    padding: 2px;
6  `;o.push("%c","up"===t?">>":"<<",r,`#${n}`,`%c${i}%c`,"%O"),u.push(a,`${a}; font-weight: bold;`,`${a}; font-weight: normal;`)}return"up"===t?u.push(s?{input:a,context:e.context}:{input:a}):u.push({input:a,result:e.result,elapsedMs:e.elapsedMs,...s&&{context:e.context}}),{parts:o,args:u}}({...s,colorMode:t,input:n,withContext:r});e["down"===s.direction&&s.result&&(s.result instanceof Error||"error"in s.result.result&&s.result.result.error)?"error":"log"].apply(null,[a.join(" ")].concat(o))})({c:e.console,colorMode:r,withContext:s})}=e;return()=>({op:e,next:r})=>m(s=>{var n;t({...e,direction:"up"})&&i({...e,direction:"up"});let a=Date.now();function o(r){let s=Date.now()-a;t({...e,direction:"down",result:r})&&i({...e,direction:"down",elapsedMs:s,result:r})}return r(e).pipe((n={next(e){o(e)},error(e){o(e)}},e=>m(t=>e.subscribe({next(e){n.next?.(e),t.next(e)},error(e){n.error?.(e),t.error(e)},complete(){n.complete?.(),t.complete()}})))).subscribe(s)})}({enabled:e=>"down"===e.direction&&e.result instanceof Error}),X({condition:tD,true:(t=D(e={transformer:tO,url:tI()+"/api/trpc",headers:tM}),()=>({op:r})=>m(s=>{let i,{path:n,input:a,type:o}=r;if("subscription"===o)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");return(e=>
6{if("input"in e){let{input:t}=e;if(t instanceof FormData){if("mutation"!==e.type&&"POST"!==e.methodOverride)throw Error("FormData is only supported for mutations");return L({...e,contentTypeHeader:void 0,getUrl:A,getBody:()=>t})}if(t instanceof Uint8Array||t instanceof Blob){if("mutation"!==e.type&&"POST"!==e.methodOverride)throw Error("Octet type input is only supported for mutations");return L({...e,contentTypeHeader:"application/octet-stream",getUrl:A,getBody:()=>t})}}return U(e)})({...t,type:o,path:n,input:a,signal:r.signal,headers:()=>e.headers?"function"==typeof e.headers?e.headers({op:r}):e.headers:{}}).then(e=>{i=e.meta;let r=(0,w.transformResult)(e.json,t.transformer.output);r.ok?(s.next({context:e.meta,result:r.result}),s.complete()):s.error(C.from(r.error,{meta:i}))}).catch(e=>{s.error(C.from(e,{meta:i}))}),()=>{}})),false:X({condition:e=>"mutation"===e.type,true:N({transformer:tO,url:tI()+"/api/trpc",headers:tM}),false:N({transformer:tO,url:tI()+"/api/trpc",headers:tM})})})]})});return(0,d.jsx)(y.QueryClientProvider,{client:t,children:(0,d.jsx)(tx.Provider,{client:r,queryClient:t,children:e.children})})},"api",0,tx],310955)}]);
7
8//# debugId=11b30d66-f52d-cba7-26e8-b6c8147cff82

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.