(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1733],{6648:(e,t,r)=>{"use strict";r.d(t,{default:()=>s.a});var n=r(5601),s=r.n(n)},6463:(e,t,r)=>{"use strict";var n=r(1169);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}})},5601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return u},getImageProps:function(){return o}});let n=r(9920),s=r(497),i=r(8173),a=n._(r(1241));function o(e){let{props:t}=(0,s.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let u=i.Image},5714:e=>{e.exports={style:{fontFamily:"'GeistSans', 'GeistSans Fallback'"},className:"__className_3a0388",variable:"__variable_3a0388"}},4939:(e,t,r)=>{"use strict";r.d(t,{j:()=>i});var n=r(9010),s=r(6298),i=new class extends n.l{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!s.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}}},4329:(e,t,r)=>{"use strict";function n(e){return"success"===e.state.status}r.d(t,{d_:()=>n})},836:(e,t,r)=>{"use strict";r.d(t,{Gm:()=>s,Qy:()=>o,ZF:()=>u});var n=r(6298);function s(e){return{onFetch:(t,r)=>{let s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],l=t.state.data?.pageParams||[],c={pages:[],pageParams:[]},h=0,f=async()=>{let r=!1,f=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},d=(0,n.cG)(t.options,t.fetchOptions),p=async(e,s,i)=>{if(r)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);let a={queryKey:t.queryKey,pageParam:s,direction:i?"backward":"forward",meta:t.options.meta};f(a);let o=await d(a),{maxPages:u}=t.options,l=i?n.Ht:n.VX;return{pages:l(e.pages,o,u),pageParams:l(e.pageParams,s,u)}};if(o&&u.length){let e="backward"===o,t={pages:u,pageParams:l},r=(e?a:i)(s,t);c=await p(t,r,e)}else{let t=e??u.length;do{let e=0===h?l[0]??s.initialPageParam:i(s,c);if(h>0&&null==e)break;c=await p(c,e),h++}while(h<t)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=f}}}function i(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function a(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function o(e,t){return!!t&&null!=i(e,t)}function u(e,t){return!!t&&!!e.getPreviousPageParam&&null!=a(e,t)}},2812:(e,t,r)=>{"use strict";r.d(t,{R:()=>o,m:()=>a});var n=r(9948),s=r(3494),i=r(924),a=class extends s.F{#n;#s;#i;constructor(e){super(),this.mutationId=e.mutationId,this.#s=e.mutationCache,this.#n=[],this.state=e.state||o(),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.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){this.#i=(0,i.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let t="pending"===this.state.status,r=!this.#i.canStart();try{if(!t){this.#a({type:"pending",variables:e,isPaused:r}),await this.#s.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:r})}let n=await this.#i.start();return await this.#s.config.onSuccess?.(n,e,this.state.context,this),await this.options.onSuccess?.(n,e,this.state.context),await this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(n,null,e,this.state.context),this.#a({type:"success",data:n}),n}catch(t){try{throw await this.#s.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#s.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#a({type:"error",error:t})}}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.V.batch(()=>{this.#n.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},9948:(e,t,r)=>{"use strict";r.d(t,{V:()=>n});var n=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},s=e=>setTimeout(e,0),i=n=>{t?e.push(n):s(()=>{r(n)})},a=()=>{let t=e;e=[],t.length&&s(()=>{n(()=>{t.forEach(e=>{r(e)})})})};return{batch:e=>{let r;t++;try{r=e()}finally{--t||a()}return r},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{s=e}}}()},9937:(e,t,r)=>{"use strict";r.d(t,{N:()=>i});var n=r(9010),s=r(6298),i=new class extends n.l{#o=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!s.sk&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}}},2459:(e,t,r)=>{"use strict";r.d(t,{A:()=>o,z:()=>u});var n=r(6298),s=r(9948),i=r(924),a=r(3494),o=class extends a.F{#u;#l;#c;#i;#h;#f;constructor(e){super(),this.#f=!1,this.#h=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#u=function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?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"}}(this.options),this.state=e.state??this.#u,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){this.options={...this.#h,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){let r=(0,n.oE)(this.state.data,e,this.options);return this.#a({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(n.ZT).catch(n.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#u)}isActive(){return this.observers.some(e=>!1!==(0,n.Nc)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,n.Kp)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.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.#i&&(this.#f?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,r.signal)})},a={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let e=(0,n.cG)(this.options,t),r={queryKey:this.queryKey,meta:this.meta};return(s(r),this.#f=!1,this.options.persister)?this.options.persister(e,r,this):e(r)}};s(a),this.options.behavior?.onFetch(a,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#a({type:"fetch",meta:a.fetchOptions?.meta});let o=e=>{(0,i.DV)(e)&&e.silent||this.#a({type:"error",error:e}),(0,i.DV)(e)||(this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#i=(0,i.Mz)({initialPromise:t?.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{if(void 0===e){o(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){o(e);return}this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:o,onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...u(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;if((0,i.DV)(r)&&r.revert&&this.#l)return{...this.#l,fetchStatus:"idle"};return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),s.V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function u(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,i.Kw)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}},8421:(e,t,r)=>{"use strict";r.d(t,{S:()=>p});var n=r(6298),s=r(2459),i=r(9948),a=r(9010),o=class extends a.l{constructor(e={}){super(),this.config=e,this.#d=new Map}#d;build(e,t,r){let i=t.queryKey,a=t.queryHash??(0,n.Rm)(i,t),o=this.get(a);return o||(o=new s.A({cache:this,queryKey:i,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#d.has(e.queryHash)||(this.#d.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#d.get(e.queryHash);t&&(e.destroy(),t===e&&this.#d.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){i.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#d.get(e)}getAll(){return[...this.#d.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){i.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){i.V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){i.V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},u=r(2812),l=class extends a.l{constructor(e={}){super(),this.config=e,this.#p=new Map,this.#y=Date.now()}#p;#y;build(e,t,r){let n=new u.m({mutationCache:this,mutationId:++this.#y,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){let t=c(e),r=this.#p.get(t)??[];r.push(e),this.#p.set(t,r),this.notify({type:"added",mutation:e})}remove(e){let t=c(e);if(this.#p.has(t)){let r=this.#p.get(t)?.filter(t=>t!==e);r&&(0===r.length?this.#p.delete(t):this.#p.set(t,r))}this.notify({type:"removed",mutation:e})}canRun(e){let t=this.#p.get(c(e))?.find(e=>"pending"===e.state.status);return!t||t===e}runNext(e){let t=this.#p.get(c(e))?.find(t=>t!==e&&t.state.isPaused);return t?.continue()??Promise.resolve()}clear(){i.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#p.values()].flat()}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){i.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.V.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function c(e){return e.options.scope?.id??String(e.mutationId)}var h=r(4939),f=r(9937),d=r(836),p=class{#m;#s;#h;#g;#b;#v;#w;#O;constructor(e={}){this.#m=e.queryCache||new o,this.#s=e.mutationCache||new l,this.#h=e.defaultOptions||{},this.#g=new Map,this.#b=new Map,this.#v=0}mount(){this.#v++,1===this.#v&&(this.#w=h.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#m.onFocus())}),this.#O=f.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#m.onOnline())}))}unmount(){this.#v--,0===this.#v&&(this.#w?.(),this.#w=void 0,this.#O?.(),this.#O=void 0)}isFetching(e){return this.#m.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#s.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#m.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.getQueryData(e.queryKey);if(void 0===t)return this.fetchQuery(e);{let r=this.defaultQueryOptions(e),s=this.#m.build(this,r);return e.revalidateIfStale&&s.isStaleByTime((0,n.KC)(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return this.#m.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let s=this.defaultQueryOptions({queryKey:e}),i=this.#m.get(s.queryHash),a=i?.state.data,o=(0,n.SE)(t,a);if(void 0!==o)return this.#m.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return i.V.batch(()=>this.#m.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#m.get(t.queryHash)?.state}removeQueries(e){let t=this.#m;i.V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#m,n={type:"active",...e};return i.V.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){let r={revert:!0,...t};return Promise.all(i.V.batch(()=>this.#m.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e={},t={}){return i.V.batch(()=>{if(this.#m.findAll(e).forEach(e=>{e.invalidate()}),"none"===e.refetchType)return Promise.resolve();let r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){let r={...t,cancelRefetch:t?.cancelRefetch??!0};return Promise.all(i.V.batch(()=>this.#m.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#m.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=(0,d.Gm)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=(0,d.Gm)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.N.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#m}getMutationCache(){return this.#s}getDefaultOptions(){return this.#h}setDefaultOptions(e){this.#h=e}setQueryDefaults(e,t){this.#g.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#g.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&(r={...r,...t.defaultOptions})}),r}setMutationDefaults(e,t){this.#b.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#b.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&(r={...r,...t.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#h.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),!0!==t.enabled&&t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#h.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#m.clear(),this.#s.clear()}}},3494:(e,t,r)=>{"use strict";r.d(t,{F:()=>s});var n=r(6298),s=class{#R;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.PN)(this.gcTime)&&(this.#R=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.sk?1/0:3e5))}clearGcTimeout(){this.#R&&(clearTimeout(this.#R),this.#R=void 0)}}},924:(e,t,r)=>{"use strict";r.d(t,{DV:()=>c,Kw:()=>u,Mz:()=>h});var n=r(4939),s=r(9937),i=r(6922),a=r(6298);function o(e){return Math.min(1e3*2**e,3e4)}function u(e){return(e??"online")!=="online"||s.N.isOnline()}var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){return e instanceof l}function h(e){let t,r=!1,c=0,h=!1,f=(0,i.O)(),d=()=>n.j.isFocused()&&("always"===e.networkMode||s.N.isOnline())&&e.canRun(),p=()=>u(e.networkMode)&&e.canRun(),y=r=>{h||(h=!0,e.onSuccess?.(r),t?.(),f.resolve(r))},m=r=>{h||(h=!0,e.onError?.(r),t?.(),f.reject(r))},g=()=>new Promise(r=>{t=e=>{(h||d())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,h||e.onContinue?.()}),b=()=>{let t;if(h)return;let n=0===c?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(y).catch(t=>{if(h)return;let n=e.retry??(a.sk?0:3),s=e.retryDelay??o,i="function"==typeof s?s(c,t):s,u=!0===n||"number"==typeof n&&c<n||"function"==typeof n&&n(c,t);if(r||!u){m(t);return}c++,e.onFail?.(c,t),(0,a._v)(i).then(()=>d()?void 0:g()).then(()=>{r?m(t):b()})})};return{promise:f,cancel:t=>{h||(m(new l(t)),e.abort?.())},continue:()=>(t?.(),f),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:p,start:()=>(p()?b():g().then(b),f)}}},9010:(e,t,r)=>{"use strict";r.d(t,{l:()=>n});var n=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(){}}},6922:(e,t,r)=>{"use strict";function n(){let e,t;let r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}r.d(t,{O:()=>n})},6298:(e,t,r)=>{"use strict";r.d(t,{CN:()=>C,Ht:()=>E,KC:()=>u,Kp:()=>o,Nc:()=>l,PN:()=>a,Q$:()=>y,Rm:()=>f,SE:()=>i,VS:()=>m,VX:()=>R,X7:()=>h,Ym:()=>d,ZT:()=>s,_v:()=>w,_x:()=>c,cG:()=>x,oE:()=>O,sk:()=>n,to:()=>p});var n="undefined"==typeof window||"Deno"in globalThis;function s(){}function i(e,t){return"function"==typeof e?e(t):e}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function o(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function l(e,t){return"function"==typeof e?e(t):e}function c(e,t){let{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(n){if(t.queryHash!==f(a,t.options))return!1}else if(!p(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!s||s===t.state.fetchStatus)&&(!i||!!i(t))}function h(e,t){let{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(d(t.options.mutationKey)!==d(i))return!1}else if(!p(t.options.mutationKey,i))return!1}return(!n||t.state.status===n)&&(!s||!!s(t))}function f(e,t){return(t?.queryKeyHashFn||d)(e)}function d(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function p(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(r=>!p(e[r],t[r]))}function y(e,t){if(e===t)return e;let r=g(e)&&g(t);if(r||b(e)&&b(t)){let n=r?e:Object.keys(e),s=n.length,i=r?t:Object.keys(t),a=i.length,o=r?[]:{},u=0;for(let s=0;s<a;s++){let a=r?s:i[s];(!r&&n.includes(a)||r)&&void 0===e[a]&&void 0===t[a]?(o[a]=void 0,u++):(o[a]=y(e[a],t[a]),o[a]===e[a]&&void 0!==e[a]&&u++)}return s===a&&u===s?e:o}return t}function m(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function g(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!v(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(v(r)&&r.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function v(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e){return new Promise(t=>{setTimeout(t,e)})}function O(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?y(e,t):t}function R(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function E(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var C=Symbol();function x(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==C?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}},3191:(e,t,r)=>{"use strict";r.d(t,{NL:()=>a,aH:()=>o});var n=r(2265),s=r(7437),i=n.createContext(void 0),a=e=>{let t=n.useContext(i);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},o=e=>{let{client:t,children:r}=e;return n.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,s.jsx)(i.Provider,{value:t,children:r})}},9106:(e,t,r)=>{"use strict";function n(e){let t={subscribe(t){let r=null,n=!1,s=!1,i=!1;function a(){if(null===r){i=!0;return}!s&&(s=!0,"function"==typeof r?r():r&&r.unsubscribe())}return r=e({next(e){n||t.next?.(e)},error(e){n||(n=!0,t.error?.(e),a())},complete(){n||(n=!0,t.complete?.(),a())}}),i&&a(),{unsubscribe:a}},pipe:(...e)=>e.reduce(s,t)};return t}function s(e,t){return t(e)}r.d(t,{NT:()=>o,Bm:()=>h,fE:()=>u,ny:()=>f,gb:()=>S,Pq:()=>E});var i=r(8401);class a extends Error{static from(e,t={}){return e instanceof a||e instanceof Error&&"TRPCClientError"===e.name?(t.meta&&(e.meta={...e.meta,...t.meta}),e):(0,i.Kn)(e)&&(0,i.Kn)(e.error)&&"number"==typeof e.error.code&&"string"==typeof e.error.message?new a(e.error.message,{...t,result:e}):new a("string"==typeof e?e:(0,i.Kn)(e)&&"string"==typeof e.message?e.message:"Unknown error",{...t,cause:e})}constructor(e,t){let r=t?.cause;super(e,{cause:r}),this.meta=t?.meta,this.cause=r,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,a.prototype)}}class o{$request(e){var t;return(t={links:this.links,op:{...e,context:e.context??{},id:++this.requestId}},n(e=>(function e(r=0,n=t.op){let s=t.links[r];if(!s)throw Error("No more links to execute - did you forget to add an ending link?");return s({op:n,next:t=>e(r+1,t)})})().subscribe(e))).pipe(e=>{let t=0,r=null,s=[];return n(n=>(t++,s.push(n),r||(r=e.subscribe({next(e){for(let t of s)t.next?.(e)},error(e){for(let t of s)t.error?.(e)},complete(){for(let e of s)e.complete?.()}})),{unsubscribe(){t--,function(){if(0===t&&r){let e=r;r=null,e.unsubscribe()}}();let e=s.findIndex(e=>e===n);e>-1&&s.splice(e,1)}}))})}async requestAsPromise(e){try{let t=this.$request(e);return(await function(e){let t=new AbortController;return new Promise((r,n)=>{let s=!1;function i(){s||(s=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{n(t.signal.reason)});let a=e.subscribe({next(e){s=!0,r(e),i()},error(e){n(e)},complete(){t.abort(),i()}})})}(t)).result.data}catch(e){throw a.from(e)}}query(e,t,r){return this.requestAsPromise({type:"query",path:e,input:t,context:r?.context,signal:r?.signal})}mutation(e,t,r){return this.requestAsPromise({type:"mutation",path:e,input:t,context:r?.context,signal:r?.signal})}subscription(e,t,r){return this.$request({type:"subscription",path:e,input:t,context:r?.context,signal:r.signal}).subscribe({next(e){"started"===e.result.type?r.onStarted?.({context:e.context}):"stopped"===e.result.type?r.onStopped?.():r.onData?.(e.result.data)},error(e){r.onError?.(e)},complete(){r.onComplete?.()}})}constructor(e){this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}}function u(e){return new o(e)}let l={query:"query",mutate:"mutation",subscribe:"subscription"},c=e=>l[e];function h(e){let t=(0,i.IX)(({path:t,args:r})=>{let n=[...t],s=c(n.pop()),i=n.join(".");return e[s](i,...r)});return(0,i.yh)(r=>e.hasOwnProperty(r)?e[r]:"__untypedClient"===r?e:t[r])}function f(e){return e.__untypedClient}let d=e=>"function"==typeof e,p={query:"GET",mutation:"POST",subscription:"PATCH"};function y(e){return"input"in e?e.transformer.input.serialize(e.input):function(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];t[r]=n}return t}(e.inputs.map(t=>e.transformer.input.serialize(t)))}let m=e=>{let t=e.url.split("?"),r=t[0].replace(/\/$/,"")+"/"+e.path,n=[];if(t[1]&&n.push(t[1]),"inputs"in e&&n.push("batch=1"),"query"===e.type||"subscription"===e.type){let t=y(e);void 0!==t&&"POST"!==e.methodOverride&&n.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return n.length&&(r+="?"+n.join("&")),r},g=e=>{if("query"===e.type&&"POST"!==e.methodOverride)return;let t=y(e);return void 0!==t?JSON.stringify(t):void 0};class b extends Error{constructor(){let e="AbortError";super(e),this.name=e,this.message=e}}let v=e=>{if(e?.aborted){if(e.throwIfAborted?.(),"undefined"!=typeof DOMException)throw new DOMException("AbortError","AbortError");throw new b}};async function w(e){v(e.signal);let t=e.getUrl(e),r=e.getBody(e),{type:n}=e,s=await (async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),i={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...s};return(function(e){if(e)return e;if("undefined"!=typeof window&&d(window.fetch))return window.fetch;if("undefined"!=typeof globalThis&&d(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")})(e.fetch)(t,{method:e.methodOverride??p[n],signal:e.signal,body:r,headers:i})}let O=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function R(e){let t=null,r=null,n=()=>{clearTimeout(r),r=null,t=null};function s(){let r=function(t){let r=[[]],n=0;for(;;){let s=t[n];if(!s)break;let i=r[r.length-1];if(s.aborted){s.reject?.(Error("Aborted")),n++;continue}if(e.validate(i.concat(s).map(e=>e.key))){i.push(s),n++;continue}if(0===i.length){s.reject?.(Error("Input is too big for a single dispatch")),n++;continue}r.push([])}return r}(t);for(let t of(n(),r)){if(!t.length)continue;let r={items:t};for(let e of t)e.batch=r;e.fetch(r.items.map(e=>e.key)).then(async e=>{for(let t of(await Promise.all(e.map(async(e,t)=>{let n=r.items[t];try{let t=await Promise.resolve(e);n.resolve?.(t)}catch(e){n.reject?.(e)}n.batch=null,n.reject=null,n.resolve=null})),r.items))t.reject?.(Error("Missing result")),t.batch=null}).catch(e=>{for(let t of r.items)t.reject?.(e),t.batch=null})}}return{load:function(e){let n={aborted:!1,key:e,batch:null,resolve:O,reject:O},i=new Promise((e,r)=>{n.reject=r,n.resolve=e,t||(t=[]),t.push(n)});return r||(r=setTimeout(s)),i}}}function E(e){var t;let r={url:e.url.toString(),fetch:e.fetch,transformer:(t=e.transformer)?"input"in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}},methodOverride:e.methodOverride},s=e.maxURLLength??1/0,o=e.maxItems??1/0;return()=>{let t=t=>({validate(e){if(s===1/0&&o===1/0)return!0;if(e.length>o)return!1;let n=e.map(e=>e.path).join(","),i=e.map(e=>e.input);return m({...r,type:t,path:n,inputs:i,signal:null}).length<=s},async fetch(n){let s=n.map(e=>e.path).join(","),o=n.map(e=>e.input),u=function(...e){let t=new AbortController,r=e.length,n=0,s=()=>{++n===r&&t.abort()};for(let t of e)t?.aborted?s():t?.addEventListener("abort",s,{once:!0});return t.signal}(...n.map(e=>e.signal)),l=new AbortController,c=w({...r,signal:function(...e){let t=new AbortController;for(let r of e)r?.aborted?t.abort():r?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}(u,l.signal),type:t,contentTypeHeader:"application/json",trpcAcceptHeader:"application/jsonl",getUrl:m,getBody:g,inputs:o,path:s,headers:()=>e.headers?"function"==typeof e.headers?e.headers({opList:n}):e.headers:{}}),h=await c,[f]=await (0,i.$N)({from:h.body,deserialize:r.transformer.output.deserialize,formatError(e){let t=e.error;return a.from({error:t})},abortController:l});return Object.keys(n).map(async e=>{let t=await Promise.resolve(f[e]);if("result"in t){let e=await Promise.resolve(t.result);t={result:{data:await Promise.resolve(e.data)}}}return{json:t,meta:{response:h}}})}}),u={query:R(t("query")),mutation:R(t("mutation"))};return({op:e})=>n(t=>{let r;if("subscription"===e.type)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");return u[e.type].load(e).then(e=>{if(r=e,"error"in e.json){t.error(a.from(e.json,{meta:e.meta}));return}if("result"in e.json){t.next({context:e.meta,result:e.json.result}),t.complete();return}t.complete()}).catch(e=>{t.error(a.from(e,{meta:r?.meta}))}),()=>{}})}}let C={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1b[30;46m","\x1b[97;46m"],mutation:["\x1b[30;45m","\x1b[97;45m"],subscription:["\x1b[30;42m","\x1b[97;42m"]},bold:{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"]}}},x=({c:e=console,colorMode:t="css",withContext:r})=>n=>{let s=n.input,i="undefined"!=typeof FormData&&s instanceof FormData?Object.fromEntries(s):s,{parts:a,args:o}=function(e){let{direction:t,type:r,withContext:n,path:s,id:i,input:a}=e,o=[],u=[];if("none"===e.colorMode)o.push("up"===t?">>":"<<",r,`#${i}`,s);else if("ansi"===e.colorMode){let[e,n]=C.ansi.regular[r],[a,u]=C.ansi.bold[r];o.push("up"===t?e:n,"up"===t?">>":"<<",r,"up"===t?a:u,`#${i}`,s,"\x1b[0m")}else{let[e,n]=C.css[r],a=`
    background-color: #${"up"===t?e:n};
    color: ${"up"===t?"black":"white"};
    padding: 2px;
  `;o.push("%c","up"===t?">>":"<<",r,`#${i}`,`%c${s}%c`,"%O"),u.push(a,`${a}; font-weight: bold;`,`${a}; font-weight: normal;`)}return"up"===t?u.push(n?{input:a,context:e.context}:{input:a}):u.push({input:a,result:e.result,elapsedMs:e.elapsedMs,...n&&{context:e.context}}),{parts:o,args:u}}({...n,colorMode:t,input:i,withContext:r});e["down"===n.direction&&n.result&&(n.result instanceof Error||"error"in n.result.result)?"error":"log"].apply(null,[a.join(" ")].concat(o))};function S(e={}){let{enabled:t=()=>!0}=e,r=e.colorMode??("undefined"==typeof window?"ansi":"css"),s=e.withContext??"css"===r,{logger:i=x({c:e.console,colorMode:r,withContext:s})}=e;return()=>({op:e,next:r})=>n(s=>{var a;t({...e,direction:"up"})&&i({...e,direction:"up"});let o=Date.now();function u(r){let n=Date.now()-o;t({...e,direction:"down",result:r})&&i({...e,direction:"down",elapsedMs:n,result:r})}return r(e).pipe((a={next(e){u(e)},error(e){u(e)}},e=>n(t=>e.subscribe({next(e){a.next?.(e),t.next(e)},error(e){a.error?.(e),t.error(e)},complete(){a.complete?.(),t.complete()}})))).subscribe(s)})}class P extends Error{constructor(e){super(e),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,P.prototype)}}},6188:(e,t,r)=>{"use strict";r.d(t,{ec:()=>W});var n=r(9106),s=r(6298),i=r(8401);function a(e,t,r){let n=e.flatMap(e=>e.split("."));if(!t&&(!r||"any"===r))return n.length?[n]:[];if("infinite"===r&&(0,i.Kn)(t)&&("direction"in t||"cursor"in t)){let{cursor:e,direction:r,...s}=t;return[n,{input:s,type:"infinite"}]}return[n,{...void 0!==t&&t!==s.CN&&{input:t},...r&&"any"!==r&&{type:r}}]}function o(e){return a(e,void 0,"any")}var u=r(2265);let l=["client","ssrContext","ssrState","abortOnUnmount"],c=u.createContext?.(null),h=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"}};var f=r(4939),d=r(9948),p=r(2459),y=r(9010),m=r(6922),g=class extends y.l{constructor(e,t){super(),this.options=t,this.#E=e,this.#C=null,this.#x=(0,m.O)(),this.options.experimental_prefetchInRender||this.#x.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#E;#S=void 0;#P=void 0;#q=void 0;#Q;#I;#x;#C;#D;#T;#k;#j;#M;#_;#F=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#S.addObserver(this),b(this.#S,this.options)?this.#A():this.updateResult(),this.#N())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return v(this.#S,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return v(this.#S,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#U(),this.#K(),this.#S.removeObserver(this)}setOptions(e,t){let r=this.options,n=this.#S;if(this.options=this.#E.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,s.Nc)(this.options.enabled,this.#S))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#V(),this.#S.setOptions(this.options),r._defaulted&&!(0,s.VS)(this.options,r)&&this.#E.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#S,observer:this});let i=this.hasListeners();i&&w(this.#S,n,this.options,r)&&this.#A(),this.updateResult(t),i&&(this.#S!==n||(0,s.Nc)(this.options.enabled,this.#S)!==(0,s.Nc)(r.enabled,this.#S)||(0,s.KC)(this.options.staleTime,this.#S)!==(0,s.KC)(r.staleTime,this.#S))&&this.#z();let a=this.#L();i&&(this.#S!==n||(0,s.Nc)(this.options.enabled,this.#S)!==(0,s.Nc)(r.enabled,this.#S)||a!==this.#_)&&this.#H(a)}getOptimisticResult(e){let t=this.#E.getQueryCache().build(this.#E,e),r=this.createResult(t,e);return(0,s.VS)(this.getCurrentResult(),r)||(this.#q=r,this.#I=this.options,this.#Q=this.#S.state),r}getCurrentResult(){return this.#q}trackResult(e,t){let r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),t?.(n),e[n])})}),r}trackProp(e){this.#F.add(e)}getCurrentQuery(){return this.#S}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#E.defaultQueryOptions(e),r=this.#E.getQueryCache().build(this.#E,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#A({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#q))}#A(e){this.#V();let t=this.#S.fetch(this.options,e);return e?.throwOnError||(t=t.catch(s.ZT)),t}#z(){this.#U();let e=(0,s.KC)(this.options.staleTime,this.#S);if(s.sk||this.#q.isStale||!(0,s.PN)(e))return;let t=(0,s.Kp)(this.#q.dataUpdatedAt,e);this.#j=setTimeout(()=>{this.#q.isStale||this.updateResult()},t+1)}#L(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#S):this.options.refetchInterval)??!1}#H(e){this.#K(),this.#_=e,!s.sk&&!1!==(0,s.Nc)(this.options.enabled,this.#S)&&(0,s.PN)(this.#_)&&0!==this.#_&&(this.#M=setInterval(()=>{(this.options.refetchIntervalInBackground||f.j.isFocused())&&this.#A()},this.#_))}#N(){this.#z(),this.#H(this.#L())}#U(){this.#j&&(clearTimeout(this.#j),this.#j=void 0)}#K(){this.#M&&(clearInterval(this.#M),this.#M=void 0)}createResult(e,t){let r;let n=this.#S,i=this.options,a=this.#q,o=this.#Q,u=this.#I,l=e!==n?e.state:this.#P,{state:c}=e,h={...c},f=!1;if(t._optimisticResults){let r=this.hasListeners(),s=!r&&b(e,t),a=r&&w(e,n,t,i);(s||a)&&(h={...h,...(0,p.z)(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(h.fetchStatus="idle")}let{error:d,errorUpdatedAt:y,status:g}=h;if(t.select&&void 0!==h.data){if(a&&h.data===o?.data&&t.select===this.#D)r=this.#T;else try{this.#D=t.select,r=t.select(h.data),r=(0,s.oE)(a?.data,r,t),this.#T=r,this.#C=null}catch(e){this.#C=e}}else r=h.data;if(void 0!==t.placeholderData&&void 0===r&&"pending"===g){let e;if(a?.isPlaceholderData&&t.placeholderData===u?.placeholderData)e=a.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#k?.state.data,this.#k):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#C=null}catch(e){this.#C=e}void 0!==e&&(g="success",r=(0,s.oE)(a?.data,e,t),f=!0)}this.#C&&(d=this.#C,r=this.#T,y=Date.now(),g="error");let v="fetching"===h.fetchStatus,R="pending"===g,E="error"===g,C=R&&v,x=void 0!==r,S={status:g,fetchStatus:h.fetchStatus,isPending:R,isSuccess:"success"===g,isError:E,isInitialLoading:C,isLoading:C,data:r,dataUpdatedAt:h.dataUpdatedAt,error:d,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>l.dataUpdateCount||h.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!R,isLoadingError:E&&!x,isPaused:"paused"===h.fetchStatus,isPlaceholderData:f,isRefetchError:E&&x,isStale:O(e,t),refetch:this.refetch,promise:this.#x};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===S.status?e.reject(S.error):void 0!==S.data&&e.resolve(S.data)},r=()=>{t(this.#x=S.promise=(0,m.O)())},s=this.#x;switch(s.status){case"pending":e.queryHash===n.queryHash&&t(s);break;case"fulfilled":("error"===S.status||S.data!==s.value)&&r();break;case"rejected":("error"!==S.status||S.error!==s.reason)&&r()}}return S}updateResult(e){let t=this.#q,r=this.createResult(this.#S,this.options);if(this.#Q=this.#S.state,this.#I=this.options,void 0!==this.#Q.data&&(this.#k=this.#S),(0,s.VS)(r,t))return;this.#q=r;let n={};e?.listeners!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.#F.size)return!0;let n=new Set(r??this.#F);return this.options.throwOnError&&n.add("error"),Object.keys(this.#q).some(e=>this.#q[e]!==t[e]&&n.has(e))})()&&(n.listeners=!0),this.#G({...n,...e})}#V(){let e=this.#E.getQueryCache().build(this.#E,this.options);if(e===this.#S)return;let t=this.#S;this.#S=e,this.#P=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#N()}#G(e){d.V.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#q)}),this.#E.getQueryCache().notify({query:this.#S,type:"observerResultsUpdated"})})}};function b(e,t){return!1!==(0,s.Nc)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)||void 0!==e.state.data&&v(e,t,t.refetchOnMount)}function v(e,t,r){if(!1!==(0,s.Nc)(t.enabled,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&O(e,t)}return!1}function w(e,t,r,n){return(e!==t||!1===(0,s.Nc)(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&O(e,r)}function O(e,t){return!1!==(0,s.Nc)(t.enabled,e)&&e.isStaleByTime((0,s.KC)(t.staleTime,e))}var R=r(3191);r(7437);var E=u.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),C=()=>u.useContext(E);function x(e,t){return"function"==typeof e?e(...t):!!e}function S(){}var P=(e,t)=>{(e.suspense||e.throwOnError)&&!t.isReset()&&(e.retryOnMount=!1)},q=e=>{u.useEffect(()=>{e.clearReset()},[e])},Q=e=>{let{result:t,errorResetBoundary:r,throwOnError:n,query:s}=e;return t.isError&&!r.isReset()&&!t.isFetching&&s&&x(n,[t.error,s])},I=u.createContext(!1),D=()=>u.useContext(I);I.Provider;var T=(e,t)=>void 0===t.state.data,k=e=>{e.suspense&&(void 0===e.staleTime&&(e.staleTime=1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))},j=(e,t)=>e.isLoading&&e.isFetching&&!t,M=(e,t)=>e?.suspense&&t.isPending,_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function F(e,t,r){var n,i,a,o,l;let c=(0,R.NL)(r),h=D(),f=C(),p=c.defaultQueryOptions(e);null===(i=c.getDefaultOptions().queries)||void 0===i||null===(n=i._experimental_beforeQuery)||void 0===n||n.call(i,p),p._optimisticResults=h?"isRestoring":"optimistic",k(p),P(p,f),q(f);let y=!c.getQueryCache().get(p.queryHash),[m]=u.useState(()=>new t(c,p)),g=m.getOptimisticResult(p);if(u.useSyncExternalStore(u.useCallback(e=>{let t=h?()=>void 0:m.subscribe(d.V.batchCalls(e));return m.updateResult(),t},[m,h]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),u.useEffect(()=>{m.setOptions(p,{listeners:!1})},[p,m]),M(p,g))throw _(p,m,f);if(Q({result:g,errorResetBoundary:f,throwOnError:p.throwOnError,query:c.getQueryCache().get(p.queryHash)}))throw g.error;if(null===(o=c.getDefaultOptions().queries)||void 0===o||null===(a=o._experimental_afterQuery)||void 0===a||a.call(o,p,g),p.experimental_prefetchInRender&&!s.sk&&j(g,h)){let e=y?_(p,m,f):null===(l=c.getQueryCache().get(p.queryHash))||void 0===l?void 0:l.promise;null==e||e.catch(S).finally(()=>{m.hasListeners()||m.updateResult()})}return p.notifyOnChangeProps?g:m.trackResult(g)}var A=r(2812),N=class extends y.l{#E;#q=void 0;#$;#B;constructor(e,t){super(),this.#E=e,this.setOptions(t),this.bindMethods(),this.#Z()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#E.defaultMutationOptions(e),(0,s.VS)(this.options,t)||this.#E.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#$,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.Ym)(t.mutationKey)!==(0,s.Ym)(this.options.mutationKey)?this.reset():this.#$?.state.status==="pending"&&this.#$.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#$?.removeObserver(this)}onMutationUpdate(e){this.#Z(),this.#G(e)}getCurrentResult(){return this.#q}reset(){this.#$?.removeObserver(this),this.#$=void 0,this.#Z(),this.#G()}mutate(e,t){return this.#B=t,this.#$?.removeObserver(this),this.#$=this.#E.getMutationCache().build(this.#E,this.options),this.#$.addObserver(this),this.#$.execute(e)}#Z(){let e=this.#$?.state??(0,A.R)();this.#q={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#G(e){d.V.batch(()=>{if(this.#B&&this.hasListeners()){let t=this.#q.variables,r=this.#q.context;e?.type==="success"?(this.#B.onSuccess?.(e.data,t,r),this.#B.onSettled?.(e.data,null,t,r)):e?.type==="error"&&(this.#B.onError?.(e.error,t,r),this.#B.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach(e=>{e(this.#q)})})}},U=r(836),K=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:(0,U.Gm)()},t)}getOptimisticResult(e){return e.behavior=(0,U.Gm)(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:a,isRefetchError:o}=n,u=r.fetchMeta?.fetchMore?.direction,l=a&&"forward"===u,c=s&&"forward"===u,h=a&&"backward"===u,f=s&&"backward"===u;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,U.Qy)(t,r.data),hasPreviousPage:(0,U.ZF)(t,r.data),isFetchNextPageError:l,isFetchingNextPage:c,isFetchPreviousPageError:h,isFetchingPreviousPage:f,isRefetchError:o&&!l&&!h,isRefetching:i&&!c&&!f}}};function V(e,t){return e.filter(e=>!t.includes(e))}var z=class extends y.l{#E;#W;#d;#X;#n;#Y;#J;#ee;constructor(e,t,r){super(),this.#E=e,this.#X=r,this.#d=[],this.#n=[],this.#W=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#n.forEach(e=>{e.subscribe(t=>{this.#et(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t,r){this.#d=e,this.#X=t,d.V.batch(()=>{let e=this.#n,t=this.#er(this.#d);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions,r));let n=t.map(e=>e.observer),s=n.map(e=>e.getCurrentResult()),i=n.some((t,r)=>t!==e[r]);(e.length!==n.length||i)&&(this.#n=n,this.#W=s,this.hasListeners()&&(V(e,n).forEach(e=>{e.destroy()}),V(n,e).forEach(e=>{e.subscribe(t=>{this.#et(e,t)})}),this.#G()))})}getCurrentResult(){return this.#W}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){let r=this.#er(e),n=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[n,e=>this.#en(e??n,t),()=>r.map((e,t)=>{let s=n[t];return e.defaultedQueryOptions.notifyOnChangeProps?s:e.observer.trackResult(s,e=>{r.forEach(t=>{t.observer.trackProp(e)})})})]}#en(e,t){return t?(this.#Y&&this.#W===this.#ee&&t===this.#J||(this.#J=t,this.#ee=this.#W,this.#Y=(0,s.Q$)(this.#Y,t(e))),this.#Y):e}#er(e){let t=new Map(this.#n.map(e=>[e.options.queryHash,e])),r=[];return e.forEach(e=>{let n=this.#E.defaultQueryOptions(e),s=t.get(n.queryHash);if(s)r.push({defaultedQueryOptions:n,observer:s});else{let e=this.#n.find(e=>e.options.queryHash===n.queryHash);r.push({defaultedQueryOptions:n,observer:e??new g(this.#E,n)})}}),r.sort((t,r)=>e.findIndex(e=>e.queryHash===t.defaultedQueryOptions.queryHash)-e.findIndex(e=>e.queryHash===r.defaultedQueryOptions.queryHash))}#et(e,t){let r=this.#n.indexOf(e);-1!==r&&(this.#W=function(e,t,r){let n=e.slice(0);return n[t]=r,n}(this.#W,r,t),this.#G())}#G(){this.hasListeners()&&this.#Y!==this.#en(this.#W,this.#X?.combine)&&d.V.batch(()=>{this.listeners.forEach(e=>{e(this.#W)})})}};function L(e,t){let{queries:r,...n}=e,s=(0,R.NL)(t),i=D(),a=C(),o=u.useMemo(()=>r.map(e=>{let t=s.defaultQueryOptions(e);return t._optimisticResults=i?"isRestoring":"optimistic",t}),[r,s,i]);o.forEach(e=>{k(e),P(e,a)}),q(a);let[l]=u.useState(()=>new z(s,o,n)),[c,h,f]=l.getOptimisticResult(o,n.combine);u.useSyncExternalStore(u.useCallback(e=>i?()=>void 0:l.subscribe(d.V.batchCalls(e)),[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u.useEffect(()=>{l.setQueries(o,n,{listeners:!1})},[o,n,l]);let p=c.some((e,t)=>M(o[t],e))?c.flatMap((e,t)=>{let r=o[t];if(r){let t=new g(s,r);if(M(r,e))return _(r,t,a);j(e,i)&&_(r,t,a)}return[]}):[];if(p.length>0)throw Promise.all(p);let y=c.find((e,t)=>{let r=o[t];return r&&Q({result:e,errorResetBoundary:a,throwOnError:r.throwOnError,query:s.getQueryCache().get(r.queryHash)})});if(null==y?void 0:y.error)throw y.error;return h(f())}function H(e,t,r){let n=e[0],s=e[1]?.input;return r&&(s={...s??{},...r.pageParam?{cursor:r.pageParam}:{},direction:r.direction}),[n.join("."),s,t?.trpc]}function G(e){return{path:e.path.join(".")}}function $(e){let t=G(e);return u.useMemo(()=>t,[t])}async function B(e,t,r){let n=t.getQueryCache().build(t,{queryKey:r});n.setState({data:[],status:"success"});let s=[];for await(let t of e)s.push(t),n.setState({data:[...s]});return s}function Z(e){return(0,i.IX)(t=>{let r=t.path,n=r.join("."),[s,i]=t.args;return{queryKey:a(r,s,"query"),queryFn:()=>e.query(n,s,i?.trpc),...i}})}function W(e){return function(e){let t=(0,i.IX)(({path:t,args:r})=>{let n=[...t],s=n.pop();if("useMutation"===s)return e[s](n,...r);if("_def"===s)return{path:n};let[i,...a]=r,o=a[0]||{};return e[s](n,i,o)});return(0,i.yh)(r=>"useContext"===r||"useUtils"===r?()=>{let t=e.useUtils();return u.useMemo(()=>(function(e){let t=(0,n.Bm)(e.client),r=(0,i.IX)(t=>{let r=[...t.path],n=r.pop(),s=[...t.args],i=s.shift(),u=a(r,i,h(n));return({infiniteQueryOptions:()=>e.infiniteQueryOptions(r,u,s[0]),queryOptions:()=>e.queryOptions(r,u,...s),fetch:()=>e.fetchQuery(u,...s),fetchInfinite:()=>e.fetchInfiniteQuery(u,s[0]),prefetch:()=>e.prefetchQuery(u,...s),prefetchInfinite:()=>e.prefetchInfiniteQuery(u,s[0]),ensureData:()=>e.ensureQueryData(u,...s),invalidate:()=>e.invalidateQueries(u,...s),reset:()=>e.resetQueries(u,...s),refetch:()=>e.refetchQueries(u,...s),cancel:()=>e.cancelQuery(u,...s),setData:()=>{e.setQueryData(u,s[0],s[1])},setQueriesData:()=>e.setQueriesData(u,s[0],s[1],s[2]),setInfiniteData:()=>{e.setInfiniteQueryData(u,s[0],s[1])},getData:()=>e.getQueryData(u),getInfiniteData:()=>e.getInfiniteQueryData(u),setMutationDefaults:()=>e.setMutationDefaults(o(r),i),getMutationDefaults:()=>e.getMutationDefaults(o(r)),isMutating:()=>e.isMutating({mutationKey:o(r)})})[n]()});return(0,i.yh)(n=>"client"===n?t:l.includes(n)?e[n]:r[n])})(t),[t])}:e.hasOwnProperty(r)?e[r]:t[r])}(function(e){let t=e?.overrides?.useMutation?.onSuccess??(e=>e.originalFn()),r=e?.context??c;function l(){let e=u.useContext(r);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function h(e,t){let{queryClient:r,ssrState:n}=l();return n&&"mounted"!==n&&r.getQueryCache().find({queryKey:e})?.state.status==="error"?{retryOnMount:!1,...t}:t}return{Provider:e=>{let{abortOnUnmount:t=!1,client:a,queryClient:o,ssrContext:l}=e,[c,h]=u.useState(e.ssrState??!1),f=u.useMemo(()=>(function(e){let{client:t,queryClient:r}=e,a=t instanceof n.NT?t:(0,n.ny)(t);return{infiniteQueryOptions:(e,t,r)=>{let n=t[1]?.input===s.CN,i=async e=>{let n={...r,trpc:{...r?.trpc,...r?.trpc?.abortOnUnmount?{signal:e.signal}:{signal:null}}};return await a.query(...H(t,n,{direction:e.direction,pageParam:e.pageParam}))};return Object.assign({...r,initialData:r?.initialData,queryKey:t,queryFn:n?s.CN:i,initialPageParam:r?.initialCursor??null},{trpc:G({path:e})})},queryOptions:(e,t,n)=>{let o=t[1]?.input===s.CN,u=async e=>{let s={...n,trpc:{...n?.trpc,...n?.trpc?.abortOnUnmount?{signal:e.signal}:{signal:null}}},o=await a.query(...H(t,s));return(0,i.D0)(o)?B(o,r,t):o};return Object.assign({...n,initialData:n?.initialData,queryKey:t,queryFn:o?s.CN:u},{trpc:G({path:e})})},fetchQuery:(e,t)=>r.fetchQuery({...t,queryKey:e,queryFn:()=>a.query(...H(e,t))}),fetchInfiniteQuery:(e,t)=>r.fetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:r,direction:n})=>a.query(...H(e,t,{pageParam:r,direction:n})),initialPageParam:t?.initialCursor??null}),prefetchQuery:(e,t)=>r.prefetchQuery({...t,queryKey:e,queryFn:()=>a.query(...H(e,t))}),prefetchInfiniteQuery:(e,t)=>r.prefetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:r,direction:n})=>a.query(...H(e,t,{pageParam:r,direction:n})),initialPageParam:t?.initialCursor??null}),ensureQueryData:(e,t)=>r.ensureQueryData({...t,queryKey:e,queryFn:()=>a.query(...H(e,t))}),invalidateQueries:(e,t,n)=>r.invalidateQueries({...t,queryKey:e},n),resetQueries:(e,t,n)=>r.resetQueries({...t,queryKey:e},n),refetchQueries:(e,t,n)=>r.refetchQueries({...t,queryKey:e},n),cancelQuery:(e,t)=>r.cancelQueries({queryKey:e},t),setQueryData:(e,t,n)=>r.setQueryData(e,t,n),setQueriesData:(e,t,n,s)=>r.setQueriesData({...t,queryKey:e},n,s),getQueryData:e=>r.getQueryData(e),setInfiniteQueryData:(e,t,n)=>r.setQueryData(e,t,n),getInfiniteQueryData:e=>r.getQueryData(e),setMutationDefaults:(t,n)=>{let s=t[0];return r.setMutationDefaults(t,"function"==typeof n?n({canonicalMutationFn:t=>a.mutation(...H([s,{input:t}],e))}):n)},getMutationDefaults:e=>r.getMutationDefaults(e),isMutating:e=>r.isMutating({...e,exact:!0})}})({client:a,queryClient:o}),[a,o]),d=u.useMemo(()=>({abortOnUnmount:t,queryClient:o,client:a,ssrContext:l??null,ssrState:c,...f}),[t,a,f,o,l,c]);return u.useEffect(()=>{h(e=>!!e&&"mounted")},[]),u.createElement(r.Provider,{value:d},e.children)},createClient:e=>(0,n.fE)(e),useContext:l,useUtils:l,useQuery:function(t,r,n){let{abortOnUnmount:o,client:u,ssrState:c,queryClient:f,prefetchQuery:d}=l(),p=a(t,r,"query"),y=f.getQueryDefaults(p),m=r===s.CN;"undefined"!=typeof window||"prepass"!==c||n?.trpc?.ssr===!1||(n?.enabled??y?.enabled)===!1||m||f.getQueryCache().find({queryKey:p})||d(p,n);let b=h(p,{...y,...n}),v=n?.trpc?.abortOnUnmount??e?.abortOnUnmount??o,w=F({...b,queryKey:p,queryFn:m?r:async e=>{let t={...b,trpc:{...b?.trpc,...v?{signal:e.signal}:{signal:null}}},r=await u.query(...H(p,t));return(0,i.D0)(r)?B(r,f,p):r}},g,f);return w.trpc=$({path:t}),w},usePrefetchQuery:function(t,r,n){let i=l(),o=a(t,r,"query"),u=r===s.CN,c=n?.trpc?.abortOnUnmount??e?.abortOnUnmount??i.abortOnUnmount;!function(e,t){let r=(0,R.NL)(void 0);r.getQueryState(e.queryKey)||r.prefetchQuery(e)}({...n,queryKey:o,queryFn:u?r:e=>{let t={trpc:{...c?{signal:e.signal}:{}}};return i.client.query(...H(o,t))}})},useSuspenseQuery:function(t,r,n){var s,i;let o=l(),u=a(t,r,"query"),c=n?.trpc?.abortOnUnmount??e?.abortOnUnmount??o.abortOnUnmount,h=(s={...n,queryKey:u,queryFn:e=>{let t={trpc:{...c?{signal:e.signal}:{signal:null}}};return o.client.query(...H(u,t))}},i=o.queryClient,F({...s,enabled:!0,suspense:!0,throwOnError:T,placeholderData:void 0},g,i));return h.trpc=$({path:t}),[h.data,h]},useQueries:e=>{let{ssrState:t,queryClient:r,prefetchQuery:n,client:s}=l(),i=e(Z(s));if("undefined"==typeof window&&"prepass"===t)for(let e of i)e.trpc?.ssr===!1||r.getQueryCache().find({queryKey:e.queryKey})||n(e.queryKey,e);return L({queries:i.map(e=>({...e,queryKey:e.queryKey}))},r)},useSuspenseQueries:e=>{var t;let{queryClient:r,client:n}=l(),s=L({...t={queries:e(Z(n)).map(e=>({...e,queryFn:e.queryFn,queryKey:e.queryKey}))},queries:t.queries.map(e=>({...e,suspense:!0,throwOnError:T,enabled:!0,placeholderData:void 0}))},r);return[s.map(e=>e.data),s]},useMutation:function(e,r){let{client:n,queryClient:s}=l(),i=o(e),a=s.defaultMutationOptions(s.getMutationDefaults(i)),c=function(e,t){let r=(0,R.NL)(t),[n]=u.useState(()=>new N(r,e));u.useEffect(()=>{n.setOptions(e)},[n,e]);let s=u.useSyncExternalStore(u.useCallback(e=>n.subscribe(d.V.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=u.useCallback((e,t)=>{n.mutate(e,t).catch(S)},[n]);if(s.error&&x(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}({...r,mutationKey:i,mutationFn:t=>n.mutation(...H([e,{input:t}],r)),onSuccess:(...e)=>t({originalFn:()=>r?.onSuccess?.(...e)??a?.onSuccess?.(...e),queryClient:s,meta:r?.meta??a?.meta??{}})},s);return c.trpc=$({path:e}),c},useSubscription:function(e,t,r){let n=r?.enabled??t!==s.CN,i=(0,s.Ym)(a(e,t,"any")),{client:o}=l(),c=u.useRef(r);c.current=r,u.useEffect(()=>{if(!n)return;let r=!1,s=o.subscription(e.join("."),t??void 0,{onStarted:()=>{r||c.current.onStarted?.()},onData:e=>{r||c.current.onData(e)},onError:e=>{r||c.current.onError?.(e)}});return()=>{r=!0,s.unsubscribe()}},[i,n])},useInfiniteQuery:function(e,t,r){let{client:n,ssrState:i,prefetchInfiniteQuery:o,queryClient:u,abortOnUnmount:c}=l(),f=a(e,t,"infinite"),d=u.getQueryDefaults(f),p=t===s.CN;"undefined"!=typeof window||"prepass"!==i||r?.trpc?.ssr===!1||(r?.enabled??d?.enabled)===!1||p||u.getQueryCache().find({queryKey:f})||o(f,{...d,...r});let y=h(f,{...d,...r}),m=r?.trpc?.abortOnUnmount??c,g=F({...y,initialPageParam:r.initialCursor??null,persister:r.persister,queryKey:f,queryFn:p?t:e=>{let t={...y,trpc:{...y?.trpc,...m?{signal:e.signal}:{signal:null}}};return n.query(...H(f,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}},K,u);return g.trpc=$({path:e}),g},usePrefetchInfiniteQuery:function(e,t,r){let n=l(),i=a(e,t,"infinite"),o=n.queryClient.getQueryDefaults(i),u=t===s.CN,c=h(i,{...o,...r}),f=r?.trpc?.abortOnUnmount??n.abortOnUnmount;!function(e,t){let r=(0,R.NL)(void 0);r.getQueryState(e.queryKey)||r.prefetchInfiniteQuery(e)}({...r,initialPageParam:r.initialCursor??null,queryKey:i,queryFn:u?t:e=>{let t={...c,trpc:{...c?.trpc,...f?{signal:e.signal}:{}}};return n.client.query(...H(i,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}})},useSuspenseInfiniteQuery:function(e,t,r){var n,s;let i=l(),o=a(e,t,"infinite"),u=i.queryClient.getQueryDefaults(o),c=h(o,{...u,...r}),f=r?.trpc?.abortOnUnmount??i.abortOnUnmount,d=(n={...r,initialPageParam:r.initialCursor??null,queryKey:o,queryFn:e=>{let t={...c,trpc:{...c?.trpc,...f?{signal:e.signal}:{}}};return i.client.query(...H(o,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}},s=i.queryClient,F({...n,enabled:!0,suspense:!0,throwOnError:T},K,s));return d.trpc=$({path:e}),[d.data,d]}}}(e))}},8401:(e,t,r)=>{"use strict";var n,s;r.d(t,{yh:()=>u,IX:()=>o,D0:()=>p,Kn:()=>h,$N:()=>C});let i=()=>{},a=e=>{Object.freeze&&Object.freeze(e)},o=e=>(function e(t,r,o){let u=r.join(".");return(n=o)[s=u]??(n[s]=new Proxy(i,{get(n,s){if("string"==typeof s&&"then"!==s)return e(t,[...r,s],o)},apply(e,n,s){let i=r[r.length-1],o={args:s,path:r};return"call"===i?o={args:s.length>=2?[s[1]]:[],path:r.slice(0,-1)}:"apply"===i&&(o={args:s.length>=2?s[1]:[],path:r.slice(0,-1)}),a(o.args),a(o.path),t(o)}})),o[u]})(e,[],Object.create(null)),u=e=>new Proxy(i,{get(t,r){if("string"==typeof r&&"then"!==r)return e(r)}}),l=Symbol();function c(e,...t){let r=Object.assign(Object.create(null),e);for(let e of t)for(let t in e){if(t in r&&r[t]!==e[t])throw Error(`Duplicate key ${t}`);r[t]=e[t]}return r}function h(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}function f(e){return Object.assign(Object.create(null),e)}let d="function"==typeof Symbol&&!!Symbol.asyncIterator;function p(e){return d&&h(e)&&Symbol.asyncIterator in e}class y extends Error{}function m(e){if(e instanceof g||e instanceof Error&&"TRPCError"===e.name)return e;let t=new g({code:"INTERNAL_SERVER_ERROR",cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}class g extends Error{constructor(e){let t=function(e){if(e instanceof Error)return e;let t=typeof e;if("undefined"!==t&&"function"!==t&&null!==e){if("object"!==t)return Error(String(e));if(h(e)){let t=new y;for(let r in e)t[r]=e[r];return t}}}(e.cause);super(e.message??t?.message??e.code,{cause:t}),this.code=e.code,this.name="TRPCError",this.cause||(this.cause=t)}}function b(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}let v=Symbol();function w(){let e=null,t=b(),r=!1;return{readable:new ReadableStream({start(t){e=t},cancel(){t.resolve(v),r=!0}}),controller:e,cancelledPromise:t.promise,cancelled:()=>r}}class O extends Error{constructor(e){super("Invalid response or stream interrupted",{cause:e})}}class R extends Error{constructor(e){super("Received error from server"),this.data=e}}let E=e=>({getReader(){let{readable:t,controller:r}=w();return e.on("data",e=>{r.enqueue(e)}),e.on("end",()=>{r.close()}),e.on("error",e=>{r.error(e)}),t.getReader()}});async function C(e){let{deserialize:t=e=>e}=e,r=function(e){let t=function(e){let t="getReader"in e?e.getReader():E(e).getReader(),r="";return new ReadableStream({async pull(e){let{done:r,value:n}=await t.read();r?e.close():e.enqueue(n)},cancel:()=>t.cancel()}).pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({transform(e,t){let n=(r+=e).split("\n");for(let e of(r=n.pop()??"",n))t.enqueue(e)}}))}(e),r=!1;return t.pipeThrough(new TransformStream({transform(e,t){if(r){let r=JSON.parse(e);t.enqueue(r)}else{let n=JSON.parse(e);t.enqueue(n),r=!0}}}))}(e.from);t&&(r=r.pipeThrough(new TransformStream({transform(e,r){r.enqueue(t(e))}})));let n=b(),s=new Map,i=new Map,a=()=>{0===s.size&&Array.from(i.values()).every(e=>e.returned)&&e.abortController?.abort()},o=e=>{let t=new O(e);for(let e of(n?.reject(t),s.values()))e.reject(t);for(let{controller:e}of(s.clear(),i.values()))e.enqueue(t),e.close();i.clear()};return r.pipeTo(new WritableStream({async write(t){if(n){for(let[r,n]of Object.entries(t)){let o=function t(r){let[[n],...o]=r;for(let r of o){let[o]=r,u=function(r){let[n,o,u]=r,{readable:l,controller:c}=w(),h={controller:c,returned:!1};i.set(u,h);let f=s.get(u);switch(f&&(f.resolve(h),s.delete(u)),o){case 0:return new Promise((r,n)=>{l.getReader().read().then(s=>{if(s.done){n(Error("Promise chunk ended without value"));return}if(s.value instanceof O){n(s.value);return}let[i,a,o]=s.value;switch(a){case 0:r(t(o));break;case 1:n(e.formatError?.({error:o})??new R(o))}}).catch(n).finally(()=>{i.delete(u),a()})});case 1:return{[Symbol.asyncIterator]:()=>{let r=l.getReader();return{next:async()=>{let{done:n,value:s}=await r.read();if(s instanceof O)throw s;if(n)return i.delete(u),a(),{done:!0,value:void 0};let[o,l,c]=s;switch(l){case 1:return{done:!1,value:t(c)};case 0:return i.delete(u),a(),{done:!0,value:t(c)};case 2:throw i.delete(u),a(),e.formatError?.({error:c})??new R(c)}},return:async()=>(h.returned=!0,a(),{done:!0,value:void 0})}}}}}(r);if(null===o)return u;n[o]=u}return n}(n);t[r]=o}n.resolve(t),n=null;return}let[r]=t,o=i.get(r);if(!o){let e=s.get(r);e||(e=b(),s.set(r,e)),o=await e.promise}o.controller.enqueue(t)},close:o,abort:o})).catch(t=>{e.onError?.({error:t}),o(t)}),[await n.promise,{controllers:i}]}Symbol(),Symbol("ping");let x={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}},S=({shape:e})=>e,P="middlewareMarker";function q(e){if("function"==typeof e&&"function"==typeof e.assert)return e.assert.bind(e);if("function"==typeof e)return e;if("function"==typeof e.parseAsync)return e.parseAsync.bind(e);if("function"==typeof e.parse)return e.parse.bind(e);if("function"==typeof e.validateSync)return e.validateSync.bind(e);if("function"==typeof e.create)return e.create.bind(e);if("function"==typeof e.assert)return t=>(e.assert(t),t);throw Error("Could not find a validator fn")}function Q(e,t){let{middlewares:r=[],inputs:n,meta:s,...i}=t;return I({...c(e,i),inputs:[...e.inputs,...n??[]],middlewares:[...e.middlewares,...r],meta:e.meta&&s?{...e.meta,...s}:s??e.meta})}function I(e={}){let t={procedure:!0,inputs:[],middlewares:[],...e};return{_def:t,input(e){let r=q(e);return Q(t,{inputs:[e],middlewares:[function(e){let t=async function(t){let r;let n=await t.getRawInput();try{r=await e(n)}catch(e){throw new g({code:"BAD_REQUEST",cause:e})}let s=h(t.input)&&h(r)?{...t.input,...r}:r;return t.next({input:s})};return t._type="input",t}(r)]})},output(e){let r=q(e);return Q(t,{output:e,middlewares:[function(e){let t=async function({next:t}){let r=await t();if(!r.ok)return r;try{let t=await e(r.data);return{...r,data:t}}catch(e){throw new g({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:e})}};return t._type="output",t}(r)]})},meta:e=>Q(t,{meta:e}),use:e=>Q(t,{middlewares:"_middlewares"in e?e._middlewares:[e]}),unstable_concat:e=>Q(t,e._def),query:e=>D({...t,type:"query"},e),mutation:e=>D({...t,type:"mutation"},e),subscription:e=>D({...t,type:"subscription"},e),experimental_caller:e=>Q(t,{caller:e})}}function D(e,t){let r=Q(e,{resolver:t,middlewares:[async function(e){return{marker:P,ok:!0,data:await t(e),ctx:e.ctx}}]}),n={...r._def,type:e.type,experimental_caller:!!r._def.caller,meta:r._def.meta,$types:null},s=function(e){async function t(t){if(!t||!("getRawInput"in t))throw Error(T);let r=await k(0,e,t);if(!r)throw new g({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!r.ok)throw r.error;return r.data}return t._def=e,t}(r._def),i=r._def.caller;if(!i)return s;let a=async(...e)=>await i({args:e,invoke:s,_def:n});return a._def=n,a}let T=`
This is a client-only function.
If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
`.trim();async function k(e,t,r){try{let n=t.middlewares[e];return await n({...r,meta:t.meta,input:r.input,next:n=>k(e+1,t,{...r,ctx:n?.ctx?{...r.ctx,...n.ctx}:r.ctx,input:n&&"input"in n?n.input:r.input,getRawInput:n?.getRawInput??r.getRawInput})})}catch(e){return{ok:!1,error:m(e),marker:P}}}let j="undefined"==typeof window||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID,M={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:S,transformer:x},_=["then","call","apply"];function F(e){return function(t){let r=new Set(Object.keys(t).filter(e=>_.includes(e)));if(r.size>0)throw Error("Reserved words used in `router({})` call: "+Array.from(r).join(", "));let n=f({}),s=function e(t,r=[]){let s=f({});for(let[i,a]of Object.entries(t??{})){if(a._def&&"router"in a._def){s[i]=e(a._def.record,[...r,i]);continue}if("function"!=typeof a){s[i]=e(a,[...r,i]);continue}let t=[...r,i].join(".");if(n[t])throw Error(`Duplicate key: ${t}`);n[t]=a,s[i]=a}return s}(t),i={_config:e,router:!0,procedures:n,...M,record:s};return{...s,_def:i,createCaller:A()({_def:i})}}}function A(){return function(e){let t=e._def;return function(e,r){return o(async({path:n,args:s})=>{let i;let a=n.join(".");if(1===n.length&&"_def"===n[0])return t;let o=t.procedures[a];try{return i="function"==typeof e?await Promise.resolve(e()):e,await o({path:a,getRawInput:async()=>s[0],ctx:i,type:o._def.type,signal:r?.signal})}catch(e){throw r?.onError?.({ctx:i,error:m(e),input:s[0],path:a,type:o._def.type}),e}})}}}function N(...e){let t=c({},...e.map(e=>e._def.record));return F({errorFormatter:e.reduce((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==S){if(e!==S&&e!==t._def._config.errorFormatter)throw Error("You seem to have several error formatters");return t._def._config.errorFormatter}return e},S),transformer:e.reduce((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==x){if(e!==x&&e!==t._def._config.transformer)throw Error("You seem to have several transformers");return t._def._config.transformer}return e},x),isDev:e.every(e=>e._def._config.isDev),allowOutsideOfServer:e.every(e=>e._def._config.allowOutsideOfServer),isServer:e.every(e=>e._def._config.isServer),$types:e[0]?._def._config.$types})(t)}class U{context(){return new U}meta(){return new U}create(e){var t;let r={transformer:"input"in(t=e?.transformer??x)?t:{input:t,output:t},isDev:e?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??S,isServer:e?.isServer??j,$types:null,experimental:e?.experimental??{}};if(!(e?.isServer??j)&&e?.allowOutsideOfServer!==!0)throw Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:r,procedure:I({meta:e?.defaultMeta}),middleware:function(e){return function e(t){return{_middlewares:t,unstable_pipe:r=>e([...t,..."_middlewares"in r?r._middlewares:[r]])}}([e])},router:F(r),mergeRouters:N,createCallerFactory:A()}}}new U},8726:(e,t,r)=>{"use strict";function n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}r.d(t,{Toaster:()=>eS,ZP:()=>eP});var s,i=r(2265);let a={data:""},o=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||a,u=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,l=/\/\*[^]*?\*\/|  +/g,c=/\n+/g,h=(e,t)=>{let r="",n="",s="";for(let i in e){let a=e[i];"@"==i[0]?"i"==i[1]?r=i+" "+a+";":n+="f"==i[1]?h(a,i):i+"{"+h(a,"k"==i[1]?"":t)+"}":"object"==typeof a?n+=h(a,t?t.replace(/([^,])+/g,e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):i):null!=a&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=h.p?h.p(i,a):i+":"+a+";")}return r+(t&&s?t+"{"+s+"}":s)+n},f={},d=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+d(e[r]);return t}return e},p=(e,t,r,n,s)=>{let i=d(e),a=f[i]||(f[i]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(i));if(!f[a]){let t=i!==e?e:(e=>{let t,r,n=[{}];for(;t=u.exec(e.replace(l,""));)t[4]?n.shift():t[3]?(r=t[3].replace(c," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(c," ").trim();return n[0]})(e);f[a]=h(s?{["@keyframes "+a]:t}:t,r?"":"."+a)}let o=r&&f.g?f.g:null;return r&&(f.g=f[a]),((e,t,r,n)=>{n?t.data=t.data.replace(n,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(f[a],t,n,o),a},y=(e,t,r)=>e.reduce((e,n,s)=>{let i=t[s];if(i&&i.call){let e=i(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":h(e,""):!1===e?"":e}return e+n+(null==i?"":i)},"");function m(e){let t=this||{},r=e.call?e(t.p):e;return p(r.unshift?r.raw?y(r,[].slice.call(arguments,1),t.p):r.reduce((e,r)=>Object.assign(e,r&&r.call?r(t.p):r),{}):r,o(t.target),t.g,t.o,t.k)}m.bind({g:1});let g,b,v,w=m.bind({k:1});function O(e,t){let r=this||{};return function(){let n=arguments;function s(i,a){let o=Object.assign({},i),u=o.className||s.className;r.p=Object.assign({theme:b&&b()},o),r.o=/ *go\d+/.test(u),o.className=m.apply(r,n)+(u?" "+u:""),t&&(o.ref=a);let l=e;return e[0]&&(l=o.as||e,delete o.as),v&&l[0]&&v(o),g(l,o)}return t?t(s):s}}function R(){let e=n(["\nfrom {\n  transform: scale(0) rotate(45deg);\n	opacity: 0;\n}\nto {\n transform: scale(1) rotate(45deg);\n  opacity: 1;\n}"]);return R=function(){return e},e}function E(){let e=n(["\nfrom {\n  transform: scale(0);\n  opacity: 0;\n}\nto {\n  transform: scale(1);\n  opacity: 1;\n}"]);return E=function(){return e},e}function C(){let e=n(["\nfrom {\n  transform: scale(0) rotate(90deg);\n	opacity: 0;\n}\nto {\n  transform: scale(1) rotate(90deg);\n	opacity: 1;\n}"]);return C=function(){return e},e}function x(){let e=n(["\n  width: 20px;\n  opacity: 0;\n  height: 20px;\n  border-radius: 10px;\n  background: ",";\n  position: relative;\n  transform: rotate(45deg);\n\n  animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n    forwards;\n  animation-delay: 100ms;\n\n  &:after,\n  &:before {\n    content: '';\n    animation: "," 0.15s ease-out forwards;\n    animation-delay: 150ms;\n    position: absolute;\n    border-radius: 3px;\n    opacity: 0;\n    background: ",";\n    bottom: 9px;\n    left: 4px;\n    height: 2px;\n    width: 12px;\n  }\n\n  &:before {\n    animation: "," 0.15s ease-out forwards;\n    animation-delay: 180ms;\n    transform: rotate(90deg);\n  }\n"]);return x=function(){return e},e}function S(){let e=n(["\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n"]);return S=function(){return e},e}function P(){let e=n(["\n  width: 12px;\n  height: 12px;\n  box-sizing: border-box;\n  border: 2px solid;\n  border-radius: 100%;\n  border-color: ",";\n  border-right-color: ",";\n  animation: "," 1s linear infinite;\n"]);return P=function(){return e},e}function q(){let e=n(["\nfrom {\n  transform: scale(0) rotate(45deg);\n	opacity: 0;\n}\nto {\n  transform: scale(1) rotate(45deg);\n	opacity: 1;\n}"]);return q=function(){return e},e}function Q(){let e=n(["\n0% {\n	height: 0;\n	width: 0;\n	opacity: 0;\n}\n40% {\n  height: 0;\n	width: 6px;\n	opacity: 1;\n}\n100% {\n  opacity: 1;\n  height: 10px;\n}"]);return Q=function(){return e},e}function I(){let e=n(["\n  width: 20px;\n  opacity: 0;\n  height: 20px;\n  border-radius: 10px;\n  background: ",";\n  position: relative;\n  transform: rotate(45deg);\n\n  animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n    forwards;\n  animation-delay: 100ms;\n  &:after {\n    content: '';\n    box-sizing: border-box;\n    animation: "," 0.2s ease-out forwards;\n    opacity: 0;\n    animation-delay: 200ms;\n    position: absolute;\n    border-right: 2px solid;\n    border-bottom: 2px solid;\n    border-color: ",";\n    bottom: 6px;\n    left: 6px;\n    height: 10px;\n    width: 6px;\n  }\n"]);return I=function(){return e},e}function D(){let e=n(["\n  position: absolute;\n"]);return D=function(){return e},e}function T(){let e=n(["\n  position: relative;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  min-width: 20px;\n  min-height: 20px;\n"]);return T=function(){return e},e}function k(){let e=n(["\nfrom {\n  transform: scale(0.6);\n  opacity: 0.4;\n}\nto {\n  transform: scale(1);\n  opacity: 1;\n}"]);return k=function(){return e},e}function j(){let e=n(["\n  position: relative;\n  transform: scale(0.6);\n  opacity: 0.4;\n  min-width: 20px;\n  animation: "," 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n    forwards;\n"]);return j=function(){return e},e}function M(){let e=n(["\n  display: flex;\n  align-items: center;\n  background: #fff;\n  color: #363636;\n  line-height: 1.3;\n  will-change: transform;\n  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);\n  max-width: 350px;\n  pointer-events: auto;\n  padding: 8px 10px;\n  border-radius: 8px;\n"]);return M=function(){return e},e}function _(){let e=n(["\n  display: flex;\n  justify-content: center;\n  margin: 4px 10px;\n  color: inherit;\n  flex: 1 1 auto;\n  white-space: pre-line;\n"]);return _=function(){return e},e}function F(){let e=n(["\n  z-index: 9999;\n  > * {\n    pointer-events: auto;\n  }\n"]);return F=function(){return e},e}var A=e=>"function"==typeof e,N=(e,t)=>A(e)?e(t):e,U=(()=>{let e=0;return()=>(++e).toString()})(),K=(()=>{let e;return()=>{if(void 0===e&&"u">typeof window){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),V=new Map,z=e=>{if(V.has(e))return;let t=setTimeout(()=>{V.delete(e),B({type:4,toastId:e})},1e3);V.set(e,t)},L=e=>{let t=V.get(e);t&&clearTimeout(t)},H=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return t.toast.id&&L(t.toast.id),{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return e.toasts.find(e=>e.id===r.id)?H(e,{type:1,toast:r}):H(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?z(n):e.toasts.forEach(e=>{z(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||void 0===n?{...e,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+s}))}}},G=[],$={toasts:[],pausedAt:void 0},B=e=>{$=H($,e),G.forEach(e=>{e($)})},Z={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},W=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=(0,i.useState)($);(0,i.useEffect)(()=>(G.push(r),()=>{let e=G.indexOf(r);e>-1&&G.splice(e,1)}),[t]);let n=t.toasts.map(t=>{var r,n;return{...e,...e[t.type],...t,duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==e?void 0:e.duration)||Z[t.type],style:{...e.style,...null==(n=e[t.type])?void 0:n.style,...t.style}}});return{...t,toasts:n}},X=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"blank",r=arguments.length>2?arguments[2]:void 0;return{createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(null==r?void 0:r.id)||U()}},Y=e=>(t,r)=>{let n=X(t,e,r);return B({type:2,toast:n}),n.id},J=(e,t)=>Y("blank")(e,t);J.error=Y("error"),J.success=Y("success"),J.loading=Y("loading"),J.custom=Y("custom"),J.dismiss=e=>{B({type:3,toastId:e})},J.remove=e=>B({type:4,toastId:e}),J.promise=(e,t,r)=>{let n=J.loading(t.loading,{...r,...null==r?void 0:r.loading});return e.then(e=>(J.success(N(t.success,e),{id:n,...r,...null==r?void 0:r.success}),e)).catch(e=>{J.error(N(t.error,e),{id:n,...r,...null==r?void 0:r.error})}),e};var ee=(e,t)=>{B({type:1,toast:{id:e,height:t}})},et=()=>{B({type:5,time:Date.now()})},er=e=>{let{toasts:t,pausedAt:r}=W(e);(0,i.useEffect)(()=>{if(r)return;let e=Date.now(),n=t.map(t=>{if(t.duration===1/0)return;let r=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(r<0){t.visible&&J.dismiss(t.id);return}return setTimeout(()=>J.dismiss(t.id),r)});return()=>{n.forEach(e=>e&&clearTimeout(e))}},[t,r]);let n=(0,i.useCallback)(()=>{r&&B({type:6,time:Date.now()})},[r]),s=(0,i.useCallback)((e,r)=>{let{reverseOrder:n=!1,gutter:s=8,defaultPosition:i}=r||{},a=t.filter(t=>(t.position||i)===(e.position||i)&&t.height),o=a.findIndex(t=>t.id===e.id),u=a.filter((e,t)=>t<o&&e.visible).length;return a.filter(e=>e.visible).slice(...n?[u+1]:[0,u]).reduce((e,t)=>e+(t.height||0)+s,0)},[t]);return{toasts:t,handlers:{updateHeight:ee,startPause:et,endPause:n,calculateOffset:s}}},en=w(R()),es=w(E()),ei=w(C()),ea=O("div")(x(),e=>e.primary||"#ff4b4b",en,es,e=>e.secondary||"#fff",ei),eo=w(S()),eu=O("div")(P(),e=>e.secondary||"#e0e0e0",e=>e.primary||"#616161",eo),el=w(q()),ec=w(Q()),eh=O("div")(I(),e=>e.primary||"#61d345",el,ec,e=>e.secondary||"#fff"),ef=O("div")(D()),ed=O("div")(T()),ep=w(k()),ey=O("div")(j(),ep),em=e=>{let{toast:t}=e,{icon:r,type:n,iconTheme:s}=t;return void 0!==r?"string"==typeof r?i.createElement(ey,null,r):r:"blank"===n?null:i.createElement(ed,null,i.createElement(eu,{...s}),"loading"!==n&&i.createElement(ef,null,"error"===n?i.createElement(ea,{...s}):i.createElement(eh,{...s})))},eg=e=>"\n0% {transform: translate3d(0,".concat(-200*e,"%,0) scale(.6); opacity:.5;}\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\n"),eb=e=>"\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\n100% {transform: translate3d(0,".concat(-150*e,"%,-1px) scale(.6); opacity:0;}\n"),ev=O("div")(M()),ew=O("div")(_()),eO=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=K()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[eg(r),eb(r)];return{animation:t?"".concat(w(n)," 0.35s cubic-bezier(.21,1.02,.73,1) forwards"):"".concat(w(s)," 0.4s forwards cubic-bezier(.06,.71,.55,1)")}},eR=i.memo(e=>{let{toast:t,position:r,style:n,children:s}=e,a=t.height?eO(t.position||r||"top-center",t.visible):{opacity:0},o=i.createElement(em,{toast:t}),u=i.createElement(ew,{...t.ariaProps},N(t.message,t));return i.createElement(ev,{className:t.className,style:{...a,...n,...t.style}},"function"==typeof s?s({icon:o,message:u}):i.createElement(i.Fragment,null,o,u))});s=i.createElement,h.p=void 0,g=s,b=void 0,v=void 0;var eE=e=>{let{id:t,className:r,style:n,onHeightUpdate:s,children:a}=e,o=i.useCallback(e=>{if(e){let r=()=>{s(t,e.getBoundingClientRect().height)};r(),new MutationObserver(r).observe(e,{subtree:!0,childList:!0,characterData:!0})}},[t,s]);return i.createElement("div",{ref:o,className:r,style:n},a)},eC=(e,t)=>{let r=e.includes("top"),n=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:K()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:"translateY(".concat(t*(r?1:-1),"px)"),...r?{top:0}:{bottom:0},...n}},ex=m(F()),eS=e=>{let{reverseOrder:t,position:r="top-center",toastOptions:n,gutter:s,children:a,containerStyle:o,containerClassName:u}=e,{toasts:l,handlers:c}=er(n);return i.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...o},className:u,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(e=>{let n=e.position||r,o=eC(n,c.calculateOffset(e,{reverseOrder:t,gutter:s,defaultPosition:r}));return i.createElement(eE,{id:e.id,key:e.id,onHeightUpdate:c.updateHeight,className:e.visible?ex:"",style:o},"custom"===e.type?N(e.message,e):a?a(e):i.createElement(eR,{toast:e,position:n}))}))},eP=J},6865:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>Z});class n{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class s{constructor(e){this.generateIdentifier=e,this.kv=new n}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class i extends s{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){"object"==typeof t?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function a(e,t){Object.entries(e).forEach(([e,r])=>t(r,e))}function o(e,t){return -1!==e.indexOf(t)}function u(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n}}class l{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return function(e,t){let r=function(e){if("values"in Object)return Object.values(e);let t=[];for(let r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}(e);if("find"in r)return r.find(t);for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}}let c=e=>Object.prototype.toString.call(e).slice(8,-1),h=e=>void 0===e,f=e=>null===e,d=e=>"object"==typeof e&&null!==e&&e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype),p=e=>d(e)&&0===Object.keys(e).length,y=e=>Array.isArray(e),m=e=>"string"==typeof e,g=e=>"number"==typeof e&&!isNaN(e),b=e=>"boolean"==typeof e,v=e=>e instanceof Map,w=e=>e instanceof Set,O=e=>"Symbol"===c(e),R=e=>"number"==typeof e&&isNaN(e),E=e=>b(e)||f(e)||h(e)||g(e)||m(e)||O(e),C=e=>e===1/0||e===-1/0,x=e=>e.replace(/\./g,"\\."),S=e=>e.map(String).map(x).join("."),P=e=>{let t=[],r="";for(let n=0;n<e.length;n++){let s=e.charAt(n);if("\\"===s&&"."===e.charAt(n+1)){r+=".",n++;continue}if("."===s){t.push(r),r="";continue}r+=s}let n=r;return t.push(n),t};function q(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}let Q=[q(h,"undefined",()=>null,()=>void 0),q(e=>"bigint"==typeof e,"bigint",e=>e.toString(),e=>"undefined"!=typeof BigInt?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),q(e=>e instanceof Date&&!isNaN(e.valueOf()),"Date",e=>e.toISOString(),e=>new Date(e)),q(e=>e instanceof Error,"Error",(e,t)=>{let r={name:e.name,message:e.message};return t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r},(e,t)=>{let r=Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r}),q(e=>e instanceof RegExp,"regexp",e=>""+e,e=>new RegExp(e.slice(1,e.lastIndexOf("/")),e.slice(e.lastIndexOf("/")+1))),q(w,"set",e=>[...e.values()],e=>new Set(e)),q(v,"map",e=>[...e.entries()],e=>new Map(e)),q(e=>R(e)||C(e),"number",e=>R(e)?"NaN":e>0?"Infinity":"-Infinity",Number),q(e=>0===e&&1/e==-1/0,"number",()=>"-0",Number),q(e=>e instanceof URL,"URL",e=>e.toString(),e=>new URL(e))];function I(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}let D=I((e,t)=>!!O(e)&&!!t.symbolRegistry.getIdentifier(e),(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{let n=r.symbolRegistry.getValue(t[1]);if(!n)throw Error("Trying to deserialize unknown symbol");return n}),T=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),k=I(e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{let r=T[t[1]];if(!r)throw Error("Trying to deserialize unknown typed array");return new r(e)});function j(e,t){return!!e?.constructor&&!!t.classRegistry.getIdentifier(e.constructor)}let M=I(j,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};let n={};return r.forEach(t=>{n[t]=e[t]}),n},(e,t,r)=>{let n=r.classRegistry.getValue(t[1]);if(!n)throw Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(n.prototype),e)}),_=I((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{let n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),F=[M,D,_,k],A=(e,t)=>{let r=u(F,r=>r.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};let n=u(Q,r=>r.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},N={};Q.forEach(e=>{N[e.annotation]=e});let U=(e,t,r)=>{if(y(t))switch(t[0]){case"symbol":return D.untransform(e,t,r);case"class":return M.untransform(e,t,r);case"custom":return _.untransform(e,t,r);case"typed-array":return k.untransform(e,t,r);default:throw Error("Unknown transformation: "+t)}else{let n=N[t];if(!n)throw Error("Unknown transformation: "+t);return n.untransform(e,r)}},K=(e,t)=>{let r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function V(e){if(o(e,"__proto__"))throw Error("__proto__ is not allowed as a property");if(o(e,"prototype"))throw Error("prototype is not allowed as a property");if(o(e,"constructor"))throw Error("constructor is not allowed as a property")}let z=(e,t)=>{V(t);for(let r=0;r<t.length;r++){let n=t[r];if(w(e))e=K(e,+n);else if(v(e)){let s=+n,i=0==+t[++r]?"key":"value",a=K(e,s);switch(i){case"key":e=a;break;case"value":e=e.get(a)}}else e=e[n]}return e},L=(e,t,r)=>{if(V(t),0===t.length)return r(e);let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(y(n))n=n[+r];else if(d(n))n=n[r];else if(w(n))n=K(n,+r);else if(v(n)){if(e===t.length-2)break;let s=+r,i=0==+t[++e]?"key":"value",a=K(n,s);switch(i){case"key":n=a;break;case"value":n=n.get(a)}}}let s=t[t.length-1];if(y(n)?n[+s]=r(n[+s]):d(n)&&(n[s]=r(n[s])),w(n)){let e=K(n,+s),t=r(e);e!==t&&(n.delete(e),n.add(t))}if(v(n)){let e=K(n,+t[t.length-2]);switch(0==+s?"key":"value"){case"key":{let t=r(e);n.set(t,n.get(e)),t!==e&&n.delete(e);break}case"value":n.set(e,r(n.get(e)))}}return e},H=(e,t)=>d(e)||y(e)||v(e)||w(e)||j(e,t),G=(e,t,r,n,s=[],i=[],u=new Map)=>{let l=E(e);if(!l){!function(e,t,r){let n=r.get(e);n?n.push(t):r.set(e,[t])}(e,s,t);let r=u.get(e);if(r)return n?{transformedValue:null}:r}if(!H(e,r)){let t=A(e,r),n=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return l||u.set(e,n),n}if(o(i,e))return{transformedValue:null};let c=A(e,r),h=c?.value??e,f=y(h)?[]:{},m={};a(h,(o,l)=>{if("__proto__"===l||"constructor"===l||"prototype"===l)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let c=G(o,t,r,n,[...s,l],[...i,e],u);f[l]=c.transformedValue,y(c.annotations)?m[l]=c.annotations:d(c.annotations)&&a(c.annotations,(e,t)=>{m[x(l)+"."+t]=e})});let g=p(m)?{transformedValue:f,annotations:c?[c.type]:void 0}:{transformedValue:f,annotations:c?[c.type,m]:m};return l||u.set(e,g),g};function $(e){return Object.prototype.toString.call(e).slice(8,-1)}function B(e){return"Array"===$(e)}class Z{constructor({dedupe:e=!1}={}){this.classRegistry=new i,this.symbolRegistry=new s(e=>e.description??""),this.customTransformerRegistry=new l,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,r=G(e,t,this,this.dedupe),n={json:r.transformedValue};r.annotations&&(n.meta={...n.meta,values:r.annotations});let s=function(e,t){let r;let n={};return(e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[s,...i]=e;0===s.length?r=i.map(S):n[S(s)]=i.map(S)}),r)?p(n)?[r]:[r,n]:p(n)?void 0:n}(t,this.dedupe);return s&&(n.meta={...n.meta,referentialEqualities:s}),n}deserialize(e){let{json:t,meta:r}=e,n=function e(t,r={}){return B(t)?t.map(t=>e(t,r)):!function(e){if("Object"!==$(e))return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}(t)?t:[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)].reduce((n,s)=>{if(B(r.props)&&!r.props.includes(s))return n;let i=e(t[s],r);return!function(e,t,r,n,s){let i=({}).propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";"enumerable"===i&&(e[t]=r),s&&"nonenumerable"===i&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}(n,s,i,t,r.nonenumerable),n},{})}(t);if(r?.values){var s,i,o;s=n,i=r.values,o=this,function e(t,r,n=[]){if(!t)return;if(!y(t)){a(t,(t,s)=>e(t,r,[...n,...P(s)]));return}let[s,i]=t;i&&a(i,(t,s)=>{e(t,r,[...n,...P(s)])}),r(s,n)}(i,(e,t)=>{s=L(s,t,t=>U(t,e,o))}),n=s}return r?.referentialEqualities&&(n=function(e,t){function r(t,r){let n=z(e,P(r));t.map(P).forEach(t=>{e=L(e,t,()=>n)})}if(y(t)){let[n,s]=t;n.forEach(t=>{e=L(e,P(t),()=>e)}),s&&a(s,r)}else a(t,r);return e}(n,r.referentialEqualities)),n}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}Z.defaultInstance=new Z,Z.serialize=Z.defaultInstance.serialize.bind(Z.defaultInstance),Z.deserialize=Z.defaultInstance.deserialize.bind(Z.defaultInstance),Z.stringify=Z.defaultInstance.stringify.bind(Z.defaultInstance),Z.parse=Z.defaultInstance.parse.bind(Z.defaultInstance),Z.registerClass=Z.defaultInstance.registerClass.bind(Z.defaultInstance),Z.registerSymbol=Z.defaultInstance.registerSymbol.bind(Z.defaultInstance),Z.registerCustom=Z.defaultInstance.registerCustom.bind(Z.defaultInstance),Z.allowErrorProps=Z.defaultInstance.allowErrorProps.bind(Z.defaultInstance),Z.serialize,Z.deserialize,Z.stringify,Z.parse,Z.registerClass,Z.registerCustom,Z.registerSymbol,Z.allowErrorProps}}]);