@acemarke/diffloupe 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +202 -135
  2. package/dist/index.js +599 -535
  3. package/dist/review-core/opencode/governor.ts +709 -0
  4. package/dist/review-core/opencode/tools.md +104 -0
  5. package/dist/review-core/system.md +52 -0
  6. package/dist/wasm/tree-sitter-cpp.wasm +0 -0
  7. package/dist/wasm/tree-sitter-tsx.wasm +0 -0
  8. package/dist/wasm/tree-sitter-typescript.wasm +0 -0
  9. package/dist/wasm/web-tree-sitter.wasm +0 -0
  10. package/dist/web/assets/arktype-bg7F_Ihs.js +34 -0
  11. package/dist/web/assets/diffs-D52k9AsX.js +157 -0
  12. package/dist/web/assets/index-BjtH6rIF.js +12 -0
  13. package/dist/web/assets/index-FlD9qnmN.css +1 -0
  14. package/dist/web/assets/langs/c-B7uRR5me.js +1 -0
  15. package/dist/web/assets/langs/cmake-Bj61d0ZC.js +1 -0
  16. package/dist/web/assets/langs/cpp-CsVjRphN.js +1 -0
  17. package/dist/web/assets/langs/css-C8fQr_0Q.js +1 -0
  18. package/dist/web/assets/langs/diff-woXpYk--.js +1 -0
  19. package/dist/web/assets/langs/docker-IyjqRm3v.js +1 -0
  20. package/dist/web/assets/langs/glsl-D4jN2Gfq.js +1 -0
  21. package/dist/web/assets/langs/go-rLFTqkRN.js +1 -0
  22. package/dist/web/assets/langs/graphql-CraUZO0h.js +1 -0
  23. package/dist/web/assets/langs/html-DA4kSGiR.js +1 -0
  24. package/dist/web/assets/langs/ini-B5eOa1yu.js +1 -0
  25. package/dist/web/assets/langs/java-BXcb2rRD.js +1 -0
  26. package/dist/web/assets/langs/javascript-BgS3c2Ky.js +1 -0
  27. package/dist/web/assets/langs/json-qhed-kSA.js +1 -0
  28. package/dist/web/assets/langs/json5-BR5RXkoi.js +1 -0
  29. package/dist/web/assets/langs/jsonc-CYpm1nAK.js +1 -0
  30. package/dist/web/assets/langs/jsx-Bz0zcwM4.js +1 -0
  31. package/dist/web/assets/langs/make-Dixweg8N.js +1 -0
  32. package/dist/web/assets/langs/markdown-BYOwaDjH.js +1 -0
  33. package/dist/web/assets/langs/objective-cpp-BsSzOQcm.js +1 -0
  34. package/dist/web/assets/langs/plain-text-BONI54VU.js +1 -0
  35. package/dist/web/assets/langs/postcss-BXeXVLqQ.js +1 -0
  36. package/dist/web/assets/langs/powershell-QtSnmXcu.js +1 -0
  37. package/dist/web/assets/langs/python-gzcpVVnB.js +1 -0
  38. package/dist/web/assets/langs/regexp-Cw_s_VJJ.js +1 -0
  39. package/dist/web/assets/langs/rust-DpiIf5JO.js +1 -0
  40. package/dist/web/assets/langs/scss-CHVQqdPx.js +1 -0
  41. package/dist/web/assets/langs/shellscript-CLZ0U2zV.js +1 -0
  42. package/dist/web/assets/langs/sql-CEbI0hMM.js +1 -0
  43. package/dist/web/assets/langs/svelte-CfPQtCMR.js +1 -0
  44. package/dist/web/assets/langs/toml-CcmNWLt0.js +1 -0
  45. package/dist/web/assets/langs/tsx-udAQXfEw.js +1 -0
  46. package/dist/web/assets/langs/typescript-bsJCZSQ-.js +1 -0
  47. package/dist/web/assets/langs/vue-DEcQttJD.js +1 -0
  48. package/dist/web/assets/langs/xml-D5JPTzE5.js +1 -0
  49. package/dist/web/assets/langs/yaml-rwi0_p6S.js +1 -0
  50. package/dist/web/assets/react-jlQz0HNM.js +9 -0
  51. package/dist/web/assets/rolldown-runtime-hePW80VL.js +1 -0
  52. package/dist/web/assets/router-DvNvfdSS.js +2 -0
  53. package/dist/web/assets/shiki-CbbI7yl6.js +153 -0
  54. package/dist/web/assets/state-a-GRkbSP.js +1 -0
  55. package/dist/web/assets/themes/pierre-dark-CpLgRqie.js +1 -0
  56. package/dist/web/assets/themes/pierre-light-CoaEpmwp.js +1 -0
  57. package/dist/web/assets/unused-C8e4aDKx.js +1 -0
  58. package/dist/web/assets/worker-uPqQ0MJ1.js +164 -0
  59. package/dist/web/index.html +26 -0
  60. package/package.json +34 -15
