PageSourceSearch

https://speechtank.com/assets/client-Ds8J-gPH.js

js speechtank.com collected 2026-10-04 13:19:40 UTC 94,019 bytes, 1 lines download raw bytes

vendor: 17,518 bytes, line 1
1import{j as Ae}from"./jsx-runtime-u17CrQMm.js";import{r as _,h as Br}from"./chunk-WWGJGFF6-CbML5bYY.js";var fe=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(){}},Wr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Gr=class{#t=Wr;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},ue=new Gr;function Yr(e){setTimeout(e,0)}var ce=typeof window>"u"||"Deno"in globalThis;function H(){}function Jr(e,t){return typeof e=="function"?e(t):e}function et(e){return typeof e=="number"&&e>=0&&e!==1/0}function Vt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function re(e,t){return typeof e=="function"?e(t):e}function W(e,t){return typeof e=="function"?e(t):e}function xt(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==yt(o,t.options))return!1}else if(!Oe(t.queryKey,o))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function St(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(ne(t.options.mutationKey)!==ne(i))return!1}else if(!Oe(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function yt(e,t){return(t?.queryKeyHashFn||ne)(e)}function ne(e){return JSON.stringify(e,(t,r)=>tt(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Oe(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Oe(e[r],t[r])):!1}var Zr=Object.prototype.hasOwnProperty;function vt(e,t){if(e===t)return e;const r=_t(e)&&_t(t);if(!r&&!(tt(e)&&tt(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,a=r?new Array(o):{};let u=0;for(let c=0;c<o;c++){const l=r?c:i[c],f=e[l],p=t[l];if(f===p){a[l]=f,(r?c<s:Zr.call(e,l))&&u++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){a[l]=p;continue}const v=vt(f,p);a[l]=v,v===f&&u++}return s===o&&u===s?e:a}function Pe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function _t(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function tt(e){if(!Ct(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Ct(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ct(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xr(e){return new Promise(t=>{ue.setTimeout(t,e)})}function rt(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?vt(e,t):t}function en(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function tn(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var V=Symbol();function Bt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===V?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wt(e,t){return typeof e=="function"?e(...t):!!e}var rn=class extends fe{#t;#e;#r;constructor(){super(),this.#r=e=>{if(!ce&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#r=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},mt=new rn;function nt(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var nn=Yr;function sn(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=nn;const i=a=>{t?e.push(a):s(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(u=>{r(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||o()}return u},batchCalls:a=>(...u)=>{i(()=>{a(...u)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var U=sn(),on=class extends fe{#t=!0;#e;#r;constructor(){super(),this.#r=e=>{if(!ce&&window.addEventListener){const 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.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#r=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#t}},ke=new on;function an(e){return Math.min(1e3*2**e,3e4)}function Gt(e){return(e??"online")==="online"?ke.isOnline():!0}var st=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Yt(e){let t=!1,r=0,n;const s=nt(),i=()=>s.status!=="pending",o=h=>{if(!i()){const C=new st(h);p(C),e.onCancel?.(C)}},a=()=>{t=!0},u=()=>{t=!1},c=()=>mt.isFocused()&&(e.networkMode==="always"||ke.isOnline())&&e.canRun(),l=()=>Gt(e.networkMode)&&e.canRun(),f=h=>{i()||(n?.(),s.resolve(h))},p=h=>{i()||(n?.(),s.reject(h))},v=()=>new Promise(h=>{n=C=>{(i()||c())&&h(C)},e.onPause?.()}).then(()=>{n=void 0,i()||e.onContinue?.()}),b=()=>{if(i())return;let h;const C=r===0?e.initialPromise:void 0;try{h=C??e.fn()}catch(j){h=Promise.reject(j)}Promise.resolve(h).then(f).catch(j=>{if(i())return;const Q=e.retry??(ce?0:3),Y=e.retryDelay??an,te=typeof Y=="function"?Y(r,j):Y,O=Q===!0||typeof Q=="number"&&r<Q||typeof Q=="function"&&Q(r,j);if(t||!O){p(j);return}r++,e.onFail?.(r,j),Xr(te).then(()=>c()?void 0:v()).then(()=>{t?p(j):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n?.(),s),cancelRetry:a,continueRetry:u,canStart:l,start:()=>(l()?b():v().then(b),s)}}var Jt=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),et(this.gcTime)&&(this.#t=ue.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ce?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ue.clearTimeout(this.#t),this.#t=void 0)}},un=class extends Jt{#t;#e;#r;#s;#n;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=jt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=jt(this.options);t.data!==void 0&&(this.setState(Rt(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=rt(this.state.data,e,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(H).catch(H):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>W(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===V||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>re(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Vt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#n&&(this.#a?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(u=>u.options.queryFn);a&&this.setOptions(a.options)}const r=new AbortController,n=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},s=()=>{const a=Bt(this.options,t),c=(()=>{const l={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(l),l})();return this.#a=!1,this.options.persister?this.options.persister(a,c,this):a(c)},o=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(a),a})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#n=Yt({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:a=>{a instanceof st&&a.revert&&this.setState({...this.#e,fetchStatus:"idle"}),r.abort()},onFail:(a,u)=>{this.#o({type:"failed",failureCount:a,error:u})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const a=await this.#n.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#r.config.onSuccess?.(a,this),this.#r.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof st){if(a.silent)return this.#n.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#o({type:"error",error:a}),this.#r.config.onError?.(a,this),this.#r.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#o(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Zt(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...Rt(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),U.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Zt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jt(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var _e=class extends fe{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#a=nt(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#r=void 0;#s=void 0;#n;#i;#a;#o;#h;#f;#d;#c;#l;#u;#y=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Et(this.#e,this.options)?this.#p():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return it(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return it(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#P(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof W(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!Pe(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&It(this.#e,r,this.options,t)&&this.#p(),this.updateResult(),n&&(this.#e!==r||W(this.options.enabled,this.#e)!==W(t.enabled,this.#e)||re(this.options.staleTime,this.#e)!==re(t.staleTime,this.#e))&&this.#v();const s=this.#m();n&&(this.#e!==r||W(this.options.enabled,this.#e)!==W(t.enabled,this.#e)||s!==this.#u)&&this.#b(s)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),r=this.createResult(t,e);return ln(this,r)&&(this.#s=r,this.#i=this.options,this.#n=this.#e.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#y.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),r=this.#t.getQueryCache().build(this.#t,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#p(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(H)),t}#v(){this.#O();const e=re(this.options.staleTime,this.#e);if(ce||this.#s.isStale||!et(e))return;const r=Vt(this.#s.dataUpdatedAt,e)+1;this.#c=ue.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#m(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#b(e){this.#P(),this.#u=e,!(ce||W(this.options.enabled,this.#e)===!1||!et(this.#u)||this.#u===0)&&(this.#l=ue.setInterval(()=>{(this.options.refetchIntervalInBackground||mt.isFocused())&&this.#p()},this.#u))}#g(){this.#v(),this.#b(this.#m())}#O(){this.#c&&(ue.clearTimeout(this.#c),this.#c=void 0)}#P(){this.#l&&(ue.clearInterval(this.#l),this.#l=void 0)}createResult(e,t){const r=this.#e,n=this.options,s=this.#s,i=this.#n,o=this.#i,u=e!==r?e.state:this.#r,{state:c}=e;let l={...c},f=!1,p;if(t._optimisticResults){const m=this.hasListeners(),w=!m&&Et(e,t),P=m&&It(e,r,t,n);(w||P)&&(l={...l,...Zt(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:v,errorUpdatedAt:b,status:h}=l;p=l.data;let C=!1;if(t.placeholderData!==void 0&&p===void 0&&h==="pending"){let m;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(m=s.data,C=!0):m=typeof t.placeholderData=="function"?t.placeholderData(this.#d?.state.data,this.#d):t.placeholderData,m!==void 0&&(h="success",p=rt(s?.data,m,t),f=!0)}if(t.select&&p!==void 0&&!C)if(s&&p===i?.data&&t.select===this.#h)p=this.#f;else try{this.#h=t.select,p=t.select(p),p=rt(s?.data,p,t),this.#f=p,this.#o=null}catch(m){this.#o=m}this.#o&&(v=this.#o,p=this.#f,b=Date.now(),h="error");const j=l.fetchStatus==="fetching",Q=h==="pending",Y=h==="error",te=Q&&j,O=p!==void 0,d={status:h,fetchStatus:l.fetchStatus,isPending:Q,isSuccess:h==="success",isError:Y,isInitialLoading:te,isLoading:te,data:p,dataUpdatedAt:l.dataUpdatedAt,error:v,errorUpdatedAt:b,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdate
1Count:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:j,isRefetching:j&&!Q,isLoadingError:Y&&!O,isPaused:l.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:Y&&O,isStale:bt(e,t),refetch:this.refetch,promise:this.#a,isEnabled:W(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const m=x=>{d.status==="error"?x.reject(d.error):d.data!==void 0&&x.resolve(d.data)},w=()=>{const x=this.#a=d.promise=nt();m(x)},P=this.#a;switch(P.status){case"pending":e.queryHash===r.queryHash&&m(P);break;case"fulfilled":(d.status==="error"||d.data!==P.value)&&w();break;case"rejected":(d.status!=="error"||d.error!==P.reason)&&w();break}}return d}updateResult(){const e=this.#s,t=this.createResult(this.#e,this.options);if(this.#n=this.#e.state,this.#i=this.options,this.#n.data!==void 0&&(this.#d=this.#e),Pe(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#y.size)return!0;const i=new Set(s??this.#y);return this.options.throwOnError&&i.add("error"),Object.keys(this.#s).some(o=>{const a=o;return this.#s[a]!==e[a]&&i.has(a)})};this.#x({listeners:r()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#x(e){U.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function cn(e,t){return W(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Et(e,t){return cn(e,t)||e.state.data!==void 0&&it(e,t,t.refetchOnMount)}function it(e,t,r){if(W(t.enabled,e)!==!1&&re(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&bt(e,t)}return!1}function It(e,t,r,n){return(e!==t||W(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&bt(e,r)}function bt(e,t){return W(t.enabled,e)!==!1&&e.isStaleByTime(re(t.staleTime,e))}function ln(e,t){return!Pe(e.getCurrentResult(),t)}function Fe(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},u=0;const c=async()=>{let l=!1;const f=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},p=Bt(t.options,t.fetchOptions),v=async(b,h,C)=>{if(l)return Promise.reject();if(h==null&&b.pages.length)return Promise.resolve(b);const Q=(()=>{const g={client:t.client,queryKey:t.queryKey,pageParam:h,direction:C?"backward":"forward",meta:t.options.meta};return f(g),g})(),Y=await p(Q),{maxPages:te}=t.options,O=C?tn:en;return{pages:O(b.pages,Y,te),pageParams:O(b.pageParams,h,te)}};if(s&&i.length){const b=s==="backward",h=b?Xt:ot,C={pages:i,pageParams:o},j=h(n,C);a=await v(C,j,b)}else{const b=e??i.length;do{const h=u===0?o[0]??n.initialPageParam:ot(n,a);if(u>0&&h==null)break;a=await v(a,h),u++}while(u<b)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function ot(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Xt(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function fn(e,t){return t?ot(e,t)!=null:!1}function dn(e,t){return!t||!e.getPreviousPageParam?!1:Xt(e,t)!=null}var er=class extends _e{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:Fe()})}getOptimisticResult(e){return e.behavior=Fe(),super.getOptimisticResult(e)}
1fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:o,isRefetchError:a}=n,u=r.fetchMeta?.fetchMore?.direction,c=o&&u==="forward",l=s&&u==="forward",f=o&&u==="backward",p=s&&u==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:fn(t,r.data),hasPreviousPage:dn(t,r.data),isFetchNextPageError:c,isFetchingNextPage:l,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:a&&!c&&!f,isRefetching:i&&!l&&!p}}},hn=class extends Jt{#t;#e;#r;#s;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#e=[],this.state=e.state||tr(),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.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Yt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#n({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#s.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:s}),await this.#r.config.onMutate?.(e,this,r);const o=await this.options.onMutate?.(e,r);o!==this.state.context&&this.#n({type:"pending",context:o,variables:e,isPaused:s})}const i=await this.#s.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#n({type:"success",data:i}),i}catch(i){try{throw await this.#r.config.onError?.(i,e,this.state.context,this,r),await this.options.onError?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,i,e,this.state.context,r),i}finally{this.#n({type:"error",error:i})}}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),U.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function tr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pn=class extends fe{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#r=0}#t;#e;#r;build(e,t,r){const n=new hn({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#t.add(e);const t=Ee(e);if(typeof t=="string"){const r=this.#e.get(t);r?r.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Ee(e);if(typeof t=="string"){const r=this.#e.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ee(e);if(typeof t=="string"){const n=this.#e.get(t)?.find(s=>
1s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=Ee(e);return typeof t=="string"?this.#e.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){U.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>St(t,r))}findAll(e={}){return this.getAll().filter(t=>St(e,t))}notify(e){U.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return U.batch(()=>Promise.all(e.map(t=>t.continue().catch(H))))}};function Ee(e){return e.options.scope?.id}var yn=class extends fe{#t;#e=void 0;#r;#s;constructor(e,t){super(),this.#t=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#t.defaultMutationOptions(e),Pe(this.options,t)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&ne(t.mutationKey)!==ne(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#i(e)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#i()}mutate(e,t){return this.#s=t,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(e)}#n(){const e=this.#r?.state??tr();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#i(e){U.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#e.variables,r=this.#e.context,n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,r,n),this.#s.onSettled?.(e.data,null,t,r,n)):e?.type==="error"&&(this.#s.onError?.(e.error,t,r,n),this.#s.onSettled?.(void 0,e.error,t,r,n))}this.listeners.forEach(t=>{t(this.#e)})})}};function Qt(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function vn(e,t,r){const n=e.slice(0);return n[t]=r,n}var mn=class extends fe{#t;#e;#r;#s;#n;#i;#a;#o;#h=[];constructor(e,t,r){super(),this.#t=e,this.#s=r,this.#r=[],this.#n=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,U.batch(()=>{const r=this.#n,n=this.#c(this.#r);this.#h=n,n.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const s=n.map(l=>l.observer),i=s.map(l=>l.getCurrentResult()),o=r.length!==s.length,a=s.some((l,f)=>l!==r[f]),u=o||a,c=u?!0:i.some((l,f)=>{const p=this.#e[f];return!p||!Pe(l,p)});!u&&!c||(u&&(this.#n=s),this.#e=i,this.hasListeners()&&(u&&(Qt(r,s).forEach(l=>{l.destroy()}),Qt(s,r).forEach(l=>{l.subscribe(f=>{this.#l(l,f)})})),this.#u()))})}getCurrentResult(){return this.#e}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#c(e),n=r.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[n,s=>this.#d(s??n,t),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{const s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,i=>{t.forEach(o=>{o.observer.trackProp(i)})})})}#d(e,t){return t?((!this.#i||this.#e!==this.#o||t!==this.#a)&&(this.#a=t,this.#o=this.#e,this.#i=vt(this.#i,t(e))),this.#i):e}#c(e){const t=new Map;this.#n.forEach(n=>{const s=n.options.queryHash;if(!s)return;const i=t.get(s);i?i.push(n):t.set(s,[n])});const r=[];return e.forEach(n=>{const s=this.#t.defaultQueryOptions(n),o=t.get(s.queryHash)?.shift()??new _e(this.#t,s);r.push({defaultedQueryOptions:s,observer:o})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#e=vn(this.#e,r,t),this.#u())}#u(){if(this.hasListeners()){const e=this.#i,t=this.#f(this.#e,this.#h),r=this.#d(t,this.#s?.combine);e!==r&&U.batch(()=>
vendor: 5,563 bytes, line 1
1{this.listeners.forEach(n=>{n(this.#e)})})}}},bn=class extends fe{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,r){const n=t.queryKey,s=t.queryHash??yt(n,t);let i=this.get(s);return i||(i=new un({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){U.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>xt(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>xt(e,r)):t}notify(e){U.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){U.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){U.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gn=class{#t;#e;#r;#s;#n;#i;#a;#o;constructor(e={}){this.#t=e.queryCache||new bn,this.#e=e.mutationCache||new pn,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=mt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=ke.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#t.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(re(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=this.#t.get(n.queryHash)?.state.data,o=Jr(t,i);if(o!==void 0)return this.#t.build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return U.batch(()=>this.#t.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;U.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#t;return U.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=U.batch(()=>this.#t.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(H).catch(H)}invalidateQueries(e,t={}){return U.batch(()=>(this.#t.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=U.batch(()=>this.#t.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(H)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(H)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#t.build(this,t);return r.isStaleByTime(re(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(H).catch(H)}fetchInfiniteQuery(e){return e.behavior=Fe(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(H).catch(H)}ensureInfiniteQueryData(e){return e.behavior=Fe(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ke.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(ne(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{Oe(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(ne(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{Oe(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yt(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===V&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},rr=_.createContext(void 0),Ce=e=>{const t=_.useContext(rr);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},On=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Ae.jsx(rr.Provider,{value:e,children:t})),nr=_.createContext(!1),sr=()=>_.useContext(nr);nr.Provider;function Pn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
1var wn=_.createContext(Pn()),ir=()=>_.useContext(wn),or=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},ar=e=>{_.useEffect(()=>{e.clearReset()},[e])},ur=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Wt(r,[e.error,n])),gt=(e,t)=>t.state.data===void 0,cr=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},lr=(e,t)=>e.isLoading&&e.isFetching&&!t,at=(e,t)=>e?.suspense&&t.isPending,Ue=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function fr({queries:e,...t},r){const n=Ce(r),s=sr(),i=ir(),o=_.useMemo(()=>e.map(h=>{const C=n.defaultQueryOptions(h);return C._optimisticResults=s?"isRestoring":"optimistic",C}),[e,n,s]);o.forEach(h=>{cr(h),or(h,i)}),ar(i);const[a]=_.useState(()=>new mn(n,o,t)),[u,c,l]=a.getOptimisticResult(o,t.combine),f=!s&&t.subscribed!==!1;_.useSyncExternalStore(_.useCallback(h=>f?a.subscribe(U.batchCalls(h)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),_.useEffect(()=>{a.setQueries(o,t)},[o,t,a]);const v=u.some((h,C)=>at(o[C],h))?u.flatMap((h,C)=>{const j=o[C];if(j){const Q=new _e(n,j);if(at(j,h))return Ue(j,Q,i);lr(h,s)&&Ue(j,Q,i)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=u.find((h,C)=>{const j=o[C];return j&&ur({result:h,errorResetBoundary:i,throwOnError:j.throwOnError,query:n.getQueryCache().get(j.queryHash),suspense:j.suspense})});if(b?.error)throw b.error;return c(l())}function Ne(e,t,r){const n=sr(),s=ir(),i=Ce(r),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=n?"isRestoring":"optimistic",cr(o),or(o,s),ar(s);const a=!i.getQueryCache().get(o.queryHash),[u]=_.useState(()=>new t(i,o)),c=u.getOptimisticResult(o),l=!n&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(f=>{const p=l?u.subscribe(U.batchCalls(f)):H;return u.updateResult(),p},[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),_.useEffect(()=>{u.setOptions(o)},[o,u]),at(o,c))throw Ue(o,u,s);if(ur({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(o,c),o.experimental_prefetchInRender&&!ce&&lr(c,n)&&(a?Ue(o,u,s):i.getQueryCache().get(o.queryHash)?.promise)?.catch(H).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?c:u.trackResult(c)}function xn(e,t){return Ne(e,_e,t)}function Sn(e,t){return Ne({...e,enabled:!0,suspense:!0,throwOnError:gt,placeholderData:void 0},_e,t)}function _n(e,t){return Ne({...e,enabled:!0,suspense:!0,throwOnError:gt},er,t)}function Cn(e,t){return fr({...e,queries:e.queries.map(r=>({...r,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},t)}function Rn(e,t){const r=Ce(t);r.getQueryState(e.queryKey)||r.prefetchQuery(e)}function jn(e,t){const r=Ce(t);r.getQueryState(e.queryKey)||r.prefetchInfiniteQuery(e)}function En(e,t){const r=Ce(t),[n]=_.useState(()=>new yn(r,e));_.useEffect(()=>{n.setOptions(e)},[n,e]);const s=_.useSyncExternalStore(_.useCallback(o=>n.subscribe(U.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=_.useCallback((o,a)=>{n.mutate(o,a).catch(H)},[n]);if(s.error&&Wt(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function In(e,t){return Ne(e,er,t)}var Qn=Object.create,dr=Object.defineProperty,Tn=Object.getOwnPropertyDescriptor,hr=Object.getOwnPropertyNames,Mn=Object.getPrototypeOf,qn=Object.prototype.hasOwnProperty,X=(e,t)=>function(){return t||(0,e[hr(e)[0]])((t={exports:{}}).exports,t),t.exports},Dn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=hr(t),i=0,o=s.length,a;i<o;i++)a=s[i],!qn.call(e,a)&&a!==r&&dr(e,a,{get:(u=>t[u]).bind(null,a),enumerable:!(n=Tn(t,a))||n.enumerable});return e},$=(e,t,r)=>(r=e!=null?Qn(Mn(e)):{},Dn(dr(r,"default",{value:e,enumerable:!0}),e)),pr=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function r(n){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s}
1,t.exports.__esModule=!0,t.exports.default=t.exports,r(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),An=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var r=pr().default;function n(s,i){if(r(s)!="object"||!s)return s;var o=s[Symbol.toPrimitive];if(o!==void 0){var a=o.call(s,i||"default");if(r(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),kn=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var r=pr().default,n=An();function s(i){var o=n(i,"string");return r(o)=="symbol"?o:o+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),de=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var r=kn();function n(s,i,o){return(i=r(i))in s?Object.defineProperty(s,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):s[i]=o,s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),G=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var r=de();function n(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),a.push.apply(a,u)}return a}function s(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?n(Object(a),!0).forEach(function(u){r(i,u,a[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(a,u))})}return i}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});function Ke(e){const t={subscribe(r){let n=null,s=!1,i=!1,o=!1;function a(){if(n===null){o=!0;return}i||(i=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=e({next(u){var c;s||(c=r.next)===null||c===void 0||c.call(r,u)},error(u){var c;s||(s=!0,(c=r.error)===null||c===void 0||c.call(r,u),a())},complete(){var u;s||(s=!0,(u=r.complete)===null||u===void 0||u.call(r),a())}}),o&&a(),{unsubscribe:a}},pipe(...r){return r.reduce(Fn,t)}};return t}function Fn(e,t){return t(e)}function Un(e){const t=new AbortController;return new Promise((n,s)=>{let i=!1;function o(){i||(i=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{s(t.signal.reason)});const a=e.subscribe({next(u){i=!0,n(u),o()},error(u){s(u)},complete(){t.abort(),o()}})})}function $n(e){return t=>{let r=0,n=null;const s=[];function i(){n||(n=t.subscribe({next(a){for(const c of s){var u;(u=c.next)===null||u===void 0||u.call(c,a)}},error(a){for(const c of s){var u;(u=c.error)===null||u===void 0||u.call(c,a)}},complete(){for(const u of s){var a;(a=u.complete)===null||a===void 0||a.call(u)}}}))}function o(){if(r===0&&n){const a=n;n=null,a.unsubscribe()}}return Ke(a=>(r++,s.push(a),i(),{unsubscribe(){r--,o();const u=s.findIndex(c=>c===a);u>-1&&s.splice(u,1)}}))}}function Nn(e){let t=e;const r=[],n=o=>{t!==void 0&&o.next(t),r.push(o)},s=o=>{r.splice(r.indexOf(o),1)},i=Ke(o=>(n(o),()=>{s(o)}));return i.next=o=>{if(t!==o){t=o;for(const a of r)a.next(o)}},i.get=()=>t,i}function Kn(e){return Ke(t=>{function r(s=0,i=e.op){const o=e.links[s];if(!o)throw new Error("No more links to execute - did you forget to add an ending link?");return o({op:i,next(u){return r(s+1,u)}})}return r().subscribe(t)})}function le(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const Ln=typeof Symbol=="function"&&!!Symbol.asyncIterator;function yr(e){return Ln&&le(e)&&Symbol.asyncIterator in e}var Hn=Object.create,vr=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,mr=Object.getOwnPropertyNames,Vn=Object.getPrototypeOf,Bn=Object.prototype.hasOwnProperty,Re=(e,t)=>function(){return t||(0,e[mr(e)[0]])((t={exports:{}}).exports,t),t.exports},Wn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=mr(t),i=0,o=s.length,a;i<o;i++)a=s[i],!Bn.call(e,a)&&a!==r&&vr(e,a,{get:(u=>t[u]).bind(null,a),enumerable:!(n=zn(t,a))||n.enumerable});return e},Le=(e,t,r)=>(r=e!=null?Hn(Vn(e)):{},Wn(vr(r,"default",{value:e,enumerable:!0}),e));const br=()=>{},Tt=e=>{Object.freeze&&Object.freeze(e)};function gr(e,t,r){var n;const s=t.join(".");return(n=r[s])!==null&&n!==void 0||(r[s]=new Proxy(br,{get(i,o){if(!(typeof o!="string"||o==="then"))return gr(e,[...t,o],r)},apply(i,o,a){const u=t[t.length-1];let c={args:a,path:t};return u==="call"?c={args:a.length>=2?[a[1]]:[],path:t.slice(0,-1)}:u==="apply"&&(c={args:a.length>=2?a[1]:[],path:t.slice(0,-1)}),Tt(c.args),Tt(c.path),e(c)}})),r[s]}const He=e=>gr(e,[],Object.create(null)),Ot=e=>new Proxy(br,{get(t,r){if(r!=="then")return e(r)}});var Or=Re({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function r(n){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s}
1,t.exports.__esModule=!0,t.exports.default=t.exports,r(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Gn=Re({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var r=Or().default;function n(s,i){if(r(s)!="object"||!s)return s;var o=s[Symbol.toPrimitive];if(o!==void 0){var a=o.call(s,i||"default");if(r(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Yn=Re({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var r=Or().default,n=Gn();function s(i){var o=n(i,"string");return r(o)=="symbol"?o:o+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Pr=Re({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var r=Yn();function n(s,i,o){return(i=r(i))in s?Object.defineProperty(s,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):s[i]=o,s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Pt=Re({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var r=Pr();function n(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),a.push.apply(a,u)}return a}function s(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?n(Object(a),!0).forEach(function(u){r(i,u,a[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(a,u))})}return i}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});Le(Pt());Le(Pr());var Ie=Le(Pt());function Jn(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:(0,Ie.default)((0,Ie.default)({},e),{},{error:n})}}return{ok:!0,result:(0,Ie.default)((0,Ie.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var We=class extends Error{constructor(){super("Unable to transform response from server")}};function Zn(e,t){let r;try{r=Jn(e,t)}catch{throw new We}if(!r.ok&&(!le(r.error.error)||typeof r.error.error.code!="number"))throw new We;if(r.ok&&!le(r.result))throw new We;return r}Le(Pt());var Qe=$(de()),pe=$(G());function Xn(e){return e instanceof $e}function es(e){return le(e)&&le(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function ts(e,t){return typeof e=="string"?e:le(e)&&typeof e.message=="string"?e.message:t}var $e=class Me extends Error{constructor(t,r){var n,s;const i=r?.cause;super(t,{cause:i}),(0,Qe.default)(this,"cause",void 0),(0,Qe.default)(this,"shape",void 0),(0,Qe.default)(this,"data",void 0),(0,Qe.default)(this,"meta",void 0),this.meta=r?.meta,this.cause=i,this.shape=r==null||(n=r.result)===null||n===void 0?void 0:n.error,this.data=r==null||(s=r.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Me.prototype)}static from(t,r={}){const n=t;return Xn(n)?(r.meta&&(n.meta=(0,pe.default)((0,pe.default)({},n.meta),r.meta)),n):es(n)?new Me(n.error.message,(0,pe.default)((0,pe.default)({},r),{},{result:n})):new Me(ts(n,"Unknown error"),(0,pe.default)((0,pe.default)({},r),{},{cause:n}))}};function rs(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}const Mt=e=>typeof e=="function";function ns(e){if(e)return e;if(typeof window<"u"&&Mt(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Mt(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var be=$(G());function ss(e){return{url:e.url.toString(),fetch:e.fetch,transformer:rs(e.transformer),methodOverride:e.methodOverride}}function is(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[r]=n}return t}const os={query:"GET",mutation:"POST",subscription:"PATCH"};function wr(e){return"input"in e?e.transformer.input.serialize(e.input):is(e.inputs.map(t=>e.transformer.input.serialize(t)))}const xr=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const s=[];if(t[1]&&s.push(t[1]),"inputs"in e&&s.push("batch=1"),e.type==="query"||e.type==="subscription"){const i=wr(e);i!==void 0&&e.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return s.length&&(n+="?"+s.join("&")),n},as=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=wr(e);return t!==void 0?JSON.stringify(t):void 0},us=e=>ds((0,be.default)((0,be.default)({},e),{},{contentTypeHeader:"application/json",getUrl:xr,getBody:as}));
1var cs=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const ls=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new cs};async function fs(e){var t;ls(e.signal);const r=e.getUrl(e),n=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:os[e.type],i=await(async()=>{const a=await e.headers();return Symbol.iterator in a?Object.fromEntries(a):a})(),o=(0,be.default)((0,be.default)((0,be.default)({},e.contentTypeHeader&&s!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),i);return ns(e.fetch)(r,{method:s,signal:e.signal,body:n,headers:o})}async function ds(e){const t={},r=await fs(e);t.response=r;const n=await r.json();return t.responseJSON=n,{json:n,meta:t}}$(G());const qt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Dt(e){let t=null,r=null;const n=()=>{clearTimeout(r),r=null,t=null};function s(a){const u=[[]];let c=0;for(;;){const p=a[c];if(!p)break;const v=u[u.length-1];if(p.aborted){var l;(l=p.reject)===null||l===void 0||l.call(p,new Error("Aborted")),c++;continue}if(e.validate(v.concat(p).map(h=>h.key))){v.push(p),c++;continue}if(v.length===0){var f;(f=p.reject)===null||f===void 0||f.call(p,new Error("Input is too big for a single dispatch")),c++;continue}u.push([])}return u}function i(){const a=s(t);n();for(const u of a){if(!u.length)continue;const c={items:u};for(const f of u)f.batch=c;e.fetch(c.items.map(f=>f.key)).then(async f=>{await Promise.all(f.map(async(v,b)=>{const h=c.items[b];try{var C;const Q=await Promise.resolve(v);(C=h.resolve)===null||C===void 0||C.call(h,Q)}catch(Q){var j;(j=h.reject)===null||j===void 0||j.call(h,Q)}h.batch=null,h.reject=null,h.resolve=null}));for(const v of c.items){var p;(p=v.reject)===null||p===void 0||p.call(v,new Error("Missing result")),v.batch=null}}).catch(f=>{for(const v of c.items){var p;(p=v.reject)===null||p===void 0||p.call(v,f),v.batch=null}})}}function o(a){var u;const c={aborted:!1,key:a,batch:null,resolve:qt,reject:qt},l=new Promise((f,p)=>{var v;c.reject=p,c.resolve=f,(v=t)!==null&&v!==void 0||(t=[]),t.push(c)});return(u=r)!==null&&u!==void 0||(r=setTimeout(i)),l}return{load:o}}function hs(...e){const t=new AbortController,r=e.length;let n=0;const s=()=>{++n===r&&t.abort()};for(const i of e)i?.aborted?s():i?.addEventListener("abort",s,{once:!0});return t.signal}var Te=$(G());function ps(e){var t,r;const n=ss(e),s=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(r=e.maxItems)!==null&&r!==void 0?r:1/0;return()=>{const o=l=>({validate(f){if(s===1/0&&i===1/0)return!0;if(f.length>i)return!1;const p=f.map(h=>h.path).join(","),v=f.map(h=>h.input);return xr((0,Te.default)((0,Te.default)({},n),{},{type:l,path:p,inputs:v,signal:null})).length<=s},async fetch(f){const p=f.map(Q=>Q.path).join(","),v=f.map(Q=>Q.input),b=hs(...f.map(Q=>Q.signal)),h=await us((0,Te.default)((0,Te.default)({},n),{},{path:p,inputs:v,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:f}):e.headers:{}},signal:b}));return(Array.isArray(h.json)?h.json:f.map(()=>h.json)).map(Q=>({meta:h.meta,json:Q}))}}),a=Dt(o("query")),u=Dt(o("mutation")),c={query:a,mutation:u};return({op:l})=>Ke(f=>{if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const v=c[l.type].load(l);let b;return v.then(h=>{b=h;const C=Zn(h.json,n.transformer.output);if(!C.ok){f.error($e.from(C.error,{meta:h.meta}));return}f.next({context:h.meta,result:C.result}),f.complete()}).catch(h=>{f.error($e.from(h,{meta:b?.meta}))}),()=>{}})}}$(G());const Sr=(e,...t)=>typeof e=="function"?e(...t):e;$(de());function ys(){let e,t;return{promise:new Promise((n,s)=>{e=n,t=s}),resolve:e,reject:t}}async function vs(e){const t=await Sr(e.url);if(!e.connectionParams)return t;const n=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+n}async function ms(e){const t={method:"connectionParams",data:await Sr(e)};return JSON.stringify(t)}$(de());var ae=$(de());function bs(e){const{promise:t,resolve:r,reject:n}=ys();return e.addEventListener("open",()=>{e.removeEventListener("error",n),r()}),e.addEventListener("error",n),t}function gs(e,{intervalMs:t,pongTimeoutMs:r}){let n,s;function i(){n=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},r)},t)}function o(){clearTimeout(n),i()}function a(){clearTimeout(s),o()}e.addEventListener("open",i),e.addEventListener("message",({data:u})=>{clearTimeout(n),i(),u==="PONG"&&a()}),e.addEventListener("close",()=>{clearTimeout(n),clearTimeout(s)})}var Os=class ut{constructor(t){var r;if((0,ae.default)(this,"id",++ut.connectCount),(0,ae.default)(this,"WebSocketPonyfill",void 0),(0,ae.default)(this,"urlOptions",void 0),(0,ae.default)(this,"keepAliveOpts",void 0),(0,ae.default)(this,"wsObservable",Nn(null)),(0,ae.default)(this,"openPromise",null),this.WebSocketPonyfill=(r=t.WebSocketPonyfill)!==null&&r!==void 0?r:WebSocket,!this.WebSocketPonyfill)throw new 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=t.urlOptions,this.keepAliveOpts=t.keepAlive}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}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(){var t=this;if(t.openPromise)return t.openPromise;t.id=++ut.connectCount;const r=vs(t.urlOptions).then(n=>new t.WebSocketPonyfill(n));t.openPromise=r.then(async n=>{t.ws=n,n.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&gs(n,t.keepAliveOpts),n.addEventListener("close",()=>{t.ws===n&&(t.ws=null)}),await bs(n),t.urlOptions.connectionParams&&n.send(await ms(t.urlOptions.connectionParams))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var r;(r=t.ws)===null||r===void 0||r.close()}}};(0,ae.default)(Os,"connectCount",0);$(de());$(G());var Ge=$(de()),At=$(G()),ze=class{constructor(e){(0,Ge.default)(this,"links",void 0),(0,Ge.default)(this,"runtime",void 0),(0,Ge.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Kn({links:this.links,op:(0,At.default)((0,At.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe($n())}async requestAsPromise(e){var t=this;try{const r=t.$request(e);return(await Un(r)).result.data}catch(r){throw $e.from(r)}}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(s){switch(s.result.type){case"state":{var i;(i=r.onConnectionStateChange)===null||i===void 0||i.call(r,s.result);break}case"started":{var o;(o=r.onStarted)===null||o===void 0||o.call(r,{context:s.context});break}case"stopped":{var a;(a=r.onStopped)===null||a===void 0||a.call(r);break}case"data":case void 0:{var u;(u=r.onData)===null||u===void 0||u.call(r,s.result.data);break}}},error(s){var i;(i=r.onError)===null||i===void 0||i.call(r,s)},complete(){var s;(s=r.onComplete)===null||s===void 0||s.call(r)}})}};const _r=Symbol.for("trpc_untypedClient"),Ps={query:"query",mutate:"mutation",subscribe:"subscription"},ws=e=>Ps[e];function Cr(e){const t=He(({path:r,args:n})=>{const s=[...r],i=ws(s.pop()),o=s.join(".");return e[i](o,...n)});return Ot(r=>r===_r?e:t[r])}function xs(e){const t=new ze(e);return Cr(t)}function wt(e){return e[_r]}$(G());$(G());var Ss=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function r(s){var i,o,a,u=2;for(typeof Symbol<"u"&&(o=Symbol.asyncIterator,a=Symbol.iterator);u--;){if(o&&(i=s[o])!=null)return i.call(s);if(a&&(i=s[a])!=null)return new n(i.call(s));o="@@asyncIterator",a="@@iterator"}throw new TypeError("Object is not async iterable")}function n(s){function i(o){if(Object(o)!==o)return Promise.reject(new TypeError(o+" is not an object."));var a=o.done;return Promise.resolve(o.value).then(function(u){return{value:u,done:a}})}return n=function(a){this.s=a,this.n=a.next},n.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(a){var u=this.s.return;return u===void 0?Promise.resolve({value:a,done:!0}):i(u.apply(this.s,arguments))},throw:function(a){var u=this.s.return;return u===void 0?Promise.reject(a):i(u.apply(this.s,arguments))}},new n(s)}
1t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});$(Ss());$(G());var _s=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function r(){var n=typeof SuppressedError=="function"?SuppressedError:function(a,u){var c=Error();return c.name="SuppressedError",c.error=a,c.suppressed=u,c},s={},i=[];function o(a,u){if(u!=null){if(Object(u)!==u)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(a)var c=u[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(c===void 0&&(c=u[Symbol.dispose||Symbol.for("Symbol.dispose")],a))var l=c;if(typeof c!="function")throw new TypeError("Object is not disposable.");l&&(c=function(){try{l.call(u)}catch(p){return Promise.reject(p)}}),i.push({v:u,d:c,a})}else a&&i.push({d:u,a});return u}return{e:s,u:o.bind(null,!1),a:o.bind(null,!0),d:function(){var u,c=this.e,l=0;function f(){for(;u=i.pop();)try{if(!u.a&&l===1)return l=0,i.push(u),Promise.resolve().then(f);if(u.d){var v=u.d.call(u.v);if(u.a)return l|=2,Promise.resolve(v).then(f,p)}else l|=1}catch(b){return p(b)}if(l===1)return c!==s?Promise.reject(c):Promise.resolve();if(c!==s)throw c}function p(v){return c=c!==s?new n(v,c):v,f()}return f()}}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Rr=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function r(n,s){this.v=n,this.k=s}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Cs=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var r=Rr();function n(s){return new r(s,0)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Rs=X({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var r=Rr();function n(i){return function(){return new s(i.apply(this,arguments))}}function s(i){var o,a;function u(l,f){try{var p=i[l](f),v=p.value,b=v instanceof r;Promise.resolve(b?v.v:v).then(function(h){if(b){var C=l==="return"?"return":"next";if(!v.k||h.done)return u(C,h);h=i[C](h).value}c(p.done?"return":"normal",h)},function(h){u("throw",h)})}catch(h){c("throw",h)}}function c(l,f){switch(l){case"return":o.resolve({value:f,done:!0});break;case"throw":o.reject(f);break;default:o.resolve({value:f,done:!1})}(o=o.next)?u(o.key,o.arg):a=null}this._invoke=function(l,f){return new Promise(function(p,v){var b={key:l,arg:f,resolve:p,reject:v,next:null};a?a=a.next=b:(o=a=b,u(l,f))})},typeof i.return!="function"&&(this.return=void 0)}s.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(i){return this._invoke("next",i)},s.prototype.throw=function(i){return this._invoke("throw",i)},s.prototype.return=function(i){return this._invoke("return",i)},t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});$(_s());$(Cs());$(Rs());$(G());var js=Object.create,jr=Object.defineProperty,Es=Object.getOwnPropertyDescriptor,Er=Object.getOwnPropertyNames,Is=Object.getPrototypeOf,Qs=Object.prototype.hasOwnProperty,ie=(e,t)=>function(){return t||(0,e[Er(e)[0]])((t={exports:{}}).exports,t),t.exports},Ts=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=Er(t),i=0,o=s.length,a;i<o;i++)a=s[i],!Qs.call(e,a)&&a!==r&&jr(e,a,{get:(u=>t[u]).bind(null,a),enumerable:!(n=Es(t,a))||n.enumerable});return e},he=(e,t,r)=>(r=e!=null?js(Is(e)):{},Ts(t||!e||!e.__esModule?jr(r,"default",{value:e,enumerable:!0}):r,e)),Ms=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function r(n,s){if(n==null)return{};var i={};for(var o in n)if({}.hasOwnProperty.call(n,o)){if(s.includes(o))continue;i[o]=n[o]}return i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),qs=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var r=Ms();
1function n(s,i){if(s==null)return{};var o,a,u=r(s,i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);for(a=0;a<c.length;a++)o=c[a],i.includes(o)||{}.propertyIsEnumerable.call(s,o)&&(u[o]=s[o])}return u}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ir=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function r(n){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,r(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ds=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var r=Ir().default;function n(s,i){if(r(s)!="object"||!s)return s;var o=s[Symbol.toPrimitive];if(o!==void 0){var a=o.call(s,i||"default");if(r(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),As=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var r=Ir().default,n=Ds();function s(i){var o=n(i,"string");return r(o)=="symbol"?o:o+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),ks=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var r=As();function n(s,i,o){return(i=r(i))in s?Object.defineProperty(s,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):s[i]=o,s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),je=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var r=ks();function n(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),a.push.apply(a,u)}return a}function s(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?n(Object(a),!0).forEach(function(u){r(i,u,a[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(a,u))})}return i}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Fs=he(qs(),1),kt=he(je(),1);const Us=["cursor","direction"];function Z(e,t,r){const n=e.flatMap(s=>s.split("."));if(!t&&(!r||r==="any"))return n.length?[n]:[];if(r==="infinite"&&le(t)&&("direction"in t||"cursor"in t)){const{cursor:s,direction:i}=t,o=(0,Fs.default)(t,Us);return[n,{input:o,type:"infinite"}]}return[n,(0,kt.default)((0,kt.default)({},typeof t<"u"&&t!==V&&{input:t}),r&&r!=="any"&&{type:r})]}function qe(e){return Z(e,void 0,"any")}function $s(e){return He(({path:t,args:r})=>{var n;const s=[...t],i=s.pop();if(i==="useMutation")return e[i](s,...r);if(i==="_def")return{path:s};const[o,...a]=r,u=(n=a[0])!==null&&n!==void 0?n:{};return e[i](s,o,u)})}var Ye;const Ns=["client","ssrContext","ssrState","abortOnUnmount"],Ks=(Ye=_.createContext)===null||Ye===void 0?void 0:Ye.call(Br,null),Ls=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"}};function Hs(e){return He(t=>{const r=[...t.path],n=r.pop(),s=[...t.args],i=s.shift(),o=Ls(n),a=Z(r,i,o);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(r,a,s[0]),queryOptions:()=>e.queryOptions(r,a,...s),fetch:()=>e.fetchQuery(a,...s),fetchInfinite:()=>e.fetchInfiniteQuery(a,s[0]),prefetch:()=>e.prefetchQuery(a,...s),prefetchInfinite:()=>e.prefetchInfiniteQuery(a,s[0]),ensureData:()=>e.ensureQueryData(a,...s),invalidate:()=>e.invalidateQueries(a,...s),reset:()=>e.resetQueries(a,...s),refetch:()=>e.refetchQueries(a,...s),cancel:()=>e.cancelQuery(a,...s),setData:()=>{e.setQueryData(a,s[0],s[1])},setQueriesData:()=>e.setQueriesData(a,s[0],s[1],s[2]),setInfiniteData:()=>{e.setInfiniteQueryData(a,s[0],s[1])},getData:()=>e.getQueryData(a),getInfiniteData:()=>e.getInfiniteQueryData(a),setMutationDefaults:()=>e.setMutationDefaults(qe(r),i),getMutationDefaults:()=>e.getMutationDefaults(qe(r)),isMutating:()=>e.isMutating({mutationKey:qe(r)})}[n]()})}function zs(e){const t=Cr(e.client),r=Hs(e);return Ot(n=>{const s=n;return s==="client"?t:Ns.includes(s)?e[s]:r[n]})}var Vs=he(je(),1);function Ft(e){const t=e instanceof ze?e:wt(e);return He(r=>{const n=r.path,s=n.join("."),[i,o]=r.args;return(0,Vs.default)({queryKey:Z(n,i,"query"),queryFn:()=>t.query(s,i,o?.trpc)},o)})}var Je=he(je(),1);function z(e,t,r){var n;const s=e[0];let i=(n=e[1])===null||n===void 0?void 0:n.input;if(r){var o;i=(0,Je.default)((0,Je.default)((0,Je.default)({},(o=i)!==null&&o!==void 0?o:{}),r.pageParam?{cursor:r.pageParam}:{}),{},{direction:r.direction})}return[s.join("."),i,t?.trpc]}var Bs=ie({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function r(s){var i,o,a,u=2;for(typeof Symbol<"u"&&(o=Symbol.asyncIterator,a=Symbol.iterator);u--;){if(o&&(i=s[o])!=null)return i.call(s);if(a&&(i=s[a])!=null)return new n(i.call(s));o="@@asyncIterator",a="@@iterator"}throw new TypeError("Object is not async iterable")}function n(s){function i(o){if(Object(o)!==o)return Promise.reject(new TypeError(o+" is not an object."));var a=o.done;return Promise.resolve(o.value).then(function(u){return{value:u,done:a}})}return n=function(a){this.s=a,this.n=a.next},n.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(a){var u=this.s.return;return u===void 0?Promise.resolve({value:a,done:!0}):i(u.apply(this.s,arguments))},throw:function(a){var u=this.s.return;return u===void 0?Promise.reject(a):i(u.apply(this.s,arguments))}},new n(s)}
1t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ws=he(Bs(),1);function ct(e){return{path:e.path.join(".")}}function me(e){const t=ct(e);return _.useMemo(()=>t,[t])}async function Qr(e,t,r){const s=t.getQueryCache().build(t,{queryKey:r});s.setState({data:[],status:"success"});const i=[];var o=!1,a=!1,u;try{for(var c=(0,Ws.default)(e),l;o=!(l=await c.next()).done;o=!1){const f=l.value;i.push(f),s.setState({data:[...i]})}}catch(f){a=!0,u=f}finally{try{o&&c.return!=null&&await c.return()}finally{if(a)throw u}}return i}var E=he(je(),1);function Gs(e){const{client:t,queryClient:r}=e,n=t instanceof ze?t:wt(t);return{infiniteQueryOptions:(s,i,o)=>{var a,u;const c=((a=i[1])===null||a===void 0?void 0:a.input)===V,l=async f=>{var p;const v=(0,E.default)((0,E.default)({},o),{},{trpc:(0,E.default)((0,E.default)({},o?.trpc),!(o==null||(p=o.trpc)===null||p===void 0)&&p.abortOnUnmount?{signal:f.signal}:{signal:null})});return await n.query(...z(i,v,{direction:f.direction,pageParam:f.pageParam}))};return Object.assign((0,E.default)((0,E.default)({},o),{},{initialData:o?.initialData,queryKey:i,queryFn:c?V:l,initialPageParam:(u=o?.initialCursor)!==null&&u!==void 0?u:null}),{trpc:ct({path:s})})},queryOptions:(s,i,o)=>{var a;const u=((a=i[1])===null||a===void 0?void 0:a.input)===V,c=async l=>{var f;const p=(0,E.default)((0,E.default)({},o),{},{trpc:(0,E.default)((0,E.default)({},o?.trpc),!(o==null||(f=o.trpc)===null||f===void 0)&&f.abortOnUnmount?{signal:l.signal}:{signal:null})}),v=await n.query(...z(i,p));return yr(v)?Qr(v,r,i):v};return Object.assign((0,E.default)((0,E.default)({},o),{},{initialData:o?.initialData,queryKey:i,queryFn:u?V:c}),{trpc:ct({path:s})})},fetchQuery:(s,i)=>r.fetchQuery((0,E.default)((0,E.default)({},i),{},{queryKey:s,queryFn:()=>n.query(...z(s,i))})),fetchInfiniteQuery:(s,i)=>{var o;return r.fetchInfiniteQuery((0,E.default)((0,E.default)({},i),{},{queryKey:s,queryFn:({pageParam:a,direction:u})=>n.query(...z(s,i,{pageParam:a,direction:u})),initialPageParam:(o=i?.initialCursor)!==null&&o!==void 0?o:null}))},prefetchQuery:(s,i)=>r.prefetchQuery((0,E.default)((0,E.default)({},i),{},{queryKey:s,queryFn:()=>n.query(...z(s,i))})),prefetchInfiniteQuery:(s,i)=>{var o;return r.prefetchInfiniteQuery((0,E.default)((0,E.default)({},i),{},{queryKey:s,queryFn:({pageParam:a,direction:u})=>n.query(...z(s,i,{pageParam:a,direction:u})),initialPageParam:(o=i?.initialCursor)!==null&&o!==void 0?o:null}))},ensureQueryData:(s,i)=>r.ensureQueryData((0,E.default)((0,E.default)({},i),{},{queryKey:s,queryFn:()=>n.query(...z(s,i))})),invalidateQueries:(s,i,o)=>r.invalidateQueries((0,E.default)((0,E.default)({},i),{},{queryKey:s}),o),resetQueries:(s,i,o)=>r.resetQueries((0,E.default)((0,E.default)({},i),{},{queryKey:s}),o),refetchQueries:(s,i,o)=>r.refetchQueries((0,E.default)((0,E.default)({},i),{},{queryKey:s}),o),cancelQuery:(s,i)=>r.cancelQueries({queryKey:s},i),setQueryData:(s,i,o)=>r.setQueryData(s,i,o),setQueriesData:(s,i,o,a)=>r.setQueriesData((0,E.default)((0,E.default)({},i),{},{queryKey:s}),o,a),getQueryData:s=>r.getQueryData(s),setInfiniteQueryData:(s,i,o)=>r.setQueryData(s,i,o),getInfiniteQueryData:s=>r.getQueryData(s),setMutationDefaults:(s,i)=>{const o=s[0],a=u=>n.mutation(...z([o,{input:u}],e));return r.setMutationDefaults(s,typeof i=="function"?i({canonicalMutationFn:a}):i)},getMutationDefaults:s=>r.getMutationDefaults(s),isMutating:s=>r.isMutating((0,E.default)((0,E.default)({},s),{},{exact:!0}))}}var y=he(je());const Ut=(e,t)=>new Proxy(e,{get(n,s){return t(s),n[s]}});function Ys(e){var t,r;const n=(t=void 0)!==null&&t!==void 0?t:O=>O.originalFn(),s=(r=void 0)!==null&&r!==void 0?r:Ks,i=xs,o=O=>{var g;const{abortOnUnmount:d=!1,queryClient:m,ssrContext:w}=O,[P,x]=_.useState((g=O.ssrState)!==null&&g!==void 0?g:!1),S=O.client instanceof ze?O.client:wt(O.client),M=_.useMemo(()=>Gs({client:S,queryClient:m}),[S,m]),I=_.useMemo(()=>(0,y.default)({abortOnUnmount:d,queryClient:m,client:S,ssrContext:w??null,ssrState:P},M),[d,S,M,m,w,P]);return _.useEffect(()=>{x(D=>D?"mounted":!1)},[]),Ae.jsx(s.Provider,{value:I,children:O.children})};function a(){const O=_.useContext(s);if(!O)throw new Error("Unable to find tRPC Context. Did you forget to wrap your Ap
1p inside `withTRPC` HoC?");return O}function u(O,g){var d;const{queryClient:m,ssrState:w}=a();return w&&w!=="mounted"&&((d=m.getQueryCache().find({queryKey:O}))===null||d===void 0?void 0:d.state.status)==="error"?(0,y.default)({retryOnMount:!1},g):g}function c(O,g,d){var m,w,P,x,S;const M=a(),{abortOnUnmount:I,client:D,ssrState:T,queryClient:k,prefetchQuery:F}=M,K=Z(O,g,"query"),ee=k.getQueryDefaults(K),N=g===V;typeof window>"u"&&T==="prepass"&&(d==null||(m=d.trpc)===null||m===void 0?void 0:m.ssr)!==!1&&((w=d?.enabled)!==null&&w!==void 0?w:ee?.enabled)!==!1&&!N&&!k.getQueryCache().find({queryKey:K})&&F(K,d);const B=u(K,(0,y.default)((0,y.default)({},ee),d)),A=(P=(x=d==null||(S=d.trpc)===null||S===void 0?void 0:S.abortOnUnmount)!==null&&x!==void 0?x:void 0)!==null&&P!==void 0?P:I,q=xn((0,y.default)((0,y.default)({},B),{},{queryKey:K,queryFn:N?g:async L=>{const oe=(0,y.default)((0,y.default)({},B),{},{trpc:(0,y.default)((0,y.default)({},B?.trpc),A?{signal:L.signal}:{signal:null})}),Be=await D.query(...z(K,oe));return yr(Be)?Qr(Be,k,K):Be}}),k);return q.trpc=me({path:O}),q}function l(O,g,d){var m,w,P;const x=a(),S=Z(O,g,"query"),M=g===V,I=(m=(w=d==null||(P=d.trpc)===null||P===void 0?void 0:P.abortOnUnmount)!==null&&w!==void 0?w:void 0)!==null&&m!==void 0?m:x.abortOnUnmount;Rn((0,y.default)((0,y.default)({},d),{},{queryKey:S,queryFn:M?g:D=>{const T={trpc:(0,y.default)((0,y.default)({},d?.trpc),I?{signal:D.signal}:{})};return x.client.query(...z(S,T))}}))}function f(O,g,d){var m,w,P;const x=a(),S=Z(O,g,"query"),M=(m=(w=d==null||(P=d.trpc)===null||P===void 0?void 0:P.abortOnUnmount)!==null&&w!==void 0?w:void 0)!==null&&m!==void 0?m:x.abortOnUnmount,I=Sn((0,y.default)((0,y.default)({},d),{},{queryKey:S,queryFn:D=>{const T=(0,y.default)((0,y.default)({},d),{},{trpc:(0,y.default)((0,y.default)({},d?.trpc),M?{signal:D.signal}:{signal:null})});return x.client.query(...z(S,T))}}),x.queryClient);return I.trpc=me({path:O}),[I.data,I]}function p(O,g){const{client:d,queryClient:m}=a(),w=qe(O),P=m.defaultMutationOptions(m.getMutationDefaults(w)),x=En((0,y.default)((0,y.default)({},g),{},{mutationKey:w,mutationFn:S=>d.mutation(...z([O,{input:S}],g)),onSuccess(...S){var M,I;return n({originalFn:()=>{var T,k,F;return(T=g==null||(k=g.onSuccess)===null||k===void 0?void 0:k.call(g,...S))!==null&&T!==void 0?T:P==null||(F=P.onSuccess)===null||F===void 0?void 0:F.call(P,...S)},queryClient:m,meta:(M=(I=g?.meta)!==null&&I!==void 0?I:P?.meta)!==null&&M!==void 0?M:{}})}}),m);return x.trpc=me({path:O}),x}const v={data:void 0,error:null,status:"idle"},b={data:void 0,error:null,status:"connecting"};function h(O,g,d){var m;const w=(m=d?.enabled)!==null&&m!==void 0?m:g!==V,P=ne(Z(O,g,"any")),{client:x}=a(),S=_.useRef(d);_.useEffect(()=>{S.current=d});const[M]=_.useState(new Set([])),I=_.useCallback(N=>{M.add(N)},[M]),D=_.useRef(null),T=_.useCallback(N=>{const B=F.current,A=F.current=N(B);let q=!1;for(const L of M)if(B[L]!==A[L]){q=!0;break}q&&ee(Ut(A,I))},[I,M]),k=_.useCallback(()=>{var N;if((N=D.current)===null||N===void 0||N.unsubscribe(),!w){T(()=>(0,y.default)((0,y.default)({},v),{},{reset:k}));return}T(()=>(0,y.default)((0,y.default)({},b),{},{reset:k}));const B=x.subscription(O.join("."),g??void 0,{onStarted:()=>{var A,q;(A=(q=S.current).onStarted)===null||A===void 0||A.call(q),T(L=>(0,y.default)((0,y.default)({},L),{},{status:"pending",error:null}))},onData:A=>{var q,L;(q=(L=S.current).onData)===null||q===void 0||q.call(L,A),T(oe=>(0,y.default)((0,y.default)({},oe),{},{status:"pending",data:A,error:null}))},onError:A=>{var q,L;(q=(L=S.current).onError)===null||q===void 0||q.call(L,A),T(oe=>(0,y.default)((0,y.default)({},oe),{},{status:"error",error:A}))},onConnectionStateChange:A=>{T(q=>{switch(A.state){case"idle":return(0,y.default)((0,y.default)({},q),{},{status:A.state,error:null,data:void 0});case"connecting":return(0,y.default)((0,y.default)({},q),{},{error:A.error,status:A.state});case"pending":return q}})},onComplete:()=>{var A,q;(A=(q=S.current).onComplete)===null||A===void 0||A.call(q),T(L=>(0,y.default)((0,y.default)({},L),{},{status:"idle",error:null,data:void 0}))}});D.current=B},[x,P,w,T]);_.useEffect(()=>(k(),()=>{var N;(N=D.current)===null||N===void 0||N.unsubscribe()}),[k]);const F=_.useRef(w?(0,y.default)((0,y.default)({},b),{},{reset:k}):(0,y.default)((0,y.default)({},v),{},{reset:k})),[K,ee]=_.useState(Ut(F.current,I));return K}function C(O,g,d){var m,w,P,x,S;const{client:M,ssrState:I,prefetchInfiniteQuery:D,queryClient:T,abortOnUnmount:k}=a(),F=Z(O,g,"infinite"),K=T.getQueryDefaults(F),ee=g===V;typeof window>"u"&&I==="prepass"&&(d==null||(m=d.trpc)===null||m===void 0?void 0:m.ssr)!==!1&&((w=d?.enabled)!==null&&w!==void 0?w:K?.enabled)!==!1&&!ee&&!T.getQueryCache().find({queryKey:F})&&D(F,(0,y.default)((0,y.default)({},K),d));const N=u(F,(0,y.default)((0,y.default)({},K),d)),B=(P=d==null||(x=d.trpc)===null||x===void 0?void 0:x.abortOnUnmount)!==null&&P!==void 0?P:k,A=In((0,y.default)((0,y.default)({},N),{},{initialPageParam:(S=d.initialCursor)!==null&&S!==void 0?S:null,persister:d.persister,queryKey:F,queryFn:ee?g:q=>{var L;const oe=(0,y.default)((0,y.default)({},N),{},{trpc:(0,y.default)((0,y.default)({},N?.trpc),B?{signal:q.signal}:{signal:null})});return M.query(...z(F,oe,{pageParam:(L=q.pageParam)!==null&&L!==void 0?L:d.initialCursor,direction:q.direction}))}}),T);return A.trpc=me({path:O}),A}function j(O,g,d){var m,w,P;
1const x=a(),S=Z(O,g,"infinite"),M=x.queryClient.getQueryDefaults(S),I=g===V,D=u(S,(0,y.default)((0,y.default)({},M),d)),T=(m=d==null||(w=d.trpc)===null||w===void 0?void 0:w.abortOnUnmount)!==null&&m!==void 0?m:x.abortOnUnmount;jn((0,y.default)((0,y.default)({},d),{},{initialPageParam:(P=d.initialCursor)!==null&&P!==void 0?P:null,queryKey:S,queryFn:I?g:k=>{var F;const K=(0,y.default)((0,y.default)({},D),{},{trpc:(0,y.default)((0,y.default)({},D?.trpc),T?{signal:k.signal}:{})});return x.client.query(...z(S,K,{pageParam:(F=k.pageParam)!==null&&F!==void 0?F:d.initialCursor,direction:k.direction}))}}))}function Q(O,g,d){var m,w,P;const x=a(),S=Z(O,g,"infinite"),M=x.queryClient.getQueryDefaults(S),I=u(S,(0,y.default)((0,y.default)({},M),d)),D=(m=d==null||(w=d.trpc)===null||w===void 0?void 0:w.abortOnUnmount)!==null&&m!==void 0?m:x.abortOnUnmount,T=_n((0,y.default)((0,y.default)({},d),{},{initialPageParam:(P=d.initialCursor)!==null&&P!==void 0?P:null,queryKey:S,queryFn:k=>{var F;const K=(0,y.default)((0,y.default)({},I),{},{trpc:(0,y.default)((0,y.default)({},I?.trpc),D?{signal:k.signal}:{})});return x.client.query(...z(S,K,{pageParam:(F=k.pageParam)!==null&&F!==void 0?F:d.initialCursor,direction:k.direction}))}}),x.queryClient);return T.trpc=me({path:O}),[T.data,T]}return{Provider:o,createClient:i,useContext:a,useUtils:a,useQuery:c,usePrefetchQuery:l,useSuspenseQuery:f,useQueries:(O,g)=>{const{ssrState:d,queryClient:m,prefetchQuery:w,client:P}=a(),x=Ft(P),S=O(x);if(typeof window>"u"&&d==="prepass")for(const I of S){var M;const D=I;((M=D.trpc)===null||M===void 0?void 0:M.ssr)!==!1&&!m.getQueryCache().find({queryKey:D.queryKey})&&w(D.queryKey,D)}return fr({queries:S.map(I=>(0,y.default)((0,y.default)({},I),{},{queryKey:I.queryKey})),combine:g?.combine},m)},useSuspenseQueries:O=>{const{queryClient:g,client:d}=a(),m=Ft(d),w=O(m),P=Cn({queries:w.map(x=>(0,y.default)((0,y.default)({},x),{},{queryFn:x.queryFn,queryKey:x.queryKey}))},g);return[P.map(x=>x.data),P]},useMutation:p,useSubscription:h,useInfiniteQuery:C,usePrefetchInfiniteQuery:j,useSuspenseInfiniteQuery:Q}}function Js(e){const t=$s(e);return Ot(r=>r==="useContext"||r==="useUtils"?()=>{const n=e.useUtils();return _.useMemo(()=>zs(n),[n])}:e.hasOwnProperty(r)?e[r]:t[r])}function Zs(e){const t=Ys();return Js(t)}class Xs{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,r){this.keyToValue.set(t,r),this.valueToKey.set(r,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Tr{constructor(t){this.generateIdentifier=t,this.kv=new Xs}register(t,r){this.kv.getByValue(t)||(r||(r=this.generateIdentifier(t)),this.kv.set(r,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}}class ei extends Tr{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),super.register(t,r.identifier)):super.register(t,r)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function ti(e){if("values"in Object)return Object.values(e);const t=[];for(const r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}function ri(e,t){const r=ti(e);if("find"in r)return r.find(t);const n=r;for(let s=0;s<n.length;s++){const i=n[s];if(t(i))return i}}function ve(e,t){Object.entries(e).forEach(([r,n])=>t(n,r))}function De(e,t){return e.indexOf(t)!==-1}function $t(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(t(n))return n}}class ni{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return ri(this.transfomers,r=>r.isApplicable(t))}findByName(t){return this.transfomers[t]}}const si=e=>Object.prototype.toString.call(e).slice(8,-1),Mr=e=>typeof e>"u",ii=e=>e===null,we=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,lt=e=>we(e)&&Object.keys(e).length===0,se=e=>Array.isArray(e),oi=e=>typeof e=="string",ai=e=>typeof e=="number"&&!isNaN(e),ui=e=>typeof e=="boolean",ci=e=>e instanceof RegExp,xe=e=>e instanceof Map,Se=e=>e instanceof Set,qr=e=>si(e)==="Symbol",li=e=>e instanceof Date&&!isNaN(e.valueOf()),Dr=e=>e instanceof Error,Nt=e=>typeof e=="number"&&isNaN(e),fi=e=>ui(e)||ii(e)||Mr(e)||ai(e)||oi(e)||qr(e),di=e=>typeof e=="bigint",hi=e=>e===1/0||e===-1/0,pi=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),yi=e=>e instanceof URL,ft=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Ze=e=>e.map(String).map(ft).join("."),ge=(e,t)=>
1{const r=[];let n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(!t&&o==="\\"){const c=e.charAt(i+1);if(c==="\\"){n+="\\",i++;continue}else if(c!==".")throw Error("invalid path")}if(o==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(o==="."){r.push(n),n="";continue}n+=o}const s=n;return r.push(s),r};function J(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const Ar=[J(Mr,"undefined",()=>null,()=>{}),J(di,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),J(li,"Date",e=>e.toISOString(),e=>new Date(e)),J(Dr,"Error",(e,t)=>{const r={name:e.name,message:e.message};return"cause"in e&&(r.cause=e.cause),t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r},(e,t)=>{const r=new Error(e.message,{cause:e.cause});return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r}),J(ci,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),r=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,r)}),J(Se,"set",e=>[...e.values()],e=>new Set(e)),J(xe,"map",e=>[...e.entries()],e=>new Map(e)),J(e=>Nt(e)||hi(e),"number",e=>Nt(e)?"NaN":e>0?"Infinity":"-Infinity",Number),J(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),J(yi,"URL",e=>e.toString(),e=>new URL(e))];function Ve(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const kr=Ve((e,t)=>qr(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{const n=r.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),vi=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Fr=Ve(pi,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const r=vi[t[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(e)});function Ur(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const $r=Ve(Ur,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};const n={};return r.forEach(s=>{n[s]=e[s]}),n},(e,t,r)=>{const n=r.classRegistry.getValue(t[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),e)}),Nr=Ve((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)=>{const n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),mi=[$r,kr,Nr,Fr],Kt=(e,t)=>{const r=$t(mi,s=>s.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};const n=$t(Ar,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},Kr={};Ar.forEach(e=>{Kr[e.annotation]=e});const bi=(e,t,r)=>{if(se(t))switch(t[0]){case"symbol":return kr.untransform(e,t,r);case"class":return $r.untransform(e,t,r);case"custom":return Nr.untransform(e,t,r);case"typed-array":return Fr.untransform(e,t,r);default:throw new Error("Unknown transformation: "+t)}else{const n=Kr[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(e,r)}},ye=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function Lr(e){if(De(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(De(e,"prototype"))throw new Error("prototype is not allowed as a property");if(De(e,"constructor"))throw new Error("constructor is not allowed as a property")}const gi=(e,t)=>{Lr(t);for(let r=0;r<t.length;r++){const n=t[r];if(Se(e))e=ye(e,+n);else if(xe(e)){const s=+n,i=+t[++r]==0?"key":"value",o=ye(e,s);switch(i){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[n]}return e},dt=(e,t,r)=>{if(Lr(t),t.length===0)return r(e);let n=e;for(let i=0;i<t.length-1;i++){const o=t[i];if(se(n)){const a=+o;n=n[a]}else if(we(n))n=n[o];else if(Se(n)){const a=+o;n=ye(n,a)}else if(xe(n)){if(i===t.length-2)break;const u=+o,c=+t[++i]==0?"key":"value",l=ye(n,u);switch(c){case"key":n=l;break;case"value":n=n.get(l);break}}}const s=t[t.length-1];if(se(n)?n[+s]=r(n[+s]):we(n)&&(n[s]=r(n[s])),Se(n)){const i=ye(n,+s),o=r(i);i!==o&&(n.delete(i),n.add(o))}if(xe(n)){const i=+t[t.length-2],o=ye(n,i);switch(+s==0?"key":"value"){case"key":{const u=r(o);n.set(u,n.get(o)),u!==o&&n.delete(o);break}case"value":{n.set(o,r(n.get(o)));break}}}return e},Hr=e=>e<1;function ht(e,t,r,n=[]){if(!e)return;const s=Hr(r);if(!se(e)){ve(e,(a,u)=>ht(a,t,r,[...n,...ge(u,s)]));return}const[i,o]=e;o&&ve(o,(a,u)=>{ht(a,t,r,[...n,...ge(u,s)])}),t(i,n)}function Oi(e,t,r,n){return ht(t,(s,i)=>{e=dt(e,i,o=>bi(o,s,n))},r),e}function Pi(e,t,r){const n=Hr(r);function s(i,o){const a=gi(e,ge(o,n));i.map(u=>
1ge(u,n)).forEach(u=>{e=dt(e,u,()=>a)})}if(se(t)){const[i,o]=t;i.forEach(a=>{e=dt(e,ge(a,n),()=>e)}),o&&ve(o,s)}else ve(t,s);return e}const wi=(e,t)=>we(e)||se(e)||xe(e)||Se(e)||Dr(e)||Ur(e,t);function xi(e,t,r){const n=r.get(e);n?n.push(t):r.set(e,[t])}function Si(e,t){const r={};let n;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(a=>a.map(String)).sort((a,u)=>a.length-u.length));const[i,...o]=s;i.length===0?n=o.map(Ze):r[Ze(i)]=o.map(Ze)}),n?lt(r)?[n]:[n,r]:lt(r)?void 0:r}const zr=(e,t,r,n,s=[],i=[],o=new Map)=>{const a=fi(e);if(!a){xi(e,s,t);const v=o.get(e);if(v)return n?{transformedValue:null}:v}if(!wi(e,r)){const v=Kt(e,r),b=v?{transformedValue:v.value,annotations:[v.type]}:{transformedValue:e};return a||o.set(e,b),b}if(De(i,e))return{transformedValue:null};const u=Kt(e,r),c=u?.value??e,l=se(c)?[]:{},f={};ve(c,(v,b)=>{if(b==="__proto__"||b==="constructor"||b==="prototype")throw new Error(`Detected property ${b}. This is a prototype pollution risk, please remove it from your object.`);const h=zr(v,t,r,n,[...s,b],[...i,e],o);l[b]=h.transformedValue,se(h.annotations)?f[ft(b)]=h.annotations:we(h.annotations)&&ve(h.annotations,(C,j)=>{f[ft(b)+"."+j]=C})});const p=lt(f)?{transformedValue:l,annotations:u?[u.type]:void 0}:{transformedValue:l,annotations:u?[u.type,f]:f};return a||o.set(e,p),p};function Vr(e){return Object.prototype.toString.call(e).slice(8,-1)}function Lt(e){return Vr(e)==="Array"}function _i(e){if(Vr(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Ci(e,t,r,n,s){const i={}.propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";i==="enumerable"&&(e[t]=r),s&&i==="nonenumerable"&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function pt(e,t={}){if(Lt(e))return e.map(s=>pt(s,t));if(!_i(e))return e;const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return[...r,...n].reduce((s,i)=>{if(i==="__proto__"||Lt(t.props)&&!t.props.includes(i))return s;const o=e[i],a=pt(o,t);return Ci(s,i,a,e,t.nonenumerable),s},{})}class R{constructor({dedupe:t=!1}={}){this.classRegistry=new ei,this.symbolRegistry=new Tr(r=>r.description??""),this.customTransformerRegistry=new ni,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const r=new Map,n=zr(t,r,this,this.dedupe),s={json:n.transformedValue};n.annotations&&(s.meta={...s.meta,values:n.annotations});const i=Si(r,this.dedupe);return i&&(s.meta={...s.meta,referentialEqualities:i}),s.meta&&(s.meta.v=1),s}deserialize(t,r){const{json:n,meta:s}=t;let i=r?.inPlace?n:pt(n);return s?.values&&(i=Oi(i,s.values,s.v??0,this)),s?.referentialEqualities&&(i=Pi(i,s.referentialEqualities,s.v??0)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t),{inPlace:!0})}registerClass(t,r){this.classRegistry.register(t,r)}registerSymbol(t,r){this.symbolRegistry.register(t,r)}registerCustom(t,r){this.customTransformerRegistry.register({name:r,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}R.defaultInstance=new R;R.serialize=R.defaultInstance.serialize.bind(R.defaultInstance);R.deserialize=R.defaultInstance.deserialize.bind(R.defaultInstance);R.stringify=R.defaultInstance.stringify.bind(R.defaultInstance);R.parse=R.defaultInstance.parse.bind(R.defaultInstance);R.registerClass=R.defaultInstance.registerClass.bind(R.defaultInstance);R.registerSymbol=R.defaultInstance.registerSymbol.bind(R.defaultInstance);R.registerCustom=R.defaultInstance.registerCustom.bind(R.defaultInstance);R.allowErrorProps=R.defaultInstance.allowErrorProps.bind(R.defaultInstance);R.serialize;R.deserialize;R.stringify;R.parse;R.registerClass;R.registerCustom;R.registerSymbol;R.allowErrorProps;const Ht=Zs();let Xe;function zt(){return new gn({defaultOptions:{queries:{staleTime:60*1e3}}})}function Ri(){return typeof window>"u"?zt():(Xe||(Xe=zt()),Xe)}function ji(){return`${typeof window<"u"?"":"http://localhost:5173"}/api/trpc`}function Qi(e){const t=Ri(),[r]=_.useState(()=>Ht.createClient({links:[ps({url:ji(),transformer:R,headers(){return{}}})]}));return Ae.jsx(Ht.Provider,{client:r,queryClient:t,children:Ae.jsx(On,{client:t,children:e.children})})}export{Qi as T,Ht as 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.