PageSourceSearch

https://static.nyse.com/cms/41.10.14/chunks/node_modules/-pnpm/rea…/dist/index-js-commonjs-proxy-Bgcd1cR8.js

js nyse.com collected 2026-09-24 15:17:03 UTC 119,235 bytes, 1 lines download raw bytes

1import{a as R,R as qa,r as Ba,b as Ha}from"../../../../../../__generated__/components/demos-sg-pcOZb.js";function k(){return k=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},k.apply(this,arguments)}var V;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(V||(V={}));const Hr="popstate";function hr(t){t===void 0&&(t={});let{initialEntries:e=["/"],initialIndex:r,v5Compat:n=!1}=t,a;a=e.map((u,m)=>p(u,typeof u=="string"?null:u.state,m===0?"default":void 0));let i=o(r==null?a.length-1:r),s=V.Pop,l=null;function o(u){return Math.min(Math.max(u,0),a.length-1)}function d(){return a[i]}function p(u,m,b){m===void 0&&(m=null);let E=we(a?d().pathname:"/",u,m,b);return me(E.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(u)),E}function h(u){return typeof u=="string"?u:fe(u)}return{get index(){return i},get action(){return s},get location(){return d()},createHref:h,createURL(u){return new URL(h(u),"http://localhost")},encodeLocation(u){let m=typeof u=="string"?se(u):u;return{pathname:m.pathname||"",search:m.search||"",hash:m.hash||""}},push(u,m){s=V.Push;let b=p(u,m);i+=1,a.splice(i,a.length,b),n&&l&&l({action:s,location:b,delta:1})},replace(u,m){s=V.Replace;let b=p(u,m);a[i]=b,n&&l&&l({action:s,location:b,delta:0})},go(u){s=V.Pop;let m=o(i+u),b=a[m];i=m,l&&l({action:s,location:b,delta:u})},listen(u){return l=u,()=>{l=null}}}}function ka(t){t===void 0&&(t={});function e(n,a){let{pathname:i,search:s,hash:l}=n.location;return we("",{pathname:i,search:s,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:fe(a)}return vn(e,r,null,t)}function za(t){t===void 0&&(t={});function e(a,i){let{pathname:s="/",search:l="",hash:o=""}=se(a.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),we("",{pathname:s,search:l,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(a,i){let s=a.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let o=a.location.href,d=o.indexOf("#");l=d===-1?o:o.slice(0,d)}return l+"#"+(typeof i=="string"?i:fe(i))}function n(a,i){me(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return vn(e,r,n,t)}function A(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function me(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Ka(){return Math.random().toString(36).substr(2,8)}function kr(t,e){return{usr:t.state,key:t.key,idx:e}}function we(t,e,r,n){return r===void 0&&(r=null),k({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?se(e):e,{state:r,key:e&&e.key||n||Ka()})}function fe(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function se(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function vn(t,e,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,l=V.Pop,o=null,d=p();d==null&&(d=0,s.replaceState(k({},s.state,{idx:d}),""));function p(){return(s.state||{idx:null}).idx}function h(){l=V.Pop;let E=p(),D=E==null?null:E-d;d=E,o&&o({action:l,location:b.location,delta:D})}function v(E,D){l=V.Push;let P=we(b.location,E,D);r&&r(P,E),d=p()+1;let O=kr(P,d),S=b.createHref(P);try{s.pushState(O,"",S)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;a.location.assign(S)}i&&o&&o({action:l,location:b.location,delta:1})}function u(E,D){l=V.Replace;let P=we(b.location,E,D);r&&r(P,E),d=p();let O=kr(P,d),S=b.createHref(P);s.replaceState(O,"",S),i&&o&&o({action:l,location:b.location,delta:0})}function m(E){let D=a.location.origin!=="null"?a.location.origin:a.location.href,P=typeof E=="string"?E:fe(E);return P=P.replace(/ $/,"%20"),A(D,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,D)}let b={get action(){return l},get location(){return t(a,s)},listen(E){if(o)throw new Error("A history only accepts one active listener");return a.addEventListener(Hr,h),o=E,()=>{a.removeEventListener(Hr,h),o=null}},createHref(E){return e(a,E)},createURL:m,encodeLocation(E){let D=m(E);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:v,replace:u,go(E){return s.go(E)}};return b}var H;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(H||(H={}));
1const Wa=new Set(["lazy","caseSensitive","path","id","index","children"]);function Va(t){return t.index===!0}function tt(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((a,i)=>{let s=[...r,String(i)],l=typeof a.id=="string"?a.id:s.join("-");if(A(a.index!==!0||!a.children,"Cannot specify children on an index route"),A(!n[l],'Found a route id collision on id "'+l+"\".  Route id's must be globally unique within Data Router usages"),Va(a)){let o=k({},a,e(a),{id:l});return n[l]=o,o}else{let o=k({},a,e(a),{id:l,children:void 0});return n[l]=o,a.children&&(o.children=tt(a.children,e,s,n)),o}})}function he(t,e,r){return r===void 0&&(r="/"),Lt(t,e,r,!1)}function Lt(t,e,r,n){let a=typeof e=="string"?se(e):e,i=Le(a.pathname||"/",r);if(i==null)return null;let s=mn(t);Ga(s);let l=null;for(let o=0;l==null&&o<s.length;++o){let d=pr(i);l=ni(s[o],d,n)}return l}function fr(t,e){let{route:r,pathname:n,params:a}=t;return{id:r.id,pathname:n,params:a,data:e[r.id],handle:r.handle}}function mn(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,s,l)=>{let o={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};o.relativePath.startsWith("/")&&(A(o.relativePath.startsWith(n),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(n.length));let d=ve([n,o.relativePath]),p=r.concat(o);i.children&&i.children.length>0&&(A(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),mn(i.children,e,p,d)),!(i.path==null&&!i.index)&&e.push({path:d,score:ti(d,i.index),routesMeta:p})};return t.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,s);else for(let o of gn(i.path))a(i,s,o)}),e}function gn(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=gn(n.join("/")),l=[];return l.push(...s.map(o=>o===""?i:[i,o].join("/"))),a&&l.push(...s),l.map(o=>t.startsWith("/")&&o===""?"/":o)}function Ga(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:ri(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Ja=/^:[\w-]+$/,Ya=3,$a=2,Xa=1,Za=10,ei=-2,zr=t=>t==="*";function ti(t,e){let r=t.split("/"),n=r.length;return r.some(zr)&&(n+=ei),e&&(n+=$a),r.filter(a=>!zr(a)).reduce((a,i)=>a+(Ja.test(i)?Ya:i===""?Xa:Za),n)}function ri(t,e){return t.length===e.length&&t.slice(0,-1).every((n,a)=>n===e[a])?t[t.length-1]-e[e.length-1]:0}function ni(t,e,r){r===void 0&&(r=!1);let{routesMeta:n}=t,a={},i="/",s=[];for(let l=0;l<n.length;++l){let o=n[l],d=l===n.length-1,p=i==="/"?e:e.slice(i.length)||"/",h=dt({path:o.relativePath,caseSensitive:o.caseSensitive,end:d},p),v=o.route;if(!h&&d&&r&&!n[n.length-1].route.index&&(h=dt({path:o.relativePath,caseSensitive:o.caseSensitive,end:!1},p)),!h)return null;
1Object.assign(a,h.params),s.push({params:a,pathname:ve([i,h.pathname]),pathnameBase:En(ve([i,h.pathnameBase])),route:v}),h.pathnameBase!=="/"&&(i=ve([i,h.pathnameBase]))}return s}function bn(t,e){e===void 0&&(e={});let r=t;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(me(!1,'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".')),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=s=>s==null?"":typeof s=="string"?s:String(s),i=r.split(/\/+/).map((s,l,o)=>{if(l===o.length-1&&s==="*")return a(e["*"]);const p=s.match(/^:([\w-]+)(\??)$/);if(p){const[,h,v]=p;let u=e[h];return A(v==="?"||u!=null,'Missing ":'+h+'" param'),a(u)}return s.replace(/\?$/g,"")}).filter(s=>!!s);return n+i.join("/")}function dt(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=ai(t.path,t.caseSensitive,t.end),a=e.match(r);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((d,p,h)=>{let{paramName:v,isOptional:u}=p;if(v==="*"){let b=l[h]||"";s=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const m=l[h];return u&&!m?d[v]=void 0:d[v]=(m||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:s,pattern:t}}function ai(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),me(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,o)=>(n.push({paramName:l,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),n]}function pr(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return me(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Le(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function yr(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:a=""}=typeof t=="string"?se(t):t;return{pathname:r?r.startsWith("/")?r:ii(r,e):e,search:oi(n),hash:li(a)}}function ii(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Vt(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Rn(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function yt(t,e){let r=Rn(t);return e?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function vt(t,e,r,n){n===void 0&&(n=!1);let a;typeof t=="string"?a=se(t):(a=k({},t),A(!a.pathname||!a.pathname.includes("?"),Vt("?","pathname","search",a)),A(!a.pathname||!a.pathname.includes("#"),Vt("#","pathname","hash",a)),A(!a.search||!a.search.includes("#"),Vt("#","search","hash",a)));let i=t===""||a.pathname==="",s=i?"/":a.pathname,l;if(s==null)l=r;else{let h=e.length-1;if(!n&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),h-=1;a.pathname=v.join("/")}l=h>=0?e[h]:"/"}let o=yr(a,l),d=s&&s!=="/"&&s.endsWith("/"),p=(i||s===".")&&r.endsWith("/");return!o.pathname.endsWith("/")&&(d||p)&&(o.pathname+="/"),o}function si(t){return t===""||t.pathname===""?"/":typeof t=="string"?se(t).pathname:t.pathname}const ve=t=>t.join("/").replace(/\/\/+/g,"/"),En=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),oi=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,li=t=>
vendor: 2,644 bytes, line 1
1!t||t==="#"?"":t.startsWith("#")?t:"#"+t,wn=function(e,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r,a=new Headers(n.headers);return a.has("Content-Type")||a.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),k({},n,{headers:a}))};class ui{constructor(e,r){this.type="DataWithResponseInit",this.data=e,this.init=r||null}}function ci(t,e){return new ui(t,typeof e=="number"?{status:e}:e)}class ht extends Error{}class Sn{constructor(e,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],A(e&&typeof e=="object"&&!Array.isArray(e),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((i,s)=>n=s),this.controller=new AbortController;let a=()=>n(new ht("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(e).reduce((i,s)=>{let[l,o]=s;return Object.assign(i,{[l]:this.trackPromise(l,o)})},{}),this.done&&this.unlistenAbortSignal(),this.init=r}trackPromise(e,r){if(!(r instanceof Promise))return r;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let n=Promise.race([r,this.abortPromise]).then(a=>this.onSettle(n,e,void 0,a),a=>this.onSettle(n,e,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(e,r,n,a){if(this.controller.signal.aborted&&n instanceof ht)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n===void 0&&a===void 0){let i=new Error('Deferred data for key "'+r+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>i}),this.emit(!1,r),Promise.reject(i)}return a===void 0?(Object.defineProperty(e,"_error",{get:()=>n}),this.emit(!1,r),Promise.reject(n)):(Object.defineProperty(e,"_data",{get:()=>a}),this.emit(!1,r),a)}emit(e,r){this.subscribers.forEach(n=>n(e,r))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((e,r)=>this.pendingKeysSet.delete(r)),this.emit(!0)}async resolveData(e){let r=!1;if(!this.done){let n=()=>this.cancel();e.addEventListener("abort",n),r=await new Promise(a=>{this.subscribe(i=>{e.removeEventListener("abort",n),(i||this.done)&&a(i)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return A(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((e,r)=>
1{let[n,a]=r;return Object.assign(e,{[n]:hi(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function di(t){return t instanceof Promise&&t._tracked===!0}function hi(t){if(!di(t))return t;if(t._error)throw t._error;return t._data}const Pn=function(e,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new Sn(e,n)},Bt=function(e,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status>"u"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",e),new Response(null,k({},n,{headers:a}))},Cn=(t,e)=>{let r=Bt(t,e);return r.headers.set("X-Remix-Reload-Document","true"),r},xn=(t,e)=>{let r=Bt(t,e);return r.headers.set("X-Remix-Replace","true"),r};class It{constructor(e,r,n,a){a===void 0&&(a=!1),this.status=e,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Se(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const On=["post","put","patch","delete"],fi=new Set(On),pi=["get",...On],yi=new Set(pi),vi=new Set([301,302,303,307,308]),mi=new Set([307,308]),Ut={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},He={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},vr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mn=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Fn="remix-router-transitions";function Ln(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;A(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(t.mapRouteProperties)a=t.mapRouteProperties;else if(t.detectErrorBoundary){let c=t.detectErrorBoundary;a=y=>({hasErrorBoundary:c(y)})}else a=Mn;let i={},s=tt(t.routes,a,void 0,i),l,o=t.basename||"/",d=t.dataStrategy||An,p=t.patchRoutesOnNavigation,h=k({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),v=null,u=new Set,m=null,b=null,E=null,D=t.hydrationData!=null,P=he(s,t.history.location,o),O=!1,S=null;if(P==null&&!p){let c=Y(404,{pathname:t.history.location.pathname}),{matches:y,route:g}=At(s);P=y,S={[g.id]:c}}P&&!t.hydrationData&&xt(P,s,t.history.location.pathname).active&&(P=null);let Q;if(P)if(P.some(c=>c.route.lazy))Q=!1;else if(!P.some(c=>c.route.loader))Q=!0;else if(h.v7_partialHydration){let c=t.hydrationData?t.hydrationData.loaderData:null,y=t.hydrationData?t.hydrationData.errors:null;if(y){let g=P.findIndex(w=>y[w.route.id]!==void 0);Q=P.slice(0,g+1).every(w=>!Zt(w.route,c,y))}else Q=P.every(g=>!Zt(g.route,c,y))}else Q=t.hydrationData!=null;else if(Q=!1,P=[],h.v7_partialHydration){let c=xt(null,s,t.history.location.pathname);c.active&&c.matches&&(O=!0,P=c.matches)}let T,f={historyAction:t.history.action,location:t.history.location,matches:P,initialized:Q,navigation:Ut,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||S,fetchers:new Map,blockers:new Map},C=V.Pop,_=!1,q,W=!1,ne=new Map,oe=null,We=!1,je=!1,Rt=[],Et=new Set,ee=new Map,wt=0,at=-1,Ve=new Map,ge=new Set,Ge=new Map,it=new Map,de=new Set,Qe=new Map,_e=new Map,St;function Sa(){if(v=t.history.listen(c=>{let{action:y,location:g,delta:w}=c;if(St){St(),St=void 0;return}me(_e.size===0||w!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let x=_r({currentLocation:f.location,nextLocation:g,historyAction:y});if(x&&w!=null){let I=new Promise(j=>{St=j});t.history.go(w*-1),Ct(x,{state:"blocked",location:g,proceed(){Ct(x,{state:"proceeding",proceed:void 0,reset:void 0,location:g}),I.then(()=>t.history.go(w))},reset(){let j=new Map(f.blockers);
1j.set(x,He),ae({blockers:j})}});return}return Ne(y,g)}),r){Li(e,ne);let c=()=>Ui(e,ne);e.addEventListener("pagehide",c),oe=()=>e.removeEventListener("pagehide",c)}return f.initialized||Ne(V.Pop,f.location,{initialHydration:!0}),T}function Pa(){v&&v(),oe&&oe(),u.clear(),q&&q.abort(),f.fetchers.forEach((c,y)=>Pt(y)),f.blockers.forEach((c,y)=>Qr(y))}function Ca(c){return u.add(c),()=>u.delete(c)}function ae(c,y){y===void 0&&(y={}),f=k({},f,c);let g=[],w=[];h.v7_fetcherPersist&&f.fetchers.forEach((x,I)=>{x.state==="idle"&&(de.has(I)?w.push(I):g.push(I))}),de.forEach(x=>{!f.fetchers.has(x)&&!ee.has(x)&&w.push(x)}),[...u].forEach(x=>x(f,{deletedFetchers:w,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),h.v7_fetcherPersist?(g.forEach(x=>f.fetchers.delete(x)),w.forEach(x=>Pt(x))):w.forEach(x=>de.delete(x))}function Je(c,y,g){var w,x;let{flushSync:I}=g===void 0?{}:g,j=f.actionData!=null&&f.navigation.formMethod!=null&&ce(f.navigation.formMethod)&&f.navigation.state==="loading"&&((w=c.state)==null?void 0:w._isRedirect)!==!0,F;y.actionData?Object.keys(y.actionData).length>0?F=y.actionData:F=null:j?F=f.actionData:F=null;let L=y.loaderData?Zr(f.loaderData,y.loaderData,y.matches||[],y.errors):f.loaderData,M=f.blockers;M.size>0&&(M=new Map(M),M.forEach((B,te)=>M.set(te,He)));let U=_===!0||f.navigation.formMethod!=null&&ce(f.navigation.formMethod)&&((x=c.state)==null?void 0:x._isRedirect)!==!0;l&&(s=l,l=void 0),We||C===V.Pop||(C===V.Push?t.history.push(c,c.state):C===V.Replace&&t.history.replace(c,c.state));let N;if(C===V.Pop){let B=ne.get(f.location.pathname);B&&B.has(c.pathname)?N={currentLocation:f.location,nextLocation:c}:ne.has(c.pathname)&&(N={currentLocation:c,nextLocation:f.location})}else if(W){let B=ne.get(f.location.pathname);B?B.add(c.pathname):(B=new Set([c.pathname]),ne.set(f.location.pathname,B)),N={currentLocation:f.location,nextLocation:c}}ae(k({},y,{actionData:F,loaderData:L,historyAction:C,location:c,initialized:!0,navigation:Ut,revalidation:"idle",restoreScrollPosition:qr(c,y.matches||f.matches),preventScrollReset:U,blockers:M}),{viewTransitionOpts:N,flushSync:I===!0}),C=V.Pop,_=!1,W=!1,We=!1,je=!1,Rt=[]}async function Fr(c,y){if(typeof c=="number"){t.history.go(c);return}let g=$t(f.location,f.matches,o,h.v7_prependBasename,c,h.v7_relativeSplatPath,y==null?void 0:y.fromRouteId,y==null?void 0:y.relative),{path:w,submission:x,error:I}=Wr(h.v7_normalizeFormMethod,!1,g,y),j=f.location,F=we(f.location,w,y&&y.state);F=k({},F,t.history.encodeLocation(F));let L=y&&y.replace!=null?y.replace:void 0,M=V.Push;L===!0?M=V.Replace:L===!1||x!=null&&ce(x.formMethod)&&x.formAction===f.location.pathname+f.location.search&&(M=V.Replace);let U=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,N=(y&&y.flushSync)===!0,B=_r({currentLocation:j,nextLocation:F,historyAction:M});if(B){Ct(B,{state:"blocked",location:F,proceed(){Ct(B,{state:"proceeding",proceed:void 0,reset:void 0,location:F}),Fr(c,y)},reset(){let te=new Map(f.blockers);te.set(B,He),ae({blockers:te})}});return}return await Ne(M,F,{submission:x,pendingError:I,preventScrollReset:U,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:N})}function xa(){if(kt(),ae({revalidation:"loading"}),f.navigation.state!=="submitting"){if(f.navigation.state==="idle"){Ne(f.historyAction,f.location,{startUninterruptedRevalidation:!0});return}Ne(C||f.historyAction,f.navigation.location,{overrideNavigation:f.navigation,enableViewTransition:W===!0})}}async function Ne(c,y,g){q&&q.abort(),q=null,C=c,We=(g&&g.startUninterruptedRevalidation)===!0,ja(f.location,f.matches),_=(g&&g.preventScrollReset)===!0,W=(g&&g.enableViewTransition)===!0;let w=l||s,x=g&&g.overrideNavigation,I=g!=null&&g.initialHydration&&f.matches&&f.matches.length>0&&!O?f.matches:he(w,y,o),j=(g&&g.flushSync)===!0;if(I&&f.initialized&&!je&&Pi(f.location,y)&&!(g&&g.submission&&ce(g.submission.formMethod))){Je(y,{matches:I},{flushSync:j});return}let F=xt(I,w,y.pathname);if(F.active&&F.matches&&(I=F.matches),!I){let{error:G,notFoundMatches:K,route:$}=zt(y.pathname);Je(y,{matches:K,loaderData:{},errors:{[$.id]:G}},{flushSync:j});return}q=new AbortController;let L=Ze(t.history,y,q.signal,g&&g.submission),M;if(g&&g.pendingError)M=[De(I).route.id,{type:H.error,error:g.pendingError}];else if(g&&g.submission&&ce(g.submission.formMethod)){let G=await Oa(L,y,g.submission,I,F.active,{replace:g.replace,flushSync:j});if(G.shortCircuited)return;if(G.pendingActionResult){let[K,$]=G.pendingActionResult;if(re($)&&Se($.error)&&$.error.status===404){q=null,Je(y,{matches:G.matches,loaderData:{},errors:{[K]:$.error}});return}}I=G.matches||I,M=G.pendingActionResult,x=Gt(y,g.submission),j=!1,F.active=!1,L=Ze(t.history,L.url,L.signal)}let{shortCircuited:U,matches:N,loaderData:B,errors:te}=await Da(L,y,I,F.active,x,g&&g.submission,g&&g.fetcherSubmission,g&&g.replace,g&&g.initialHydration===!0,j,M);U||(q=null,Je(y,k({matches:N||I},en(M),{loaderData:B,errors:te})))}async function Oa(c,y,g,w,x,I){I===void 0&&(I={}),kt();let j=Mi(y,g);
1if(ae({navigation:j},{flushSync:I.flushSync===!0}),x){let M=await Ot(w,y.pathname,c.signal);if(M.type==="aborted")return{shortCircuited:!0};if(M.type==="error"){let U=De(M.partialMatches).route.id;return{matches:M.partialMatches,pendingActionResult:[U,{type:H.error,error:M.error}]}}else if(M.matches)w=M.matches;else{let{notFoundMatches:U,error:N,route:B}=zt(y.pathname);return{matches:U,pendingActionResult:[B.id,{type:H.error,error:N}]}}}let F,L=ke(w,y);if(!L.route.action&&!L.route.lazy)F={type:H.error,error:Y(405,{method:c.method,pathname:y.pathname,routeId:L.route.id})};else if(F=(await st("action",f,c,[L],w,null))[L.route.id],c.signal.aborted)return{shortCircuited:!0};if(Fe(F)){let M;return I&&I.replace!=null?M=I.replace:M=Yr(F.response.headers.get("Location"),new URL(c.url),o)===f.location.pathname+f.location.search,await qe(c,F,!0,{submission:g,replace:M}),{shortCircuited:!0}}if(Ee(F))throw Y(400,{type:"defer-action"});if(re(F)){let M=De(w,L.route.id);return(I&&I.replace)!==!0&&(C=V.Push),{matches:w,pendingActionResult:[M.route.id,F]}}return{matches:w,pendingActionResult:[L.route.id,F]}}async function Da(c,y,g,w,x,I,j,F,L,M,U){let N=x||Gt(y,I),B=I||j||tn(N),te=!We&&(!h.v7_partialHydration||!L);if(w){if(te){let X=Lr(U);ae(k({navigation:N},X!==void 0?{actionData:X}:{}),{flushSync:M})}let z=await Ot(g,y.pathname,c.signal);if(z.type==="aborted")return{shortCircuited:!0};if(z.type==="error"){let X=De(z.partialMatches).route.id;return{matches:z.partialMatches,loaderData:{},errors:{[X]:z.error}}}else if(z.matches)g=z.matches;else{let{error:X,notFoundMatches:$e,route:ut}=zt(y.pathname);return{matches:$e,loaderData:{},errors:{[ut.id]:X}}}}let G=l||s,[K,$]=Vr(t.history,f,g,B,y,h.v7_partialHydration&&L===!0,h.v7_skipActionErrorRevalidation,je,Rt,Et,de,Ge,ge,G,o,U);if(Kt(z=>!(g&&g.some(X=>X.route.id===z))||K&&K.some(X=>X.route.id===z)),at=++wt,K.length===0&&$.length===0){let z=Ar();return Je(y,k({matches:g,loaderData:{},errors:U&&re(U[1])?{[U[0]]:U[1].error}:null},en(U),z?{fetchers:new Map(f.fetchers)}:{}),{flushSync:M}),{shortCircuited:!0}}if(te){let z={};if(!w){z.navigation=N;let X=Lr(U);X!==void 0&&(z.actionData=X)}$.length>0&&(z.fetchers=Ma($)),ae(z,{flushSync:M})}$.forEach(z=>{Ce(z.key),z.controller&&ee.set(z.key,z.controller)});let Ye=()=>$.forEach(z=>Ce(z.key));q&&q.signal.addEventListener("abort",Ye);let{loaderResults:ot,fetcherResults:Re}=await Ur(f,g,K,$,c);if(c.signal.aborted)return{shortCircuited:!0};q&&q.signal.removeEventListener("abort",Ye),$.forEach(z=>ee.delete(z.key));let ye=Ft(ot);if(ye)return await qe(c,ye.result,!0,{replace:F}),{shortCircuited:!0};if(ye=Ft(Re),ye)return ge.add(ye.key),await qe(c,ye.result,!0,{replace:F}),{shortCircuited:!0};let{loaderData:Wt,errors:lt}=Xr(f,g,ot,U,$,Re,Qe);Qe.forEach((z,X)=>{z.subscribe($e=>{($e||z.done)&&Qe.delete(X)})}),h.v7_partialHydration&&L&&f.errors&&(lt=k({},f.errors,lt));let Be=Ar(),Dt=jr(at),Mt=Be||Dt||$.length>0;return k({matches:g,loaderData:Wt,errors:lt},Mt?{fetchers:new Map(f.fetchers)}:{})}function Lr(c){if(c&&!re(c[1]))return{[c[0]]:c[1].data};if(f.actionData)return Object.keys(f.actionData).length===0?null:f.actionData}function Ma(c){return c.forEach(y=>{let g=f.fetchers.get(y.key),w=ct(void 0,g?g.data:void 0);f.fetchers.set(y.key,w)}),new Map(f.fetchers)}function Fa(c,y,g,w){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ce(c);let x=(w&&w.flushSync)===!0,I=l||s,j=$t(f.location,f.matches,o,h.v7_prependBasename,g,h.v7_relativeSplatPath,y,w==null?void 0:w.relative),F=he(I,j,o),L=xt(F,I,j);if(L.active&&L.matches&&(F=L.matches),!F){be(c,y,Y(404,{pathname:j}),{flushSync:x});return}let{path:M,submission:U,error:N}=Wr(h.v7_normalizeFormMethod,!0,j,w);if(N){be(c,y,N,{flushSync:x});return}let B=ke(F,M),te=(w&&w.preventScrollReset)===!0;if(U&&ce(U.formMethod)){La(c,y,M,B,F,L.active,x,te,U);return}Ge.set(c,{routeId:y,path:M}),Ua(c,y,M,B,F,L.active,x,te,U)}async function La(c,y,g,w,x,I,j,F,L){kt(),Ge.delete(c);
1function M(Z){if(!Z.route.action&&!Z.route.lazy){let Xe=Y(405,{method:L.formMethod,pathname:g,routeId:y});return be(c,y,Xe,{flushSync:j}),!0}return!1}if(!I&&M(w))return;let U=f.fetchers.get(c);Pe(c,Fi(L,U),{flushSync:j});let N=new AbortController,B=Ze(t.history,g,N.signal,L);if(I){let Z=await Ot(x,new URL(B.url).pathname,B.signal,c);if(Z.type==="aborted")return;if(Z.type==="error"){be(c,y,Z.error,{flushSync:j});return}else if(Z.matches){if(x=Z.matches,w=ke(x,g),M(w))return}else{be(c,y,Y(404,{pathname:g}),{flushSync:j});return}}ee.set(c,N);let te=wt,K=(await st("action",f,B,[w],x,c))[w.route.id];if(B.signal.aborted){ee.get(c)===N&&ee.delete(c);return}if(h.v7_fetcherPersist&&de.has(c)){if(Fe(K)||re(K)){Pe(c,xe(void 0));return}}else{if(Fe(K))if(ee.delete(c),at>te){Pe(c,xe(void 0));return}else return ge.add(c),Pe(c,ct(L)),qe(B,K,!1,{fetcherSubmission:L,preventScrollReset:F});if(re(K)){be(c,y,K.error);return}}if(Ee(K))throw Y(400,{type:"defer-action"});let $=f.navigation.location||f.location,Ye=Ze(t.history,$,N.signal),ot=l||s,Re=f.navigation.state!=="idle"?he(ot,f.navigation.location,o):f.matches;A(Re,"Didn't find any matches after fetcher action");let ye=++wt;Ve.set(c,ye);let Wt=ct(L,K.data);f.fetchers.set(c,Wt);let[lt,Be]=Vr(t.history,f,Re,L,$,!1,h.v7_skipActionErrorRevalidation,je,Rt,Et,de,Ge,ge,ot,o,[w.route.id,K]);Be.filter(Z=>Z.key!==c).forEach(Z=>{let Xe=Z.key,Br=f.fetchers.get(Xe),Na=ct(void 0,Br?Br.data:void 0);f.fetchers.set(Xe,Na),Ce(Xe),Z.controller&&ee.set(Xe,Z.controller)}),ae({fetchers:new Map(f.fetchers)});let Dt=()=>Be.forEach(Z=>Ce(Z.key));N.signal.addEventListener("abort",Dt);let{loaderResults:Mt,fetcherResults:z}=await Ur(f,Re,lt,Be,Ye);if(N.signal.aborted)return;N.signal.removeEventListener("abort",Dt),Ve.delete(c),ee.delete(c),Be.forEach(Z=>ee.delete(Z.key));let X=Ft(Mt);if(X)return qe(Ye,X.result,!1,{preventScrollReset:F});if(X=Ft(z),X)return ge.add(X.key),qe(Ye,X.result,!1,{preventScrollReset:F});let{loaderData:$e,errors:ut}=Xr(f,Re,Mt,void 0,Be,z,Qe);if(f.fetchers.has(c)){let Z=xe(K.data);f.fetchers.set(c,Z)}jr(ye),f.navigation.state==="loading"&&ye>at?(A(C,"Expected pending action"),q&&q.abort(),Je(f.navigation.location,{matches:Re,loaderData:$e,errors:ut,fetchers:new Map(f.fetchers)})):(ae({errors:ut,loaderData:Zr(f.loaderData,$e,Re,ut),fetchers:new Map(f.fetchers)}),je=!1)}async function Ua(c,y,g,w,x,I,j,F,L){let M=f.fetchers.get(c);Pe(c,ct(L,M?M.data:void 0),{flushSync:j});let U=new AbortController,N=Ze(t.history,g,U.signal);if(I){let K=await Ot(x,new URL(N.url).pathname,N.signal,c);if(K.type==="aborted")return;if(K.type==="error"){be(c,y,K.error,{flushSync:j});return}else if(K.matches)x=K.matches,w=ke(x,g);else{be(c,y,Y(404,{pathname:g}),{flushSync:j});return}}ee.set(c,U);let B=wt,G=(await st("loader",f,N,[w],x,c))[w.route.id];if(Ee(G)&&(G=await mr(G,N.signal,!0)||G),ee.get(c)===U&&ee.delete(c),!N.signal.aborted){if(de.has(c)){Pe(c,xe(void 0));return}if(Fe(G))if(at>B){Pe(c,xe(void 0));return}else{ge.add(c),await qe(N,G,!1,{preventScrollReset:F});return}if(re(G)){be(c,y,G.error);return}A(!Ee(G),"Unhandled fetcher deferred data"),Pe(c,xe(G.data))}}async function qe(c,y,g,w){let{submission:x,fetcherSubmission:I,preventScrollReset:j,replace:F}=w===void 0?{}:w;y.response.headers.has("X-Remix-Revalidate")&&(je=!0);let L=y.response.headers.get("Location");A(L,"Expected a Location header on the redirect Response"),L=Yr(L,new URL(c.url),o);let M=we(f.location,L,{_isRedirect:!0});if(r){let K=!1;if(y.response.headers.has("X-Remix-Reload-Document"))K=!0;else if(vr.test(L)){const $=t.history.createURL(L);K=$.origin!==e.location.origin||Le($.pathname,o)==null}if(K){F?e.location.replace(L):e.location.assign(L);return}}q=null;let U=F===!0||y.response.headers.has("X-Remix-Replace")?V.Replace:V.Push,{formMethod:N,formAction:B,formEncType:te}=f.navigation;!x&&!I&&N&&B&&te&&(x=tn(f.navigation));let G=x||I;if(mi.has(y.response.status)&&G&&ce(G.formMethod))await Ne(U,M,{submission:k({},G,{formAction:L}),preventScrollReset:j||_,enableViewTransition:g?W:void 0});else{let K=Gt(M,x);await Ne(U,M,{overrideNavigation:K,fetcherSubmission:I,preventScrollReset:j||_,enableViewTransition:g?W:void 0})}}async function st(c,y,g,w,x,I){let j,F={};try{j=await jn(d,c,y,g,w,x,I,i,a)}
1catch(L){return w.forEach(M=>{F[M.route.id]={type:H.error,error:L}}),F}for(let[L,M]of Object.entries(j))if(Bn(M)){let U=M.result;F[L]={type:H.redirect,response:_n(U,g,L,x,o,h.v7_relativeSplatPath)}}else F[L]=await Qn(M);return F}async function Ur(c,y,g,w,x){let I=c.matches,j=st("loader",c,x,g,y,null),F=Promise.all(w.map(async U=>{if(U.matches&&U.match&&U.controller){let B=(await st("loader",c,Ze(t.history,U.path,U.controller.signal),[U.match],U.matches,U.key))[U.match.route.id];return{[U.key]:B}}else return Promise.resolve({[U.key]:{type:H.error,error:Y(404,{pathname:U.path})}})})),L=await j,M=(await F).reduce((U,N)=>Object.assign(U,N),{});return await Promise.all([Oi(y,L,x.signal,I,c.loaderData),Di(y,M,w)]),{loaderResults:L,fetcherResults:M}}function kt(){je=!0,Rt.push(...Kt()),Ge.forEach((c,y)=>{ee.has(y)&&Et.add(y),Ce(y)})}function Pe(c,y,g){g===void 0&&(g={}),f.fetchers.set(c,y),ae({fetchers:new Map(f.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function be(c,y,g,w){w===void 0&&(w={});let x=De(f.matches,y);Pt(c),ae({errors:{[x.route.id]:g},fetchers:new Map(f.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function Tr(c){return it.set(c,(it.get(c)||0)+1),de.has(c)&&de.delete(c),f.fetchers.get(c)||Dn}function Pt(c){let y=f.fetchers.get(c);ee.has(c)&&!(y&&y.state==="loading"&&Ve.has(c))&&Ce(c),Ge.delete(c),Ve.delete(c),ge.delete(c),h.v7_fetcherPersist&&de.delete(c),Et.delete(c),f.fetchers.delete(c)}function Ta(c){let y=(it.get(c)||0)-1;y<=0?(it.delete(c),de.add(c),h.v7_fetcherPersist||Pt(c)):it.set(c,y),ae({fetchers:new Map(f.fetchers)})}function Ce(c){let y=ee.get(c);y&&(y.abort(),ee.delete(c))}function Ir(c){for(let y of c){let g=Tr(y),w=xe(g.data);f.fetchers.set(y,w)}}function Ar(){let c=[],y=!1;for(let g of ge){let w=f.fetchers.get(g);A(w,"Expected fetcher: "+g),w.state==="loading"&&(ge.delete(g),c.push(g),y=!0)}return Ir(c),y}function jr(c){let y=[];for(let[g,w]of Ve)if(w<c){let x=f.fetchers.get(g);A(x,"Expected fetcher: "+g),x.state==="loading"&&(Ce(g),Ve.delete(g),y.push(g))}return Ir(y),y.length>0}function Ia(c,y){let g=f.blockers.get(c)||He;return _e.get(c)!==y&&_e.set(c,y),g}function Qr(c){f.blockers.delete(c),_e.delete(c)}function Ct(c,y){let g=f.blockers.get(c)||He;A(g.state==="unblocked"&&y.state==="blocked"||g.state==="blocked"&&y.state==="blocked"||g.state==="blocked"&&y.state==="proceeding"||g.state==="blocked"&&y.state==="unblocked"||g.state==="proceeding"&&y.state==="unblocked","Invalid blocker state transition: "+g.state+" -> "+y.state);let w=new Map(f.blockers);w.set(c,y),ae({blockers:w})}function _r(c){let{currentLocation:y,nextLocation:g,historyAction:w}=c;if(_e.size===0)return;_e.size>1&&me(!1,"A router only supports one blocker at a time");let x=Array.from(_e.entries()),[I,j]=x[x.length-1],F=f.blockers.get(I);if(!(F&&F.state==="proceeding")&&j({currentLocation:y,nextLocation:g,historyAction:w}))return I}function zt(c){let y=Y(404,{pathname:c}),g=l||s,{matches:w,route:x}=At(g);return Kt(),{notFoundMatches:w,route:x,error:y}}function Kt(c){let y=[];return Qe.forEach((g,w)=>{(!c||c(w))&&(g.cancel(),y.push(w),Qe.delete(w))}),y}function Aa(c,y,g){if(m=c,E=y,b=g||null,!D&&f.navigation===Ut){D=!0;let w=qr(f.location,f.matches);w!=null&&ae({restoreScrollPosition:w})}return()=>{m=null,E=null,b=null}}function Nr(c,y){return b&&b(c,y.map(w=>fr(w,f.loaderData)))||c.key}function ja(c,y){if(m&&E){let g=Nr(c,y);m[g]=E()}}function qr(c,y){if(m){let g=Nr(c,y),w=m[g];if(typeof w=="number")return w}return null}function xt(c,y,g){if(p)if(c){if(Object.keys(c[0].params).length>0)return{active:!0,matches:Lt(y,g,o,!0)}}else return{active:!0,matches:Lt(y,g,o,!0)||[]};return{active:!1,matches:null}}async function Ot(c,y,g,w){if(!p)return{type:"success",matches:c};let x=c;for(;;){let I=l==null,j=l||s,F=i;try{await p({signal:g,path:y,matches:x,fetcherKey:w,patch:(U,N)=>{g.aborted||Jr(U,N,j,F,a)}})}catch(U){return{type:"error",error:U,partialMatches:x}}finally{I&&!g.aborted&&(s=[...s])}if(g.aborted)return{type:"aborted"};let L=he(j,y,o);if(L)return{type:"success",matches:L};let M=Lt(j,y,o,!0);if(!M||x.length===M.length&&x.every((U,N)=>U.route.id===M[N].route.id))return{type:"success",matches:null};x=M}}function Qa(c){i={},l=tt(c,a,void 0,i)}function _a(c,y){let g=l==null;Jr(c,y,l||s,i,a),g&&(s=[...s],ae({}))}return T={get basename(){return o},get future(){return h},get state(){return f},get routes(){return s},get window(){return e},initialize:Sa,subscribe:Ca,enableScrollRestoration:Aa,navigate:Fr,fetch:Fa,revalidate:xa,createHref:c=>t.history.createHref(c),encodeLocation:c=>t.history.encodeLocation(c),getFetcher:Tr,deleteFetcher:Ta,dispose:Pa,getBlocker:Ia,deleteBlocker:Qr,patchRoutes:_a,_internalFetchControllers:ee,_internalActiveDeferreds:Qe,_internalSetRoutes:Qa},T}const Un=Symbol("deferred");function gi(t,e){A(t.length>0,"You must provide a non-empty routes array to createStaticHandler");let r={},n=(e?e.basename:null)||"/",a;if(e!=null&&e.mapRouteProperties)a=e.mapRouteProperties;else if(e!=null&&e.detectErrorBoundary){let u=e.detectErrorBoundary;a=m=>({hasErrorBoundary:u(m)})}else a=Mn;let i=k({v7_relativeSplatPath:!1,v7_throwAbortReason:!1},e?e.future:null),s=tt(t,a,void 0,r);async function l(u,m){let{requestContext:b,skipLoaderErrorBubbling:E,dataStrategy:D}=m===void 0?{}
1:m,P=new URL(u.url),O=u.method,S=we("",fe(P),null,"default"),Q=he(s,S,n);if(!rr(O)&&O!=="HEAD"){let f=Y(405,{method:O}),{matches:C,route:_}=At(s);return{basename:n,location:S,matches:C,loaderData:{},actionData:null,errors:{[_.id]:f},statusCode:f.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!Q){let f=Y(404,{pathname:S.pathname}),{matches:C,route:_}=At(s);return{basename:n,location:S,matches:C,loaderData:{},actionData:null,errors:{[_.id]:f},statusCode:f.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let T=await d(u,S,Q,b,D||null,E===!0,null);return Me(T)?T:k({location:S,basename:n},T)}async function o(u,m){let{routeId:b,requestContext:E,dataStrategy:D}=m===void 0?{}:m,P=new URL(u.url),O=u.method,S=we("",fe(P),null,"default"),Q=he(s,S,n);if(!rr(O)&&O!=="HEAD"&&O!=="OPTIONS")throw Y(405,{method:O});if(!Q)throw Y(404,{pathname:S.pathname});let T=b?Q.find(q=>q.route.id===b):ke(Q,S);if(b&&!T)throw Y(403,{pathname:S.pathname,routeId:b});if(!T)throw Y(404,{pathname:S.pathname});let f=await d(u,S,Q,E,D||null,!1,T);if(Me(f))return f;let C=f.errors?Object.values(f.errors)[0]:void 0;if(C!==void 0)throw C;if(f.actionData)return Object.values(f.actionData)[0];if(f.loaderData){var _;let q=Object.values(f.loaderData)[0];return(_=f.activeDeferreds)!=null&&_[T.route.id]&&(q[Un]=f.activeDeferreds[T.route.id]),q}}async function d(u,m,b,E,D,P,O){A(u.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(ce(u.method.toLowerCase()))return await p(u,b,O||ke(b,m),E,D,P,O!=null);let S=await h(u,b,E,D,P,O);return Me(S)?S:k({},S,{actionData:null,actionHeaders:{}})}catch(S){if(Ci(S)&&Me(S.result)){if(S.type===H.error)throw S.result;return S.result}if(xi(S))return S;throw S}}async function p(u,m,b,E,D,P,O){let S;if(!b.route.action&&!b.route.lazy){let f=Y(405,{method:u.method,pathname:new URL(u.url).pathname,routeId:b.route.id});if(O)throw f;S={type:H.error,error:f}}else S=(await v("action",u,[b],m,O,E,D))[b.route.id],u.signal.aborted&&Kr(u,O,i);if(Fe(S))throw new Response(null,{status:S.response.status,headers:{Location:S.response.headers.get("Location")}});if(Ee(S)){let f=Y(400,{type:"defer-action"});if(O)throw f;S={type:H.error,error:f}}if(O){if(re(S))throw S.error;return{matches:[b],loaderData:{},actionData:{[b.route.id]:S.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let Q=new Request(u.url,{headers:u.headers,redirect:u.redirect,signal:u.signal});if(re(S)){let f=P?b:De(m,b.route.id),C=await h(Q,m,E,D,P,null,[f.route.id,S]);return k({},C,{statusCode:Se(S.error)?S.error.status:S.statusCode!=null?S.statusCode:500,actionData:null,actionHeaders:k({},S.headers?{[b.route.id]:S.headers}:{})})}let T=await h(Q,m,E,D,P,null);return k({},T,{actionData:{[b.route.id]:S.data}},S.statusCode?{statusCode:S.statusCode}:{},{actionHeaders:S.headers?{[b.route.id]:S.headers}:{}})}async function h(u,m,b,E,D,P,O){let S=P!=null;if(S&&!(P!=null&&P.route.loader)&&!(P!=null&&P.route.lazy))throw Y(400,{method:u.method,pathname:new URL(u.url).pathname,routeId:P==null?void 0:P.route.id});let T=(P?[P]:O&&re(O[1])?Xt(m,O[0]):m).filter(W=>W.route.loader||W.route.lazy);if(T.length===0)return{matches:m,loaderData:m.reduce((W,ne)=>Object.assign(W,{[ne.route.id]:null}),{}),errors:O&&re(O[1])?{[O[0]]:O[1].error}:null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let f=await v("loader",u,T,m,S,b,E);u.signal.aborted&&Kr(u,S,i);let C=new Map,_=Nn(m,f,O,C,D),q=new Set(T.map(W=>W.route.id));return m.forEach(W=>{q.has(W.route.id)||(_.loaderData[W.route.id]=null)}),k({},_,{matches:m,activeDeferreds:C.size>0?Object.fromEntries(C.entries()):null})}async function v(u,m,b,E,D,P,O){let S=await jn(O||An,u,null,m,b,E,null,r,a,P),Q={};return await Promise.all(E.map(async T=>{if(!(T.route.id in S))return;let f=S[T.route.id];if(Bn(f)){let C=f.result;throw _n(C,m,T.route.id,E,n,i.v7_relativeSplatPath)}if(Me(f.result)&&D)throw f;Q[T.route.id]=await Qn(f)})),Q}return{dataRoutes:s,query:l,queryRoute:o}}function bi(t,e,r){return k({},e,{statusCode:Se(r)?r.status:500,errors:{[e._deepestRenderedBoundaryId||t[0].id]:r}})}function Kr(t,e,r){if(r.v7_throwAbortReason&&t.signal.reason!==void 0)throw t.signal.reason;let n=e?"queryRoute":"query";throw new Error(n+"() call aborted: "+t.method+" "+t.url)}function Ri(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function $t(t,e,r,n,a,i,s,l){let o,d;if(s){o=[];for(let h of e)if(o.push(h),h.route.id===s){d=h;break}}else o=e,d=e[e.length-1];let p=vt(a||".",yt(o,i),Le(t.pathname,r)||t.pathname,l==="path");if(a==null&&(p.search=t.search,p.hash=t.hash),(a==null||a===""||a===".")&&d){let h=gr(p.search);if(d.route.index&&!h)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&h){let v=new URLSearchParams(p.search),u=v.getAll("index");v.delete("index"),u.filter(b=>b).forEach(b=>v.append("index",b));let m=v.toString();p.search=m?"?"+m:""}}return n&&r!=="/"&&(p.pathname=p.pathname==="/"?r:ve([r,p.pathname])),fe(p)}
1function Wr(t,e,r,n){if(!n||!Ri(n))return{path:r};if(n.formMethod&&!rr(n.formMethod))return{path:r,error:Y(405,{method:n.formMethod})};let a=()=>({path:r,error:Y(400,{type:"invalid-body"})}),i=n.formMethod||"get",s=t?i.toUpperCase():i.toLowerCase(),l=qn(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ce(s))return a();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((u,m)=>{let[b,E]=m;return""+u+b+"="+E+"\n"},""):String(n.body);return{path:r,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!ce(s))return a();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return a()}}}A(typeof FormData=="function","FormData is not available in this environment");let o,d;if(n.formData)o=er(n.formData),d=n.formData;else if(n.body instanceof FormData)o=er(n.body),d=n.body;else if(n.body instanceof URLSearchParams)o=n.body,d=$r(o);else if(n.body==null)o=new URLSearchParams,d=new FormData;else try{o=new URLSearchParams(n.body),d=$r(o)}catch{return a()}let p={formMethod:s,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(ce(p.formMethod))return{path:r,submission:p};let h=se(r);return e&&h.search&&gr(h.search)&&o.append("index",""),h.search="?"+o,{path:fe(h),submission:p}}function Xt(t,e,r){r===void 0&&(r=!1);let n=t.findIndex(a=>a.route.id===e);return n>=0?t.slice(0,r?n+1:n):t}function Vr(t,e,r,n,a,i,s,l,o,d,p,h,v,u,m,b){let E=b?re(b[1])?b[1].error:b[1].data:void 0,D=t.createURL(e.location),P=t.createURL(a),O=r;i&&e.errors?O=Xt(r,Object.keys(e.errors)[0],!0):b&&re(b[1])&&(O=Xt(r,b[0]));let S=b?b[1].statusCode:void 0,Q=s&&S&&S>=400,T=O.filter((C,_)=>{let{route:q}=C;if(q.lazy)return!0;if(q.loader==null)return!1;if(i)return Zt(q,e.loaderData,e.errors);if(Ei(e.loaderData,e.matches[_],C)||o.some(oe=>oe===C.route.id))return!0;let W=e.matches[_],ne=C;return Gr(C,k({currentUrl:D,currentParams:W.params,nextUrl:P,nextParams:ne.params},n,{actionResult:E,actionStatus:S,defaultShouldRevalidate:Q?!1:l||D.pathname+D.search===P.pathname+P.search||D.search!==P.search||Tn(W,ne)}))}),f=[];return h.forEach((C,_)=>{if(i||!r.some(We=>We.route.id===C.routeId)||p.has(_))return;let q=he(u,C.path,m);if(!q){f.push({key:_,routeId:C.routeId,path:C.path,matches:null,match:null,controller:null});return}let W=e.fetchers.get(_),ne=ke(q,C.path),oe=!1;v.has(_)?oe=!1:d.has(_)?(d.delete(_),oe=!0):W&&W.state!=="idle"&&W.data===void 0?oe=l:oe=Gr(ne,k({currentUrl:D,currentParams:e.matches[e.matches.length-1].params,nextUrl:P,nextParams:r[r.length-1].params},n,{actionResult:E,actionStatus:S,defaultShouldRevalidate:Q?!1:l})),oe&&f.push({key:_,routeId:C.routeId,path:C.path,matches:q,match:ne,controller:new AbortController})}),[T,f]}function Zt(t,e,r){if(t.lazy)return!0;if(!t.loader)return!1;let n=e!=null&&e[t.id]!==void 0,a=r!=null&&r[t.id]!==void 0;return!n&&a?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!n&&!a}function Ei(t,e,r){let n=!e||r.route.id!==e.route.id,a=t[r.route.id]===void 0;return n||a}function Tn(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function Gr(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}function Jr(t,e,r,n,a){var i;let s;if(t){let d=n[t];A(d,"No route found to patch children into: routeId = "+t),d.children||(d.children=[]),s=d.children}else s=r;let l=e.filter(d=>!s.some(p=>In(d,p))),o=tt(l,a,[t||"_","patch",String(((i=s)==null?void 0:i.length)||"0")],n);s.push(...o)}function In(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((r,n)=>{var a;return(a=e.children)==null?void 0:a.some(i=>In(r,i))}):!1}async function wi(t,e,r){if(!t.lazy)return;let n=await t.lazy();if(!t.lazy)return;let a=r[t.id];A(a,"No route found in manifest");let i={};for(let s in n){let o=a[s]!==void 0&&s!=="hasErrorBoundary";me(!o,'Route "'+a.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!o&&!Wa.has(s)&&(i[s]=n[s])}Object.assign(a,i),Object.assign(a,k({},e(a),{lazy:void 0}))}async function An(t){let{matches:e}=t,r=e.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,i,s)=>Object.assign(a,{[r[s].route.id]:i}),{})}async function jn(t,e,r,n,a,i,s,l,o,d){let p=i.map(u=>u.route.lazy?wi(u.route,o,l):void 0),h=i.map((u,m)=>{let b=p[m],E=a.some(P=>P.route.id===u.route.id);return k({},u,{shouldLoad:E,resolve:async P=>(P&&n.method==="GET"&&(u.route.lazy||u.route.loader)&&(E=!0),E?Si(e,n,u,b,P,d):Promise.resolve({type:H.data,result:void 0}))})}),v=await t({matches:h,request:n,params:i[0].params,fetcherKey:s,context:d});try{await Promise.all(p)}catch{}return v}async function Si(t,e,r,n,a,i){let s,l,o=d=>{let p,h=new Promise((m,b)=>p=b);l=()=>p(),e.signal.addEventListener("abort",l);let v=m=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+r.route.id+"]"))):d({request:e,params:r.params,context:i},...m!==void 0?[m]:[]),u=(async()=>{try{return{type:"data",result:await(a?a(b=>v(b)):v())}}catch(m){return{type:"error",result:m}}})();return Promise.race([u,h])};try{let d=r.route[t];if(n)if(d){let p,[h]=await Promise.all([o(d).catch(v=>{p=v}),n]);if(p!==void 0)throw p;s=h}else if(await n,d=r.route[t],d)s=await o(d);else if(t==="action"){let p=new URL(e.url),h=p.pathname+p.search;throw Y(405,{method:e.method,pathname:h,routeId:r.route.id})}else return{type:H.data,result:void 0};else if(d)s=await o(d);else{let p=new URL(e.url),h=p.pathname+p.search;throw Y(404,{pathname:h})}A(s.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:H.error,result:d}}finally{l&&e.signal.removeEventListener("abort",l)}return s}async function Qn(t){let{result:e,type:r}=t;if(Me(e)){let h;try{let v=e.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?e.body==null?h=null:h=await e.json():h=await e.text()}catch(v){return{type:H.error,error:v}}return r===H.error?{type:H.error,error:new It(e.status,e.statusText,h),statusCode:e.status,headers:e.headers}:{type:H.data,data:h,statusCode:e.status,headers:e.headers}}if(r===H.error){if(tr(e)){var n,a;if(e.data instanceof Error){var i,s;return{type:H.error,error:e.data,statusCode:(i=e.init)==null?void 0:i.status,headers:(s=e.init)!=null&&s.headers?new Headers(e.init.headers):void 0}}return{type:H.error,error:new It(((n=e.init)==null?void 0:n.status)||500,void 0,e.data),statusCode:Se(e)?e.status:void 0,headers:(a=e.init)!=null&&a.headers?new Headers(e.init.headers):void 0}}return{type:H.error,error:e,statusCode:Se(e)?e.status:void 0}}if(Hn(e)){var l,o;return{type:H.deferred,deferredData:e,statusCode:(l=e.init)==null?void 0:l.status,headers:((o=e.init)==null?void 0:o.headers)&&new Headers(e.init.headers)}}if(tr(e)){var d,p;return{type:H.data,data:e.data,statusCode:(d=e.init)==null?void 0:d.status,headers:(p=e.init)!=null&&p.headers?new Headers(e.init.headers):void 0}}return{type:H.data,data:e}}function _n(t,e,r,n,a,i){let s=t.headers.get("Location");if(A(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!vr.test(s)){let l=n.slice(0,n.findIndex(o=>o.route.id===r)+1);s=$t(new URL(e.url),l,a,!0,s,i),t.headers.set("Location",s)}return t}function Yr(t,e,r){if(vr.test(t)){let n=t,a=n.startsWith("//")?new URL(e.protocol+n):new URL(n),i=Le(a.pathname,r)!=null;if(a.origin===e.origin&&i)return a.pathname+a.search+a.hash}return t}function Ze(t,e,r,n){let a=t.createURL(qn(e)).toString(),i={signal:r};if(n&&ce(n.formMethod)){let{formMethod:s,formEncType:l}=n;i.method=s.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(n.json)):l==="text/plain"?i.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?i.body=er(n.formData):i.body=n.formData}
1return new Request(a,i)}function er(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function $r(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function Nn(t,e,r,n,a){let i={},s=null,l,o=!1,d={},p=r&&re(r[1])?r[1].error:void 0;return t.forEach(h=>{if(!(h.route.id in e))return;let v=h.route.id,u=e[v];if(A(!Fe(u),"Cannot handle redirect results in processLoaderData"),re(u)){let m=u.error;if(p!==void 0&&(m=p,p=void 0),s=s||{},a)s[v]=m;else{let b=De(t,v);s[b.route.id]==null&&(s[b.route.id]=m)}i[v]=void 0,o||(o=!0,l=Se(u.error)?u.error.status:500),u.headers&&(d[v]=u.headers)}else Ee(u)?(n.set(v,u.deferredData),i[v]=u.deferredData.data,u.statusCode!=null&&u.statusCode!==200&&!o&&(l=u.statusCode),u.headers&&(d[v]=u.headers)):(i[v]=u.data,u.statusCode&&u.statusCode!==200&&!o&&(l=u.statusCode),u.headers&&(d[v]=u.headers))}),p!==void 0&&r&&(s={[r[0]]:p},i[r[0]]=void 0),{loaderData:i,errors:s,statusCode:l||200,loaderHeaders:d}}function Xr(t,e,r,n,a,i,s){let{loaderData:l,errors:o}=Nn(e,r,n,s,!1);return a.forEach(d=>{let{key:p,match:h,controller:v}=d,u=i[p];if(A(u,"Did not find corresponding fetcher result"),!(v&&v.signal.aborted))if(re(u)){let m=De(t.matches,h==null?void 0:h.route.id);o&&o[m.route.id]||(o=k({},o,{[m.route.id]:u.error})),t.fetchers.delete(p)}else if(Fe(u))A(!1,"Unhandled fetcher revalidation redirect");else if(Ee(u))A(!1,"Unhandled fetcher deferred data");else{let m=xe(u.data);t.fetchers.set(p,m)}}),{loaderData:l,errors:o}}function Zr(t,e,r,n){let a=k({},e);for(let i of r){let s=i.route.id;if(e.hasOwnProperty(s)?e[s]!==void 0&&(a[s]=e[s]):t[s]!==void 0&&i.route.loader&&(a[s]=t[s]),n&&n.hasOwnProperty(s))break}return a}function en(t){return t?re(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function De(t,e){return(e?t.slice(0,t.findIndex(n=>n.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function At(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Y(t,e){let{pathname:r,routeId:n,method:a,type:i,message:s}=e===void 0?{}:e,l="Unknown Server Error",o="Unknown @remix-run/router error";return t===400?(l="Bad Request",a&&r&&n?o="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?o="defer() is not supported in actions":i==="invalid-body"&&(o="Unable to encode submission body")):t===403?(l="Forbidden",o='Route "'+n+'" does not match URL "'+r+'"'):t===404?(l="Not Found",o='No route matches URL "'+r+'"'):t===405&&(l="Method Not Allowed",a&&r&&n?o="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(o='Invalid request method "'+a.toUpperCase()+'"')),new It(t||500,l,new Error(o),!0)}function Ft(t){let e=Object.entries(t);for(let r=e.length-1;r>=0;r--){let[n,a]=e[r];if(Fe(a))return{key:n,result:a}}}function qn(t){let e=typeof t=="string"?se(t):t;return fe(k({},e,{hash:""}))}function Pi(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Ci(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type===
1H.data||t.type===H.error)}function Bn(t){return Me(t.result)&&vi.has(t.result.status)}function Ee(t){return t.type===H.deferred}function re(t){return t.type===H.error}function Fe(t){return(t&&t.type)===H.redirect}function tr(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Hn(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function Me(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function xi(t){if(!Me(t))return!1;let e=t.status,r=t.headers.get("Location");return e>=300&&e<=399&&r!=null}function rr(t){return yi.has(t.toLowerCase())}function ce(t){return fi.has(t.toLowerCase())}async function Oi(t,e,r,n,a){let i=Object.entries(e);for(let s=0;s<i.length;s++){let[l,o]=i[s],d=t.find(v=>(v==null?void 0:v.route.id)===l);if(!d)continue;let p=n.find(v=>v.route.id===d.route.id),h=p!=null&&!Tn(p,d)&&(a&&a[d.route.id])!==void 0;Ee(o)&&h&&await mr(o,r,!1).then(v=>{v&&(e[l]=v)})}}async function Di(t,e,r){for(let n=0;n<r.length;n++){let{key:a,routeId:i,controller:s}=r[n],l=e[a];t.find(d=>(d==null?void 0:d.route.id)===i)&&Ee(l)&&(A(s,"Expected an AbortController for revalidating fetcher deferred result"),await mr(l,s.signal,!0).then(d=>{d&&(e[a]=d)}))}}async function mr(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:H.data,data:t.deferredData.unwrappedData}}catch(a){return{type:H.error,error:a}}return{type:H.data,data:t.deferredData.data}}}function gr(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function ke(t,e){let r=typeof e=="string"?se(e).search:e.search;if(t[t.length-1].route.index&&gr(r||""))return t[t.length-1];let n=Rn(t);return n[n.length-1]}function tn(t){let{formMethod:e,formAction:r,formEncType:n,text:a,formData:i,json:s}=t;if(!(!e||!r||!n)){if(a!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:e,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:s,text:void 0}}}function Gt(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Mi(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function ct(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Fi(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function xe(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Li(t,e){try{let r=t.sessionStorage.getItem(Fn);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&e.set(a,new Set(i||[]))}}catch{}}function Ui(t,e){if(e.size>0){let r={};for(let[n,a]of e)r[n]=[...a];try{t.sessionStorage.setItem(Fn,JSON.stringify(r))}catch(n){me(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}const Hs=Object.freeze(Object.defineProperty({__proto__:null,AbortedDeferredError:ht,get Action(){return V},IDLE_BLOCKER:He,IDLE_FETCHER:Dn,IDLE_NAVIGATION:Ut,UNSAFE_DEFERRED_SYMBOL:Un,UNSAFE_DeferredData:Sn,UNSAFE_ErrorResponseImpl:It,UNSAFE_convertRouteMatchToUiMatch:fr,UNSAFE_convertRoutesToDataRoutes:tt,UNSAFE_decodePath:pr,UNSAFE_getResolveToMatches:yt,UNSAFE_invariant:A,UNSAFE_warning:me,createBrowserHistory:ka,createHashHistory:za,createMemoryHistory:hr,createPath:fe,createRouter:Ln,createStaticHandler:gi,data:ci,defer:Pn,generatePath:bn,getStaticContextFromError:bi,getToPathname:si,isDataWithResponseInit:tr,isDeferredData:Hn,isRouteErrorResponse:Se,joinPaths:ve,json:wn,matchPath:dt,matchRoutes:he,normalizePathname:En,parsePath:se,redirect:Bt,redirectDocument:Cn,replace:xn,resolvePath:yr,resolveTo:vt,stripBasename:Le},Symbol.toStringTag,{value:"Module"}));function Ue(){return Ue=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
1for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ue.apply(this,arguments)}const mt=R.createContext(null),br=R.createContext(null),jt=R.createContext(null),Te=R.createContext(null),rt=R.createContext(null),pe=R.createContext({outlet:null,matches:[],isDataRoute:!1}),kn=R.createContext(null);function Ti(t,e){let{relative:r}=e===void 0?{}:e;Ie()||A(!1);let{basename:n,navigator:a}=R.useContext(Te),{hash:i,pathname:s,search:l}=Gn(t,{relative:r}),o=s;return n!=="/"&&(o=s==="/"?n:ve([n,s])),a.createHref({pathname:o,search:l,hash:i})}function Ie(){return R.useContext(rt)!=null}function nt(){return Ie()||A(!1),R.useContext(rt).location}function Ii(){return R.useContext(rt).navigationType}function Ai(t){Ie()||A(!1);let{pathname:e}=nt();return R.useMemo(()=>dt(t,pr(e)),[e,t])}function zn(t){R.useContext(Te).static||R.useLayoutEffect(t)}function Kn(){let{isDataRoute:t}=R.useContext(pe);return t?es():ji()}function ji(){Ie()||A(!1);let t=R.useContext(mt),{basename:e,future:r,navigator:n}=R.useContext(Te),{matches:a}=R.useContext(pe),{pathname:i}=nt(),s=JSON.stringify(yt(a,r.v7_relativeSplatPath)),l=R.useRef(!1);return zn(()=>{l.current=!0}),R.useCallback(function(d,p){if(p===void 0&&(p={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let h=vt(d,JSON.parse(s),i,p.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:ve([e,h.pathname])),(p.replace?n.replace:n.push)(h,p.state,p)},[e,n,s,i,t])}const Wn=R.createContext(null);function Qi(){return R.useContext(Wn)}function Vn(t){let e=R.useContext(pe).outlet;return e&&R.createElement(Wn.Provider,{value:t},e)}function _i(){let{matches:t}=R.useContext(pe),e=t[t.length-1];return e?e.params:{}}function Gn(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=R.useContext(Te),{matches:a}=R.useContext(pe),{pathname:i}=nt(),s=JSON.stringify(yt(a,n.v7_relativeSplatPath));return R.useMemo(()=>vt(t,JSON.parse(s),i,r==="path"),[t,s,i,r])}function Jn(t,e){return Rr(t,e)}function Rr(t,e,r,n){Ie()||A(!1);let{navigator:a}=R.useContext(Te),{matches:i}=R.useContext(pe),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let o=s?s.pathnameBase:"/";s&&s.route;let d=nt(),p;if(e){var h;let E=typeof e=="string"?se(e):e;o==="/"||(h=E.pathname)!=null&&h.startsWith(o)||A(!1),p=E}else p=d;let v=p.pathname||"/",u=v;if(o!=="/"){let E=o.replace(/^\//,"").split("/");u="/"+v.replace(/^\//,"").split("/").slice(E.length).join("/")}let m=he(t,{pathname:u}),b=Yn(m&&m.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:ve([o,a.encodeLocation?a.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?o:ve([o,a.encodeLocation?a.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),i,r,n);return e&&b?R.createElement(rt.Provider,{value:{location:Ue({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:V.Pop}},b):b}function Ni(){let t=Xn(),e=Se(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},e),r?R.createElement("pre",{style:a},r):null,null)}const qi=R.createElement(Ni,null);class Bi extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?R.createElement(pe.Provider,{value:this.props.routeContext},R.createElement(kn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}
1function Hi(t){let{routeContext:e,match:r,children:n}=t,a=R.useContext(mt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),R.createElement(pe.Provider,{value:e},n)}function Yn(t,e,r,n){var a;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var i;if(!r)return null;if(r.errors)t=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let s=t,l=(a=r)==null?void 0:a.errors;if(l!=null){let p=s.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);p>=0||A(!1),s=s.slice(0,Math.min(s.length,p+1))}let o=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let p=0;p<s.length;p++){let h=s[p];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=p),h.route.id){let{loaderData:v,errors:u}=r,m=h.route.loader&&v[h.route.id]===void 0&&(!u||u[h.route.id]===void 0);if(h.route.lazy||m){o=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((p,h,v)=>{let u,m=!1,b=null,E=null;r&&(u=l&&h.route.id?l[h.route.id]:void 0,b=h.route.errorElement||qi,o&&(d<0&&v===0?(ts("route-fallback"),m=!0,E=null):d===v&&(m=!0,E=h.route.hydrateFallbackElement||null)));let D=e.concat(s.slice(0,v+1)),P=()=>{let O;return u?O=b:m?O=E:h.route.Component?O=R.createElement(h.route.Component,null):h.route.element?O=h.route.element:O=p,R.createElement(Hi,{match:h,routeContext:{outlet:p,matches:D,isDataRoute:r!=null},children:O})};return r&&(h.route.ErrorBoundary||h.route.errorElement||v===0)?R.createElement(Bi,{location:r.location,revalidation:r.revalidation,component:b,error:u,children:P(),routeContext:{outlet:null,matches:D,isDataRoute:!0}}):P()},null)}var $n=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})($n||{}),ie=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(ie||{});function Er(t){let e=R.useContext(mt);return e||A(!1),e}function Ae(t){let e=R.useContext(br);return e||A(!1),e}function ki(t){let e=R.useContext(pe);return e||A(!1),e}function gt(t){let e=ki(),r=e.matches[e.matches.length-1];return r.route.id||A(!1),r.route.id}function zi(){return gt(ie.UseRouteId)}function Ki(){return Ae(ie.UseNavigation).navigation}function Wi(){let t=Er(),e=Ae(ie.UseRevalidator);return R.useMemo(()=>({revalidate:t.router.revalidate,state:e.revalidation}),[t.router.revalidate,e.revalidation])}function Vi(){let{matches:t,loaderData:e}=Ae(ie.UseMatches);return R.useMemo(()=>t.map(r=>fr(r,e)),[t,e])}function Gi(){let t=Ae(ie.UseLoaderData),e=gt(ie.UseLoaderData);if(t.errors&&t.errors[e]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+e+")");return}return t.loaderData[e]}function Ji(t){return Ae(ie.UseRouteLoaderData).loaderData[t]}function Yi(){let t=Ae(ie.UseActionData),e=gt(ie.UseLoaderData);return t.actionData?t.actionData[e]:void 0}function Xn(){var t;let e=R.useContext(kn),r=Ae(ie.UseRouteError),n=gt(ie.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function Zn(){let t=R.useContext(jt);return t==null?void 0:t._data}function $i(){let t=R.useContext(jt);return t==null?void 0:t._error}let Xi=0;function Zi(t){let{router:e,basename:r}=Er(),n=Ae(ie.UseBlocker),[a,i]=R.useState(""),s=R.useCallback(l=>{if(typeof t!="function")return!!t;if(r==="/")return t(l);let{currentLocation:o,nextLocation:d,historyAction:p}=l;return t({currentLocation:Ue({},o,{pathname:Le(o.pathname,r)||o.pathname}),nextLocation:Ue({},d,{pathname:Le(d.pathname,r)||d.pathname}),historyAction:p})},[r,t]);return R.useEffect(()=>{let l=String(++Xi);return i(l),()=>e.deleteBlocker(l)},[e]),R.useEffect(()=>{a!==""&&e.getBlocker(a,s)},[e,a,s]),a&&n.blockers.has(a)?n.blockers.get(a):He}function es(){let{router:t}=Er($n.UseNavigateStable),e=gt(ie.UseNavigateStable),r=R.useRef(!1);return zn(()=>{r.current=!0}),R.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?t.navigate(a):t.navigate(a,Ue({fromRouteId:e},i)))},[t,e])}const rn={};function ts(t,e,r){rn[t]||(rn[t]=!0)}function wr(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}const rs="startTransition",Qt=qa[rs];function ns(t){let{fallbackElement:e,router:r,future:n}
1=t,[a,i]=R.useState(r.state),{v7_startTransition:s}=n||{},l=R.useCallback(h=>{s&&Qt?Qt(()=>i(h)):i(h)},[i,s]);R.useLayoutEffect(()=>r.subscribe(l),[r,l]),R.useEffect(()=>{},[]);let o=R.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:h=>r.navigate(h),push:(h,v,u)=>r.navigate(h,{state:v,preventScrollReset:u==null?void 0:u.preventScrollReset}),replace:(h,v,u)=>r.navigate(h,{replace:!0,state:v,preventScrollReset:u==null?void 0:u.preventScrollReset})}),[r]),d=r.basename||"/",p=R.useMemo(()=>({router:r,navigator:o,static:!1,basename:d}),[r,o,d]);return R.useEffect(()=>wr(n,r.future),[r,n]),R.createElement(R.Fragment,null,R.createElement(mt.Provider,{value:p},R.createElement(br.Provider,{value:a},R.createElement(Sr,{basename:d,location:a.location,navigationType:a.historyAction,navigator:o,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?R.createElement(as,{routes:r.routes,future:r.future,state:a}):e))),null)}function as(t){let{routes:e,future:r,state:n}=t;return Rr(e,void 0,n,r)}function is(t){let{basename:e,children:r,initialEntries:n,initialIndex:a,future:i}=t,s=R.useRef();s.current==null&&(s.current=hr({initialEntries:n,initialIndex:a,v5Compat:!0}));let l=s.current,[o,d]=R.useState({action:l.action,location:l.location}),{v7_startTransition:p}=i||{},h=R.useCallback(v=>{p&&Qt?Qt(()=>d(v)):d(v)},[d,p]);return R.useLayoutEffect(()=>l.listen(h),[l,h]),R.useEffect(()=>wr(i),[i]),R.createElement(Sr,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:l,future:i})}function ss(t){let{to:e,replace:r,state:n,relative:a}=t;Ie()||A(!1);let{future:i,static:s}=R.useContext(Te),{matches:l}=R.useContext(pe),{pathname:o}=nt(),d=Kn(),p=vt(e,yt(l,i.v7_relativeSplatPath),o,a==="path"),h=JSON.stringify(p);return R.useEffect(()=>d(JSON.parse(h),{replace:r,state:n,relative:a}),[d,h,a,r,n]),null}function os(t){return Vn(t.context)}function ea(t){A(!1)}function Sr(t){let{basename:e="/",children:r=null,location:n,navigationType:a=V.Pop,navigator:i,static:s=!1,future:l}=t;Ie()&&A(!1);let o=e.replace(/^\/*/,"/"),d=R.useMemo(()=>({basename:o,navigator:i,static:s,future:Ue({v7_relativeSplatPath:!1},l)}),[o,l,i,s]);typeof n=="string"&&(n=se(n));let{pathname:p="/",search:h="",hash:v="",state:u=null,key:m="default"}=n,b=R.useMemo(()=>{let E=Le(p,o);return E==null?null:{location:{pathname:E,search:h,hash:v,state:u,key:m},navigationType:a}},[o,p,h,v,u,m,a]);return b==null?null:R.createElement(Te.Provider,{value:d},R.createElement(rt.Provider,{children:r,value:b}))}function ls(t){let{children:e,location:r}=t;return Jn(ft(e),r)}function us(t){let{children:e,errorElement:r,resolve:n}=t;return R.createElement(ds,{resolve:n,errorElement:r},R.createElement(hs,null,e))}var le=(function(t){return t[t.pending=0]="pending",t[t.success=1]="success",t[t.error=2]="error",t})(le||{});const cs=new Promise(()=>{});class ds extends R.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,r){console.error("<Await> caught the following error during render",e,r)}render(){let{children:e,errorElement:r,resolve:n}=this.props,a=null,i=le.pending;if(!(n instanceof Promise))i=le.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});else if(this.state.error){i=le.error;let s=this.state.error;a=Promise.reject().catch(()=>{}),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>s})}else n._tracked?(a=n,i="_error"in a?le.error:"_data"in a?le.success:le.pending):(i=le.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then(s=>Object.defineProperty(n,"_data",{get:()=>s}),s=>Object.defineProperty(n,"_error",{get:()=>s})));if(i===le.error&&a._error instanceof ht)throw cs;if(i===le.error&&!r)throw a._error;if(i===le.error)return R.createElement(jt.Provider,{value:a,children:r});if(i===le.success)return R.createElement(jt.Provider,{value:a,children:e});throw a}}function hs(t){let{children:e}=t,r=Zn(),n=typeof e=="function"?e(r):e;return R.createElement(R.Fragment,null,n)}function ft(t,e){e===void 0&&(e=[]);let r=[];
1return R.Children.forEach(t,(n,a)=>{if(!R.isValidElement(n))return;let i=[...e,a];if(n.type===R.Fragment){r.push.apply(r,ft(n.props.children,i));return}n.type!==ea&&A(!1),!n.props.index||!n.props.children||A(!1);let s={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=ft(n.props.children,i)),r.push(s)}),r}function fs(t){return Yn(t)}function ta(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:R.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:R.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:R.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function ps(t,e){return Ln({basename:e==null?void 0:e.basename,future:Ue({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:hr({initialEntries:e==null?void 0:e.initialEntries,initialIndex:e==null?void 0:e.initialIndex}),hydrationData:e==null?void 0:e.hydrationData,routes:t,mapRouteProperties:ta,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation}).initialize()}const ys=Object.freeze(Object.defineProperty({__proto__:null,AbortedDeferredError:ht,Await:us,MemoryRouter:is,Navigate:ss,get NavigationType(){return V},Outlet:os,Route:ea,Router:Sr,RouterProvider:ns,Routes:ls,UNSAFE_DataRouterContext:mt,UNSAFE_DataRouterStateContext:br,UNSAFE_LocationContext:rt,UNSAFE_NavigationContext:Te,UNSAFE_RouteContext:pe,UNSAFE_logV6DeprecationWarnings:wr,UNSAFE_mapRouteProperties:ta,UNSAFE_useRouteId:zi,UNSAFE_useRoutesImpl:Rr,createMemoryRouter:ps,createPath:fe,createRoutesFromChildren:ft,createRoutesFromElements:ft,defer:Pn,generatePath:bn,isRouteErrorResponse:Se,json:wn,matchPath:dt,matchRoutes:he,parsePath:se,redirect:Bt,redirectDocument:Cn,renderMatches:fs,replace:xn,resolvePath:yr,useActionData:Yi,useAsyncError:$i,useAsyncValue:Zn,useBlocker:Zi,useHref:Ti,useInRouterContext:Ie,useLoaderData:Gi,useLocation:nt,useMatch:Ai,useMatches:Vi,useNavigate:Kn,useNavigation:Ki,useNavigationType:Ii,useOutlet:Vn,useOutletContext:Qi,useParams:_i,useResolvedPath:Gn,useRevalidator:Wi,useRouteError:Xn,useRouteLoaderData:Ji,useRoutes:Jn},Symbol.toStringTag,{value:"Module"}));class Ke{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const r={listener:e};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const pt=typeof window>"u"||"Deno"in window;function ue(){}function vs(t,e){return typeof t=="function"?t(e):t}function nr(t){return typeof t=="number"&&t>=0&&t!==1/0}function nn(t,e){return t.filter(r=>!e.includes(r))}function ms(t,e,r){const n=t.slice(0);return n[e]=r,n}function ra(t,e){return Math.max(t+(e||0)-Date.now(),0)}function et(t,e,r){return bt(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function gs(t,e,r){return bt(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function Oe(t,e,r){return bt(t)?[{...e,queryKey:t},r]:[t||{},e]}function an(t,e){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:s,stale:l}=t;if(bt(s)){if(n){if(e.queryHash!==Pr(s,e.options))return!1}else if(!_t(e.queryKey,s))return!1}if(r!=="all"){const o=e.isActive();if(r==="active"&&!o||r==="inactive"&&o)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||typeof a<"u"&&a!==e.state.fetchStatus||i&&!i(e))}function sn(t,e){const{exact:r,fetching:n,predicate:a,mutationKey:i}=t;if(bt(i)){if(!e.options.mutationKey)return!1;if(r){if(ze(e.options.mutationKey)!==ze(i))return!1}else if(!_t(e.options.mutationKey,i))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||a&&!a(e))}function Pr(t,e){return((e==null?void 0:e.queryKeyHashFn)||ze)(t)}function ze(t){return JSON.stringify(t,(e,r)=>ir(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function _t(t,e){return na(t,e)}function na(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!na(t[r],e[r])):!1}function aa(t,e){if(t===e)return t;const r=on(t)&&on(e);if(r||ir(t)&&ir(e)){const n=r?t.length:Object.keys(t).length,a=r?e:Object.keys(e),i=a.length,s=r?[]:{};let l=0;for(let o=0;o<i;o++){const d=r?o:a[o];s[d]=aa(t[d],e[d]),s[d]===t[d]&&l++}return n===i&&l===n?t:s}return e}function ar(t,e){if(t&&!e||e&&!t)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function on(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function ir(t){if(!ln(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!ln(r)||!r.hasOwnProperty("isPrototypeOf"))}function ln(t){return Object.prototype.toString.call(t)==="[object Object]"}function bt(t){return Array.isArray(t)}function ia(t){return new Promise(e=>{setTimeout(e,t)})}function un(t){ia(0).then(t)}function bs(){if(typeof AbortController=="function")return new AbortController}function sr(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?aa(t,e):e}class Rs extends Ke{constructor(){super(),this.setup=e=>{if(!pt&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.focused=e,e&&this.onFocus()}
1onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Nt=new Rs,cn=["online","offline"];class Es extends Ke{constructor(){super(),this.setup=e=>{if(!pt&&window.addEventListener){const r=()=>e();return cn.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{cn.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(e){this.online=e,e&&this.onOnline()}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const qt=new Es;function ws(t){return Math.min(1e3*2**t,3e4)}function Ht(t){return(t!=null?t:"online")==="online"?qt.isOnline():!0}class sa{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Tt(t){return t instanceof sa}function oa(t){let e=!1,r=0,n=!1,a,i,s;const l=new Promise((E,D)=>{i=E,s=D}),o=E=>{n||(u(new sa(E)),t.abort==null||t.abort())},d=()=>{e=!0},p=()=>{e=!1},h=()=>!Nt.isFocused()||t.networkMode!=="always"&&!qt.isOnline(),v=E=>{n||(n=!0,t.onSuccess==null||t.onSuccess(E),a==null||a(),i(E))},u=E=>{n||(n=!0,t.onError==null||t.onError(E),a==null||a(),s(E))},m=()=>new Promise(E=>{a=D=>{const P=n||!h();return P&&E(D),P},t.onPause==null||t.onPause()}).then(()=>{a=void 0,n||t.onContinue==null||t.onContinue()}),b=()=>{if(n)return;let E;try{E=t.fn()}catch(D){E=Promise.reject(D)}Promise.resolve(E).then(v).catch(D=>{var P,O;if(n)return;const S=(P=t.retry)!=null?P:3,Q=(O=t.retryDelay)!=null?O:ws,T=typeof Q=="function"?Q(r,D):Q,f=S===!0||typeof S=="number"&&r<S||typeof S=="function"&&S(r,D);if(e||!f){u(D);return}r++,t.onFail==null||t.onFail(r,D),ia(T).then(()=>{if(h())return m()}).then(()=>{e?u(D):b()})})};return Ht(t.networkMode)?b():m().then(b),{promise:l,cancel:o,continue:()=>(a==null?void 0:a())?l:Promise.resolve(),cancelRetry:d,continueRetry:p}}const Cr=console;function Ss(){let t=[],e=0,r=p=>{p()},n=p=>{p()};const a=p=>{let h;e++;try{h=p()}finally{e--,e||l()}return h},i=p=>{e?t.push(p):un(()=>{r(p)})},s=p=>(...h)=>{i(()=>{p(...h)})},l=()=>{const p=t;t=[],p.length&&un(()=>{n(()=>{p.forEach(h=>{r(h)})})})};return{batch:a,batchCalls:s,schedule:i,setNotifyFunction:p=>{r=p},setBatchNotifyFunction:p=>{n=p}}}const J=Ss();class la{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nr(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e!=null?e:pt?1/0:300*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Ps extends la{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||Cr,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||Cs(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&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,r){const n=sr(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){this.dispatch({type:"setState",state:e,setStateOptions:r})}cancel(e){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(e),n?n.then(ue).catch(ue):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}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||!ra(this.state.dataUpdatedAt,e)}onFocus(){var e;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||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(r=>
1r!==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,r){var n,a;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var i;return(i=this.retryer)==null||i.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(m=>m.options.queryFn);u&&this.setOptions(u.options)}Array.isArray(this.options.queryKey);const s=bs(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},o=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};o(l);const d=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),p={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:d};if(o(p),(n=this.options.behavior)==null||n.onFetch(p),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((a=p.fetchOptions)==null?void 0:a.meta)){var h;this.dispatch({type:"fetch",meta:(h=p.fetchOptions)==null?void 0:h.meta})}const v=u=>{if(Tt(u)&&u.silent||this.dispatch({type:"error",error:u}),!Tt(u)){var m,b,E,D;(m=(b=this.cache.config).onError)==null||m.call(b,u,this),(E=(D=this.cache.config).onSettled)==null||E.call(D,this.state.data,u,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=oa({fn:p.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:u=>{var m,b,E,D;if(typeof u>"u"){v(new Error(this.queryHash+" data is undefined"));return}this.setData(u),(m=(b=this.cache.config).onSuccess)==null||m.call(b,u,this),(E=(D=this.cache.config).onSettled)==null||E.call(D,u,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:v,onFail:(u,m)=>{this.dispatch({type:"failed",failureCount:u,error:m})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const r=n=>{var a,i;switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(a=e.meta)!=null?a:null,fetchStatus:Ht(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(i=e.dataUpdatedAt)!=null?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return Tt(s)&&s.revert&&this.revertState?{...this.revertState}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),J.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function Cs(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n!=null?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class xs extends Ke{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,r,n){var a;const i=r.queryKey,s=(a=r.queryHash)!=null?a:Pr(i,r);let l=this.get(s);return l||(l=new Ps({cache:this,logger:e.getLogger(),queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const r=this.queriesMap[e.queryHash];r&&(e.destroy(),this.queries=this.queries.filter(n=>n!==e),r===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){J.batch(()=>
1{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=Oe(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(a=>an(n,a))}findAll(e,r){const[n]=Oe(e,r);return Object.keys(n).length>0?this.queries.filter(a=>an(n,a)):this.queries}notify(e){J.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){J.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){J.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class Os extends la{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||Cr,this.observers=[],this.state=e.state||ua(),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(r=>r!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,r;return(e=(r=this.retryer)==null?void 0:r.continue())!=null?e:this.execute()}async execute(){const e=()=>{var f;return this.retryer=oa({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(C,_)=>{this.dispatch({type:"failed",failureCount:C,error:_})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(f=this.options.retry)!=null?f:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,a,i,s,l,o,d,p;if(!r){var h,v,u,m;this.dispatch({type:"loading",variables:this.options.variables}),await((h=(v=this.mutationCache.config).onMutate)==null?void 0:h.call(v,this.state.variables,this));const C=await((u=(m=this.options).onMutate)==null?void 0:u.call(m,this.state.variables));C!==this.state.context&&this.dispatch({type:"loading",context:C,variables:this.state.variables})}const f=await e();return await((n=(a=this.mutationCache.config).onSuccess)==null?void 0:n.call(a,f,this.state.variables,this.state.context,this)),await((i=(s=this.options).onSuccess)==null?void 0:i.call(s,f,this.state.variables,this.state.context)),await((l=(o=this.mutationCache.config).onSettled)==null?void 0:l.call(o,f,null,this.state.variables,this.state.context,this)),await((d=(p=this.options).onSettled)==null?void 0:d.call(p,f,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:f}),f}catch(f){try{var b,E,D,P,O,S,Q,T;throw await((b=(E=this.mutationCache.config).onError)==null?void 0:b.call(E,f,this.state.variables,this.state.context,this)),await((D=(P=this.options).onError)==null?void 0:D.call(P,f,this.state.variables,this.state.context)),await((O=(S=this.mutationCache.config).onSettled)==null?void 0:O.call(S,void 0,f,this.state.variables,this.state.context,this)),await((Q=(T=this.options).onSettled)==null?void 0:Q.call(T,void 0,f,this.state.variables,this.state.context)),f}finally{this.dispatch({type:"error",error:f})}}}dispatch(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Ht(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...n,...e.state}}};this.state=r(this.state),J.batch(()=>
1{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function ua(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Ds extends Ke{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const a=new Os({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?e.getMutationDefaults(r.mutationKey):void 0});return this.add(a),a}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(r=>r!==e),this.notify({type:"removed",mutation:e})}clear(){J.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(r=>sn(e,r))}findAll(e){return this.mutations.filter(r=>sn(e,r))}notify(e){J.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return J.batch(()=>r.reduce((n,a)=>n.then(()=>a.continue().catch(ue)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function or(){return{onFetch:t=>{t.fetchFn=()=>{var e,r,n,a,i,s;const l=(e=t.fetchOptions)==null||(r=e.meta)==null?void 0:r.refetchPage,o=(n=t.fetchOptions)==null||(a=n.meta)==null?void 0:a.fetchMore,d=o==null?void 0:o.pageParam,p=(o==null?void 0:o.direction)==="forward",h=(o==null?void 0:o.direction)==="backward",v=((i=t.state.data)==null?void 0:i.pages)||[],u=((s=t.state.data)==null?void 0:s.pageParams)||[];let m=u,b=!1;const E=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>{var f;if((f=t.signal)!=null&&f.aborted)b=!0;else{var C;(C=t.signal)==null||C.addEventListener("abort",()=>{b=!0})}return t.signal}})},D=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),P=(T,f,C,_)=>(m=_?[f,...m]:[...m,f],_?[C,...T]:[...T,C]),O=(T,f,C,_)=>{if(b)return Promise.reject("Cancelled");if(typeof C>"u"&&!f&&T.length)return Promise.resolve(T);const q={queryKey:t.queryKey,pageParam:C,meta:t.options.meta};E(q);const W=D(q);return Promise.resolve(W).then(oe=>P(T,C,oe,_))};let S;if(!v.length)S=O([]);else if(p){const T=typeof d<"u",f=T?d:lr(t.options,v);S=O(v,T,f)}else if(h){const T=typeof d<"u",f=T?d:ca(t.options,v);S=O(v,T,f,!0)}else{m=[];const T=typeof t.options.getNextPageParam>"u";S=(l&&v[0]?l(v[0],0,v):!0)?O([],T,u[0]):Promise.resolve(P([],u[0],v[0]));for(let C=1;C<v.length;C++)S=S.then(_=>{if(l&&v[C]?l(v[C],C,v):!0){const W=T?u[C]:lr(t.options,_);return O(_,T,W)}return Promise.resolve(P(_,u[C],v[C]))})}return S.then(T=>({pages:T,pageParams:m}))}}}}function lr(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function ca(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function Ms(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=lr(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function Fs(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=ca(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class ks{constructor(e={}){this.queryCache=e.queryCache||new xs,this.mutationCache=e.mutationCache||new Ds,this.logger=e.logger||Cr,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Nt.subscribe(()=>{Nt.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=qt.subscribe(()=>{qt.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,r;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(e,r){const[n]=Oe(e,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state.data}ensureQueryData(e,r,n){const a=et(e,r,n),i=this.getQueryData(a.queryKey);return i?Promise.resolve(i):this.fetchQuery(a)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:r,state:n})=>{const a=n.data;return[r,a]})}setQueryData(e,r,n){const a=this.queryCache.find(e),i=a==null?void 0:a.state.data,s=vs(r,i);if(typeof s>"u")return;const l=et(e),o=this.defaultQueryOptions(l);return this.queryCache.build(this,o).setData(s,{...n,manual:!0})}
1setQueriesData(e,r,n){return J.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,r,n)]))}getQueryState(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state}removeQueries(e,r){const[n]=Oe(e,r),a=this.queryCache;J.batch(()=>{a.findAll(n).forEach(i=>{a.remove(i)})})}resetQueries(e,r,n){const[a,i]=Oe(e,r,n),s=this.queryCache,l={type:"active",...a};return J.batch(()=>(s.findAll(a).forEach(o=>{o.reset()}),this.refetchQueries(l,i)))}cancelQueries(e,r,n){const[a,i={}]=Oe(e,r,n);typeof i.revert>"u"&&(i.revert=!0);const s=J.batch(()=>this.queryCache.findAll(a).map(l=>l.cancel(i)));return Promise.all(s).then(ue).catch(ue)}invalidateQueries(e,r,n){const[a,i]=Oe(e,r,n);return J.batch(()=>{var s,l;if(this.queryCache.findAll(a).forEach(d=>{d.invalidate()}),a.refetchType==="none")return Promise.resolve();const o={...a,type:(s=(l=a.refetchType)!=null?l:a.type)!=null?s:"active"};return this.refetchQueries(o,i)})}refetchQueries(e,r,n){const[a,i]=Oe(e,r,n),s=J.batch(()=>this.queryCache.findAll(a).filter(o=>!o.isDisabled()).map(o=>{var d;return o.fetch(void 0,{...i,cancelRefetch:(d=i==null?void 0:i.cancelRefetch)!=null?d:!0,meta:{refetchPage:a.refetchPage}})}));let l=Promise.all(s).then(ue);return i!=null&&i.throwOnError||(l=l.catch(ue)),l}fetchQuery(e,r,n){const a=et(e,r,n),i=this.defaultQueryOptions(a);typeof i.retry>"u"&&(i.retry=!1);const s=this.queryCache.build(this,i);return s.isStaleByTime(i.staleTime)?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(e,r,n){return this.fetchQuery(e,r,n).then(ue).catch(ue)}fetchInfiniteQuery(e,r,n){const a=et(e,r,n);return a.behavior=or(),this.fetchQuery(a)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(ue).catch(ue)}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,r){const n=this.queryDefaults.find(a=>ze(e)===ze(a.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>_t(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(a=>ze(e)===ze(a.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>_t(e,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const r={...this.defaultOptions.queries,...this.getQueryDefaults(e==null?void 0:e.queryKey),...e,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=Pr(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e==null?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class xr extends Ke{constructor(e,r){super(),this.client=e,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),dn(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ur(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ur(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,r){const n=this.options,a=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),ar(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const i=this.hasListeners();i&&hn(this.currentQuery,a,this.options,n)&&this.executeFetch(),this.updateResult(r),i&&(this.currentQuery!==a||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();i&&(this.currentQuery!==a||this.options.enabled!==n.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(e){const r=this.client.getQueryCache().build(this.client,e);return this.createResult(r,e)}getCurrentResult(){return this.currentResult}trackResult(e){const r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...r}={}){return this.fetch({...r,meta:{refetchPage:e}})}fetchOptimistic(e){const r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){var r;return this.executeFetch({...e,cancelRefetch:(r=e.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let r=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(ue)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),pt||this.currentResult.isStale||!nr(this.options.staleTime))return;const r=ra(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(pt||this.options.enabled===!1||!nr(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>
1{(this.options.refetchIntervalInBackground||Nt.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,r){const n=this.currentQuery,a=this.options,i=this.currentResult,s=this.currentResultState,l=this.currentResultOptions,o=e!==n,d=o?e.state:this.currentQueryInitialState,p=o?this.currentResult:this.previousQueryResult,{state:h}=e;let{dataUpdatedAt:v,error:u,errorUpdatedAt:m,fetchStatus:b,status:E}=h,D=!1,P=!1,O;if(r._optimisticResults){const C=this.hasListeners(),_=!C&&dn(e,r),q=C&&hn(e,n,r,a);(_||q)&&(b=Ht(e.options.networkMode)?"fetching":"paused",v||(E="loading")),r._optimisticResults==="isRestoring"&&(b="idle")}if(r.keepPreviousData&&!h.dataUpdatedAt&&p!=null&&p.isSuccess&&E!=="error")O=p.data,v=p.dataUpdatedAt,E=p.status,D=!0;else if(r.select&&typeof h.data<"u")if(i&&h.data===(s==null?void 0:s.data)&&r.select===this.selectFn)O=this.selectResult;else try{this.selectFn=r.select,O=r.select(h.data),O=sr(i==null?void 0:i.data,O,r),this.selectResult=O,this.selectError=null}catch(C){this.selectError=C}else O=h.data;if(typeof r.placeholderData<"u"&&typeof O>"u"&&E==="loading"){let C;if(i!=null&&i.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData))C=i.data;else if(C=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof C<"u")try{C=r.select(C),this.selectError=null}catch(_){this.selectError=_}typeof C<"u"&&(E="success",O=sr(i==null?void 0:i.data,C,r),P=!0)}this.selectError&&(u=this.selectError,O=this.selectResult,m=Date.now(),E="error");const S=b==="fetching",Q=E==="loading",T=E==="error";return{status:E,fetchStatus:b,isLoading:Q,isSuccess:E==="success",isError:T,isInitialLoading:Q&&S,data:O,dataUpdatedAt:v,error:u,errorUpdatedAt:m,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!Q,isLoadingError:T&&h.dataUpdatedAt===0,isPaused:b==="paused",isPlaceholderData:P,isPreviousData:D,isRefetchError:T&&h.dataUpdatedAt!==0,isStale:Or(e,r),refetch:this.refetch,remove:this.remove}}updateResult(e){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,ar(n,r))return;this.currentResult=n;const a={cache:!0},i=()=>
1{if(!r)return!0;const{notifyOnChangeProps:s}=this.options;if(s==="all"||!s&&!this.trackedProps.size)return!0;const l=new Set(s!=null?s:this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(o=>{const d=o;return this.currentResult[d]!==r[d]&&l.has(d)})};(e==null?void 0:e.listeners)!==!1&&i()&&(a.listeners=!0),this.notify({...a,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const r={};e.type==="success"?r.onSuccess=!e.manual:e.type==="error"&&!Tt(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){J.batch(()=>{if(e.onSuccess){var r,n,a,i;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(a=(i=this.options).onSettled)==null||a.call(i,this.currentResult.data,null)}else if(e.onError){var s,l,o,d;(s=(l=this.options).onError)==null||s.call(l,this.currentResult.error),(o=(d=this.options).onSettled)==null||o.call(d,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:p})=>{p(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function Ls(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function dn(t,e){return Ls(t,e)||t.state.dataUpdatedAt>0&&ur(t,e,e.refetchOnMount)}function ur(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Or(t,e)}return!1}function hn(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&Or(t,r)}function Or(t,e){return t.isStaleByTime(e.staleTime)}class Us extends Ke{constructor(e,r){super(),this.client=e,this.queries=[],this.result=[],this.observers=[],this.observersMap={},r&&this.setQueries(r)}onSubscribe(){this.listeners.size===1&&this.observers.forEach(e=>{e.subscribe(r=>{this.onUpdate(e,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.observers.forEach(e=>{e.destroy()})}setQueries(e,r){this.queries=e,J.batch(()=>{const n=this.observers,a=this.findMatchingObservers(this.queries);a.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions,r));const i=a.map(d=>d.observer),s=Object.fromEntries(i.map(d=>[d.options.queryHash,d])),l=i.map(d=>d.getCurrentResult()),o=i.some((d,p)=>d!==n[p]);n.length===i.length&&!o||(this.observers=i,this.observersMap=s,this.result=l,this.hasListeners()&&(nn(n,i).forEach(d=>{d.destroy()}),nn(i,n).forEach(d=>{d.subscribe(p=>{this.onUpdate(d,p)})}),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(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions))}
1findMatchingObservers(e){const r=this.observers,n=new Map(r.map(u=>[u.options.queryHash,u])),a=e.map(u=>this.client.defaultQueryOptions(u)),i=a.flatMap(u=>{const m=n.get(u.queryHash);return m!=null?[{defaultedQueryOptions:u,observer:m}]:[]}),s=new Set(i.map(u=>u.defaultedQueryOptions.queryHash)),l=a.filter(u=>!s.has(u.queryHash)),o=new Set(i.map(u=>u.observer)),d=r.filter(u=>!o.has(u)),p=u=>{const m=this.client.defaultQueryOptions(u),b=this.observersMap[m.queryHash];return b!=null?b:new xr(this.client,m)},h=l.map((u,m)=>{if(u.keepPreviousData){const b=d[m];if(b!==void 0)return{defaultedQueryOptions:u,observer:b}}return{defaultedQueryOptions:u,observer:p(u)}}),v=(u,m)=>a.indexOf(u.defaultedQueryOptions)-a.indexOf(m.defaultedQueryOptions);return i.concat(h).sort(v)}onUpdate(e,r){const n=this.observers.indexOf(e);n!==-1&&(this.result=ms(this.result,n,r),this.notify())}notify(){J.batch(()=>{this.listeners.forEach(({listener:e})=>{e(this.result)})})}}class Ts extends xr{constructor(e,r){super(e,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,r){super.setOptions({...e,behavior:or()},r)}getOptimisticResult(e){return e.behavior=or(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,r){var n,a,i,s,l,o;const{state:d}=e,p=super.createResult(e,r),{isFetching:h,isRefetching:v}=p,u=h&&((n=d.fetchMeta)==null||(a=n.fetchMore)==null?void 0:a.direction)==="forward",m=h&&((i=d.fetchMeta)==null||(s=i.fetchMore)==null?void 0:s.direction)==="backward";return{...p,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ms(r,(l=d.data)==null?void 0:l.pages),hasPreviousPage:Fs(r,(o=d.data)==null?void 0:o.pages),isFetchingNextPage:u,isFetchingPreviousPage:m,isRefetching:v&&!u&&!m}}}class Is extends Ke{constructor(e,r){super(),this.client=e,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=this.client.defaultMutationOptions(e),ar(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const r={listeners:!0};e.type==="success"?r.onSuccess=!0:e.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:ua(),r={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){J.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var r,n,a,i;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(a=(i=this.mutateOptions).onSettled)==null||a.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var s,l,o,d;(s=(l=this.mutateOptions).onError)==null||s.call(l,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(o=(d=this.mutateOptions).onSettled)==null||o.call(d,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}
1e.listeners&&this.listeners.forEach(({listener:p})=>{p(this.currentResult)})})}}var Jt={exports:{}},Yt={};var fn;function As(){if(fn)return Yt;fn=1;var t=Ba();function e(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,a=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function l(h,v){var u=v(),m=n({inst:{value:u,getSnapshot:v}}),b=m[0].inst,E=m[1];return i(function(){b.value=u,b.getSnapshot=v,o(b)&&E({inst:b})},[h,u,v]),a(function(){return o(b)&&E({inst:b}),h(function(){o(b)&&E({inst:b})})},[h]),s(u),u}function o(h){var v=h.getSnapshot;h=h.value;try{var u=v();return!r(h,u)}catch{return!0}}function d(h,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Yt.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,Yt}var pn;function js(){return pn||(pn=1,Jt.exports=As()),Jt.exports}var Qs=js();const Dr=Qs.useSyncExternalStore,yn=R.createContext(void 0),da=R.createContext(!1);function ha(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=yn),window.ReactQueryClientContext):yn)}const Mr=({context:t}={})=>{const e=R.useContext(ha(t,R.useContext(da)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},zs=({client:t,children:e,context:r,contextSharing:n=!1})=>{R.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const a=ha(r,n);return R.createElement(da.Provider,{value:!r&&n},R.createElement(a.Provider,{value:t},e))},fa=R.createContext(!1),pa=()=>R.useContext(fa);fa.Provider;function _s(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Ns=R.createContext(_s()),ya=()=>R.useContext(Ns);function va(t,e){return typeof t=="function"?t(...e):!!t}const ma=(t,e)=>{(t.suspense||t.useErrorBoundary)&&(e.isReset()||(t.retryOnMount=!1))},ga=t=>{R.useEffect(()=>{t.clearReset()},[t])},ba=({result:t,errorResetBoundary:e,useErrorBoundary:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&va(r,[t.error,n]),Ra=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},Ea=(t,e)=>t.isLoading&&t.isFetching&&!e,cr=(t,e,r)=>(t==null?void 0:t.suspense)&&Ea(e,r),dr=(t,e,r)=>e.fetchOptimistic(t).then(({data:n})=>{t.onSuccess==null||t.onSuccess(n),t.onSettled==null||t.onSettled(n,null)}).catch(n=>{r.clearReset(),t.onError==null||t.onError(n),t.onSettled==null||t.onSettled(void 0,n)});function Ks({queries:t,context:e}){const r=Mr({context:e}),n=pa(),a=ya(),i=R.useMemo(()=>t.map(v=>{const u=r.defaultQueryOptions(v);return u._optimisticResults=n?"isRestoring":"optimistic",u}),[t,r,n]);i.forEach(v=>{Ra(v),ma(v,a)}),ga(a);const[s]=R.useState(()=>new Us(r,i)),l=s.getOptimisticResult(i);Dr(R.useCallback(v=>n?()=>{}:s.subscribe(J.batchCalls(v)),[s,n]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),R.useEffect(()=>{s.setQueries(i,{listeners:!1})},[i,s]);const d=l.some((v,u)=>cr(i[u],v,n))?l.flatMap((v,u)=>{const m=i[u],b=s.getObservers()[u];if(m&&b){if(cr(m,v,n))return dr(m,b,a);Ea(v,n)&&dr(m,b,a)}return[]}):[];if(d.length>0)throw Promise.all(d);const p=s.getQueries(),h=l.find((v,u)=>{var m,b;return ba({result:v,errorResetBoundary:a,useErrorBoundary:(m=(b=i[u])==null?void 0:b.useErrorBoundary)!=null?m:!1,query:p[u]})});if(h!=null&&h.error)throw h.error;return l}function wa(t,e){const r=Mr({context:t.context}),n=pa(),a=ya(),i=r.defaultQueryOptions(t);i._optimisticResults=n?"isRestoring":"optimistic",i.onError&&(i.onError=J.batchCalls(i.onError)),i.onSuccess&&(i.onSuccess=J.batchCalls(i.onSuccess)),i.onSettled&&(i.onSettled=J.batchCalls(i.onSettled)),Ra(i),ma(i,a),ga(a);const[s]=R.useState(()=>new e(r,i)),l=s.getOptimisticResult(i);if(Dr(R.useCallback(o=>{const d=n?()=>{}:s.subscribe(J.batchCalls(o));return s.updateResult(),d},[s,n]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),R.useEffect(()=>{s.setOptions(i,{listeners:!1})},[i,s]),cr(i,l,n))throw dr(i,s,a);if(ba({result:l,errorResetBoundary:a,useErrorBoundary:i.useErrorBoundary,query:s.getCurrentQuery()}))throw l.error;return i.notifyOnChangeProps?l:s.trackResult(l)}function Ws(t,e,r){const n=et(t,e,r);return wa(n,xr)}function Vs(t,e,r){const n=gs(t,e,r),a=Mr({context:n.context}
1),[i]=R.useState(()=>new Is(a,n));R.useEffect(()=>{i.setOptions(n)},[i,n]);const s=Dr(R.useCallback(o=>i.subscribe(J.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=R.useCallback((o,d)=>{i.mutate(o,d).catch(qs)},[i]);if(s.error&&va(i.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}function qs(){}function Gs(t,e,r){const n=et(t,e,r);return wa(n,Ts)}const Js=Ha(ys);export{Bt as $,ve as A,fe as B,zi as C,br as D,It as E,dt as F,Rr as G,ta as H,Dn as I,ht as J,us as K,V as L,is as M,ss as N,os as O,ea as P,ks as Q,ns as R,ls as S,rt as T,ps as U,ft as V,Pn as W,bn as X,wn as Y,he as Z,se as _,Kn as a,Cn as a0,fs as a1,xn as a2,yr as a3,Yi as a4,$i as a5,Zn as a6,Ie as a7,Gi as a8,Ii as a9,Vn as aa,Qi as ab,Wi as ac,Ji as ad,Jn as ae,Hs as af,Js as ag,Gs as ah,Ks as ai,Ai as b,Xn as c,Ki as d,zs as e,Nt as f,Vs as g,Mr as h,Se as i,nt as j,_i as k,Ln as l,ka as m,wr as n,Sr as o,za as p,Te as q,Ti as r,Le as s,Gn as t,Ws as u,mt as v,Vi as w,Zi as x,pe as y,A as z};

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.