1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9409],{1681:(t,e,r)=>{r.d(e,{t:()=>i});var n=r(98216);let i=new class extends n.Q{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#t}}},5858:(t,e,r)=>{r.d(e,{BH:()=>m,Cp:()=>f,EN:()=>p,F$:()=>d,GF:()=>l,GU:()=>E,MK:()=>c,S$:()=>i,ZM:()=>Q,ZZ:()=>C,Zw:()=>o,f8:()=>v,gn:()=>u,hT:()=>R,j3:()=>a,lQ:()=>s,nJ:()=>h,ox:()=>j,pl:()=>P,y9:()=>S,yy:()=>w});var n=r(83599);let i="u"<typeof window||"Deno"in globalThis;function s(){}function o(t,e){return"function"==typeof t?t(e):t}function u(t){return"number"==typeof t&&t>=0&&t!==1/0}function a(t,e){return Math.max(t+(e||0)-Date.now(),0)}function l(t,e){return"function"==typeof t?t(e):t}function c(t,e){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:u}=t;if(o){if(n){if(e.queryHash!==d(o,e.options))return!1}else if(!f(e.queryKey,o))return!1}if("all"!==r){let t=e.isActive();if("active"===r&&!t||"inactive"===r&&t)return!1}return("boolean"!=typeof u||e.isStale()===u)&&(!i||i===e.state.fetchStatus)&&(!s||!!s(e))}function h(t,e){let{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(p(e.options.mutationKey)!==p(s))return!1}else if(!f(e.options.mutationKey,s))return!1}return(!n||e.state.status===n)&&(!i||!!i(e))}function d(t,e){return(e?.queryKeyHashFn||p)(t)}function p(t){return JSON.stringify(t,(t,e)=>g(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function f(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!f(t[r],e[r]))return!1;return!0}for(let r of Object.keys(e))if(!f(t[r],e[r]))return!1;return!0}return!1}let y=Object.prototype.hasOwnProperty;function m(t,e,r=0){if(t===e)return t;if(r>500)return e;let n=b(t)&&b(e);if(!n&&!(g(t)&&g(e)))return e;let i=(n?t:Object.keys(t)).length,s=n?e:Object.keys(e),o=s.length,u=n?Array(o):{},a=0;for(let l=0;l<o;l++){let o=n?l:s[l],c=t[o],h=e[o];if(c===h){u[o]=c,(n?l<i:y.call(t,o))&&a++;continue}if(null===c||null===h||"object"!=typeof c||"object"!=typeof h){u[o]=h;continue}let d=m(c,h,r+1);u[o]=d,d===c&&a++}return i===o&&a===i?t:u}function v(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function b(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function g(t){if(!O(t))return!1;let e=Object.getPrototypeOf(t),r=e?.constructor;if(void 0===r)return!0;if("function"!=typeof r)return!1;let n=r.prototype;return!!O(n)&&!!n.hasOwnProperty("isPrototypeOf")&&e===Object.prototype}function O(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t){return new Promise(e=>{n.zs.setTimeout(e,t)})}function P(t,e,r){return"function"==typeof r.structuralSharing?r.structuralSharing(t,e):!1!==r.structuralSharing?m(t,e):e}function S(t,e,r=0){let n=[...t,e];return r&&n.length>r?n.slice(1):n}function C(t,e,r=0){let n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}let R=Symbol();function Q(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==R?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function E(t,e){return"function"==typeof t?t(...e):!!t}function j(t,e,r){let n,i=!1;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(n??=e(),i||(i=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),t}},9113:(t,e,r)=>{function n(t){return!!t&&!Array.isArray(t)&&"object"==typeof t}function i(){return Object.create(null)}r.d(e,{c:()=>o,o:()=>i,u:()=>n});let s="function"==typeof Symbol&&!!Symbol.asyncIterator;function o(t){return s&&n(t)&&Symbol.asyncIterator in t}},9846:(t,e,r)=>{r.d(e,{II:()=>c,cc:()=>l,v_:()=>a});var n=r(5858),i=r(20297),s=r(20562),o=r(1681);function u(t){return Math.min(1e3*2**t,3e4)}function a(t){return(t??"online")!=="online"||o.t.isOnline()}
1var l=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function c(t){let e,r,c,h=!1,d=0,p="pending",f=new Promise((t,e)=>{r=t,c=e});f.catch(n.lQ);let y=()=>s.m.isFocused()&&("always"===t.networkMode||o.t.isOnline())&&t.canRun(),m=()=>a(t.networkMode)&&t.canRun(),v=t=>{"pending"===p&&(e?.(),p="resolved",r(t))},b=t=>{"pending"===p&&(e?.(),p="rejected",c(t))},g=()=>new Promise(r=>{e=t=>{("pending"!==p||y())&&r(t)},t.onPause?.()}).then(()=>{e=void 0,"pending"===p&&t.onContinue?.()}),O=()=>{let e;if("pending"!==p)return;let r=0===d?t.initialPromise:void 0;try{e=r??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(v).catch(e=>{if("pending"!==p)return;let r=t.retry??3*!(0,i.S)(),s=t.retryDelay??u,o="function"==typeof s?s(d,e):s,a=!0===r||"number"==typeof r&&d<r||"function"==typeof r&&r(d,e);h||!a?b(e):(d++,t.onFail?.(d,e),(0,n.yy)(o).then(()=>y()?void 0:g()).then(()=>{h?b(e):O()}))})};return{promise:f,status:()=>p,cancel:e=>{if("pending"===p){let r=new l(e);b(r),t.onCancel?.(r)}},continue:()=>(e?.(),f),cancelRetry:()=>{h=!0},continueRetry:()=>{h=!1},canStart:m,start:()=>(m()?O():g().then(O),f)}}},20297:(t,e,r)=>{r.d(e,{S:()=>i});var n=r(5858);let i=()=>n.S$},20562:(t,e,r)=>{r.d(e,{m:()=>i});var n=r(98216);let i=new class extends n.Q{#n;#e;#r;constructor(){super(),this.#r=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#n!==t&&(this.#n=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#n?this.#n:globalThis.document?.visibilityState!=="hidden"}}},28509:(t,e,r)=>{r.d(e,{PL:()=>i,RQ:()=>a,rB:()=>u});var n=r(5858);function i(t){return{onFetch:(e,r)=>{let i=e.options,u=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],l=e.state.data?.pageParams||[],c={pages:[],pageParams:[]},h=0,d=async()=>{let r=!1,d=(0,n.ZM)(e.options,e.fetchOptions),p=async(t,i,s)=>{let o;if(r)return Promise.reject(e.signal.reason);if(null==i&&t.pages.length)return Promise.resolve(t);let u=(o={client:e.client,queryKey:e.queryKey,pageParam:i,direction:s?"backward":"forward",meta:e.options.meta},(0,n.ox)(o,()=>e.signal,()=>r=!0),o),a=await d(u),{maxPages:l}=e.options,c=s?n.ZZ:n.y9;return{pages:c(t.pages,a,l),pageParams:c(t.pageParams,i,l)}};if(u&&a.length){let t="backward"===u,e=t?o:s,r={pages:a,pageParams:l};c=await p(r,e(i,r),t)}else{let e=t??a.length;do{let t=0===h?l[0]??i.initialPageParam:s(i,c);if(h>0&&null==t)break;c=await p(c,t),h++}while(h<e)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=d}}}function s(t,{pages:e,pageParams:r}){let n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function o(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}function u(t,e){return!!e&&null!=s(t,e)}function a(t,e){return!!e&&!!t.getPreviousPageParam&&null!=o(t,e)}},31967:(t,e,r)=>{let n,i,s,o,u,a;r.d(e,{jG:()=>c});let l=r(83599).Zq,c=(n=[],i=0,s=t=>{t()},o=t=>{t()},u=l,{batch:t=>{let e;i++;try{e=t()}finally{let t;--i||(t=n,n=[],t.length&&u(()=>{o(()=>{t.forEach(t=>{s(t)})})}))}return e},batchCalls:t=>(...e)=>{a(()=>{t(...e)})},schedule:a=t=>{i?n.push(t):u(()=>{s(t)})},setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{o=t},setScheduler:t=>{u=t}})},35625:(t,e,r)=>{r.d(e,{Ht:()=>u,jE:()=>o});var n=r(12115),i=r(95155);let s=n.createContext(void 0),o=t=>{let e=n.useContext(s);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},u=({client:t,children:e})=>(n.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,i.jsx)(s.Provider,{value:t,children:e}))},53390:(t,e,r)=>{r.d(e,{$:()=>u,s:()=>o});var n=r(31967),i=r(9846),s=r(99190),o=class extends s.k{#i;#s;#o;#u;
1constructor(t){super(),this.#i=t.client,this.mutationId=t.mutationId,this.#o=t.mutationCache,this.#s=[],this.state=t.state||u(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#s.includes(t)||(this.#s.push(t),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#s=this.#s.filter(e=>e!==t),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#s.length||("pending"===this.state.status?this.scheduleGc():this.#o.remove(this))}continue(){return this.#u?.continue()??("pending"===this.state.status?this.execute(this.state.variables):Promise.resolve())}async execute(t){let e=()=>{this.#a({type:"continue"})},r={client:this.#i,meta:this.options.meta,mutationKey:this.options.mutationKey},n=this.#u=(0,i.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#o.canRun(this)}),s="pending"===this.state.status,o=!n.canStart();try{if(s)e();else{this.#a({type:"pending",variables:t,isPaused:o}),this.#o.config.onMutate&&await this.#o.config.onMutate(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:o})}let i=await n.start();return await this.#o.config.onSuccess?.(i,t,this.state.context,this,r),await this.options.onSuccess?.(i,t,this.state.context,r),await this.#o.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,t,this.state.context,r),this.#a({type:"success",data:i}),i}catch(e){try{await this.#o.config.onError?.(e,t,this.state.context,this,r)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,r)}catch(t){Promise.reject(t)}try{await this.#o.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,r)}catch(t){Promise.reject(t)}throw this.#a({type:"error",error:e}),e}finally{this.#u===n&&(this.#u=void 0),this.#o.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),n.jG.batch(()=>{this.#s.forEach(e=>{e.onMutationUpdate(t)}),this.#o.notify({mutation:this,type:"updated",action:t})})}};function u(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},54482:(t,e,r)=>{function n(t){let e={subscribe(e){let r=null,n=!1,i=!1,s=!1;function o(){if(null===r){s=!0;return}!i&&(i=!0,"function"==typeof r?r():r&&r.unsubscribe())}return r=t({next(t){var r;n||null==(r=e.next)||r.call(e,t)},error(t){var r;n||(n=!0,null==(r=e.error)||r.call(e,t),o())},complete(){var t;n||(n=!0,null==(t=e.complete)||t.call(e),o())}}),s&&o(),{unsubscribe:o}},pipe:(...t)=>t.reduce(i,e)};return e}function i(t,e){return e(t)}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,r){var n;return(n=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=s(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==s(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
1e%2?u(Object(r),!0).forEach(function(e){o(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}r.d(e,{Ke:()=>T,XT:()=>I,Xq:()=>k,n2:()=>M,fu:()=>P,$H:()=>Q});var l=r(9113),c=class t extends Error{constructor(e,r){var n,i;const s=null==r?void 0:r.cause;super(e,{cause:s}),o(this,"cause",void 0),o(this,"shape",void 0),o(this,"data",void 0),o(this,"meta",void 0),this.meta=null==r?void 0:r.meta,this.cause=s,this.shape=null==r||null==(n=r.result)?void 0:n.error,this.data=null==r||null==(i=r.result)?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,t.prototype)}static from(e,r={}){return e instanceof c?(r.meta&&(e.meta=a(a({},e.meta),r.meta)),e):(0,l.u)(e)&&(0,l.u)(e.error)&&"number"==typeof e.error.code&&"string"==typeof e.error.message?new t(e.error.message,a(a({},r),{},{result:e,cause:r.cause})):new t("string"==typeof e?e:(0,l.u)(e)&&"string"==typeof e.message?e.message:"Unknown error",a(a({},r),{},{cause:e}))}};let h={query:"GET",mutation:"POST",subscription:"PATCH"};function d(t){return"input"in t?t.transformer.input.serialize(t.input):function(t){let e={};for(let r=0;r<t.length;r++){let n=t[r];e[r]=n}return e}(t.inputs.map(e=>t.transformer.input.serialize(e)))}let p=t=>{let e=t.url.split("?"),r=e[0].replace(/\/$/,"")+"/"+t.path,n=[];if(e[1]&&n.push(e[1]),"inputs"in t&&n.push("batch=1"),"query"===t.type||"subscription"===t.type){let e=d(t);void 0!==e&&"POST"!==t.methodOverride&&n.push(`input=${encodeURIComponent(JSON.stringify(e))}`)}return n.length&&(r+="?"+n.join("&")),r},f=t=>{if("query"===t.type&&"POST"!==t.methodOverride)return;let e=d(t);return void 0!==e?JSON.stringify(e):void 0};var y=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};async function m(t){var e,r,n,i=t.signal;if(null==i?void 0:i.aborted){if(null==(n=i.throwIfAborted)||n.call(i),"u">typeof DOMException)throw new DOMException("AbortError","AbortError");throw new y}let s=t.getUrl(t),o=t.getBody(t),u=null!=(e=t.methodOverride)?e:h[t.type],l=await (async()=>{let e=await t.headers();return Symbol.iterator in e?Object.fromEntries(e):e})(),c=a(a(a({},t.contentTypeHeader&&"GET"!==u?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{[null!=(r=t.trpcAcceptHeaderKey)?r:"trpc-accept"]:t.trpcAcceptHeader}:void 0),l);return(function(t){if(t)return t;if("u">typeof window&&"function"==typeof window.fetch)return window.fetch.bind(window);if("u">typeof globalThis&&"function"==typeof globalThis.fetch)return globalThis.fetch;throw Error("No fetch implementation found")})(t.fetch)(s,{method:u,signal:t.signal,body:o,headers:c})}async function v(t){let e={},r=await m(t);e.response=r;let n=await r.json();return e.responseJSON=n,{json:n,meta:e}}var b=r(81045),g=class extends Error{constructor(){super("Unable to transform response from server")}};Symbol();let O=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function w(t){let e=null,r=null;function n(){let n=function(e){let r=[[]],n=0;for(;;){var i,s;let o=e[n];if(!o)break;let u=r[r.length-1];if(o.aborted){null==(i=o.reject)||i.call(o,Error("Aborted")),n++;continue}if(t.validate(u.concat(o).map(t=>t.key))){u.push(o),n++;continue}if(0===u.length){null==(s=o.reject)||s.call(o,Error("Input is too big for a single dispatch")),n++;continue}r.push([])}return r}(e);for(let i of(clearTimeout(r),r=null,e=null,n)){if(!i.length)continue;let e={items:i};for(let t of i)t.batch=e;t.fetch(e.items.map(t=>t.key)).then(async t=>{for(let n of(await Promise.all(t.map(async(t,r)=>{var n,i;let s=e.items[r];try{let e=await Promise.resolve(t);null==(n=s.resolve)||n.call(s,e)}catch(t){null==(i=s.reject)||i.call(s,t)}s.batch=null,s.reject=null,s.resolve=null}
1)),e.items)){var r;null==(r=n.reject)||r.call(n,Error("Missing result")),n.batch=null}}).catch(t=>{for(let n of e.items){var r;null==(r=n.reject)||r.call(n,t),n.batch=null}})}}return{load:function(t){let i={aborted:!1,key:t,batch:null,resolve:O,reject:O},s=new Promise((t,r)=>{i.reject=r,i.resolve=t,null!=e||(e=[]),e.push(i)});return null!=r||(r=setTimeout(n)),s}}}function P(t){var e,r,i;let s={url:t.url.toString(),fetch:t.fetch,transformer:(i=t.transformer)?"input"in i?i:{input:i,output:i}:{input:{serialize:t=>t,deserialize:t=>t},output:{serialize:t=>t,deserialize:t=>t}},methodOverride:t.methodOverride},o=null!=(e=t.maxURLLength)?e:1/0,u=null!=(r=t.maxItems)?r:1/0;return()=>{let e=e=>({validate(t){if(o===1/0&&u===1/0)return!0;if(t.length>u)return!1;let r=t.map(t=>t.path).join(","),n=t.map(t=>t.input);return p(a(a({},s),{},{type:e,path:r,inputs:n,signal:null})).length<=o},async fetch(r){let n,i=r.map(t=>t.path).join(","),o=r.map(t=>t.input),u=function(...t){let e=new AbortController,r=t.length,n=0,i=()=>{++n===r&&e.abort()};for(let e of t)(null==e?void 0:e.aborted)?i():null==e||e.addEventListener("abort",i,{once:!0});return e.signal}(...r.map(t=>t.signal)),l=await (n=a(a({},s),{},{path:i,inputs:o,type:e,headers:()=>t.headers?"function"==typeof t.headers?t.headers({opList:r}):t.headers:{},signal:u}),v(a(a({},n),{},{contentTypeHeader:"application/json",getUrl:p,getBody:f})));return(Array.isArray(l.json)?l.json:r.map(()=>l.json)).map(t=>({meta:l.meta,json:t}))}}),r={query:w(e("query")),mutation:w(e("mutation"))};return({op:t})=>n(e=>{let n;if("subscription"===t.type)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let i=new AbortController,o=r[t.type].load(a(a({},t),{},{signal:function(...t){let e=new AbortController;for(let r of t)(null==r?void 0:r.aborted)?e.abort():null==r||r.addEventListener("abort",()=>e.abort(),{once:!0});return e.signal}(t.signal,i.signal)})),u=!1;return o.then(t=>{u=!0,n=t;let r=function(t,e){let r;try{r=function(t,e){if("error"in t){let r=e.deserialize(t.error);return{ok:!1,error:(0,b.n)((0,b.n)({},t),{},{error:r})}}return{ok:!0,result:(0,b.n)((0,b.n)({},t.result),(!t.result.type||"data"===t.result.type)&&{type:"data",data:e.deserialize(t.result.data)})}}(t,e)}catch(t){throw new g}if(!r.ok&&(!(0,l.u)(r.error.error)||"number"!=typeof r.error.error.code)||r.ok&&!(0,l.u)(r.result))throw new g;return r}(t.json,s.transformer.output);r.ok?(e.next({context:t.meta,result:r.result}),e.complete()):e.error(c.from(r.error,{meta:t.meta}))}).catch(t=>{u=!0,e.error(c.from(t,{meta:null==n?void 0:n.meta}))}),()=>{u||i.abort()}})}}Symbol();let S={query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},C={query:["\x1b[30;46m","\x1b[97;46m"],mutation:["\x1b[30;45m","\x1b[97;45m"],subscription:["\x1b[30;42m","\x1b[97;42m"]},R={query:["\x1b[1;30;46m","\x1b[1;97;46m"],mutation:["\x1b[1;30;45m","\x1b[1;97;45m"],subscription:["\x1b[1;30;42m","\x1b[1;97;42m"]};function Q(t={}){var e,r;let{enabled:i=()=>!0}=t,s=null!=(e=t.colorMode)?e:"u"<typeof window?"ansi":"css",o=null!=(r=t.withContext)?r:"css"===s,{logger:u=(({c:t=console,colorMode:e="css",withContext:r})=>n=>{let i=n.input,s=!("u"<typeof FormData)&&i instanceof FormData?Object.fromEntries(i):i,{parts:o,args:u}=function(t){let{direction:e,type:r,withContext:n,path:i,id:s,input:o}=t,u=[],l=[];if("none"===t.colorMode)u.push("up"===e?">>":"<<",r,`#${s}`,i);else if("ansi"===t.colorMode){let[t,n]=C[r],[o,a]=R[r];u.push("up"===e?t:n,"up"===e?">>":"<<",r,"up"===e?o:a,`#${s}`,i,"\x1b[0m")}else{let[t,n]=S[r],o=` 2 background-color: #${"up"===e?t:n}; 3 color: ${"up"===e?"black":"white"}; 4 padding: 2px; 5 `;u.push("%c","up"===e?">>":"<<",r,`#${s}`,`%c${i}%c`,"%O"),l.push(o,`${o}; font-weight: bold;`,`${o}; font-weight: normal;`)}return"up"===e?l.push(n?{input:o,context:t.context}:{input:o}):l.push(a({input:o,result:t.result,elapsedMs:t.elapsedMs},n&&{context:t.context})),{parts:u,args:l}}(a(a({},n),{},{colorMode:e,input:s,withContext:r}));t["down"===n.direction&&n.result&&(n.result instanceof Error||"error"in n.result.result&&n.result.result.error)?"error":"log"].apply(null,[o.join(" ")].concat(u))})({c:t.console,colorMode:s,withContext:o})}=t;return()=>({op:t,next:e})=>n(r=>{var s;i(a(a({},t),{},{direction:"up"}))&&u(a(a({},t),{},{direction:"up"}));let o=Date.now();function l(e){let r=Date.now()-o;i(a(a({},t),{},{direction:"down",result:e}))&&u(a(a({},t),{},{direction:"down",elapsedMs:r,result:e}))}return e(t).pipe((s={next(t){l(t)},error(t){l(t)}},t=>n(e=>t.subscribe({next(t){var r;null==(r=s.next)||r.call(s,t),e.next(t)},error(t){var r;null==(r=s.error)||r.call(s,t),e.error(t)},complete(){var t;null==(t=s.complete)||t.call(s),e.complete()}})))).subscribe(r)})}let E=(t,...e)=>"function"==typeof t?t(...e):t;async function j(t){let e=await E(t.url);return t.connectionParams?e+`${e.includes("?")?"&":"?"}connectionParams=1`:e}async function x(t,e){let r={method:"connectionParams",data:await E(t)};return e.encode(r)}var q=class t{constructor(e){var r;if(o(this,"id",++t.connectCount),o(this,"WebSocketPonyfill",void 0),o(this,"urlOptions",void 0),o(this,"keepAliveOpts",void 0),o(this,"encoder",void 0),o(this,"wsObservable",function(t){let e=null,r=[],i=n(t=>(void 0!==e&&t.next(e),r.push(t),()=>{r.splice(r.indexOf(t),1)}));return i.next=t=>{if(e!==t)for(let n of(e=t,r))n.next(t)},i.get=()=>e,i}(0)),o(this,"openPromise",null),this.WebSocketPonyfill=null!=(r=e.WebSocketPonyfill)?r:WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}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(){if(this.openPromise)return this.openPromise;this.id=++t.connectCount;let e=j(this.urlOptions).then(t=>new this.WebSocketPonyfill(t));this.openPromise=e.then(async t=>{this.ws=t,t.binaryType="arraybuffer",t.addEventListener("message",function({data:t}){"PING"===t&&this.send("PONG")}),this.keepAliveOpts.enabled&&function(t,{intervalMs:e,pongTimeoutMs:r}){let n,i;function s(){n=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},r)},e)}t.addEventListener("open",s),t.addEventListener("message",({data:t})=>{clearTimeout(n),s(),"PONG"===t&&(clearTimeout(i),clearTimeout(n),s())}),t.addEventListener("close",()=>{clearTimeout(n),clearTimeout(i)})}(t,this.keepAliveOpts),t.addEventListener("close",()=>{this.ws===t&&(this.ws=null)}),await function(t){let e,r,{promise:n,resolve:i,reject:s}={promise:new Promise((t,n)=>{e=t,r=n}),resolve:e,reject:r};return t.addEventListener("open",()=>{t.removeEventListener("error",s),i()}),t.addEventListener("error",s),n}(t),this.urlOptions.connectionParams&&t.send(await x(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;null==(t=this.ws)||t.close()}}};o(q,"connectCount",0);var T=class{constructor(t){o(this,"links",void 0),o(this,"runtime",void 0),o(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(t=>t(this.runtime))}$request(t){var e,r;return(r={links:this.links,op:a(a({},t),{},{context:null!=(e=t.context)?e:{},id:++this.requestId})},n(t=>(function t(e=0,n=r.op){let i=r.links[e];if(!i)throw Error("No more links to execute - did you forget to add an ending link?");return i({op:n,next:r=>t(e+1,r)})})().subscribe(t))).pipe(t=>{let e=0,r=null,i=[];return n(n=>(e++,i.push(n),r||(r=t.subscribe({next(t){for(let r of i){var e;null==(e=r.next)||e.call(r,t)}},error(t){for(let r of i){var e;null==(e=r.error)||e.call(r,t)}},complete(){for(let e of i){var t;null==(t=e.complete)||t.call(e)}}})),{unsubscribe(){if(0==--e&&r){let t=r;r=null,t.unsubscribe()}let t=i.findIndex(t=>t===n);t>-1&&i.splice(t,1)}}))})}async requestAsPromise(t){try{let e,r=this.$request(t);return(await (e=new AbortController,new Promise((t,n)=>{let i=!1;function s(){i||(i=!0,o.unsubscribe())}e.signal.addEventListener("abort",()=>{n(e.signal.reason)});let o=r.subscribe({next(e){i=!0,t(e),s()},error(t){n(t)},complete(){e.abort(),s()}})}))).result.data}catch(t){throw c.from(t)}}query(t,e,r){return this.requestAsPromise({type:"query",path:t,input:e,context:null==r?void 0:r.context,signal:null==r?void 0:r.signal})}mutation(t,e,r){return this.requestAsPromise({type:"mutation",path:t,input:e,context:null==r?void 0:r.context,signal:null==r?void 0:r.signal})}subscription(t,e,r){return this.$request({type:"subscription",path:t,input:e,context:r.context,signal:r.signal}).subscribe({next(t){var e,n,i,s;switch(t.result.type){case"state":null==(e=r.onConnectionStateChange)||e.call(r,t.result);break;case"started":null==(n=r.onStarted)||n.call(r,{context:t.context});break;case"stopped":null==(i=r.onStopped)||i.call(r);break;case"data":case void 0:null==(s=r.onData)||s.call(r,t.result.data)}},error(t){var e;null==(e=r.onError)||e.call(r,t)},complete(){var t;null==(t=r.onComplete)||t.call(r)}})}};let D=Symbol.for("trpc_untypedClient"),F={query:"query",mutate:"mutation",subscribe:"subscription"};function k(t){let e=(0,b.d)(({path:e,args:r})=>{let n=[...e],i=F[n.pop()],s=n.join(".");return t[i](s,...r)});return(0,b.u)(r=>r===D?t:e[r])}function I(t){return k(new T(t))}function M(t){return t[D]}function U(t,e){this.v=t,this.k=e}function A(t){var e,r;function n(e,r){try{var s=t[e](r),o=s.value,u=o instanceof U;Promise.resolve(u?o.v:o).then(function(r){if(u){var a="return"===e?"return":"next";if(!o.k||r.done)return n(a,r);r=t[a](r).value}i(s.done?"return":"normal",r)},function(t){n("throw",t)})}catch(t){i("throw",t)}}
5function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,i){return new Promise(function(s,o){var u={key:t,arg:i,resolve:s,reject:o,next:null};r?r=r.next=u:(e=r=u,n(t,i))})},"function"!=typeof t.return&&(this.return=void 0)}A.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},A.prototype.next=function(t){return this._invoke("next",t)},A.prototype.throw=function(t){return this._invoke("throw",t)},A.prototype.return=function(t){return this._invoke("return",t)}},59409:(t,e,r)=>{let n;r.d(e,{pY:()=>te});var i,s=r(5858),o=r(9113);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach(function(e){!function(t,e,r){var n;(n=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==u(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}let c=["cursor","direction"];function h(t,e,r){let n=t.flatMap(t=>t.split("."));if(!e&&(!r||"any"===r))return n.length?[n]:[];if("infinite"===r&&(0,o.u)(e)&&("direction"in e||"cursor"in e)){let{cursor:t,direction:r}=e;return[n,{input:function(t,e){if(null==t)return{};var r,n,i=function(t,e){if(null==t)return{};var r={};for(var n in t)if(({}).hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.includes(r)||({}).propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}(e,c),type:"infinite"}]}return[n,l(l({},void 0!==e&&e!==s.hT&&{input:e}),r&&"any"!==r&&{type:r})]}function d(t){return h(t,void 0,"any")}var p=r(54482),f=r(35625),y=r(12115),m=r.t(y,2);let v=y.createContext(!1);v.Provider,r(95155);let b=y.createContext((n=!1,{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n})),g=(t,e,r)=>{let n=r?.state.error&&"function"==typeof t.throwOnError?(0,s.GU)(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||n)&&!e.isReset()&&(t.retryOnMount=!1)},O=t=>{y.useEffect(()=>{t.clearReset()},[t])},w=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(i&&void 0===t.data||(0,s.GU)(r,[t.error,n])),P=(t,e)=>void 0===e.state.data,S=t=>{if(t.suspense){let e=t=>"static"===t?t:Math.max(t??1e3,1e3),r=t.staleTime;t.staleTime="function"==typeof r?(...t)=>e(r(...t)):e(r),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3))}},C=(t,e)=>t?.suspense&&e.isPending,R=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});var Q=r(31967);function E(t,e,r){let n=y.useContext(v),i=y.useContext(b),o=(0,f.jE)(r),u=o.defaultQueryOptions(t),a=o.getQueryCache().get(u.queryHash),l=!1!==t.subscribed;u._optimisticResults=n?"isRestoring":l?"optimistic":void 0,S(u),g(u,i,a),O(i);let[c]=y.useState(()=>new e(o,u)),h=c.getOptimisticResult(u),d=!n&&l;if(y.useSyncExternalStore(y.useCallback(t=>{let e=d?c.subscribe(Q.jG.batchCalls(t)):s.lQ;return c.updateResult(),e},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),y.useEffect(()=>{c.setOptions(u)},[u,c]),C(u,h))throw R(u,c,i);if(w({result:h,errorResetBoundary:i,throwOnError:u.throwOnError,query:a,suspense:u.suspense}))throw h.error;return u.notifyOnChangeProps?h:c.trackResult(h)}var j=r(83599),x=r(20297),q=r(98216),T=r(20562),D=r(65531),F=class extends q.Q{#i;#l=void 0;#c=void 0;#h=void 0;#d;#p;#f;#y;#m;#v;#b;#g;#O;#w=new Set;constructor(t,e){super(),this.options=e,this.#i=t,this.#f=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#l.addObserver(this),
5k(this.#l,this.options)?this.#P():this.updateResult(),this.#S())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return I(this.#l,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return I(this.#l,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#C(),this.#R(),this.#l.removeObserver(this)}setOptions(t){let e=this.options,r=this.#l;if(this.options=this.#i.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,s.GF)(this.options.enabled,this.#l))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#Q(),this.#l.setOptions(this.options),e._defaulted&&!(0,s.f8)(this.options,e)&&this.#i.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#l,observer:this});let n=this.hasListeners();n&&M(this.#l,r,this.options,e)&&this.#P(),this.updateResult(),n&&(this.#l!==r||(0,s.GF)(this.options.enabled,this.#l)!==(0,s.GF)(e.enabled,this.#l)||(0,s.GF)(this.options.staleTime,this.#l)!==(0,s.GF)(e.staleTime,this.#l))&&this.#E();let i=this.#j();n&&(this.#l!==r||(0,s.GF)(this.options.enabled,this.#l)!==(0,s.GF)(e.enabled,this.#l)||i!==this.#O)&&this.#x(i)}getOptimisticResult(t){let e=this.#i.getQueryCache().build(this.#i,t),r=this.createResult(e,t);return(0,s.f8)(this.getCurrentResult(),r)||(this.#h=r,this.#p=this.options,this.#d=this.#l.state),r}getCurrentResult(){return this.#h}trackResult(t,e){return new Proxy(t,{get:(t,r)=>(this.trackProp(r),e?.(r),Reflect.get(t,r))})}trackProp(t){this.#w.add(t)}getCurrentQuery(){return this.#l}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e,r=this.#i.defaultQueryOptions(t),n=this.#i.getQueryCache().build(this.#i,r),i=()=>{},s=new Promise(t=>{e=t,i=this.#i.getQueryCache().subscribe(e=>{"updated"===e.type&&e.query.queryHash===n.queryHash&&void 0!==n.state.data&&(i(),t(this.createResult(n,r)))})});return Promise.race([n.fetch().then(()=>{let t=this.createResult(n,r);return e?.(t),t}).finally(()=>{i()}),s])}fetch(t){return this.#P({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#h))}#P(t){this.#Q();let e=this.#l.fetch(this.options,t);return t?.throwOnError||(e=e.catch(s.lQ)),e}#q(t){return!(0,x.S)()&&!1!==(0,s.GF)(this.options.enabled,this.#l)&&(0,s.gn)(t)}#E(){this.#C();let t=(0,s.GF)(this.options.staleTime,this.#l);if(this.#h.isStale||!this.#q(t))return;let e=(0,s.j3)(this.#h.dataUpdatedAt,t)+1;this.#b=j.zs.setTimeout(()=>{this.#h.isStale||this.updateResult()},e)}#j(){return(0,s.GF)(this.options.refetchInterval,this.#l)??!1}#x(t){this.#R(),this.#O=t,0!==this.#O&&this.#q(this.#O)&&(this.#g=j.zs.setInterval(()=>{(this.options.refetchIntervalInBackground||T.m.isFocused())&&this.#P()},this.#O))}#S(){this.#E(),this.#x(this.#j())}#C(){void 0!==this.#b&&(j.zs.clearTimeout(this.#b),this.#b=void 0)}#R(){void 0!==this.#g&&(j.zs.clearInterval(this.#g),this.#g=void 0)}createResult(t,e){let r,n=this.#l,i=this.options,o=this.#h,u=this.#d,a=this.#p,l=t!==n?t.state:this.#c,{state:c}=t,h={...c},d=!1;if(e._optimisticResults){let r=this.hasListeners(),s=!r&&k(t,e),o=r&&M(t,n,e,i);(s||o)&&(h={...h,...(0,D.k)(c.data,t.options)}),"isRestoring"===e._optimisticResults&&(h.fetchStatus="idle")}let{error:p,errorUpdatedAt:f,status:y}=h;r=h.data;let m=!1;if(void 0!==e.placeholderData&&void 0===r&&"pending"===y){let t;o?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(t=o.data,m=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#v?.state.data,this.#v):e.placeholderData,void 0!==t&&(y="success",r=(0,s.pl)(o?.data,t,e),d=!0)}if(e.select&&void 0!==r&&!m)if(o&&r===u?.data&&e.select===this.#y)r=this.#m;else try{this.#y=e.select,r=e.select(r),r=(0,s.pl)(o?.data,r,e),this.#m=r,this.#f=null}catch(t){this.#f=t}else void 0===r&&(this.#f=null);this.#f&&(p=this.#f,r=this.#m,f=Date.now(),y="error",d=!1);let v="fetching"===h.fetchStatus,b="pending"===y,g="error"===y,O=b&&v,w=void 0!==r;return{status:y,fetchStatus:h.fetchStatus,isPending:b,isSuccess:"success"===y,isError:g,isInitialLoading:O,isLoading:O,data:r,dataUpdatedAt:h.dataUpdatedAt,error:p,errorUpdatedAt:f,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdate
5Count:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>l.dataUpdateCount||h.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!b,isLoadingError:g&&!w,isPaused:"paused"===h.fetchStatus,isPlaceholderData:d,isRefetchError:g&&w,isStale:U(t,e),refetch:this.refetch,isEnabled:!1!==(0,s.GF)(e.enabled,t)}}updateResult(){let t=this.#h,e=this.createResult(this.#l,this.options);if(this.#d=this.#l.state,this.#p=this.options,void 0!==this.#d.data&&(this.#v=this.#l),(0,s.f8)(e,t))return;this.#h=e;let r=(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.#w.size)return!0;let n=new Set(r??this.#w);return this.options.throwOnError&&n.add("error"),Object.keys(this.#h).some(e=>this.#h[e]!==t[e]&&n.has(e))})();Q.jG.batch(()=>{r&&this.listeners.forEach(t=>{t(this.#h)}),this.#i.getQueryCache().notify({query:this.#l,type:"observerResultsUpdated"})})}#Q(){let t=this.#i.getQueryCache().build(this.#i,this.options);if(t===this.#l)return;let e=this.#l;this.#l=t,this.#c=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#S()}};function k(t,e){return!1!==(0,s.GF)(e.enabled,t)&&void 0===t.state.data&&("error"!==t.state.status||!1!==(0,s.GF)(e.retryOnMount,t))||void 0!==t.state.data&&I(t,e,e.refetchOnMount)}function I(t,e,r){if(!1!==(0,s.GF)(e.enabled,t)&&"static"!==(0,s.GF)(e.staleTime,t)){let n=(0,s.GF)(r,t);return"always"===n||!1!==n&&U(t,e)}return!1}function M(t,e,r,n){return(t!==e||!1===(0,s.GF)(n.enabled,t))&&(!r.suspense||"error"!==t.state.status)&&U(t,r)}function U(t,e){return!1!==(0,s.GF)(e.enabled,t)&&t.isStaleByTime((0,s.GF)(e.staleTime,t))}var A=r(53390),G=class extends q.Q{#i;#h=void 0;#T;#D;constructor(t,e){super(),this.#i=t,this.setOptions(e),this.bindMethods(),this.#F()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#i.defaultMutationOptions(t),(0,s.f8)(this.options,e)||this.#i.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#T,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,s.EN)(e.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():this.#T?.state.status==="pending"&&this.#T.setOptions(this.options)}onSubscribe(){1===this.listeners.size&&this.#T&&(this.#T.addObserver(this),this.#F())}onUnsubscribe(){this.hasListeners()||this.#T?.removeObserver(this)}onMutationUpdate(t){this.#F(),this.#k(t)}getCurrentResult(){return this.#h}reset(){this.#T?.removeObserver(this),this.#T=void 0,this.#F(),this.#k()}mutate(t,e){return this.#D=e,this.#T?.removeObserver(this),this.#T=this.#i.getMutationCache().build(this.#i,this.options),this.#T.addObserver(this),this.#T.execute(t)}#F(){let t=this.#T?.state??(0,A.$)();this.#h={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#k(t){Q.jG.batch(()=>{if(this.#D&&this.hasListeners()){let e=this.#h.variables,r=this.#h.context,n={client:this.#i,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#D.onSuccess?.(t.data,e,r,n)}catch(t){Promise.reject(t)}try{this.#D.onSettled?.(t.data,null,e,r,n)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#D.onError?.(t.error,e,r,n)}catch(t){Promise.reject(t)}try{this.#D.onSettled?.(void 0,t.error,e,r,n)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#h)})})}},L=r(28509),K=class extends F{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){t._type="infinite",super.setOptions(t)}getOptimisticResult(t){return t._type="infinite",super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){let{state:r}=t,n=super.createResult(t,e),{isFetching:i,isRefetching:s,isError:o,isRefetchError:u}
5=n,a=r.fetchMeta?.fetchMore?.direction,l=o&&"forward"===a,c=i&&"forward"===a,h=o&&"backward"===a,d=i&&"backward"===a;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,L.rB)(e,r.data),hasPreviousPage:(0,L.RQ)(e,r.data),isFetchNextPageError:l,isFetchingNextPage:c,isFetchPreviousPageError:h,isFetchingPreviousPage:d,isRefetchError:u&&!l&&!h,isRefetching:s&&!c&&!d}}};function N(t,e){let r=new Set(e);return t.filter(t=>!r.has(t))}var H=class extends q.Q{#i;#I;#M;#U;#s;#A;#G;#L;#K;#N=[];constructor(t,e,r){super(),this.#i=t,this.#U=r,this.#M=[],this.#s=[],this.#I=[],this.setQueries(e)}onSubscribe(){1===this.listeners.size&&this.#s.forEach(t=>{t.subscribe(e=>{this.#H(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(t=>{t.destroy()})}setQueries(t,e){this.#M=t,this.#U=e,Q.jG.batch(()=>{let t=this.#s,e=this.#z(this.#M);e.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions));let r=e.map(t=>t.observer),n=r.map(t=>t.getCurrentResult()),i=t.length!==r.length,o=r.some((e,r)=>e!==t[r]),u=i||o,a=!!u||n.some((t,e)=>{let r=this.#I[e];return!r||!(0,s.f8)(t,r)});(u||a)&&(u&&(this.#N=e,this.#s=r),this.#I=n,this.hasListeners()&&(u&&(N(t,r).forEach(t=>{t.destroy()}),N(r,t).forEach(t=>{t.subscribe(e=>{this.#H(t,e)})})),this.#k()))})}getCurrentResult(){return this.#I}getQueries(){return this.#s.map(t=>t.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(t,e){let r=this.#z(t),n=r.map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions)),i=r.map(t=>t.defaultedQueryOptions.queryHash);return[n,t=>this.#$(t??n,e,i),()=>this.#_(n,r)]}#_(t,e){let r=new Set;return e.map((n,i)=>{let s=t[i];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,t=>{r.has(t)||(r.add(t),e.forEach(e=>{e.observer.trackProp(t)}))})})}#$(t,e,r){if(e){let n=this.#K,i=void 0!==r&&void 0!==n&&(n.length!==r.length||r.some((t,e)=>t!==n[e]));return(this.#I!==this.#L||i||e!==this.#G)&&(this.#G=e,this.#L=this.#I,void 0!==r&&(this.#K=r),this.#A=(0,s.BH)(this.#A,e(t))),this.#A}return t}#W(){return!this.#U?.combine||this.#s.some((t,e)=>t.options.suspense&&this.#I[e]?.data===void 0)}#z(t){let e=new Map;this.#s.forEach(t=>{let r=t.options.queryHash;if(!r)return;let n=e.get(r);n?n.push(t):e.set(r,[t])});let r=[];return t.forEach(t=>{let n=this.#i.defaultQueryOptions(t),i=e.get(n.queryHash)?.shift()??new F(this.#i,n);r.push({defaultedQueryOptions:n,observer:i})}),r}#H(t,e){let r=this.#s.indexOf(t);-1!==r&&(this.#I=this.#I.slice(),this.#I[r]=e,this.#k())}#k(){if(this.hasListeners()){let t=this.#W(),e=this.#A,r=t?e:this.#$(this.#_(this.#I,this.#N),this.#U?.combine);(t||e!==r)&&Q.jG.batch(()=>{this.listeners.forEach(t=>{t(this.#I)})})}}};function z({queries:t,...e},r){let n=(0,f.jE)(r),i=y.useContext(v),o=y.useContext(b),u=!1!==e.subscribed,a=y.useMemo(()=>t.map(t=>{let e=n.defaultQueryOptions(t);return e._optimisticResults=i?"isRestoring":u?"optimistic":void 0,e}),[t,n,i,u]);a.forEach(t=>{S(t);let e=n.getQueryCache().get(t.queryHash);g(t,o,e)}),O(o);let[l]=y.useState(()=>new H(n,a,e)),[c,h,d]=l.getOptimisticResult(a,e.combine),p=!i&&u;y.useSyncExternalStore(y.useCallback(t=>p?l.subscribe(Q.jG.batchCalls(t)):s.lQ,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setQueries(a,e)},[a,e,l]);let m=c.some((t,e)=>C(a[e],t))?c.flatMap((t,e)=>{let r=a[e];if(r&&C(r,t)){let t=new F(n,r);return R(r,t,o)}return[]}):[];if(m.length>0)throw Promise.all(m);let P=c.find((t,e)=>{let r=a[e];return r&&w({result:t,errorResetBoundary:o,throwOnError:r.throwOnError,query:n.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(P)throw P.error;return h(d())}var $=r(81045);let _=["client","ssrContext","ssrState","abortOnUnmount"],W=null==(i=y.createContext)?void 0:i.call(m,null);function B(t){let e=t instanceof p.Ke?t:(0,p.n2)(t);return(0,$.d)(t=>{let r=t.path,n=r.join("."),[i,s]=t.args;return l({queryKey:h(r,i,"query"),queryFn:()=>e.query(n,i,null==s?void 0:s.trpc)},s)})}function Z(t,e,r){var n,i;let s=t[0],o=null==(n=t[1])?void 0:n.input;return r&&(o=l(l(l({},null!=(i=o)?i:{}),r.pageParam?{cursor:r.pageParam}:{}),{},{direction:r.direction})),[s.join("."),o,null==e?void 0:e.trpc]}function J(t){function e(t){if(Object(t)!==t)return Promise.reject(TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return(J=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var r=this.s.return;return void 0===r?Promise.resolve({value:t,done:!0}):e(r.apply(this.s,arguments))},throw:function(t){var r=this.s.return;return void 0===r?Promise.reject(t):e(r.apply(this.s,arguments))}},new J(t)}function X(t){return{path:t.path.join(".")}}function Y(t){let e=X(t);return y.useMemo(()=>e,[e])}async function V(t,e,r){let n=e.getQueryCache().build(e,{queryKey:r});n.setState({data:[],status:"success"});let i=[];var s=!1,o=!1;try{for(var u,a,l=function(t){var e,r,n,i=2;
5for("u">typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(e=t[r]))return e.call(t);if(n&&null!=(e=t[n]))return new J(e.call(t));r="@@asyncIterator",n="@@iterator"}throw TypeError("Object is not async iterable")}(t);s=!(a=await l.next()).done;s=!1){let t=a.value;i.push(t),n.setState({data:[...i]})}}catch(t){o=!0,u=t}finally{try{s&&null!=l.return&&await l.return()}finally{if(o)throw u}}return i}let tt=(t,e)=>new Proxy(t,{get:(t,r)=>(e(r),t[r])});function te(t){var e,r;let n;return r=e=function(t){var e,r,n;let i=null!=(e=null==t||null==(r=t.overrides)||null==(r=r.useMutation)?void 0:r.onSuccess)?e:t=>t.originalFn(),u=null!=(n=null==t?void 0:t.context)?n:W,a=p.XT;function c(){let t=y.useContext(u);if(!t)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return t}function m(t,e){var r;let{queryClient:n,ssrState:i}=c();return i&&"mounted"!==i&&(null==(r=n.getQueryCache().find({queryKey:t}))?void 0:r.state.status)==="error"?l({retryOnMount:!1},e):e}let v={data:void 0,error:null,status:"idle"},b={data:void 0,error:null,status:"connecting"};return{Provider:t=>{var e;let{abortOnUnmount:r=!1,queryClient:n,ssrContext:i}=t,[a,c]=y.useState(null!=(e=t.ssrState)&&e),h=t.client instanceof p.Ke?t.client:(0,p.n2)(t.client),d=y.useMemo(()=>(function(t){let{client:e,queryClient:r}=t,n=e instanceof p.Ke?e:(0,p.n2)(e);return{infiniteQueryOptions:(t,e,r)=>{var i,o;let u=(null==(i=e[1])?void 0:i.input)===s.hT,a=async t=>{var i;let s=l(l({},r),{},{trpc:l(l({},null==r?void 0:r.trpc),(null==r||null==(i=r.trpc)?void 0:i.abortOnUnmount)?{signal:t.signal}:{signal:null})});return await n.query(...Z(e,s,{direction:t.direction,pageParam:t.pageParam}))};return Object.assign(l(l({},r),{},{initialData:null==r?void 0:r.initialData,queryKey:e,queryFn:u?s.hT:a,initialPageParam:null!=(o=null==r?void 0:r.initialCursor)?o:null}),{trpc:X({path:t})})},queryOptions:(t,e,i)=>{var u;let a=(null==(u=e[1])?void 0:u.input)===s.hT,c=async t=>{var s;let u=l(l({},i),{},{trpc:l(l({},null==i?void 0:i.trpc),(null==i||null==(s=i.trpc)?void 0:s.abortOnUnmount)?{signal:t.signal}:{signal:null})}),a=await n.query(...Z(e,u));return(0,o.c)(a)?V(a,r,e):a};return Object.assign(l(l({},i),{},{initialData:null==i?void 0:i.initialData,queryKey:e,queryFn:a?s.hT:c}),{trpc:X({path:t})})},fetchQuery:(t,e)=>r.fetchQuery(l(l({},e),{},{queryKey:t,queryFn:()=>n.query(...Z(t,e))})),fetchInfiniteQuery:(t,e)=>{var i;return r.fetchInfiniteQuery(l(l({},e),{},{queryKey:t,queryFn:({pageParam:r,direction:i})=>n.query(...Z(t,e,{pageParam:r,direction:i})),initialPageParam:null!=(i=null==e?void 0:e.initialCursor)?i:null}))},prefetchQuery:(t,e)=>r.prefetchQuery(l(l({},e),{},{queryKey:t,queryFn:()=>n.query(...Z(t,e))})),prefetchInfiniteQuery:(t,e)=>{var i;return r.prefetchInfiniteQuery(l(l({},e),{},{queryKey:t,queryFn:({pageParam:r,direction:i})=>n.query(...Z(t,e,{pageParam:r,direction:i})),initialPageParam:null!=(i=null==e?void 0:e.initialCursor)?i:null}))},ensureQueryData:(t,e)=>r.ensureQueryData(l(l({},e),{},{queryKey:t,queryFn:()=>n.query(...Z(t,e))})),invalidateQueries:(t,e,n)=>r.invalidateQueries(l(l({},e),{},{queryKey:t}),n),resetQueries:(t,e,n)=>r.resetQueries(l(l({},e),{},{queryKey:t}),n),refetchQueries:(t,e,n)=>r.refetchQueries(l(l({},e),{},{queryKey:t}),n),cancelQuery:(t,e)=>r.cancelQueries({queryKey:t},e),setQueryData:(t,e,n)=>r.setQueryData(t,e,n),setQueriesData:(t,e,n,i)=>r.setQueriesData(l(l({},e),{},{queryKey:t}),n,i),getQueryData:t=>r.getQueryData(t),setInfiniteQueryData:(t,e,n)=>r.setQueryData(t,e,n),getInfiniteQueryData:t=>r.getQueryData(t),setMutationDefaults:(e,i)=>{let s=e[0];return r.setMutationDefaults(e,"function"==typeof i?i({canonicalMutationFn:e=>n.mutation(...Z([s,{input:e}],t))}):i)},getMutationDefaults:t=>r.getMutationDefaults(t),isMutating:t=>r.isMutating(l(l({},t),{},{exact:!0}))}})({client:h,queryClient:n}),[h,n]),f=y.useMemo(()=>l({abortOnUnmount:r,queryClient:n,client:h,ssrContext:null!=i?i:null,ssrState:a},d),[r,h,d,n,i,a]);return y.useEffect(()=>{c(t=>!!t&&"mounted")},[]),y.createElement(u.Provider,{value:f},t.children)},createClient:a,useContext:c,useUtils:c,useQuery:function(e,r,n){var i,u,a,d,p;let{abortOnUnmount:f,client:y,ssrState:v,queryClient:b,prefetchQuery:g}=c(),O=h(e,r,"query"),w=b.getQueryDefaults(O),P=r===s.hT;
5!("u"<typeof window)||"prepass"!==v||(null==n||null==(i=n.trpc)?void 0:i.ssr)===!1||(null!=(u=null==n?void 0:n.enabled)?u:null==w?void 0:w.enabled)===!1||P||b.getQueryCache().find({queryKey:O})||g(O,n);let S=m(O,l(l({},w),n)),C=null!=(a=null!=(d=null==n||null==(p=n.trpc)?void 0:p.abortOnUnmount)?d:null==t?void 0:t.abortOnUnmount)?a:f,R=E(l(l({},S),{},{queryKey:O,queryFn:P?r:async t=>{let e=l(l({},S),{},{trpc:l(l({},null==S?void 0:S.trpc),C?{signal:t.signal}:{signal:null})}),r=await y.query(...Z(O,e));return(0,o.c)(r)?V(r,b,O):r}}),F,b);return R.trpc=Y({path:e}),R},usePrefetchQuery:function(e,r,n){var i,o,u,a;let d,p=c(),y=h(e,r,"query"),m=r===s.hT,v=null!=(i=null!=(o=null==n||null==(u=n.trpc)?void 0:u.abortOnUnmount)?o:null==t?void 0:t.abortOnUnmount)?i:p.abortOnUnmount;a=l(l({},n),{},{queryKey:y,queryFn:m?r:t=>{let e={trpc:l(l({},null==n?void 0:n.trpc),v?{signal:t.signal}:{})};return p.client.query(...Z(y,e))}}),(d=(0,f.jE)(void 0)).getQueryState(a.queryKey)||d.query(a).catch(s.lQ)},useSuspenseQuery:function(e,r,n){var i,s,o,u,a;let d=c(),p=h(e,r,"query"),f=null!=(i=null!=(s=null==n||null==(o=n.trpc)?void 0:o.abortOnUnmount)?s:null==t?void 0:t.abortOnUnmount)?i:d.abortOnUnmount,y=(u=l(l({},n),{},{queryKey:p,queryFn:t=>{let e=l(l({},n),{},{trpc:l(l({},null==n?void 0:n.trpc),f?{signal:t.signal}:{signal:null})});return d.client.query(...Z(p,e))}}),a=d.queryClient,E({...u,enabled:!0,suspense:!0,throwOnError:P,placeholderData:void 0},F,a));return y.trpc=Y({path:e}),[y.data,y]},useQueries:(t,e)=>{let{ssrState:r,queryClient:n,prefetchQuery:i,client:s}=c(),o=t(B(s));if("u"<typeof window&&"prepass"===r)for(let t of o){var u;(null==(u=t.trpc)?void 0:u.ssr)===!1||n.getQueryCache().find({queryKey:t.queryKey})||i(t.queryKey,t)}return z({queries:o.map(t=>l(l({},t),{},{queryKey:t.queryKey})),combine:null==e?void 0:e.combine},n)},useSuspenseQueries:t=>{var e;let{queryClient:r,client:n}=c(),i=(e={queries:t(B(n)).map(t=>l(l({},t),{},{queryFn:t.queryFn,queryKey:t.queryKey}))},z({...e,queries:e.queries.map(t=>({...t,suspense:!0,throwOnError:P,enabled:!0,placeholderData:void 0}))},r));return[i.map(t=>t.data),i]},useMutation:function(t,e){let{client:r,queryClient:n}=c(),o=d(t),u=n.defaultMutationOptions(n.getMutationDefaults(o)),a=function(t,e){let r=(0,f.jE)(e),[n]=y.useState(()=>new G(r,t));y.useEffect(()=>{n.setOptions(t)},[n,t]);let i=y.useSyncExternalStore(y.useCallback(t=>n.subscribe(Q.jG.batchCalls(t)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=y.useCallback((...t)=>{n.mutate(t[0],t[1]).catch(s.lQ)},[n]);if(i.error&&(0,s.GU)(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}(l(l({},e),{},{mutationKey:o,mutationFn:n=>r.mutation(...Z([t,{input:n}],e)),onSuccess(...t){var r,s;return i({originalFn:()=>{var r,n,i;return null!=(r=null==e||null==(n=e.onSuccess)?void 0:n.call(e,...t))?r:null==u||null==(i=u.onSuccess)?void 0:i.call(u,...t)},queryClient:n,meta:null!=(r=null!=(s=null==e?void 0:e.meta)?s:null==u?void 0:u.meta)?r:{}})}}),n);return a.trpc=Y({path:t}),a},useSubscription:function(t,e,r){var n;let i=null!=(n=null==r?void 0:r.enabled)?n:e!==s.hT,o=(0,s.EN)(h(t,e,"any")),{client:u}=c(),a=y.useRef(r);y.useEffect(()=>{a.current=r});let[d]=y.useState(new Set([])),p=y.useCallback(t=>{d.add(t)},[d]),f=y.useRef(null),m=y.useCallback(t=>{let e=O.current,r=O.current=t(e),n=!1;for(let t of d)if(e[t]!==r[t]){n=!0;break}n&&P(tt(r,p))},[p,d]),g=y.useCallback(()=>{var r;(null==(r=f.current)||r.unsubscribe(),i)?(m(()=>l(l({},b),{},{reset:g})),f.current=u.subscription(t.join("."),null!=e?e:void 0,{onStarted:()=>{var t,e;null==(t=(e=a.current).onStarted)||t.call(e),m(t=>l(l({},t),{},{status:"pending",error:null}))},onData:t=>{var e,r;null==(e=(r=a.current).onData)||e.call(r,t),m(e=>l(l({},e),{},{status:"pending",data:t,error:null}))},onError:t=>{var e,r;null==(e=(r=a.current).onError)||e.call(r,t),m(e=>l(l({},e),{},{status:"error",error:t}))},onConnectionStateChange:t=>{m(e=>{switch(t.state){case"idle":return l(l({},e),{},{status:t.state,error:null,data:void 0});case"connecting":return l(l({},e),{},{error:t.error,status:t.state});
5case"pending":return e}})},onComplete:()=>{var t,e;null==(t=(e=a.current).onComplete)||t.call(e),m(t=>l(l({},t),{},{status:"idle",error:null,data:void 0}))}})):m(()=>l(l({},v),{},{reset:g}))},[u,o,i,m]);y.useEffect(()=>(g(),()=>{var t;null==(t=f.current)||t.unsubscribe()}),[g]);let O=y.useRef(i?l(l({},b),{},{reset:g}):l(l({},v),{},{reset:g})),[w,P]=y.useState(tt(O.current,p));return w},useInfiniteQuery:function(t,e,r){var n,i,o,u,a;let{client:d,ssrState:p,prefetchInfiniteQuery:f,queryClient:y,abortOnUnmount:v}=c(),b=h(t,e,"infinite"),g=y.getQueryDefaults(b),O=e===s.hT;!("u"<typeof window)||"prepass"!==p||(null==r||null==(n=r.trpc)?void 0:n.ssr)===!1||(null!=(i=null==r?void 0:r.enabled)?i:null==g?void 0:g.enabled)===!1||O||y.getQueryCache().find({queryKey:b})||f(b,l(l({},g),r));let w=m(b,l(l({},g),r)),P=null!=(o=null==r||null==(u=r.trpc)?void 0:u.abortOnUnmount)?o:v,S=E(l(l({},w),{},{initialPageParam:null!=(a=r.initialCursor)?a:null,persister:r.persister,queryKey:b,queryFn:O?e:t=>{var e;let n=l(l({},w),{},{trpc:l(l({},null==w?void 0:w.trpc),P?{signal:t.signal}:{signal:null})});return d.query(...Z(b,n,{pageParam:null!=(e=t.pageParam)?e:r.initialCursor,direction:t.direction}))}}),K,y);return S.trpc=Y({path:t}),S},usePrefetchInfiniteQuery:function(t,e,r){var n,i,o,u;let a,d=c(),p=h(t,e,"infinite"),y=d.queryClient.getQueryDefaults(p),v=e===s.hT,b=m(p,l(l({},y),r)),g=null!=(n=null==r||null==(i=r.trpc)?void 0:i.abortOnUnmount)?n:d.abortOnUnmount;u=l(l({},r),{},{initialPageParam:null!=(o=r.initialCursor)?o:null,queryKey:p,queryFn:v?e:t=>{var e;let n=l(l({},b),{},{trpc:l(l({},null==b?void 0:b.trpc),g?{signal:t.signal}:{})});return d.client.query(...Z(p,n,{pageParam:null!=(e=t.pageParam)?e:r.initialCursor,direction:t.direction}))}}),(a=(0,f.jE)(void 0)).getQueryState(u.queryKey)||a.infiniteQuery(u).catch(s.lQ)},useSuspenseInfiniteQuery:function(t,e,r){var n,i,s,o,u;let a=c(),d=h(t,e,"infinite"),p=a.queryClient.getQueryDefaults(d),f=m(d,l(l({},p),r)),y=null!=(n=null==r||null==(i=r.trpc)?void 0:i.abortOnUnmount)?n:a.abortOnUnmount,v=(o=l(l({},r),{},{initialPageParam:null!=(s=r.initialCursor)?s:null,queryKey:d,queryFn:t=>{var e;let n=l(l({},f),{},{trpc:l(l({},null==f?void 0:f.trpc),y?{signal:t.signal}:{})});return a.client.query(...Z(d,n,{pageParam:null!=(e=t.pageParam)?e:r.initialCursor,direction:t.direction}))}}),u=a.queryClient,E({...o,enabled:!0,suspense:!0,throwOnError:P,placeholderData:void 0},K,u));return v.trpc=Y({path:t}),[v.data,v]}}}(t),n=(0,$.d)(({path:t,args:e})=>{var n;let i=[...t],s=i.pop();if("useMutation"===s)return r[s](i,...e);if("_def"===s)return{path:i};let[o,...u]=e,a=null!=(n=u[0])?n:{};return r[s](i,o,a)}),(0,$.u)(t=>"useContext"===t||"useUtils"===t?()=>{let t=e.useUtils();return y.useMemo(()=>{let e,r;return e=(0,p.Xq)(t.client),r=(0,$.d)(e=>{let r=[...e.path],n=r.pop(),i=[...e.args],s=i.shift(),o=h(r,s,(t=>{switch(t){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"}})(n));return({infiniteQueryOptions:()=>t.infiniteQueryOptions(r,o,i[0]),queryOptions:()=>t.queryOptions(r,o,...i),fetch:()=>t.fetchQuery(o,...i),fetchInfinite:()=>t.fetchInfiniteQuery(o,i[0]),prefetch:()=>t.prefetchQuery(o,...i),prefetchInfinite:()=>t.prefetchInfiniteQuery(o,i[0]),ensureData:()=>t.ensureQueryData(o,...i),invalidate:()=>t.invalidateQueries(o,...i),reset:()=>t.resetQueries(o,...i),refetch:()=>t.refetchQueries(o,...i),cancel:()=>t.cancelQuery(o,...i),setData:()=>{t.setQueryData(o,i[0],i[1])},setQueriesData:()=>t.setQueriesData(o,i[0],i[1],i[2]),setInfiniteData:()=>{t.setInfiniteQueryData(o,i[0],i[1])},getData:()=>t.getQueryData(o),getInfiniteData:()=>t.getInfiniteQueryData(o),setMutationDefaults:()=>t.setMutationDefaults(d(r),s),getMutationDefaults:()=>t.getMutationDefaults(d(r)),isMutating:()=>t.isMutating({mutationKey:d(r)})})[n]()}),(0,$.u)(n=>"client"===n?e:_.includes(n)?t[n]:r[n])},[t])}:e.hasOwnProperty(t)?e[t]:n[t])}},65531:(t,e,r)=>{r.d(e,{X:()=>a,k:()=>l});var n=r(5858),i=r(31967),s=r(9846),o=r(99190),u=r(28509),a=class extends o.k{#B;#Z;#J;#X;#i;#u;#Y;#V;constructor(t){super(),this.#V=!1,this.#Y=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#X=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#Z=h(this.options),this.state=t.state??this.#Z,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#B}get promise(){return this.#u?.promise}setOptions(t){if(this.options={...this.#Y,...t},t?._type&&(this.#B=t._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=h(this.options);void 0!==t.data&&(this.setState(c(t.data,t.dataUpdatedAt)),this.#Z=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#X.remove(this)}setData(t,e){let r=(0,n.pl)(this.state.data,t,this.options);return this.#a({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t){this.#a({type:"setState",state:t})}cancel(t){let e=this.#u?.promise;return this.#u?.cancel(t),e?e.then(n.lQ).catch(n.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#Z}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>!1!==(0,n.GF)(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n.hT||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
vendor: 4,687 bytes, line 5
5Count>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===(0,n.GF)(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!(0,n.j3)(this.state.dataUpdatedAt,t))}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#u?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#u?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#X.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){let e=this.observers.indexOf(t);-1!==e&&(this.observers.splice(e,1),this.observers.length||(this.#u&&(this.#V||"paused"===this.state.fetchStatus&&"pending"===this.state.status?this.#u.cancel({revert:!0}):this.#u.cancelRetry()),this.scheduleGc()),this.#X.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(t,e){let r;if("idle"!==this.state.fetchStatus&&this.#u?.status()!=="rejected"){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#u)return this.#u.continueRetry(),this.#u.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let i=new AbortController,o=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#V=!0,i.signal)})},a=()=>{let t,r=(0,n.ZM)(this.options,e),i=(o(t={client:this.#i,queryKey:this.queryKey,meta:this.meta}),t);return(this.#V=!1,this.options.persister)?this.options.persister(r,i,this):r(i)},l=(o(r={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:a}),r);("infinite"===this.#B?(0,u.PL)(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#J=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#a({type:"fetch",meta:l.fetchOptions?.meta});let c=this.#u=(0,s.II)({initialPromise:e?.initialPromise,fn:l.fetchFn,onCancel:t=>{t instanceof s.cc&&t.revert&&this.setState({...this.#J,fetchStatus:"idle"}),i.abort()},onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{let t=await c.start();if(void 0===t)throw Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#X.config.onSuccess?.(t,this),this.#X.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof s.cc){if(t.silent)return this.#u.promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#a({type:"error",error:t}),this.#X.config.onError?.(t,this),this.#X.config.onSettled?.(this.state.data,t,this),t}finally{this.#u===c&&(this.#u=void 0),this.scheduleGc()}}#a(t){let e=e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...l(e.data,this.options),fetchMeta:t.meta??null};case"success":let r={...e,...c(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=t.manual?r:void 0,r;case"error":let n=t.error;return{...e,error:n,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),i.jG.batch(()=>{this.observers.slice().forEach(t=>{t.onQueryUpdate()}),this.#X.notify({query:this,type:"updated",action:t})})}};function l(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,s.v_)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function c(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,n=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdate
5Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},81045:(t,e,r)=>{r.d(e,{d:()=>o,n:()=>h,r:()=>l,u:()=>u});var n=r(9113);let i=()=>{},s=t=>{Object.freeze&&Object.freeze(t)},o=t=>(function t(e,r,n){let o=r.join(".");return null!=n[o]||(n[o]=new Proxy(i,{get(i,s){if("string"==typeof s&&"then"!==s)return t(e,[...r,s],n)},apply(t,n,i){let o=r[r.length-1];if("valueOf"===o||"toString"===o||"toJSON"===o)return`tRPC.proxy(${r.slice(0,-1).join(".")})`;let u={args:i,path:r};return"call"===o?u={args:i.length>=2?[i[1]]:[],path:r.slice(0,-1)}:"apply"===o&&(u={args:i.length>=2?i[1]:[],path:r.slice(0,-1)}),s(u.args),s(u.path),e(u)}})),n[o]})(t,[],(0,n.o)()),u=t=>new Proxy(i,{get(e,r){if("then"!==r)return t(r)}});function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e,r){var n;return(n=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==a(n)?n:n+"")in t)?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach(function(e){l(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}},83599:(t,e,r)=>{r.d(e,{Zq:()=>s,zs:()=>i});let n={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},i=new class{#tt=n;#te=!1;setTimeoutProvider(t){this.#tt=t}setTimeout(t,e){return this.#tt.setTimeout(t,e)}clearTimeout(t){this.#tt.clearTimeout(t)}setInterval(t,e){return this.#tt.setInterval(t,e)}clearInterval(t){this.#tt.clearInterval(t)}};function s(t){setTimeout(t,0)}},98216:(t,e,r)=>{r.d(e,{Q:()=>n});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},99190:(t,e,r)=>{r.d(e,{k:()=>o});var n=r(83599),i=r(5858),s=r(20297),o=class{#tr;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.gn)(this.gcTime)&&(this.#tr=n.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??((0,s.S)()?1/0:3e5))}clearGcTimeout(){void 0!==this.#tr&&(n.zs.clearTimeout(this.#tr),this.#tr=void 0)}}}}]);
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.