PageSourceSearch

https://docs.datahub.io/_next/static/chunks/6577-d9967b55198ac2e4.js?dpl=dpl_BotPXnzwYu3c82m4Bq8X7dRGKpBf

js datahub.io collected 2026-09-24 08:30:09 UTC 75,401 bytes, 5 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6577],{1e3:(e,t,r)=>{r.d(t,{Ay:()=>N});class s{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 n{constructor(e){this.generateIdentifier=e,this.kv=new s}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 n{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 o(e,t){Object.entries(e).forEach(([e,r])=>t(r,e))}function a(e,t){return -1!==e.indexOf(t)}function u(e,t){for(let r=0;r<e.length;r++){let s=e[r];if(t(s))return s}}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 s=r[e];if(t(s))return s}}(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}}let c=e=>void 0===e,h=e=>"object"==typeof e&&null!==e&&e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype),d=e=>h(e)&&0===Object.keys(e).length,f=e=>Array.isArray(e),p=e=>e instanceof Map,y=e=>e instanceof Set,m=e=>"Symbol"===Object.prototype.toString.call(e).slice(8,-1),b=e=>e instanceof Error,v=e=>"number"==typeof e&&isNaN(e),g=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),w=e=>e.map(String).map(g).join("."),O=(e,t)=>{let r=[],s="";for(let n=0;n<e.length;n++){let i=e.charAt(n);if(!t&&"\\"===i){let t=e.charAt(n+1);if("\\"===t){s+="\\",n++;continue}if("."!==t)throw Error("invalid path")}if("\\"===i&&"."===e.charAt(n+1)){s+=".",n++;continue}if("."===i){r.push(s),s="";continue}s+=i}let n=s;return r.push(n),r};function C(e,t,r,s){return{isApplicable:e,annotation:t,transform:r,untransform:s}}let E=[C(c,"undefined",()=>null,()=>void 0),C(e=>"bigint"==typeof e,"bigint",e=>e.toString(),e=>"undefined"!=typeof BigInt?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),C(e=>e instanceof Date&&!isNaN(e.valueOf()),"Date",e=>e.toISOString(),e=>new Date(e)),C(b,"Error",(e,t)=>{let r={name:e.name,message:e.message};return"cause"in e&&(r.cause=e.cause),t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r},(e,t)=>{let r=Error(e.message,{cause:e.cause});return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r}),C(e=>e instanceof RegExp,"regexp",e=>""+e,e=>new RegExp(e.slice(1,e.lastIndexOf("/")),e.slice(e.lastIndexOf("/")+1))),C(y,"set",e=>[...e.values()],e=>new Set(e)),C(p,"map",e=>[...e.entries()],e=>new Map(e)),C(e=>v(e)||(e=>e===1/0||e===-1/0)(e),"number",e=>v(e)?"NaN":e>0?"Infinity":"-Infinity",Number),C(e=>0===e&&1/e==-1/0,"number",()=>"-0",Number),C(e=>e instanceof URL,"URL",e=>e.toString(),e=>new URL(e))];function R(e,t,r,s){return{isApplicable:e,annotation:t,transform:r,untransform:s}}let S=R((e,t)=>!!m(e)&&!!t.symbolRegistry.getIdentifier(e),(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{let s=r.symbolRegistry.getValue(t[1]);if(!s)throw Error("Trying to deserialize unknown symbol");return s}),Q=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),q=R(e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{let r=Q[t[1]];if(!r)throw Error("Trying to deserialize unknown typed array");return new r(e)});function P(e,t){return!!e?.constructor&&!!t.classRegistry.getIdentifier(e.constructor)}let x=R(P,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};let s={};return r.forEach(t=>{s[t]=e[t]}),s},(e,t,r)=>{let s=r.classRegistry.getValue(t[1]);
1if(!s)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(s.prototype),e)}),D=R((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{let s=r.customTransformerRegistry.findByName(t[1]);if(!s)throw Error("Trying to deserialize unknown custom value");return s.deserialize(e)}),I=[x,S,D,q],T=(e,t)=>{let r=u(I,r=>r.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};let s=u(E,r=>r.isApplicable(e,t));if(s)return{value:s.transform(e,t),type:s.annotation}},j={};E.forEach(e=>{j[e.annotation]=e});let A=(e,t)=>{if(t>e.size)throw Error("index out of bounds");let r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function M(e){if(a(e,"__proto__"))throw Error("__proto__ is not allowed as a property");if(a(e,"prototype"))throw Error("prototype is not allowed as a property");if(a(e,"constructor"))throw Error("constructor is not allowed as a property")}let k=(e,t,r)=>{if(M(t),0===t.length)return r(e);let s=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(f(s))s=s[+r];else if(h(s))s=s[r];else if(y(s))s=A(s,+r);else if(p(s)){if(e===t.length-2)break;let n=+r,i=0==+t[++e]?"key":"value",o=A(s,n);switch(i){case"key":s=o;break;case"value":s=s.get(o)}}}let n=t[t.length-1];if(f(s)?s[+n]=r(s[+n]):h(s)&&(s[n]=r(s[n])),y(s)){let e=A(s,+n),t=r(e);e!==t&&(s.delete(e),s.add(t))}if(p(s)){let e=A(s,+t[t.length-2]);switch(0==+n?"key":"value"){case"key":{let t=r(e);s.set(t,s.get(e)),t!==e&&s.delete(e);break}case"value":s.set(e,r(s.get(e)))}}return e},F=(e,t,r,s,n=[],i=[],u=new Map)=>{let l=(e=>"boolean"==typeof e||null===e||c(e)||(e=>"number"==typeof e&&!isNaN(e))(e)||"string"==typeof e||m(e))(e);if(!l){!function(e,t,r){let s=r.get(e);s?s.push(t):r.set(e,[t])}(e,n,t);let r=u.get(e);if(r)return s?{transformedValue:null}:r}if(!((e,t)=>h(e)||f(e)||p(e)||y(e)||b(e)||P(e,t))(e,r)){let t=T(e,r),s=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return l||u.set(e,s),s}if(a(i,e))return{transformedValue:null};let v=T(e,r),w=v?.value??e,O=f(w)?[]:{},C={};o(w,(a,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=F(a,t,r,s,[...n,l],[...i,e],u);O[l]=c.transformedValue,f(c.annotations)?C[g(l)]=c.annotations:h(c.annotations)&&o(c.annotations,(e,t)=>{C[g(l)+"."+t]=e})});let E=d(C)?{transformedValue:O,annotations:v?[v.type]:void 0}:{transformedValue:O,annotations:v?[v.type,C]:C};return l||u.set(e,E),E};function U(e){return Object.prototype.toString.call(e).slice(8,-1)}function K(e){return"Array"===U(e)}class _{constructor({dedupe:e=!1}={}){this.classRegistry=new i,this.symbolRegistry=new n(e=>e.description??""),this.customTransformerRegistry=new l,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,r=F(e,t,this,this.dedupe),s={json:r.transformedValue};r.annotations&&(s.meta={...s.meta,values:r.annotations});let n=function(e,t){let r,s={};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[n,...i]=e;0===n.length?r=i.map(w):s[w(n)]=i.map(w)}),r)?d(s)?[r]:[r,s]:d(s)?void 0:s}(t,this.dedupe);return n&&(s.meta={...s.meta,referentialEqualities:n}),s.meta&&(s.meta.v=1),s}deserialize(e,t){var r,s,n,i;let{json:a,meta:u}=e,l=t?.inPlace?a:function e(t,r={}){return K(t)?t.map(t=>e(t,r)):!function(e){if("Object"!==U(e))return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}(t)?t:[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)].reduce((s,n)=>{if("__proto__"===n||K(r.props)&&!r.props.includes(n))return s;let i=e(t[n],r);var o=r.nonenumerable;let a=({}).propertyIsEnumerable.call(t,n)?"enumerable":"nonenumerable";return"enumerable"===a&&(s[n]=i),o&&"nonenumerable"===a&&Object.defineProperty(s,n,{value:i,enumerable:!1,writable:!0,configurable:!0}),s},{})}(a);return u?.values&&(r=l,s=u.values,n=u.v??0,i=this,function e(t,r,s,n=[]){if(!t)return;let i=s<1;if(!f(t))return void o(t,(t,o)=>e(t,r,s,[...n,...O(o,i)]));let[a,u]=t;u&&o(u,(t,o)=>{e(t,r,s,[...n,...O(o,i)])}),r(a,n)}(s,(e,t)=>{r=k(r,t,t=>((e,t,r)=>{if(f(t))switch(t[0]){case"symbol":return S.untransform(e,t,r);case"class":return x.untransform(e,t,r);
1case"custom":return D.untransform(e,t,r);case"typed-array":return q.untransform(e,t,r);default:throw Error("Unknown transformation: "+t)}{let s=j[t];if(!s)throw Error("Unknown transformation: "+t);return s.untransform(e,r)}})(t,e,i))},n),l=r),u?.referentialEqualities&&(l=function(e,t,r){let s=r<1;function n(t,r){let n=((e,t)=>{M(t);for(let r=0;r<t.length;r++){let s=t[r];if(y(e))e=A(e,+s);else if(p(e)){let n=+s,i=0==+t[++r]?"key":"value",o=A(e,n);switch(i){case"key":e=o;break;case"value":e=e.get(o)}}else e=e[s]}return e})(e,O(r,s));t.map(e=>O(e,s)).forEach(t=>{e=k(e,t,()=>n)})}if(f(t)){let[r,i]=t;r.forEach(t=>{e=k(e,O(t,s),()=>e)}),i&&o(i,n)}else o(t,n);return e}(l,u.referentialEqualities,u.v??0)),l}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}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)}}_.defaultInstance=new _,_.serialize=_.defaultInstance.serialize.bind(_.defaultInstance),_.deserialize=_.defaultInstance.deserialize.bind(_.defaultInstance),_.stringify=_.defaultInstance.stringify.bind(_.defaultInstance),_.parse=_.defaultInstance.parse.bind(_.defaultInstance),_.registerClass=_.defaultInstance.registerClass.bind(_.defaultInstance),_.registerSymbol=_.defaultInstance.registerSymbol.bind(_.defaultInstance),_.registerCustom=_.defaultInstance.registerCustom.bind(_.defaultInstance),_.allowErrorProps=_.defaultInstance.allowErrorProps.bind(_.defaultInstance);let N=_;_.serialize,_.deserialize,_.stringify,_.parse,_.registerClass,_.registerCustom,_.registerSymbol,_.allowErrorProps},8711:(e,t,r)=>{r.d(t,{II:()=>c,v_:()=>a,wm:()=>l});var s=r(36731),n=r(52014),i=r(68387);function o(e){return Math.min(1e3*2**e,3e4)}function a(e){return(null!=e?e:"online")!=="online"||n.t.isOnline()}class u{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}function l(e){return e instanceof u}function c(e){let t,r,l,c=!1,h=0,d=!1,f=new Promise((e,t)=>{r=e,l=t}),p=()=>!s.m.isFocused()||"always"!==e.networkMode&&!n.t.isOnline(),y=s=>{d||(d=!0,null==e.onSuccess||e.onSuccess(s),null==t||t(),r(s))},m=r=>{d||(d=!0,null==e.onError||e.onError(r),null==t||t(),l(r))},b=()=>new Promise(r=>{t=e=>{let t=d||!p();return t&&r(e),t},null==e.onPause||e.onPause()}).then(()=>{t=void 0,d||null==e.onContinue||e.onContinue()}),v=()=>{let t;if(!d){try{t=e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(y).catch(t=>{var r,s;if(d)return;let n=null!=(r=e.retry)?r:3,a=null!=(s=e.retryDelay)?s:o,u="function"==typeof a?a(h,t):a,l=!0===n||"number"==typeof n&&h<n||"function"==typeof n&&n(h,t);if(c||!l)return void m(t);h++,null==e.onFail||e.onFail(h,t),(0,i.yy)(u).then(()=>{if(p())return b()}).then(()=>{c?m(t):v()})})}};return a(e.networkMode)?v():b().then(v),{promise:f,cancel:t=>{d||(m(new u(t)),null==e.abort||e.abort())},continue:()=>(null==t?void 0:t())?f:Promise.resolve(),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1}}}},15565:(e,t,r)=>{r.d(t,{Q:()=>s});class s{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){let t={listener:e};return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},20326:(e,t,r)=>{r.d(t,{pY:()=>z});var s=r(57895),n=r(36098);function i(e,t){let[r,s]=Array.isArray(e)?e:[e],n="string"!=typeof r||""===r?[]:r.split(".");return s||t&&"any"!==t?[n,{...void 0!==s&&{input:s},...t&&"any"!==t&&{type:t}}]:n.length?[n]:[]}var o=r(68387),a=r(98992),u=r(36731),l=r(15565),c=r(8711);class h extends l.Q{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),d(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){let r=this.options,s=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),(0,o.f8)(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let n=this.hasListeners();n&&p(this.currentQuery,s,this.options,r)&&this.executeFetch(),this.updateResult(t),n&&(this.currentQuery!==s||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let i=this.computeRefetchInterval();n&&(this.currentQuery!==s||this.options.enabled!==r.enabled||i!==this.currentRefetchInterval)&&this.updateRefetchInterval(i)}getOptimisticResult(e){var t,r,s;let n=this.client.getQueryCache().build(this.client,e),i=this.createResult(n,e);return t=this,r=i,(s=e).keepPreviousData||(void 0!==s.placeholderData?!r.isPlaceholderData:(0,o.f8)(t.getCurrentResult(),r))||(this.currentResult=i,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),i}getCurrentResult(){return this.currentResult}trackResult(e){let t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){let t=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(o.lQ)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),o.S$||this.currentResult.isStale||!(0,o.gn)(this.options.staleTime))return;let e=(0,o.j3)(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},e+1)}computeRefetchInterval(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!o.S$&&!1!==this.options.enabled&&(0,o.gn)(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>
1{(this.options.refetchIntervalInBackground||u.m.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){let r,s=this.currentQuery,n=this.options,i=this.currentResult,a=this.currentResultState,u=this.currentResultOptions,l=e!==s,h=l?e.state:this.currentQueryInitialState,f=l?this.currentResult:this.previousQueryResult,{state:m}=e,{dataUpdatedAt:b,error:v,errorUpdatedAt:g,fetchStatus:w,status:O}=m,C=!1,E=!1;if(t._optimisticResults){let r=this.hasListeners(),i=!r&&d(e,t),o=r&&p(e,s,t,n);(i||o)&&(w=(0,c.v_)(e.options.networkMode)?"fetching":"paused",b||(O="loading")),"isRestoring"===t._optimisticResults&&(w="idle")}if(t.keepPreviousData&&!m.dataUpdatedAt&&null!=f&&f.isSuccess&&"error"!==O)r=f.data,b=f.dataUpdatedAt,O=f.status,C=!0;else if(t.select&&void 0!==m.data)if(i&&m.data===(null==a?void 0:a.data)&&t.select===this.selectFn)r=this.selectResult;else try{this.selectFn=t.select,r=t.select(m.data),r=(0,o.pl)(null==i?void 0:i.data,r,t),this.selectResult=r,this.selectError=null}catch(e){this.selectError=e}else r=m.data;if(void 0!==t.placeholderData&&void 0===r&&"loading"===O){let e;if(null!=i&&i.isPlaceholderData&&t.placeholderData===(null==u?void 0:u.placeholderData))e=i.data;else if(e="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.selectError=null}catch(e){this.selectError=e}void 0!==e&&(O="success",r=(0,o.pl)(null==i?void 0:i.data,e,t),E=!0)}this.selectError&&(v=this.selectError,r=this.selectResult,g=Date.now(),O="error");let R="fetching"===w,S="loading"===O,Q="error"===O;return{status:O,fetchStatus:w,isLoading:S,isSuccess:"success"===O,isError:Q,isInitialLoading:S&&R,data:r,dataUpdatedAt:b,error:v,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:R,isRefetching:R&&!S,isLoadingError:Q&&0===m.dataUpdatedAt,isPaused:"paused"===w,isPlaceholderData:E,isPreviousData:C,isRefetchError:Q&&0!==m.dataUpdatedAt,isStale:y(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){let t=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,(0,o.f8)(r,t))return;this.currentResult=r;let s={cache:!0},n=()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.trackedProps.size)return!0;let s=new Set(null!=r?r:this.trackedProps);return this.options.useErrorBoundary&&s.add("error"),Object.keys(this.currentResult).some(e=>this.currentResult[e]!==t[e]&&s.has(e))};(null==e?void 0:e.listeners)!==!1&&n()&&(s.listeners=!0),this.notify({...s,...e})}updateQuery(){let e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;let t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){let t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||(0,c.wm)(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){a.j.batch(()=>{var t,r,s,n,i,o,a,u;e.onSuccess?(null==(t=(r=this.options).onSuccess)||t.call(r,this.currentResult.data),null==(s=(n=this.options).onSettled)||s.call(n,this.currentResult.data,null)):e.onError&&(null==(i=(o=this.options).onError)||i.call(o,this.currentResult.error),null==(a=(u=this.options).onSettled)||a.call(u,void 0,this.currentResult.error)),e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function d(e,t){return!1!==t.enabled&&!e.state.dataUpdatedAt&&("error"!==e.state.status||!1!==t.retryOn
1Mount)||e.state.dataUpdatedAt>0&&f(e,t,t.refetchOnMount)}function f(e,t,r){if(!1!==t.enabled){let s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&y(e,t)}return!1}function p(e,t,r,s){return!1!==r.enabled&&(e!==t||!1===s.enabled)&&(!r.suspense||"error"!==e.state.status)&&y(e,r)}function y(e,t){return e.isStaleByTime(t.staleTime)}var m=r(71527);let b=r(68320).useSyncExternalStore,v=m.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),g=()=>m.useContext(v);var w=r(75365);let O=m.createContext(!1),C=()=>m.useContext(O);function E(e,t){return"function"==typeof e?e(...t):!!e}O.Provider;let R=(e,t)=>{(e.suspense||e.useErrorBoundary)&&!t.isReset()&&(e.retryOnMount=!1)},S=e=>{m.useEffect(()=>{e.clearReset()},[e])},Q=e=>{let{result:t,errorResetBoundary:r,useErrorBoundary:s,query:n}=e;return t.isError&&!r.isReset()&&!t.isFetching&&E(s,[t.error,n])},q=e=>{e.suspense&&("number"!=typeof e.staleTime&&(e.staleTime=1e3),"number"==typeof e.cacheTime&&(e.cacheTime=Math.max(e.cacheTime,1e3)))},P=(e,t)=>e.isLoading&&e.isFetching&&!t,x=(e,t,r)=>(null==e?void 0:e.suspense)&&P(t,r),D=(e,t,r)=>t.fetchOptimistic(e).then(({data:t})=>{null==e.onSuccess||e.onSuccess(t),null==e.onSettled||e.onSettled(t,null)}).catch(t=>{r.clearReset(),null==e.onError||e.onError(t),null==e.onSettled||e.onSettled(void 0,t)});function I(e,t){let r=(0,w.jE)({context:e.context}),s=C(),n=g(),i=r.defaultQueryOptions(e);i._optimisticResults=s?"isRestoring":"optimistic",i.onError&&(i.onError=a.j.batchCalls(i.onError)),i.onSuccess&&(i.onSuccess=a.j.batchCalls(i.onSuccess)),i.onSettled&&(i.onSettled=a.j.batchCalls(i.onSettled)),q(i),R(i,n),S(n);let[o]=m.useState(()=>new t(r,i)),u=o.getOptimisticResult(i);if(b(m.useCallback(e=>{let t=s?()=>void 0:o.subscribe(a.j.batchCalls(e));return o.updateResult(),t},[o,s]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),m.useEffect(()=>{o.setOptions(i,{listeners:!1})},[i,o]),x(i,u,s))throw D(i,o,n);if(Q({result:u,errorResetBoundary:n,useErrorBoundary:i.useErrorBoundary,query:o.getCurrentQuery()}))throw u.error;return i.notifyOnChangeProps?u:o.trackResult(u)}var T=r(70255);
1class j extends l.Q{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let r=this.options;this.options=this.client.defaultMutationOptions(e),(0,o.f8)(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:(0,T.$)(),t="loading"===e.status,r={...e,isLoading:t,isPending:t,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){a.j.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,r,s,n,i,o,a,u;e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(s=(n=this.mutateOptions).onSettled)||s.call(n,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(i=(o=this.mutateOptions).onError)||i.call(o,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(u=this.mutateOptions).onSettled)||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}function A(){}var M=r(45890);class k extends h{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,M.PL)()},t)}getOptimisticResult(e){return e.behavior=(0,M.PL)(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,t){var r,s,n,i,o,a;let{state:u}=e,l=super.createResult(e,t),{isFetching:c,isRefetching:h}=l,d=c&&(null==(r=u.fetchMeta)||null==(s=r.fetchMore)?void 0:s.direction)==="forward",f=c&&(null==(n=u.fetchMeta)||null==(i=n.fetchMore)?void 0:i.direction)==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,M.rB)(t,null==(o=u.data)?void 0:o.pages),hasPreviousPage:(0,M.RQ)(t,null==(a=u.data)?void 0:a.pages),isFetchingNextPage:d,isFetchingPreviousPage:f,isRefetching:h&&!d&&!f}}}class F extends l.Q{constructor(e,t){super(),this.client=e,this.queries=[],this.result=[],this.observers=[],this.observersMap={},t&&this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.observers.forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.observers.forEach(e=>{e.destroy()})}setQueries(e,t){this.queries=e,a.j.batch(()=>{let e=this.observers,r=this.findMatchingObservers(this.queries);r.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions,t));let s=r.map(e=>e.observer),n=Object.fromEntries(s.map(e=>[e.options.queryHash,e])),i=s.map(e=>e.getCurrentResult()),a=s.some((t,r)=>t!==e[r]);(e.length!==s.length||a)&&(this.observers=s,this.observersMap=n,this.result=i,this.hasListeners()&&((0,o.iv)(e,s).forEac
1h(e=>{e.destroy()}),(0,o.iv)(s,e).forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})}),this.notify()))})}getCurrentResult(){return this.result}getQueries(){return this.observers.map(e=>e.getCurrentQuery())}getObservers(){return this.observers}getOptimisticResult(e){return this.findMatchingObservers(e).map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions))}findMatchingObservers(e){let t=this.observers,r=new Map(t.map(e=>[e.options.queryHash,e])),s=e.map(e=>this.client.defaultQueryOptions(e)),n=s.flatMap(e=>{let t=r.get(e.queryHash);return null!=t?[{defaultedQueryOptions:e,observer:t}]:[]}),i=new Set(n.map(e=>e.defaultedQueryOptions.queryHash)),o=s.filter(e=>!i.has(e.queryHash)),a=new Set(n.map(e=>e.observer)),u=t.filter(e=>!a.has(e)),l=e=>{let t=this.client.defaultQueryOptions(e),r=this.observersMap[t.queryHash];return null!=r?r:new h(this.client,t)},c=o.map((e,t)=>{if(e.keepPreviousData){let r=u[t];if(void 0!==r)return{defaultedQueryOptions:e,observer:r}}return{defaultedQueryOptions:e,observer:l(e)}});return n.concat(c).sort((e,t)=>s.indexOf(e.defaultedQueryOptions)-s.indexOf(t.defaultedQueryOptions))}onUpdate(e,t){let r=this.observers.indexOf(e);-1!==r&&(this.result=(0,o._D)(this.result,r,t),this.notify())}notify(){a.j.batch(()=>{this.listeners.forEach(({listener:e})=>{e(this.result)})})}}function U(e,t){return e.length?void 0===t?[e]:[e,t]:[]}let K=["client","ssrContext","ssrState","abortOnUnmount"],_=(0,m.createContext)(null);function N(e,t){let[r,s]=e;return[r,s,t?.trpc]}function L(e){let{path:t}=e;return(0,m.useMemo)(()=>({path:t}),[t])}function z(e){var t;return t=function(e){let t=(e?.overrides??e?.unstable_overrides)?.useMutation?.onSuccess??(e=>e.originalFn()),r=e?.context??_,u=e?.reactQueryContext;function l(){return m.useContext(r)}function c(e,t,r){let{queryClient:s,ssrState:n}=l();return n&&"mounted"!==n&&s.getQueryCache().find(i(e,t))?.state.status==="error"?{retryOnMount:!1,...r}:r}return{Provider:e=>{let{abortOnUnmount:t=!1,client:s,queryClient:n,ssrContext:o}=e,[a,u]=(0,m.useState)(e.ssrState??!1);return(0,m.useEffect)(()=>{u(e=>!!e&&"mounted")},[]),m.createElement(r.Provider,{value:{abortOnUnmount:t,queryClient:n,client:s,ssrContext:o??null,ssrState:a,fetchQuery:(0,m.useCallback)((e,t)=>n.fetchQuery({...t,queryKey:i(e,"query"),queryFn:()=>s.query(...N(e,t))}),[s,n]),fetchInfiniteQuery:(0,m.useCallback)((e,t)=>n.fetchInfiniteQuery({...t,queryKey:i(e,"infinite"),queryFn:({pageParam:r})=>{let[n,i]=e,o={...i,cursor:r};return s.query(...N([n,o],t))}}),[s,n]),prefetchQuery:(0,m.useCallback)((e,t)=>n.prefetchQuery({...t,queryKey:i(e,"query"),queryFn:()=>s.query(...N(e,t))}),[s,n]),prefetchInfiniteQuery:(0,m.useCallback)((e,t)=>n.prefetchInfiniteQuery({...t,queryKey:i(e,"infinite"),queryFn:({pageParam:r})=>{let[n,i]=e,o={...i,cursor:r};return s.query(...N([n,o],t))}}),[s,n]),ensureQueryData:(0,m.useCallback)((e,t)=>n.ensureQueryData({...t,queryKey:i(e,"query"),queryFn:()=>s.query(...N(e,t))}),[s,n]),invalidateQueries:(0,m.useCallback)((e,t,r)=>n.invalidateQueries({...t,queryKey:i(e,"any")},r),[n]),resetQueries:(0,m.useCallback)((...e)=>{let[t,r,s]=e;return n.resetQueries({...r,queryKey:i(t,"any")},s)},[n]),refetchQueries:(0,m.useCallback)((...e)=>{let[t,r,s]=e;return n.refetchQueries({...r,queryKey:i(t,"any")},s)},[n]),cancelQuery:(0,m.useCallback)(e=>n.cancelQueries({queryKey:i(e,"any")}),[n]),setQueryData:(0,m.useCallback)((...e)=>{let[t,...r]=e;return n.setQueryData(i(t,"query"),...r)},[n]),getQueryData:(0,m.useCallback)((...e)=>{let[t,...r]=e;return n.getQueryData(i(t,"query"),...r)},[n]),setInfiniteQueryData:(0,m.useCallback)((...e)=>{let[t,...r]=e;return n.setQueryData(i(t,"infinite"),...r)},[n]),getInfiniteQueryData:(0,m.useCallback)((...e)=>{let[t,...r]=e;return n.getQueryData(i(t,"infinite"),...r)},[n])}},e.children)},createClient:e=>(0,s.XT)(e),useContext:l,useUtils:l,useQuery:function(t,r){var s;let n=l();if(!n)throw Error("Unable to retrieve application context. Did you forget to wrap your App inside `withTRPC` HoC?");let{abortOnUnmount:a,client:d,ssrState:f,queryClient:p,prefetchQuery:y}=n,m=p.getQueryDefaults(i(t,"query"));"undefined"!=typeof window||"prepass"!==f||r?.trpc?.ssr===!1||(r?.enabled??m?.enabled)===!1||p.getQueryCache().find(i(t,"query"))||y(t,r);let b=c(t,"query",{...m,...r}),v=r?.trpc?.abortOnUnmount??e?.abortOnUnmount??a,g=(s={...b,queryKey:i(t,"query"),queryFn:e=>{let r={...b,trpc:{...b?.trpc,...v?{signal:e.signal}:{}}};return d.query(...N(t,r))},context:u},I((0,o.vh)(s,void 0,void 0),h));return g.trpc=L({path:t[0]}),g},useQueries:(e,t)=>{let{ssrState:r,queryClient:s,prefetchQuery:o,client:u}
1=l(),c=e((0,n.vX)(e=>{let t=e.path.join("."),[r,s]=e.args;return{queryKey:U(t,r),queryFn:()=>u.query(t,r,s?.trpc),...s}}));if("undefined"==typeof window&&"prepass"===r)for(let e of c)e.trpc?.ssr===!1||s.getQueryCache().find(i(e.queryKey,"query"))||o(e.queryKey,e);return function(e){let{queries:t,context:r}=e,s=(0,w.jE)({context:r}),n=C(),i=g(),o=m.useMemo(()=>t.map(e=>{let t=s.defaultQueryOptions(e);return t._optimisticResults=n?"isRestoring":"optimistic",t}),[t,s,n]);o.forEach(e=>{q(e),R(e,i)}),S(i);let[u]=m.useState(()=>new F(s,o)),l=u.getOptimisticResult(o);b(m.useCallback(e=>n?()=>void 0:u.subscribe(a.j.batchCalls(e)),[u,n]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),m.useEffect(()=>{u.setQueries(o,{listeners:!1})},[o,u]);let c=l.some((e,t)=>x(o[t],e,n))?l.flatMap((e,t)=>{let r=o[t],s=u.getObservers()[t];if(r&&s)if(x(r,e,n))return D(r,s,i);else P(e,n)&&D(r,s,i);return[]}):[];if(c.length>0)throw Promise.all(c);let h=u.getQueries(),d=l.find((e,t)=>{var r,s;return Q({result:e,errorResetBoundary:i,useErrorBoundary:null!=(r=null==(s=o[t])?void 0:s.useErrorBoundary)&&r,query:h[t]})});if(null!=d&&d.error)throw d.error;return l}({queries:c.map(e=>({...e,queryKey:i(e.queryKey,"query")})),context:t})},useMutation:function(e,r){let{client:s}=l(),n=(0,w.jE)({context:u}),i=Array.isArray(e)?e[0]:e,c=n.getMutationDefaults([i.split(".")]),h=function(e,t,r){let s=(0,o.GR)(e,void 0,void 0),n=(0,w.jE)({context:s.context}),[i]=m.useState(()=>new j(n,s));m.useEffect(()=>{i.setOptions(s)},[i,s]);let u=b(m.useCallback(e=>i.subscribe(a.j.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=m.useCallback((e,t)=>{i.mutate(e,t).catch(A)},[i]);if(u.error&&E(i.options.useErrorBoundary,[u.error]))throw u.error;return{...u,mutate:l,mutateAsync:u.mutate}}({...r,mutationKey:[i.split(".")],mutationFn:e=>s.mutation(...N([i,e],r)),context:u,onSuccess:(...e)=>t({originalFn:()=>r?.onSuccess?.(...e)??c?.onSuccess?.(...e),queryClient:n,meta:r?.meta??c?.meta??{}})});return h.trpc=L({path:i}),h},useSubscription:function(e,t){let r=t?.enabled??!0,s=(0,o.Od)(e),{client:n}=l(),i=(0,m.useRef)(t);i.current=t,(0,m.useEffect)(()=>{if(!r)return;let[t,s]=e,o=!1,a=n.subscription(t,s??void 0,{onStarted:()=>{o||i.current.onStarted?.()},onData:e=>{o||i.current.onData(e)},onError:e=>{o||i.current.onError?.(e)}});return()=>{o=!0,a.unsubscribe()}},[s,r])},useDehydratedState:(e,t)=>(0,m.useMemo)(()=>t?e.runtime.transformer.deserialize(t):t,[t,e]),useInfiniteQuery:function(e,t){var r;let[s,n]=e,{client:a,ssrState:h,prefetchInfiniteQuery:d,queryClient:f,abortOnUnmount:p}=l(),y=f.getQueryDefaults(i(e,"infinite"));"undefined"!=typeof window||"prepass"!==h||t?.trpc?.ssr===!1||(t?.enabled??y?.enabled)===!1||f.getQueryCache().find(i(e,"infinite"))||d(e,{...y,...t});let m=c(e,"infinite",{...y,...t}),b=t?.trpc?.abortOnUnmount??p,v=(r={...m,queryKey:i(e,"infinite"),queryFn:e=>{let r={...m,trpc:{...m?.trpc,...b?{signal:e.signal}:{}}},i={...n??{},cursor:e.pageParam??t?.initialCursor};return a.query(...N([s,i],r))},context:u},I((0,o.vh)(r,void 0,void 0),k));return v.trpc=L({path:s}),v}}}(e),(0,n.U6)(e=>"useContext"===e||"useUtils"===e?()=>{let e=t.useUtils();return(0,m.useMemo)(()=>(0,n.U6)(t=>"client"===t?(0,s.Xq)(e.client):K.includes(t)?e[t]:(0,n.vX)(({path:r,args:s})=>{let n=[t,...r],i=n.pop(),o=n.join("."),{queryKey:a,rest:u,updater:l}=(e=>{if(["setData","setInfiniteData"].includes(e)){let[e,t,...r]=s;return{queryKey:U(o,e),updater:t,rest:r}}let[t,...r]=s;return{queryKey:U(o,t),rest:r}})(i);return({fetch:()=>e.fetchQuery(a,...u),fetchInfinite:()=>e.fetchInfiniteQuery(a,...u),prefetch:()=>e.prefetchQuery(a,...u),prefetchInfinite:()=>e.prefetchInfiniteQuery(a,...u),ensureData:()=>e.ensureQueryData(a,...u),invalidate:()=>e.invalidateQueries(a,...u),reset:()=>e.resetQueries(a,...u),refetch:()=>e.refetchQueries(a,...u),cancel:()=>e.cancelQuery(a,...u),setData:()=>{e.setQueryData(a,l,...u)},setInfiniteData:()=>{e.setInfiniteQueryData(a,l,...u)},getData:()=>e.getQueryData(a),getInfiniteData:()=>e.getInfiniteQueryData(a)})[i]()})),[e])}:t.hasOwnProperty(e)?t[e]:(0,n.vX)(r=>{let s=r.args,n=[e,...r.path],o=n.pop(),a=n.join(".");if("useMutation"===o)return t[o](a,...s);let[u,...l]=s,c=U(a,u);if("getQueryKey"===o)return i(c,l[0]??"any");
1if("_def"===o)return{path:n};if(o.startsWith("useSuspense")){let e=l[0]||{},r=t["useSuspenseQuery"===o?"useQuery":"useInfiniteQuery"](c,{...e,suspense:!0,enabled:!0});return[r.data,r]}return t[o](c,...l)}))}},20769:(e,t,r)=>{r.d(t,{E:()=>m});var s=r(68387),n=r(98646),i=r(98992),o=r(8711),a=r(82559);class u extends a.k{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||n.U,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?null!=s?s:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){let r=(0,s.pl)(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;let r=this.promise;return null==(t=this.retryer)||t.cancel(e),r?r.then(s.lQ).catch(s.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,s.j3)(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.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.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,n,i,a;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let u=(0,s.jY)(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(u)return this.abortSignalConsumed=!0,u.signal}})};c(l);let h=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),d={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:h};c(d),null==(r=this.options.behavior)||r.onFetch(d),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=d.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(a=d.fetchOptions)?void 0:a.meta});let f=e=>{if((0,o.wm)(e)&&e.silent||this.dispatch({type:"error",error:e}),!(0,o.wm)(e)){var t,r,s,n;null==(t=(r=this.cache.config).onError)||t.call(r,e,this),null==(s=(n=this.cache.config).onSettled)||s.call(n,this.state.data,e,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,o.II)({fn:d.fetchFn,abort:null==u?void 0:u.abort.bind(u),onSuccess:e=>{var t,r,s,n;if(void 0===e)return void f(Error(this.queryHash+" data is undefined"));this.setData(e),null==(t=(r=this.cache.config).onSuccess)||t.call(r,e,this),null==(s=(n=this.cache.config).onSettled)||s.call(n,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){let t=t=>{var r,s;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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(r=e.meta)?r:null,fetchStatus:(0,o.v_)(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(s=e.dataUpdatedAt)?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;if((0,o.wm)(n)&&n.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};
1return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),i.j.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}var l=r(15565);class c extends l.Q{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var n;let i=t.queryKey,o=null!=(n=t.queryHash)?n:(0,s.F$)(i,t),a=this.get(o);return a||(a=new u({cache:this,logger:e.getLogger(),queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){let t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(t=>t!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){i.j.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){let[r]=(0,s.b_)(e,t);return void 0===r.exact&&(r.exact=!0),this.queries.find(e=>(0,s.MK)(r,e))}findAll(e,t){let[r]=(0,s.b_)(e,t);return Object.keys(r).length>0?this.queries.filter(e=>(0,s.MK)(r,e)):this.queries}notify(e){i.j.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}onFocus(){i.j.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){i.j.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}var h=r(70255);class d extends l.Q{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){let s=new h.s({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(s),s}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){i.j.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find(t=>(0,s.nJ)(e,t))}findAll(e){return this.mutations.filter(t=>(0,s.nJ)(e,t))}notify(e){i.j.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then(()=>{let e=this.mutations.filter(e=>
1e.state.isPaused);return i.j.batch(()=>e.reduce((e,t)=>e.then(()=>t.continue().catch(s.lQ)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}var f=r(36731),p=r(52014),y=r(45890);class m{constructor(e={}){this.queryCache=e.queryCache||new c,this.mutationCache=e.mutationCache||new d,this.logger=e.logger||n.U,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=f.m.subscribe(()=>{f.m.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=p.t.subscribe(()=>{p.t.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){let[r]=(0,s.b_)(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}ensureQueryData(e,t,r){let n=(0,s.vh)(e,t,r),i=this.getQueryData(n.queryKey);return i?Promise.resolve(i):this.fetchQuery(n)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.queryCache.find(e),i=null==n?void 0:n.state.data,o=(0,s.Zw)(t,i);if(void 0===o)return;let a=(0,s.vh)(e),u=this.defaultQueryOptions(a);return this.queryCache.build(this,u).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return i.j.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}removeQueries(e,t){let[r]=(0,s.b_)(e,t),n=this.queryCache;i.j.batch(()=>{n.findAll(r).forEach(e=>{n.remove(e)})})}resetQueries(e,t,r){let[n,o]=(0,s.b_)(e,t,r),a=this.queryCache,u={type:"active",...n};return i.j.batch(()=>(a.findAll(n).forEach(e=>{e.reset()}),this.refetchQueries(u,o)))}cancelQueries(e,t,r){let[n,o={}]=(0,s.b_)(e,t,r);return void 0===o.revert&&(o.revert=!0),Promise.all(i.j.batch(()=>this.queryCache.findAll(n).map(e=>e.cancel(o)))).then(s.lQ).catch(s.lQ)}invalidateQueries(e,t,r){let[n,o]=(0,s.b_)(e,t,r);return i.j.batch(()=>{var e,t;if(this.queryCache.findAll(n).forEach(e=>{e.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(e=null!=(t=n.refetchType)?t:n.type)?e:"active"};return this.refetchQueries(r,o)})}refetchQueries(e,t,r){let[n,o]=(0,s.b_)(e,t,r),a=Promise.all(i.j.batch(()=>this.queryCache.findAll(n).filter(e=>!e.isDisabled()).map(e=>{var t;return e.fetch(void 0,{...o,cancelRefetch:null==(t=null==o?void 0:o.cancelRefetch)||t,meta:{refetchPage:n.refetchPage}})}))).then(s.lQ);return null!=o&&o.throwOnError||(a=a.catch(s.lQ)),a}fetchQuery(e,t,r){let n=(0,s.vh)(e,t,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then(s.lQ).catch(s.lQ)}fetchInfiniteQuery(e,t,r){let n=(0,s.vh)(e,t,r);return n.behavior=(0,y.PL)(),this.fetchQuery(n)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(s.lQ).catch(s.lQ)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){let r=this.queryDefaults.find(t=>(0,s.Od)(e)===(0,s.Od)(t.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;let t=this.queryDefaults.find(t=>(0,s.Cp)(e,t.queryKey));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){let r=this.mutationDefaults.find(t=>(0,s.Od)(e)===(0,s.Od)(t.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;let t=this.mutationDefaults.find(t=>(0,s.Cp)(e,t.mutationKey));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;let t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=(0,s.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}},36098:(e,t,r)=>{function s(e){let t=Object.create(null);for(let r in e)t[e[r]]=r;return t}r.d(t,{U6:()=>a,vX:()=>o,e2:()=>l});let n={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,
1NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};s(n),s(n);let i=()=>{},o=e=>(function e(t,r){return new Proxy(i,{get(s,n){if("string"==typeof n&&"then"!==n)return e(t,[...r,n])},apply(e,s,n){let i="apply"===r[r.length-1];return t({args:i?n.length>=2?n[1]:[]:n,path:i?r.slice(0,-1):r})}})})(e,[]),a=e=>new Proxy(i,{get(t,r){if("string"==typeof r&&"then"!==r)return e(r)}});class u extends Error{}function l(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(e&&!Array.isArray(e)&&"object"==typeof e){let t=new u;for(let r in e)t[r]=e[r];return t}}}},36731:(e,t,r)=>{r.d(t,{m:()=>o});var s=r(15565),n=r(68387);class i extends s.Q{constructor(){super(),this.setup=e=>{if(!n.S$&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}}let o=new i},45890:(e,t,r)=>{function s(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,s,o,a,u;let l,c=null==(t=e.fetchOptions)||null==(r=t.meta)?void 0:r.refetchPage,h=null==(s=e.fetchOptions)||null==(o=s.meta)?void 0:o.fetchMore,d=null==h?void 0:h.pageParam,f=(null==h?void 0:h.direction)==="forward",p=(null==h?void 0:h.direction)==="backward",y=(null==(a=e.state.data)?void 0:a.pages)||[],m=(null==(u=e.state.data)?void 0:u.pageParams)||[],b=m,v=!1,g=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),w=(e,t,r,s)=>(b=s?[t,...b]:[...b,t],s?[r,...e]:[...e,r]),O=(t,r,s,n)=>{if(v)return Promise.reject("Cancelled");if(void 0===s&&!r&&t.length)return Promise.resolve(t);let i={queryKey:e.queryKey,pageParam:s,meta:e.options.meta};return Object.defineProperty(i,"signal",{enumerable:!0,get:()=>{var t,r;return null!=(t=e.signal)&&t.aborted?v=!0:null==(r=e.signal)||r.addEventListener("abort",()=>{v=!0}),e.signal}}),Promise.resolve(g(i)).then(e=>w(t,s,e,n))};if(y.length)if(f){let t=void 0!==d,r=t?d:n(e.options,y);l=O(y,t,r)}else if(p){let t=void 0!==d,r=t?d:i(e.options,y);l=O(y,t,r,!0)}else{b=[];let t=void 0===e.options.getNextPageParam;l=!c||!y[0]||c(y[0],0,y)?O([],t,m[0]):Promise.resolve(w([],m[0],y[0]));for(let r=1;r<y.length;r++)l=l.then(s=>{if(!c||!y[r]||c(y[r],r,y)){let i=t?m[r]:n(e.options,s);return O(s,t,i)}return Promise.resolve(w(s,m[r],y[r]))})}else l=O([]);return l.then(e=>({pages:e,pageParams:b}))}}}}function n(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}function i(e,t){return null==e.getPreviousPageParam?void 0:e.getPreviousPageParam(t[0],t)}function o(e,t){if(e.getNextPageParam&&Array.isArray(t)){let r=n(e,t);return null!=r&&!1!==r}}function a(e,t){if(e.getPreviousPageParam&&Array.isArray(t)){let r=i(e,t);return null!=r&&!1!==r}}r.d(t,{PL:()=>s,RQ:()=>a,rB:()=>o})},52014:(e,t,r)=>{r.d(t,{t:()=>a});var s=r(15565),n=r(68387);let i=["online","offline"];class o extends s.Q{constructor(){super(),this.setup=e=>{if(!n.S$&&window.addEventListener){let t=()=>e();return i.forEach(e=>{window.addEventListener(e,t,!1)}),()=>{i.forEach(e=>{window.removeEventListener(e,t)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}
1onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}}let a=new o},57895:(e,t,r)=>{function s(e){let t={subscribe(t){let r=null,s=!1,n=!1,i=!1;function o(){if(null===r){i=!0;return}!n&&(n=!0,"function"==typeof r?r():r&&r.unsubscribe())}return r=e({next(e){s||t.next?.(e)},error(e){s||(s=!0,t.error?.(e),o())},complete(){s||(s=!0,t.complete?.(),o())}}),i&&o(),{unsubscribe:o}},pipe:(...e)=>(0===e.length?function(e){return e}:1===e.length?e[0]:function(t){return e.reduce((e,t)=>t(e),t)})(t)};return t}r.d(t,{XT:()=>S,Xq:()=>q,$H:()=>E,kM:()=>I});class n extends Error{constructor(e){super(e),this.name="ObservableAbortError",Object.setPrototypeOf(this,n.prototype)}}var i=r(36098);function o(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}class a extends Error{constructor(){super("Unable to transform response from server")}}function u(e,t){let r;try{r=function(e,t){if("error"in e){let r=t.transformer.deserialize(e.error);return{ok:!1,error:{...e,error:r}}}return{ok:!0,result:{...e.result,...(!e.result.type||"data"===e.result.type)&&{type:"data",data:t.transformer.deserialize(e.result.data)}}}}(e,t)}catch(e){throw new a}if(!r.ok&&(!o(r.error.error)||"number"!=typeof r.error.error.code)||r.ok&&!o(r.result))throw new a;return r}class l extends Error{static from(e,t={}){return e instanceof l||e instanceof Error&&"TRPCClientError"===e.name?(t.meta&&(e.meta={...e.meta,...t.meta}),e):o(e)&&o(e.error)&&"number"==typeof e.error.code&&"string"==typeof e.error.message?new l(e.error.message,{...t,result:e}):e instanceof Error?new l(e.message,{...t,cause:(0,i.e2)(e)}):new l("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,l.prototype)}}function c(e){var t;return{url:e.url.toString().replace(/\/$/,""),fetch:e.fetch,AbortController:(t=e.AbortController)?t:"undefined"!=typeof window&&window.AbortController?window.AbortController:"undefined"!=typeof globalThis&&globalThis.AbortController?globalThis.AbortController:null}}let h={query:"GET",mutation:"POST"};function d(e){return"input"in e?e.runtime.transformer.serialize(e.input):function(e){let t={};for(let r=0;r<e.length;r++){let s=e[r];t[r]=s}return t}(e.inputs.map(t=>e.runtime.transformer.serialize(t)))}let f=e=>{let t=e.url+"/"+e.path,r=[];if("inputs"in e&&r.push("batch=1"),"query"===e.type){let t=d(e);void 0!==t&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(t+="?"+r.join("&")),t},p=e=>{if("query"===e.type)return;let t=d(e);return void 0!==t?JSON.stringify(t):void 0},y=e=>b({...e,contentTypeHeader:"application/json",getUrl:f,getBody:p});async function m(e,t){let r=e.getUrl(e),s=e.getBody(e),{type:n}=e,i=await e.headers();if("subscription"===n)throw Error("Subscriptions should use wsLink");let o={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.batchModeHeader?{"trpc-batch-mode":e.batchModeHeader}:{},...i};return(function(e){if(e)return e;if("undefined"!=typeof window&&"function"==typeof window.fetch)return window.fetch;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.fetch)return globalThis.fetch;throw Error("No fetch implementation found")})(e.fetch)(r,{method:h[n],signal:t?.signal,body:s,headers:o})}function b(e){let t=e.AbortController?new e.AbortController:null,r={},s=!1;return{promise:new Promise((n,i)=>{m(e,t).then(e=>(r.response=e,s=!0,e.json())).then(e=>{r.responseJSON=e,n({json:e,meta:r})}).catch(e=>{s=!0,i(l.from(e,{meta:r}))})}),cancel:()=>{s||t?.abort()}}}let v=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function g(e){let t=null,r=null;function s(){let s=function(t){let r=[[]],s=0;for(;;){let n=t[s];if(!n)break;let i=r[r.length-1];if(n.aborted){n.reject?.(Error("Aborted")),s++;continue}if(e.validate(i.concat(n).map(e=>e.key))){i.push(n),s++;continue}if(0===i.length){n.reject?.(Error("Input is too big for a single dispatch")),s++;continue}r.push([])}return r}(t);for(let n of(clearTimeout(r),r=null,t=null,s)){if(!n.length)continue;let t={items:n,cancel:v};for(let e of n)e.batch=t;let r=(e,r)=>{let s=t.items[e];s.resolve?.(r),s.batch=null,s.reject=null,s.resolve=null},{promise:s,cancel:i}=e.fetch(t.items.map(e=>e.key),r);t.cancel=i,s.then(e=>{for(let t=0;t<e.length;t++){let s=e[t];r(t,s)}for(let e of t.items)e.reject?.(Error("Missing result")),e.batch=null}).catch(e=>{for(let r of t.items)r.reject?.(e),r.batch=null})}}return{load:function(e){let n={aborted:!1,key:e,batch:null,resolve:v,reject:v},i=new Promise((e,r)=>{n.reject=r,n.resolve=e,t||(t=[]),t.push(n)});return r||(r=setTimeout(s)),{promise:i,cancel:()=>{n.aborted=!0,n.batch?.items.every(e=>e.aborted)&&(n.batch.cancel(),n.batch=null)}}}}}function w(e){return function(t){let r=c(t),n=t.maxURLLength??1/0;return i=>{let o=s=>
1({validate:e=>{if(n===1/0)return!0;let t=e.map(e=>e.path).join(","),o=e.map(e=>e.input);return f({...r,runtime:i,type:s,path:t,inputs:o}).length<=n},fetch:e({...r,runtime:i,type:s,opts:t})}),a=g(o("query")),c=g(o("mutation")),h={query:a,subscription:g(o("subscription")),mutation:c};return({op:e})=>s(t=>{let r,{promise:s,cancel:n}=h[e.type].load(e);return s.then(e=>{r=e;let s=u(e.json,i);if(!s.ok)return void t.error(l.from(s.error,{meta:e.meta}));t.next({context:e.meta,result:s.result}),t.complete()}).catch(e=>{t.error(l.from(e,{meta:r?.meta}))}),()=>{n()}})}}}function O(e){return t=>{let r=c(t);return n=>({op:i})=>s(s=>{let o,{path:a,input:c,type:h}=i,{promise:d,cancel:f}=e.requester({...r,runtime:n,type:h,path:a,input:c,headers:()=>t.headers?"function"==typeof t.headers?t.headers({op:i}):t.headers:{}});return d.then(e=>{o=e.meta;let t=u(e.json,n);if(!t.ok)return void s.error(l.from(t.error,{meta:o}));s.next({context:e.meta,result:t.result}),s.complete()}).catch(e=>{s.error(l.from(e,{meta:o}))}),()=>{f()}})}}w(e=>t=>{let r=t.map(e=>e.path).join(","),s=t.map(e=>e.input),{promise:n,cancel:i}=y({...e,path:r,inputs:s,headers:()=>e.opts.headers?"function"==typeof e.opts.headers?e.opts.headers({opList:t}):e.opts.headers:{}});return{promise:n.then(e=>(Array.isArray(e.json)?e.json:t.map(()=>e.json)).map(t=>({meta:e.meta,json:t}))),cancel:i}}),O({requester:y});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"]}}};function E(e={}){let{enabled:t=()=>!0}=e,r=e.colorMode??("undefined"==typeof window?"ansi":"css"),{logger:n=(({c:e=console,colorMode:t="css"})=>r=>{let s=r.input,n="undefined"!=typeof FormData&&s instanceof FormData?Object.fromEntries(s):s,{parts:i,args:o}=function(e){let{direction:t,type:r,path:s,id:n,input:i}=e,o=[],a=[];if("ansi"===e.colorMode){let[i,u]=C.ansi.regular[r],[l,c]=C.ansi.bold[r];return o.push("up"===t?i:u,"up"===t?">>":"<<",r,"up"===t?l:c,`#${n}`,s,"\x1b[0m"),"up"===t?a.push({input:e.input}):a.push({input:e.input,result:"result"in e.result?e.result.result:e.result,elapsedMs:e.elapsedMs}),{parts:o,args:a}}let[u,l]=C.css[r],c=`
2    background-color: #${"up"===t?u:l}; 
3    color: ${"up"===t?"black":"white"};
4    padding: 2px;
5  `;return o.push("%c","up"===t?">>":"<<",r,`#${n}`,`%c${s}%c`,"%O"),a.push(c,`${c}; font-weight: bold;`,`${c}; font-weight: normal;`),"up"===t?a.push({input:i,context:e.context}):a.push({input:i,result:e.result,elapsedMs:e.elapsedMs,context:e.context}),{parts:o,args:a}}({...r,colorMode:t,input:n});e["down"===r.direction&&r.result&&(r.result instanceof Error||"error"in r.result.result)?"error":"log"].apply(null,[i.join(" ")].concat(o))})({c:e.console,colorMode:r})}=e;return()=>({op:e,next:r})=>s(s=>{var i;t({...e,direction:"up"})&&n({...e,direction:"up"});let o=Date.now();function a(r){let s=Date.now()-o;t({...e,direction:"down",result:r})&&n({...e,direction:"down",elapsedMs:s,result:r})}return r(e).pipe((i={next(e){a(e)},error(e){a(e)}},e=>({subscribe:t=>e.subscribe({next(e){i.next?.(e),t.next?.(e)},error(e){i.error?.(e),t.error?.(e)},complete(){i.complete?.(),t.complete?.()}})}))).subscribe(s)})}class R{$request({type:e,input:t,path:r,context:n={}}){var i;return(i={links:this.links,op:{id:++this.requestId,type:e,path:r,input:t,context:n}},s(e=>(function e(t=0,r=i.op){let s=i.links[t];if(!s)throw Error("No more links to execute - did you forget to add an ending link?");return s({op:r,next:r=>e(t+1,r)})})().subscribe(e))).pipe(e=>{let t=0,r=null,s=[];return{subscribe: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(){if(0==--t&&r){let e=r;r=null,e.unsubscribe()}let e=s.findIndex(e=>e===n);e>-1&&s.splice(e,1)}})}})}requestAsPromise(e){var t;let r,{promise:s,abort:i}=(t=this.$request(e),{promise:new Promise((e,s)=>{let i=!1;function o(){i||(i=!0,s(new n("This operation was aborted.")),a.unsubscribe())}let a=t.subscribe({next(t){i=!0,e(t),o()},error(e){i=!0,s(e),o()},complete(){i=!0,o()}});r=o}),abort:r});return new Promise((t,r)=>{e.signal?.addEventListener("abort",i),s.then(e=>{t(e.result.data)}).catch(e=>{r(l.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}).subscribe({next(e){"started"===e.result.type?r.onStarted?.():"stopped"===e.result.type?r.onStopped?.():r.onData?.(e.result.data)},error(e){r.onError?.(e)},complete(){r.onComplete?.()}})}constructor(e){this.requestId=0;let t=(()=>{let t=e.transformer;return t?"input"in t?e.transformer:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}})();this.runtime={transformer:{serialize:e=>t.input.serialize(e),deserialize:e=>t.output.deserialize(e)}
5,combinedTransformer:t},this.links=e.links.map(e=>e(this.runtime))}}function S(e){return new R(e)}let Q={query:"query",mutate:"mutation",subscribe:"subscription"};function q(e){return(0,i.U6)(t=>e.hasOwnProperty(t)?e[t]:"__untypedClient"===t?e:(0,i.vX)(({path:r,args:s})=>{let n=[t,...r],i=Q[n.pop()],o=n.join(".");return e[i](o,...s)}))}async function P(e){let t=e.parse??JSON.parse;await x(e.readableStream,r=>{if(e.signal?.aborted||!r||"}"===r)return;let s=r.indexOf(":"),n=r.substring(2,s-1),i=r.substring(s+1);e.onSingle(Number(n),t(i))},e.textDecoder)}async function x(e,t,r){var s,n;let i="",o=e=>{let s=r.decode(e).split("\n");if(1===s.length)i+=s[0];else if(s.length>1){t(i+s[0]);for(let e=1;e<s.length-1;e++)t(s[e]);i=s[s.length-1]}};"getReader"in e?await D(e,o):await (s=e,n=o,new Promise(e=>{s.on("data",n),s.on("end",e)})),t(i)}async function D(e,t){let r=e.getReader(),s=await r.read();for(;!s.done;)t(s.value),s=await r.read()}let I=w(e=>{let t=function(e){if(e)return e;if("undefined"!=typeof window&&window.TextDecoder)return new window.TextDecoder;if("undefined"!=typeof globalThis&&globalThis.TextDecoder)return new globalThis.TextDecoder;throw Error("No TextDecoder implementation found")}(e.opts.textDecoder);return(r,s)=>{let n=r.map(e=>e.path).join(","),i=r.map(e=>e.input),{cancel:o,promise:a}=((e,t)=>{let r=e.AbortController?new e.AbortController:null;return{cancel:()=>r?.abort(),promise:m({...e,contentTypeHeader:"application/json",batchModeHeader:"stream",getUrl:f,getBody:p},r).then(async s=>{if(!s.body)throw Error("Received response without body");let n={response:s};return P({readableStream:s.body,onSingle:t,parse:e=>({json:JSON.parse(e),meta:n}),signal:r?.signal,textDecoder:e.textDecoder})})}})({...e,textDecoder:t,path:n,inputs:i,headers:()=>e.opts.headers?"function"==typeof e.opts.headers?e.opts.headers({opList:r}):e.opts.headers:{}},(e,t)=>{s(e,t)});return{promise:a.then(()=>[]),cancel:o}}}),T=e=>{if("input"in e){if(!(e.input instanceof FormData))throw Error("Input is not FormData");return e.input}};O({requester:e=>{if("mutation"!==e.type)throw Error("We only handle mutations with formdata");return b({...e,getUrl:()=>`${e.url}/${e.path}`,getBody:T})}})},68320:(e,t,r)=>{e.exports=r(92343)},68387:(e,t,r)=>{r.d(t,{Cp:()=>b,F$:()=>y,G6:()=>S,GR:()=>h,MK:()=>f,Od:()=>m,S$:()=>s,Zw:()=>i,_D:()=>u,b_:()=>d,f8:()=>g,gn:()=>o,iv:()=>a,j3:()=>l,jY:()=>Q,lQ:()=>n,nJ:()=>p,pl:()=>q,vh:()=>c,yy:()=>R});let s="undefined"==typeof window||"Deno"in window;function n(){}function i(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function a(e,t){return e.filter(e=>!t.includes(e))}function u(e,t,r){let s=e.slice(0);return s[t]=r,s}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t,r){return E(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function h(e,t,r){return E(e)?"function"==typeof t?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}}function d(e,t,r){return E(e)?[{...t,queryKey:e},r]:[e||{},t]}function f(e,t){let{type:r="all",exact:s,fetchStatus:n,predicate:i,queryKey:o,stale:a}=e;if(E(o))if(s){if(t.queryHash!==y(o,t.options))return!1}else{var u;if(u=t.queryKey,!v(u,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(void 0===n||n===t.state.fetchStatus)&&(!i||!!i(t))}function p(e,t){let{exact:r,fetching:s,predicate:n,mutationKey:i}=e;if(E(i)){if(!t.options.mutationKey)return!1;if(r){if(m(t.options.mutationKey)!==m(i))return!1}else{var o;if(o=t.options.mutationKey,!v(o,i))return!1}}return("boolean"!=typeof s||"loading"===t.state.status===s)&&(!n||!!n(t))}function y(e,t){return((null==t?void 0:t.queryKeyHashFn)||m)(e)}function m(e){return JSON.stringify(e,(e,t)=>O(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function b(e,t){return v(e,t)}function v(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(r=>!v(e[r],t[r]))}function g(e,t){if(e&&!t||t&&!e)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e){if(!C(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!C(r)&&!!r.hasOwnProperty("isPrototypeOf")}function C(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return Array.isArray(e)}function R(e){return new Promise(t=>{setTimeout(t,e)})}function S(e){R(0).then(e)}function Q(){if("function"==typeof AbortController)return new AbortController}function q(e,t,r){return null!=r.isDataEqual&&r.isDataEqual(e,t)?e:"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,s=0){if(t===r)return t;if(s>500)return r;let n=w(t)&&w(r);if(n||O(t)&&O(r)){let i=n?t.length:Object.keys(t).length,o=n?r:Object.keys(r),a=o.length,u=n?[]:{},l=0;for(let i=0;i<a;i++){let a=n?i:o[i];
5u[a]=e(t[a],r[a],s+1),u[a]===t[a]&&l++}return i===a&&l===i?t:u}return r}(e,t):t}},70255:(e,t,r)=>{r.d(t,{$:()=>u,s:()=>a});var s=r(98646),n=r(98992),i=r(82559),o=r(8711);class a extends i.k{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||s.U,this.observers=[],this.state=e.state||u(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){var e,t,r,s,n,i,a,u,l,c,h,d,f,p,y,m,b,v,g,w;let O=()=>{var e;return this.retryer=(0,o.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},C="loading"===this.state.status;try{if(!C){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(l=(c=this.mutationCache.config).onMutate)?void 0:l.call(c,this.state.variables,this));let e=await (null==(h=(d=this.options).onMutate)?void 0:h.call(d,this.state.variables));e!==this.state.context&&this.dispatch({type:"loading",context:e,variables:this.state.variables})}let o=await O();return await (null==(e=(t=this.mutationCache.config).onSuccess)?void 0:e.call(t,o,this.state.variables,this.state.context,this)),await (null==(r=(s=this.options).onSuccess)?void 0:r.call(s,o,this.state.variables,this.state.context)),await (null==(n=(i=this.mutationCache.config).onSettled)?void 0:n.call(i,o,null,this.state.variables,this.state.context,this)),await (null==(a=(u=this.options).onSettled)?void 0:a.call(u,o,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:o}),o}catch(e){try{throw await (null==(f=(p=this.mutationCache.config).onError)?void 0:f.call(p,e,this.state.variables,this.state.context,this)),await (null==(y=(m=this.options).onError)?void 0:y.call(m,e,this.state.variables,this.state.context)),await (null==(b=(v=this.mutationCache.config).onSettled)?void 0:b.call(v,void 0,e,this.state.variables,this.state.context,this)),await (null==(g=(w=this.options).onSettled)?void 0:g.call(w,void 0,e,this.state.variables,this.state.context)),e}finally{this.dispatch({type:"error",error:e})}}}dispatch(e){let t=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"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,o.v_)(this.options.networkMode),status:"loading",variables:e.variables};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"};case"setState":return{...t,...e.state}}};this.state=t(this.state),n.j.batch(()=>{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function u(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}},75365:(e,t,r)=>{r.d(t,{Ht:()=>u,jE:()=>a});var s=r(71527);let n=s.createContext(void 0),i=s.createContext(!1);function o(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=n),window.ReactQueryClientContext):n)}let a=function(){let{context:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=s.useContext(o(e,s.useContext(i)));if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},u=e=>{let{client:t,children:r,context:n,contextSharing:a=!1}=e;s.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);let u=o(n,a);return s.createElement(i.Provider,{value:!n&&a},s.createElement(u.Provider,{value:t},r))}},82559:(e,t,r)=>{r.d(t,{k:()=>n});var s=r(68387);
5class n{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,s.gn)(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:s.S$?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}},92343:(e,t,r)=>{var s=r(71527),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=s.useState,o=s.useEffect,a=s.useLayoutEffect,u=s.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),s=i({inst:{value:r,getSnapshot:t}}),n=s[0].inst,c=s[1];return a(function(){n.value=r,n.getSnapshot=t,l(n)&&c({inst:n})},[e,r,t]),o(function(){return l(n)&&c({inst:n}),e(function(){l(n)&&c({inst:n})})},[e]),u(r),r};t.useSyncExternalStore=void 0!==s.useSyncExternalStore?s.useSyncExternalStore:c},98646:(e,t,r)=>{r.d(t,{U:()=>s});let s=console},98992:(e,t,r)=>{r.d(t,{j:()=>n});var s=r(68387);let n=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=n=>{t?e.push(n):(0,s.G6)(()=>{r(n)})};return{batch:i=>{let o;t++;try{o=i()}finally{--t||(()=>{let t=e;e=[],t.length&&(0,s.G6)(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e}}}()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.