Socket
Socket
Sign inDemoInstall

vue-router

Package Overview
Dependencies
1
Maintainers
2
Versions
180
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.0-aabe509 to 4.1.0-beta.0

dist/vue-router.cjs

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [4.0.16](https://github.com/vuejs/router/compare/v4.0.15...v4.0.16) (2022-06-09)
### Bug Fixes
- **compat:** force router-link mode to Vue 3 ([#1426](https://github.com/vuejs/router/issues/1426)) ([0478512](https://github.com/vuejs/router/commit/047851299c4c438cc977f6d5d7da455eb69195db))
- **matcher:** leave catchall routes at the end ([77f0998](https://github.com/vuejs/router/commit/77f099835a237e5b996ff4af19d1488b49990c38)), closes [#1435](https://github.com/vuejs/router/issues/1435)
## [4.0.15](https://github.com/vuejs/router/compare/v4.0.14...v4.0.15) (2022-05-04)

@@ -2,0 +9,0 @@

318

dist/vue-router.d.ts

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

import { DefineComponent } from 'vue';
import { InjectionKey } from 'vue';
import type { InjectionKey } from 'vue';
import { Ref } from 'vue';

@@ -18,26 +18,2 @@ import { UnwrapRef } 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.

@@ -56,3 +32,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 extends RouterOptions>(options: Options): Router<Options>;
export declare function createRouter(options: RouterOptions): Router;

@@ -69,11 +45,9 @@ /**

/**
* Creates a hash history. Useful for web applications with no host (e.g.
* `file://`) or when configuring a server to handle any URL is not possible.
* Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
* handle any URL is not possible.
*
* @param base - optional base to provide. Defaults to `location.pathname +
* location.search` If there is a `<base>` tag in the `head`, its value will be
* ignored in favor of this parameter **but note it affects all the
* history.pushState() calls**, meaning that if you use a `<base>` tag, it's
* `href` value **has to match this parameter** (ignoring anything after the
* `#`).
* @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
* in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
* calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
* after the `#`).
*

@@ -115,5 +89,8 @@ * @example

/**
* Flags so we can combine them when checking for multiple errors
* Flags so we can combine them when checking for multiple errors. This is the internal version of
* {@link NavigationFailureType}.
*
* @internal
*/
declare const enum ErrorTypes {
export declare const enum ErrorTypes {
MATCHER_NOT_FOUND = 1,

@@ -126,16 +103,2 @@ NAVIGATION_GUARD_REDIRECT = 2,

/**
* 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;

@@ -151,2 +114,7 @@

/**
* Allowed arrays for history.state.
*
* @internal
*/
declare interface HistoryStateArray extends Array<HistoryStateValue> {

@@ -156,3 +124,7 @@ }

/**
* Allowed variables in HTML5 history state
* Allowed variables in HTML5 history state. Note that pushState clones the state
* passed and does not accept everything: e.g it doesn't accept symbols, nor
* functions as values. It also ignores Symbols as keys.
*
* @internal
*/

@@ -190,9 +162,2 @@ declare type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;

/**
* 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>;

@@ -210,27 +175,8 @@

*/
declare interface LocationAsName {
name: RouteRecordName;
params?: RouteParams;
export declare interface LocationAsRelativeRaw {
name?: string;
params?: RouteParamsRaw;
}
/**
* @internal
*/
export declare interface LocationAsPath {
path: string;
}
declare interface LocationAsRelative<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric, Name extends keyof RouteMap = keyof RouteMap> {
params?: RouteNamedMapGeneric extends RouteMap ? RouteParams : RouteMap[Name]['params'];
}
/**
* @internal
*/
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'];
}
/**
* Normalized query object that appears in {@link RouteLocationNormalized}

@@ -240,3 +186,3 @@ *

*/
export declare type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
export declare type LocationQuery = Record<string, LocationQueryValue | readonly LocationQueryValue[]>;

@@ -250,3 +196,3 @@ /**

*/
export declare type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | LocationQueryValueRaw[]>;
export declare type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | readonly LocationQueryValueRaw[]>;

@@ -284,2 +230,5 @@ /**

/**
* Normalized/resolved Route location that returned by the matcher.
*/
declare interface MatcherLocation {

@@ -310,11 +259,29 @@ /**

declare type MatcherLocationRaw = LocationAsPath | LocationAsName | LocationAsRelative;
/**
* @internal
*/
declare interface MatcherLocationAsName {
name: RouteRecordName;
params?: RouteParams;
}
/**
* 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;
export declare interface MatcherLocationAsPath<P extends string = string> {
path: P;
}
/**
* @internal
*/
declare interface MatcherLocationAsRelative {
params?: RouteParams;
}
/**
* Route location that can be passed to the matcher.
*/
declare type MatcherLocationRaw = MatcherLocationAsPath | MatcherLocationAsName | MatcherLocationAsRelative;
declare interface NavigationCallback {

@@ -407,3 +374,8 @@ (to: HistoryLocation, from: HistoryLocation, information: NavigationInformation): void;

declare interface NavigationRedirectError extends Omit<NavigationFailure, 'to' | 'type'> {
/**
* Internal error used to detect a redirection.
*
* @internal
*/
export declare interface NavigationRedirectError extends Omit<NavigationFailure, 'to' | 'type'> {
type: ErrorTypes.NAVIGATION_GUARD_REDIRECT;

@@ -437,70 +409,2 @@ to: RouteLocationRaw;

/**
* 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

@@ -590,20 +494,2 @@ * version with the leading `?` and without Should work as URLSearchParams

/**
* 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}

@@ -664,7 +550,8 @@ */

/**
* Route Location that can infer the necessary params based on the name
* 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;
export declare interface RouteLocationNamedRaw extends RouteQueryAndHash, LocationAsRelativeRaw, RouteLocationOptions {
}

@@ -695,2 +582,5 @@ /**

/**
* Common options for all navigation methods.
*/
export declare interface RouteLocationOptions {

@@ -702,3 +592,5 @@ /**

/**
* Triggers the navigation even if the location is the same as the current one
* Triggers the navigation even if the location is the same as the current one.
* Note this will also add a new entry to the history unless `replace: true`
* is passed.
*/

@@ -714,3 +606,9 @@ force?: boolean;

declare type RouteLocationPathRaw = RouteQueryAndHash & LocationAsPath & RouteLocationOptions;
/**
* Route Location that can infer the possible paths.
*
* @internal
*/
export declare interface RouteLocationPathRaw extends RouteQueryAndHash, MatcherLocationAsPath, RouteLocationOptions {
}

@@ -741,20 +639,2 @@ /**

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 : {};
declare type RouteNamedMapGeneric = Record<string | symbol | number, {
params: RouteParams;
paramsRaw: RouteParamsRaw;
path: string;
}>;
export declare type RouteParams = Record<string, RouteParamValue | readonly RouteParamValue[]>;

@@ -783,5 +663,5 @@

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

@@ -797,3 +677,3 @@ * @internal

*/
readonly options: Options;
readonly options: RouterOptions;
/**

@@ -804,3 +684,3 @@ * Allows turning off the listening of history events. This is a low level api for micro-frontends.

/**
* Add a new {@link RouteRecordRaw route record} as the child of an existing route.
* Add a new {@link RouteRecordRaw | route record} as the child of an existing route.
*

@@ -812,3 +692,3 @@ * @param parentName - Parent Route Record where `route` should be appended at

/**
* Add a new {@link RouteRecordRaw route record} to the router.
* Add a new {@link RouteRecordRaw | route record} to the router.
*

@@ -831,8 +711,8 @@ * @param route - Route Record to add

/**
* Get a full list of all the {@link RouteRecord route records}.
* Get a full list of all the {@link RouteRecord | route records}.
*/
getRoutes(): RouteRecord[];
/**
* Returns the {@link RouteLocation normalized version} of a
* {@link RouteLocationRaw route location}. Also includes an `href` property
* Returns the {@link RouteLocation | normalized version} of a
* {@link RouteLocationRaw | route location}. Also includes an `href` property
* that includes any existing `base`. By default the `currentLocation` used is

@@ -853,3 +733,3 @@ * `route.currentRoute` and should only be overridden in advanced use cases.

*/
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>;
push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
/**

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

*/
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>;
replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
/**

@@ -944,3 +824,3 @@ * Go back in history if possible by calling `history.back()`. Equivalent to

* Called automatically by `app.use(router)`. Should not be called manually by
* the user.
* the user. This will trigger the initial navigation when on client side.
*

@@ -1045,3 +925,3 @@ * @internal

/**
* Normalized version of a {@link RouteRecord route record}
* Normalized version of a {@link RouteRecord | route record}.
*/

@@ -1254,3 +1134,3 @@ export declare interface RouteRecordNormalized {

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

@@ -1260,3 +1140,11 @@ /**

*/
export declare const RouterLink: {
export declare const RouterLink: _RouterLinkI;
/**
* Typed version of the `RouterLink` component. Its generic defaults to the typed router so it can be inferred
* automatically for JSX.
*
* @internal
*/
export declare interface _RouterLinkI {
new (): {

@@ -1274,3 +1162,3 @@ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterLinkProps;

useLink: typeof useLink;
};
}

@@ -1281,3 +1169,3 @@ declare interface RouterLinkOptions {

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

@@ -1373,3 +1261,3 @@ * Calls `router.replace` instead of `router.push`.

* @example
* Let's say you want to use the package {@link https://github.com/ljharb/qs | qs}
* Let's say you want to use the [qs package](https://github.com/ljharb/qs)
* to parse queries, you can provide both `parseQuery` and `stringifyQuery`:

@@ -1416,4 +1304,2 @@ * ```js

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

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

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

@@ -1606,3 +1492,3 @@ /**

*/
$router: RouterTyped
$router: Router
}

@@ -1609,0 +1495,0 @@

/*!
* vue-router v4.0.15
* vue-router v4.0.16
* (c) 2022 Eduardo San Martin Morote
* @license MIT
*/
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);
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]=s(o)?o.map(e):e(o)}return n}const c=()=>{},s=Array.isArray,i=/\/$/;function l(e,t,n="/"){let r,o={},a="",c="";const s=t.indexOf("#");let i=t.indexOf("?");return s<i&&s>=0&&(i=-1),i>-1&&(r=t.slice(0,i),a=t.slice(i+1,s>-1?s:t.length),o=e(a)),s>-1&&(r=r||t.slice(0,s),c=t.slice(s,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],"."!==a){if(".."!==a)break;c>1&&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 u(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function f(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function p(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!h(e[n],t[n]))return!1;return!0}function h(e,t){return s(e)?d(e,t):s(t)?d(t,e):e===t}function d(e,t){return s(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var m,g;!function(e){e.pop="pop",e.push="push"}(m||(m={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(g||(g={}));function v(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(i,"")}const y=/^[^#]+#/;function b(e,t){return e.replace(y,"#")+t}const w=()=>({left:window.pageXOffset,top:window.pageYOffset});function E(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 R(e,t){return(history.state?history.state.position-t:-1)+e}const O=new Map;let k=()=>location.protocol+"//"+location.host;function P(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),u(n,"")}return u(n,e)+r+o}function j(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?w():null}}function C(e){const t=function(e){const{history:t,location:n}=window,r={value:P(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:k()+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:w()});c(s.current,s,!0),c(e,o({},j(r.value,e,null),{position:s.position+1},n),!1),r.value=e},replace:function(e,n){c(e,o({},t.state,j(a.value.back,e,a.value.forward,!0),n,{position:a.value.position}),!0),r.value=e}}}(e=v(e)),n=function(e,t,n,r){let a=[],c=[],s=null;const i=({state:o})=>{const c=P(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:m.pop,direction:u?u>0?g.forward:g.back:g.unknown})}))};function l(){const{history:e}=window;e.state&&e.replaceState(o({},e.state,{scroll:w()}),"")}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:b.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 x(e){return"string"==typeof e||"symbol"==typeof e}const $={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},S=Symbol("");var A;function L(e,t){return o(new Error,{type:e,[S]:!0},t)}function M(e,t){return e instanceof Error&&S in e&&(null==t||!!(e.type&t))}e.NavigationFailureType=void 0,(A=e.NavigationFailureType||(e.NavigationFailureType={}))[A.aborted=4]="aborted",A[A.cancelled=8]="cancelled",A[A.duplicated=16]="duplicated";const q="[^/]+?",B={sensitive:!1,strict:!1,start:!0,end:!0},T=/[.+*?^${}()[\]/\\]/g;function _(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 G(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=_(r[n],o[n]);if(e)return e;n++}if(1===Math.abs(o.length-r.length)){if(F(r))return 1;if(F(o))return-1}return o.length-r.length}function F(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const D={type:0,value:""},I=/[a-zA-Z0-9_]/;function K(e,t,n){const r=function(e,t){const n=o({},B,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(T,"\\$&"),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 i=new RegExp(a,n.sensitive?"":"i");return{re:i,score:r,keys:c,parse:function(e){const t=e.match(i),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:i,optional:l}=a,u=c in t?t[c]:"";if(s(u)&&!i)throw new Error(`Provided param "${c}" is an array but it is not repeatable (* or + modifiers)`);const f=s(u)?u.join("/"):u;if(!f){if(!l)throw new Error(`Missing required param "${c}"`);o.length<2&&e.length>1&&(n.endsWith("/")?n=n.slice(0,-1):r=!0)}n+=f}}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:I.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 U(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:V(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=N(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=K(t,n,f),r?r.alias.push(h):(d=d||h,d!==h&&d.alias.push(h),l&&e.name&&!H(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(x(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&&G(e,n[t])>=0&&(e.record.path!==n[t].record.path||!z(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!H(e)&&r.set(e.record.name,e)}return t=N({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 L(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 L(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:W(l)}},removeRoute:s,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function V(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 H(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function W(e){return e.reduce(((e,t)=>o(e,t.meta)),{})}function N(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 Q=/#/g,X=/&/g,Y=/\//g,Z=/=/g,J=/\?/g,ee=/\+/g,te=/%5B/g,ne=/%5D/g,re=/%5E/g,oe=/%60/g,ae=/%7B/g,ce=/%7C/g,se=/%7D/g,ie=/%20/g;function le(e){return encodeURI(""+e).replace(ce,"|").replace(te,"[").replace(ne,"]")}function ue(e){return le(e).replace(ee,"%2B").replace(ie,"+").replace(Q,"%23").replace(X,"%26").replace(oe,"`").replace(ae,"{").replace(se,"}").replace(re,"^")}function fe(e){return null==e?"":function(e){return le(e).replace(Q,"%23").replace(J,"%3F")}(e).replace(Y,"%2F")}function pe(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function he(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(ee," "),o=r.indexOf("="),a=pe(o<0?r:r.slice(0,o)),c=o<0?null:pe(r.slice(o+1));if(a in t){let e=t[a];s(e)||(e=t[a]=[e]),e.push(c)}else t[a]=c}return t}function de(e){let t="";for(let n in e){const r=e[n];if(n=ue(n).replace(Z,"%3D"),null==r){void 0!==r&&(t+=(t.length?"&":"")+n);continue}(s(r)?r.map((e=>e&&ue(e))):[r&&ue(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function me(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=s(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}const ge=Symbol(""),ve=Symbol(""),ye=Symbol(""),be=Symbol(""),we=Symbol("");function Ee(){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 Re(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 Oe(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(L(4,{from:n,to:t})):e instanceof Error?s(e):"string"==typeof(i=e)||i&&"object"==typeof i?s(L(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 ke(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(Oe(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&&Oe(i,n,o,s,e)()}))))}}var c;return a}function Pe(e){const n=t.inject(ye),r=t.inject(be),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(f.bind(null,n));if(c>-1)return c;const s=Ce(e[t-2]);return t>1&&Ce(n)===s&&a[a.length-1].path!==s?a.findIndex(f.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(!s(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&&p(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(c):Promise.resolve()}}}const je=t.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"}},useLink:Pe,setup(e,{slots:n}){const r=t.reactive(Pe(e)),{options:o}=t.inject(ye),a=t.computed((()=>({[xe(e.activeClass,o.linkActiveClass,"router-link-active")]:r.isActive,[xe(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 Ce(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const xe=(e,t,n)=>null!=e?e:null!=t?t:n;function $e(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Se=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(we),c=t.computed((()=>e.route||a.value)),s=t.inject(ve,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(ve,t.computed((()=>i.value+1))),t.provide(ge,l),t.provide(we,c);const u=t.ref();return t.watch((()=>[u.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&&f(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],f=e.name;if(!i)return $e(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[f]=null)},ref:u}));return $e(r.default,{Component:d,route:a})||d}}});function Ae(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}return e.RouterLink=je,e.RouterView=Se,e.START_LOCATION=$,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=v(e),createHref:b.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?g.back:g.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:m.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=U(e.routes,e),i=e.parseQuery||he,u=e.stringifyQuery||de,h=e.history,d=Ee(),g=Ee(),v=Ee(),y=t.shallowRef($);let b=$;n&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const k=a.bind(null,(e=>""+e)),P=a.bind(null,fe),j=a.bind(null,pe);function C(e,t){if(t=o({},t||y.value),"string"==typeof e){const n=l(i,e,t.path),a=r.resolve({path:n.path},t),c=h.createHref(n.fullPath);return o(n,a,{params:j(a.params),hash:pe(n.hash),redirectedFrom:void 0,href:c})}let n;if("path"in e)n=o({},e,{path:l(i,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:P(e.params)}),t.params=P(t.params)}const a=r.resolve(n,t),c=e.hash||"";a.params=k(j(a.params));const s=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(u,o({},e,{hash:(f=c,le(f).replace(ae,"{").replace(se,"}").replace(re,"^")),path:a.path}));var f;const p=h.createHref(s);return o({fullPath:s,hash:c,query:u===de?me(e.query):e.query||{}},a,{redirectedFrom:void 0,href:p})}function S(e){return"string"==typeof e?l(i,e,y.value.path):o({},e)}function A(e,t){if(b!==e)return L(8,{from:t,to:e})}function q(e){return T(e)}function B(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=S(r):{path:r},r.params={}),o({query:e.query,hash:e.hash,params:"path"in r?{}:e.params},r)}}function T(e,t){const n=b=C(e),r=y.value,a=e.state,c=e.force,s=!0===e.replace,i=B(n);if(i)return T(o(S(i),{state:a,force:c,replace:s}),t||n);const l=n;let h;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&&f(t.matched[r],n.matched[o])&&p(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(u,r,n)&&(h=L(16,{to:l,from:r}),Q(r,r,!0,!1)),(h?Promise.resolve(h):G(l,r)).catch((e=>M(e)?M(e,2)?e:z(e):N(e,l,r))).then((e=>{if(e){if(M(e,2))return T(o(S(e.to),{state:a,force:c,replace:s}),t||l)}else e=D(l,r,!0,s,a);return F(l,r,e),e}))}function _(e,t){const n=A(e,t);return n?Promise.reject(n):Promise.resolve()}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 c=0;c<a;c++){const a=t.matched[c];a&&(e.matched.find((e=>f(e,a)))?r.push(a):n.push(a));const s=e.matched[c];s&&(t.matched.find((e=>f(e,s)))||o.push(s))}return[n,r,o]}(e,t);n=ke(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Oe(r,e,t))}));const c=_.bind(null,e,t);return n.push(c),Ae(n).then((()=>{n=[];for(const r of d.list())n.push(Oe(r,e,t));return n.push(c),Ae(n)})).then((()=>{n=ke(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Oe(r,e,t))}));return n.push(c),Ae(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&!t.matched.includes(r))if(s(r.beforeEnter))for(const o of r.beforeEnter)n.push(Oe(o,e,t));else n.push(Oe(r.beforeEnter,e,t));return n.push(c),Ae(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=ke(a,"beforeRouteEnter",e,t),n.push(c),Ae(n)))).then((()=>{n=[];for(const r of g.list())n.push(Oe(r,e,t));return n.push(c),Ae(n)})).catch((e=>M(e,8)?e:Promise.reject(e)))}function F(e,t,n){for(const r of v.list())r(e,t,n)}function D(e,t,r,a,c){const s=A(e,t);if(s)return s;const i=t===$,l=n?history.state:{};r&&(a||i?h.replace(e.fullPath,o({scroll:i&&l&&l.scroll},c)):h.push(e.fullPath,c)),y.value=e,Q(e,t,r,i),z()}let I;function K(){I||(I=h.listen(((e,t,r)=>{if(!J.listening)return;const a=C(e),s=B(a);if(s)return void T(o(s,{replace:!0}),a).catch(c);b=a;const i=y.value;var l,u;n&&(l=R(i.fullPath,r.delta),u=w(),O.set(l,u)),G(a,i).catch((e=>M(e,12)?e:M(e,2)?(T(e.to,a).then((e=>{M(e,20)&&!r.delta&&r.type===m.pop&&h.go(-1,!1)})).catch(c),Promise.reject()):(r.delta&&h.go(-r.delta,!1),N(e,a,i)))).then((e=>{(e=e||D(a,i,!1))&&(r.delta?h.go(-r.delta,!1):r.type===m.pop&&M(e,20)&&h.go(-1,!1)),F(a,i,e)})).catch(c)})))}let V,H=Ee(),W=Ee();function N(e,t,n){z(e);const r=W.list();return r.length?r.forEach((r=>r(e,t,n))):console.error(e),Promise.reject(e)}function z(e){return V||(V=!e,K(),H.list().forEach((([t,n])=>e?n(e):t())),H.reset()),e}function Q(r,o,a,c){const{scrollBehavior:s}=e;if(!n||!s)return Promise.resolve();const i=!a&&function(e){const t=O.get(e);return O.delete(e),t}(R(r.fullPath,0))||(c||!a)&&history.state&&history.state.scroll||null;return t.nextTick().then((()=>s(r,o,i))).then((e=>e&&E(e))).catch((e=>N(e,r,o)))}const X=e=>h.go(e);let Y;const Z=new Set,J={currentRoute:y,listening:!0,addRoute:function(e,t){let n,o;return x(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:C,options:e,push:q,replace:function(e){return q(o(S(e),{replace:!0}))},go:X,back:()=>X(-1),forward:()=>X(1),beforeEach:d.add,beforeResolve:g.add,afterEach:v.add,onError:W.add,isReady:function(){return V&&y.value!==$?Promise.resolve():new Promise(((e,t)=>{H.add([e,t])}))},install(e){e.component("RouterLink",je),e.component("RouterView",Se),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>t.unref(y)}),n&&!Y&&y.value===$&&(Y=!0,q(h.location).catch((e=>{})));const r={};for(const e in $)r[e]=t.computed((()=>y.value[e]));e.provide(ye,this),e.provide(be,t.reactive(r)),e.provide(we,y);const o=e.unmount;Z.add(e),e.unmount=function(){Z.delete(e),Z.size<1&&(b=$,I&&I(),I=null,y.value=$,Y=!1,V=!1),o()}}};return J},e.createRouterMatcher=U,e.createWebHashHistory=function(e){return(e=location.host?e||location.pathname+location.search:"").includes("#")||(e+="#"),C(e)},e.createWebHistory=C,e.isNavigationFailure=M,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=ge,e.onBeforeRouteLeave=function(e){const n=t.inject(ge,{}).value;n&&Re(n,"leaveGuards",e)},e.onBeforeRouteUpdate=function(e){const n=t.inject(ge,{}).value;n&&Re(n,"updateGuards",e)},e.parseQuery=he,e.routeLocationKey=be,e.routerKey=ye,e.routerViewLocationKey=we,e.stringifyQuery=de,e.useLink=Pe,e.useRoute=function(){return t.inject(be)},e.useRouter=function(){return t.inject(ye)},e.viewDepthKey=ve,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
{
"name": "vue-router",
"version": "4.1.0-aabe509",
"main": "dist/vue-router.cjs.js",
"version": "4.1.0-beta.0",
"main": "index.js",
"unpkg": "dist/vue-router.global.js",
"jsdelivr": "dist/vue-router.global.js",
"module": "dist/vue-router.esm-bundler.js",
"module": "dist/vue-router.mjs",
"types": "dist/vue-router.d.ts",
"exports": {
".": {
"browser": "./dist/vue-router.esm-browser.js",
"node": {
"import": {
"production": "./dist/vue-router.prod.cjs",
"development": "./dist/vue-router.node.mjs",
"default": "./dist/vue-router.node.mjs"
},
"require": {
"production": "./dist/vue-router.prod.cjs",
"development": "./dist/vue-router.cjs",
"default": "./index.js"
}
},
"import": "./dist/vue-router.mjs"
},
"./dist/*": "./dist/*",
"./vetur/*": "./vetur/*",
"./package.json": "./package.json"
},
"sideEffects": false,

@@ -21,3 +42,4 @@ "funding": "https://github.com/sponsors/posva",

"files": [
"dist/*.js",
"index.js",
"dist/*.{js,cjs,mjs}",
"dist/vue-router.d.ts",

@@ -30,38 +52,20 @@ "vetur/tags.json",

"dev": "vite --config playground/vite.config.js",
"release": "bash scripts/release.sh",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
"build": "rollup -c rollup.config.js",
"build": "rimraf dist && rollup -c rollup.config.js",
"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",
"build:e2e": "vue-tsc --noEmit && vite build --config e2e/vite.config.js",
"build:size": "yarn run build && rollup -c size-checks/rollup.config.js",
"build:size": "pnpm run build && rollup -c size-checks/rollup.config.js",
"dev:e2e": "vite --config e2e/vite.config.js",
"docs": "vitepress dev docs",
"docs:build": "vitepress build docs",
"lint": "yarn run lint:script && yarn run lint:html",
"lint:script": "prettier -c --parser typescript \"{src,__tests__,e2e,playground}/**/*.[jt]s?(x)\"",
"lint:html": "prettier -c --parser html \"{playground,e2e}/**/*.html\"",
"lint:fix": "yarn run lint:script --write && yarn run lint:html --write",
"test:types": "tsc --build tsconfig.json",
"test:dts": "tsc -p ./test-dts/tsconfig.json",
"test:unit": "jest --coverage",
"test": "yarn run test:types && yarn run test:unit && yarn run build && yarn run build:dts && yarn run test:e2e",
"test:e2e": "yarn run test:e2e:headless && yarn run test:e2e:native",
"test:e2e:headless": "node e2e/runner.js -e chrome-headless --skiptags no-headless",
"test:e2e:native": "node e2e/runner.js -e chrome --tag no-headless",
"test:e2e:ci": "node e2e/runner.js -e firefox --retries 2",
"test:e2e:bs": "node e2e/runner.js --local -e edge_pre_chrome,android44 -c e2e/nightwatch.browserstack.js --tag browserstack"
"test": "pnpm run test:types && pnpm run test:unit && pnpm run build && pnpm run build:dts && pnpm run test:e2e",
"test:e2e": "pnpm run test:e2e:headless",
"test:e2e:headless": "node e2e/runner.js --env chrome-headless",
"test:e2e:native": "node e2e/runner.js --env chrome",
"test:e2e:ci": "node e2e/runner.js --env chrome-headless --retries 2",
"test:e2e:bs": "node e2e/runner.js --local -e android5 --tag browserstack",
"test:e2e:bs-test": "node e2e/runner.js --local --env browserstack.local_chrome --tag browserstack"
},
"gitHooks": {
"pre-commit": "lint-staged",
"commit-msg": "node scripts/verifyCommit.js"
},
"lint-staged": {
"*.js": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
},
"peerDependencies": {

@@ -80,3 +84,3 @@ "vue": "^3.2.0"

"@rollup/plugin-alias": "^3.1.4",
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.0.5",

@@ -87,38 +91,27 @@ "@rollup/plugin-replace": "^4.0.0",

"@types/jsdom": "^16.2.13",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.16.2",
"@vitejs/plugin-vue": "^2.2.2",
"@types/nightwatch": "^2.0.8",
"@vitejs/plugin-vue": "^2.3.3",
"@vue/compiler-sfc": "^3.2.31",
"@vue/server-renderer": "^3.2.31",
"@vue/test-utils": "^2.0.0-rc.3",
"axios": "^0.26.0",
"brotli": "^1.3.2",
"@vue/server-renderer": "^3.2.37",
"@vue/test-utils": "^2.0.0",
"browserstack-local": "^1.4.5",
"chalk": "^4.1.0",
"chromedriver": "^97.0.4",
"chromedriver": "^102.0.0",
"connect-history-api-fallback": "^1.6.0",
"conventional-changelog-cli": "^2.1.1",
"css-loader": "^6.3.0",
"dotenv": "^16.0.0",
"faked-promise": "^2.2.2",
"html-webpack-plugin": "^5.3.2",
"geckodriver": "^3.0.1",
"jest": "^27.5.1",
"jest-mock-warn": "^1.1.0",
"lint-staged": "^12.3.4",
"nightwatch": "^1.7.11",
"nightwatch": "^2.0.0",
"nightwatch-helpers": "^1.2.0",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",
"rollup": "^2.68.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.0",
"selenium-server": "^3.141.59",
"serve-handler": "^6.1.3",
"typescript": "~4.4.3",
"vite": "~2.8.4",
"vitepress": "^0.20.0",
"vue": "^3.2.31",
"vue-tsc": "^0.32.0",
"yorkie": "^2.0.0"
"rollup-plugin-typescript2": "^0.32.1",
"typescript": "~4.7.2",
"vite": "^2.9.9",
"vue": "^3.2.37"
}
}

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc