import{s as e,l as t,u as n,a8 as r,i as o,K as a,f as s,P as c,Q as l,a as i,w as u,n as f}from"./@vue-COP35Tvs.js"; /*! * vue-router v4.5.0 * (c) 2024 Eduardo San Martin Morote * @license MIT */const p="undefined"!=typeof document;function h(e){return"object"==typeof e||"displayName"in e||"props"in e||"__vccOpts"in e}const d=Object.assign;function m(e,t){const n={};for(const r in t){const o=t[r];n[r]=v(o)?o.map(e):e(o)}return n}const g=()=>{},v=Array.isArray,y=/#/g,b=/&/g,w=/\//g,E=/=/g,R=/\?/g,k=/\+/g,O=/%5B/g,P=/%5D/g,x=/%5E/g,C=/%60/g,j=/%7B/g,$=/%7C/g,S=/%7D/g,A=/%20/g;function q(e){return encodeURI(""+e).replace($,"|").replace(O,"[").replace(P,"]")}function L(e){return q(e).replace(k,"%2B").replace(A,"+").replace(y,"%23").replace(b,"%26").replace(C,"`").replace(j,"{").replace(S,"}").replace(x,"^")}function M(e){return null==e?"":function(e){return q(e).replace(y,"%23").replace(R,"%3F")}(e).replace(w,"%2F")}function B(e){try{return decodeURIComponent(""+e)}catch(t){}return""+e}const G=/\/$/;function _(e,t,n="/"){let r,o={},a="",s="";const c=t.indexOf("#");let l=t.indexOf("?");return c=0&&(l=-1),l>-1&&(r=t.slice(0,l),a=t.slice(l+1,c>-1?c:t.length),o=e(a)),c>-1&&(r=r||t.slice(0,c),s=t.slice(c,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];".."!==o&&"."!==o||r.push("");let a,s,c=n.length-1;for(a=0;a1&&c--}return n.slice(0,c).join("/")+"/"+r.slice(a).join("/")}(null!=r?r:t,n),{fullPath:r+(a&&"?")+a+s,path:r,query:o,hash:B(s)}}function I(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function T(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function W(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!D(e[n],t[n]))return!1;return!0}function D(e,t){return v(e)?U(e,t):v(t)?U(t,e):e===t}function U(e,t){return v(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}const V={path:"/", // TODO: could we use a symbol in the future? name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var F,K,z,H;function Q(e){if(!e)if(p){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(G,"")}(K=F||(F={})).pop="pop",K.push="push",(H=z||(z={})).back="back",H.forward="forward",H.unknown="";const X=/^[^#]+#/;function Y(e,t){return e.replace(X,"#")+t}const N=()=>({left:window.scrollX,top:window.scrollY});function Z(e){let t;if("el"in e){const n=e.el,r="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=function(e,t){const 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)}}(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.scrollX,null!=t.top?t.top:window.scrollY)}function J(e,t){return(history.state?history.state.position-t:-1)+e}const ee=new Map;function te(e,t){const{pathname:n,search:r,hash:o}=t,a=e.indexOf("#");if(a>-1){let t=o.includes(e.slice(a))?e.slice(a).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),I(n,"")}return I(n,e)+r+o}function ne(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?N():null}}function re(e){const{history:t,location:n}=window,r={value:te(e,n)},o={value:t.state};function a(r,a,s){const c=e.indexOf("#"),l=c>-1?(n.host&&document.querySelector("base")?e:e.slice(c))+r:location.protocol+"//"+location.host+e+r;try{t[s?"replaceState":"pushState"](a,"",l),o.value=a}catch(i){n[s?"replace":"assign"](l)}}return o.value||a(r.value,{back:null,current:r.value,forward:null, // the length is off by one, we need to decrease it position:t.length-1,replaced:!0, // don't add a scroll as the user may have an anchor, and we want // scrollBehavior to be triggered without a saved position scroll:null},!0),{location:r,state:o,push:function(e,n){const s=d({}, // use current history state to gracefully handle a wrong call to // history.replaceState // https://github.com/vuejs/router/issues/366 o.value,t.state,{forward:e,scroll:N()});a(s.current,s,!0),a(e,d({},ne(r.value,e,null),{position:s.position+1},n),!1),r.value=e},replace:function(e,n){a(e,d({},t.state,ne(o.value.back, // keep back and forward entries but override current position e,o.value.forward,!0),n,{position:o.value.position}),!0),r.value=e}}}function oe(e){const t=re(e=Q(e)),n=function(e,t,n,r){let o=[],a=[],s=null;const c=({state:a})=>{const c=te(e,location),l=n.value,i=t.value;let u=0;if(a){if(n.value=c,t.value=a,s&&s===l)return void(s=null);u=i?a.position-i.position:0}else r(c);o.forEach((e=>{e(n.value,l,{delta:u,type:F.pop,direction:u?u>0?z.forward:z.back:z.unknown})}))};function l(){const{history:e}=window;e.state&&e.replaceState(d({},e.state,{scroll:N()}),"")}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",l,{passive:!0}),{pauseListeners:function(){s=n.value},listen:function(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return a.push(t),t},destroy:function(){for(const e of a)e();a=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",l)}}}(e,t.state,t.location,t.replace);const r=d({ // it's overridden right after location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:Y.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function ae(e){return(e=location.host?e||location.pathname+location.search:"").includes("#")||(e+="#"),oe(e)}function se(e){return"string"==typeof e||"symbol"==typeof e}const ce=Symbol("");var le,ie;function ue(e,t){return d(new Error,{type:e,[ce]:!0},t)}function fe(e,t){return e instanceof Error&&ce in e&&(null==t||!!(e.type&t))}(ie=le||(le={}))[ie.aborted=4]="aborted",ie[ie.cancelled=8]="cancelled",ie[ie.duplicated=16]="duplicated";const pe="[^/]+?",he={sensitive:!1,strict:!1,start:!0,end:!0},de=/[.+*?^${}()[\]/\\]/g;function me(e,t){let n=0;for(;nt.length?1===t.length&&80===t[0]?1:-1:0}function ge(e,t){let n=0;const r=e.score,o=t.score;for(;n0&&t[t.length-1]<0}const ye={type:0,value:""},be=/[a-zA-Z0-9_]/;function we(e,t,n){const r=function(e,t){const n=d({},he,t),r=[];let o=n.start?"^":"";const a=[];for(const l of e){const e=l.length?[]:[90 /* PathScore.Root */];n.strict&&!l.length&&(o+="/");for(let t=0;t1&&("*"===c||"+"===c)&&t(`A repeatable param (${i}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:i,regexp:u,repeatable:"*"===c||"+"===c,optional:"*"===c||"?"===c})):t("Invalid state to consume buffer"),i="")}function p(){i+=c}for(;l{a(p)}:g}function a(e){if(se(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(a),t.alias.forEach(a))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(a),e.alias.forEach(a))}}function s(e){const t=function(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;ge(e,t[o])<0?r=o:n=o+1}const o=function(e){let t=e;for(;t=t.parent;)if(je(t)&&0===ge(e,t))return t;return}(e);o&&(r=t.lastIndexOf(o,r-1));return r}(e,n);n.splice(t,0,e),e.record.name&&!Pe(e)&&r.set(e.record.name,e)}return t=Ce({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>o(e))),{addRoute:o,resolve:function(e,t){let o,a,s,c={};if("name"in e&&e.name){if(o=r.get(e.name),!o)throw ue(1,{location:e});s=o.record.name,c=d( // paramsFromLocation is a new object Re(t.params, // only keep params that exist in the resolved location // only keep optional params coming from a parent record o.keys.filter((e=>!e.optional)).concat(o.parent?o.parent.keys.filter((e=>e.optional)):[]).map((e=>e.name))), // discard any existing params in the current location that do not exist here // #1497 this ensures better active/exact matching e.params&&Re(e.params,o.keys.map((e=>e.name)))),a=o.stringify(c)}else if(null!=e.path)a=e.path,o=n.find((e=>e.re.test(a))),o&&(c=o.parse(a),s=o.record.name);else{if(o=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!o)throw ue(1,{location:e,currentLocation:t});s=o.record.name,c=d({},t.params,e.params),a=o.stringify(c)}const l=[];let i=o;for(;i;)l.unshift(i.record),i=i.parent;return{name:s,path:a,params:c,matched:l,meta:xe(l)}},removeRoute:a,clearRoutes:function(){n.length=0,r.clear()},getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function Re(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function ke(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Oe(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{}, // must be declared afterwards // mods: {}, components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Oe(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]="object"==typeof n?n[r]:n;return t}function Pe(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xe(e){return e.reduce(((e,t)=>d(e,t.meta)),{})}function Ce(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function je({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function $e(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let r=0;re&&L(e))):[r&&L(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function Ae(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=v(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}const qe=Symbol(""),Le=Symbol(""),Me=Symbol(""),Be=Symbol(""),Ge=Symbol("");function _e(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e.slice(),reset:function(){e=[]}}}function Ie(e,t,n,r,o,a=e=>e()){const s=r&&(// name is defined if record is because of the function overload r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((c,l)=>{const i=e=>{var a;!1===e?l(ue(4,{from:n,to:t})):e instanceof Error?l(e):"string"==typeof(a=e)||a&&"object"==typeof a?l(ue(2,{from:t,to:e})):(s&&// since enterCallbackArray is truthy, both record and name also are r.enterCallbacks[o]===s&&"function"==typeof e&&s.push(e),c())},u=a((()=>e.call(r&&r.instances[o],t,n,i)));let f=Promise.resolve(u);e.length<3&&(f=f.then(i)),f.catch((e=>l(e)))}))}function Te(e,t,n,r,o=e=>e()){const a=[];for(const s of e)for(const e in s.components){let c=s.components[e];if("beforeRouteEnter"===t||s.instances[e])if(h(c)){const l=(c.__vccOpts||c)[t];l&&a.push(Ie(l,n,r,s,e,o))}else{let l=c();a.push((()=>l.then((a=>{if(!a)throw new Error(`Couldn't resolve component "${e}" at "${s.path}"`);const c=(l=a).__esModule||"Module"===l[Symbol.toStringTag]||// support CF with dynamic imports that do not // add the Module string tag l.default&&h(l.default)?a.default:a;var l;s.mods[e]=a,s.components[e]=c;const i=(c.__vccOpts||c)[t];return i&&Ie(i,n,r,s,e,o)()}))))}}return a}function We(e){const t=o(Me),r=o(Be),a=s((()=>{const r=n(e.to);return t.resolve(r)})),c=s((()=>{const{matched:e}=a.value,{length:t}=e,n=e[t-1],o=r.matched;if(!n||!o.length)return-1;const s=o.findIndex(T.bind(null,n));if(s>-1)return s;const c=Ue(e[t-2]); // we are dealing with nested routes return t>1&&// if the parent and matched route have the same path, this link is // referring to the empty child. Or we currently are on a different // child of the same parent Ue(n)===c&&// avoid comparing the child with its parent o[o.length-1].path!==c?o.findIndex(T.bind(null,e[t-2])):s})),l=s((()=>c.value>-1&&function(e,t){for(const n in t){const r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!v(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(r.params,a.value.params))),i=s((()=>c.value>-1&&c.value===r.matched.length-1&&W(r.params,a.value.params)));return{route:a,href:s((()=>a.value.href)),isActive:l,isExactActive:i,navigate:function(r={}){if(function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0}(r)){const r=t[n(e.replace)?"replace":"push"](n(e.to)).catch(g);return e.viewTransition&&"undefined"!=typeof document&&"startViewTransition"in document&&document.startViewTransition((()=>r)),r}return Promise.resolve()}}}const De=t({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String, // inactiveClass: String, exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:We,setup(e,{slots:t}){const n=a(We(e)),{options:r}=o(Me),l=s((()=>({[Ve(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive, // [getLinkClass( // props.inactiveClass, // options.linkInactiveClass, // 'router-link-inactive' // )]: !link.isExactActive, [Ve(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive})));return()=>{const r=t.default&&(1===(o=t.default(n)).length?o[0]:o);var o;return e.custom?r:c("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href, // this would override user added attrs but Vue will still add // the listener, so we end up triggering both onClick:n.navigate,class:l.value},r)}}});function Ue(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ve=(e,t,n)=>null!=e?e:null!=t?t:n;function Fe(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Ke=t({name:"RouterView", // #674 we manually inherit them inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object}, // Better compat for @vue/compat users // https://github.com/vuejs/router/issues/1315 compatConfig:{MODE:3},setup(e,{attrs:t,slots:r}){const a=o(Ge),f=s((()=>e.route||a.value)),p=o(Le,0),h=s((()=>{let e=n(p);const{matched:t}=f.value;let r;for(;(r=t[e])&&!r.components;)e++;return e})),m=s((()=>f.value.matched[h.value]));l(Le,s((()=>h.value+1))),l(qe,m),l(Ge,f);const g=i();return u((()=>[g.value,m.value,e.name]),(([e,t,n],[r,o,a])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=o.leaveGuards),t.updateGuards.size||(t.updateGuards=o.updateGuards))),!e||!t||// if there is no instance but to and from are the same this might be // the first visit o&&T(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const n=f.value,o=e.name,a=m.value,s=a&&a.components[o];if(!s)return Fe(r.default,{Component:s,route:n});const l=a.props[o],i=l?!0===l?n.params:"function"==typeof l?l(n):l:null,u=c(s,d({},i,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[o]=null)},ref:g})); // pass the vnode to the slot as a prop. // h and both accept vnodes return Fe(r.default,{Component:u,route:n})||u}}});function ze(t){const o=Ee(t.routes,t),a=t.parseQuery||$e,s=t.stringifyQuery||Se,c=t.history,l=_e(),i=_e(),u=_e(),h=e(V);let y=V;p&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const b=m.bind(null,(e=>""+e)),w=m.bind(null,M),E= // @ts-expect-error: intentionally avoid the type check m.bind(null,B);function R(e,t){if(t=d({},t||h.value),"string"==typeof e){const n=_(a,e,t.path),r=o.resolve({path:n.path},t),s=c.createHref(n.fullPath);return d(n,r,{params:E(r.params),hash:B(n.hash),redirectedFrom:void 0,href:s})}let n;if(null!=e.path)n=d({},e,{path:_(a,e.path,t.path).path});else{const r=d({},e.params);for(const e in r)null==r[e]&&delete r[e];n=d({},e,{params:w(r)}),t.params=w(t.params)}const r=o.resolve(n,t),l=e.hash||"";r.params=b(E(r.params));const i=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(s,d({},e,{hash:(u=l,q(u).replace(j,"{").replace(S,"}").replace(x,"^")),path:r.path}));var u;const f=c.createHref(i);return d({fullPath:i, // keep the hash encoded so fullPath is effectively path + encodedQuery + // hash hash:l,query: // if the user is using a custom query lib like qs, we might have // nested objects, so we keep the query as is, meaning it can contain // numbers at `$route.query`, but at the point, the user will have to // use their own type anyway. // https://github.com/vuejs/router/issues/328#issuecomment-649481567 s===Se?Ae(e.query):e.query||{}},r,{redirectedFrom:void 0,href:f})}function k(e){return"string"==typeof e?_(a,e,h.value.path):d({},e)}function O(e,t){if(y!==e)return ue(8,{from:t,to:e})}function P(e){return $(e)}function C(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let r="function"==typeof n?n(e):n;return"string"==typeof r&&(r=r.includes("?")||r.includes("#")?r=k(r): // force empty params {path:r},r.params={}),d({query:e.query,hash:e.hash, // avoid transferring params if the redirect has a path params:null!=r.path?{}:e.params},r)}}function $(e,t){const n=y=R(e),r=h.value,o=e.state,a=e.force,c=!0===e.replace,l=C(n);if(l)return $(d(k(l),{state:"object"==typeof l?d({},o,l.state):o,force:a,replace:c}), // keep original redirectedFrom if it exists t||n);const i=n;let u;return i.redirectedFrom=t,!a&&function(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&T(t.matched[r],n.matched[o])&&W(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(s,r,n)&&(u=ue(16,{to:i,from:r}),te(r,r, // this is a push, the only way for it to be triggered from a // history.listen is with a redirect, which makes it become a push !0, // This cannot be the first navigation because the initial location // cannot be manually navigated to !1)),(u?Promise.resolve(u):G(i,r)).catch((e=>fe(e)? // navigation redirects still mark the router as ready fe(e,2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */)?e:Y(e): // reject any unknown error X(e,i,r))).then((e=>{if(e){if(fe(e,2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */))return $( // keep options d({ // preserve an existing replacement but allow the redirect to override it replace:c},k(e.to),{state:"object"==typeof e.to?d({},o,e.to.state):o,force:a}), // preserve the original redirectedFrom if any t||i)}else e=D(i,r,!0,c,o);return I(i,r,e),e}))}function A(e,t){const n=O(e,t);return n?Promise.reject(n):Promise.resolve()}function L(e){const t=oe.values().next().value;return t&&"function"==typeof t.runWithContext?t.runWithContext(e):e()}function G(e,t){let n;const[r,o,a]=function(e,t){const n=[],r=[],o=[],a=Math.max(t.matched.length,e.matched.length);for(let s=0;sT(e,a)))?r.push(a):n.push(a));const c=e.matched[s];c&&(t.matched.find((e=>T(e,c)))||o.push(c))}return[n,r,o]}(e,t);n=Te(r.reverse(),"beforeRouteLeave",e,t);for(const c of r)c.leaveGuards.forEach((r=>{n.push(Ie(r,e,t))}));const s=A.bind(null,e,t);return n.push(s),ce(n).then((()=>{n=[];for(const r of l.list())n.push(Ie(r,e,t));return n.push(s),ce(n)})).then((()=>{n=Te(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Ie(r,e,t))}));return n.push(s),ce(n)})).then((()=>{n=[];for(const r of a)if(r.beforeEnter)if(v(r.beforeEnter))for(const o of r.beforeEnter)n.push(Ie(o,e,t));else n.push(Ie(r.beforeEnter,e,t));return n.push(s),ce(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=Te(a,"beforeRouteEnter",e,t,L),n.push(s),ce(n)))).then((()=>{n=[];for(const r of i.list())n.push(Ie(r,e,t));return n.push(s),ce(n)})).catch((e=>fe(e,8 /* ErrorTypes.NAVIGATION_CANCELLED */)?e:Promise.reject(e)))}function I(e,t,n){u.list().forEach((r=>L((()=>r(e,t,n)))))}function D(e,t,n,r,o){const a=O(e,t);if(a)return a;const s=t===V,l=p?history.state:{};n&&(r||s?c.replace(e.fullPath,d({scroll:s&&l&&l.scroll},o)):c.push(e.fullPath,o)),h.value=e,te(e,t,n,s),Y()}let U;function K(){U||(U=c.listen(((e,t,n)=>{if(!ae.listening)return;const r=R(e),o=C(r);if(o)return void $(d(o,{replace:!0,force:!0}),r).catch(g);y=r;const a=h.value;var s,l;p&&(s=J(a.fullPath,n.delta),l=N(),ee.set(s,l)),G(r,a).catch((e=>fe(e,12 /* ErrorTypes.NAVIGATION_CANCELLED */)?e:fe(e,2 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */)?($(d(k(e.to),{force:!0}),r).then((e=>{fe(e,20 /* ErrorTypes.NAVIGATION_DUPLICATED */)&&!n.delta&&n.type===F.pop&&c.go(-1,!1)})).catch(g),Promise.reject()):(n.delta&&c.go(-n.delta,!1),X(e,r,a)))).then((e=>{(e=e||D( // after navigation, all matched components are resolved r,a,!1))&&(n.delta&&// a new navigation has been triggered, so we do not want to revert, that will change the current history // entry while a different route is displayed !fe(e,8 /* ErrorTypes.NAVIGATION_CANCELLED */)?c.go(-n.delta,!1):n.type===F.pop&&fe(e,20 /* ErrorTypes.NAVIGATION_DUPLICATED */)&&c.go(-1,!1)),I(r,a,e)})).catch(g)})))}let z,H=_e(),Q=_e();function X(e,t,n){Y(e);const r=Q.list();return r.length&&r.forEach((r=>r(e,t,n))),Promise.reject(e)}function Y(e){return z||(z=!e,K(),H.list().forEach((([t,n])=>e?n(e):t())),H.reset()),e}function te(e,n,r,o){const{scrollBehavior:a}=t;if(!p||!a)return Promise.resolve();const s=!r&&function(e){const t=ee.get(e);return ee.delete(e),t}(J(e.fullPath,0))||(o||!r)&&history.state&&history.state.scroll||null;return f().then((()=>a(e,n,s))).then((e=>e&&Z(e))).catch((t=>X(t,e,n)))}const ne=e=>c.go(e);let re;const oe=new Set,ae={currentRoute:h,listening:!0,addRoute:function(e,t){let n,r;return se(e)?(n=o.getRecordMatcher(e),r=t):r=e,o.addRoute(r,n)},removeRoute:function(e){const t=o.getRecordMatcher(e);t&&o.removeRoute(t)},clearRoutes:o.clearRoutes,hasRoute:function(e){return!!o.getRecordMatcher(e)},getRoutes:function(){return o.getRoutes().map((e=>e.record))},resolve:R,options:t,push:P,replace:function(e){return P(d(k(e),{replace:!0}))},go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:l.add,beforeResolve:i.add,afterEach:u.add,onError:Q.add,isReady:function(){return z&&h.value!==V?Promise.resolve():new Promise(((e,t)=>{H.add([e,t])}))},install(e){e.component("RouterLink",De),e.component("RouterView",Ke),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>n(h)}),p&&// used for the initial navigation client side to avoid pushing // multiple times when the router is used in multiple apps !re&&h.value===V&&(re=!0,P(c.location).catch((e=>{})));const t={};for(const n in V)Object.defineProperty(t,n,{get:()=>h.value[n],enumerable:!0});e.provide(Me,this),e.provide(Be,r(t)),e.provide(Ge,h);const o=e.unmount;oe.add(e),e.unmount=function(){oe.delete(e),oe.size<1&&(y=V,U&&U(),U=null,h.value=V,re=!1,z=!1),o()}}};function ce(e){return e.reduce(((e,t)=>e.then((()=>L(t)))),Promise.resolve())}return ae}function He(){return o(Me)}function Qe(e){return o(Be)}export{He as a,ae as b,ze as c,Qe as u};