function en(t,s){for(var e=0;eo[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var ur=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function we(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ne={exports:{}},It={};var Ne;function sn(){if(Ne)return It;Ne=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function e(o,n,r){var i=null;if(r!==void 0&&(i=""+r),n.key!==void 0&&(i=""+n.key),"key"in n){r={};for(var a in n)a!=="key"&&(r[a]=n[a])}else r=n;return n=r.ref,{$$typeof:t,type:o,key:i,ref:n!==void 0?n:null,props:r}}return It.Fragment=s,It.jsx=e,It.jsxs=e,It}var ze;function nn(){return ze||(ze=1,ne.exports=sn()),ne.exports}var T=nn(),oe={exports:{}},A={};var Ue;function on(){if(Ue)return A;Ue=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),h=Symbol.iterator;function d(p){return p===null||typeof p!="object"?null:(p=h&&p[h]||p["@@iterator"],typeof p=="function"?p:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,y={};function v(p,_,O){this.props=p,this.context=_,this.refs=y,this.updater=O||m}v.prototype.isReactComponent={},v.prototype.setState=function(p,_){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,_,"setState")},v.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function R(){}R.prototype=v.prototype;function b(p,_,O){this.props=p,this.context=_,this.refs=y,this.updater=O||m}var x=b.prototype=new R;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var P=Array.isArray;function I(){}var S={H:null,A:null,T:null,S:null},C=Object.prototype.hasOwnProperty;function w(p,_,O){var M=O.ref;return{$$typeof:t,type:p,key:_,ref:M!==void 0?M:null,props:O}}function k(p,_){return w(p.type,_,p.props)}function L(p){return typeof p=="object"&&p!==null&&p.$$typeof===t}function N(p){var _={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(O){return _[O]})}var F=/\/+/g;function V(p,_){return typeof p=="object"&&p!==null&&p.key!=null?N(""+p.key):_.toString(36)}function H(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(I,I):(p.status="pending",p.then(function(_){p.status==="pending"&&(p.status="fulfilled",p.value=_)},function(_){p.status==="pending"&&(p.status="rejected",p.reason=_)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function G(p,_,O,M,j){var B=typeof p;(B==="undefined"||B==="boolean")&&(p=null);var D=!1;if(p===null)D=!0;else switch(B){case"bigint":case"string":case"number":D=!0;break;case"object":switch(p.$$typeof){case t:case s:D=!0;break;case u:return D=p._init,G(D(p._payload),_,O,M,j)}}if(D)return j=j(p),D=M===""?"."+V(p,0):M,P(j)?(O="",D!=null&&(O=D.replace(F,"$&/")+"/"),G(j,_,O,"",function(St){return St})):j!=null&&(L(j)&&(j=k(j,O+(j.key==null||p&&p.key===j.key?"":(""+j.key).replace(F,"$&/")+"/")+D)),_.push(j)),1;D=0;var q=M===""?".":M+":";if(P(p))for(var W=0;W"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),re.exports=rn(),re.exports}var Ve=E.use,jt=typeof window<"u"?E.useLayoutEffect:E.useEffect;function ie(t){const s=E.useRef({value:t,prev:null}),e=s.current.value;return t!==e&&(s.current={value:t,prev:e}),s.current.prev}function cn(t,s,e={},o={}){E.useEffect(()=>{if(!t.current||o.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([r])=>{s(r)},e);return n.observe(t.current),()=>{n.disconnect()}},[s,e,o.disabled,t])}function ln(t){const s=E.useRef(null);return E.useImperativeHandle(t,()=>s.current,[]),s}var bs=!1;function Bt(t){return t[t.length-1]}function un(t){return typeof t=="function"}function nt(t,s){return un(t)?t(s):t}var fn=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,hn=()=>Object.create(null),ft=(t,s)=>ot(t,s,hn);function ot(t,s,e=()=>({}),o=0){if(t===s)return t;if(o>500)return s;const n=s,r=Ye(t)&&Ye(n);if(!r&&!(Ct(t)&&Ct(n)))return n;const i=r?t:Ke(t);if(!i)return n;const a=r?n:Ke(n);if(!a)return n;const l=i.length,c=a.length,u=r?new Array(c):e();let f=0;for(let h=0;h"u")return!0;const e=s.prototype;return!(!Ge(e)||!e.hasOwnProperty("isPrototypeOf"))}function Ge(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ye(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function pt(t,s,e){if(t===s)return!0;if(typeof t!=typeof s)return!1;if(Array.isArray(t)&&Array.isArray(s)){if(t.length!==s.length)return!1;for(let o=0,n=t.length;on||!pt(t[i],s[i],e)))return!1;return n===r}return!1}function Mt(t){let s,e;const o=new Promise((n,r)=>{s=n,e=r});return o.status="pending",o.resolve=n=>{o.status="resolved",o.value=n,s(n),t?.(n)},o.reject=n=>{o.status="rejected",e(n)},o}function dn(t){return typeof t?.message!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}function Dt(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function pn(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function Je(t){let s;try{s=decodeURI(t)}catch{s=t.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return pn(s)}var mn=["http:","https:","mailto:","tel:"];function Kt(t,s){if(!t)return!1;try{const e=new URL(t);return!s.has(e.protocol)}catch{return!1}}function Lt(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const s=/%25|%5C/gi;let e=0,o="",n;for(;(n=s.exec(t))!==null;)o+=Je(t.slice(e,n.index))+n[0],e=s.lastIndex;o=o+Je(e?t.slice(e):t);let r=!1;return o.startsWith("//")&&(r=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:r}}function gn(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}function vn(t,s){if(t===s)return!0;if(t.length!==s.length)return!1;for(let e=0;e{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,o&&(o.next=r,r.prev=o)):(r.next.prev=void 0,e=r.next,r.next=void 0,o&&(r.prev=o,o.next=r)),o=r)};return{get(r){const i=s.get(r);if(i)return n(i),i.value},set(r,i){if(s.size>=t&&e){const l=e;s.delete(l.key),l.next&&(e=l.next,l.next.prev=void 0),l===o&&(o=void 0)}const a=s.get(r);if(a)a.value=i,n(a);else{const l={key:r,value:i,prev:o};o&&(o.next=l),o=l,e||(e=l),s.set(r,l)}},clear(){s.clear(),e=void 0,o=void 0}}}var ht=4,ws=5;function yn(t){const s=t.indexOf("{");if(s===-1)return null;const e=t.indexOf("}",s);return e===-1||s+1>=t.length?null:[s,e]}function Pe(t,s,e=new Uint16Array(6)){const o=t.indexOf("/",s),n=o===-1?t.length:o,r=t.substring(s,n);if(!r||!r.includes("$"))return e[0]=0,e[1]=s,e[2]=s,e[3]=n,e[4]=n,e[5]=n,e;if(r==="$"){const a=t.length;return e[0]=2,e[1]=s,e[2]=s,e[3]=a,e[4]=a,e[5]=a,e}if(r.charCodeAt(0)===36)return e[0]=1,e[1]=s,e[2]=s+1,e[3]=n,e[4]=n,e[5]=n,e;const i=yn(r);if(i){const[a,l]=i,c=r.charCodeAt(a+1);if(c===45){if(a+2!S.skipOnParamError&&S.caseSensitive===b&&S.prefix===x&&S.suffix===P);if(I)m=I;else{const S=ce(1,e.fullPath??e.from,b,x,P);m=S,S.depth=r,S.parent=n,n.dynamic??=[],n.dynamic.push(S)}break}case 3:{const v=l.substring(g,d[1]),R=l.substring(d[4],y),b=u&&!!(v||R),x=v?b?v:v.toLowerCase():void 0,P=R?b?R:R.toLowerCase():void 0,I=!f&&n.optional?.find(S=>!S.skipOnParamError&&S.caseSensitive===b&&S.prefix===x&&S.suffix===P);if(I)m=I;else{const S=ce(3,e.fullPath??e.from,b,x,P);m=S,S.parent=n,S.depth=r,n.optional??=[],n.optional.push(S)}break}case 2:{const v=l.substring(g,d[1]),R=l.substring(d[4],y),b=u&&!!(v||R),x=v?b?v:v.toLowerCase():void 0,P=R?b?R:R.toLowerCase():void 0,I=ce(2,e.fullPath??e.from,b,x,P);m=I,I.parent=n,I.depth=r,n.wildcard??=[],n.wildcard.push(I)}}n=m}if(f&&e.children&&!e.isRoot&&e.id&&e.id.charCodeAt(e.id.lastIndexOf("/")+1)===95){const d=dt(e.fullPath??e.from);d.kind=ws,d.parent=n,r++,d.depth=r,n.pathless??=[],n.pathless.push(d),n=d}const h=(e.path||!e.children)&&!e.isRoot;if(h&&l.endsWith("/")){const d=dt(e.fullPath??e.from);d.kind=ht,d.parent=n,r++,d.depth=r,n.index=d,n=d}n.parse=e.options?.params?.parse??null,n.skipOnParamError=f,n.parsingPriority=e.options?.skipRouteOnParseError?.priority??0,h&&!n.route&&(n.route=e,n.fullPath=e.fullPath??e.from)}if(e.children)for(const l of e.children)Qt(t,s,l,a,n,r,i)}function ae(t,s){if(t.skipOnParamError&&!s.skipOnParamError)return-1;if(!t.skipOnParamError&&s.skipOnParamError)return 1;if(t.skipOnParamError&&s.skipOnParamError&&(t.parsingPriority||s.parsingPriority))return s.parsingPriority-t.parsingPriority;if(t.prefix&&s.prefix&&t.prefix!==s.prefix){if(t.prefix.startsWith(s.prefix))return-1;if(s.prefix.startsWith(t.prefix))return 1}if(t.suffix&&s.suffix&&t.suffix!==s.suffix){if(t.suffix.endsWith(s.suffix))return-1;if(s.suffix.endsWith(t.suffix))return 1}return t.prefix&&!s.prefix?-1:!t.prefix&&s.prefix?1:t.suffix&&!s.suffix?-1:!t.suffix&&s.suffix?1:t.caseSensitive&&!s.caseSensitive?-1:!t.caseSensitive&&s.caseSensitive?1:0}function st(t){if(t.pathless)for(const s of t.pathless)st(s);if(t.static)for(const s of t.static.values())st(s);if(t.staticInsensitive)for(const s of t.staticInsensitive.values())st(s);if(t.dynamic?.length){t.dynamic.sort(ae);for(const s of t.dynamic)st(s)}if(t.optional?.length){t.optional.sort(ae);for(const s of t.optional)st(s)}if(t.wildcard?.length){t.wildcard.sort(ae);for(const s of t.wildcard)st(s)}}function dt(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function ce(t,s,e,o,n){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:s,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:e,prefix:o,suffix:n}}function Sn(t,s){const e=dt("/"),o=new Uint16Array(6);for(const n of t)Qt(!1,o,n,1,e,0);st(e),s.masksTree=e,s.flatCache=Ft(1e3)}function Rn(t,s){t||="/";const e=s.flatCache.get(t);if(e)return e;const o=Ce(t,s.masksTree);return s.flatCache.set(t,o),o}function _n(t,s,e,o,n){t||="/",o||="/";const r=s?`case\0${t}`:t;let i=n.singleCache.get(r);return i||(i=dt("/"),Qt(s,new Uint16Array(6),{from:t},1,i,0),n.singleCache.set(r,i)),Ce(o,i,e)}function xn(t,s,e=!1){const o=e?t:`nofuzz\0${t}`,n=s.matchCache.get(o);if(n!==void 0)return n;t||="/";let r;try{r=Ce(t,s.segmentTree,e)}catch(i){if(i instanceof URIError)r=null;else throw i}return r&&(r.branch=Pn(r.route)),s.matchCache.set(o,r),r}function bn(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function wn(t,s=!1,e){const o=dt(t.fullPath),n=new Uint16Array(6),r={},i={};let a=0;return Qt(s,n,t,1,o,0,l=>{if(e?.(l,a),l.id in r&&et(),r[l.id]=l,a!==0&&l.path){const c=bn(l.fullPath);(!i[c]||l.fullPath.endsWith("/"))&&(i[c]=l)}a++}),st(o),{processedTree:{segmentTree:o,singleCache:Ft(1e3),matchCache:Ft(1e3),flatCache:null,masksTree:null},routesById:r,routesByPath:i}}function Ce(t,s,e=!1){const o=t.split("/"),n=Mn(t,o,s,e);if(!n)return null;const[r]=Ps(t,o,n);return{route:n.node.route,rawParams:r,parsedParams:n.parsedParams}}function Ps(t,s,e){const o=Cn(e.node);let n=null;const r=Object.create(null);let i=e.extract?.part??0,a=e.extract?.node??0,l=e.extract?.path??0,c=e.extract?.segment??0;for(;a=0;L--){const N=h.optional[L];a.push({node:N,index:d,skipped:w,depth:k,statics:y,dynamics:v,optionals:R,extract:b,rawParams:x,parsedParams:P})}if(!I)for(let L=h.optional.length-1;L>=0;L--){const N=h.optional[L],{prefix:F,suffix:V}=N;if(F||V){const H=N.caseSensitive?S:C??=S.toLowerCase();if(F&&!H.startsWith(F)||V&&!H.endsWith(V))continue}a.push({node:N,index:d+1,skipped:m,depth:k,statics:y,dynamics:v,optionals:R+1,extract:b,rawParams:x,parsedParams:P})}}if(!I&&h.dynamic&&S)for(let w=h.dynamic.length-1;w>=0;w--){const k=h.dynamic[w],{prefix:L,suffix:N}=k;if(L||N){const F=k.caseSensitive?S:C??=S.toLowerCase();if(L&&!F.startsWith(L)||N&&!F.endsWith(N))continue}a.push({node:k,index:d+1,skipped:m,depth:g+1,statics:y,dynamics:v+1,optionals:R,extract:b,rawParams:x,parsedParams:P})}if(!I&&h.staticInsensitive){const w=h.staticInsensitive.get(C??=S.toLowerCase());w&&a.push({node:w,index:d+1,skipped:m,depth:g+1,statics:y+1,dynamics:v,optionals:R,extract:b,rawParams:x,parsedParams:P})}if(!I&&h.static){const w=h.static.get(S);w&&a.push({node:w,index:d+1,skipped:m,depth:g+1,statics:y+1,dynamics:v,optionals:R,extract:b,rawParams:x,parsedParams:P})}if(h.pathless){const w=g+1;for(let k=h.pathless.length-1;k>=0;k--){const L=h.pathless[k];a.push({node:L,index:d,skipped:m,depth:w,statics:y,dynamics:v,optionals:R,extract:b,rawParams:x,parsedParams:P})}}}if(u&&l)return Tt(l,u)?u:l;if(u)return u;if(l)return l;if(o&&c){let f=c.index;for(let d=0;dt.statics||s.statics===t.statics&&(s.dynamics>t.dynamics||s.dynamics===t.dynamics&&(s.optionals>t.optionals||s.optionals===t.optionals&&((s.node.kind===ht)>(t.node.kind===ht)||s.node.kind===ht==(t.node.kind===ht)&&s.depth>t.depth))):!0}function Wt(t){return Me(t.filter(s=>s!==void 0).join("/"))}function Me(t){return t.replace(/\/{2,}/g,"/")}function Cs(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function it(t){const s=t.length;return s>1&&t[s-1]==="/"?t.replace(/\/{1,}$/,""):t}function Ms(t){return it(Cs(t))}function Gt(t,s){return t?.endsWith("/")&&t!=="/"&&t!==`${s}/`?t.slice(0,-1):t}function En(t,s,e){return Gt(t,e)===Gt(s,e)}function In({base:t,to:s,trailingSlash:e="never",cache:o}){const n=s.startsWith("/"),r=!n&&s===".";let i;if(o){i=n?s:r?t:t+"\0"+s;const f=o.get(i);if(f)return f}let a;if(r)a=t.split("/");else if(n)a=s.split("/");else{for(a=t.split("/");a.length>1&&Bt(a)==="";)a.pop();const f=s.split("/");for(let h=0,d=f.length;h1&&(Bt(a)===""?e==="never"&&a.pop():e==="always"&&a.push(""));let l,c="";for(let f=0;f0&&(c+="/");const h=a[f];if(!h)continue;l=Pe(h,0,l);const d=l[0];if(d===0){c+=h;continue}const m=l[5],g=h.substring(0,l[1]),y=h.substring(l[4],m),v=h.substring(l[2],l[3]);d===1?c+=g||y?`${g}{$${v}}${y}`:`$${v}`:d===2?c+=g||y?`${g}{$}${y}`:"$":c+=`${g}{-$${v}}${y}`}c=Me(c);const u=c||"/";return i&&o&&o.set(i,u),u}function Ln(t){const s=new Map(t.map(n=>[encodeURIComponent(n),n])),e=Array.from(s.keys()).map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(e,"g");return n=>n.replace(o,r=>s.get(r)??r)}function ue(t,s,e){const o=s[t];return typeof o!="string"?o:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(n=>Ze(n,e)).join("/"):Ze(o,e)}function Xe({path:t,params:s,decoder:e,...o}){let n=!1;const r=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:r,isMissingParams:n};if(!t.includes("$"))return{interpolatedPath:t,usedParams:r,isMissingParams:n};const i=t.length;let a=0,l,c="";for(;a{s=nt(o,s)||s},persist:()=>{try{t.setItem(On,JSON.stringify(s))}catch{}}}}var Qe=kn(),An=t=>t.state.__TSR_key||t.href;function jn(t){const s=[];let e;for(;e=t.parentNode;)s.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${s.reverse().join(" > ")}`.toLowerCase()}var Ut=!1,Ot="window",ts="data-scroll-restoration-id";function Bn(t,s){if(!Qe)return;const e=Qe;if((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!e)return;t.isScrollRestorationSetup=!0,Ut=!1;const o=t.options.getScrollRestorationKey||An,n=new Map;window.history.scrollRestoration="manual";const r=a=>{if(!(Ut||!t.isScrollRestoring))if(a.target===document||a.target===window)n.set(Ot,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;n.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},i=a=>{if(!t.isScrollRestoring||!a||n.size===0||!e)return;const l=e.state[a]||={};for(const[c,u]of n){let f;if(c===Ot)f=Ot;else if(c.isConnected){const h=c.getAttribute(ts);f=h?`[${ts}="${h}"]`:jn(c)}f&&(l[f]=u)}};document.addEventListener("scroll",r,!0),t.subscribe("onBeforeLoad",a=>{i(a.fromLocation?o(a.fromLocation):void 0),n.clear()}),window.addEventListener("pagehide",()=>{i(o(t.stores.resolvedLocation.state??t.stores.location.state)),e.persist()}),t.subscribe("onRendered",a=>{const l=o(a.toLocation),c=t.options.scrollRestorationBehavior,u=t.options.scrollToTopSelectors;if(n.clear(),!t.resetNextScroll){t.resetNextScroll=!0;return}if(!(typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))){Ut=!0;try{const f=t.isScrollRestoring?e.state[l]:void 0;let h=!1;if(f)for(const d in f){const m=f[d];if(!Ct(m))continue;const{scrollX:g,scrollY:y}=m;if(!(!Number.isFinite(g)||!Number.isFinite(y))){if(d===Ot)window.scrollTo({top:y,left:g,behavior:c}),h=!0;else if(d){let v;try{v=document.querySelector(d)}catch{continue}v&&(v.scrollLeft=g,v.scrollTop=y,h=!0)}}}if(!h){const d=t.history.location.hash.slice(1);if(d){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const g=document.getElementById(d);g&&g.scrollIntoView(m)}}else{const m={top:0,left:0,behavior:c};if(window.scrollTo(m),u)for(const g of u){if(g===Ot)continue;const y=typeof g=="function"?g():document.querySelector(g);y&&y.scrollTo(m)}}}}finally{Ut=!1}t.isScrollRestoring&&e.set(f=>(f[l]||={},f))}})}function Dn(t,s=String){const e=new URLSearchParams;for(const o in t){const n=t[o];n!==void 0&&e.set(o,s(n))}return e.toString()}function fe(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function Fn(t){const s=new URLSearchParams(t),e=Object.create(null);for(const[o,n]of s.entries()){const r=e[o];r==null?e[o]=fe(n):Array.isArray(r)?r.push(fe(n)):e[o]=[r,fe(n)]}return e}var Nn=Un(JSON.parse),zn=Hn(JSON.stringify,JSON.parse);function Un(t){return s=>{s[0]==="?"&&(s=s.substring(1));const e=Fn(s);for(const o in e){const n=e[o];if(typeof n=="string")try{e[o]=t(n)}catch{}}return e}}function Hn(t,s){const e=typeof s=="function";function o(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(e&&typeof n=="string")try{return s(n),t(n)}catch{}return n}return n=>{const r=Dn(n,o);return r?`?${r}`:""}}var mt="__root__";function Wn(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const s=new Headers(t.headers);t.href&&s.get("Location")===null&&s.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:s});if(e.options=t,t.throw)throw e;return e}function Z(t){return t instanceof Response&&!!t.options}function $n(t){return{input:({url:s})=>{for(const e of t)s=Se(e,s);return s},output:({url:s})=>{for(let e=t.length-1;e>=0;e--)s=Es(t[e],s);return s}}}function Vn(t){const s=Ms(t.basepath),e=`/${s}`,o=`${e}/`,n=t.caseSensitive?e:e.toLowerCase(),r=t.caseSensitive?o:o.toLowerCase();return{input:({url:i})=>{const a=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===n?i.pathname="/":a.startsWith(r)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=Wt(["/",s,i.pathname]),i)}}function Se(t,s){const e=t?.input?.({url:s});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return s}function Es(t,s){const e=t?.output?.({url:s});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return s}function qn(t,s){const{createMutableStore:e,createReadonlyStore:o,batch:n,init:r}=s,i=new Map,a=new Map,l=new Map,c=e(t.status),u=e(t.loadedAt),f=e(t.isLoading),h=e(t.isTransitioning),d=e(t.location),m=e(t.resolvedLocation),g=e(t.statusCode),y=e(t.redirect),v=e([]),R=e([]),b=e([]),x=o(()=>he(i,v.state)),P=o(()=>he(a,R.state)),I=o(()=>he(l,b.state)),S=o(()=>v.state[0]),C=o(()=>v.state.some($=>i.get($)?.state.status==="pending")),w=o(()=>({locationHref:d.state.href,resolvedLocationHref:m.state?.href,status:c.state})),k=o(()=>({status:c.state,loadedAt:u.state,isLoading:f.state,isTransitioning:h.state,matches:x.state,location:d.state,resolvedLocation:m.state,statusCode:g.state,redirect:y.state})),L=Ft(64);function N($){let ct=L.get($);return ct||(ct=o(()=>{const Et=v.state;for(const yt of Et){const p=i.get(yt);if(p&&p.routeId===$)return p.state}}),L.set($,ct)),ct}const F={status:c,loadedAt:u,isLoading:f,isTransitioning:h,location:d,resolvedLocation:m,statusCode:g,redirect:y,matchesId:v,pendingMatchesId:R,cachedMatchesId:b,activeMatchesSnapshot:x,pendingMatchesSnapshot:P,cachedMatchesSnapshot:I,firstMatchId:S,hasPendingMatches:C,matchRouteReactivity:w,activeMatchStoresById:i,pendingMatchStoresById:a,cachedMatchStoresById:l,__store:k,getMatchStoreByRouteId:N,setActiveMatches:V,setPendingMatches:H,setCachedMatches:G};V(t.matches),r?.(F);function V($){de($,i,v,e,n)}function H($){de($,a,R,e,n)}function G($){de($,l,b,e,n)}return F}function he(t,s){const e=[];for(const o of s){const n=t.get(o);n&&e.push(n.state)}return e}function de(t,s,e,o,n){const r=t.map(a=>a.id),i=new Set(r);n(()=>{for(const a of s.keys())i.has(a)||s.delete(a);for(const a of t){const l=s.get(a.id);if(!l){const c=o(a);c.routeId=a.routeId,s.set(a.id,c);continue}l.routeId=a.routeId,l.state!==a&&l.setState(()=>a)}vn(e.state,r)||e.setState(()=>r)})}var Re=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},Kn=t=>t.stores.matchesId.state.some(s=>t.stores.activeMatchStoresById.get(s)?.state._forcePending),te=(t,s)=>!!(t.preload&&!t.router.stores.activeMatchStoresById.has(s)),gt=(t,s,e=!0)=>{const o={...t.router.options.context??{}},n=e?s:s-1;for(let r=0;r<=n;r++){const i=t.matches[r];if(!i)continue;const a=t.router.getMatch(i.id);a&&Object.assign(o,a.__routeContext,a.__beforeLoadContext)}return o},es=(t,s)=>{if(!t.matches.length)return;const e=s.routeId,o=t.matches.findIndex(i=>i.routeId===t.router.routeTree.id),n=o>=0?o:0;let r=e?t.matches.findIndex(i=>i.routeId===e):t.firstBadMatchIndex??t.matches.length-1;r<0&&(r=n);for(let i=r;i>=0;i--){const a=t.matches[i];if(t.router.looseRoutesById[a.routeId].options.notFoundComponent)return i}return e?r:n},rt=(t,s,e)=>{if(!(!Z(e)&&!Y(e)))throw Z(e)&&e.redirectHandled&&!e.options.reloadDocument||(s&&(s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.loaderPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,s._nonReactive.loaderPromise=void 0,s._nonReactive.error=e,t.updateMatch(s.id,o=>({...o,status:Z(e)?"redirected":o.status==="pending"?"success":o.status,context:gt(t,s.index),isFetching:!1,error:e})),Y(e)&&!e.routeId&&(e.routeId=s.routeId),s._nonReactive.loadPromise?.resolve()),Z(e)&&(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e))),e},Is=(t,s)=>{const e=t.router.getMatch(s);return!!(!e||e._nonReactive.dehydrated)},ss=(t,s,e)=>{const o=gt(t,e);t.updateMatch(s,n=>({...n,context:o}))},kt=(t,s,e,o)=>{const{id:n,routeId:r}=t.matches[s],i=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;e.routerCode=o,t.firstBadMatchIndex??=s,rt(t,t.router.getMatch(n),e);try{i.options.onError?.(e)}catch(a){e=a,rt(t,t.router.getMatch(n),e)}t.updateMatch(n,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!Z(e)&&!Y(e)&&(t.serialError??=e)},Ls=(t,s,e,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const n=e.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!te(t,s)&&(e.options.loader||e.options.beforeLoad||Os(e))&&typeof n=="number"&&n!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent)){const r=setTimeout(()=>{Re(t)},n);o._nonReactive.pendingTimeout=r}},Gn=(t,s,e)=>{const o=t.router.getMatch(s);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Ls(t,s,e,o);const n=()=>{const r=t.router.getMatch(s);r.preload&&(r.status==="redirected"||r.status==="notFound")&&rt(t,r,r.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(n):n()},Yn=(t,s,e,o)=>{const n=t.router.getMatch(s);let r=n._nonReactive.loadPromise;n._nonReactive.loadPromise=Mt(()=>{r?.resolve(),r=void 0});const{paramsError:i,searchError:a}=n;i&&kt(t,e,i,"PARSE_PARAMS"),a&&kt(t,e,a,"VALIDATE_SEARCH"),Ls(t,s,o,n);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,t.updateMatch(s,x=>({...x,isFetching:"beforeLoad",fetchCount:x.fetchCount+1,abortController:l})))},f=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(s,x=>({...x,isFetching:!1}))};if(!o.options.beforeLoad){t.router.batch(()=>{u(),f()});return}n._nonReactive.beforeLoadPromise=Mt();const h={...gt(t,e,!1),...n.__routeContext},{search:d,params:m,cause:g}=n,y=te(t,s),v={search:d,abortController:l,params:m,preload:y,context:h,location:t.location,navigate:x=>t.router.navigate({...x,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:y?"preload":g,matches:t.matches,routeId:o.id,...t.router.options.additionalContext},R=x=>{if(x===void 0){t.router.batch(()=>{u(),f()});return}(Z(x)||Y(x))&&(u(),kt(t,e,x,"BEFORE_LOAD")),t.router.batch(()=>{u(),t.updateMatch(s,P=>({...P,__beforeLoadContext:x})),f()})};let b;try{if(b=o.options.beforeLoad(v),Dt(b))return u(),b.catch(x=>{kt(t,e,x,"BEFORE_LOAD")}).then(R)}catch(x){u(),kt(t,e,x,"BEFORE_LOAD")}R(b)},Jn=(t,s)=>{const{id:e,routeId:o}=t.matches[s],n=t.router.looseRoutesById[o],r=()=>a(),i=()=>Yn(t,e,s,n),a=()=>{if(Is(t,e))return;const l=Gn(t,e,n);return Dt(l)?l.then(i):i()};return r()},Xn=(t,s,e)=>{const o=t.router.getMatch(s);if(!o||!e.options.head&&!e.options.scripts&&!e.options.headers)return;const n={ssr:t.router.options.ssr,matches:t.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([e.options.head?.(n),e.options.scripts?.(n),e.options.headers?.(n)]).then(([r,i,a])=>({meta:r?.meta,links:r?.links,headScripts:r?.scripts,headers:a,scripts:i,styles:r?.styles}))},Ts=(t,s,e,o,n)=>{const r=s[o-1],{params:i,loaderDeps:a,abortController:l,cause:c}=t.router.getMatch(e),u=gt(t,o),f=te(t,e);return{params:i,deps:a,preload:!!f,parentMatchPromise:r,abortController:l,context:u,location:t.location,navigate:h=>t.router.navigate({...h,_fromLocation:t.location}),cause:f?"preload":c,route:n,...t.router.options.additionalContext}},ns=async(t,s,e,o,n)=>{try{const r=t.router.getMatch(e);try{(!(bs??t.router.isServer)||r.ssr===!0)&&Nt(n);const i=n.options.loader,a=typeof i=="function"?i:i?.handler,l=a?.(Ts(t,s,e,o,n)),c=!!a&&Dt(l);if((c||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||r._nonReactive.minPendingPromise)&&t.updateMatch(e,f=>({...f,isFetching:"loader"})),a){const f=c?await l:l;rt(t,t.router.getMatch(e),f),f!==void 0&&t.updateMatch(e,h=>({...h,loaderData:f}))}n._lazyPromise&&await n._lazyPromise;const u=r._nonReactive.minPendingPromise;u&&await u,n._componentsPromise&&await n._componentsPromise,t.updateMatch(e,f=>({...f,error:void 0,context:gt(t,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let a=i;if(a?.name==="AbortError"){if(r.abortController.signal.aborted){r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loaderPromise=void 0;return}t.updateMatch(e,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:gt(t,o)}));return}const l=r._nonReactive.minPendingPromise;l&&await l,Y(i)&&await n.options.notFoundComponent?.preload?.(),rt(t,t.router.getMatch(e),i);try{n.options.onError?.(i)}catch(c){a=c,rt(t,t.router.getMatch(e),c)}!Z(a)&&!Y(a)&&await Nt(n,["errorComponent"]),t.updateMatch(e,c=>({...c,error:a,context:gt(t,o),status:"error",isFetching:!1}))}}catch(r){const i=t.router.getMatch(e);i&&(i._nonReactive.loaderPromise=void 0),rt(t,i,r)}},Zn=async(t,s,e)=>{async function o(d,m,g,y,v){const R=Date.now()-m.updatedAt,b=d?v.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??t.router.options.defaultStaleTime??0,x=v.options.shouldReload,P=typeof x=="function"?x(Ts(t,s,n,e,v)):x,{status:I,invalid:S}=y,C=R>=b&&(!!t.forceStaleReload||y.cause==="enter"||g!==void 0&&g!==y.id);i=I==="success"&&(S||(P??C)),d&&v.options.preload===!1||(i&&!t.sync&&u?(a=!0,(async()=>{try{await ns(t,s,n,e,v);const w=t.router.getMatch(n);w._nonReactive.loaderPromise?.resolve(),w._nonReactive.loadPromise?.resolve(),w._nonReactive.loaderPromise=void 0,w._nonReactive.loadPromise=void 0}catch(w){Z(w)&&await t.router.navigate(w.options)}})()):I!=="success"||i?await ns(t,s,n,e,v):ss(t,n,e))}const{id:n,routeId:r}=t.matches[e];let i=!1,a=!1;const l=t.router.looseRoutesById[r],c=l.options.loader,u=((typeof c=="function"?void 0:c?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Is(t,n)){if(!t.router.getMatch(n))return t.matches[e];ss(t,n,e)}else{const d=t.router.getMatch(n),m=t.router.stores.matchesId.state[e],g=(m&&t.router.stores.activeMatchStoresById.get(m)||null)?.routeId===r?m:t.router.stores.activeMatchesSnapshot.state.find(v=>v.routeId===r)?.id,y=te(t,n);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!t.sync&&!d.preload&&u)return d;await d._nonReactive.loaderPromise;const v=t.router.getMatch(n),R=v._nonReactive.error||v.error;R&&rt(t,v,R),v.status==="pending"&&await o(y,d,g,v,l)}else{const v=y&&!t.router.stores.activeMatchStoresById.has(n),R=t.router.getMatch(n);R._nonReactive.loaderPromise=Mt(),v!==R.preload&&t.updateMatch(n,b=>({...b,preload:v})),await o(y,d,g,R,l)}}const f=t.router.getMatch(n);a||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=a?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(t.updateMatch(n,d=>({...d,isFetching:h,invalid:!1})),t.router.getMatch(n)):f};async function os(t){const s=t,e=[];Kn(s.router)&&Re(s);let o;for(let h=0;h({...v,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=h,await Nt(m,["notFoundComponent"])}else if(!s.preload){const h=s.matches[0];h.globalNotFound||s.router.getMatch(h.id)?.globalNotFound&&s.updateMatch(h.id,d=>({...d,globalNotFound:!1,error:void 0}))}if(s.serialError&&s.firstBadMatchIndex!==void 0){const h=s.router.looseRoutesById[s.matches[s.firstBadMatchIndex].routeId];await Nt(h,["errorComponent"])}for(let h=0;h<=u;h++){const{id:d,routeId:m}=s.matches[h],g=s.router.looseRoutesById[m];try{const y=Xn(s,d,g);if(y){const v=await y;s.updateMatch(d,R=>({...R,...v}))}}catch(y){console.error(`Error executing head for route ${m}:`,y)}}const f=Re(s);if(Dt(f)&&await f,c)throw c;if(s.serialError&&!s.preload&&!s.onReady)throw s.serialError;return s.matches}function rs(t,s){const e=s.map(o=>t.options[o]?.preload?.()).filter(Boolean);if(e.length!==0)return Promise.all(e)}function Nt(t,s=$t){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(o=>{const{id:n,...r}=o.options;Object.assign(t.options,r),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);const e=()=>t._componentsLoaded?void 0:s===$t?(()=>{if(t._componentsPromise===void 0){const o=rs(t,$t);o?t._componentsPromise=o.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():rs(t,s);return t._lazyPromise?t._lazyPromise.then(e):e()}function Os(t){for(const s of $t)if(t.options[s]?.preload)return!0;return!1}var $t=["component","errorComponent","pendingComponent","notFoundComponent"],at="__TSR_index",is="popstate",as="beforeunload";function Qn(t){let s=t.getLocation();const e=new Set,o=i=>{s=t.getLocation(),e.forEach(a=>a({location:s,action:i}))},n=i=>{t.notifyOnIndexChange??!0?o(i):s=t.getLocation()},r=async({task:i,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){i();return}const c=t.getBlockers?.()??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const f of c){const h=Yt(l.path,l.state);if(await f.blockerFn({currentLocation:s,nextLocation:h,action:l.type})){t.onBlocked?.();return}}i()};return{get location(){return s},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,a,l)=>{const c=s.state[at];a=cs(c+1,a),r({task:()=>{t.pushState(i,a),o({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:i,state:a})},replace:(i,a,l)=>{const c=s.state[at];a=cs(c,a),r({task:()=>{t.replaceState(i,a),o({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:i,state:a})},go:(i,a)=>{r({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{r({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{r({task:()=>{t.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>s.state[at]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};const a=t.getBlockers?.()??[];return t.setBlockers([...a,i]),()=>{const l=t.getBlockers?.()??[];t.setBlockers?.(l.filter(c=>c!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:o}}function cs(t,s){s||(s={});const e=Ee();return{...s,key:e,__TSR_key:e,[at]:t}}function to(t){const s=typeof document<"u"?window:void 0,e=s.history.pushState,o=s.history.replaceState;let n=[];const r=()=>n,i=C=>n=C,a=(C=>C),l=(()=>Yt(`${s.location.pathname}${s.location.search}${s.location.hash}`,s.history.state));if(!s.history.state?.__TSR_key&&!s.history.state?.key){const C=Ee();s.history.replaceState({[at]:0,key:C,__TSR_key:C},"")}let c=l(),u,f=!1,h=!1,d=!1,m=!1;const g=()=>c;let y,v;const R=()=>{y&&(S._ignoreSubscribers=!0,(y.isPush?s.history.pushState:s.history.replaceState)(y.state,"",y.href),S._ignoreSubscribers=!1,y=void 0,v=void 0,u=void 0)},b=(C,w,k)=>{const L=a(w);v||(u=c),c=Yt(w,k),y={href:L,state:k,isPush:y?.isPush||C==="push"},v||(v=Promise.resolve().then(()=>R()))},x=C=>{c=l(),S.notify({type:C})},P=async()=>{if(h){h=!1;return}const C=l(),w=C.state[at]-c.state[at],k=w===1,L=w===-1,N=!k&&!L||f;f=!1;const F=N?"GO":L?"BACK":"FORWARD",V=N?{type:"GO",index:w}:{type:L?"BACK":"FORWARD"};if(d)d=!1;else{const H=r();if(typeof document<"u"&&H.length){for(const G of H)if(await G.blockerFn({currentLocation:c,nextLocation:C,action:F})){h=!0,s.history.go(1),S.notify(V);return}}}c=l(),S.notify(V)},I=C=>{if(m){m=!1;return}let w=!1;const k=r();if(typeof document<"u"&&k.length)for(const L of k){const N=L.enableBeforeUnload??!0;if(N===!0){w=!0;break}if(typeof N=="function"&&N()===!0){w=!0;break}}if(w)return C.preventDefault(),C.returnValue=""},S=Qn({getLocation:g,getLength:()=>s.history.length,pushState:(C,w)=>b("push",C,w),replaceState:(C,w)=>b("replace",C,w),back:C=>(C&&(d=!0),m=!0,s.history.back()),forward:C=>{C&&(d=!0),m=!0,s.history.forward()},go:C=>{f=!0,s.history.go(C)},createHref:C=>a(C),flush:R,destroy:()=>{s.history.pushState=e,s.history.replaceState=o,s.removeEventListener(as,I,{capture:!0}),s.removeEventListener(is,P)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:r,setBlockers:i,notifyOnIndexChange:!1});return s.addEventListener(as,I,{capture:!0}),s.addEventListener(is,P),s.history.pushState=function(...C){const w=e.apply(s.history,C);return S._ignoreSubscribers||x("PUSH"),w},s.history.replaceState=function(...C){const w=o.apply(s.history,C);return S._ignoreSubscribers||x("REPLACE"),w},S}function eo(t){let s=t.replace(/[\x00-\x1f\x7f]/g,"");return s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}function Yt(t,s){const e=eo(t),o=e.indexOf("#"),n=e.indexOf("?"),r=Ee();return{href:e,pathname:e.substring(0,o>0?n>0?Math.min(o,n):o:n>0?n:e.length),hash:o>-1?e.substring(o):"",search:n>-1?e.slice(n,o===-1?void 0:o):"",state:s||{[at]:0,key:r,__TSR_key:r}}}function Ee(){return(Math.random()+1).toString(36).substring(7)}function wt(t,s){const e=s,o=t;return{fromLocation:e,toLocation:o,pathChanged:e?.pathname!==o.pathname,hrefChanged:e?.href!==o.href,hashChanged:e?.hash!==o.hash}}var so=class{constructor(t,s){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{const o=this.options,n=this.basepath??o?.basepath??"/",r=this.basepath===void 0,i=o?.rewrite;if(this.options={...o,...e},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ln(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=to()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=Ft(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=qn(oo(this.latestLocation),u),Bn(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(r||n!==l||i!==c){this.basepath=l;const u=[],f=Ms(l);f&&f!=="/"&&u.push(Vn({basepath:l})),c&&u.push(c),this.rewrite=u.length===0?void 0:u.length===1?u[0]:$n(u),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const e=wn(this.routeTree,this.options.caseSensitive,(o,n)=>{o.init({originalIndex:n})});return this.options.routeMasks&&Sn(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,o)=>{const n={eventType:e,fn:o};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(o=>{o.eventType===e.type&&o.fn(e)})},this.parseLocation=(e,o)=>{const n=({pathname:l,search:c,hash:u,href:f,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const v=this.options.parseSearch(c),R=this.options.stringifySearch(v);return{href:l+R+u,publicHref:l+R+u,pathname:Lt(l).path,external:!1,searchStr:R,search:ft(o?.search,v),hash:Lt(u.slice(1)).path,state:ot(o?.state,h)}}const d=new URL(f,this.origin),m=Se(this.rewrite,d),g=this.options.parseSearch(m.search),y=this.options.stringifySearch(g);return m.search=y,{href:m.href.replace(m.origin,""),publicHref:f,pathname:Lt(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:y,search:ft(o?.search,g),hash:Lt(m.hash.slice(1)).path,state:ot(o?.state,h)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){const l=n(i);return l.state.key=r.state.key,l.state.__TSR_key=r.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:r}}return r},this.resolvePathWithBase=(e,o)=>In({base:e,to:Me(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,o,n)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:o},n):this.matchRoutesInternal(e,o),this.getMatchedRoutes=e=>ro({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{const o=this.getMatch(e);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.state.forEach(e=>{if(this.stores.pendingMatchStoresById.has(e))return;const o=this.stores.activeMatchStoresById.get(e)?.state;o&&(o.status==="pending"||o.isFetching==="loader")&&this.cancelMatch(e)})},this.buildLocation=e=>{const o=(r={})=>{const i=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);r.from;const l=r.unsafeRelative==="path"?i.pathname:r.from??a.fullPath,c=this.resolvePathWithBase(l,"."),u=a.search,f=Object.assign(Object.create(null),a.params),h=r.to?this.resolvePathWithBase(c,`${r.to}`):this.resolvePathWithBase(c,"."),d=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?f:Object.assign(f,nt(r.params,f)),m=this.getMatchedRoutes(h);let g=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]),Object.keys(d).length>0)for(const k of g){const L=k.options.params?.stringify??k.options.stringifyParams;if(L)try{Object.assign(d,L(d))}catch{}}const y=e.leaveParams?h:Lt(Xe({path:h,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(e._includeValidateSearch&&this.options.search?.strict){const k={};g.forEach(L=>{if(L.options.validateSearch)try{Object.assign(k,Vt(L.options.validateSearch,{...k,...v}))}catch{}}),v=k}v=io({search:v,dest:r,destRoutes:g,_includeValidateSearch:e._includeValidateSearch}),v=ft(u,v);const R=this.options.stringifySearch(v),b=r.hash===!0?i.hash:r.hash?nt(r.hash,i.hash):void 0,x=b?`#${b}`:"";let P=r.state===!0?i.state:r.state?nt(r.state,i.state):{};P=ot(i.state,P);const I=`${y}${R}${x}`;let S,C,w=!1;if(this.rewrite){const k=new URL(I,this.origin),L=Es(this.rewrite,k);S=k.href.replace(k.origin,""),L.origin!==this.origin?(C=L.href,w=!0):C=L.pathname+L.search+L.hash}else S=gn(I),C=S;return{publicHref:C,href:S,pathname:y,search:v,searchStr:R,state:P,hash:b??"",external:w,unmaskOnReload:r.unmaskOnReload}},n=(r={},i)=>{const a=o(r);let l=i?o(i):void 0;if(!l){const c=Object.create(null);if(this.options.routeMasks){const u=Rn(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:f,params:h,...d}=u.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?c:Object.assign(c,nt(h,c));i={from:e.from,...d,params:m},l=o(i)}}}return l&&(a.maskedLocation=l),a};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:o,...n})=>{const r=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{n.state[u]=this.latestLocation.state[u]});const c=pt(n.state,this.latestLocation.state);return l.forEach(u=>{delete n.state[u]}),c},i=it(this.latestLocation.href)===it(n.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Mt(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=n;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:o})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:o,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,h=Yt(a,{__TSR_index:e?f:f+1}),d=new URL(h.pathname,this.origin);l.to=Se(this.rewrite,d).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:r,replace:e,resetScroll:o,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:e,reloadDocument:o,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!o&&(o=!0),o){if(e!==void 0||!n){const c=this.buildLocation({to:e,...i});n=n??c.publicHref,r=r??c.publicHref}const l=!a&&r?r:n;if(Kt(l,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){const c=this.history.getBlockers?.()??[];for(const u of c)if(u?.blockerFn&&await u.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const e=this.matchRoutes(this.latestLocation),o=this.stores.cachedMatchesSnapshot.state.filter(n=>!e.some(r=>r.id===n.id));this.batch(()=>{this.stores.status.setState(()=>"pending"),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(e),this.stores.setCachedMatches(o)})},this.load=async e=>{let o,n,r;const i=this.stores.resolvedLocation.state??this.stores.location.state;for(r=new Promise(l=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,u=this.stores.resolvedLocation.state,f=wt(c,u);this.stores.redirect.state||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await os({router:this,sync:e?.sync,forceStaleReload:i.href===c.href,matches:this.stores.pendingMatchesSnapshot.state,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let h=null,d=null,m=null,g=null;this.batch(()=>{const y=this.stores.pendingMatchesSnapshot.state,v=y.length,R=this.stores.activeMatchesSnapshot.state;h=v?R.filter(P=>!this.stores.pendingMatchStoresById.has(P.id)):null;const b=new Set;for(const P of this.stores.pendingMatchStoresById.values())P.routeId&&b.add(P.routeId);const x=new Set;for(const P of this.stores.activeMatchStoresById.values())P.routeId&&x.add(P.routeId);d=v?R.filter(P=>!b.has(P.routeId)):null,m=v?y.filter(P=>!x.has(P.routeId)):null,g=v?y.filter(P=>x.has(P.routeId)):R,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),v&&(this.stores.setActiveMatches(y),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...h.filter(P=>P.status!=="error"&&P.status!=="notFound"&&P.status!=="redirected")]),this.clearExpiredCache())});for(const[y,v]of[[d,"onLeave"],[m,"onEnter"],[g,"onStay"]])if(y)for(const R of y)this.looseRoutesById[R.routeId].options[v]?.(R)})})}})}catch(c){Z(c)?(o=c,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):Y(c)&&(n=c);const u=o?o.status:n?404:this.stores.activeMatchesSnapshot.state.some(f=>f.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>u),this.stores.redirect.setState(()=>o)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.activeMatchesSnapshot.state.some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.setState(()=>a)},this.startViewTransition=e=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,i=this.stores.resolvedLocation.state,a=typeof o.types=="function"?o.types(wt(r,i)):o.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,o)=>{this.startTransition(()=>{const n=this.stores.pendingMatchStoresById.get(e);if(n){n.setState(o);return}const r=this.stores.activeMatchStoresById.get(e);if(r){r.setState(o);return}const i=this.stores.cachedMatchStoresById.get(e);if(i){const a=o(i.state);a.status==="redirected"?this.stores.cachedMatchStoresById.delete(e)&&this.stores.cachedMatchesId.setState(l=>l.filter(c=>c!==e)):i.setState(()=>a)}})},this.getMatch=e=>this.stores.cachedMatchStoresById.get(e)?.state??this.stores.pendingMatchStoresById.get(e)?.state??this.stores.activeMatchStoresById.get(e)?.state,this.invalidate=e=>{const o=n=>e?.filter?.(n)??!0?{...n,invalid:!0,...e?.forcePending||n.status==="error"||n.status==="notFound"?{status:"pending",error:void 0}:void 0}:n;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(o)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(o)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(o))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||"/",this.resolveRedirect=e=>{const o=e.headers.get("Location");if(!e.options.href||e.options._builtLocation){const n=e.options._builtLocation??this.buildLocation(e.options),r=this.getParsedLocationHref(n);e.options.href=r,e.headers.set("Location",r)}else if(o)try{const n=new URL(o);if(this.origin&&n.origin===this.origin){const r=n.pathname+n.search+n.hash;e.options.href=r,e.headers.set("Location",r)}}catch{}if(e.options.href&&!e.options._builtLocation&&Kt(e.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const o=e?.filter;o!==void 0?this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(n=>!o(n))):this.stores.setCachedMatches([])},this.clearExpiredCache=()=>{const e=Date.now(),o=n=>{const r=this.looseRoutesById[n.routeId];if(!r.options.loader)return!0;const i=(n.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:e-n.updatedAt>=i};this.clearCache({filter:o})},this.loadRouteChunk=Nt,this.preloadRoute=async e=>{const o=e._builtLocation??this.buildLocation(e);let n=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:e});const r=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),i=new Set([...r,...this.stores.cachedMatchesId.state]),a=n.filter(l=>!i.has(l.id));if(a.length){const l=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...l,...a])}try{return n=await os({router:this,matches:n,location:o,preload:!0,updateMatch:(l,c)=>{r.has(l)?n=n.map(u=>u.id===l?c(u):u):this.updateMatch(l,c)}}),n}catch(l){if(Z(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:o});Y(l)||console.error(l);return}},this.matchRoute=(e,o)=>{const n={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(o?.pending&&this.stores.status.state!=="pending")return!1;const i=(o?.pending===void 0?!this.stores.isLoading.state:o.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,a=_n(r.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!pt(a.rawParams,e.params,{partial:!0})?!1:o?.includeSearch??!0?pt(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(e=>e.status==="notFound"||e.globalNotFound),this.getStoreConfig=s,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??zn,parseSearch:t.parseSearch??Nn,protocolAllowlist:t.protocolAllowlist??mn}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:t,routesByPath:s,processedTree:e}){this.routesById=t,this.routesByPath=s,this.processedTree=e;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,s){const e=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:n,parsedParams:r}=e;let{matchedRoutes:i}=e,a=!1;(o?o.path!=="/"&&n["**"]:it(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const l=a?co(this.options.notFoundMode,i):void 0,c=new Array(i.length),u=new Map;for(const f of this.stores.activeMatchStoresById.values())f.routeId&&u.set(f.routeId,f.state);for(let f=0;fthis.navigate({...b,_fromLocation:t}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:c,routeId:d.id};h.__routeContext=d.options.context(R)??void 0}h.context={...v,...h.__routeContext,...h.__beforeLoadContext}}}return c}matchRoutesLightweight(t){const{matchedRoutes:s,routeParams:e,parsedParams:o}=this.getMatchedRoutes(t.pathname),n=Bt(s),r={...t.search};for(const u of s)try{Object.assign(r,Vt(u.options.validateSearch,r))}catch{}const i=Bt(this.stores.matchesId.state),a=i&&this.stores.activeMatchStoresById.get(i)?.state,l=a&&a.routeId===n.id&&a.pathname===t.pathname;let c;if(l)c=a.params;else{const u=Object.assign(Object.create(null),e);for(const f of s)try{ls(f,e,o??{},u)}catch{}c=u}return{matchedRoutes:s,fullPath:n.fullPath,search:r,params:c}}},Jt=class extends Error{},no=class extends Error{};function oo(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}function Vt(t,s){if(t==null)return{};if("~standard"in t){const e=t["~standard"].validate(s);if(e instanceof Promise)throw new Jt("Async validation not supported");if(e.issues)throw new Jt(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(s):typeof t=="function"?t(s):{}}function ro({pathname:t,routesById:s,processedTree:e}){const o=Object.create(null),n=it(t);let r,i;const a=xn(n,e,!0);return a&&(r=a.route,Object.assign(o,a.rawParams),i=Object.assign(Object.create(null),a.parsedParams)),{matchedRoutes:a?.branch||[s.__root__],routeParams:o,foundRoute:r,parsedParams:i}}function io({search:t,dest:s,destRoutes:e,_includeValidateSearch:o}){return ao(e)(t,s,o??!1)}function ao(t){const s={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const n of t){if("search"in n.options)n.options.search?.middlewares&&s.middlewares.push(...n.options.search.middlewares);else if(n.options.preSearchFilters||n.options.postSearchFilters){const r=({search:i,next:a})=>{let l=i;"preSearchFilters"in n.options&&n.options.preSearchFilters&&(l=n.options.preSearchFilters.reduce((u,f)=>f(u),i));const c=a(l);return"postSearchFilters"in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((u,f)=>f(u),c):c};s.middlewares.push(r)}if(n.options.validateSearch){const r=({search:i,next:a})=>{const l=a(i);if(!s._includeValidateSearch)return l;try{return{...l,...Vt(n.options.validateSearch,l)??void 0}}catch{return l}};s.middlewares.push(r)}}const e=({search:n})=>{const r=s.dest;return r.search?r.search===!0?n:nt(r.search,n):{}};s.middlewares.push(e);const o=(n,r,i)=>{if(n>=i.length)return r;const a=i[n];return a({search:r,next:c=>o(n+1,c,i)})};return function(r,i,a){return s.dest=i,s._includeValidateSearch=a,o(0,r,s.middlewares)}}function co(t,s){if(t!=="root")for(let e=s.length-1;e>=0;e--){const o=s[e];if(o.children)return o.id}return mt}function ls(t,s,e,o){const n=t.options.params?.parse??t.options.parseParams;if(n)if(t.options.skipRouteOnParseError)for(const r in s)r in e&&(o[r]=e[r]);else{const r=n(o);Object.assign(o,r)}}var lo="Error preloading route! ☝️",ks=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=s=>{this.originalIndex=s.originalIndex;const e=this.options,o=!e?.path&&!e?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=mt:this.parentRoute||et();let n=o?mt:e?.path;n&&n!=="/"&&(n=Cs(n));const r=e?.id||n;let i=o?mt:Wt([this.parentRoute.id==="__root__"?"":this.parentRoute.id,r]);n==="__root__"&&(n="/"),i!=="__root__"&&(i=Wt(["/",i]));const a=i==="__root__"?"/":Wt([this.parentRoute.fullPath,n]);this._path=n,this._id=i,this._fullPath=a,this._to=it(a)},this.addChildren=s=>this._addFileChildren(s),this._addFileChildren=s=>(Array.isArray(s)&&(this.children=s),typeof s=="object"&&s!==null&&(this.children=Object.values(s)),this),this._addFileTypes=()=>this,this.updateLoader=s=>(Object.assign(this.options,s),this),this.update=s=>(Object.assign(this.options,s),this),this.lazy=s=>(this.lazyFn=s,this),this.redirect=s=>Wn({from:this.fullPath,...s}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},uo=class extends ks{constructor(t){super(t)}};function fo(t){if(typeof document<"u"&&document.querySelector){const s=t.stores.location.state,e=s.state.__hashScrollIntoViewOptions??!0;if(e&&s.hash!==""){const o=document.getElementById(s.hash);o&&o.scrollIntoView(e)}}}function Ie(t){const s=t.errorComponent??Le;return T.jsx(ho,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:o})=>e?E.createElement(s,{error:e,reset:o}):t.children})}var ho=class extends E.Component{constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,s){s.error&&s.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,s){this.props.onCatch&&this.props.onCatch(t,s)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function Le({error:t}){const[s,e]=E.useState(!1);return T.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[T.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),T.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(o=>!o),children:s?"Hide Error":"Show Error"})]}),T.jsx("div",{style:{height:".25rem"}}),s?T.jsx("div",{children:T.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?T.jsx("code",{children:t.message}):null})}):null]})}function po({children:t,fallback:s=null}){return As()?T.jsx(Pt.Fragment,{children:t}):T.jsx(Pt.Fragment,{children:s})}function As(){return Pt.useSyncExternalStore(mo,()=>!0,()=>!1)}function mo(){return()=>{}}var js=E.createContext(null);function Q(t){return E.useContext(js)}var ee=E.createContext(void 0),go=E.createContext(void 0),U=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(U||{});function vo({update:t,notify:s,unwatched:e}){return{link:o,unlink:n,propagate:r,checkDirty:i,shallowPropagate:a};function o(c,u,f){const h=u.depsTail;if(h!==void 0&&h.dep===c)return;const d=h!==void 0?h.nextDep:u.deps;if(d!==void 0&&d.dep===c){d.version=f,u.depsTail=d;return}const m=c.subsTail;if(m!==void 0&&m.version===f&&m.sub===u)return;const g=u.depsTail=c.subsTail={version:f,dep:c,sub:u,prevDep:h,nextDep:d,prevSub:m,nextSub:void 0};d!==void 0&&(d.prevDep=g),h!==void 0?h.nextDep=g:u.deps=g,m!==void 0?m.nextSub=g:c.subs=g}function n(c,u=c.sub){const f=c.dep,h=c.prevDep,d=c.nextDep,m=c.nextSub,g=c.prevSub;return d!==void 0?d.prevDep=h:u.depsTail=h,h!==void 0?h.nextDep=d:u.deps=d,m!==void 0?m.prevSub=g:f.subsTail=g,g!==void 0?g.nextSub=m:(f.subs=m)===void 0&&e(f),d}function r(c){let u=c.nextSub,f;t:do{const h=c.sub;let d=h.flags;if(d&60?d&12?d&4?!(d&48)&&l(c,h)?(h.flags=d|40,d&=1):d=0:h.flags=d&-9|32:d=0:h.flags=d|32,d&2&&s(h),d&1){const m=h.subs;if(m!==void 0){const g=(c=m).nextSub;g!==void 0&&(f={value:u,prev:f},u=g);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){u=c.nextSub;continue t}break}while(!0)}function i(c,u){let f,h=0,d=!1;t:do{const m=c.dep,g=m.flags;if(u.flags&16)d=!0;else if((g&17)===17){if(t(m)){const y=m.subs;y.nextSub!==void 0&&a(y),d=!0}}else if((g&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=m.deps,u=m,++h;continue}if(!d){const y=c.nextDep;if(y!==void 0){c=y;continue}}for(;h--;){const y=u.subs,v=y.nextSub!==void 0;if(v?(c=f.value,f=f.prev):c=y,d){if(t(u)){v&&a(y),u=c.sub;continue}d=!1}else u.flags&=-33;u=c.sub;const R=c.nextDep;if(R!==void 0){c=R;continue t}}return d}while(!0)}function a(c){do{const u=c.sub,f=u.flags;(f&48)===32&&(u.flags=f|16,(f&6)===2&&s(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let f=u.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}function Te(t,s,e){const o=typeof t=="object",n=o?t:void 0;return{next:(o?t.next:t)?.bind(n),error:(o?t.error:s)?.bind(n),complete:(o?t.complete:e)?.bind(n)}}const _e=[];let qt=0;const{link:us,unlink:yo,propagate:So,checkDirty:Bs,shallowPropagate:fs}=vo({update(t){return t._update()},notify(t){_e[xe++]=t,t.flags&=~U.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=U.Mutable|U.Dirty,Xt(t))}});let Ht=0,xe=0,tt,be=0;function Ds(t){try{++be,t()}finally{--be||Fs()}}function Xt(t){const s=t.depsTail;let e=s!==void 0?s.nextDep:t.deps;for(;e!==void 0;)e=yo(e,t)}function Fs(){if(!(be>0)){for(;Ht{n.get(),a.current?i.next?.(n._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(r){const i=tt,a=Object.is;if(e)tt=n,++qt,n.depsTail=void 0;else if(r===void 0)return!1;e&&(n.flags=U.Mutable|U.RecursedCheck);try{const l=n._snapshot,c=typeof r=="function"?r(l):r===void 0&&e?o(l):r;return l===void 0||!a(l,c)?(n._snapshot=c,!0):!1}finally{tt=i,e&&(n.flags&=~U.RecursedCheck),Xt(n)}}};return e?(n.flags=U.Mutable|U.Dirty,n.get=function(){const r=n.flags;if(r&U.Dirty||r&U.Pending&&Bs(n.deps,n)){if(n._update()){const i=n.subs;i!==void 0&&fs(i)}}else r&U.Pending&&(n.flags=r&~U.Pending);return tt!==void 0&&us(n,tt,qt),n._snapshot}):n.set=function(r){if(n._update(r)){const i=n.subs;i!==void 0&&(So(i),fs(i),Fs())}},n}function Ro(t){const s=()=>{const o=tt;tt=e,++qt,e.depsTail=void 0,e.flags=U.Watching|U.RecursedCheck;try{return t()}finally{tt=o,e.flags&=~U.RecursedCheck,Xt(e)}},e={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:U.Watching|U.RecursedCheck,notify(){const o=this.flags;o&U.Dirty||o&U.Pending&&Bs(this.deps,this)?s():this.flags=U.Watching},stop(){this.flags=U.None,this.depsTail=void 0,Xt(this)}};return s(),e}class _o{constructor(s){this.atom=Ns(s)}setState(s){this.atom.set(s)}get state(){return this.atom.get()}get(){return this.state}subscribe(s){return this.atom.subscribe(Te(s))}}class xo{constructor(s){this.atom=Ns(s)}get state(){return this.atom.get()}get(){return this.state}subscribe(s){return this.atom.subscribe(Te(s))}}function hs(t){return typeof t=="function"?new xo(t):new _o(t)}var pe={exports:{}},me={},ge={exports:{}},ve={};var ds;function bo(){if(ds)return ve;ds=1;var t=Zt();function s(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var e=typeof Object.is=="function"?Object.is:s,o=t.useState,n=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function a(f,h){var d=h(),m=o({inst:{value:d,getSnapshot:h}}),g=m[0].inst,y=m[1];return r(function(){g.value=d,g.getSnapshot=h,l(g)&&y({inst:g})},[f,d,h]),n(function(){return l(g)&&y({inst:g}),f(function(){l(g)&&y({inst:g})})},[f]),i(d),d}function l(f){var h=f.getSnapshot;f=f.value;try{var d=h();return!e(f,d)}catch{return!0}}function c(f,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return ve.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,ve}var ps;function wo(){return ps||(ps=1,ge.exports=bo()),ge.exports}var ms;function Po(){if(ms)return me;ms=1;var t=Zt(),s=wo();function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var o=typeof Object.is=="function"?Object.is:e,n=s.useSyncExternalStore,r=t.useRef,i=t.useEffect,a=t.useMemo,l=t.useDebugValue;return me.useSyncExternalStoreWithSelector=function(c,u,f,h,d){var m=r(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function v(I){if(!R){if(R=!0,b=I,I=h(I),d!==void 0&&g.hasValue){var S=g.value;if(d(S,I))return x=S}return x=I}if(S=x,o(b,I))return S;var C=h(I);return d!==void 0&&d(S,C)?(b=I,S):(b=I,x=C)}var R=!1,b,x,P=f===void 0?null:f;return[function(){return v(u())},P===null?void 0:function(){return v(P())}]},[u,f,h,d]);var y=n(c,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},me}var gs;function Co(){return gs||(gs=1,pe.exports=Po()),pe.exports}var zs=Co();const hr=we(zs);function Mo(t,s){return t===s}function J(t,s,e=Mo){const o=E.useCallback(i=>{if(!t)return()=>{};const{unsubscribe:a}=t.subscribe(i);return a},[t]),n=E.useCallback(()=>t?.get(),[t]);return zs.useSyncExternalStoreWithSelector(o,n,n,s,e)}var Eo={state:void 0,get:()=>{},subscribe:()=>()=>{}};function vt(t){const s=Q(),e=E.useContext(t.from?go:ee),o=t.from??e,n=o?t.from?s.stores.getMatchStoreByRouteId(o):s.stores.activeMatchStoresById.get(o):void 0,r=E.useRef(void 0);return J(n??Eo,i=>{if((t.shouldThrow??!0)&&!i&&et(),i===void 0)return;const a=t.select?t.select(i):i;if(t.structuralSharing??s.options.defaultStructuralSharing){const l=ot(r.current,a);return r.current=l,l}return a})}function Us(t){return vt({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:s=>t.select?t.select(s.loaderData):s.loaderData})}function Hs(t){const{select:s,...e}=t;return vt({...e,select:o=>s?s(o.loaderDeps):o.loaderDeps})}function Ws(t){return vt({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:s=>{const e=t.strict===!1?s.params:s._strictParams;return t.select?t.select(e):e}})}function $s(t){return vt({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:s=>t.select?t.select(s.search):s.search})}function Vs(t){const s=Q();return E.useCallback(e=>s.navigate({...e,from:e.from??t?.from}),[t?.from,s])}function qs(t){return vt({...t,select:s=>t.select?t.select(s.context):s.context})}var Oe=an();const dr=we(Oe);function Io(t,s){const e=Q(),o=ln(s),{activeProps:n,inactiveProps:r,activeOptions:i,to:a,preload:l,preloadDelay:c,hashScrollIntoView:u,replace:f,startTransition:h,resetScroll:d,viewTransition:m,children:g,target:y,disabled:v,style:R,className:b,onClick:x,onBlur:P,onFocus:I,onMouseEnter:S,onMouseLeave:C,onTouchStart:w,ignoreBlocker:k,params:L,search:N,hash:F,state:V,mask:H,reloadDocument:G,unsafeRelative:$,from:ct,_fromLocation:Et,...yt}=t,p=As(),_=E.useMemo(()=>t,[e,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),O=J(e.stores.location,z=>z,(z,X)=>z.href===X.href),M=E.useMemo(()=>{const z={_fromLocation:O,..._};return e.buildLocation(z)},[e,O,_]),j=M.maskedLocation?M.maskedLocation.publicHref:M.publicHref,B=M.maskedLocation?M.maskedLocation.external:M.external,D=E.useMemo(()=>jo(j,B,e.history,v),[v,B,j,e.history]),q=E.useMemo(()=>{if(D?.external)return Kt(D.href,e.protocolAllowlist)?void 0:D.href;if(!Bo(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Kt(a,e.protocolAllowlist)?void 0:a}catch{}},[a,D,e.protocolAllowlist]),W=E.useMemo(()=>{if(q)return!1;if(i?.exact){if(!En(O.pathname,M.pathname,e.basepath))return!1}else{const z=Gt(O.pathname,e.basepath),X=Gt(M.pathname,e.basepath);if(!(z.startsWith(X)&&(z.length===X.length||z[X.length]==="/")))return!1}return(i?.includeSearch??!0)&&!pt(O.search,M.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?p&&O.hash===M.hash:!0},[i?.exact,i?.explicitUndefined,i?.includeHash,i?.includeSearch,O,q,p,M.hash,M.pathname,M.search,e.basepath]),St=W?nt(n,{})??Lo:ye,zt=W?ye:nt(r,{})??ye,ke=[b,St.className,zt.className].filter(Boolean).join(" "),Ae=(R||St.style||zt.style)&&{...R,...St.style,...zt.style},[Xs,je]=E.useState(!1),Be=E.useRef(!1),Rt=t.reloadDocument||q?!1:l??e.options.defaultPreload,se=c??e.options.defaultPreloadDelay??0,lt=E.useCallback(()=>{e.preloadRoute({..._,_builtLocation:M}).catch(z=>{console.warn(z),console.warn(lo)})},[e,_,M]);cn(o,E.useCallback(z=>{z?.isIntersecting&<()},[lt]),Ao,{disabled:!!v||Rt!=="viewport"}),E.useEffect(()=>{Be.current||!v&&Rt==="render"&&(lt(),Be.current=!0)},[v,lt,Rt]);const Zs=z=>{const X=z.currentTarget.getAttribute("target"),ut=y!==void 0?y:X;if(!v&&!Do(z)&&!z.defaultPrevented&&(!ut||ut==="_self")&&z.button===0){z.preventDefault(),Oe.flushSync(()=>{je(!0)});const tn=e.subscribe("onResolved",()=>{tn(),je(!1)});e.navigate({..._,replace:f,resetScroll:d,hashScrollIntoView:u,startTransition:h,viewTransition:m,ignoreBlocker:k})}};if(q)return{...yt,ref:o,href:q,...g&&{children:g},...y&&{target:y},...v&&{disabled:v},...R&&{style:R},...b&&{className:b},...x&&{onClick:x},...P&&{onBlur:P},...I&&{onFocus:I},...S&&{onMouseEnter:S},...C&&{onMouseLeave:C},...w&&{onTouchStart:w}};const De=z=>{if(v||Rt!=="intent")return;if(!se){lt();return}const X=z.currentTarget;if(At.has(X))return;const ut=setTimeout(()=>{At.delete(X),lt()},se);At.set(X,ut)},Qs=z=>{v||Rt!=="intent"||lt()},Fe=z=>{if(v||!Rt||!se)return;const X=z.currentTarget,ut=At.get(X);ut&&(clearTimeout(ut),At.delete(X))};return{...yt,...St,...zt,href:D?.href,ref:o,onClick:_t([x,Zs]),onBlur:_t([P,Fe]),onFocus:_t([I,De]),onMouseEnter:_t([S,De]),onMouseLeave:_t([C,Fe]),onTouchStart:_t([w,Qs]),disabled:!!v,target:y,...Ae&&{style:Ae},...ke&&{className:ke},...v&&To,...W&&Oo,...p&&Xs&&ko}}var ye={},Lo={className:"active"},To={role:"link","aria-disabled":!0},Oo={"data-status":"active","aria-current":"page"},ko={"data-transitioning":"transitioning"},At=new WeakMap,Ao={rootMargin:"100px"},_t=t=>s=>{for(const e of t)if(e){if(s.defaultPrevented)return;e(s)}};function jo(t,s,e,o){if(!o)return s?{href:t,external:!0}:{href:e.createHref(t)||"/",external:!1}}function Bo(t){if(typeof t!="string")return!1;const s=t.charCodeAt(0);return s===47?t.charCodeAt(1)!==47:s===46}var Ks=E.forwardRef((t,s)=>{const{_asChild:e,...o}=t,{type:n,...r}=Io(o,s),i=typeof o.children=="function"?o.children({isActive:r["data-status"]==="active"}):o.children;if(!e){const{disabled:a,...l}=r;return E.createElement("a",l,i)}return E.createElement(e,r,i)});function Do(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var Fo=class extends ks{constructor(t){super(t),this.useMatch=s=>vt({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>qs({...s,from:this.id}),this.useSearch=s=>$s({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>Ws({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Hs({...s,from:this.id}),this.useLoaderData=s=>Us({...s,from:this.id}),this.useNavigate=()=>Vs({from:this.fullPath}),this.Link=Pt.forwardRef((s,e)=>T.jsx(Ks,{ref:e,from:this.fullPath,...s}))}};function pr(t){return new Fo(t)}var No=class extends uo{constructor(t){super(t),this.useMatch=s=>vt({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>qs({...s,from:this.id}),this.useSearch=s=>$s({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>Ws({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Hs({...s,from:this.id}),this.useLoaderData=s=>Us({...s,from:this.id}),this.useNavigate=()=>Vs({from:this.fullPath}),this.Link=Pt.forwardRef((s,e)=>T.jsx(Ks,{ref:e,from:this.fullPath,...s}))}};function mr(t){return new No(t)}function gr(t,s){let e,o,n,r;const i=()=>(e||(e=t().then(l=>{e=void 0,o=l[s??"default"]}).catch(l=>{if(n=l,dn(n)&&n instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const c=`tanstack_router_reload:${n.message}`;sessionStorage.getItem(c)||(sessionStorage.setItem(c,"1"),r=!0)}})),e),a=function(c){if(r)throw window.location.reload(),new Promise(()=>{});if(n)throw n;if(!o)if(Ve)Ve(i());else throw i();return E.createElement(o,c)};return a.preload=i,a}function zo(t){const s=Q(),e=`not-found-${J(s.stores.location,o=>o.pathname)}-${J(s.stores.status,o=>o)}`;return T.jsx(Ie,{getResetKey:()=>e,onCatch:(o,n)=>{if(Y(o))t.onCatch?.(o,n);else throw o},errorComponent:({error:o})=>{if(Y(o))return t.fallback?.(o);throw o},children:t.children})}function Uo(){return T.jsx("p",{children:"Not Found"})}function bt(t){return T.jsx(T.Fragment,{children:t.children})}function Gs(t,s,e){return s.options.notFoundComponent?T.jsx(s.options.notFoundComponent,{...e}):t.options.defaultNotFoundComponent?T.jsx(t.options.defaultNotFoundComponent,{...e}):T.jsx(Uo,{})}function Ho(t){return null}function Wo(){return Ho(Q()),null}var Ys=E.memo(function({matchId:s}){const e=Q(),o=e.stores.activeMatchStoresById.get(s);o||et();const n=J(e.stores.loadedAt,i=>i),r=J(o,i=>i);return T.jsx($o,{router:e,matchId:s,resetKey:n,matchState:E.useMemo(()=>{const i=r.routeId,a=e.routesById[i].parentRoute?.id;return{routeId:i,ssr:r.ssr,_displayPending:r._displayPending,parentRouteId:a}},[r._displayPending,r.routeId,r.ssr,e.routesById])})});function $o({router:t,matchId:s,resetKey:e,matchState:o}){const n=t.routesById[o.routeId],r=n.options.pendingComponent??t.options.defaultPendingComponent,i=r?T.jsx(r,{}):null,a=n.options.errorComponent??t.options.defaultErrorComponent,l=n.options.onCatch??t.options.defaultOnCatch,c=n.isRoot?n.options.notFoundComponent??t.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=o.ssr===!1||o.ssr==="data-only",f=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||u))?E.Suspense:bt,h=a?Ie:bt,d=c?zo:bt;return T.jsxs(n.isRoot?n.options.shellComponent??bt:bt,{children:[T.jsx(ee.Provider,{value:s,children:T.jsx(f,{fallback:i,children:T.jsx(h,{getResetKey:()=>e,errorComponent:a||Le,onCatch:(m,g)=>{if(Y(m))throw m.routeId??=o.routeId,m;l?.(m,g)},children:T.jsx(d,{fallback:m=>{if(m.routeId??=o.routeId,!c||m.routeId&&m.routeId!==o.routeId||!m.routeId&&!n.isRoot)throw m;return E.createElement(c,m)},children:u||o._displayPending?T.jsx(po,{fallback:i,children:T.jsx(vs,{matchId:s})}):T.jsx(vs,{matchId:s})})})})}),o.parentRouteId===mt?T.jsxs(T.Fragment,{children:[T.jsx(Vo,{resetKey:e}),t.options.scrollRestoration&&bs?T.jsx(Wo,{}):null]}):null]})}function Vo({resetKey:t}){const s=Q(),e=E.useRef(void 0);return jt(()=>{const o=s.latestLocation.href;(e.current===void 0||e.current!==o)&&(s.emit({type:"onRendered",...wt(s.stores.location.state,s.stores.resolvedLocation.state)}),e.current=o)},[s.latestLocation.state.__TSR_key,t,s]),null}var vs=E.memo(function({matchId:s}){const e=Q(),o=e.stores.activeMatchStoresById.get(s);o||et();const n=J(o,c=>c),r=n.routeId,i=e.routesById[r],a=E.useMemo(()=>{const c=(e.routesById[r].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return c?JSON.stringify(c):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,e.options.defaultRemountDeps,e.routesById]),l=E.useMemo(()=>{const c=i.options.component??e.options.defaultComponent;return c?T.jsx(c,{},a):T.jsx(qo,{})},[a,i.options.component,e.options.defaultComponent]);if(n._displayPending)throw e.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw e.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status==="pending"){const c=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(c){const u=e.getMatch(n.id);if(u&&!u._nonReactive.minPendingPromise){const f=Mt();u._nonReactive.minPendingPromise=f,setTimeout(()=>{f.resolve(),u._nonReactive.minPendingPromise=void 0},c)}}throw e.getMatch(n.id)?._nonReactive.loadPromise}if(n.status==="notFound")return Y(n.error)||et(),Gs(e,i,n.error);if(n.status==="redirected")throw Z(n.error)||et(),e.getMatch(n.id)?._nonReactive.loadPromise;if(n.status==="error")throw n.error;return l}),qo=E.memo(function(){const s=Q(),e=E.useContext(ee);let o,n=!1,r;{const c=e?s.stores.activeMatchStoresById.get(e):void 0;[o,n]=J(c,u=>[u?.routeId,u?.globalNotFound??!1]),r=J(s.stores.matchesId,u=>u[u.findIndex(f=>f===e)+1])}const i=o?s.routesById[o]:void 0,a=s.options.defaultPendingComponent?T.jsx(s.options.defaultPendingComponent,{}):null;if(n)return i||et(),Gs(s,i,void 0);if(!r)return null;const l=T.jsx(Ys,{matchId:r});return o===mt?T.jsx(E.Suspense,{fallback:a,children:l}):l});function Ko(){const t=Q(),s=E.useRef({router:t,mounted:!1}),[e,o]=E.useState(!1),n=J(t.stores.isLoading,f=>f),r=J(t.stores.hasPendingMatches,f=>f),i=ie(n),a=n||e||r,l=ie(a),c=n||r,u=ie(c);return t.startTransition=f=>{o(!0),E.startTransition(()=>{f(),o(!1)})},E.useEffect(()=>{const f=t.history.subscribe(t.load),h=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return it(t.latestLocation.publicHref)!==it(h.publicHref)&&t.commitLocation({...h,replace:!0}),()=>{f()}},[t,t.history]),jt(()=>{if(typeof window<"u"&&t.ssr||s.current.router===t&&s.current.mounted)return;s.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(h){console.error(h)}})()},[t]),jt(()=>{i&&!n&&t.emit({type:"onLoad",...wt(t.stores.location.state,t.stores.resolvedLocation.state)})},[i,t,n]),jt(()=>{u&&!c&&t.emit({type:"onBeforeRouteMount",...wt(t.stores.location.state,t.stores.resolvedLocation.state)})},[c,u,t]),jt(()=>{if(l&&!a){const f=wt(t.stores.location.state,t.stores.resolvedLocation.state);t.emit({type:"onResolved",...f}),Ds(()=>{t.stores.status.setState(()=>"idle"),t.stores.resolvedLocation.setState(()=>t.stores.location.state)}),f.hrefChanged&&fo(t)}},[a,l,t]),null}function Go(){const t=Q(),s=t.routesById[mt].options.pendingComponent??t.options.defaultPendingComponent,e=s?T.jsx(s,{}):null,o=T.jsxs(typeof document<"u"&&t.ssr?bt:E.Suspense,{fallback:e,children:[T.jsx(Ko,{}),T.jsx(Yo,{})]});return t.options.InnerWrap?T.jsx(t.options.InnerWrap,{children:o}):o}function Yo(){const t=Q(),s=J(t.stores.firstMatchId,n=>n),e=J(t.stores.loadedAt,n=>n),o=s?T.jsx(Ys,{matchId:s}):null;return T.jsx(ee.Provider,{value:s,children:t.options.disableGlobalCatchBoundary?o:T.jsx(Ie,{getResetKey:()=>e,errorComponent:Le,onCatch:void 0,children:o})})}function vr(){const t=Q();return J(t.stores.matchRouteReactivity,s=>s),E.useCallback(s=>{const{pending:e,caseSensitive:o,fuzzy:n,includeSearch:r,...i}=s;return t.matchRoute(i,{pending:e,caseSensitive:o,fuzzy:n,includeSearch:r})},[t])}var Jo=t=>({createMutableStore:hs,createReadonlyStore:hs,batch:Ds}),yr=t=>new Xo(t),Xo=class extends so{constructor(t){super(t,Jo)}};function Zo({router:t,children:s,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const o=T.jsx(js.Provider,{value:t,children:s});return t.options.Wrap?T.jsx(t.options.Wrap,{children:o}):o}function Sr({router:t,...s}){return T.jsx(Zo,{router:t,...s,children:T.jsx(Go,{})})}function Rr(t){const s=Q({warn:t?.router===void 0}),e=t?.router||s,o=E.useRef(void 0);return J(e.stores.__store,n=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){const r=ot(o.current,t.select(n));return o.current=r,r}return t.select(n)}return n})}function xt(t,s,e){let o=e.initialDeps??[],n,r=!0;function i(){var a,l,c;let u;e.key&&((a=e.debug)!=null&&a.call(e))&&(u=Date.now());const f=t();if(!(f.length!==o.length||f.some((m,g)=>o[g]!==m)))return n;o=f;let d;if(e.key&&((l=e.debug)!=null&&l.call(e))&&(d=Date.now()),n=s(...f),e.key&&((c=e.debug)!=null&&c.call(e))){const m=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-d)*100)/100,y=g/16,v=(R,b)=>{for(R=String(R);R.length{o=a},i}function ys(t,s){if(t===void 0)throw new Error("Unexpected undefined");return t}const Qo=(t,s)=>Math.abs(t-s)<1.01,tr=(t,s,e)=>{let o;return function(...n){t.clearTimeout(o),o=t.setTimeout(()=>s.apply(this,n),e)}},Ss=t=>{const{offsetWidth:s,offsetHeight:e}=t;return{width:s,height:e}},er=t=>t,sr=t=>{const s=Math.max(t.startIndex-t.overscan,0),e=Math.min(t.endIndex+t.overscan,t.count-1),o=[];for(let n=s;n<=e;n++)o.push(n);return o},nr=(t,s)=>{const e=t.scrollElement;if(!e)return;const o=t.targetWindow;if(!o)return;const n=i=>{const{width:a,height:l}=i;s({width:Math.round(a),height:Math.round(l)})};if(n(Ss(e)),!o.ResizeObserver)return()=>{};const r=new o.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){n({width:c.inlineSize,height:c.blockSize});return}}n(Ss(e))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return r.observe(e,{box:"border-box"}),()=>{r.unobserve(e)}},Rs={passive:!0},_s=typeof window>"u"?!0:"onscrollend"in window,or=(t,s)=>{const e=t.scrollElement;if(!e)return;const o=t.targetWindow;if(!o)return;let n=0;const r=t.options.useScrollendEvent&&_s?()=>{}:tr(o,()=>{s(n,!1)},t.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:f,isRtl:h}=t.options;n=f?e.scrollLeft*(h&&-1||1):e.scrollTop,r(),s(n,u)},a=i(!0),l=i(!1);e.addEventListener("scroll",a,Rs);const c=t.options.useScrollendEvent&&_s;return c&&e.addEventListener("scrollend",l,Rs),()=>{e.removeEventListener("scroll",a),c&&e.removeEventListener("scrollend",l)}},rr=(t,s,e)=>{if(s?.borderBoxSize){const o=s.borderBoxSize[0];if(o)return Math.round(o[e.options.horizontal?"inlineSize":"blockSize"])}return t[e.options.horizontal?"offsetWidth":"offsetHeight"]},ir=(t,{adjustments:s=0,behavior:e},o)=>{var n,r;const i=t+s;(r=(n=o.scrollElement)==null?void 0:n.scrollTo)==null||r.call(n,{[o.options.horizontal?"left":"top"]:i,behavior:e})};class ar{constructor(s){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,o,n;return((n=(o=(e=this.targetWindow)==null?void 0:e.performance)==null?void 0:o.now)==null?void 0:n.call(o))??Date.now()},this.observer=(()=>{let e=null;const o=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(n=>{n.forEach(r=>{const i=()=>{const a=r.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,r,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var n;(n=o())==null||n.disconnect(),e=null},observe:n=>{var r;return(r=o())==null?void 0:r.observe(n,{box:"border-box"})},unobserve:n=>{var r;return(r=o())==null?void 0:r.unobserve(n)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([o,n])=>{typeof n>"u"&&delete e[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:er,rangeExtractor:sr,onChange:()=>{},measureElement:rr,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var o,n;(n=(o=this.options).onChange)==null||n.call(o,this,e)},this.maybeNotify=xt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,o)=>{const n=new Map,r=new Map;for(let i=o-1;i>=0;i--){const a=e[i];if(n.has(a.lane))continue;const l=r.get(a.lane);if(l==null||a.end>l.end?r.set(a.lane,a):a.endi.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=xt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,o,n,r,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:o,scrollMargin:n,getItemKey:r,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=xt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:o,scrollMargin:n,getItemKey:r,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const h of this.laneAssignments.keys())h>=e&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let h=0;h1){g=m;const x=f[g],P=x!==void 0?u[x]:void 0;y=P?P.end+this.options.gap:o+n}else{const x=this.options.lanes===1?u[h-1]:this.getFurthestMeasurement(u,h);y=x?x.end+this.options.gap:o+n,g=x?x.lane:h%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(h,g)}const v=l.get(d),R=typeof v=="number"?v:this.options.estimateSize(h),b=y+R;u[h]={index:h,start:y,size:R,end:b,key:d,lane:g},f[g]=h}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=xt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,o,n,r)=>this.range=e.length>0&&o>0?cr({measurements:e,outerSize:o,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=xt(()=>{let e=null,o=null;const n=this.calculateRange();return n&&(e=n.startIndex,o=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,o]},(e,o,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:o,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const o=this.options.indexAttribute,n=e.getAttribute(o);return n?parseInt(n,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(n!==void 0&&this.range){const r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,n-r),a=Math.min(this.options.count-1,n+r);return e>=i&&e<=a}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((i,a)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(a))});return}const o=this.indexFromElement(e),n=this.options.getItemKey(o),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,o)=>{var n;const r=this.measurementsCache[e];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,a=o-i;a!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start[this.getVirtualIndexes(),this.getMeasurements()],(e,o)=>{const n=[];for(let r=0,i=e.length;rthis.options.debug}),this.getVirtualItemForOffset=e=>{const o=this.getMeasurements();if(o.length!==0)return ys(o[Js(0,o.length-1,n=>ys(o[n]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,o,n=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),i=this.getScrollOffset();o==="auto"&&(o=e>=i+r?"end":"start"),o==="center"?e+=(n-r)/2:o==="end"&&(e-=r);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,o="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(o==="auto")if(i.end>=r+n-this.options.scrollPaddingEnd)o="end";else if(i.start<=r+this.options.scrollPaddingStart)o="start";else return[r,o];if(o==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),o];const a=o==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,o,i.size),o]},this.scrollToOffset=(e,{align:o="start",behavior:n="auto"}={})=>{const r=this.getOffsetForAlignment(e,o),i=this.now();this.scrollState={index:null,align:o,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:o="auto",behavior:n="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=this.getOffsetForIndex(e,o);if(!r)return;const[i,a]=r,l=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:o="auto"}={})=>{const n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;const o=this.getMeasurements();let n;if(o.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((e=o[o.length-1])==null?void 0:e.end)??0;else{const r=Array(this.options.lanes).fill(null);let i=o.length-1;for(;i>=0&&r.some(a=>a===null);){const a=o[i];r[a.lane]===null&&(r[a.lane]=a.end),i--}n=Math.max(...r.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:o,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(s)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=o?o[0]:this.scrollState.lastTargetOffset,r=1,i=n!==this.scrollState.lastTargetOffset;if(!i&&Qo(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=r){this.scrollState=null;return}}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Js=(t,s,e,o)=>{for(;t<=s;){const n=(t+s)/2|0,r=e(n);if(ro)s=n-1;else return n}return t>0?t-1:0};function cr({measurements:t,outerSize:s,scrollOffset:e,lanes:o}){const n=t.length-1,r=l=>t[l].start;if(t.length<=o)return{startIndex:0,endIndex:n};let i=Js(0,n,r,e),a=i;if(o===1)for(;a1){const l=Array(o).fill(0);for(;au=0&&c.some(u=>u>=e);){const u=t[i];c[u.lane]=u.start,i--}i=Math.max(0,i-i%o),a=Math.min(n,a+(o-1-a%o))}return{startIndex:i,endIndex:a}}const xs=typeof document<"u"?E.useLayoutEffect:E.useEffect;function lr({useFlushSync:t=!0,...s}){const e=E.useReducer(()=>({}),{})[1],o={...s,onChange:(r,i)=>{var a;t&&i?Oe.flushSync(e):e(),(a=s.onChange)==null||a.call(s,r,i)}},[n]=E.useState(()=>new ar(o));return n.setOptions(o),xs(()=>n._didMount(),[]),xs(()=>n._willUpdate()),n}function _r(t){return lr({observeElementRect:nr,observeElementOffset:or,scrollToFn:ir,...t})}export{Ks as L,qo as O,Pt as R,Oe as a,wo as b,fr as c,dr as d,Zt as e,ur as f,we as g,an as h,Vs as i,T as j,vr as k,Q as l,Rr as m,mr as n,pr as o,gr as p,yr as q,E as r,Wn as s,Sr as t,hr as u,_r as v,zs as w,$s as x};