You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

vue-router

Package Overview
Dependencies
Maintainers
2
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.15 to 4.1.0-aabe509

326

dist/vue-router.d.ts

@@ -7,2 +7,3 @@ import { AllowedComponentProps } from 'vue';

import { ComputedRef } from 'vue';
import { DefineComponent } from 'vue';
import { InjectionKey } from 'vue';

@@ -17,2 +18,26 @@ import { Ref } from 'vue';

/**
* Vue Router Configuration that allows to add global types for better type support.
*
* @example
*
* ```ts
* const router = createRouter({
* // ...
* routes: [
* // ...
* ] as const // IMPORTANT
* })
*
* declare module 'vue-router' {
* export interface Config {
* // allow global functions to get a typed router
* Router: typeof router
* }
* }
* ```
*/
export declare interface Config {
}
/**
* Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.

@@ -31,3 +56,3 @@ * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.

*/
export declare function createRouter(options: RouterOptions): Router;
export declare function createRouter<Options extends RouterOptions>(options: Options): Router<Options>;

@@ -41,3 +66,3 @@ /**

*/
export declare function createRouterMatcher(routes: RouteRecordRaw[], globalOptions: PathParserOptions): RouterMatcher;
export declare function createRouterMatcher(routes: Readonly<RouteRecordRaw[]>, globalOptions: PathParserOptions): RouterMatcher;

@@ -100,2 +125,16 @@ /**

/**
* Extract the first param name (after a `:`) and ignores the rest.
*
* @internal
*/
export declare type _ExtractFirstParamName<S extends string> = S extends `${infer P}${_ParamDelimiter}${string}` ? _ExtractFirstParamName<P> : S extends `${string}${_ParamDelimiter}${string}` ? never : S;
/**
* Given a simple path, creates an object of the possible param values.
*
* @internal
*/
declare type _ExtractParamsPath<P extends string, isRaw extends boolean> = P extends `${string}{${infer PP}}${infer Rest}` ? (PP extends `${infer N}${_ParamModifier}` ? PP extends `${N}${infer M}` ? M extends _ParamModifier ? _ParamToObject<N, M, isRaw> : never : never : _ParamToObject<PP, '', isRaw>) & _ExtractParamsPath<Rest, isRaw> : {};
declare type HistoryLocation = string;

@@ -148,4 +187,21 @@