@@ -0,0 +1,2 @@
1
+ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{n,r}from"./react-jlQz0HNM.js";var i=e(r(),1),a=i.useLayoutEffect;function o(e){return e[e.length-1]}function s(e,t){return typeof e==`function`?e(t):e}var c=Object.prototype.hasOwnProperty;function l(e){for(let t in e)if(c.call(e,t))return!0;return!1}var u=()=>Object.create(null),d=(e,t)=>f(e,t,!0);function f(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(p(e)&&p(t)))return t;let a=Object.keys(e),s=a.length,l=Object.keys(t),d=l.length;if(i?s!==e.length||d!==t.length||s&&o(a)!==`${s-1}`||d&&o(l)!==`${d-1}`:s!==Object.getOwnPropertyNames(e).length||d!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let m=0,h,g,_;if(i){for(;m<d&&(_=m,g=e[_],h=t[_],h=g===h?g:typeof g==`object`?f(g,h,n,r):h,h===g);m++);if(m===d&&s===d)return e}else{let i=s===d,o=!0;for(;m<d;m++){_=l[m],g=e[_];let s=t[_];h=g===s?g:typeof g==`object`?f(g,s,n,r):s,i&&=h===g&&(a[m]===_||c.call(e,_)),o&&=Object.is(h,s),a[m]=h}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(o)return t}let v=i?l.fill(0):n?u():{};for(let o=0;o<d;o++)_=i?o:l[o],i?(g=e[_],o>m&&(h=t[_],h=g===h?g:typeof g==`object`?f(g,h,n,r):h),v[_]=o<m?g:h):v[_]=a[o];return v}function p(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function m(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!m(a,o,n,r))return!1}return!0}if(p(e)&&p(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!m(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!m(e[a],t[a],n,r)))return!1;return i===0}return!1}var h=/[\x00-\x1f\x7f"<>`{}]/g;function g(e){return e.replace(h,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function _(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return g(t)}var v=[`http:`,`https:`,`mailto:`,`tel:`];function y(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var b=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function x(e,t){if(!e)return!1;if(b.test(e))return!0;let n=y(e);return n?!t.has(n):!1}function S(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=_(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=_(r?e.slice(r):e)}return t}function C(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function w(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function T(){throw Error(`Invariant failed`)}function E(e){return e.replace(/\/{2,}/g,`/`)}function D(e){return e===`/`?e:e.replace(/^\/+/,``)}function O(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function k(e){return O(D(e))}function A(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ee(e,t,n=`never`,r){if(t.includes(`//`)&&(t=E(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let s;if(i)s=e.split(`/`);else{for(e.includes(`//`)&&(e=E(e)),s=e.split(`/`);s.length>1&&o(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(o(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=s.join(`/`),l=(i?E(c):c)||`/`;return a&&r&&r.set(a,l),l}function te(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function ne(e){return e==null||e===``}function re(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function ie(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&ne(f)){if(c===`/`&&!d)continue;f=``}o+=c+re(s,f,r)+(d||``)}}return o+a||`/`}function j(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function M(e){return e?.isNotFound===!0}function N(){try{return sessionStorage}catch{return}}var ae=`tsr-scroll-restoration-v1_3`,oe=N();function P(){try{return JSON.parse(oe?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var F=P(),se=`data-scroll-restoration-id`,ce=e=>e.state.__TSR_key||e.href;function le(e){let t=e.getAttribute(se);if(t)return`[${se}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var ue=!1,de=`window`;function fe(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function pe(e){let t=new Set;for(let n of e){if(n===de)continue;let e=fe(n);e&&t.add(e)}return t}function me(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||ce,a=new Set,o=e=>{let t=F[e]||={};for(let e of a)e===document?t[de]={scrollX,scrollY}:e.isConnected&&(t[le(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,ue=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{ue||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{oe?.setItem(ae,JSON.stringify(F))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=F[d];if(e){let t=F[u];for(let n in e){if(n===de){if(s)continue}else{let e=fe(n);if(!e||s&&o&&(l??=pe(o),l.has(e)))continue}t||=F[u]={},t[n]??=e[n]}}}ue=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=pe(o));let t=e&&i&&c,s=r.e?F[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===de){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=fe(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{ue=!1}}))}function he(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function ge(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function _e(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ge(r):Array.isArray(t)?t.push(ge(r)):n[e]=[t,ge(r)]}return n}var ve=/^(?:\s|["[{\d-]|fa|nu|tr)/,ye=xe(JSON.parse),be=Se(JSON.stringify,JSON.parse);function xe(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=_e(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!ve.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Se(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!ve.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=he(e,r);return t?`?${t}`:``}}var Ce=`__root__`;function we(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Te(e){return e instanceof Response&&!!e.options}function Ee(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var I=4,De=5;function Oe(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function ke(e,t,n){let r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.substring(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.substring(s,a);return[o?3:c?1:2,c||`_splat`,r.substring(0,i),e.substring(t+a+1,c?n:e.length)]}}return r}function Ae(e,t,n,r,i,a){let s=n,c=t.fullPath??t.from,l=t.options,u=c.length,d=c.endsWith(`/`)?u-1:u,f=l?.caseSensitive??e,p=l?.params?.parse??l?.parseParams,m,h=a?n-1:0;if(!r||c.includes(`$`)){m=a?.slice()??[];let e=o(m);e&&typeof e!=`string`&&e[0]===2&&(m[m.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+c.substring(n-(c[n-2]===`/`?2:1),d)],h=u)}for(;s<u;){let e=s,t=c.indexOf(`/`,e),n=t===-1?u:t,a=ke(c,e,n);s=n+1;let o;if(typeof a==`string`){if(!r)continue;let e=a,t;f?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)o=n;else{let n=L(r);o=n,t.set(e,n)}}else{let t=a[0],l=a[2],g=a[3]??``;if(t===2&&(n=u,s=n+1),m&&h<n&&(h<e-1&&m.push(c.substring(h,e-1)),a[2]=`/`+l,t===2&&a[3]!==void 0&&d<u&&(a[3]=g.slice(0,-1)),m.push(a),h=n),!r)continue;let _=f&&!!(l||g);f||(l=l.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!p&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===l&&e.suffix===g);if(y)o=y;else{let e=L(r,t,_,l,g);o=e,v.push(e),v.length===2&&i?.push(v)}}r=o}m&&h<d&&m.push(c.substring(h,d));let g=m?.slice();if(!r)return g;if(p&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=L(r,De);(r.pathless??=[]).push(e),r=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&d<u){let e=L(r,I);r.index=e,r=e}return r.parse=p??null,r.priority=l?.params?.priority??0,r.route||(r.data=g,_&&(r.route=t)),[r,s,g]}function je(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function L(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Me(e,t){let n=L(),r=[];function i(e,t,n,a){let[o,s,c]=Ae(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(je);t.masksTree=n,t.flatCache=Ee(1e3)}function Ne(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Le(e,t.masksTree);return t.flatCache.set(e,r),r}function Pe(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=L(),Ae(t,{from:e},1,o),i.singleCache.set(a,o)),Le(r,o,n)}function Fe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Le(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ze(a.route)),t.matchCache.set(r,a),a}function Ie(e,t=!1){let n=L(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&T(),i[e.id]=e,o!==0&&e.path){let t=O(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Ae(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(je);return{processedTree:{segmentTree:n,singleCache:Ee(1e3),matchCache:Ee(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Le(e,t,n=!1){let r=e.split(`/`),i=Ve(e,r,t,n);if(!i)return null;let[a]=Re(e,r,i);return{route:i.node.route,rawParams:a}}function Re(e,t,n){let r=Be(n.node),i=n.node.data&&Oe(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===I)break;if(u.kind===De){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function ze(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Be(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ve(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!o(t),a=i&&e!==`/`,s=t.length-+!!i,c=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let n=c.pop(),{node:i,index:o,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Ge(u,n))continue;if(i.parse){if(!We(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==I&&Ge(l,n)&&(l=n);let _=o===s;if(_&&(i.route&&(!a||i.kind===I||i.kind===2)&&Ge(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[o],y;if(_&&i.index){let n={node:i.index,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(We(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Ue(f,s))return n;Ge(u,n)&&(u=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(o).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}c.push({node:n,index:s,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];c.push({node:n,index:o,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}c.push({node:t,index:o+1,skipped:d,statics:f,dynamics:p,optionals:m+He(s,o),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}c.push({node:t,index:o+1,skipped:d,statics:f,dynamics:p+He(s,o),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&c.push({node:e,index:o+1,skipped:d,statics:f+He(s,o),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&c.push({node:e,index:o+1,skipped:d,statics:f+He(s,o),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];c.push({node:t,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(u)return u;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function He(e,t){return 2**(e-t-1)}function Ue(e,t){return e===2**(t-1)-1}function We(e,t,n){let r,i;try{[r,i]=Re(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Ge(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===I)>(e.node.kind===I)||t.node.kind===I==(e.node.kind===I)&&t.node.depth>e.node.depth)))}function Ke(e,t,n){let r=k(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=E(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>qe(n,s.input({url:e})),output:({url:e})=>s.output({url:Je(n,e)})}:s}function qe(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Je(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ye(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{w(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var R=`__TSR_index`,Xe=`popstate`,Ze=`beforeunload`,Qe=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function $e(e){let t=Qe.exec(e);return t?`/`+e.slice(t[0].length):e}function et(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
2
+ \r`.includes(e)?``:encodeURIComponent(e))),$e(e)}function tt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=it(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[R];i=nt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[R];i=nt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[R]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function nt(e,t){let n=at();return{...t,key:n,__TSR_key:n,[R]:e}}function rt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>et(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>it(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=at();t.history.replaceState({[R]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=it(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[R]-l.state[R],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=tt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ze,x,{capture:!0}),t.removeEventListener(Xe,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(Ze,x,{capture:!0}),t.addEventListener(Xe,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function it(e,t){let n=et(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=at();t={[R]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function at(){return(Math.random()+1).toString(36).substring(7)}function ot(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function st(e){return e.pathname+e.search+e.hash}function ct(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function lt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function ut({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function dt(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function ft(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var pt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:rt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&k(n)?Ke(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Ye(this.latestLocation,e),me(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ie(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Me(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:Ee(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:S(e),external:!1,searchStr:o,search:d(t?.search,i),hash:S(r.slice(1)),state:f(t?.state,a)}}let o=qe(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:S($e(o.pathname)),external:!!this.rewrite&&ot(o,this.origin),searchStr:c,search:d(t?.search,s),hash:S(o.hash.slice(1)),state:f(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Fe(O(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=it(n.href,{});n={...n,to:qe(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>(t=!0,i??=this.matchRoutesLightweight(r)),s=n.to?`${n.to}`:`.`,c=ee(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),d=this.routesByPath[O(c)],f=c.includes(`$`),p;if(d)p=d._branch??=ze(d);else if(f)p=[];else{let[e,t,n]=this.getMatchedRoutes(c);p=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(p=[...p,this.options.notFoundRoute])}let m=f?d?._interpolation??Ae(!1,{fullPath:c},0):void 0,h;for(let e of p){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(h??=vt(n.params,e),!l(h))break;h===e&&(h=Object.assign(u(),h));try{Object.assign(h,t(h))}catch{}}}h??=vt(n.params,yt(n.params,m)?o()[3]:bt);let g=e.leaveParams?c:$e(S(m?ie(c,m,h,this.pathParamsDecoder):c)),_=xt(p,e._includeValidateSearch),v=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};p.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,_t(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},y=_.length?St(_,v(),n):n.search===!0?v():typeof n.search==`function`?n.search(v()):n.search||bt,b=this.options.stringifySearch(y),x=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,w=x?`#${x}`:``,T=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:bt,E=`${g}${b}${w}`,D,k,A=!1;if(this.rewrite){let e=new URL(E,this.origin),t=e.origin,n=Je(this.rewrite,e);D=st(e),ot(n,t)?(k=n.href,A=!0):k=$e(st(n))}else D=C(E),k=D;return{publicHref:k,href:D,pathname:g,search:y,searchStr:b,state:T,hash:x??``,external:A,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Ne(r.pathname,this.processedTree);if(t){let i=Object.assign(u(),t.rawParams),{from:a,params:o,...s}=t.route,c=vt(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&!r.maskedLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return mt(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=O(this.latestLocation.href)===O(n.href)&&m(ut(n.state),ut(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?y(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return mt(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await an(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(lt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&ct(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(b.test(n)||(r=y(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:ot(e,this.origin)||(n=st(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=z,this.preloadRoute=e=>on(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?ee(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Pe(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!m(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?m(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=te(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??be,parseSearch:e.parseSearch??ye,protocolAllowlist:e.protocolAllowlist??v}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Ae(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:O(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ct(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,p=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},m;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,h,g;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=_t(i.options.validateSearch,{...n})??void 0;l={...n,...e},h={...r,...e}}catch(e){let r=e;if(e instanceof ht||(r=new ht(e.message,{cause:e})),t?.throwOnError)throw r;l=n,h={},g=r}}let _=``,v=``;try{_=i.options.loaderDeps?.({search:l})??``,v=_&&JSON.stringify(_)||``}catch(e){if(t?.throwOnError)throw e;g??=e}let y=u(),b=i._interpolation?ie(i.fullPath,i._interpolation,r,this.pathParamsDecoder,y):i.fullPath,x=i.id+b+v,S=p(i,n),C=this._cache.get(x)??(S?.id===x?S:void 0);m=C?._strictParams??Object.assign(y,m);let w;if(!C)try{wt(i,m)}catch(e){if(w=M(e)||Te(e)?e:new gt(e.message,{cause:e}),t?.throwOnError)throw w}let T=S?`stay`:`enter`,E;if(C)E={...C,cause:T,search:d(S?S.search:C.search,l),_strictSearch:h,searchError:g};else{let e=ct(i)?`pending`:`success`;E={id:x,ssr:i.options.ssr,index:n,routeId:i.id,params:S?.params??m,_strictParams:m,pathname:b,updatedAt:Date.now(),search:S?d(S.search,l):l,_strictSearch:h,searchError:g,status:e,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:t?._controller??new AbortController,cause:T,loaderDeps:S?f(S.loaderDeps,_):_,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let D=s===i.id;E._notFound&&!D&&(E.error=void 0),E._notFound=D,c[n]=E}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?d(n.params,m):m,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=o(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,s]=this.getMatchedRoutes(e.pathname),c=o(a),l={...e.search};for(let e of a)try{Object.assign(l,_t(e.options.validateSearch,l))}catch{}let u=n&&n.routeId===c.id&&n.pathname===e.pathname,d;if(u)d=n.params;else{let e=s;for(let t of a)try{wt(t,e)}catch{}d=e}let f=[a,c.fullPath,l,d];return this.lightweightCache.set(e,[r,f]),f}};async function mt(e,t,{replace:n,ignoreBlocker:r}){if(!x(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var ht=class extends Error{},gt=class extends Error{};function _t(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new ht(`Async validation not supported`);if(n.issues)throw new ht(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function vt(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function yt(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!c.call(e,t[1]))}var bt=Object.freeze({});function xt(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=_t(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function St(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=s(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Ct(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Ce}function wt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Tt(e,t){return e.options[t]?.preload?.()}function Et(e,t){let n=Tt(e,`component`),r=Tt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function z(e,t,n){let r=()=>t===!1?void 0:t?Tt(e,t):Et(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Dt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var B=0,V=1,Ot=2,H=3,U=[4];function kt(e){return typeof e[0]==`number`}function W(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function G(e,t){return e.routesById[t.routeId]}function At(e,t,n){return Te(e)?[H,e]:M(e)?(e.routeId||=n,[Ot,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[V,e]):[B,e]}function jt(e,t){let n=At(t,!0,e.id);if(n[0]!==V)return n;try{e.options.onError?.(n[1])}catch(t){n=At(t,!0,e.id)}return n}function Mt(e,t,n,r,i){return i[0].signal.aborted?U:Gt(e,t,n,jt(n,r),i)}async function Nt(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=G(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return K(e,r),[i,Mt(e,t,u,a,n)]}if(c.aborted)return[i,U];let p=r.paramsError??r.searchError;if(p!==void 0)return K(e,r),[i,Mt(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{It(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?W(a,c):a);if(c.aborted)return[i,U];let s=Gt(e,t,u,At(o,!1,u.id),n);if(s[0]!==B)return K(e,r),[i,s];r.context={...r.context,...o}}catch(a){return K(e,r),[i,Mt(e,t,u,a,n)]}finally{r.status=h,It(e,r,!1,n[0])}}i()}function Pt(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function K(e,t){let n=t._flight;t._flight=void 0,Pt(e,t,n)?.abort()}function q(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Pt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Ft(e){for(let t of e){let e=t._flight;e&&e[2]++}}function It(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Lt(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Rt(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return U;if(!i)return[B,void 0];let l=n._flight;It(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Lt(e,t,n,r,s,a,!!o[3]))).then(e=>At(e,!1,r.id),e=>At(e,!0,r.id)).then(t=>(t[0]!==B&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===V&&l[2]?jt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Gt(e,t,r,await W(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return K(e,n),U}finally{It(e,n,!1,s)}}function zt(e,t,n){t[0]!==H&&(e.status=`success`,e.error=void 0,t[0]===B?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function Bt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&K(e,r)}function Vt(e,t){return t[0]===V||t[0]===Ot?{...e,status:t[0]===V?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Ht(e,t,n,r,i,a,o){let s=t[1][n],c=G(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Lt(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=U)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,K(e,s),p=Mt(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Pt(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Rt(e,t,s,c,g,i,a).then(t=>(zt(s,t,l),t[0]===B&&(m&&!a[0].signal.aborted&&Bt(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[B,s.loaderData]),T=(async()=>{try{let e=z(c,void 0,C);e&&await W(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Mt(e,t,c,r,a)]}let r=await w;x&&r[0]===B&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>Vt(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=Rt(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,zt(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Vt(E,e))}async function Ut(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=G(e,t[n]);try{let e=z(i,!1);e&&await W(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function J(e,t){t[2]&&=(q(e,t[2].map(e=>e[3])),void 0)}async function Wt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=H)throw[a,t];!i&&t[0]!==B&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===H)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Gt(e,t,n,r,i,a){for(;r[0]===H;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[H,t]:[H,t,a]}return[H,o,n]}catch(e){r=a?[V,e]:jt(n,e),a=!0}}return r}async function Kt(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ot?Ut(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=H)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==B&&t[0]<H&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=H){let n=s[1];if(n[0]!==H||n[1].options.reloadDocument||n[2])return J(e,t),n;c=!0,s=[0,[V,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===V?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=G(e,u);try{await W(i?Promise.resolve().then(()=>z(m,l===V?`errorComponent`:`notFoundComponent`)):Promise.all([z(m),z(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return J(e,t),U}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),J(e,t),q(e,o),p()):u.status=`success`}return t}async function qt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=G(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await W(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Jt(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Ut(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Ht(e,i,t,u,f,r,l)},m=await Nt(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Ot){let t=await Ut(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=H&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Kt(e,i,u,r[0],Wt(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Wt(i[2],void 0,void 0,h.then(e=>kt(e)?0:Dt(n).length,()=>0))),o=await h}catch(t){if(J(e,i),t===a&&a.aborted)return U;throw t}return kt(o)?o:qt(e,o,a,r[6]===n.length?r[6]:0)}function Yt(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=G(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Yt(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Xt(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Zt(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Dt(t[3]).some(e=>e.id===n[1]))return;let i;try{await W(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Qt(e,t){e._committed=t,e.stores.setMatches(t)}function $t(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Dt(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=G(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=dt(n);Qt(e,n),q(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),ft(e,i,n,a,l,t)}async function en(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function tn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function nn(e,t,n,r,i){let a=n.map(e=>({...e}));Ft(a);for(let t of r)K(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Kt(e,o,r,t[0],i)}catch(t){throw q(e,a),t}if(kt(s))q(e,a),s[0]===H&&e._tx===t&&e._committed===n&&await tn(e,t,s);else if(await qt(e,s,t[0].signal),e._tx!==t||e._committed!==n)q(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),K(e,n))}Qt(e,a),q(e,n,a)}}async function rn(e,t,n,r,i,a){let o=await Jt(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(kt(o)){let n=o[0]===H&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Xt(e,t),q(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Xt(e,t);return}await tn(e,t,o);return}let s=o[1];if(e._tx===t&&await Zt(e,t),e._tx!==t){Xt(e,t),q(e,s),J(e,o);return}let c=t[2],l=lt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Zt(e,t),e._tx!==t){Xt(e,t),q(e,s),J(e,o);return}let n=await e.startTransition(()=>{Xt(e,t),$t(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&nn(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):J(e,o)})}async function an(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=lt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await en(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Ft(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){q(e,m),await en(e,n);return}e._preflight=void 0;let g,_=()=>rn(e,y,f,()=>Yt(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>en(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&It(e,t,!1)}n[0].abort(),q(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Yt(e,y),g?.(_()),await y[5]):(q(e,y[3]),y[3]=[],g?.(),await en(e,y))}async function on(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Ft(a),o=(e._preloads??=new Map).set(i,a),s=await Jt(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),q(e,a)),i.abort()}if(!kt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){M(e)||console.error(e);return}}}var sn=`Error preloading route! ☝️`,cn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Ce:this.parentRoute||T();let r=n?Ce:t?.path;r&&r!==`/`&&(r=D(r));let i=t?.id||r,a=n?Ce:E((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:E(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=O(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>we({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ln=class{constructor({id:e}){this.notFound=e=>j({routeId:this.id,...e}),this.redirect=e=>we({from:this.id,...e}),this.id=e}},un=class extends cn{constructor(e){super(e)}},Y=n(),dn=class extends i.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?i.createElement(this.props.errorComponent??fn,{error:e[0],reset:this.reset}):this.props.children}};function fn({error:e}){let[t,n]=i.useState(!1);return(0,Y.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Y.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Y.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Y.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,Y.jsx)(`code`,{children:e.message}):null})}):null]})}var pn=()=>!0,mn=()=>!1;function hn({children:e,fallback:t=null}){return(0,Y.jsx)(i.Fragment,{children:gn()?e:t})}function gn(e=!0){return i.useSyncExternalStore(_n,pn,e?mn:pn)}function _n(){return()=>{}}var vn=i.createContext(null);function X(e){return i.useContext(vn)}var yn=i.createContext(void 0),bn=i.createContext(void 0);function xn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Sn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Cn=[],wn=0,{link:Tn,unlink:En,propagate:Dn,checkDirty:On,shallowPropagate:kn}=xn({update(e){return e._update()},notify(e){Cn[jn++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Pn(e))}}),An=0,jn=0,Z,Mn=0;function Nn(e){try{++Mn,e()}finally{--Mn||Fn()}}function Pn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=En(n,e)}function Fn(){if(!(Mn>0)){for(;An<jn;){let e=Cn[An];Cn[An++]=void 0,e.notify()}An=0,jn=0}}function In(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return Z!==void 0&&Tn(i,Z,wn),i._snapshot},subscribe(e){let t=Sn(e),n={current:!1},r=Ln(()=>{i.get(),n.current?(Z=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++wn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Z=a,n&&(i.flags&=-5),Pn(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&On(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&kn(e)}}else e&32&&(i.flags=e&-33);return Z!==void 0&&Tn(i,Z,wn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Dn(e),kn(e),Fn())}},i}function Ln(e){let t=()=>{let t=Z;Z=n,++wn,n.depsTail=void 0,n.flags=6;try{return e()}finally{Z=t,n.flags&=-5,Pn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&On(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Pn(this)}};return t(),n}var Rn=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),zn=t(((e,t)=>{t.exports=Rn()})),Bn=t((e=>{var t=r(),n=zn();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Vn=t(((e,t)=>{t.exports=Bn()}))();function Hn(e,t){return e===t}function Q(e,t=e=>e,n){let r=n?.compare??Hn,a=(0,i.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),o=(0,i.useCallback)(()=>e.get(),[e]);return(0,Vn.useSyncExternalStoreWithSelector)(a,o,o,t,r)}var Un={};function Wn(e,t){let n=i.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=f(n.current,i):i}}function $(e){let t=X(),n=i.useContext(e.from?bn:yn),r=e.from??n,a=t.stores.getMatchStore(r),o=Wn(e,t),s=Q(a,e=>e?o(e):Un);if(s!==Un)return s;(e.shouldThrow??!0)&&T()}function Gn(e){return $({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Kn(e){let{select:t,...n}=e;return $({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function qn(e){return $({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Jn(e){return $({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Yn(e){let t=X();return i.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Xn(e){return $({...e,select:t=>e.select?e.select(t.context):t.context})}function Zn(...e){let t=i.useRef(e),n=t.current;return e.forEach((e,t)=>{m(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Qn(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(sn)})}var $n={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function er(e,t){let n=typeof e==`string`&&y(e);if(n)return t.has(n)?e:null}function tr(e,t,n,r,i){let a=A(e.pathname,r),o=A(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!m(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||i&&e.hash===t.hash}function nr(e,t,n){let r=X(),a=i.useRef(null),o=i.useCallback(e=>{if(a.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:s,to:c,preload:l,preloadDelay:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,ignoreBlocker:g,disabled:_,target:v,onClick:b,onBlur:x,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:T}=e,E=gn(!!s?.includeHash),[D,O,k]=Zn(e.search,e.params,s),[A,ee]=i.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,D,O,e.state,e.mask,e.unsafeRelative]),te=i.useMemo(()=>{let e=er(c,r.protocolAllowlist);if(e!==void 0){let t=[e??void 0];return()=>t}let t,n;return e=>{A._fromLocation||(ee._fromLocation=e);let i=r.buildLocation(ee),a=dr(i,r,_);return(!t||t[0]!==a)&&(t=[a,!(_||a&&!y(a))&&void 0],n=[a,!0]),t[1]!==void 0&&tr(e,i,k,r.basepath,E)?n:t}},[k,_,E,A,ee,r,c]),[ne,re]=Q(r.stores.location,te,$n),ie=re===void 0&&ne,j=_||ne===void 0,M=i.useRef(!1),N=e.reloadDocument||ie||j?!1:l??r.options.defaultPreload,ae=u??r.options.defaultPreloadDelay??0,oe=i.useCallback(e=>{let t=e?.isIntersecting;t??N===`intent`?ae?cr.has(a)||cr.set(a,setTimeout(()=>{cr.delete(a),Qn(r,A)},ae)):Qn(r,A):t===!1&&lr(a)},[r,A,a,N,ae]);i.useEffect(()=>{if(!N)return;N===`render`&&!M.current&&(M.current=!0,Qn(r,A));let e=!0,t;return N===`viewport`&&a.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&oe(t.pop())},{rootMargin:`100px`}),t.observe(a.current)),()=>{e=!1,t?.disconnect(),lr(a)}},[r,A,N,oe,a]);let P=or(e,n);if(P.ref=t?o:a,ie)return P.href=ie,P;let F=e=>{let t=v??e.currentTarget.getAttribute(`target`);!j&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!t||t===`_self`)&&e.button===0&&(e.preventDefault(),r.navigate({...A,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:g}))},se=()=>{N===`intent`&&Qn(r,A)},ce=()=>{N===`intent`&&lr(a)};return P.onClick=ur(b,F),P.onBlur=ur(x,ce),P.onFocus=ur(S,oe),P.onMouseEnter=ur(C,oe),P.onMouseLeave=ur(w,ce),P.onTouchStart=ur(T,se),sr(P,e,re,ne,j,n)}var rr={},ir={className:`active`},ar=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`_fromLocation`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function or(e,t){let n={};for(let r in e)ar.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function sr(e,t,n,r,i,a){let{activeProps:o,inactiveProps:c,className:l,style:u,target:d}=t,f=s(n?o:c,{})??(n?ir:rr);Object.assign(e,f),e.href=r,a!==`a`&&(e.disabled=i),e.target=d;let p=f.style;(u||p)&&(e.style=u&&p?{...u,...p}:u||p);let m=f.className;return(l||m)&&(e.className=l?m?`${l} ${m}`:l:m),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var cr=new WeakMap,lr=e=>{clearTimeout(cr.get(e)),cr.delete(e)},ur=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function dr(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!x(i,t.protocolAllowlist))return i}var fr=i.memo(i.forwardRef((e,t)=>{let n=e._asChild||`a`,r=nr(e,t,n),a=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return i.createElement(n,r,a)}),pr);function pr(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!ar.has(r)||!m(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}function mr(e){return new hr({id:e})}var hr=class extends ln{constructor({id:e}){super({id:e}),this.useMatch=e=>$({...e,from:this.id}),this.useRouteContext=e=>Xn({...e,from:this.id}),this.useSearch=e=>Jn({...e,from:this.id}),this.useParams=e=>qn({...e,from:this.id}),this.useLoaderDeps=e=>Kn({...e,from:this.id,strict:!1}),this.useLoaderData=e=>Gn({...e,from:this.id,strict:!1}),this.useNavigate=()=>Yn({from:X().routesById[this.id].fullPath}),this.notFound=e=>j({routeId:this.id,...e}),this.Link=i.forwardRef((e,t)=>{let n=X().routesById[this.id].fullPath;return(0,Y.jsx)(fr,{ref:t,from:n,...e})})}},gr=class extends cn{constructor(e){super(e),this.useMatch=e=>$({...e,from:this.id}),this.useRouteContext=e=>Xn({...e,from:this.id}),this.useSearch=e=>Jn({...e,from:this.id}),this.useParams=e=>qn({...e,from:this.id}),this.useLoaderDeps=e=>Kn({...e,from:this.id}),this.useLoaderData=e=>Gn({...e,from:this.id}),this.useNavigate=()=>Yn({from:this.fullPath}),this.Link=i.forwardRef((e,t)=>(0,Y.jsx)(fr,{ref:t,from:this.fullPath,...e}))}};function _r(e){return new gr(e)}function vr(){return e=>br(e)}var yr=class extends un{constructor(e){super(e),this.useMatch=e=>$({...e,from:this.id}),this.useRouteContext=e=>Xn({...e,from:this.id}),this.useSearch=e=>Jn({...e,from:this.id}),this.useParams=e=>qn({...e,from:this.id}),this.useLoaderDeps=e=>Kn({...e,from:this.id}),this.useLoaderData=e=>Gn({...e,from:this.id}),this.useNavigate=()=>Yn({from:this.fullPath}),this.Link=i.forwardRef((e,t)=>(0,Y.jsx)(fr,{ref:t,from:this.fullPath,...e}))}};function br(e){return new yr(e)}function xr(e){let t=X(),n=`not-found-${Q(t.stores.location,e=>e.pathname)}-${Q(t.stores.status)}`;return(0,Y.jsx)(dn,{getResetKey:()=>n,onCatch:(t,n)=>{if(M(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(M(t))return e.fallback?.(t);throw t},children:e.children})}function Sr(){return(0,Y.jsx)(`p`,{children:`Not Found`})}function Cr(e,t,n){return t.options.notFoundComponent?(0,Y.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Y.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Y.jsx)(Sr,{})}function wr(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,Y.jsx)(n,{}):null}var Tr=(e,t)=>e[0]===t[0]&&e[1]===t[1],Er=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Dr=i.memo(function({routeId:e}){let t=X();return(0,Y.jsx)(Or,{router:t,match:Q(t.stores.getMatchStore(e))})});function Or({router:e,match:t}){let n=e.routesById[t.routeId],r=wr(e,n),a=n.options.errorComponent??e.options.defaultErrorComponent,o=n.options.onCatch??e.options.defaultOnCatch,s=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,c=t.ssr===!1||t.ssr===`data-only`,l=Er(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||c)),u=(0,Y.jsx)(kr,{match:t});c&&(u=(0,Y.jsx)(hn,{fallback:r,children:u})),s&&(u=(0,Y.jsx)(xr,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return i.createElement(s,e)},children:u})),a&&(u=(0,Y.jsx)(dn,{getResetKey:()=>t,errorComponent:a,onCatch:(e,n)=>{if(M(e))throw e.routeId??=t.routeId,e;o?.(e,n)},children:u})),l&&(u=(0,Y.jsx)(i.Suspense,{fallback:r,children:u}));let d=n.isRoot?n.options.shellComponent:void 0;return(0,Y.jsx)(yn.Provider,{value:t.routeId,children:d?(0,Y.jsxs)(d,{children:[u,null]}):(0,Y.jsxs)(Y.Fragment,{children:[u,null]})})}var kr=i.memo(function({match:e}){let t=X(),n=e.routeId,r=t.routesById[n],a=i.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),o=i.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,Y.jsx)(e,{},a):(0,Y.jsx)(Ar,{})},[a,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Er(t,r,e.ssr))return o;if(t._tx)throw t._tx[5];return wr(t,r)}if(e.status===`notFound`)return Cr(t,r,e.error);if(e.status===`error`)throw e.error;return o}),Ar=i.memo(function(){let e=X(),t=i.useContext(yn),n,r,a;{let i=e.stores.getMatchStore(t);[n,r]=Q(i,e=>[!!e._notFound,e.error],{compare:Tr}),a=Q(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Cr(e,e.routesById[t],r);if(!a)return null;let o=(0,Y.jsx)(Dr,{routeId:a});return t===`__root__`?(0,Y.jsx)(i.Suspense,{fallback:wr(e),children:o}):o});function jr(e,t){let n=e[1];e.length=0,n?.(t)}function Mr({t:e}){let t=X(),n=t._rendered??=[];return t.startTransition=(r,a)=>new Promise(o=>{jr(n,!1),n.push(a,o),e(t),i.startTransition(r)}),a(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(O(r.publicHref)!==O(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...lt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Nr(){let e=X(),t=e.routesById[Ce],n=wr(e,t),r=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Mr,{t:i.useState()[1]}),e.ssr?(0,Y.jsx)(Pr,{}):(0,Y.jsx)(i.Suspense,{fallback:n,children:(0,Y.jsx)(Pr,{})})]});return e.options.InnerWrap?(0,Y.jsx)(e.options.InnerWrap,{children:r}):r}function Pr(){let e=X(),t=e._rendered,n=Q(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;a(()=>{t[0]===n&&jr(t,!0)},[t,n]);let o=i?(0,Y.jsx)(Dr,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?o:(0,Y.jsx)(dn,{getResetKey:()=>r,onCatch:void 0,children:o})}var Fr=e=>({createMutableStore:In,createReadonlyStore:In,batch:Nn}),Ir=e=>new Lr(e),Lr=class extends pt{constructor(e){super(e,Fr)}};function Rr({router:e,children:t,...n}){l(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,Y.jsx)(vn.Provider,{value:e,children:t});return e.options.Wrap?(0,Y.jsx)(e.options.Wrap,{children:r}):r}function zr({router:e,...t}){return(0,Y.jsx)(Rr,{router:e,...t,children:(0,Y.jsx)(Nr,{})})}export{_r as a,Yn as c,vr as i,X as l,Ir as n,mr as o,Ar as r,fr as s,zr as t,j as u};