vendor: 4,172 bytes, line 1
1var fs=e=>{throw TypeError(e)};var Ae=(e,t,s)=>t.has(e)||fs("Cannot "+s);var a=(e,t,s)=>(Ae(e,t,"read from private field"),s?s.call(e):t.get(e)),P=(e,t,s)=>t.has(e)?fs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),S=(e,t,s,r)=>(Ae(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),E=(e,t,s)=>(Ae(e,t,"access private method"),s);var Ce=(e,t,s,r)=>({set _(i){S(e,t,i,s)},get _(){return a(e,t,r)}});import{r as O,j as M}from"./ui-vendor-kqy_wwo0.js";import{r as zs}from"./react-vendor-C8w-UNLI.js";var ce=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(){}},qt=typeof window>"u"||"Deno"in globalThis;function W(){}function vr(e,t){return typeof e=="function"?e(t):e}function We(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ws(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ot(e,t){return typeof e=="function"?e(t):e}function Z(e,t){return typeof e=="function"?e(t):e}function ps(e,t){const{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==as(o,t.options))return!1}else if(!pe(t.queryKey,o))return!1}if(s!=="all"){const c=t.isActive();if(s==="active"&&!c||s==="inactive"&&c)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||n&&!n(t))}function ys(e,t){const{exact:s,status:r,predicate:i,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(s){if(Kt(t.options.mutationKey)!==Kt(n))return!1}else if(!pe(t.options.mutationKey,n))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function as(e,t){return((t==null?void 0:t.queryKeyHashFn)||Kt)(e)}function Kt(e){return JSON.stringify(e,(t,s)=>Ge(s)?Object.keys(s).sort().reduce((r,i)=>(r[i]=s[i],r),{}):s)}function pe(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>pe(e[s],t[s])):!1}function Gs(e,t){if(e===t)return e;const s=ms(e)&&ms(t);if(s||Ge(e)&&Ge(t)){const r=s?e:Object.keys(e),i=r.length,n=s?t:Object.keys(t),o=n.length,u=s?[]:{},c=new Set(r);let l=0;for(let p=0;p<o;p++){const d=s?p:n[p];(!s&&c.has(d)||s)&&e[d]===void 0&&t[d]===void 0?(u[d]=void 0,l++):(u[d]=Gs(e[d],t[d]),u[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:u}return t}function Me(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function ms(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ge(e){if(!vs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!vs(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vs(e){return Object.prototype.toString.call(e)==="[object Object]"}function gr(e){return new Promise(t=>{setTimeout(t,e)})}function Ve(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Gs(e,t):t}function br(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function Sr(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var us=Symbol();function Vs(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===us?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Js(e,t){return typeof e=="function"?e(...t):!!e}var Tt,bt,Vt,ks,Rr=(ks=class extends ce{constructor(){super();P(this,Tt);P(this,bt);P(this,Vt);S(this,Vt,t=>{if(!qt&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){a(this,bt)||this.setEventListener(a(this,Vt))}onUnsubscribe(){var t;this.hasListeners()||((t=a(this,bt))==null||t.call(this),S(this,bt,void 0))}setEventListener(t){var s;S(this,Vt,t),(s=a(this,bt))==null||s.call(this),S(this,bt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){a(this,Tt)!==t&&(S(this,Tt,t),this.onFocus())}onFocus(){const t=this.isFocused();
1this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof a(this,Tt)=="boolean"?a(this,Tt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Tt=new WeakMap,bt=new WeakMap,Vt=new WeakMap,ks),cs=new Rr,Jt,St,Yt,As,wr=(As=class extends ce{constructor(){super();P(this,Jt,!0);P(this,St);P(this,Yt);S(this,Yt,t=>{if(!qt&&window.addEventListener){const s=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){a(this,St)||this.setEventListener(a(this,Yt))}onUnsubscribe(){var t;this.hasListeners()||((t=a(this,St))==null||t.call(this),S(this,St,void 0))}setEventListener(t){var s;S(this,Yt,t),(s=a(this,St))==null||s.call(this),S(this,St,t(this.setOnline.bind(this)))}setOnline(t){a(this,Jt)!==t&&(S(this,Jt,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return a(this,Jt)}},Jt=new WeakMap,St=new WeakMap,Yt=new WeakMap,As),Oe=new wr;function Je(){let e,t;const s=new Promise((i,n)=>{e=i,t=n});s.status="pending",s.catch(()=>{});function r(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},s.reject=i=>{r({status:"rejected",reason:i}),t(i)},s}function Pr(e){return Math.min(1e3*2**e,3e4)}function Ys(e){return(e??"online")==="online"?Oe.isOnline():!0}var Xs=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Zs(e){let t=!1,s=0,r;const i=Je(),n=()=>i.status!=="pending",o=h=>{var v;n()||(b(new Xs(h)),(v=e.abort)==null||v.call(e))},u=()=>{t=!0},c=()=>{t=!1},l=()=>cs.isFocused()&&(e.networkMode==="always"||Oe.isOnline())&&e.canRun(),p=()=>Ys(e.networkMode)&&e.canRun(),d=h=>{n()||(r==null||r(),i.resolve(h))},b=h=>{n()||(r==null||r(),i.reject(h))},m=()=>new Promise(h=>{var v;r=g=>{(n()||l())&&h(g)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;r=void 0,n()||(h=e.onContinue)==null||h.call(e)}),f=()=>{if(n())return;let h;const v=s===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(d).catch(g=>{var C;if(n())return;const w=e.retry??(qt?0:3),R=e.retryDelay??Pr,y=typeof R=="function"?R(s,g):R,_=w===!0||typeof w=="number"&&s<w||typeof w=="function"&&w(s,g);if(t||!_){b(g);return}s++,(C=e.onFail)==null||C.call(e,s,g),gr(y).then(()=>l()?void 0:m()).then(()=>{t?b(g):f()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:c,canStart:p,start:()=>(p()?f():m().then(f),i)}}var Cr=e=>setTimeout(e,0);function _r(){let e=[],t=0,s=u=>{u()},r=u=>{u()},i=Cr;const n=u=>{t?e.push(u):i(()=>{s(u)})},o=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(c=>{s(c)})})})};return{batch:u=>{let c;t++;try{c=u()}finally{t--,t||o()}return c},batchCalls:u=>(...c)=>{n(()=>{u(...c)})},schedule:n,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var K=_r(),Dt,Qs,tr=(Qs=class{constructor(){P(this,Dt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),We(this.gcTime)&&S(this,Dt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qt?1/0:300*1e3))}clearGcTimeout(){a(this,Dt)&&(clearTimeout(a(this,Dt)),S(this,Dt,void 0))}},Dt=new WeakMap,Qs),Xt,Zt,X,jt,N,me,kt,st,ct,Us,Er=(Us=class extends tr{constructor(t){super();P(this,st);P(this,Xt);P(this,Zt);P(this,X);P(this,jt);P(this,N);P(this,me);P(this,kt);S(this,kt,!1),S(this,me,t.defaultOptions),this.setOptions(t.options),this.observers=[],S(this,jt,t.client),S(this,X,a(this,jt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,S(this,Xt,xr(this.options)),this.state=t.state??a(this,Xt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=a(this,N))==null?void 0:t.promise}setOptions(t){this.options={...a(this,me),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&a(this,X).remove(this)}setData(t,s){const r=Ve(this.state.data,t,this.options);return E(this,st,ct).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(t,s){E(this,st,ct).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var r,i;const s=(r=a(this,N))==null?void 0:r.promise;return(i=a(this,N))==null||i.cancel(t),s?s.then(W).catch(W):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(a(this,Xt))}isActive(){return this.observers.some(t=>Z(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===us||this.state.dataUpdateCount+this.state.errorUpdate
1Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ot(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ws(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=a(this,N))==null||s.continue()}onOnline(){var s;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=a(this,N))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),a(this,X).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(a(this,N)&&(a(this,kt)?a(this,N).cancel({revert:!0}):a(this,N).cancelRetry()),this.scheduleGc()),a(this,X).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||E(this,st,ct).call(this,{type:"invalidate"})}async fetch(t,s){var c,l,p,d,b,m,f,h,v,g,w,R;if(this.state.fetchStatus!=="idle"&&((c=a(this,N))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(a(this,N))return a(this,N).continueRetry(),a(this,N).promise}if(t&&this.setOptions(t),!this.options.queryFn){const y=this.observers.find(_=>_.options.queryFn);y&&this.setOptions(y.options)}const r=new AbortController,i=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(S(this,kt,!0),r.signal)})},n=()=>{const y=Vs(this.options,s),C=(()=>{const F={client:a(this,jt),queryKey:this.queryKey,meta:this.meta};return i(F),F})();return S(this,kt,!1),this.options.persister?this.options.persister(y,C,this):y(C)},u=(()=>{const y={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:a(this,jt),state:this.state,fetchFn:n};return i(y),y})();(l=this.options.behavior)==null||l.onFetch(u,this),S(this,Zt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&E(this,st,ct).call(this,{type:"fetch",meta:(d=u.fetchOptions)==null?void 0:d.meta}),S(this,N,Zs({initialPromise:s==null?void 0:s.initialPromise,fn:u.fetchFn,abort:r.abort.bind(r),onFail:(y,_)=>{E(this,st,ct).call(this,{type:"failed",failureCount:y,error:_})},onPause:()=>{E(this,st,ct).call(this,{type:"pause"})},onContinue:()=>{E(this,st,ct).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const y=await a(this,N).start();if(y===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(y),(m=(b=a(this,X).config).onSuccess)==null||m.call(b,y,this),(h=(f=a(this,X).config).onSettled)==null||h.call(f,y,this.state.error,this),y}catch(y){if(y instanceof Xs){if(y.silent)return a(this,N).promise;if(y.revert)return this.setState({...a(this,Zt),fetchStatus:"idle"}),this.state.data}throw E(this,st,ct).call(this,{type:"error",error:y}),(g=(v=a(this,X).config).onError)==null||g.call(v,y,this),(R=(w=a(this,X).config).onSettled)==null||R.call(w,this.state.data,y,this),y}finally{this.scheduleGc()}}},Xt=new WeakMap,Zt=new WeakMap,X=new WeakMap,jt=new WeakMap,N=new WeakMap,me=new WeakMap,kt=new WeakMap,st=new WeakSet,ct=function(t){const s=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...er(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return S(this,Zt,t.manual?i:void 0),i;case"error":const n=t.error;
vendor: 5,073 bytes, line 1
1return{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=s(this.state),K.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),a(this,X).notify({query:this,type:"updated",action:t})})},Us);function er(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ys(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function xr(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var it,Bs,Mr=(Bs=class extends ce{constructor(t={}){super();P(this,it);this.config=t,S(this,it,new Map)}build(t,s,r){const i=s.queryKey,n=s.queryHash??as(i,s);let o=this.get(n);return o||(o=new Er({client:t,queryKey:i,queryHash:n,options:t.defaultQueryOptions(s),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){a(this,it).has(t.queryHash)||(a(this,it).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=a(this,it).get(t.queryHash);s&&(t.destroy(),s===t&&a(this,it).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){K.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return a(this,it).get(t)}getAll(){return[...a(this,it).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(r=>ps(s,r))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(r=>ps(t,r)):s}notify(t){K.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){K.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){K.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},it=new WeakMap,Bs),ot,H,At,at,vt,qs,Or=(qs=class extends tr{constructor(t){super();P(this,at);P(this,ot);P(this,H);P(this,At);this.mutationId=t.mutationId,S(this,H,t.mutationCache),S(this,ot,[]),this.state=t.state||sr(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){a(this,ot).includes(t)||(a(this,ot).push(t),this.clearGcTimeout(),a(this,H).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){S(this,ot,a(this,ot).filter(s=>s!==t)),this.scheduleGc(),a(this,H).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){a(this,ot).length||(this.state.status==="pending"?this.scheduleGc():a(this,H).remove(this))}continue(){var t;return((t=a(this,At))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var n,o,u,c,l,p,d,b,m,f,h,v,g,w,R,y,_,C,F,L;const s=()=>{E(this,at,vt).call(this,{type:"continue"})};S(this,At,Zs({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(x,T)=>{E(this,at,vt).call(this,{type:"failed",failureCount:x,error:T})},onPause:()=>{E(this,at,vt).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>a(this,H).canRun(this)}));const r=this.state.status==="pending",i=!a(this,At).canStart();try{if(r)s();else{E(this,at,vt).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(n=a(this,H).config).onMutate)==null?void 0:o.call(n,t,this));const T=await((c=(u=this.options).onMutate)==null?void 0:c.call(u,t));T!==this.state.context&&E(this,at,vt).call(this,{type:"pending",context:T,variables:t,isPaused:i})}const x=await a(this,At).start();return await((p=(l=a(this,H).config).onSuccess)==null?void 0:p.call(l,x,t,this.state.context,this)),await((b=(d=this.options).onSuccess)==null?void 0:b.call(d,x,t,this.state.context)),await((f=(m=a(this,H).config).onSettled)==null?void 0:f.call(m,x,null,this.state.variables,this.state.context,this)),await((v=(h=this.options).onSettled)==null?void 0:v.call(h,x,null,t,this.state.context)),E(this,at,vt).call(this,{type:"success",data:x}),x}catch(x){try{throw await((w=(g=a(this,H).config).onError)==null?void 0:w.call(g,x,t,this.state.context,this)),await((y=(R=this.options).onError)==null?void 0:y.call(R,x,t,this.state.context)),await((C=(_=a(this,H).config).onSettled)==null?void 0:C.call(_,void 0,x,this.state.variables,this.state.context,this)),await((L=(F=this.options).onSettled)==null?void 0:L.call(F,void 0,x,t,this.state.context)),x}finally{E(this,at,vt).call(this,{type:"error",error:x})}}finally{a(this,H).runNext(this)}}},ot=new WeakMap,H=new WeakMap,At=new WeakMap,at=new WeakSet,vt=function(t){const s=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};
1case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),K.batch(()=>{a(this,ot).forEach(r=>{r.onMutationUpdate(t)}),a(this,H).notify({mutation:this,type:"updated",action:t})})},qs);function sr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dt,rt,ve,Ks,Fr=(Ks=class extends ce{constructor(t={}){super();P(this,dt);P(this,rt);P(this,ve);this.config=t,S(this,dt,new Set),S(this,rt,new Map),S(this,ve,0)}build(t,s,r){const i=new Or({mutationCache:this,mutationId:++Ce(this,ve)._,options:t.defaultMutationOptions(s),state:r});return this.add(i),i}add(t){a(this,dt).add(t);const s=_e(t);if(typeof s=="string"){const r=a(this,rt).get(s);r?r.push(t):a(this,rt).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(a(this,dt).delete(t)){const s=_e(t);if(typeof s=="string"){const r=a(this,rt).get(s);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&a(this,rt).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=_e(t);if(typeof s=="string"){const r=a(this,rt).get(s),i=r==null?void 0:r.find(n=>n.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const s=_e(t);if(typeof s=="string"){const i=(r=a(this,rt).get(s))==null?void 0:r.find(n=>n!==t&&n.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){K.batch(()=>{a(this,dt).forEach(t=>{this.notify({type:"removed",mutation:t})}),a(this,dt).clear(),a(this,rt).clear()})}getAll(){return Array.from(a(this,dt))}find(t){const s={exact:!0,...t};return this.getAll().find(r=>ys(s,r))}findAll(t={}){return this.getAll().filter(s=>ys(t,s))}notify(t){K.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return K.batch(()=>Promise.all(t.map(s=>s.continue().catch(W))))}},dt=new WeakMap,rt=new WeakMap,ve=new WeakMap,Ks);function _e(e){var t;return(t=e.options.scope)==null?void 0:t.id}function gs(e){return{onFetch:(t,s)=>{var p,d,b,m,f;const r=t.options,i=(b=(d=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:d.fetchMore)==null?void 0:b.direction,n=((m=t.state.data)==null?void 0:m.pages)||[],o=((f=t.state.data)==null?void 0:f.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const l=async()=>{let h=!1;const v=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(t.signal.aborted?h=!0:t.signal.addEventListener("abort",()=>{h=!0}),t.signal)})},g=Vs(t.options,t.fetchOptions),w=async(R,y,_)=>{if(h)return Promise.reject();if(y==null&&R.pages.length)return Promise.resolve(R);const F=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:y,direction:_?"backward":"forward",meta:t.options.meta};return v(U),U})(),L=await g(F),{maxPages:x}=t.options,T=_?Sr:br;return{pages:T(R.pages,L,x),pageParams:T(R.pageParams,y,x)}};if(i&&n.length){const R=i==="backward",y=R?Lr:bs,_={pages:n,pageParams:o},C=y(r,_);u=await w(_,C,R)}else{const R=e??n.length;do{const y=c===0?o[0]??r.initialPageParam:bs(r,u);if(c>0&&y==null)break;u=await w(u,y),c++}while(c<R)}return u};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=l}}}function bs(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function Lr(e,{pages:t,pageParams:s}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,s[0],s):void 0}var Q,Rt,wt,te,ee,Pt,se,re,Ns,Hn=(Ns=class{constructor(e={}){P(this,Q);P(this,Rt);P(this,wt);P(this,te);P(this,ee);P(this,Pt);P(this,se);P(this,re);S(this,Q,e.queryCache||new Mr),S(this,Rt,e.mutationCache||new Fr),S(this,wt,e.defaultOptions||{}),S(this,te,new Map),S(this,ee,new Map),S(this,Pt,0)}mount(){Ce(this,Pt)._++,a(this,Pt)===1&&(S(this,se,cs.subscribe(async e=>{e&&(await this.resumePausedMutations(),a(this,Q).onFocus())})),S(this,re,Oe.subscribe(async e=>{e&&(await this.resumePausedMutations(),a(this,Q).onOnline())})))}unmount(){var e,t;Ce(this,Pt)._--,a(this,Pt)===0&&((e=a(this,se))==null||e.call(this),S(this,se,void 0),(t=a(this,re))==null||t.call(this),S(this,re,void 0))}isFetching(e){return a(this,Q).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return a(this,Rt).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=a(this,Q).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=a(this,Q).build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Ot(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return a(this,Q).findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),i=a(this,Q).get(r.queryHash),n=i==null?void 0:i.state.data,o=vr(t,n);if(o!==void 0)return a(this,Q).build(this,r).setData(o,{...s,manual:!0})}
vendor: 12,388 bytes, line 1
1setQueriesData(e,t,s){return K.batch(()=>a(this,Q).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=a(this,Q).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=a(this,Q);K.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=a(this,Q);return K.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=K.batch(()=>a(this,Q).findAll(e).map(i=>i.cancel(s)));return Promise.all(r).then(W).catch(W)}invalidateQueries(e,t={}){return K.batch(()=>(a(this,Q).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=K.batch(()=>a(this,Q).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let n=i.fetch(void 0,s);return s.throwOnError||(n=n.catch(W)),i.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(r).then(W)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=a(this,Q).build(this,t);return s.isStaleByTime(Ot(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(W).catch(W)}fetchInfiniteQuery(e){return e.behavior=gs(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(W).catch(W)}ensureInfiniteQueryData(e){return e.behavior=gs(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Oe.isOnline()?a(this,Rt).resumePausedMutations():Promise.resolve()}getQueryCache(){return a(this,Q)}getMutationCache(){return a(this,Rt)}getDefaultOptions(){return a(this,wt)}setDefaultOptions(e){S(this,wt,e)}setQueryDefaults(e,t){a(this,te).set(Kt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...a(this,te).values()],s={};return t.forEach(r=>{pe(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){a(this,ee).set(Kt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...a(this,ee).values()],s={};return t.forEach(r=>{pe(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...a(this,wt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=as(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===us&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...a(this,wt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){a(this,Q).clear(),a(this,Rt).clear()}},Q=new WeakMap,Rt=new WeakMap,wt=new WeakMap,te=new WeakMap,ee=new WeakMap,Pt=new WeakMap,se=new WeakMap,re=new WeakMap,Ns),V,I,ge,z,Qt,ne,Ct,_t,be,ie,oe,Ut,Bt,Et,ae,j,de,Ye,Xe,Ze,ts,es,ss,rs,rr,$s,Ir=($s=class extends ce{constructor(t,s){super();P(this,j);P(this,V);P(this,I);P(this,ge);P(this,z);P(this,Qt);P(this,ne);P(this,Ct);P(this,_t);P(this,be);P(this,ie);P(this,oe);P(this,Ut);P(this,Bt);P(this,Et);P(this,ae,new Set);this.options=s,S(this,V,t),S(this,_t,null),S(this,Ct,Je()),this.options.experimental_prefetchInRender||a(this,Ct).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(a(this,I).addObserver(this),Ss(a(this,I),this.options)?E(this,j,de).call(this):this.updateResult(),E(this,j,ts).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ns(a(this,I),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ns(a(this,I),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,E(this,j,es).call(this),E(this,j,ss).call(this),a(this,I).removeObserver(this)}setOptions(t){const s=this.options,r=a(this,I);if(this.options=a(this,V).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Z(this.options.enabled,a(this,I))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");E(this,j,rs).call(this),a(this,I).setOptions(this.options),s._defaulted&&!Me(this.options,s)&&a(this,V).getQueryCache().notify({type:"observerOptionsUpdated",query:a(this,I),observer:this});const i=this.hasListeners();i&&Rs(a(this,I),r,this.options,s)&&E(this,j,de).call(this),this.updateResult(),i&&(a(this,I)!==r||Z(this.options.enabled,a(this,I))!==Z(s.enabled,a(this,I))||Ot(this.options.staleTime,a(this,I))!==Ot(s.staleTime,a(this,I)))&&E(this,j,Ye).call(this);const n=E(this,j,Xe).call(this);i&&(a(this,I)!==r||Z(this.options.enabled,a(this,I))!==Z(s.enabled,a(this,I))||n!==a(this,Et))&&E(this,j,Ze).call(this,n)}getOptimisticResult(t){const s=a(this,V).getQueryCache().build(a(this,V),t),r=this.createResult(s,t);return Dr(this,r)&&(S(this,z,r),S(this,ne,this.options),S(this,Qt,a(this,I).state)),r}getCurrentResult(){return a(this,z)}trackResult(t,s){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),s==null||s(i),Reflect.get(r,i))})}trackProp(t){a(this,ae).add(t)}getCurrentQuery(){return a(this,I)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=a(this,V).defaultQueryOptions(t),r=a(this,V).getQueryCache().build(a(this,V),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return E(this,j,de).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),a(this,z)))}createResult(t,s){var x;const r=a(this,I),i=this.options,n=a(this,z),o=a(this,Qt),u=a(this,ne),l=t!==r?t.state:a(this,ge),{state:p}=t;let d={...p},b=!1,m;if(s._optimisticResults){const T=this.hasListeners(),U=!T&&Ss(t,s),k=T&&Rs(t,r,s,i);(U||k)&&(d={...d,...er(p.data,t.options)}),s._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:v}=d;m=d.data;let g=!1;if(s.placeholderData!==void 0&&m===void 0&&v==="pending"){let T;n!=null&&n.isPlaceholderData&&s.placeholderData===(u==null?void 0:u.placeholderData)?(T=n.data,g=!0):T=typeof s.placeholderData=="function"?s.placeholderData((x=a(this,oe))==null?void 0:x.state.data,a(this,oe)):s.placeholderData,T!==void 0&&(v="success",m=Ve(n==null?void 0:n.data,T,s),b=!0)}if(s.select&&m!==void 0&&!g)if(n&&m===(o==null?void 0:o.data)&&s.select===a(this,be))m=a(this,ie);else try{S(this,be,s.select),m=s.select(m),m=Ve(n==null?void 0:n.data,m,s),S(this,ie,m),S(this,_t,null)}catch(T){S(this,_t,T)}a(this,_t)&&(f=a(this,_t),m=a(this,ie),h=Date.now(),v="error");const w=d.fetchStatus==="fetching",R=v==="pending",y=v==="error",_=R&&w,C=m!==void 0,L={status:v,fetchStatus:d.fetchStatus,isPending:R,isSuccess:v==="success",isError:y,isInitialLoading:_,isLoading:_,data:m,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!R,isLoadingError:y&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:y&&C,isStale:ls(t,s),refetch:this.refetch,promise:a(this,Ct),isEnabled:Z(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=B=>{L.status==="error"?B.reject(L.error):L.data!==void 0&&B.resolve(L.data)},U=()=>{const B=S(this,Ct,L.promise=Je());T(B)},k=a(this,Ct);switch(k.status){case"pending":t.queryHash===r.queryHash&&T(k);break;case"fulfilled":(L.status==="error"||L.data!==k.value)&&U();break;case"rejected":(L.status!=="error"||L.error!==k.reason)&&U();break}}return L}updateResult(){const t=a(this,z),s=this.createResult(a(this,I),this.options);if(S(this,Qt,a(this,I).state),S(this,ne,this.options),a(this,Qt).data!==void 0&&S(this,oe,a(this,I)),Me(s,t))return;S(this,z,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,n=typeof i=="function"?i():i;if(n==="all"||!n&&!a(this,ae).size)return!0;const o=new Set(n??a(this,ae));return this.options.throwOnError&&o.add("error"),Object.keys(a(this,z)).some(u=>{const c=u;return a(this,z)[c]!==t[c]&&o.has(c)})};E(this,j,rr).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&E(this,j,ts).call(this)}},V=new WeakMap,I=new WeakMap,ge=new WeakMap,z=new WeakMap,Qt=new WeakMap,ne=new WeakMap,Ct=new WeakMap,_t=new WeakMap,be=new WeakMap,ie=new WeakMap,oe=new WeakMap,Ut=new WeakMap,Bt=new WeakMap,Et=new WeakMap,ae=new WeakMap,j=new WeakSet,de=function(t){E(this,j,rs).call(this);let s=a(this,I).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(W)),s},Ye=function(){E(this,j,es).call(this);const t=Ot(this.options.staleTime,a(this,I));if(qt||a(this,z).isStale||!We(t))return;const r=Ws(a(this,z).dataUpdatedAt,t)+1;S(this,Ut,setTimeout(()=>{a(this,z).isStale||this.updateResult()},r))},Xe=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(a(this,I)):this.options.refetchInterval)??!1},Ze=function(t){E(this,j,ss).call(this),S(this,Et,t),!(qt||Z(this.options.enabled,a(this,I))===!1||!We(a(this,Et))||a(this,Et)===0)&&S(this,Bt,setInterval(()=>{(this.options.refetchIntervalInBackground||cs.isFocused())&&E(this,j,de).call(this)},a(this,Et)))},ts=function(){E(this,j,Ye).call(this),E(this,j,Ze).call(this,E(this,j,Xe).call(this))},es=function(){a(this,Ut)&&(clearTimeout(a(this,Ut)),S(this,Ut,void 0))},ss=function(){a(this,Bt)&&(clearInterval(a(this,Bt)),S(this,Bt,void 0))},rs=function(){const t=a(this,V).getQueryCache().build(a(this,V),this.options);if(t===a(this,I))return;const s=a(this,I);S(this,I,t),S(this,ge,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},rr=function(t){K.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(a(this,z))}),a(this,V).getQueryCache().notify({query:a(this,I),type:"observerResultsUpdated"})})},$s);function Tr(e,t){return Z(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ss(e,t){return Tr(e,t)||e.state.data!==void 0&&ns(e,t,t.refetchOnMount)}function ns(e,t,s){if(Z(t.enabled,e)!==!1&&Ot(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&ls(e,t)}return!1}function Rs(e,t,s,r){return(e!==t||Z(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&ls(e,s)}function ls(e,t){return Z(t.enabled,e)!==!1&&e.isStaleByTime(Ot(t.staleTime,e))}function Dr(e,t){return!Me(e.getCurrentResult(),t)}var xt,Mt,J,ft,pt,Ee,is,Hs,jr=(Hs=class extends ce{constructor(t,s){super();P(this,pt);P(this,xt);P(this,Mt);P(this,J);P(this,ft);S(this,xt,t),this.setOptions(s),this.bindMethods(),E(this,pt,Ee).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=a(this,xt).defaultMutationOptions(t),Me(this.options,s)||a(this,xt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:a(this,J),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Kt(s.mutationKey)!==Kt(this.options.mutationKey)?this.reset():((r=a(this,J))==null?void 0:r.state.status)==="pending"&&a(this,J).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=a(this,J))==null||t.removeObserver(this)}onMutationUpdate(t){E(this,pt,Ee).call(this),E(this,pt,is).call(this,t)}getCurrentResult(){return a(this,Mt)}reset(){var t;(t=a(this,J))==null||t.removeObserver(this),S(this,J,void 0),E(this,pt,Ee).call(this),E(this,pt,is).call(this)}mutate(t,s){var r;return S(this,ft,s),(r=a(this,J))==null||r.removeObserver(this),S(this,J,a(this,xt).getMutationCache().build(a(this,xt),this.options)),a(this,J).addObserver(this),a(this,J).execute(t)}},xt=new WeakMap,Mt=new WeakMap,J=new WeakMap,ft=new WeakMap,pt=new WeakSet,Ee=function(){var s;const t=((s=a(this,J))==null?void 0:s.state)??sr();S(this,Mt,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.
1status==="idle",mutate:this.mutate,reset:this.reset})},is=function(t){K.batch(()=>{var s,r,i,n,o,u,c,l;if(a(this,ft)&&this.hasListeners()){const p=a(this,Mt).variables,d=a(this,Mt).context;(t==null?void 0:t.type)==="success"?((r=(s=a(this,ft)).onSuccess)==null||r.call(s,t.data,p,d),(n=(i=a(this,ft)).onSettled)==null||n.call(i,t.data,null,p,d)):(t==null?void 0:t.type)==="error"&&((u=(o=a(this,ft)).onError)==null||u.call(o,t.error,p,d),(l=(c=a(this,ft)).onSettled)==null||l.call(c,void 0,t.error,p,d))}this.listeners.forEach(p=>{p(a(this,Mt))})})},Hs),nr=O.createContext(void 0),ir=e=>{const t=O.useContext(nr);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zn=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),M.jsx(nr.Provider,{value:e,children:t})),or=O.createContext(!1),kr=()=>O.useContext(or);or.Provider;function Ar(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Qr=O.createContext(Ar()),Ur=()=>O.useContext(Qr),Br=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},qr=e=>{O.useEffect(()=>{e.clearReset()},[e])},Kr=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Js(s,[e.error,r])),Nr=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>t(s(...r)):t(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$r=(e,t)=>e.isLoading&&e.isFetching&&!t,Hr=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ws=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function zr(e,t,s){var d,b,m,f,h;const r=kr(),i=Ur(),n=ir(),o=n.defaultQueryOptions(e);(b=(d=n.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||b.call(d,o),o._optimisticResults=r?"isRestoring":"optimistic",Nr(o),Br(o,i),qr(i);const u=!n.getQueryCache().get(o.queryHash),[c]=O.useState(()=>new t(n,o)),l=c.getOptimisticResult(o),p=!r&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(v=>{const g=p?c.subscribe(K.batchCalls(v)):W;return c.updateResult(),g},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),O.useEffect(()=>{c.setOptions(o)},[o,c]),Hr(o,l))throw ws(o,c,i);if(Kr({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:n.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((f=(m=n.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||f.call(m,o,l),o.experimental_prefetchInRender&&!qt&&$r(l,r)){const v=u?ws(o,c,i):(h=n.getQueryCache().get(o.queryHash))==null?void 0:h.promise;v==null||v.catch(W).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function Wn(e,t){return zr(e,Ir)}function Gn(e,t){const s=ir(),[r]=O.useState(()=>new jr(s,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const i=O.useSyncExternalStore(O.useCallback(o=>r.subscribe(K.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),n=O.useCallback((o,u)=>{r.mutate(o,u).catch(W)},[r]);if(i.error&&Js(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}const Ps="pushstate",Cs="popstate",ar="beforeunload",ur=e=>(e.preventDefault(),e.returnValue=""),Wr=()=>{removeEventListener(ar,ur,{capture:!0})};function cr(e){let t=e.getLocation(),s=new Set,r=[];const i=()=>{t=e.getLocation(),s.forEach(o=>o())},n=async o=>{var u;if(typeof document<"u"&&r.length){for(let c of r)if(!await c()){(u=e.onBlocked)==null||u.call(e,i);return}}o()};return{get location(){return t},subscribe:o=>(s.add(o),()=>{s.delete(o)}),push:(o,u)=>{u=_s(u),n(()=>{e.pushState(o,u),i()})},replace:(o,u)=>{u=_s(u),n(()=>{e.replaceState(o,u),i()})},go:o=>{n(()=>{e.go(o)})},back:()=>{n(()=>{e.back()})},forward:()=>{n(()=>{e.forward()})},createHref:o=>e.createHref(o),block:o=>(r.push(o),r.length===1&&addEventListener(ar,ur,{capture:!0}),()=>{r=r.filter(u=>u!==o),r.length||Wr()}),flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:i}}function _s(e){return e||(e={}),{...e,key:lr()}}function Gr(e){const t=typeof document<"u"?window:void 0,s=(g=>g),r=(()=>os(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));let i=r(),n;const o=()=>i;let u,c=!0,l;const p=g=>{c=!1,g(),c=!0},d=()=>{p(()=>{u&&(t.history[u.isPush?"pushState":"replaceState"](u.state,"",u.href),u=void 0,l=void 0,n=void 0)})},b=(g,w,R)=>{const y=s(w);l||(n=i),i=os(w,R),u={href:y,state:R,isPush:(u==null?void 0:u.isPush)||g==="push"},l||(l=Promise.resolve().then(()=>d()))},m=()=>{i=r(),v.notify()};var f=t.history.pushState,h=t.history.replaceState;const v=cr({getLocation:o,pushState:(g,w)=>b("push",g,w),replaceState:(g,w)=>b("replace",g,w),back:()=>t.history.back(),forward:()=>t.history.forward(),go:g=>t.history.go(g),createHref:g=>s(g),flush:d,destroy:()=>{t.history.pushState=f,t.history.replaceState=h,t.removeEventListener(Ps,m),t.removeEventListener(Cs,m)},onBlocked:g=>{n&&i!==n&&(i=n,g())}});return t.addEventListener(Ps,m),t.addEventListener(Cs,m),t.history.pushState=function(){let g=f.apply(t.history,arguments);return c&&v.notify(),g},t.history.replaceState=function(){let g=h.apply(t.history,arguments);return c&&v.notify(),g},v}function Vr(e={initialEntries:["/"]}){const t=e.initialEntries;let s=e.initialIndex??t.length-1,r={key:lr()};return cr({getLocation:()=>os(t[s],r),pushState:(n,o)=>{r=o,t.push(n),s++},replaceState:(n,o)=>{r=o,t[s]=n},back:()=>{s--},forward:()=>{s=Math.min(s+1,t.length-1)},go:n=>{s=Math.min(Math.max(s+n,0),t.length-1)},createHref:n=>n})}function os(e,t){let s=e.indexOf("#"),r=e.indexOf("?");return{href:e,pathname:e.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:e.length),hash:s>-1?e.substring(s):"",search:r>-1?e.slice(r,s===-1?void 0:s):"",state:t||{}}}function lr(){return(Math.random()+1).toString(36).substring(7)}var Jr="Invariant failed";function G(e,t){if(!e)throw new Error(Jr)}let Qe=O.createContext(null);function hr(){return typeof document>"u"?Qe:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Qe,Qe)}function yt(e){const t=O.useContext(hr());return e==null||e.warn,t}var Ue={exports:{}},Be={},qe={exports:{}},Ke={};/** 2 * @license React 3 * use-sync-external-store-shim.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Es;function Yr(){if(Es)return Ke;Es=1;var e=zs();function t(d,b){return d===b&&(d!==0||1/d===1/b)||d!==d&&b!==b}var s=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,n=e.useLayoutEffect,o=e.useDebugValue;function u(d,b){var m=b(),f=r({inst:{value:m,getSnapshot:b}}),h=f[0].inst,v=f[1];return n(function(){h.value=m,h.getSnapshot=b,c(h)&&v({inst:h})},[d,m,b]),i(function(){return c(h)&&v({inst:h}),d(function(){c(h)&&v({inst:h})})},[d]),o(m),m}function c(d){var b=d.getSnapshot;d=d.value;try{var m=b();return!s(d,m)}catch{return!0}}function l(d,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:u;return Ke.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ke}var xs;function Xr(){return xs||(xs=1,qe.exports=Yr()),qe.exports}/** 10 * @license React 11 * use-sync-external-store-shim/with-selector.production.js 12 * 13 * Copyright (c) Meta Platforms, Inc. and affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var Ms;function Zr(){if(Ms)return Be;Ms=1;var e=zs(),t=Xr();
17function s(l,p){return l===p&&(l!==0||1/l===1/p)||l!==l&&p!==p}var r=typeof Object.is=="function"?Object.is:s,i=t.useSyncExternalStore,n=e.useRef,o=e.useEffect,u=e.useMemo,c=e.useDebugValue;return Be.useSyncExternalStoreWithSelector=function(l,p,d,b,m){var f=n(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=u(function(){function g(C){if(!w){if(w=!0,R=C,C=b(C),m!==void 0&&h.hasValue){var F=h.value;if(m(F,C))return y=F}return y=C}if(F=y,r(R,C))return F;var L=b(C);return m!==void 0&&m(F,L)?(R=C,F):(R=C,y=L)}var w=!1,R,y,_=d===void 0?null:d;return[function(){return g(p())},_===null?void 0:function(){return g(_())}]},[p,d,b,m]);var v=i(l,f[0],f[1]);return o(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},Be}var Os;function tn(){return Os||(Os=1,Ue.exports=Zr()),Ue.exports}var en=tn(),sn=class{constructor(e,t){this.listeners=new Set,this._batching=!1,this._flushing=0,this._nextPriority=null,this.subscribe=s=>{var i,n;this.listeners.add(s);const r=(n=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:n.call(i,s,this);return()=>{this.listeners.delete(s),r==null||r()}},this.setState=(s,r)=>{var o,u,c,l,p;const i=this.state;this.state=(o=this.options)!=null&&o.updateFn?this.options.updateFn(i)(s):s(i);const n=(r==null?void 0:r.priority)??((u=this.options)==null?void 0:u.defaultPriority)??"high";this._nextPriority===null?this._nextPriority=n:this._nextPriority==="high"?this._nextPriority=n:this._nextPriority=((c=this.options)==null?void 0:c.defaultPriority)??"high",(p=(l=this.options)==null?void 0:l.onUpdate)==null||p.call(l,{priority:this._nextPriority}),this._flush()},this._flush=()=>
17{if(this._batching)return;const s=++this._flushing;this.listeners.forEach(r=>{this._flushing===s&&r({priority:this._nextPriority??"high"})})},this.batch=s=>{if(this._batching)return s();this._batching=!0,s(),this._batching=!1,this._flush()},this.state=e,this.options=t}};function rn(e,t=s=>s){return en.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,nn)}function nn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!1;for(let r=0;r<s.length;r++)if(!Object.prototype.hasOwnProperty.call(t,s[r])||!Object.is(e[s[r]],t[s[r]]))return!1;return!0}function hs(e){const t=e.errorComponent??Ie;return M.jsx(on,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s})=>s?O.createElement(t,{error:s}):e.children})}class on extends O.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){var s;return{resetKey:(s=t.getResetKey)==null?void 0:s.call(t)}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t,s){s.error&&s.resetKey!==this.state.resetKey&&this.setState({error:null})}componentDidCatch(t){var s,r;this.props.onCatch?(r=(s=this.props).onCatch)==null||r.call(s,t):console.error(t)}render(){return this.props.children(this.state)}}function Ie({error:e}){const[t,s]=O.useState(!1);return M.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[M.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[M.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),M.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(r=>!r),children:t?"Hide Error":"Show Error"})]}),M.jsx("div",{style:{height:".25rem"}}),t?M.jsx("div",{children:M.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?M.jsx("code",{children:e.message}):null})}):null]})}function et(e){const t=yt({warn:(e==null?void 0:e.router)===void 0});return rn(((e==null?void 0:e.router)||t).__store,e==null?void 0:e.select)}const dr=typeof document>"u";function Fe(e){return e[e.length-1]}function an(e){return typeof e=="function"}function Gt(e,t){return an(e)?e(t):e}function fe(e,t){return t.reduce((s,r)=>(s[r]=e[r],s),{})}function gt(e,t){if(e===t)return e;const s=t,r=Ls(e)&&Ls(s);if(r||Le(e)&&Le(s)){const i=r?e:Object.keys(e),n=i.length,o=r?s:Object.keys(s),u=o.length,c=r?[]:{};let l=0;for(let p=0;p<u;p++){const d=r?p:o[p];!r&&e[d]===void 0&&s[d]===void 0&&i.includes(d)?(c[d]=void 0,l++):(c[d]=gt(e[d],s[d]),c[d]===e[d]&&e[d]!==void 0&&l++)}return n===u&&l===n?e:c}return s}function Le(e){if(!Fs(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!Fs(s)||!s.hasOwnProperty("isPrototypeOf"))}function Fs(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ls(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ye(e,t,s=!1){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Le(e)&&Le(t)){const r=Object.keys(e),i=Object.keys(t);return!s&&r.length!==i.length?!1:!i.some(n=>!(n in e)||!ye(e[n],t[n],s))}return Array.isArray(e)&&Array.isArray(t)?!e.some((r,i)=>!ye(r,t[i],s)):!1}const Ne=typeof window<"u"?O.useLayoutEffect:O.useEffect;function un(e){return e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}function ht(e){return!!(e!=null&&e.isNotFound)}function cn(e){const t=et({select:s=>`not-found-${s.location.pathname}-${s.status}`});return M.jsx(hs,{getResetKey:()=>t,onCatch:s=>{var r;if(ht(s))(r=e.onCatch)==null||r.call(e,s);else throw s},errorComponent:({error:s})=>{var r;return(r=e.fallback)==null?void 0:r.call(e,s)},children:e.children})}function ln(){return M.jsx("p",{children:"Not Found"})}function Vn(e){if(e.isRedirect=!0,e.throw??!0)throw e;return e}function lt(e){return!!(e!=null&&e.isRedirect)}const Te=O.createContext(void 0);function Is(){const e=yt(),t=et({select:s=>{var r;return(r=nt(s)[0])==null?void 0:r.id}});return M.jsx(Te.Provider,{value:t,children:M.jsx(hs,{getResetKey:()=>{var s;return(s=e.state.resolvedLocation.state)==null?void 0:s.key},errorComponent:Ie,onCatch:s=>{console.error(s)},children:t?M.jsx(fr,{matchId:t}):null})})}function $e(e){return M.jsx(M.Fragment,{children:e.children})}function fr({matchId:e}){var t,s,r,i;const n=yt(),o=et({select:h=>{var v;return(v=nt(h).find(g=>g.id===e))==null?void 0:v.routeId}});G(o);const u=n.routesById[o],c=u.options.pendingComponent??n.options.defaultPendingComponent,l=c?M.jsx(c,{}):null,p=u.options.errorComponent??n.options.defaultErrorComponent??Ie,d=u.isRoot?u.options.notFoundComponent??((t=n.options.notFoundRoute)==null?void 0:t.options.component):u.options.notFoundComponent,b=u.options.wrapInSuspense??c??((s=u.options.component)==null?void 0:s.preload)??((r=u.options.pendingComponent)==null?void 0:r.preload)??((i=u.options.errorComponent)==null?void 0:i.preload)?O.Suspense:$e,m=p?hs:$e,f=d?cn:$e;return M.jsx(Te.Provider,{value:e,children:M.jsx(b,{fallback:l,children:M.jsx(m,{getResetKey:()=>{var h;
17return(h=n.state.resolvedLocation.state)==null?void 0:h.key},errorComponent:p,onCatch:h=>{if(ht(h))throw h;console.error(h)},children:M.jsx(f,{fallback:h=>{if(!d||h.routeId&&h.routeId!==o||!h.routeId&&!u.isRoot)throw h;return O.createElement(d,h)},children:M.jsx(hn,{matchId:e,pendingElement:l})})})})})}function hn({matchId:e,pendingElement:t}){var s;const r=yt(),i=et({select:c=>{var l;return(l=nt(c).find(p=>p.id===e))==null?void 0:l.routeId}}),n=r.routesById[i],o=et({select:c=>fe(nt(c).find(l=>l.id===e),["status","error","showPending","loadPromise"])}),u=(n.options.errorComponent??r.options.defaultErrorComponent)||Ie;if(o.status==="notFound")return G(ht(o.error)),pr(r,n,o.error.data);if(o.status==="redirected")return G(lt(o.error)),null;if(o.status==="error"){if(dr)return M.jsx(u,{error:o.error,info:{componentStack:""}});throw yn(o.error)?(((s=r.options.errorSerializer)==null?void 0:s.deserialize)??mn)(o.error.data):o.error}if(o.status==="pending"){if(o.showPending)return t;throw o.loadPromise}if(o.status==="success"){let c=n.options.component??r.options.defaultComponent;return c?M.jsx(c,{}):M.jsx(dn,{})}G(!1)}const dn=O.memo(function(){const t=yt(),s=O.useContext(Te),r=et({select:u=>{var c;return(c=nt(u).find(l=>l.id===s))==null?void 0:c.routeId}}),i=t.routesById[r],{parentGlobalNotFound:n}=et({select:u=>{const l=nt(u).find(p=>p.id===s);return G(l),{parentGlobalNotFound:l.globalNotFound}}}),o=et({select:u=>{var c;const l=nt(u),p=l.findIndex(d=>d.id===s);return(c=l[p+1])==null?void 0:c.id}});return n?pr(t,i,void 0):o?M.jsx(fr,{matchId:o}):null});function pr(e,t,s){return t.options.notFoundComponent?M.jsx(t.options.notFoundComponent,{data:s}):e.options.defaultNotFoundComponent?M.jsx(e.options.defaultNotFoundComponent,{data:s}):M.jsx(ln,{})}function nt(e){var t;return(t=e.pendingMatches)!=null&&t.some(s=>s.showPending)?e.pendingMatches:e.matches}function Nt(e){var t;const s=yt(),r=O.useContext(Te),i=(t=nt(s.state).find(u=>u.id===r))==null?void 0:t.routeId,n=(()=>{const u=nt(s.state);return(e!=null&&e.from?u.find(l=>l.routeId===(e==null?void 0:e.from)):u.find(l=>l.id===r)).routeId})();return((e==null?void 0:e.strict)??!0)&&G(i==n),et({select:u=>{const c=nt(u).find(l=>e!=null&&e.from?(e==null?void 0:e.from)===l.routeId:l.id===r);return G(c,`Could not find ${e!=null&&e.from?`an active match from "${e.from}"`:"a nearest match!"}`),e!=null&&e.select?e.select(c):c}})}function fn(e){return Nt({...e,select:t=>typeof e.select=="function"?e.select(t==null?void 0:t.loaderDeps):t==null?void 0:t.loaderDeps})}function pn(e){return Nt({...e,select:t=>typeof e.select=="function"?e.select(t==null?void 0:t.loaderData):t==null?void 0:t.loaderData})}function yn(e){return!(typeof e=="object"&&e&&"data"in e)||!("__isServerError"in e&&e.__isServerError)||!(typeof e.data=="object"&&e.data)?!1:e.__isServerError===!0}function mn(e){if("name"in e&&"message"in e){const t=new Error(e.message);return t.name=e.name,t}return e.data}function Ft(e){return De(e.filter(Boolean).join("/"))}function De(e){return e.replace(/\/{2,}/g,"/")}function ds(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function xe(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function vn(e){return xe(ds(e))}function gn(e,t,s){t=t.replace(new RegExp(`^${e}`),"/"),s=s.replace(new RegExp(`^${e}`),"/");let r=ue(t);const i=ue(s);i.forEach((o,u)=>{var c;if(o.value==="/")u?u===i.length-1&&r.push(o):r=[o];else if(o.value==="..")r.length>1&&((c=Fe(r))==null?void 0:c.value)==="/"&&r.pop(),r.pop();else{if(o.value===".")return;r.push(o)}});const n=Ft([e,...r.map(o=>o.value)]);return De(n)}function ue(e){if(!e)return[];e=De(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const s=e.split("/").filter(Boolean);return t.push(...s.map(r=>r==="$"||r==="*"?{type:"wildcard",value:r}:r.charAt(0)==="$"?{type:"param",value:r}:{type:"pathname",value:r})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function He({path:e,params:t,leaveWildcards:s,leaveParams:r}){const i=ue(e);return Ft(i.map(n=>{if(n.type==="wildcard"){const o=t._splat;return s?`${n.value}${o??""}`:o}if(n.type==="param"){if(r){const o=t[n.value];return`${n.value}${o??""}`}return t[n.value.substring(1)]??"undefined"}return n.value}))}function ze(e,t,s){const r=bn(e,t,s);if(!(s.to&&!r))return r??{}}function Ts(e,t){return e!="/"?t.replace(e,""):t}function bn(e,t,s){t=Ts(e,t);const r=Ts(e,`${s.to??"$"}`),i=ue(t),n=ue(r);t.startsWith("/")||i.unshift({type:"pathname",value:"/"}),r.startsWith("/")||n.unshift({type:"pathname",value:"/"});const o={};return(()=>{for(let c=0;c<Math.max(i.length,n.length);c++){const l=i[c],p=n[c],d=c>=i.length-1,b=c>=n.length-1;if(p){if(p.type==="wildcard"){if(l!=null&&l.value){const m=decodeURI(Ft(i.slice(c).map(f=>f.value)));return o["*"]=m,o._splat=m,!0}return!1}if(p.type==="pathname"){if(p.value==="/"&&!(l!=null&&l.value))return!0;
17if(l){if(s.caseSensitive){if(p.value!==l.value)return!1}else if(p.value.toLowerCase()!==l.value.toLowerCase())return!1}}if(!l)return!1;if(p.type==="param"){if((l==null?void 0:l.value)==="/")return!1;l.value.charAt(0)!=="$"&&(o[p.value.substring(1)]=decodeURI(l.value))}}if(!d&&b)return o["**"]=Ft(i.slice(c+1).map(m=>m.value)),!!s.fuzzy&&(p==null?void 0:p.value)!=="/"}return!0})()?o:void 0}function Sn(e){return et({select:t=>{var s;const r=(s=Fe(nt(t)))==null?void 0:s.params;return e!=null&&e.select?e.select(r):r}})}function Rn(e){return Nt({...e,select:t=>e!=null&&e.select?e.select(t.search):t.search})}const tt="__root__";class yr{constructor(t){this.init=s=>{var r,i;this.originalIndex=s.originalIndex;const n=this.options,o=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(i=(r=this.options)==null?void 0:r.getParentRoute)==null?void 0:i.call(r),o?this.path=tt:G(this.parentRoute);let u=o?tt:n.path;u&&u!=="/"&&(u=ds(u));const c=(n==null?void 0:n.id)||u;let l=o?tt:Ft([this.parentRoute.id===tt?"":this.parentRoute.id,c]);u===tt&&(u="/"),l!==tt&&(l=Ft(["/",l]));const p=l===tt?"/":Ft([this.parentRoute.fullPath,u]);this.path=u,this.id=l,this.fullPath=p,this.to=p},this.addChildren=s=>(this.children=s,this),this.updateLoader=s=>(Object.assign(this.options,s),this),this.update=s=>(Object.assign(this.options,s),this),this.lazy=s=>(this.lazyFn=s,this),this.useMatch=s=>Nt({...s,from:this.id}),this.useRouteContext=s=>Nt({...s,from:this.id,select:r=>s!=null&&s.select?s.select(r.context):r.context}),this.useSearch=s=>Rn({...s,from:this.id}),this.useParams=s=>Sn({...s,from:this.id}),this.useLoaderDeps=s=>fn({...s,from:this.id}),this.useLoaderData=s=>pn({...s,from:this.id}),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),G(!(t!=null&&t.id&&(t!=null&&t.path))),this.$$typeof=Symbol.for("react.memo")}}function wn(e){return new yr(e)}class Pn extends yr{constructor(t){super(t)}}function Jn(e){return new Pn(e)}function Cn(e,t){var s,r,i,n="";for(s in e)if((i=e[s])!==void 0)if(Array.isArray(i))for(r=0;r<i.length;r++)n&&(n+="&"),n+=encodeURIComponent(s)+"="+encodeURIComponent(i[r]);else n&&(n+="&"),n+=encodeURIComponent(s)+"="+encodeURIComponent(i);return""+n}function Ds(e){if(!e)return"";var t=decodeURIComponent(e);return t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t}function _n(e,t){for(var s,r,i={},n=e.split("&");s=n.shift();)s=s.split("="),r=s.shift(),i[r]!==void 0?i[r]=[].concat(i[r],Ds(s.shift())):i[r]=Ds(s.shift());return i}const En=Mn(JSON.parse),xn=On(JSON.stringify,JSON.parse);function Mn(e){return t=>{t.substring(0,1)==="?"&&(t=t.substring(1));let s=_n(t);for(let r in s){const i=s[r];if(typeof i=="string")try{s[r]=e(i)}catch{}}return s}}function On(e,t){function s(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(typeof r=="string"&&typeof t=="function")try{return t(r),e(r)}catch{}return r}return r=>{r={...r},r&&Object.keys(r).forEach(n=>{const o=r[n];typeof o>"u"||o===void 0?delete r[n]:r[n]=s(o)});const i=Cn(r).toString();return i?`?${i}`:""}}const Fn=O.useTransition||(()=>[!1,e=>{e()}]);function Yn({router:e,...t}){e.update({...e.options,...t,context:{...e.options.context,...t==null?void 0:t.context}});const s=e.options.InnerWrap?M.jsx(e.options.InnerWrap,{children:M.jsx(Is,{})}):M.jsx(Is,{}),r=hr(),i=M.jsxs(r.Provider,{value:e,children:[s,M.jsx(Ln,{})]});return e.options.Wrap?M.jsx(e.options.Wrap,{children:i}):i}function Ln(){const e=yt(),t=O.useRef({router:e,mounted:!1}),s=et({select:o=>fe(o,["isLoading","location","resolvedLocation","isTransitioning"])}),[r,i]=Fn();e.startReactTransition=i,O.useEffect(()=>{r&&e.__store.setState(o=>({...o,isTransitioning:r}))},[r]);const n=()=>{(u=>{s.isTransitioning?u():i(()=>u())})(()=>{try{e.load()}catch(u){console.error(u)}})};return Ne(()=>{const o=e.history.subscribe(()=>{e.latestLocation=e.parseLocation(e.latestLocation),e.state.location!==e.latestLocation&&n()});return()=>{o()}},[e.history]),Ne(()=>{var o;if(O.useTransition?s.isTransitioning&&!r:!s.isLoading&&s.resolvedLocation!==s.location){if(e.emit({type:"onResolved",fromLocation:s.resolvedLocation,toLocation:s.location,pathChanged:s.location.href!==((o=s.resolvedLocation)==null?void 0:o.href)}),document.querySelector&&s.location.hash!==""){const u=document.getElementById(s.location.hash);u&&u.scrollIntoView()}e.__store.setState(u=>({...u,isTransitioning:!1,resolvedLocation:u.location}))}},[s.isTransitioning,r,s.isLoading,s.resolvedLocation,s.location]),Ne(()=>{window.__TSR_DEHYDRATED__||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},n())},[e]),null}function js(e,t){return[...e.cachedMatches,...e.pendingMatches??[],...e.matches].find(s=>s.id===t)}const In=["component","errorComponent","pendingComponent","notFoundComponent"];function Xn(e){return new Tn(e)}class Tn{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.navigateTimeout=null,this.latestLoadPromise=Promise.resolve(),this.subscribers=new Set,this.injectedHtml=[],this.startReactTransition=s=>s(),this.update=s=>{s.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options;this.options={...this.options,...s},(!this.basepath||s.basepath&&s.basepath!==r.basepath)&&(s.basepath===void 0||s.basepath===""||s.basepath==="/"?this.basepath="/":this.basepath=`/${vn(s.basepath)}
17`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(typeof document<"u"?Gr():Vr({initialEntries:[this.options.basepath||"/"]})),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new sn(kn(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,status:this.state.isTransitioning||this.state.isLoading?"pending":"idle",cachedMatches:this.state.cachedMatches.filter(i=>!["redirected"].includes(i.status))}}}))},this.buildRouteTree=()=>{this.routesById={},this.routesByPath={};const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s);const r=n=>{n.forEach((o,u)=>{o.init({originalIndex:u});const c=this.routesById[o.id];if(G(!c,`Duplicate routes found with id: ${String(o.id)}`),this.routesById[o.id]=o,!o.isRoot&&o.path){const p=xe(o.fullPath);(!this.routesByPath[p]||o.fullPath.endsWith("/"))&&(this.routesByPath[p]=o)}const l=o.children;l!=null&&l.length&&r(l)})};r([this.routeTree]);const i=[];Object.values(this.routesById).forEach((n,o)=>{var u;if(n.isRoot||!n.path)return;const c=ds(n.fullPath),l=ue(c);for(;l.length>1&&((u=l[0])==null?void 0:u.value)==="/";)l.shift();const p=l.map(d=>d.value==="/"?.75:d.type==="param"?.5:d.type==="wildcard"?.25:1);i.push({child:n,trimmed:c,parsed:l,index:o,scores:p})}),this.flatRoutes=i.sort((n,o)=>{const u=Math.min(n.scores.length,o.scores.length);for(let c=0;c<u;c++)if(n.scores[c]!==o.scores[c])return o.scores[c]-n.scores[c];if(n.scores.length!==o.scores.length)return o.scores.length-n.scores.length;for(let c=0;c<u;c++)if(n.parsed[c].value!==o.parsed[c].value)return n.parsed[c].value>o.parsed[c].value?1:-1;return n.index-o.index}).map((n,o)=>(n.child.rank=o,n.child))},this.subscribe=(s,r)=>{const i={eventType:s,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=s=>{this.subscribers.forEach(r=>{r.eventType===s.type&&r.fn(s)})},this.checkLatest=s=>this.latestLoadPromise!==s?this.latestLoadPromise:void 0,this.parseLocation=s=>{const r=({pathname:u,search:c,hash:l,state:p})=>{const d=this.options.parseSearch(c),b=this.options.stringifySearch(d);return{pathname:u,searchStr:b,search:gt(s==null?void 0:s.search,d),hash:l.split("#").reverse()[0]??"",href:`${u}${b}${l}`,state:gt(s==null?void 0:s.state,p)}},i=r(this.history.location);let{__tempLocation:n,__tempKey:o}=i.state;if(n&&(!o||o===this.tempLocationKey)){const u=r(n);return u.state.key=i.state.key,delete u.state.__tempLocation,{...u,maskedLocation:i}}return i},this.resolvePathWithBase=(s,r)=>gn(this.basepath,s,De(r)),this.matchRoutes=(s,r,i)=>{let n={},o=this.flatRoutes.find(m=>{const f=ze(this.basepath,xe(s),{to:m.fullPath,caseSensitive:m.options.caseSensitive??this.options.caseSensitive,fuzzy:!0});return f?(n=f,!0):!1}),u=o||this.routesById[tt],c=[u],l=!1;for((o?o.path!=="/"&&n["**"]:xe(s))&&(this.options.notFoundRoute?c.push(this.options.notFoundRoute):l=!0);u!=null&&u.parentRoute;)u=u.parentRoute,u&&c.unshift(u);const p=(()=>
17{if(l){if(this.options.notFoundMode!=="root")for(let m=c.length-1;m>=0;m--){const f=c[m];if(f.children)return f.id}return tt}})(),d=c.map(m=>{let f;if(m.options.parseParams)try{const h=m.options.parseParams(n);Object.assign(n,h)}catch(h){if(f=new jn(h.message,{cause:h}),i!=null&&i.throwOnError)throw f;return f}}),b=[];return c.forEach((m,f)=>{var h,v,g,w,R,y;const _=b[f-1],[C,F]=(()=>{const Y=(_==null?void 0:_.search)??r;try{const ut=typeof m.options.validateSearch=="object"?m.options.validateSearch.parse:m.options.validateSearch;let A=(ut==null?void 0:ut(Y))??{};return[{...Y,...A},void 0]}catch(ut){const A=new Dn(ut.message,{cause:ut});if(i!=null&&i.throwOnError)throw A;return[Y,A]}})(),L=((v=(h=m.options).loaderDeps)==null?void 0:v.call(h,{search:C}))??"",x=L?JSON.stringify(L):"",T=He({path:m.fullPath,params:n}),U=He({path:m.id,params:n,leaveWildcards:!0})+x;let k=js(this.state,U);const B=this.state.matches.find(Y=>Y.id===U)?"stay":"enter",$=k?{...k,cause:B,params:n}:{id:U,routeId:m.id,params:n,pathname:Ft([this.basepath,T]),updatedAt:Date.now(),search:{},searchError:void 0,status:"pending",showPending:!1,isFetching:!1,error:void 0,paramsError:d[f],loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:L,invalid:!1,preload:!1,links:(w=(g=m.options).links)==null?void 0:w.call(g),scripts:(y=(R=m.options).scripts)==null?void 0:y.call(R),staticData:m.options.staticData||{}};i!=null&&i.preload||($.globalNotFound=p===m.id),$.search=gt($.search,C),$.searchError=F,b.push($)}),b},this.cancelMatch=s=>{},this.cancelMatches=()=>{var s;(s=this.state.pendingMatches)==null||s.forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=s=>{const r=(n={},o)=>{var u,c,l;const p=this.state.pendingMatches||this.state.matches,d=((u=p[p.length-1])==null?void 0:u.search)||this.latestLocation.search,b=this.matchRoutes(this.latestLocation.pathname,d),m=o==null?void 0:o.filter(k=>b==null?void 0:b.find(B=>B.routeId===k.routeId)),f=this.looseRoutesById[(c=Fe(b))==null?void 0:c.routeId];let h=n.to?this.resolvePathWithBase(n.from??this.latestLocation.pathname,`${n.to}`):f==null?void 0:f.fullPath;const v={...(l=Fe(b))==null?void 0:l.params};let g=(n.params??!0)===!0?v:{...v,...Gt(n.params,v)};g&&(o==null||o.map(k=>this.looseRoutesById[k.routeId].options.stringifyParams).filter(Boolean).forEach(k=>{g={...g,...k(g)}})),h=He({path:h,params:g??{},leaveWildcards:!1,leaveParams:s.leaveParams});
17const w=(m==null?void 0:m.map(k=>this.looseRoutesById[k.routeId].options.preSearchFilters??[]).flat().filter(Boolean))??[],R=(m==null?void 0:m.map(k=>this.looseRoutesById[k.routeId].options.postSearchFilters??[]).flat().filter(Boolean))??[],y=w!=null&&w.length?w==null?void 0:w.reduce((k,B)=>B(k),d):d,_=n.search===!0?y:n.search?Gt(n.search,y)??{}:w!=null&&w.length?y:{},C=R!=null&&R.length?R.reduce((k,B)=>B(k),_):_,F=gt(d,C),L=this.options.stringifySearch(F),x=n.hash===!0?this.latestLocation.hash:n.hash?Gt(n.hash,this.latestLocation.hash):void 0,T=x?`#${x}`:"";let U=n.state===!0?this.latestLocation.state:n.state?Gt(n.state,this.latestLocation.state):{};return U=gt(this.latestLocation.state,U),{pathname:h,search:F,searchStr:L,state:U,hash:x??"",href:`${h}${L}${T}`,unmaskOnReload:n.unmaskOnReload}},i=(n={},o)=>{var u;let c=r(n),l=o?r(o):void 0;if(!l){let f={},h=(u=this.options.routeMasks)==null?void 0:u.find(v=>{const g=ze(this.basepath,c.pathname,{to:v.from,caseSensitive:!1,fuzzy:!1});return g?(f=g,!0):!1});h&&(o={...fe(s,["from"]),...h,params:f},l=r(o))}const p=this.matchRoutes(c.pathname,c.search),d=l?this.matchRoutes(l.pathname,l.search):void 0,b=l?r(o,d):void 0,m=r(n,p);return b&&(m.maskedLocation=b),m};return s.mask?i(s,{...fe(s,["from"]),...s.mask}):i(s)},this.commitLocation=async({startTransition:s,...r})=>
17{if(this.navigateTimeout&&clearTimeout(this.navigateTimeout),!(this.latestLocation.href===r.href)){let{maskedLocation:n,...o}=r;n&&(o={...n,state:{...n.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey));const u=()=>{this.history[r.replace?"replace":"push"](o.href,o.state)};s??!0?this.startReactTransition(u):u()}return this.resetNextScroll=r.resetScroll??!0,this.latestLoadPromise},this.buildAndCommitLocation=({replace:s,resetScroll:r,startTransition:i,...n}={})=>{const o=this.buildLocation(n);return this.commitLocation({...o,startTransition:i,replace:s,resetScroll:r})},this.navigate=({from:s,to:r,...i})=>{const n=String(r);let o;try{new URL(`${n}`),o=!0}catch{}return G(!o),this.buildAndCommitLocation({...i,from:s,to:r})},this.loadMatches=async({checkLatest:s,location:r,matches:i,preload:n})=>{var o,u;let c,l;const p=(f,h)=>{var v;const g=(v=this.state.pendingMatches)==null?void 0:v.find(y=>y.id===f.id),w=this.state.matches.find(y=>y.id===f.id),R=g?"pendingMatches":w?"matches":"cachedMatches";this.__store.setState(y=>{var _;return{...y,[R]:(_=y[R])==null?void 0:_.map(C=>C.id===f.id?f:C)}})},d=(f,h)=>{throw f={...f,status:lt(h)?"redirected":ht(h)?"notFound":"error",isFetching:!1,error:h},p(f),h.routeId||(h.routeId=f.routeId),h};for(let[f,h]of i.entries()){const v=i[f-1],g=this.looseRoutesById[h.routeId],w=new AbortController,R=(y,_)=>{var C,F;y.routerCode=_,l=l??f,(lt(y)||ht(y))&&d(h,y);try{(F=(C=g.options).onError)==null||F.call(C,y)}
17catch(L){y=L,(lt(y)||ht(y))&&d(h,L)}i[f]=h={...h,error:y,status:"error",updatedAt:Date.now(),abortController:new AbortController}};h.paramsError&&R(h.paramsError,"PARSE_PARAMS"),h.searchError&&R(h.searchError,"VALIDATE_SEARCH");try{const y=(v==null?void 0:v.context)??this.options.context??{},_=g.options.pendingMs??this.options.defaultPendingMs,C=typeof _=="number"&&_<=0?Promise.resolve():new Promise(x=>setTimeout(x,_)),F=await((u=(o=g.options).beforeLoad)==null?void 0:u.call(o,{search:h.search,abortController:w,params:h.params,preload:!!n,context:y,location:r,navigate:x=>this.navigate({...x,from:h.pathname}),buildLocation:this.buildLocation,cause:n?"preload":h.cause}))??{};(lt(F)||ht(F))&&R(F,"BEFORE_LOAD");const L={...y,...F};i[f]=h={...h,routeContext:gt(h.routeContext,F),context:gt(h.context,L),abortController:w,pendingPromise:C}}catch(y){R(y,"BEFORE_LOAD");break}}const b=i.slice(0,l),m=[];return b.forEach((f,h)=>{m.push(new Promise(async(v,g)=>{var w;const R=m[h-1],y=this.looseRoutesById[f.routeId],_=A=>{(lt(A)||ht(A))&&d(f,A)};let C;i[h]=f={...f,showPending:!1};let F=!1;const L=y.options.pendingMs??this.options.defaultPendingMs,x=y.options.pendingMinMs??this.options.defaultPendingMinMs,T={params:f.params,deps:f.loaderDeps,preload:!!n,parentMatchPromise:R,abortController:f.abortController,context:f.context,location:r,navigate:A=>this.navigate({...A,from:f.pathname}),cause:n?"preload":f.cause,route:y},U=async()=>{var A,$t,Lt,le,Se,Re,we,mt,Ht,zt;try{if(f.isFetching)C=(A=js(this.state,f.id))==null?void 0:A.loadPromise;else{i[h]=f={...f,isFetching:!0,fetchCount:f.fetchCount+1};const Wt=(($t=y.lazyFn)==null?void 0:$t.call(y).then(It=>{Object.assign(y.options,It.options)}))||Promise.resolve(),je=Wt.then(()=>Promise.all(In.map(async It=>{const he=y.options[It];he!=null&&he.preload&&await he.preload()}))),ke=(le=(Lt=y.options).loader)==null?void 0:le.call(Lt,T);C=Promise.all([je,ke,Wt]).then(It=>It[1])}i[h]=f={...f,loadPromise:C},p(f);const D=await C;if(c=s())return await c;if(_(D),F&&x&&await new Promise(Wt=>setTimeout(Wt,x)),c=s())return await c;const[q,Pe]=await Promise.all([(Re=(Se=y.options).meta)==null?void 0:Re.call(Se,{params:f.params,loaderData:D}),(mt=(we=y.options).headers)==null?void 0:mt.call(we,{loaderData:D})]);i[h]=f={...f,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:D,loadPromise:void 0,meta:q,headers:Pe}}catch(D){if(c=s())return await c;_(D);try{(zt=(Ht=y.options).onError)==null||zt.call(Ht,D)}catch(q){D=q,_(q)}i[h]=f={...f,error:D,status:"error",isFetching:!1}}p(f)},k=Date.now()-f.updatedAt;let B=n?y.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:y.options.staleTime??this.options.defaultStaleTime??0,$;const Y=y.options.shouldReload;if($=typeof Y=="function"?Y(T):Y,i[h]=f={...f,preload:!!n&&!this.state.matches.find(A=>A.id===f.id)},f.status==="success"&&(f.invalid||($??k>B)))return(async()=>{try{await U()}
17catch(A){if(console.info("Background Fetching Error",A),lt(A)){const $t=(this.state.pendingMatches||this.state.matches).find(Lt=>Lt.id===f.id);_(A),$t&&this.handleRedirect(A)}}})(),v();const ut=!n&&typeof L=="number"&&(y.options.pendingComponent??this.options.defaultPendingComponent);if(f.status!=="success")try{ut&&((w=f.pendingPromise)==null||w.then(async()=>{if(c=s())return c;F=!0,i[h]=f={...f,showPending:!0},p(f),v()})),await U()}catch(A){g(A)}v()}))}),await Promise.all(m),i},this.invalidate=()=>{const s=r=>({...r,invalid:!0});this.__store.setState(r=>{var i;return{...r,matches:r.matches.map(s),cachedMatches:r.cachedMatches.map(s),pendingMatches:(i=r.pendingMatches)==null?void 0:i.map(s)}}),this.load()},this.load=async()=>{const s=new Promise(async(r,i)=>{const n=this.latestLocation,o=this.state.resolvedLocation,u=o.href!==n.href;let c;this.cancelMatches(),this.emit({type:"onBeforeLoad",fromLocation:o,toLocation:n,pathChanged:u});let l;const p=this.state.matches;this.__store.batch(()=>{this.cleanCache(),l=this.matchRoutes(n.pathname,n.search,{debug:!0}),this.__store.setState(d=>({...d,isLoading:!0,location:n,pendingMatches:l,cachedMatches:d.cachedMatches.filter(b=>!l.find(m=>m.id===b.id))}
17))});try{let d,b;try{await this.loadMatches({matches:l,location:n,checkLatest:()=>this.checkLatest(s)})}catch(v){lt(v)?(d=v,this.handleRedirect(v)):ht(v)&&(b=v,this.handleNotFound(l,v))}if(c=this.checkLatest(s))return c;const m=p.filter(v=>!l.find(g=>g.id===v.id)),f=l.filter(v=>!p.find(g=>g.id===v.id)),h=p.filter(v=>l.find(g=>g.id===v.id));this.__store.batch(()=>{this.__store.setState(v=>({...v,isLoading:!1,matches:v.pendingMatches,pendingMatches:void 0,cachedMatches:[...v.cachedMatches,...m.filter(g=>g.status!=="error")],statusCode:d!=null&&d.code||b?404:v.matches.some(g=>g.status==="error")?500:200})),this.cleanCache()}),[[m,"onLeave"],[f,"onEnter"],[h,"onStay"]].forEach(([v,g])=>{v.forEach(w=>{var R,y;(y=(R=this.looseRoutesById[w.routeId].options)[g])==null||y.call(R,w)})}),this.emit({type:"onLoad",fromLocation:o,toLocation:n,pathChanged:u}),r()}catch(d){if(c=this.checkLatest(s))return c;console.log("Load Error",d),i(d)}});return this.latestLoadPromise=s,this.latestLoadPromise},this.handleRedirect=s=>{s.href||(s.href=this.buildLocation(s).href),dr||this.navigate({...s,replace:!0})},this.cleanCache=()=>{this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!1;const n=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status!=="error"&&Date.now()-r.updatedAt<n})}))},this.preloadRoute=async s=>{var r;let i=this.buildLocation(s),n=this.matchRoutes(i.pathname,i.search,{throwOnError:!0,preload:!0});const o=Object.fromEntries((r=[...this.state.matches,...this.state.pendingMatches??[],...this.state.cachedMatches])==null?void 0:r.map(u=>[u.id,!0]));this.__store.batch(()=>{n.forEach(u=>{o[u.id]||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,u]}))})});try{return n=await this.loadMatches({matches:n,location:i,preload:!0,checkLatest:()=>{}}),n}catch(u){if(lt(u))return await this.preloadRoute(u);console.error(u);return}},this.matchRoute=(s,r)=>{const i={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},n=this.buildLocation(i);if(r!=null&&r.pending&&this.state.status!=="pending")return!1;const o=r!=null&&r.pending?this.latestLocation:this.state.resolvedLocation;if(!o)return!1;const u=ze(this.basepath,o.pathname,{...r,to:n.pathname});return!u||s.params&&!ye(u,s.params,!0)?!1:u&&((r==null?void 0:r.includeSearch)??!0)?ye(o.search,n.search,!0)?u:!1:u},this.injectHtml=async s=>{this.injectedHtml.push(s)},this.registeredDeferredsIds=new Map,this.registeredDeferreds=new WeakMap,this.getDeferred=s=>{const r=this.registeredDeferredsIds.get(s);if(r)return this.registeredDeferreds.get(r)},this.dehydrateData=(s,r)=>{if(typeof document>"u"){const i=typeof s=="string"?s:JSON.stringify(s);return this.injectHtml(async()=>{const n=`__TSR_DEHYDRATED__${i}`,o=typeof r=="function"?await r():r;return`<script id='${n}' suppressHydrationWarning> 18 window["__TSR_DEHYDRATED__${un(i)}"] = ${JSON.stringify(this.options.transformer.stringify(o))} 19<\/script>`}),()=>this.hydrateData(s)}return()=>{}},this.hydrateData=s=>{if(typeof document<"u"){const r=typeof s=="string"?s:JSON.stringify(s);return this.options.transformer.parse(window[`__TSR_DEHYDRATED__${r}`])}},this.dehydrate=()=>{var s;const r=((s=this.options.errorSerializer)==null?void 0:s.serialize)??An;return{state:{dehydratedMatches:this.state.matches.map(i=>({...fe(i,["id","status","updatedAt","loaderData"]),error:i.error?{data:r(i.error),__isServerError:!0}:void 0}))}}},this.hydrate=async s=>{var r,i,n;let o=s;typeof document<"u"&&(o=(r=window.__TSR_DEHYDRATED__)==null?void 0:r.data),G(o);const u=this.options.transformer.parse(o);this.dehydratedData=u.payload,(n=(i=this.options).hydrate)==null||n.call(i,u.payload);const c=u.router.state;let l=this.matchRoutes(this.state.location.pathname,this.state.location.search).map(p=>{var d,b,m,f,h,v;const g=c.dehydratedMatches.find(w=>w.id===p.id);if(G(g,`Could not find a client-side match for dehydrated match with id: ${p.id}!`),g){const w=this.looseRoutesById[p.routeId];return{...p,...g,meta:(b=(d=w.options).meta)==null?void 0:b.call(d,{params:p.params,loaderData:g.loaderData}),links:(f=(m=w.options).links)==null?void 0:f.call(m),scripts:(v=(h=w.options).scripts)==null?void 0:v.call(h)}}return p});this.__store.setState(p=>({...p,matches:l,lastUpdated:Date.now()}))},this.handleNotFound=(s,r)=>{const i=Object.fromEntries(s.map(u=>[u.routeId,u]));let n=(r.global?this.looseRoutesById[tt]:this.looseRoutesById[r.routeId])||this.looseRoutesById[tt];for(;!n.options.notFoundComponent&&!this.options.defaultNotFoundComponent&&n.id!==tt;)n=n==null?void 0:n.parentRoute,G(n);let o=i[n.id];G(o,"Could not find match for route: "+n.id),Object.assign(o,{status:"notFound",error:r,isFetching:!1})},this.hasNotFoundMatch=()=>this.__store.state.matches.some(s=>s.status==="notFound"||s.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,stringifySearch:(t==null?void 0:t.stringifySearch)??xn,parseSearch:(t==null?void 0:t.parseSearch)??En,transformer:(t==null?void 0:t.transformer)??JSON}),typeof document<"u"&&(window.__TSR__ROUTER__=this)}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}}
19class Dn extends Error{}class jn extends Error{}function kn(e){return{isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:{...e},location:e,matches:[],pendingMatches:[],cachedMatches:[],lastUpdated:0,statusCode:200}}function An(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function Zn(e){return new Qn(e,{silent:!0}).createRoute}class Qn{constructor(t,s){this.path=t,this.createRoute=r=>{this.silent;const i=wn(r);return i.isRoot=!1,i},this.silent=s==null?void 0:s.silent}}const Un="Error preloading route! âï¸";function Bn(e){const t=yt(),s=Nt({strict:!1,select:D=>D.pathname}),{activeProps:r=()=>({className:"active"}),inactiveProps:i=()=>({}),activeOptions:n,hash:o,search:u,params:c,to:l,state:p,mask:d,preload:b,preloadDelay:m,replace:f,startTransition:h,resetScroll:v,children:g,target:w,disabled:R,style:y,className:_,onClick:C,onFocus:F,onMouseEnter:L,onMouseLeave:x,onTouchStart:T,...U}=e,k={from:e.to?s:void 0,...e};let B="internal";try{new URL(`${l}`),B="external"}catch{}const $=t.buildLocation(k),Y=b??t.options.defaultPreload,ut=m??t.options.defaultPreloadDelay??0,A=et({select:D=>{const q=D.location.pathname.split("/"),Wt=$.pathname.split("/").every((he,mr)=>he===q[mr]),je=n!=null&&n.exact?D.location.pathname===$.pathname:Wt,ke=n!=null&&n.includeHash?D.location.hash===$.hash:!0,It=(n==null?void 0:n.includeSearch)??!0?ye(D.location.search,$.search,!(n!=null&&n.exact)):!0;return je&&ke&&It}});if(B==="external")return{...U,type:B,href:l,children:g,target:w,disabled:R,style:y,className:_,onClick:C,onFocus:F,onMouseEnter:L,onMouseLeave:x,onTouchStart:T};const $t=D=>{!R&&!qn(D)&&!D.defaultPrevented&&(!w||w==="_self")&&D.button===0&&(D.preventDefault(),t.commitLocation({...$,replace:f,resetScroll:v,startTransition:h}))},Lt=()=>{O.startTransition(()=>{t.preloadRoute(k).catch(D=>{console.warn(D),console.warn(Un)})})},le=D=>{R||Y&&Lt()},Se=le,Re=D=>{if(R)return;const q=D.target||{};if(Y){if(q.preloadTimeout)return;q.preloadTimeout=setTimeout(()=>{q.preloadTimeout=null,Lt()},ut)}},we=D=>{if(R)return;const q=D.target||{};q.preloadTimeout&&(clearTimeout(q.preloadTimeout),q.preloadTimeout=null)},mt=D=>q=>{q.persist&&q.persist(),D.filter(Boolean).forEach(Pe=>{q.defaultPrevented||Pe(q)})},Ht=A?Gt(r,{})??{}:{},zt=A?{}:Gt(i,{})??{};return{...Ht,...zt,...U,href:R?void 0:$.maskedLocation?$.maskedLocation.href:$.href,onClick:mt([C,$t]),onFocus:mt([F,le]),onMouseEnter:mt([L,Re]),onMouseLeave:mt([x,we]),onTouchStart:mt([T,Se]),target:w,style:{...y,...Ht.style,...zt.style},className:[_,Ht.className,zt.className].filter(Boolean).join(" ")||void 0,...R?{role:"link","aria-disabled":!0}:void 0,"data-status":A?"active":void 0}}const ti=O.forwardRef((e,t)=>{const{type:s,...r}=Bn(e),i=typeof e.children=="function"?e.children({isActive:r["data-status"]==="active"}):e.children;return M.jsx("a",{...r,ref:t,children:i})});function qn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ei(e){const{navigate:t}=yt(),s=Nt({strict:!1,select:i=>i.pathname}),r=({from:i,...n})=>t({from:n!=null&&n.to?s:void 0,...n});return O.useCallback(r,[])}export{ti as L,Fr as M,dn as O,Hn as Q,Yn as R,ir as a,Wn as b,Jn as c,Gn as d,Zn as e,Rn as f,Mr as g,Xn as h,zn as i,Vn as r,ei as u};
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.