/**
* Joins a prefix and a path putting a `/` between them when necessary
*
* @internal
*/
export declare type JoinPath<Prefix extends string, Path extends string> = Path extends `/${string}` ? Path : '' extends Prefix ? never : `${Prefix}${Prefix extends `${string}/` ? '' : '/'}${Path}`;
declare type Lazy<T> = () => Promise<T>;
/**
* Ensures a route is loaded so it can be passed as o prop to `<RouterView>`.
*
* @param route - resolved route to load
*/
export declare function loadRouteLocation(route: RouteLocationNormalized): Promise<RouteLocationNormalizedLoaded>;
/**
* @internal
*/
declare interface LocationAsName {

@@ -163,4 +219,4 @@ name: RouteRecordName;

declare interface LocationAsRelative {
params?: RouteParams;
declare interface LocationAsRelative<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric, Name extends keyof RouteMap = keyof RouteMap> {
params?: RouteNamedMapGeneric extends RouteMap ? RouteParams : RouteMap[Name]['params'];
}

@@ -171,5 +227,5 @@

*/
export declare interface LocationAsRelativeRaw {
name?: RouteRecordName;
params?: RouteParamsRaw;
export declare interface LocationAsRelativeRaw<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric, Name extends keyof RouteMap = keyof RouteMap> {
name?: RouteNamedMapGeneric extends RouteMap ? RouteRecordName : Name;
params?: RouteNamedMapGeneric extends RouteMap ? RouteParamsRaw : RouteMap[Name]['paramsRaw'];
}

@@ -224,3 +280,25 @@

declare interface MatcherLocation extends Pick<RouteLocation, 'name' | 'path' | 'params' | 'matched' | 'meta'> {
declare interface MatcherLocation {
/**
* Name of the matched record
*/
name: RouteRecordName | null | undefined;
/**
* Percentage encoded pathname section of the URL.
*/
path: string;
/**
* Object of decoded params extracted from the `path`.
*/
params: RouteParams;
/**
* Merged `meta` properties from all of the matched route records.
*/
meta: RouteMeta;
/**
* Array of {@link RouteRecord} containing components as they were
* passed when adding records. It can also contain redirect records. This
* can't be used directly
*/
matched: RouteRecord[];
}

@@ -230,2 +308,9 @@

/**
* Gets the possible type of a param based on its modifier M.
*
* @internal
*/
declare type _ModifierParamValue<M extends _ParamModifier | '' = _ParamModifier | '', isRaw extends boolean = false> = '' extends M ? _ParamValue<isRaw> : '+' extends M ? _ParamValueOneOrMore<isRaw> : '*' extends M ? _ParamValueZeroOrMore<isRaw> : '?' extends M ? _ParamValueZeroOrOne<isRaw> : never;
declare interface NavigationCallback {

@@ -347,2 +432,70 @@ (to: HistoryLocation, from: HistoryLocation, information: NavigationInformation): void;

/**
* Characters that mark the end of a param. In reality, there is a lot more than
* this as only alphanumerical + _ are accepted as params but that is impossible
* to achieve with TS and in practice, This set should cover them all. TODO: Add
* missing characters that do not need to be encoded.
*
* @internal
*/
declare type _ParamDelimiter = '-' | '/' | '%' | ':' | '(' | '\\' | ';' | ',' | '&' | '!' | "'" | '=' | '@' | '[' | ']' | _ParamModifier;
/**
* Possible param modifiers.
*
* @internal
*/
declare type _ParamModifier = '+' | '?' | '*';
/**
* Extract an object of params given a path like `/users/:id`.
*
* @example
* ```ts
* type P = ParamsFromPath<'/:id/b/:c*'> // { id: string; c?: string[] }
* ```
*/
export declare type ParamsFromPath<P extends string = string> = string extends P ? RouteParams : _ExtractParamsPath<_RemoveRegexpFromParam<P>, false>;
declare type ParamsRawFromPath<P extends string = string> = string extends P ? RouteParamsRaw : _ExtractParamsPath<_RemoveRegexpFromParam<P>, true>;
/**
* Given a param name N and its modifier M, creates a param object for the pair.
*
* @internal
*/
declare type _ParamToObject<N extends string, M extends _ParamModifier | '', isRaw extends boolean> = M extends '?' | '*' ? {
[K in N]?: _ModifierParamValue<M, isRaw>;
} : {
[K in N]: _ModifierParamValue<M, isRaw>;
};
/**
* Utility type for raw and non raw params like :id
*
* @internal
*/
declare type _ParamValue<isRaw extends boolean> = true extends isRaw ? string | number : string;
/**
* Utility type for raw and non raw params like :id+
*
* @internal
*/
declare type _ParamValueOneOrMore<isRaw extends boolean> = true extends isRaw ? readonly [string | number, ...(string | number)[]] : readonly [string, ...string[]];
/**
* Utility type for raw and non raw params like :id*
*
* @internal
*/
declare type _ParamValueZeroOrMore<isRaw extends boolean> = true extends isRaw ? readonly (string | number)[] | undefined | null : readonly string[] | undefined | null;
/**
* Utility type for raw and non raw params like :id?
*
* @internal
*/
declare type _ParamValueZeroOrOne<isRaw extends boolean> = true extends isRaw ? RouteParamValueRaw : string;
/**
* Transforms a queryString into a {@link LocationQuery} object. Accept both, a

@@ -358,3 +511,3 @@ * version with the leading `?` and without Should work as URLSearchParams

declare type PathParams = Record<string, string | string[]>;
declare type PathParams = Record<string, string | readonly string[]>;

@@ -433,5 +586,23 @@ declare interface PathParser {

/**
* Reformats a path string `/:id(custom-regex)/:other+` by wrapping params with
* `{}` and removing custom regexps to make them easier to parse.
*
* @internal
*/
export declare type _RemoveRegexpFromParam<S extends string> = S extends `${infer A}:${infer P}${_ParamDelimiter}${infer Rest}` ? P extends _ExtractFirstParamName<P> ? S extends `${A}:${P}${infer D}${Rest}` ? D extends _ParamModifier | '' ? `${A}{${P}${D}}${S extends `${A}:${P}${D}${infer Rest2}` ? _RemoveRegexpFromParam<Rest2> : never}` : D extends _ParamDelimiter ? '(' extends D ? `${A}{${P}${S extends `${A}:${P}(${infer Rest2}` ? _RemoveRegexpFromParam<_RemoveUntilClosingPar<Rest2>> : '}'}` : `${A}{${P}}${S extends `${A}:${P}${infer Rest2}` ? _RemoveRegexpFromParam<Rest2> : never}` : never : never : never : S extends `${infer A}:${infer P}` ? P extends _ExtractFirstParamName<P> ? `${A}{${P}}` : never : S;
/**
* Takes the custom regex (and everything after) of a param and strips it off.
*
* @example
* - `\\d+(?:inner-group\\)-end)/:rest-of-url` -> `/:rest-of-url`
*
* @internal
*/
export declare type _RemoveUntilClosingPar<S extends string> = S extends `${infer A}\\)${infer Rest}` ? A extends `${string})${infer Rest2}` ? Rest2 extends `${_ParamModifier}${infer Rest3}` ? Rest2 extends `${infer M}${Rest3}` ? `${M}}${Rest3}\\)${Rest}` : never : `}${Rest2}\\)${Rest}` : _RemoveUntilClosingPar<Rest> : S extends `${string})${infer Rest}` ? Rest extends `${_ParamModifier}${infer Rest2}` ? Rest extends `${infer M}${Rest2}` ? `${M}}${Rest2}` : never : `}${Rest}` : never;
/**
* Allowed Component in {@link RouteLocationMatched}
*/
export declare type RouteComponent = Component;
export declare type RouteComponent = Component | DefineComponent;

@@ -455,8 +626,4 @@ /**

*/
export declare interface _RouteLocationBase {
export declare interface _RouteLocationBase extends Pick<MatcherLocation, 'name' | 'path' | 'params' | 'meta'> {
/**
* Percentage encoded pathname section of the URL.
*/
path: string;
/**
* The whole location including the `search` and `hash`. This string is

@@ -475,10 +642,2 @@ * percentage encoded.

/**
* Name of the matched record
*/
name: RouteRecordName | null | undefined;
/**
* Object of decoded params extracted from the `path`.
*/
params: RouteParams;
/**
* Contains the location we were initially trying to access before ending up

@@ -488,6 +647,2 @@ * on the current location.

redirectedFrom: RouteLocation | undefined;
/**
* Merged `meta` properties from all of the matched route records.
*/
meta: RouteMeta;
}

@@ -504,6 +659,13 @@

export declare interface RouteLocationMatched extends RouteRecordNormalized {
components: Record<string, RouteComponent>;
components: Record<string, RouteComponent> | null | undefined;
}
/**
* Route Location that can infer the necessary params based on the name
*
* @internal
*/
declare type RouteLocationNamedRaw<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric, Name extends keyof RouteMap = keyof RouteMap> = RouteQueryAndHash & LocationAsRelativeRaw<RouteMap, Name> & RouteLocationOptions;
/**
* Similar to {@link RouteLocation} but its

@@ -549,6 +711,8 @@ * {@link RouteLocationNormalized.matched} cannot contain redirect records

declare type RouteLocationPathRaw = RouteQueryAndHash & LocationAsPath & RouteLocationOptions;
/**
* User-level route location
*/
export declare type RouteLocationRaw = string | (RouteQueryAndHash & LocationAsPath & RouteLocationOptions) | (RouteQueryAndHash & LocationAsRelativeRaw & RouteLocationOptions);
export declare type RouteLocationRaw = string | RouteLocationPathRaw | RouteLocationNamedRaw;

@@ -574,6 +738,24 @@ /**

export declare type RouteParams = Record<string, RouteParamValue | RouteParamValue[]>;
export declare type RouteNamedMap<Routes extends Readonly<RouteRecordRaw[]>, Prefix extends string = ''> = Routes extends readonly [infer R, ...infer Rest] ? Rest extends Readonly<RouteRecordRaw[]> ? (R extends {
name?: infer Name;
path: infer Path;
children?: infer Children;
} ? Path extends string ? (Name extends string | symbol ? {
[N in Name]: {
params: ParamsFromPath<JoinPath<Prefix, Path>>;
paramsRaw: ParamsRawFromPath<JoinPath<Prefix, Path>>;
path: JoinPath<Prefix, Path>;
};
} : {}) & (Children extends Readonly<RouteRecordRaw[]> ? RouteNamedMap<Children, JoinPath<Prefix, Path>> : {}) : never : {}) & RouteNamedMap<Rest, Prefix> : never : {};
export declare type RouteParamsRaw = Record<string, RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]>;
declare type RouteNamedMapGeneric = Record<string | symbol | number, {
params: RouteParams;
paramsRaw: RouteParamsRaw;
path: string;
}>;
export declare type RouteParams = Record<string, RouteParamValue | readonly RouteParamValue[]>;
export declare type RouteParamsRaw = Record<string, RouteParamValueRaw | readonly Exclude<RouteParamValueRaw, null | undefined>[]>;
/**

@@ -600,3 +782,3 @@ * @internal

*/
export declare interface Router {
export declare interface Router<Options extends RouterOptions = RouterOptions> {
/**

@@ -612,4 +794,8 @@ * @internal

*/
readonly options: RouterOptions;
readonly options: Options;
/**
* Allows turning off the listening of history events. This is a low level api for micro-frontends.
*/
listening: boolean;
/**
* Add a new {@link RouteRecordRaw route record} as the child of an existing route.

@@ -647,3 +833,3 @@ *

* that includes any existing `base`. By default the `currentLocation` used is
* `route.currentRoute` and should only be overriden in advanced use cases.
* `route.currentRoute` and should only be overridden in advanced use cases.
*

@@ -662,3 +848,3 @@ * @param to - Raw route location to resolve

*/
push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
push<RouteMap extends RouteNamedMapGeneric = RouteNamedMap<Options['routes']>, Name extends keyof RouteMap = keyof RouteNamedMap<Options['routes']>>(to: RouteNamedMapGeneric extends RouteMap ? RouteLocationRaw : RouteLocationNamedRaw<RouteMap, Name> | RouteLocationPathRaw | string): Promise<NavigationFailure | void | undefined>;
/**

@@ -670,3 +856,3 @@ * Programmatically navigate to a new URL by replacing the current entry in

*/
replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
replace<RouteMap extends RouteNamedMapGeneric = RouteNamedMap<Options['routes']>, Name extends keyof RouteMap = keyof RouteNamedMap<Options['routes']>>(to: RouteNamedMapGeneric extends RouteMap ? RouteLocationRaw : RouteLocationNamedRaw<RouteMap, Name> | RouteLocationPathRaw | string): Promise<NavigationFailure | void | undefined>;
/**

@@ -785,6 +971,2 @@ * Go back in history if possible by calling `history.back()`. Equivalent to

/**
* Array of nested routes.
*/
children?: RouteRecordRaw[];
/**
* Aliases for the record. Allows defining extra paths that will behave like a

@@ -835,2 +1017,20 @@ * copy of the record. Allows having paths shorthands like `/users/:id` and

/**
* Route Record defining multiple named components with the `components` option and children.
*/
declare interface RouteRecordMultipleViewsWithChildren extends _RouteRecordBase {
/**
* Components to display when the URL matches this route. Allow using named views.
*/
components?: Record<string, RawRouteComponent> | null | undefined;
component?: never;
children: Readonly<RouteRecordRaw>[];
/**
* Allow passing down params as props to the component rendered by
* `router-view`. Should be an object with the same keys as `components` or a
* boolean to be applied to every component.
*/
props?: Record<string, _RouteRecordProps> | boolean;
}
/**
* Possible values for a user-defined route record's name

@@ -859,7 +1059,7 @@ */

*/
components: RouteRecordMultipleViews['components'];
components: RouteRecordMultipleViews['components'] | null | undefined;
/**
* {@inheritDoc _RouteRecordBase.components}
* Nested route records.
*/
children: Exclude<_RouteRecordBase['children'], void>;
children: RouteRecordSingleViewWithChildren['children'];
/**

@@ -917,3 +1117,3 @@ * {@inheritDoc _RouteRecordBase.meta}

export declare type RouteRecordRaw = RouteRecordSingleView | RouteRecordMultipleViews | RouteRecordRedirect;
export declare type RouteRecordRaw = RouteRecordSingleView | RouteRecordSingleViewWithChildren | RouteRecordMultipleViews | RouteRecordMultipleViewsWithChildren | RouteRecordRedirect;

@@ -951,2 +1151,21 @@ /**

/**
* Route Record defining one single component with a nested view.
*/
declare interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
/**
* Component to display when the URL matches this route.
*/
component?: RawRouteComponent | null | undefined;
components?: never;
/**
* Array of nested routes.
*/
children: Readonly<RouteRecordRaw[]>;
/**
* Allow passing down params as props to the component rendered by `router-view`.
*/
props?: _RouteRecordProps;
}
/**
* Interface implemented by History implementations that can be passed to the

@@ -1033,3 +1252,3 @@ * router as {@link Router.history}

*/
export declare const routerKey: InjectionKey<Router>;
export declare const routerKey: InjectionKey<Router<RouterOptions>>;

@@ -1058,3 +1277,3 @@ /**

*/
to: RouteLocationRaw;
to: Parameters<RouterTyped['push']>[0];
/**

@@ -1131,3 +1350,3 @@ * Calls `router.replace` instead of `router.push`.

*/
routes: RouteRecordRaw[];
routes: Readonly<RouteRecordRaw[]>;
/**

@@ -1193,2 +1412,4 @@ * Function to control scrolling when navigating between pages. Can return a

export declare type RouterTyped = Config extends Record<'Router', infer R> ? R : Router;
/**

@@ -1311,3 +1532,3 @@ * Component to display the current route the user is at.

*/
export declare function useRouter(): Router;
export declare function useRouter(): RouterTyped;

@@ -1320,3 +1541,3 @@ /**

*/
export declare const viewDepthKey: InjectionKey<number>;
export declare const viewDepthKey: InjectionKey<number | Ref<number>>;

@@ -1382,4 +1603,9 @@ /**

*/
$router: Router
$router: RouterTyped
}
export interface GlobalComponents {
RouterView: typeof RouterView
RouterLink: typeof RouterLink
}
}

2

dist/vue-router.global.prod.js

@@ -6,2 +6,2 @@ /*!

*/
var VueRouter=function(e,t){"use strict";const n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=e=>n?Symbol(e):"_vr_"+e,o=r("rvlm"),a=r("rvd"),c=r("r"),s=r("rl"),i=r("rvl"),l="undefined"!=typeof window;const u=Object.assign;function f(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}const p=()=>{},h=/\/$/;function d(e,t,n="/"){let r,o={},a="",c="";const s=t.indexOf("?"),i=t.indexOf("#",s>-1?s:0);return s>-1&&(r=t.slice(0,s),a=t.slice(s+1,i>-1?i:t.length),o=e(a)),i>-1&&(r=r||t.slice(0,i),c=t.slice(i,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,a,c=n.length-1;for(o=0;o<r.length;o++)if(a=r[o],1!==c&&"."!==a){if(".."!==a)break;c--}return n.slice(0,c).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(a&&"?")+a+c,path:r,query:o,hash:c}}function m(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function g(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function v(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!y(e[n],t[n]))return!1;return!0}function y(e,t){return Array.isArray(e)?b(e,t):Array.isArray(t)?b(t,e):e===t}function b(e,t){return Array.isArray(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var w,E;!function(e){e.pop="pop",e.push="push"}(w||(w={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(E||(E={}));function R(e){if(!e)if(l){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(h,"")}const A=/^[^#]+#/;function O(e,t){return e.replace(A,"#")+t}const k=()=>({left:window.pageXOffset,top:window.pageYOffset});function P(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.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function j(e,t){return(history.state?history.state.position-t:-1)+e}const x=new Map;let C=()=>location.protocol+"//"+location.host;function $(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),m(n,"")}return m(n,e)+r+o}function S(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?k():null}}function L(e){const t=function(e){const{history:t,location:n}=window,r={value:$(e,n)},o={value:t.state};function a(r,a,c){const s=e.indexOf("#"),i=s>-1?(n.host&&document.querySelector("base")?e:e.slice(s))+r:C()+e+r;try{t[c?"replaceState":"pushState"](a,"",i),o.value=a}catch(e){console.error(e),n[c?"replace":"assign"](i)}}return o.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:function(e,n){const c=u({},o.value,t.state,{forward:e,scroll:k()});a(c.current,c,!0),a(e,u({},S(r.value,e,null),{position:c.position+1},n),!1),r.value=e},replace:function(e,n){a(e,u({},t.state,S(o.value.back,e,o.value.forward,!0),n,{position:o.value.position}),!0),r.value=e}}}(e=R(e)),n=function(e,t,n,r){let o=[],a=[],c=null;const s=({state:a})=>{const s=$(e,location),i=n.value,l=t.value;let u=0;if(a){if(n.value=s,t.value=a,c&&c===i)return void(c=null);u=l?a.position-l.position:0}else r(s);o.forEach((e=>{e(n.value,i,{delta:u,type:w.pop,direction:u?u>0?E.forward:E.back:E.unknown})}))};function i(){const{history:e}=window;e.state&&e.replaceState(u({},e.state,{scroll:k()}),"")}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",i),{pauseListeners:function(){c=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",s),window.removeEventListener("beforeunload",i)}}}(e,t.state,t.location,t.replace);const r=u({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:O.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 q(e){return"string"==typeof e||"symbol"==typeof e}const M={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},_=r("nf");var T;function B(e,t){return u(new Error,{type:e,[_]:!0},t)}function G(e,t){return e instanceof Error&&_ in e&&(null==t||!!(e.type&t))}e.NavigationFailureType=void 0,(T=e.NavigationFailureType||(e.NavigationFailureType={}))[T.aborted=4]="aborted",T[T.cancelled=8]="cancelled",T[T.duplicated=16]="duplicated";const F="[^/]+?",I={sensitive:!1,strict:!1,start:!0,end:!0},K=/[.+*?^${}()[\]/\\]/g;function U(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function V(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=U(r[n],o[n]);if(e)return e;n++}return o.length-r.length}const D={type:0,value:""},H=/[a-zA-Z0-9_]/;function W(e,t,n){const r=function(e,t){const n=u({},I,t),r=[];let o=n.start?"^":"";const a=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(o+="/");for(let r=0;r<t.length;r++){const c=t[r];let s=40+(n.sensitive?.25:0);if(0===c.type)r||(o+="/"),o+=c.value.replace(K,"\\$&"),s+=40;else if(1===c.type){const{value:e,repeatable:n,optional:i,regexp:l}=c;a.push({name:e,repeatable:n,optional:i});const u=l||F;if(u!==F){s+=10;try{new RegExp(`(${u})`)}catch(t){throw new Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let f=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(f=i&&t.length<2?`(?:/${f})`:"/"+f),i&&(f+="?"),o+=f,s+=20,i&&(s+=-8),n&&(s+=-20),".*"===u&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){const e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const c=new RegExp(o,n.sensitive?"":"i");return{re:c,score:r,keys:a,parse:function(e){const t=e.match(c),n={};if(!t)return null;for(let e=1;e<t.length;e++){const r=t[e]||"",o=a[e-1];n[o.name]=r&&o.repeatable?r.split("/"):r}return n},stringify:function(t){let n="",r=!1;for(const o of e){r&&n.endsWith("/")||(n+="/"),r=!1;for(const a of o)if(0===a.type)n+=a.value;else if(1===a.type){const{value:c,repeatable:s,optional:i}=a,l=c in t?t[c]:"";if(Array.isArray(l)&&!s)throw new Error(`Provided param "${c}" is an array but it is not repeatable (* or + modifiers)`);const u=Array.isArray(l)?l.join("/"):l;if(!u){if(!i)throw new Error(`Missing required param "${c}"`);o.length<2&&e.length>1&&(n.endsWith("/")?n=n.slice(0,-1):r=!0)}n+=u}}return n}}}(function(e){if(!e)return[[]];if("/"===e)return[[D]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n;const o=[];let a;function c(){a&&o.push(a),a=[]}let s,i=0,l="",u="";function f(){l&&(0===n?a.push({type:0,value:l}):1===n||2===n||3===n?(a.length>1&&("*"===s||"+"===s)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:"*"===s||"+"===s,optional:"*"===s||"?"===s})):t("Invalid state to consume buffer"),l="")}function p(){l+=s}for(;i<e.length;)if(s=e[i++],"\\"!==s||2===n)switch(n){case 0:"/"===s?(l&&f(),c()):":"===s?(f(),n=1):p();break;case 4:p(),n=r;break;case 1:"("===s?n=2:H.test(s)?p():(f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--);break;case 2:")"===s?"\\"==u[u.length-1]?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--,u="";break;default:t("Unknown state")}else r=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${l}"`),f(),c(),o}(e.path),n),o=u(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function N(e,t){const n=[],r=new Map;function o(e,n,r){const s=!r,i=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:z(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||{}:{default:e.component}}}(e);i.aliasOf=r&&r.record;const l=Y(t,e),f=[i];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)f.push(u({},i,{components:r?r.record.components:i.components,path:e,aliasOf:r?r.record:i}))}let h,d;for(const t of f){const{path:u}=t;if(n&&"/"!==u[0]){const e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(u&&r+u)}if(h=W(t,n,l),r?r.alias.push(h):(d=d||h,d!==h&&d.alias.push(h),s&&e.name&&!Q(h)&&a(e.name)),"children"in i){const e=i.children;for(let t=0;t<e.length;t++)o(e[t],h,r&&r.children[t])}r=r||h,c(h)}return d?()=>{a(d)}:p}function a(e){if(q(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 c(e){let t=0;for(;t<n.length&&V(e,n[t])>=0&&(e.record.path!==n[t].record.path||!Z(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!Q(e)&&r.set(e.record.name,e)}return t=Y({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>o(e))),{addRoute:o,resolve:function(e,t){let o,a,c,s={};if("name"in e&&e.name){if(o=r.get(e.name),!o)throw B(1,{location:e});c=o.record.name,s=u(function(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(t.params,o.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params),a=o.stringify(s)}else if("path"in e)a=e.path,o=n.find((e=>e.re.test(a))),o&&(s=o.parse(a),c=o.record.name);else{if(o=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!o)throw B(1,{location:e,currentLocation:t});c=o.record.name,s=u({},t.params,e.params),a=o.stringify(s)}const i=[];let l=o;for(;l;)i.unshift(l.record),l=l.parent;return{name:c,path:a,params:s,matched:i,meta:X(i)}},removeRoute:a,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function z(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]="boolean"==typeof n?n:n[r];return t}function Q(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function X(e){return e.reduce(((e,t)=>u(e,t.meta)),{})}function Y(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function Z(e,t){return t.children.some((t=>t===e||Z(e,t)))}const J=/#/g,ee=/&/g,te=/\//g,ne=/=/g,re=/\?/g,oe=/\+/g,ae=/%5B/g,ce=/%5D/g,se=/%5E/g,ie=/%60/g,le=/%7B/g,ue=/%7C/g,fe=/%7D/g,pe=/%20/g;function he(e){return encodeURI(""+e).replace(ue,"|").replace(ae,"[").replace(ce,"]")}function de(e){return he(e).replace(oe,"%2B").replace(pe,"+").replace(J,"%23").replace(ee,"%26").replace(ie,"`").replace(le,"{").replace(fe,"}").replace(se,"^")}function me(e){return null==e?"":function(e){return he(e).replace(J,"%23").replace(re,"%3F")}(e).replace(te,"%2F")}function ge(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function ve(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const r=n[e].replace(oe," "),o=r.indexOf("="),a=ge(o<0?r:r.slice(0,o)),c=o<0?null:ge(r.slice(o+1));if(a in t){let e=t[a];Array.isArray(e)||(e=t[a]=[e]),e.push(c)}else t[a]=c}return t}function ye(e){let t="";for(let n in e){const r=e[n];if(n=de(n).replace(ne,"%3D"),null==r){void 0!==r&&(t+=(t.length?"&":"")+n);continue}(Array.isArray(r)?r.map((e=>e&&de(e))):[r&&de(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function be(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=Array.isArray(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}function we(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function Ee(e,n,r){const o=()=>{e[n].delete(r)};t.onUnmounted(o),t.onDeactivated(o),t.onActivated((()=>{e[n].add(r)})),e[n].add(r)}function Re(e,t,n,r,o){const a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((c,s)=>{const i=e=>{var i;!1===e?s(B(4,{from:n,to:t})):e instanceof Error?s(e):"string"==typeof(i=e)||i&&"object"==typeof i?s(B(2,{from:t,to:e})):(a&&r.enterCallbacks[o]===a&&"function"==typeof e&&a.push(e),c())},l=e.call(r&&r.instances[o],t,n,i);let u=Promise.resolve(l);e.length<3&&(u=u.then(i)),u.catch((e=>s(e)))}))}function Ae(e,t,r,o){const a=[];for(const s of e)for(const e in s.components){let i=s.components[e];if("beforeRouteEnter"===t||s.instances[e])if("object"==typeof(c=i)||"displayName"in c||"props"in c||"__vccOpts"in c){const n=(i.__vccOpts||i)[t];n&&a.push(Re(n,r,o,s,e))}else{let c=i();a.push((()=>c.then((a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${s.path}"`));const c=(i=a).__esModule||n&&"Module"===i[Symbol.toStringTag]?a.default:a;var i;s.components[e]=c;const l=(c.__vccOpts||c)[t];return l&&Re(l,r,o,s,e)()}))))}}var c;return a}function Oe(e){const n=t.inject(c),r=t.inject(s),o=t.computed((()=>n.resolve(t.unref(e.to)))),a=t.computed((()=>{const{matched:e}=o.value,{length:t}=e,n=e[t-1],a=r.matched;if(!n||!a.length)return-1;const c=a.findIndex(g.bind(null,n));if(c>-1)return c;const s=Pe(e[t-2]);return t>1&&Pe(n)===s&&a[a.length-1].path!==s?a.findIndex(g.bind(null,e[t-2])):c})),i=t.computed((()=>a.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(!Array.isArray(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(r.params,o.value.params))),l=t.computed((()=>a.value>-1&&a.value===r.matched.length-1&&v(r.params,o.value.params)));return{route:o,href:t.computed((()=>o.value.href)),isActive:i,isExactActive:l,navigate:function(r={}){return 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)?n[t.unref(e.replace)?"replace":"push"](t.unref(e.to)).catch(p):Promise.resolve()}}}const ke=t.defineComponent({name:"RouterLink",props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Oe,setup(e,{slots:n}){const r=t.reactive(Oe(e)),{options:o}=t.inject(c),a=t.computed((()=>({[je(e.activeClass,o.linkActiveClass,"router-link-active")]:r.isActive,[je(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive})));return()=>{const o=n.default&&n.default(r);return e.custom?o:t.h("a",{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},o)}}});function Pe(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const je=(e,t,n)=>null!=e?e:null!=t?t:n;function xe(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Ce=t.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:n,slots:r}){const c=t.inject(i),s=t.computed((()=>e.route||c.value)),l=t.inject(a,0),f=t.computed((()=>s.value.matched[l]));t.provide(a,l+1),t.provide(o,f),t.provide(i,s);const p=t.ref();return t.watch((()=>[p.value,f.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||o&&g(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const o=s.value,a=f.value,c=a&&a.components[e.name],i=e.name;if(!c)return xe(r.default,{Component:c,route:o});const l=a.props[e.name],h=l?!0===l?o.params:"function"==typeof l?l(o):l:null,d=t.h(c,u({},h,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[i]=null)},ref:p}));return xe(r.default,{Component:d,route:o})||d}}});function $e(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}return e.RouterLink=ke,e.RouterView=Ce,e.START_LOCATION=M,e.createMemoryHistory=function(e=""){let t=[],n=[""],r=0;function o(e){r++,r===n.length||n.splice(r),n.push(e)}const a={location:"",state:{},base:e=R(e),createHref:O.bind(null,e),replace(e){n.splice(r--,1),o(e)},push(e,t){o(e)},listen:e=>(t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}),destroy(){t=[],n=[""],r=0},go(e,o=!0){const a=this.location,c=e<0?E.back:E.forward;r=Math.max(0,Math.min(r+e,n.length-1)),o&&function(e,n,{direction:r,delta:o}){const a={direction:r,delta:o,type:w.pop};for(const r of t)r(e,n,a)}(this.location,a,{direction:c,delta:e})}};return Object.defineProperty(a,"location",{enumerable:!0,get:()=>n[r]}),a},e.createRouter=function(e){const n=N(e.routes,e),r=e.parseQuery||ve,o=e.stringifyQuery||ye,a=e.history,h=we(),m=we(),y=we(),b=t.shallowRef(M);let E=M;l&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const R=f.bind(null,(e=>""+e)),A=f.bind(null,me),O=f.bind(null,ge);function C(e,t){if(t=u({},t||b.value),"string"==typeof e){const o=d(r,e,t.path),c=n.resolve({path:o.path},t),s=a.createHref(o.fullPath);return u(o,c,{params:O(c.params),hash:ge(o.hash),redirectedFrom:void 0,href:s})}let c;if("path"in e)c=u({},e,{path:d(r,e.path,t.path).path});else{const n=u({},e.params);for(const e in n)null==n[e]&&delete n[e];c=u({},e,{params:A(e.params)}),t.params=A(t.params)}const s=n.resolve(c,t),i=e.hash||"";s.params=R(O(s.params));const l=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(o,u({},e,{hash:(f=i,he(f).replace(le,"{").replace(fe,"}").replace(se,"^")),path:s.path}));var f;const p=a.createHref(l);return u({fullPath:l,hash:i,query:o===ye?be(e.query):e.query||{}},s,{redirectedFrom:void 0,href:p})}function $(e){return"string"==typeof e?d(r,e,b.value.path):u({},e)}function S(e,t){if(E!==e)return B(8,{from:t,to:e})}function L(e){return T(e)}function _(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=$(r):{path:r},r.params={}),u({query:e.query,hash:e.hash,params:e.params},r)}}function T(e,t){const n=E=C(e),r=b.value,a=e.state,c=e.force,s=!0===e.replace,i=_(n);if(i)return T(u($(i),{state:a,force:c,replace:s}),t||n);const l=n;let f;return l.redirectedFrom=t,!c&&function(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&g(t.matched[r],n.matched[o])&&v(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(o,r,n)&&(f=B(16,{to:l,from:r}),Y(r,r,!0,!1)),(f?Promise.resolve(f):I(l,r)).catch((e=>G(e)?G(e,2)?e:X(e):Q(e,l,r))).then((e=>{if(e){if(G(e,2))return T(u($(e.to),{state:a,force:c,replace:s}),t||l)}else e=U(l,r,!0,s,a);return K(l,r,e),e}))}function F(e,t){const n=S(e,t);return n?Promise.reject(n):Promise.resolve()}function I(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 c=0;c<a;c++){const a=t.matched[c];a&&(e.matched.find((e=>g(e,a)))?r.push(a):n.push(a));const s=e.matched[c];s&&(t.matched.find((e=>g(e,s)))||o.push(s))}return[n,r,o]}(e,t);n=Ae(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Re(r,e,t))}));const c=F.bind(null,e,t);return n.push(c),$e(n).then((()=>{n=[];for(const r of h.list())n.push(Re(r,e,t));return n.push(c),$e(n)})).then((()=>{n=Ae(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Re(r,e,t))}));return n.push(c),$e(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&!t.matched.includes(r))if(Array.isArray(r.beforeEnter))for(const o of r.beforeEnter)n.push(Re(o,e,t));else n.push(Re(r.beforeEnter,e,t));return n.push(c),$e(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=Ae(a,"beforeRouteEnter",e,t),n.push(c),$e(n)))).then((()=>{n=[];for(const r of m.list())n.push(Re(r,e,t));return n.push(c),$e(n)})).catch((e=>G(e,8)?e:Promise.reject(e)))}function K(e,t,n){for(const r of y.list())r(e,t,n)}function U(e,t,n,r,o){const c=S(e,t);if(c)return c;const s=t===M,i=l?history.state:{};n&&(r||s?a.replace(e.fullPath,u({scroll:s&&i&&i.scroll},o)):a.push(e.fullPath,o)),b.value=e,Y(e,t,n,s),X()}let V;function D(){V||(V=a.listen(((e,t,n)=>{const r=C(e),o=_(r);if(o)return void T(u(o,{replace:!0}),r).catch(p);E=r;const c=b.value;var s,i;l&&(s=j(c.fullPath,n.delta),i=k(),x.set(s,i)),I(r,c).catch((e=>G(e,12)?e:G(e,2)?(T(e.to,r).then((e=>{G(e,20)&&!n.delta&&n.type===w.pop&&a.go(-1,!1)})).catch(p),Promise.reject()):(n.delta&&a.go(-n.delta,!1),Q(e,r,c)))).then((e=>{(e=e||U(r,c,!1))&&(n.delta?a.go(-n.delta,!1):n.type===w.pop&&G(e,20)&&a.go(-1,!1)),K(r,c,e)})).catch(p)})))}let H,W=we(),z=we();function Q(e,t,n){X(e);const r=z.list();return r.length?r.forEach((r=>r(e,t,n))):console.error(e),Promise.reject(e)}function X(e){return H||(H=!e,D(),W.list().forEach((([t,n])=>e?n(e):t())),W.reset()),e}function Y(n,r,o,a){const{scrollBehavior:c}=e;if(!l||!c)return Promise.resolve();const s=!o&&function(e){const t=x.get(e);return x.delete(e),t}(j(n.fullPath,0))||(a||!o)&&history.state&&history.state.scroll||null;return t.nextTick().then((()=>c(n,r,s))).then((e=>e&&P(e))).catch((e=>Q(e,n,r)))}const Z=e=>a.go(e);let J;const ee=new Set,te={currentRoute:b,addRoute:function(e,t){let r,o;return q(e)?(r=n.getRecordMatcher(e),o=t):o=e,n.addRoute(o,r)},removeRoute:function(e){const t=n.getRecordMatcher(e);t&&n.removeRoute(t)},hasRoute:function(e){return!!n.getRecordMatcher(e)},getRoutes:function(){return n.getRoutes().map((e=>e.record))},resolve:C,options:e,push:L,replace:function(e){return L(u($(e),{replace:!0}))},go:Z,back:()=>Z(-1),forward:()=>Z(1),beforeEach:h.add,beforeResolve:m.add,afterEach:y.add,onError:z.add,isReady:function(){return H&&b.value!==M?Promise.resolve():new Promise(((e,t)=>{W.add([e,t])}))},install(e){e.component("RouterLink",ke),e.component("RouterView",Ce),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>t.unref(b)}),l&&!J&&b.value===M&&(J=!0,L(a.location).catch((e=>{})));const n={};for(const e in M)n[e]=t.computed((()=>b.value[e]));e.provide(c,this),e.provide(s,t.reactive(n)),e.provide(i,b);const r=e.unmount;ee.add(e),e.unmount=function(){ee.delete(e),ee.size<1&&(E=M,V&&V(),V=null,b.value=M,J=!1,H=!1),r()}}};return te},e.createRouterMatcher=N,e.createWebHashHistory=function(e){return(e=location.host?e||location.pathname+location.search:"").includes("#")||(e+="#"),L(e)},e.createWebHistory=L,e.isNavigationFailure=G,e.matchedRouteKey=o,e.onBeforeRouteLeave=function(e){const n=t.inject(o,{}).value;n&&Ee(n,"leaveGuards",e)},e.onBeforeRouteUpdate=function(e){const n=t.inject(o,{}).value;n&&Ee(n,"updateGuards",e)},e.parseQuery=ve,e.routeLocationKey=s,e.routerKey=c,e.routerViewLocationKey=i,e.stringifyQuery=ye,e.useLink=Oe,e.useRoute=function(){return t.inject(s)},e.useRouter=function(){return t.inject(c)},e.viewDepthKey=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
var VueRouter=function(e,t){"use strict";const n="undefined"!=typeof window;function r(e){return e.__esModule||"Module"===e[Symbol.toStringTag]}const o=Object.assign;function a(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}const c=()=>{},s=/\/$/;function i(e,t,n="/"){let r,o={},a="",c="";const s=t.indexOf("?"),i=t.indexOf("#",s>-1?s:0);return s>-1&&(r=t.slice(0,s),a=t.slice(s+1,i>-1?i:t.length),o=e(a)),i>-1&&(r=r||t.slice(0,i),c=t.slice(i,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,a,c=n.length-1;for(o=0;o<r.length;o++)if(a=r[o],1!==c&&"."!==a){if(".."!==a)break;c--}return n.slice(0,c).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(a&&"?")+a+c,path:r,query:o,hash:c}}function l(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function u(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function f(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!p(e[n],t[n]))return!1;return!0}function p(e,t){return Array.isArray(e)?h(e,t):Array.isArray(t)?h(t,e):e===t}function h(e,t){return Array.isArray(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var d,m;!function(e){e.pop="pop",e.push="push"}(d||(d={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(m||(m={}));function g(e){if(!e)if(n){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(s,"")}const v=/^[^#]+#/;function y(e,t){return e.replace(v,"#")+t}const b=()=>({left:window.pageXOffset,top:window.pageYOffset});function w(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.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function E(e,t){return(history.state?history.state.position-t:-1)+e}const R=new Map;let O=()=>location.protocol+"//"+location.host;function k(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),l(n,"")}return l(n,e)+r+o}function A(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?b():null}}function P(e){const t=function(e){const{history:t,location:n}=window,r={value:k(e,n)},a={value:t.state};function c(r,o,c){const s=e.indexOf("#"),i=s>-1?(n.host&&document.querySelector("base")?e:e.slice(s))+r:O()+e+r;try{t[c?"replaceState":"pushState"](o,"",i),a.value=o}catch(e){console.error(e),n[c?"replace":"assign"](i)}}return a.value||c(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:a,push:function(e,n){const s=o({},a.value,t.state,{forward:e,scroll:b()});c(s.current,s,!0),c(e,o({},A(r.value,e,null),{position:s.position+1},n),!1),r.value=e},replace:function(e,n){c(e,o({},t.state,A(a.value.back,e,a.value.forward,!0),n,{position:a.value.position}),!0),r.value=e}}}(e=g(e)),n=function(e,t,n,r){let a=[],c=[],s=null;const i=({state:o})=>{const c=k(e,location),i=n.value,l=t.value;let u=0;if(o){if(n.value=c,t.value=o,s&&s===i)return void(s=null);u=l?o.position-l.position:0}else r(c);a.forEach((e=>{e(n.value,i,{delta:u,type:d.pop,direction:u?u>0?m.forward:m.back:m.unknown})}))};function l(){const{history:e}=window;e.state&&e.replaceState(o({},e.state,{scroll:b()}),"")}return window.addEventListener("popstate",i),window.addEventListener("beforeunload",l),{pauseListeners:function(){s=n.value},listen:function(e){a.push(e);const t=()=>{const t=a.indexOf(e);t>-1&&a.splice(t,1)};return c.push(t),t},destroy:function(){for(const e of c)e();c=[],window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",l)}}}(e,t.state,t.location,t.replace);const r=o({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 j(e){return"string"==typeof e||"symbol"==typeof e}const C={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},x=Symbol("");var $;function S(e,t){return o(new Error,{type:e,[x]:!0},t)}function L(e,t){return e instanceof Error&&x in e&&(null==t||!!(e.type&t))}e.NavigationFailureType=void 0,($=e.NavigationFailureType||(e.NavigationFailureType={}))[$.aborted=4]="aborted",$[$.cancelled=8]="cancelled",$[$.duplicated=16]="duplicated";const q="[^/]+?",M={sensitive:!1,strict:!1,start:!0,end:!0},B=/[.+*?^${}()[\]/\\]/g;function T(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function _(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=T(r[n],o[n]);if(e)return e;n++}return o.length-r.length}const G={type:0,value:""},F=/[a-zA-Z0-9_]/;function I(e,t,n){const r=function(e,t){const n=o({},M,t),r=[];let a=n.start?"^":"";const c=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(a+="/");for(let r=0;r<t.length;r++){const o=t[r];let s=40+(n.sensitive?.25:0);if(0===o.type)r||(a+="/"),a+=o.value.replace(B,"\\$&"),s+=40;else if(1===o.type){const{value:e,repeatable:n,optional:i,regexp:l}=o;c.push({name:e,repeatable:n,optional:i});const u=l||q;if(u!==q){s+=10;try{new RegExp(`(${u})`)}catch(t){throw new Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let f=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(f=i&&t.length<2?`(?:/${f})`:"/"+f),i&&(f+="?"),a+=f,s+=20,i&&(s+=-8),n&&(s+=-20),".*"===u&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){const e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(a+="/?"),n.end?a+="$":n.strict&&(a+="(?:/|$)");const s=new RegExp(a,n.sensitive?"":"i");return{re:s,score:r,keys:c,parse:function(e){const t=e.match(s),n={};if(!t)return null;for(let e=1;e<t.length;e++){const r=t[e]||"",o=c[e-1];n[o.name]=r&&o.repeatable?r.split("/"):r}return n},stringify:function(t){let n="",r=!1;for(const o of e){r&&n.endsWith("/")||(n+="/"),r=!1;for(const a of o)if(0===a.type)n+=a.value;else if(1===a.type){const{value:c,repeatable:s,optional:i}=a,l=c in t?t[c]:"";if(Array.isArray(l)&&!s)throw new Error(`Provided param "${c}" is an array but it is not repeatable (* or + modifiers)`);const u=Array.isArray(l)?l.join("/"):l;if(!u){if(!i)throw new Error(`Missing required param "${c}"`);o.length<2&&e.length>1&&(n.endsWith("/")?n=n.slice(0,-1):r=!0)}n+=u}}return n}}}(function(e){if(!e)return[[]];if("/"===e)return[[G]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n;const o=[];let a;function c(){a&&o.push(a),a=[]}let s,i=0,l="",u="";function f(){l&&(0===n?a.push({type:0,value:l}):1===n||2===n||3===n?(a.length>1&&("*"===s||"+"===s)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:"*"===s||"+"===s,optional:"*"===s||"?"===s})):t("Invalid state to consume buffer"),l="")}function p(){l+=s}for(;i<e.length;)if(s=e[i++],"\\"!==s||2===n)switch(n){case 0:"/"===s?(l&&f(),c()):":"===s?(f(),n=1):p();break;case 4:p(),n=r;break;case 1:"("===s?n=2:F.test(s)?p():(f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--);break;case 2:")"===s?"\\"==u[u.length-1]?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--,u="";break;default:t("Unknown state")}else r=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${l}"`),f(),c(),o}(e.path),n),a=o(r,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function K(e,t){const n=[],r=new Map;function a(e,n,r){const l=!r,u=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:U(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);u.aliasOf=r&&r.record;const f=H(t,e),p=[u];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)p.push(o({},u,{components:r?r.record.components:u.components,path:e,aliasOf:r?r.record:u}))}let h,d;for(const t of p){const{path:o}=t;if(n&&"/"!==o[0]){const e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(o&&r+o)}if(h=I(t,n,f),r?r.alias.push(h):(d=d||h,d!==h&&d.alias.push(h),l&&e.name&&!V(h)&&s(e.name)),"children"in u){const e=u.children;for(let t=0;t<e.length;t++)a(e[t],h,r&&r.children[t])}r=r||h,i(h)}return d?()=>{s(d)}:c}function s(e){if(j(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(s),t.alias.forEach(s))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(s),e.alias.forEach(s))}}function i(e){let t=0;for(;t<n.length&&_(e,n[t])>=0&&(e.record.path!==n[t].record.path||!W(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!V(e)&&r.set(e.record.name,e)}return t=H({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>a(e))),{addRoute:a,resolve:function(e,t){let a,c,s,i={};if("name"in e&&e.name){if(a=r.get(e.name),!a)throw S(1,{location:e});s=a.record.name,i=o(function(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(t.params,a.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params),c=a.stringify(i)}else if("path"in e)c=e.path,a=n.find((e=>e.re.test(c))),a&&(i=a.parse(c),s=a.record.name);else{if(a=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!a)throw S(1,{location:e,currentLocation:t});s=a.record.name,i=o({},t.params,e.params),c=a.stringify(i)}const l=[];let u=a;for(;u;)l.unshift(u.record),u=u.parent;return{name:s,path:c,params:i,matched:l,meta:D(l)}},removeRoute:s,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function U(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]="boolean"==typeof n?n:n[r];return t}function V(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function D(e){return e.reduce(((e,t)=>o(e,t.meta)),{})}function H(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function W(e,t){return t.children.some((t=>t===e||W(e,t)))}const N=/#/g,z=/&/g,Q=/\//g,X=/=/g,Y=/\?/g,Z=/\+/g,J=/%5B/g,ee=/%5D/g,te=/%5E/g,ne=/%60/g,re=/%7B/g,oe=/%7C/g,ae=/%7D/g,ce=/%20/g;function se(e){return encodeURI(""+e).replace(oe,"|").replace(J,"[").replace(ee,"]")}function ie(e){return se(e).replace(Z,"%2B").replace(ce,"+").replace(N,"%23").replace(z,"%26").replace(ne,"`").replace(re,"{").replace(ae,"}").replace(te,"^")}function le(e){return null==e?"":function(e){return se(e).replace(N,"%23").replace(Y,"%3F")}(e).replace(Q,"%2F")}function ue(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function fe(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const r=n[e].replace(Z," "),o=r.indexOf("="),a=ue(o<0?r:r.slice(0,o)),c=o<0?null:ue(r.slice(o+1));if(a in t){let e=t[a];Array.isArray(e)||(e=t[a]=[e]),e.push(c)}else t[a]=c}return t}function pe(e){let t="";for(let n in e){const r=e[n];if(n=ie(n).replace(X,"%3D"),null==r){void 0!==r&&(t+=(t.length?"&":"")+n);continue}(Array.isArray(r)?r.map((e=>e&&ie(e))):[r&&ie(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function he(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=Array.isArray(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}const de=Symbol(""),me=Symbol(""),ge=Symbol(""),ve=Symbol(""),ye=Symbol("");function be(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function we(e,n,r){const o=()=>{e[n].delete(r)};t.onUnmounted(o),t.onDeactivated(o),t.onActivated((()=>{e[n].add(r)})),e[n].add(r)}function Ee(e,t,n,r,o){const a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((c,s)=>{const i=e=>{var i;!1===e?s(S(4,{from:n,to:t})):e instanceof Error?s(e):"string"==typeof(i=e)||i&&"object"==typeof i?s(S(2,{from:t,to:e})):(a&&r.enterCallbacks[o]===a&&"function"==typeof e&&a.push(e),c())},l=e.call(r&&r.instances[o],t,n,i);let u=Promise.resolve(l);e.length<3&&(u=u.then(i)),u.catch((e=>s(e)))}))}function Re(e,t,n,o){const a=[];for(const s of e)for(const e in s.components){let i=s.components[e];if("beforeRouteEnter"===t||s.instances[e])if("object"==typeof(c=i)||"displayName"in c||"props"in c||"__vccOpts"in c){const r=(i.__vccOpts||i)[t];r&&a.push(Ee(r,n,o,s,e))}else{let c=i();a.push((()=>c.then((a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${s.path}"`));const c=r(a)?a.default:a;s.components[e]=c;const i=(c.__vccOpts||c)[t];return i&&Ee(i,n,o,s,e)()}))))}}var c;return a}function Oe(e){const n=t.inject(ge),r=t.inject(ve),o=t.computed((()=>n.resolve(t.unref(e.to)))),a=t.computed((()=>{const{matched:e}=o.value,{length:t}=e,n=e[t-1],a=r.matched;if(!n||!a.length)return-1;const c=a.findIndex(u.bind(null,n));if(c>-1)return c;const s=Ae(e[t-2]);return t>1&&Ae(n)===s&&a[a.length-1].path!==s?a.findIndex(u.bind(null,e[t-2])):c})),s=t.computed((()=>a.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(!Array.isArray(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(r.params,o.value.params))),i=t.computed((()=>a.value>-1&&a.value===r.matched.length-1&&f(r.params,o.value.params)));return{route:o,href:t.computed((()=>o.value.href)),isActive:s,isExactActive:i,navigate:function(r={}){return 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)?n[t.unref(e.replace)?"replace":"push"](t.unref(e.to)).catch(c):Promise.resolve()}}}const ke=t.defineComponent({name:"RouterLink",props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Oe,setup(e,{slots:n}){const r=t.reactive(Oe(e)),{options:o}=t.inject(ge),a=t.computed((()=>({[Pe(e.activeClass,o.linkActiveClass,"router-link-active")]:r.isActive,[Pe(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive})));return()=>{const o=n.default&&n.default(r);return e.custom?o:t.h("a",{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},o)}}});function Ae(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Pe=(e,t,n)=>null!=e?e:null!=t?t:n;function je(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Ce=t.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:n,slots:r}){const a=t.inject(ye),c=t.computed((()=>e.route||a.value)),s=t.inject(me,0),i=t.computed((()=>{let e=t.unref(s);const{matched:n}=c.value;let r;for(;(r=n[e])&&!r.components;)e++;return e})),l=t.computed((()=>c.value.matched[i.value]));t.provide(me,t.computed((()=>i.value+1))),t.provide(de,l),t.provide(ye,c);const f=t.ref();return t.watch((()=>[f.value,l.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||o&&u(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const a=c.value,s=l.value,i=s&&s.components[e.name],u=e.name;if(!i)return je(r.default,{Component:i,route:a});const p=s.props[e.name],h=p?!0===p?a.params:"function"==typeof p?p(a):p:null,d=t.h(i,o({},h,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(s.instances[u]=null)},ref:f}));return je(r.default,{Component:d,route:a})||d}}});function xe(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}return e.RouterLink=ke,e.RouterView=Ce,e.START_LOCATION=C,e.createMemoryHistory=function(e=""){let t=[],n=[""],r=0;function o(e){r++,r===n.length||n.splice(r),n.push(e)}const a={location:"",state:{},base:e=g(e),createHref:y.bind(null,e),replace(e){n.splice(r--,1),o(e)},push(e,t){o(e)},listen:e=>(t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}),destroy(){t=[],n=[""],r=0},go(e,o=!0){const a=this.location,c=e<0?m.back:m.forward;r=Math.max(0,Math.min(r+e,n.length-1)),o&&function(e,n,{direction:r,delta:o}){const a={direction:r,delta:o,type:d.pop};for(const r of t)r(e,n,a)}(this.location,a,{direction:c,delta:e})}};return Object.defineProperty(a,"location",{enumerable:!0,get:()=>n[r]}),a},e.createRouter=function(e){const r=K(e.routes,e),s=e.parseQuery||fe,l=e.stringifyQuery||pe,p=e.history,h=be(),m=be(),g=be(),v=t.shallowRef(C);let y=C;n&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const O=a.bind(null,(e=>""+e)),k=a.bind(null,le),A=a.bind(null,ue);function P(e,t){if(t=o({},t||v.value),"string"==typeof e){const n=i(s,e,t.path),a=r.resolve({path:n.path},t),c=p.createHref(n.fullPath);return o(n,a,{params:A(a.params),hash:ue(n.hash),redirectedFrom:void 0,href:c})}let n;if("path"in e)n=o({},e,{path:i(s,e.path,t.path).path});else{const r=o({},e.params);for(const e in r)null==r[e]&&delete r[e];n=o({},e,{params:k(e.params)}),t.params=k(t.params)}const a=r.resolve(n,t),c=e.hash||"";a.params=O(A(a.params));const u=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(l,o({},e,{hash:(f=c,se(f).replace(re,"{").replace(ae,"}").replace(te,"^")),path:a.path}));var f;const h=p.createHref(u);return o({fullPath:u,hash:c,query:l===pe?he(e.query):e.query||{}},a,{redirectedFrom:void 0,href:h})}function x(e){return"string"==typeof e?i(s,e,v.value.path):o({},e)}function $(e,t){if(y!==e)return S(8,{from:t,to:e})}function q(e){return B(e)}function M(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=x(r):{path:r},r.params={}),o({query:e.query,hash:e.hash,params:e.params},r)}}function B(e,t){const n=y=P(e),r=v.value,a=e.state,c=e.force,s=!0===e.replace,i=M(n);if(i)return B(o(x(i),{state:a,force:c,replace:s}),t||n);const p=n;let h;return p.redirectedFrom=t,!c&&function(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&u(t.matched[r],n.matched[o])&&f(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(l,r,n)&&(h=S(16,{to:p,from:r}),z(r,r,!0,!1)),(h?Promise.resolve(h):_(p,r)).catch((e=>L(e)?L(e,2)?e:N(e):W(e,p,r))).then((e=>{if(e){if(L(e,2))return B(o(x(e.to),{state:a,force:c,replace:s}),t||p)}else e=F(p,r,!0,s,a);return G(p,r,e),e}))}function T(e,t){const n=$(e,t);return n?Promise.reject(n):Promise.resolve()}function _(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 c=0;c<a;c++){const a=t.matched[c];a&&(e.matched.find((e=>u(e,a)))?r.push(a):n.push(a));const s=e.matched[c];s&&(t.matched.find((e=>u(e,s)))||o.push(s))}return[n,r,o]}(e,t);n=Re(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Ee(r,e,t))}));const c=T.bind(null,e,t);return n.push(c),xe(n).then((()=>{n=[];for(const r of h.list())n.push(Ee(r,e,t));return n.push(c),xe(n)})).then((()=>{n=Re(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Ee(r,e,t))}));return n.push(c),xe(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&!t.matched.includes(r))if(Array.isArray(r.beforeEnter))for(const o of r.beforeEnter)n.push(Ee(o,e,t));else n.push(Ee(r.beforeEnter,e,t));return n.push(c),xe(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=Re(a,"beforeRouteEnter",e,t),n.push(c),xe(n)))).then((()=>{n=[];for(const r of m.list())n.push(Ee(r,e,t));return n.push(c),xe(n)})).catch((e=>L(e,8)?e:Promise.reject(e)))}function G(e,t,n){for(const r of g.list())r(e,t,n)}function F(e,t,r,a,c){const s=$(e,t);if(s)return s;const i=t===C,l=n?history.state:{};r&&(a||i?p.replace(e.fullPath,o({scroll:i&&l&&l.scroll},c)):p.push(e.fullPath,c)),v.value=e,z(e,t,r,i),N()}let I;function U(){I||(I=p.listen(((e,t,r)=>{if(!Z.listening)return;const a=P(e),s=M(a);if(s)return void B(o(s,{replace:!0}),a).catch(c);y=a;const i=v.value;var l,u;n&&(l=E(i.fullPath,r.delta),u=b(),R.set(l,u)),_(a,i).catch((e=>L(e,12)?e:L(e,2)?(B(e.to,a).then((e=>{L(e,20)&&!r.delta&&r.type===d.pop&&p.go(-1,!1)})).catch(c),Promise.reject()):(r.delta&&p.go(-r.delta,!1),W(e,a,i)))).then((e=>{(e=e||F(a,i,!1))&&(r.delta?p.go(-r.delta,!1):r.type===d.pop&&L(e,20)&&p.go(-1,!1)),G(a,i,e)})).catch(c)})))}let V,D=be(),H=be();function W(e,t,n){N(e);const r=H.list();return r.length?r.forEach((r=>r(e,t,n))):console.error(e),Promise.reject(e)}function N(e){return V||(V=!e,U(),D.list().forEach((([t,n])=>e?n(e):t())),D.reset()),e}function z(r,o,a,c){const{scrollBehavior:s}=e;if(!n||!s)return Promise.resolve();const i=!a&&function(e){const t=R.get(e);return R.delete(e),t}(E(r.fullPath,0))||(c||!a)&&history.state&&history.state.scroll||null;return t.nextTick().then((()=>s(r,o,i))).then((e=>e&&w(e))).catch((e=>W(e,r,o)))}const Q=e=>p.go(e);let X;const Y=new Set,Z={currentRoute:v,listening:!0,addRoute:function(e,t){let n,o;return j(e)?(n=r.getRecordMatcher(e),o=t):o=e,r.addRoute(o,n)},removeRoute:function(e){const t=r.getRecordMatcher(e);t&&r.removeRoute(t)},hasRoute:function(e){return!!r.getRecordMatcher(e)},getRoutes:function(){return r.getRoutes().map((e=>e.record))},resolve:P,options:e,push:q,replace:function(e){return q(o(x(e),{replace:!0}))},go:Q,back:()=>Q(-1),forward:()=>Q(1),beforeEach:h.add,beforeResolve:m.add,afterEach:g.add,onError:H.add,isReady:function(){return V&&v.value!==C?Promise.resolve():new Promise(((e,t)=>{D.add([e,t])}))},install(e){e.component("RouterLink",ke),e.component("RouterView",Ce),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>t.unref(v)}),n&&!X&&v.value===C&&(X=!0,q(p.location).catch((e=>{})));const r={};for(const e in C)r[e]=t.computed((()=>v.value[e]));e.provide(ge,this),e.provide(ve,t.reactive(r)),e.provide(ye,v);const o=e.unmount;Y.add(e),e.unmount=function(){Y.delete(e),Y.size<1&&(y=C,I&&I(),I=null,v.value=C,X=!1,V=!1),o()}}};return Z},e.createRouterMatcher=K,e.createWebHashHistory=function(e){return(e=location.host?e||location.pathname+location.search:"").includes("#")||(e+="#"),P(e)},e.createWebHistory=P,e.isNavigationFailure=L,e.loadRouteLocation=function(e){return e.matched.every((e=>e.redirect))?Promise.reject(new Error("Cannot load a route that redirects.")):Promise.all(e.matched.map((e=>e.components&&Promise.all(Object.keys(e.components).reduce(((t,n)=>{const o=e.components[n];return"function"!=typeof o||"displayName"in o||t.push(o().then((t=>{if(!t)return Promise.reject(new Error(`Couldn't resolve component "${n}" at "${e.path}". Ensure you passed a function that returns a promise.`));const o=r(t)?t.default:t;e.components[n]=o}))),t}),[]))))).then((()=>e))},e.matchedRouteKey=de,e.onBeforeRouteLeave=function(e){const n=t.inject(de,{}).value;n&&we(n,"leaveGuards",e)},e.onBeforeRouteUpdate=function(e){const n=t.inject(de,{}).value;n&&we(n,"updateGuards",e)},e.parseQuery=fe,e.routeLocationKey=ve,e.routerKey=ge,e.routerViewLocationKey=ye,e.stringifyQuery=pe,e.useLink=Oe,e.useRoute=function(){return t.inject(ve)},e.useRouter=function(){return t.inject(ge)},e.viewDepthKey=me,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
{
"name": "vue-router",
"version": "4.0.15",
"version": "4.1.0-aabe509",
"main": "dist/vue-router.cjs.js",

@@ -32,3 +32,3 @@ "unpkg": "dist/vue-router.global.js",

"build": "rollup -c rollup.config.js",
"build:dts": "api-extractor run --local --verbose && tail -n +7 src/globalExtensions.ts >> dist/vue-router.d.ts",
"build:dts": "api-extractor run --local --verbose && tail -n +9 src/globalExtensions.ts >> dist/vue-router.d.ts",
"build:playground": "vue-tsc --noEmit && vite build --config playground/vite.config.js",

@@ -74,3 +74,3 @@ "build:e2e": "vue-tsc --noEmit && vite build --config e2e/vite.config.js",

"dependencies": {
"@vue/devtools-api": "^6.0.0"
"@vue/devtools-api": "^6.1.4"
},

@@ -77,0 +77,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc