vue-router
Version:
> To see what versions are currently supported, please refer to the [Security Policy](./packages/router/SECURITY.md).
19 lines (17 loc) • 43.8 kB
JavaScript
/*!
* vue-router v5.1.0
* (c) 2026 Eduardo San Martin Morote
* @license MIT
*/
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`vue`),t=require(`@vue/devtools-api`);const n=typeof document<`u`;function r(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function i(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&r(e.default)}const a=Object.assign;function o(e,t){let n={};for(let r in t){let i=t[r];n[r]=c(i)?i.map(e):e(i)}return n}const s=()=>{},c=Array.isArray;function l(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}function u(e){let t=Array.from(arguments).slice(1);console.warn.apply(console,[`[Vue Router warn]: `+e].concat(t))}const d=/#/g,f=/&/g,p=/\//g,m=/=/g,h=/\?/g,g=/\+/g,_=/%5B/g,v=/%5D/g,y=/%5E/g,ee=/%60/g,te=/%7B/g,ne=/%7C/g,re=/%7D/g,b=/%20/g;function x(e){return e==null?``:encodeURI(``+e).replace(ne,`|`).replace(_,`[`).replace(v,`]`)}function ie(e){return x(e).replace(te,`{`).replace(re,`}`).replace(y,`^`)}function S(e){return x(e).replace(g,`%2B`).replace(b,`+`).replace(d,`%23`).replace(f,`%26`).replace(ee,"`").replace(te,`{`).replace(re,`}`).replace(y,`^`)}function C(e){return S(e).replace(m,`%3D`)}function ae(e){return x(e).replace(d,`%23`).replace(h,`%3F`)}function oe(e){return ae(e).replace(p,`%2F`)}function w(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{process.env.NODE_ENV!==`production`&&u(`Error decoding "${e}". Using original value`)}return``+e}const se=/\/$/,T=e=>e.replace(se,``);function ce(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=A(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:w(o)}}function le(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function ue(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function de(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&E(t.matched[r],n.matched[i])&&D(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function E(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function D(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!O(e[n],t[n]))return!1;return!0}function O(e,t){return c(e)?k(e,t):c(t)?k(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function k(e,t){return c(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function A(e,t){if(e.startsWith(`/`))return e;if(process.env.NODE_ENV!==`production`&&!t.startsWith(`/`))return u(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`),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(`/`)}const j={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function fe(e){if(!e)if(n){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),T(e)}const M=/^[^#]+#/;function N(e,t){return e.replace(M,`#`)+t}function P(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)}}const F=()=>({left:window.scrollX,top:window.scrollY});function pe(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`);if(process.env.NODE_ENV!==`production`&&typeof e.el==`string`&&(!r||!document.getElementById(e.el.slice(1))))try{let t=document.querySelector(e.el);if(r&&t){u(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);return}}catch{u(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);return}let i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i){process.env.NODE_ENV!==`production`&&u(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);return}t=P(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 me(e,t){return(history.state?history.state.position-t:-1)+e}const I=new Map;function he(e,t){I.set(e,t)}function ge(e){let t=I.get(e);return I.delete(e),t}let _e=()=>location.protocol+`//`+location.host;function L(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),ue(n,``)}return ue(n,e)+r+i}function ve(e,t,n,r){let i=[],o=[],s=null,c=({state:a})=>{let o=L(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=o,t.value=a,s&&s===c){s=null;return}u=l?a.position-l.position:0}else r(o);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function l(){s=n.value}function u(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return o.push(t),t}function d(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(a({},e.state,{scroll:F()}),``)}}function f(){for(let e of o)e();o=[],window.removeEventListener(`popstate`,c),window.removeEventListener(`pagehide`,d),document.removeEventListener(`visibilitychange`,d)}return window.addEventListener(`popstate`,c),window.addEventListener(`pagehide`,d),document.addEventListener(`visibilitychange`,d),{pauseListeners:l,listen:u,destroy:f}}function R(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?F():null}}function z(e){let{history:t,location:n}=window,r={value:L(e,n)},i={value:t.state};i.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:_e()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){process.env.NODE_ENV===`production`?console.error(e):u(`Error with push/replace State`,e),n[o?`replace`:`assign`](c)}}function s(e,n){o(e,a({},t.state,R(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function c(e,n){let s=a({},i.value,t.state,{forward:e,scroll:F()});process.env.NODE_ENV!==`production`&&!t.state&&u(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
history.replaceState(history.state, '', url)
You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`),o(s.current,s,!0),o(e,a({},R(r.value,e,null),{position:s.position+1},n),!1),r.value=e}return{location:r,state:i,push:c,replace:s}}function B(e){e=fe(e);let t=z(e),n=ve(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=a({location:``,base:e,go:r,createHref:N.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}function V(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),process.env.NODE_ENV!==`production`&&!e.endsWith(`#/`)&&!e.endsWith(`#`)&&u(`A hash base must end with a "#":\n"${e}" should be "${e.replace(/#.*$/,`#`)}".`),B(e)}function H(e=``){let t=[],n=[[``,{}]],r=0;e=fe(e);function i(e,t={}){r++,r!==n.length&&n.splice(r),n.push([e,t])}function a(e,n,{direction:r,delta:i}){let a={direction:r,delta:i,type:`pop`};for(let r of t)r(e,n,a)}let o={location:``,state:{},base:e,createHref:N.bind(null,e),replace(e,t){n.splice(r--,1),i(e,t)},push(e,t){i(e,t)},listen(e){return t.push(e),()=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)}},destroy(){t=[],n=[[``,{}]],r=0},go(e,t=!0){let i=this.location,o=e<0?`back`:`forward`;r=Math.max(0,Math.min(r+e,n.length-1)),t&&a(this.location,i,{direction:o,delta:e})}};return Object.defineProperty(o,`location`,{enumerable:!0,get:()=>n[r][0]}),Object.defineProperty(o,`state`,{enumerable:!0,get:()=>n[r][1]}),o}function U(e){return typeof e==`string`||e&&typeof e==`object`}function ye(e){return typeof e==`string`||typeof e==`symbol`}const be=Symbol(process.env.NODE_ENV===`production`?``:`navigation failure`);let xe=function(e){return e[e.aborted=4]=`aborted`,e[e.cancelled=8]=`cancelled`,e[e.duplicated=16]=`duplicated`,e}({});const Se={1({location:e,currentLocation:t}){return`No match for\n ${JSON.stringify(e)}${t?`
while being at
`+JSON.stringify(t):``}`},2({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${we(t)}" via a navigation guard.`},4({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},8({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},16({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function W(e,t){if(process.env.NODE_ENV!==`production`||!0)return a(Error(Se[e](t)),{type:e,[be]:!0},t)}function G(e,t){return e instanceof Error&&be in e&&(t==null||!!(e.type&t))}const Ce=[`params`,`query`,`hash`];function we(e){if(typeof e==`string`)return e;if(e.path!=null)return e.path;let t={};for(let n of Ce)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const Te={type:0,value:``},Ee=/[a-zA-Z0-9_]/;function De(e){if(!e)return[[]];if(e===`/`)return[[Te]];if(!e.startsWith(`/`))throw Error(process.env.NODE_ENV===`production`?`Invalid path "${e}"`:`Route paths should start with a "/": "${e}" should be "/${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:Ee.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}const Oe=`[^/]+?`,ke={sensitive:!1,strict:!1,start:!0,end:!0},Ae=/[.+*?^${}()[\]/\\]/g;function je(e,t){let n=a({},ke,t),r=[],i=n.start?`^`:``,o=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let a=t[r],s=40+(n.sensitive?.25:0);if(a.type===0)r||(i+=`/`),i+=a.value.replace(Ae,`\\$&`),s+=40;else if(a.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=a;o.push({name:e,repeatable:n,optional:c});let u=l||Oe;if(u!==Oe){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 s=new RegExp(i,n.sensitive?``:`i`);function l(e){let t=e.match(s),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=o[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function u(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,l=a in t?t[a]:``;if(c(l)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let u=c(l)?l.join(`/`):l;if(!u)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=u}}return n||`/`}return{re:s,score:r,keys:o,parse:l,stringify:u}}function Me(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 Ne(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Me(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Pe(r))return 1;if(Pe(i))return-1}return i.length-r.length}function Pe(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Fe={strict:!1,end:!0,sensitive:!1};function Ie(e,t,n){let r=je(De(e.path),n);if(process.env.NODE_ENV!==`production`){let t=new Set;for(let n of r.keys)t.has(n.name)&&u(`Found duplicated params with name "${n.name}" for path "${e.path}". Only the last one will be available on "$route.params".`),t.add(n.name)}let i=a(r,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function Le(e,t){let n=[],r=new Map;t=l(Fe,t);function i(e){return r.get(e)}function o(e,n,r){let i=!r,u=ze(e);process.env.NODE_ENV!==`production`&&Ge(u,n),u.aliasOf=r&&r.record;let d=l(t,e),p=[u];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)p.push(ze(a({},u,{components:r?r.record.components:u.components,path:e,aliasOf:r?r.record:u})))}let m,h;for(let t of p){let{path:a}=t;if(n&&a[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(a&&r+a)}if(process.env.NODE_ENV!==`production`&&t.path===`*`)throw Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);if(m=Ie(t,n,d),process.env.NODE_ENV!==`production`&&n&&a[0]===`/`&&qe(m,n),r?(r.alias.push(m),process.env.NODE_ENV!==`production`&&We(r,m)):(h||=m,h!==m&&h.alias.push(m),i&&e.name&&!Ve(m)&&(process.env.NODE_ENV!==`production`&&Ke(e,n),c(e.name))),Xe(m)&&f(m),u.children){let e=u.children;for(let t=0;t<e.length;t++)o(e[t],m,r&&r.children[t])}r||=m}return h?()=>{c(h)}:s}function c(e){if(ye(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(c),t.alias.forEach(c))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(c),e.alias.forEach(c))}}function d(){return n}function f(e){let t=Je(e,n);n.splice(t,0,e),e.record.name&&!Ve(e)&&r.set(e.record.name,e)}function p(e,t){let i,o={},s,c;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw W(1,{location:e});if(process.env.NODE_ENV!==`production`){let n=Object.keys(e.params||{}).filter(e=>!i.keys.find(t=>t.name===e));if(n.length){let e=!i.keys.length&&n.some(e=>e in t.params);u(`Discarded invalid param(s) "${n.join(`", "`)}" when navigating.`+(e?" If you are using a catch-all route with a named redirect, pass an empty `params` object: `redirect: { name: '...', params: {} }`.":``)+` See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}}c=i.record.name,o=a(Re(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Re(e.params,i.keys.map(e=>e.name))),s=i.stringify(o)}else if(e.path!=null)s=e.path,process.env.NODE_ENV!==`production`&&!s.startsWith(`/`)&&u(`The Matcher cannot resolve relative paths but received "${s}". Unless you directly called \`matcher.resolve("${s}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`),i=n.find(e=>e.re.test(s)),i&&(o=i.parse(s),c=i.record.name,i.keys.forEach(e=>{e.optional&&!o[e.name]&&delete o[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw W(1,{location:e,currentLocation:t});c=i.record.name,o=a({},t.params,e.params),s=i.stringify(o)}let l=[],d=i;for(;d;)l.unshift(d.record),d=d.parent;return{name:c,path:s,params:o,matched:l,meta:He(l)}}e.forEach(e=>o(e));function m(){n.length=0,r.clear()}return{addRoute:o,resolve:p,removeRoute:c,clearRoutes:m,getRoutes:d,getRecordMatcher:i}}function Re(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function ze(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Be(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 Be(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 Ve(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function He(e){return e.reduce((e,t)=>a(e,t.meta),{})}function Ue(e,t){return e.name===t.name&&e.optional===t.optional&&e.repeatable===t.repeatable}function We(e,t){for(let n of e.keys)if(!n.optional&&!t.keys.find(Ue.bind(null,n)))return u(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);for(let n of t.keys)if(!n.optional&&!e.keys.find(Ue.bind(null,n)))return u(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`)}function Ge(e,t){t&&t.record.name&&!e.name&&!e.path&&e.children.length===0&&u(`The route named "${String(t.record.name)}" has a child without a name, an empty path, and no children. This is probably a mistake: using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to silence the warning.`)}function Ke(e,t){for(let n=t;n;n=n.parent)if(n.record.name===e.name)throw Error(`A route named "${String(e.name)}" has been added as a ${t===n?`child`:`descendant`} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`)}function qe(e,t){for(let n of t.keys)if(!e.keys.find(Ue.bind(null,n)))return u(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`)}function Je(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;Ne(e,t[i])<0?r=i:n=i+1}let i=Ye(e);return i&&(r=t.lastIndexOf(i,r-1),process.env.NODE_ENV!==`production`&&r<0&&u(`Finding ancestor route "${i.record.path}" failed for "${e.record.path}"`)),r}function Ye(e){let t=e;for(;t=t.parent;)if(Xe(t)&&Ne(e,t)===0)return t}function Xe({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ze(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(g,` `),i=r.indexOf(`=`),a=w(i<0?r:r.slice(0,i)),o=i<0?null:w(r.slice(i+1));if(a in t){let e=t[a];c(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function Qe(e){let t=``;for(let n in e){let r=e[n];if(n=C(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(c(r)?r.map(e=>e&&S(e)):[r&&S(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function $e(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=c(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}const K=Symbol(process.env.NODE_ENV===`production`?``:`router view location matched`),et=Symbol(process.env.NODE_ENV===`production`?``:`router view depth`),q=Symbol(process.env.NODE_ENV===`production`?``:`router`),J=Symbol(process.env.NODE_ENV===`production`?``:`route location`),Y=Symbol(process.env.NODE_ENV===`production`?``:`router view location`);function X(){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 tt(t,n,r){let i=t.value;if(!i){process.env.NODE_ENV!==`production`&&u(`No active route record was found when calling \`${n===`updateGuards`?`onBeforeRouteUpdate`:`onBeforeRouteLeave`}()\`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?`);return}let a=i,o=()=>{a[n].delete(r)};(0,e.onUnmounted)(o),(0,e.onDeactivated)(o),(0,e.onActivated)(()=>{let e=t.value;process.env.NODE_ENV!==`production`&&!e&&u(`No active route record was found when reactivating component with navigation guard. This is likely a bug in vue-router. Please report it.`),e&&(a=e),a[n].add(r)}),a[n].add(r)}function nt(t){if(process.env.NODE_ENV!==`production`&&!(0,e.getCurrentInstance)()){u(`getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function`);return}tt((0,e.inject)(K,{}),`leaveGuards`,t)}function rt(t){if(process.env.NODE_ENV!==`production`&&!(0,e.getCurrentInstance)()){u(`getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function`);return}tt((0,e.inject)(K,{}),`updateGuards`,t)}function Z(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(W(4,{from:n,to:t})):e instanceof Error?c(e):U(e)?c(W(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},d=a(()=>e.call(r&&r.instances[i],t,n,process.env.NODE_ENV===`production`?l:it(at(l,t,n)))),f=Promise.resolve(d);if(e.length<3&&(f=f.then(l)),process.env.NODE_ENV!==`production`&&e.length>2){let t=`The "next" callback was never called inside of ${e.name?`"`+e.name+`"`:``}:\n${e.toString()}\n. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof d==`object`&&`then`in d)f=f.then(e=>l._called?e:(u(t),Promise.reject(Error(`Invalid navigation guard`))));else if(d!==void 0&&!l._called){u(t),c(Error(`Invalid navigation guard`));return}}f.catch(e=>c(e))})}function it(e){let t=!1;return function(){return t||(t=!0,u("The `next()` callback in navigation guards is deprecated. Return the value instead of calling `next(value)`.")),e.apply(this,arguments)}}function at(e,t,n){let r=0;return function(){r++===1&&u(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),e._called=!0,r===1&&e.apply(null,arguments)}}function ot(e,t,n,a,o=e=>e()){let s=[];for(let c of e){process.env.NODE_ENV!==`production`&&!c.components&&c.children&&!c.children.length&&u(`Record with path "${c.path}" is either missing a "component(s)" or "children" property.`);for(let e in c.components){let l=c.components[e];if(process.env.NODE_ENV!==`production`){if(!l||typeof l!=`object`&&typeof l!=`function`)throw u(`Component "${e}" in record with path "${c.path}" is not a valid component. Received "${String(l)}".`),Error(`Invalid route component`);if(`then`in l){u(`Component "${e}" in record with path "${c.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);let t=l;l=()=>t}else l.__asyncLoader&&!l.__warnedDefineAsync&&(l.__warnedDefineAsync=!0,u(`Component "${e}" in record with path "${c.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(t!==`beforeRouteEnter`&&!c.instances[e]))if(r(l)){let r=(l.__vccOpts||l)[t];r&&s.push(Z(r,n,a,c,e,o))}else{let r=l();process.env.NODE_ENV!==`production`&&!(`catch`in r)&&(u(`Component "${e}" in record with path "${c.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),r=Promise.resolve(r)),s.push(()=>r.then(r=>{if(!r)throw Error(`Couldn't resolve component "${e}" at "${c.path}"`);let s=i(r)?r.default:r;c.mods[e]=r,c.components[e]=s;let l=(s.__vccOpts||s)[t];return l&&Z(l,n,a,c,e,o)()}))}}}return s}function st(e){return e.matched.every(e=>e.redirect)?Promise.reject(Error(`Cannot load a route that redirects.`)):Promise.all(e.matched.map(e=>e.components&&Promise.all(Object.keys(e.components).reduce((t,n)=>{let r=e.components[n];return typeof r==`function`&&!(`displayName`in r)&&t.push(r().then(t=>{if(!t)return Promise.reject(Error(`Couldn't resolve component "${n}" at "${e.path}". Ensure you passed a function that returns a promise.`));let r=i(t)?t.default:t;e.mods[n]=t,e.components[n]=r})),t},[])))).then(()=>e)}function ct(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=>E(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>E(e,s))||i.push(s))}return[n,r,i]}function lt(t){let r=(0,e.inject)(q),i=(0,e.inject)(J),a=!1,o=null,c=(0,e.computed)(()=>{let n=(0,e.unref)(t.to);return process.env.NODE_ENV!==`production`&&(!a||n!==o)&&(U(n)||(a?u(`Invalid value for prop "to" in useLink()
- to:`,n,`
- previous to:`,o,`
- props:`,t):u(`Invalid value for prop "to" in useLink()
- to:`,n,`
- props:`,t)),o=n,a=!0),r.resolve(n)}),l=(0,e.computed)(()=>{let{matched:e}=c.value,{length:t}=e,n=e[t-1],r=i.matched;if(!n||!r.length)return-1;let a=r.findIndex(E.bind(null,n));if(a>-1)return a;let o=mt(e[t-2]);return t>1&&mt(n)===o&&r[r.length-1].path!==o?r.findIndex(E.bind(null,e[t-2])):a}),d=(0,e.computed)(()=>l.value>-1&&pt(i.params,c.value.params)),f=(0,e.computed)(()=>l.value>-1&&l.value===i.matched.length-1&&D(i.params,c.value.params));function p(n={}){if(ft(n)){let n=r[(0,e.unref)(t.replace)?`replace`:`push`]((0,e.unref)(t.to)).catch(s);return t.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}if(process.env.NODE_ENV!==`production`&&n){let n=(0,e.getCurrentInstance)();if(n){let r={route:c.value,isActive:d.value,isExactActive:f.value,error:null};n.__vrl_devtools=n.__vrl_devtools||[],n.__vrl_devtools.push(r),(0,e.watchEffect)(()=>{r.route=c.value,r.isActive=d.value,r.isExactActive=f.value,r.error=U((0,e.unref)(t.to))?null:`Invalid "to" value`},{flush:`post`})}}return{route:c,href:(0,e.computed)(()=>c.value.href),isActive:d,isExactActive:f,navigate:p}}function ut(e){return e.length===1?e[0]:e}const dt=(0,e.defineComponent)({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:lt,setup(t,{slots:n}){let r=(0,e.reactive)(lt(t)),{options:i}=(0,e.inject)(q),a=(0,e.computed)(()=>({[ht(t.activeClass,i.linkActiveClass,`router-link-active`)]:r.isActive,[ht(t.exactActiveClass,i.linkExactActiveClass,`router-link-exact-active`)]:r.isExactActive}));return()=>{let i=n.default&&ut(n.default(r));return t.custom?i:(0,e.h)(`a`,{"aria-current":r.isExactActive?t.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},i)}}});function ft(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 pt(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(!c(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function mt(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}const ht=(e,t,n)=>e??t??n,gt=(0,e.defineComponent)({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(t,{attrs:r,slots:i}){process.env.NODE_ENV!==`production`&&yt();let o=(0,e.inject)(Y),s=(0,e.computed)(()=>t.route||o.value),l=(0,e.inject)(et,0),u=(0,e.computed)(()=>{let t=(0,e.unref)(l),{matched:n}=s.value,r;for(;(r=n[t])&&!r.components;)t++;return t}),d=(0,e.computed)(()=>s.value.matched[u.value]);(0,e.provide)(et,(0,e.computed)(()=>u.value+1)),(0,e.provide)(K,d),(0,e.provide)(Y,s);let f=(0,e.ref)();return(0,e.watch)(()=>[f.value,d.value,t.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||!E(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let o=s.value,l=t.name,p=d.value,m=p&&p.components[l];if(!m)return _t(i.default,{Component:m,route:o});let h=p.props[l],g=h?h===!0?o.params:typeof h==`function`?h(o):h:null,_=(0,e.h)(m,a({},g,r,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(p.instances[l]=null)},ref:f}));if(process.env.NODE_ENV!==`production`&&n&&_.ref){let e={depth:u.value,name:p.name,path:p.path,meta:p.meta};(c(_.ref)?_.ref.map(e=>e.i):[_.ref.i]).forEach(t=>{t.__vrv_devtools=e})}return _t(i.default,{Component:_,route:o})||_}}});function _t(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}const vt=gt;function yt(){let t=(0,e.getCurrentInstance)(),n=t.parent&&t.parent.type.name,r=t.parent&&t.parent.subTree&&t.parent.subTree.type;if(n&&(n===`KeepAlive`||n.includes(`Transition`))&&typeof r==`object`&&r.name===`RouterView`){let e=n===`KeepAlive`?`keep-alive`:`transition`;u(`<router-view> can no longer be used directly inside <${e}>.\nUse slot props instead:\n\n<router-view v-slot="{ Component }">\n <${e}>\n <component :is="Component" />\n </${e}>\n</router-view>`)}}function Q(e,t){let n=a({},e,{matched:e.matched.map(e=>It(e,[`instances`,`children`,`aliasOf`]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function $(e){return{_custom:{display:e}}}let bt=0;function xt(n,r,i){if(r.__hasDevtools)return;r.__hasDevtools=!0;let a=bt++;(0,t.setupDevtoolsPlugin)({id:`org.vuejs.router`+(a?`.`+a:``),label:`Vue Router`,packageName:`vue-router`,homepage:`https://router.vuejs.org`,logo:`https://router.vuejs.org/logo.png`,componentStateTypes:[`Routing`],app:n},t=>{t.on.inspectComponent(e=>{e.instanceData&&e.instanceData.state.push({type:`Routing`,key:`$route`,editable:!1,value:Q(r.currentRoute.value,`Current Route`)})}),t.on.visitComponentTree(({treeNode:e,componentInstance:n})=>{if(n.__vrv_devtools){let t=n.__vrv_devtools;e.tags.push({label:(t.name?`${t.name.toString()}: `:``)+t.path,textColor:0,tooltip:`This component is rendered by <router-view>`,backgroundColor:wt})}c(n.__vrl_devtools)&&(n.__devtoolsApi=t,n.__vrl_devtools.forEach(t=>{let n=t.route.path,r=Dt,i=``,a=0;t.error?(n=t.error,r=Ot,a=kt):t.isExactActive?(r=Et,i=`This is exactly active`):t.isActive&&(r=Tt,i=`This link is active`),e.tags.push({label:n,textColor:a,tooltip:i,backgroundColor:r})}))}),(0,e.watch)(r.currentRoute,()=>{u(),t.notifyComponentUpdate(),t.sendInspectorTree(l),t.sendInspectorState(l)});let o=`router:navigations:`+a;t.addTimelineLayer({id:o,label:`Router${a?` `+a:``} Navigations`,color:4237508}),r.onError((e,n)=>{t.addTimelineEvent({layerId:o,event:{title:`Error during Navigation`,subtitle:n.fullPath,logType:`error`,time:t.now(),data:{error:e},groupId:n.meta.__navigationId}})});let s=0;r.beforeEach((e,n)=>{let r={guard:$(`beforeEach`),from:Q(n,`Current Location during this navigation`),to:Q(e,`Target location`)};Object.defineProperty(e.meta,`__navigationId`,{value:s++}),t.addTimelineEvent({layerId:o,event:{time:t.now(),title:`Start of navigation`,subtitle:e.fullPath,data:r,groupId:e.meta.__navigationId}})}),r.afterEach((e,n,r)=>{let i={guard:$(`afterEach`)};r?(i.failure={_custom:{type:Error,readOnly:!0,display:r?r.message:``,tooltip:`Navigation Failure`,value:r}},i.status=$(`❌`)):i.status=$(`✅`),i.from=Q(n,`Current Location during this navigation`),i.to=Q(e,`Target location`),t.addTimelineEvent({layerId:o,event:{title:`End of navigation`,subtitle:e.fullPath,time:t.now(),data:i,logType:r?`warning`:`default`,groupId:e.meta.__navigationId}})});let l=`router-inspector:`+a;t.addInspector({id:l,label:`Routes`+(a?` `+a:``),icon:`book`,treeFilterPlaceholder:`Search routes`});function u(){if(!d)return;let e=d,t=i.getRoutes().filter(e=>!e.parent||!e.parent.record.components);t.forEach(Pt),e.filter&&(t=t.filter(t=>Ft(t,e.filter.toLowerCase()))),t.forEach(e=>Nt(e,r.currentRoute.value)),e.rootNodes=t.map(At)}let d;t.on.getInspectorTree(e=>{d=e,e.app===n&&e.inspectorId===l&&u()}),t.on.getInspectorState(e=>{if(e.app===n&&e.inspectorId===l){let t=i.getRoutes().find(t=>t.record.__vd_id===e.nodeId);t&&(e.state={options:Ct(t)})}}),t.sendInspectorTree(l),t.sendInspectorState(l)})}function St(e){return e.optional?e.repeatable?`*`:`?`:e.repeatable?`+`:``}function Ct(e){let{record:t}=e,n=[{editable:!1,key:`path`,value:t.path}];return t.name!=null&&n.push({editable:!1,key:`name`,value:t.name}),n.push({editable:!1,key:`regexp`,value:e.re}),e.keys.length&&n.push({editable:!1,key:`keys`,value:{_custom:{type:null,readOnly:!0,display:e.keys.map(e=>`${e.name}${St(e)}`).join(` `),tooltip:`Param keys`,value:e.keys}}}),t.redirect!=null&&n.push({editable:!1,key:`redirect`,value:t.redirect}),e.alias.length&&n.push({editable:!1,key:`aliases`,value:e.alias.map(e=>e.record.path)}),Object.keys(e.record.meta).length&&n.push({editable:!1,key:`meta`,value:e.record.meta}),n.push({key:`score`,editable:!1,value:{_custom:{type:null,readOnly:!0,display:e.score.map(e=>e.join(`, `)).join(` | `),tooltip:`Score used to sort routes`,value:e.score}}}),n}const wt=15485081,Tt=2450411,Et=8702998,Dt=16486972,Ot=16704226,kt=12131356;function At(e){let t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:2282478}),n.aliasOf&&t.push({label:`alias`,textColor:0,backgroundColor:Dt}),e.__vd_match&&t.push({label:`matches`,textColor:0,backgroundColor:wt}),e.__vd_exactActive&&t.push({label:`exact`,textColor:0,backgroundColor:Et}),e.__vd_active&&t.push({label:`active`,textColor:0,backgroundColor:Tt}),n.redirect&&t.push({label:typeof n.redirect==`string`?`redirect: ${n.redirect}`:`redirects`,textColor:16777215,backgroundColor:6710886});let r=n.__vd_id;return r??(r=String(jt++),n.__vd_id=r),{id:r,label:n.path,tags:t,children:e.children.map(At)}}let jt=0;const Mt=/^\/(.*)\/([a-z]*)$/;function Nt(e,t){let n=t.matched.length&&E(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(t=>E(t,e.record))),e.children.forEach(e=>Nt(e,t))}function Pt(e){e.__vd_match=!1,e.children.forEach(Pt)}function Ft(e,t){let n=String(e.re).match(Mt);if(e.__vd_match=!1,!n||n.length<3)return!1;if(new RegExp(n[1].replace(/\$$/,``),n[2]).test(t))return e.children.forEach(e=>Ft(e,t)),e.record.path!==`/`||t===`/`?(e.__vd_match=e.re.test(t),!0):!1;let r=e.record.path.toLowerCase(),i=w(r);return!t.startsWith(`/`)&&(i.includes(t)||r.includes(t))||i.startsWith(t)||r.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(e=>Ft(e,t))}function It(e,t){let n={};for(let r in e)t.includes(r)||(n[r]=e[r]);return n}function Lt(t){let r=Le(t.routes,t),i=t.parseQuery||Ze,l=t.stringifyQuery||Qe,d=t.history;if(process.env.NODE_ENV!==`production`&&!d)throw Error(`Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history`);let f=X(),p=X(),m=X(),h=(0,e.shallowRef)(j),g=j;n&&t.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let _=o.bind(null,e=>``+e),v=o.bind(null,oe),y=o.bind(null,w);function ee(e,t){let n,i;return ye(e)?(n=r.getRecordMatcher(e),process.env.NODE_ENV!==`production`&&!n&&u(`Parent route "${String(e)}" not found when adding child route`,t),i=t):i=e,r.addRoute(i,n)}function te(e){let t=r.getRecordMatcher(e);t?r.removeRoute(t):process.env.NODE_ENV!==`production`&&u(`Cannot remove non-existent route "${String(e)}"`)}function ne(){return r.getRoutes().map(e=>e.record)}function re(e){return!!r.getRecordMatcher(e)}function b(e,t){if(t=a({},t||h.value),typeof e==`string`){let n=ce(i,e,t.path),o=r.resolve({path:n.path},t),s=d.createHref(n.fullPath);return process.env.NODE_ENV!==`production`&&(s.startsWith(`//`)?u(`Location "${e}" resolved to "${s}". A resolved location cannot start with multiple slashes.`):o.matched.length||u(`No match found for location with path "${e}"`)),a(n,o,{params:y(o.params),redirectedFrom:void 0,href:s})}if(process.env.NODE_ENV!==`production`&&!U(e))return u(`router.resolve() was passed an invalid location. This will fail in production.
- Location:`,e),b({});let n;if(e.path!=null)process.env.NODE_ENV!==`production`&&`params`in e&&!(`name`in e)&&Object.keys(e.params).length&&u(`Path "${e.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),n=a({},e,{path:ce(i,e.path,t.path).path});else{let r=a({},e.params);for(let e in r)r[e]??delete r[e];n=a({},e,{params:v(r)}),t.params=v(t.params)}let o=r.resolve(n,t),s=e.hash||``;process.env.NODE_ENV!==`production`&&s&&!s.startsWith(`#`)&&u(`A \`hash\` should always start with the character "#". Replace "${s}" with "#${s}".`),o.params=_(y(o.params));let c=le(l,a({},e,{hash:ie(s),path:o.path})),f=d.createHref(c);return process.env.NODE_ENV!==`production`&&(f.startsWith(`//`)?u(`Location "${e}" resolved to "${f}". A resolved location cannot start with multiple slashes.`):o.matched.length||u(`No match found for location with path "${e.path==null?e:e.path}"`)),a({fullPath:c,hash:s,query:l===Qe?$e(e.query):e.query||{}},o,{redirectedFrom:void 0,href:f})}function x(e){return typeof e==`string`?ce(i,e,h.value.path):a({},e)}function S(e,t){if(g!==e)return W(8,{from:t,to:e})}function C(e){return T(e)}function ae(e){return C(a(x(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;if(typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=x(i):{path:i},i.params={}),process.env.NODE_ENV!==`production`&&i.path==null&&!(`name`in i))throw u(`Invalid redirect found:\n${JSON.stringify(i,null,2)}\n when navigating to "${e.fullPath}". A redirect must contain a name or path. This will break in production.`),Error(`Invalid redirect`);return a({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function T(e,t){let n=g=b(e),r=h.value,i=e.state,o=e.force,s=e.replace===!0,c=se(n,r);if(c)return T(a(x(c),{state:typeof c==`object`?a({},i,c.state):i,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&de(l,r,n)&&(f=W(16,{to:d,from:r}),ve(r,r,!0,!1)),(f?Promise.resolve(f):D(d,r)).catch(e=>G(e)?G(e,2)?e:L(e):I(e,d,r)).then(e=>{if(e){if(G(e,2))return process.env.NODE_ENV!==`production`&&de(l,b(e.to),d)&&t&&(t._count=t._count?t._count+1:1)>30?(u(`Detected a possibly infinite redirection in a navigation guard when going from "${r.fullPath}" to "${d.fullPath}". Aborting to avoid a Stack Overflow.\n Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(Error(`Infinite redirect in navigation guard`))):T(a({replace:s},x(e.to),{state:typeof e.to==`object`?a({},i,e.to.state):i,force:o}),t||d)}else e=k(d,r,!0,s,i);return O(d,r,e),e})}function ue(e,t){let n=S(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=B.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function D(e,t){let n,[r,i,a]=ct(e,t);n=ot(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(Z(r,e,t))});let o=ue.bind(null,e,t);return n.push(o),H(n).then(()=>{n=[];for(let r of f.list())n.push(Z(r,e,t));return n.push(o),H(n)}).then(()=>{n=ot(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(Z(r,e,t))});return n.push(o),H(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(c(r.beforeEnter))for(let i of r.beforeEnter)n.push(Z(i,e,t));else n.push(Z(r.beforeEnter,e,t));return n.push(o),H(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=ot(a,`beforeRouteEnter`,e,t,E),n.push(o),H(n))).then(()=>{n=[];for(let r of p.list())n.push(Z(r,e,t));return n.push(o),H(n)}).catch(e=>G(e,8)?e:Promise.reject(e))}function O(e,t,n){m.list().forEach(r=>E(()=>r(e,t,n)))}function k(e,t,r,i,o){let s=S(e,t);if(s)return s;let c=t===j,l=n?history.state:{};r&&(i||c?d.replace(e.fullPath,a({scroll:c&&l&&l.scroll},o)):d.push(e.fullPath,o)),h.value=e,ve(e,t,r,c),L()}let A;function fe(){A||=d.listen((e,t,r)=>{if(!V.listening)return;let i=b(e),o=se(i,V.currentRoute.value);if(o){T(a(o,{replace:!0,force:!0}),i).catch(s);return}g=i;let c=h.value;n&&he(me(c.fullPath,r.delta),F()),D(i,c).catch(e=>G(e,12)?e:G(e,2)?(T(a(x(e.to),{force:!0}),i).then(e=>{G(e,20)&&!r.delta&&r.type===`pop`&&d.go(-1,!1)}).catch(s),Promise.reject()):(r.delta&&d.go(-r.delta,!1),I(e,i,c))).then(e=>{e||=k(i,c,!1),e&&(r.delta&&!G(e,8)?d.go(-r.delta,!1):r.type===`pop`&&G(e,20)&&d.go(-1,!1)),O(i,c,e)}).catch(s)})}let M=X(),N=X(),P;function I(e,t,n){L(e);let r=N.list();return r.length?r.forEach(r=>r(e,t,n)):(process.env.NODE_ENV!==`production`&&u(`uncaught error during route navigation:`),console.error(e)),Promise.reject(e)}function _e(){return P&&h.value!==j?Promise.resolve():new Promise((e,t)=>{M.add([e,t])})}function L(e){return P||(P=!e,fe(),M.list().forEach(([t,n])=>e?n(e):t()),M.reset()),e}function ve(r,i,a,o){let{scrollBehavior:s}=t;if(!n||!s)return Promise.resolve();let c=!a&&ge(me(r.fullPath,0))||(o||!a)&&history.state&&history.state.scroll||null;return(0,e.nextTick)().then(()=>s(r,i,c)).then(e=>e&&pe(e)).catch(e=>I(e,r,i))}let R=e=>d.go(e),z,B=new Set,V={currentRoute:h,listening:!0,addRoute:ee,removeRoute:te,clearRoutes:r.clearRoutes,hasRoute:re,getRoutes:ne,resolve:b,options:t,push:C,replace:ae,go:R,back:()=>R(-1),forward:()=>R(1),beforeEach:f.add,beforeResolve:p.add,afterEach:m.add,onError:N.add,isReady:_e,install(t){t.component(`RouterLink`,dt),t.component(`RouterView`,vt),t.config.globalProperties.$router=V,Object.defineProperty(t.config.globalProperties,`$route`,{enumerable:!0,get:()=>(0,e.unref)(h)}),n&&!z&&h.value===j&&(z=!0,C(d.location).catch(e=>{process.env.NODE_ENV!==`production`&&u(`Unexpected error when starting the router:`,e)}));let i={};for(let e in j)Object.defineProperty(i,e,{get:()=>h.value[e],enumerable:!0});t.provide(q,V),t.provide(J,(0,e.shallowReactive)(i)),t.provide(Y,h);let a=t.unmount;B.add(t),t.unmount=function(){B.delete(t),B.size<1&&(g=j,A&&A(),A=null,h.value=j,z=!1,P=!1),a()},process.env.NODE_ENV!==`production`&&n&&xt(t,V,r)}};function H(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return V}function Rt(){return(0,e.inject)(q)}function zt(t){return(0,e.inject)(J)}exports.NavigationFailureType=xe,exports.RouterLink=dt,exports.RouterView=vt,exports.START_LOCATION=j,exports.createMemoryHistory=H,exports.createRouter=Lt,exports.createRouterMatcher=Le,exports.createWebHashHistory=V,exports.createWebHistory=B,exports.isNavigationFailure=G,exports.loadRouteLocation=st,exports.matchedRouteKey=K,exports.onBeforeRouteLeave=nt,exports.onBeforeRouteUpdate=rt,exports.parseQuery=Ze,exports.routeLocationKey=J,exports.routerKey=q,exports.routerViewLocationKey=Y,exports.stringifyQuery=Qe,exports.useLink=lt,exports.useRoute=zt,exports.useRouter=Rt,exports.viewDepthKey=et;