import{$ as e,A as t,D as n,I as r,M as i,Tt as a,U as o,_ as s,_t as c,gt as l,mt as u,yt as d}from"./vue.runtime.esm-bundler-DVLEBHCy.js";var f=typeof document<`u`;function p(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function m(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&p(e.default)}var h=Object.assign;function g(e,t){let n={};for(let r in t){let i=t[r];n[r]=v(i)?i.map(e):e(i)}return n}var _=()=>{},v=Array.isArray;function ee(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var y=Symbol(``);function b(e,t){return h(Error(),{type:e,[y]:!0},t)}function x(e,t){return e instanceof Error&&y in e&&(t==null||!!(e.type&t))}var S=Symbol(``),C=Symbol(``),w=Symbol(``),T=Symbol(``),te=Symbol(``);function ne(){return i(w)}function re(e){return i(T)}var ie=/#/g,E=/&/g,D=/\//g,ae=/=/g,O=/\?/g,oe=/\+/g,se=/%5B/g,k=/%5D/g,A=/%5E/g,j=/%60/g,M=/%7B/g,N=/%7C/g,P=/%7D/g,F=/%20/g;function I(e){return e==null?``:encodeURI(``+e).replace(N,`|`).replace(se,`[`).replace(k,`]`)}function ce(e){return I(e).replace(M,`{`).replace(P,`}`).replace(A,`^`)}function L(e){return I(e).replace(oe,`%2B`).replace(F,`+`).replace(ie,`%23`).replace(E,`%26`).replace(j,"`").replace(M,`{`).replace(P,`}`).replace(A,`^`)}function R(e){return L(e).replace(ae,`%3D`)}function z(e){return I(e).replace(ie,`%23`).replace(O,`%3F`)}function le(e){return z(e).replace(D,`%2F`)}function B(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var V=/\/$/,ue=e=>e.replace(V,``);function H(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=J(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:B(o)}}function de(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function U(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function fe(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&W(t.matched[r],n.matched[i])&&G(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function W(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function G(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!K(e[n],t[n]))return!1;return!0}function K(e,t){return v(e)?q(e,t):v(t)?q(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function q(e,t){return v(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function J(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var Y={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function X(e){if(!e)if(f){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),ue(e)}var pe=/^[^#]+#/;function me(e,t){return e.replace(pe,`#`)+t}function he(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var Z=()=>({left:window.scrollX,top:window.scrollY});function ge(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=he(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function _e(e,t){return(history.state?history.state.position-t:-1)+e}var ve=new Map;function ye(e,t){ve.set(e,t)}function be(e){let t=ve.get(e);return ve.delete(e),t}function xe(e){return typeof e==`string`||e&&typeof e==`object`}function Se(e){return typeof e==`string`||typeof e==`symbol`}function Ce(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(oe,` `),i=r.indexOf(`=`),a=B(i<0?r:r.slice(0,i)),o=i<0?null:B(r.slice(i+1));if(a in t){let e=t[a];v(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function we(e){let t=``;for(let n in e){let r=e[n];if(n=R(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(v(r)?r.map(e=>e&&L(e)):[r&&L(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function Te(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=v(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function Q(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(b(4,{from:n,to:t})):e instanceof Error?c(e):xe(e)?c(b(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Ee(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(p(s)){let c=(s.__vccOpts||s)[t];c&&a.push($(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=m(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&$(c,n,r,o,e,i)()}))}}return a}function De(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>W(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>W(e,s))||i.push(s))}return[n,r,i]}var Oe=()=>location.protocol+`//`+location.host;function ke(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),U(n,``)}return U(n,e)+r+i}function Ae(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=ke(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(h({},e.state,{scroll:Z()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function je(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?Z():null}}function Me(e){let{history:t,location:n}=window,r={value:ke(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Oe()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,h({},t.state,je(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=h({},i.value,t.state,{forward:e,scroll:Z()});a(o.current,o,!0),a(e,h({},je(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function Ne(e){e=X(e);let t=Me(e),n=Ae(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=h({location:``,base:e,go:r,createHref:me.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}var Pe={type:0,value:``},Fe=/[a-zA-Z0-9_]/;function Ie(e){if(!e)return[[]];if(e===`/`)return[[Pe]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:Fe.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case 2:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var Le=`[^/]+?`,Re={sensitive:!1,strict:!1,start:!0,end:!0},ze=/[.+*?^${}()[\]/\\]/g;function Be(e,t){let n=h({},Re,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(ze,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||Le;if(u!==Le){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(v(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=v(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function Ve(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function He(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Ve(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Ue(r))return 1;if(Ue(i))return-1}return i.length-r.length}function Ue(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var We={strict:!1,end:!0,sensitive:!1};function Ge(e,t,n){let r=h(Be(Ie(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ke(e,t){let n=[],r=new Map;t=ee(We,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Je(e);s.aliasOf=r&&r.record;let l=ee(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Je(h({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=Ge(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!Xe(d)&&o(e.name)),et(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:_}function o(e){if(Se(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Qe(e,n);n.splice(t,0,e),e.record.name&&!Xe(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw b(1,{location:e});s=i.record.name,a=h(qe(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&qe(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name,i.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw b(1,{location:e,currentLocation:t});s=i.record.name,a=h({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Ze(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function qe(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Je(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ye(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function Ye(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Xe(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ze(e){return e.reduce((e,t)=>h(e,t.meta),{})}function Qe(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;He(e,t[i])<0?r=i:n=i+1}let i=$e(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function $e(e){let t=e;for(;t=t.parent;)if(et(t)&&He(e,t)===0)return t}function et({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function tt(e){let t=i(w),n=i(T),r=s(()=>{let n=a(e.to);return t.resolve(n)}),o=s(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(W.bind(null,i));if(o>-1)return o;let s=ot(e[t-2]);return t>1&&ot(i)===s&&a[a.length-1].path!==s?a.findIndex(W.bind(null,e[t-2])):o}),c=s(()=>o.value>-1&&at(n.params,r.value.params)),l=s(()=>o.value>-1&&o.value===n.matched.length-1&&G(n.params,r.value.params));function u(n={}){if(it(n)){let n=t[a(e.replace)?`replace`:`push`](a(e.to)).catch(_);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:s(()=>r.value.href),isActive:c,isExactActive:l,navigate:u}}function nt(e){return e.length===1?e[0]:e}var rt=n({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:tt,setup(e,{slots:n}){let r=u(tt(e)),{options:a}=i(w),o=s(()=>({[st(e.activeClass,a.linkActiveClass,`router-link-active`)]:r.isActive,[st(e.exactActiveClass,a.linkExactActiveClass,`router-link-exact-active`)]:r.isExactActive}));return()=>{let i=n.default&&nt(n.default(r));return e.custom?i:t(`a`,{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:o.value},i)}}});function it(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function at(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!v(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function ot(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var st=(e,t,n)=>e??t??n,ct=n({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(n,{attrs:r,slots:c}){let u=i(te),d=s(()=>n.route||u.value),f=i(C,0),p=s(()=>{let e=a(f),{matched:t}=d.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),m=s(()=>d.value.matched[p.value]);o(C,s(()=>p.value+1)),o(S,m),o(te,d);let g=l();return e(()=>[g.value,m.value,n.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!W(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let e=d.value,i=n.name,a=m.value,o=a&&a.components[i];if(!o)return lt(c.default,{Component:o,route:e});let s=a.props[i],l=t(o,h({},s?s===!0?e.params:typeof s==`function`?s(e):s:null,r,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[i]=null)},ref:g}));return lt(c.default,{Component:l,route:e})||l}}});function lt(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var ut=ct;function dt(e){let t=Ke(e.routes,e),n=e.parseQuery||Ce,i=e.stringifyQuery||we,o=e.history,s=Q(),l=Q(),u=Q(),p=d(Y),m=Y;f&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let ee=g.bind(null,e=>``+e),y=g.bind(null,le),S=g.bind(null,B);function C(e,n){let r,i;return Se(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function ne(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function re(){return t.getRoutes().map(e=>e.record)}function ie(e){return!!t.getRecordMatcher(e)}function E(e,r){if(r=h({},r||p.value),typeof e==`string`){let i=H(n,e,r.path),a=t.resolve({path:i.path},r),s=o.createHref(i.fullPath);return h(i,a,{params:S(a.params),redirectedFrom:void 0,href:s})}let a;if(e.path!=null)a=h({},e,{path:H(n,e.path,r.path).path});else{let t=h({},e.params);for(let e in t)t[e]??delete t[e];a=h({},e,{params:y(t)}),r.params=y(r.params)}let s=t.resolve(a,r),c=e.hash||``;s.params=ee(S(s.params));let l=de(i,h({},e,{hash:ce(c),path:s.path})),u=o.createHref(l);return h({fullPath:l,hash:c,query:i===we?Te(e.query):e.query||{}},s,{redirectedFrom:void 0,href:u})}function D(e){return typeof e==`string`?H(n,e,p.value.path):h({},e)}function ae(e,t){if(m!==e)return b(8,{from:t,to:e})}function O(e){return k(e)}function oe(e){return O(h(D(e),{replace:!0}))}function se(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=D(i):{path:i},i.params={}),h({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function k(e,t){let n=m=E(e),r=p.value,a=e.state,o=e.force,s=e.replace===!0,c=se(n,r);if(c)return k(h(D(c),{state:typeof c==`object`?h({},a,c.state):a,force:o,replace:s}),t||n);let l=n;l.redirectedFrom=t;let u;return!o&&fe(i,r,n)&&(u=b(16,{to:l,from:r}),W(r,r,!0,!1)),(u?Promise.resolve(u):M(l,r)).catch(e=>x(e)?x(e,2)?e:U(e):V(e,l,r)).then(e=>{if(e){if(x(e,2))return k(h({replace:s},D(e.to),{state:typeof e.to==`object`?h({},a,e.to.state):a,force:o}),t||l)}else e=P(l,r,!0,s,a);return N(l,r,e),e})}function A(e,t){let n=ae(e,t);return n?Promise.reject(n):Promise.resolve()}function j(e){let t=q.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function M(e,t){let n,[r,i,a]=De(e,t);n=Ee(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push($(r,e,t))});let o=A.bind(null,e,t);return n.push(o),X(n).then(()=>{n=[];for(let r of s.list())n.push($(r,e,t));return n.push(o),X(n)}).then(()=>{n=Ee(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push($(r,e,t))});return n.push(o),X(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(v(r.beforeEnter))for(let i of r.beforeEnter)n.push($(i,e,t));else n.push($(r.beforeEnter,e,t));return n.push(o),X(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Ee(a,`beforeRouteEnter`,e,t,j),n.push(o),X(n))).then(()=>{n=[];for(let r of l.list())n.push($(r,e,t));return n.push(o),X(n)}).catch(e=>x(e,8)?e:Promise.reject(e))}function N(e,t,n){u.list().forEach(r=>j(()=>r(e,t,n)))}function P(e,t,n,r,i){let a=ae(e,t);if(a)return a;let s=t===Y,c=f?history.state:{};n&&(r||s?o.replace(e.fullPath,h({scroll:s&&c&&c.scroll},i)):o.push(e.fullPath,i)),p.value=e,W(e,t,n,s),U()}let F;function I(){F||=o.listen((e,t,n)=>{if(!J.listening)return;let r=E(e),i=se(r,J.currentRoute.value);if(i){k(h(i,{replace:!0,force:!0}),r).catch(_);return}m=r;let a=p.value;f&&ye(_e(a.fullPath,n.delta),Z()),M(r,a).catch(e=>x(e,12)?e:x(e,2)?(k(h(D(e.to),{force:!0}),r).then(e=>{x(e,20)&&!n.delta&&n.type===`pop`&&o.go(-1,!1)}).catch(_),Promise.reject()):(n.delta&&o.go(-n.delta,!1),V(e,r,a))).then(e=>{e||=P(r,a,!1),e&&(n.delta&&!x(e,8)?o.go(-n.delta,!1):n.type===`pop`&&x(e,20)&&o.go(-1,!1)),N(r,a,e)}).catch(_)})}let L=Q(),R=Q(),z;function V(e,t,n){U(e);let r=R.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function ue(){return z&&p.value!==Y?Promise.resolve():new Promise((e,t)=>{L.add([e,t])})}function U(e){return z||(z=!e,I(),L.list().forEach(([t,n])=>e?n(e):t()),L.reset()),e}function W(t,n,i,a){let{scrollBehavior:o}=e;if(!f||!o)return Promise.resolve();let s=!i&&be(_e(t.fullPath,0))||(a||!i)&&history.state&&history.state.scroll||null;return r().then(()=>o(t,n,s)).then(e=>e&&ge(e)).catch(e=>V(e,t,n))}let G=e=>o.go(e),K,q=new Set,J={currentRoute:p,listening:!0,addRoute:C,removeRoute:ne,clearRoutes:t.clearRoutes,hasRoute:ie,getRoutes:re,resolve:E,options:e,push:O,replace:oe,go:G,back:()=>G(-1),forward:()=>G(1),beforeEach:s.add,beforeResolve:l.add,afterEach:u.add,onError:R.add,isReady:ue,install(e){e.component(`RouterLink`,rt),e.component(`RouterView`,ut),e.config.globalProperties.$router=J,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>a(p)}),f&&!K&&p.value===Y&&(K=!0,O(o.location).catch(e=>{}));let t={};for(let e in Y)Object.defineProperty(t,e,{get:()=>p.value[e],enumerable:!0});e.provide(w,J),e.provide(T,c(t)),e.provide(te,p);let n=e.unmount;q.add(e),e.unmount=function(){q.delete(e),q.size<1&&(m=Y,F&&F(),F=null,p.value=Y,K=!1,z=!1),n()}}};function X(e){return e.reduce((e,t)=>e.then(()=>j(t)),Promise.resolve())}return J}export{ne as a,re as i,dt as n,Ne as r,rt as t};