vue-router
Advanced tools
Comparing version 3.5.4 to 3.6.0
/*! | ||
* vue-router v3.5.4 | ||
* vue-router v3.6.0 | ||
* (c) 2022 Evan You | ||
@@ -7,6 +7,6 @@ * @license MIT | ||
/*! | ||
* vue-router v3.5.4 | ||
* vue-router v3.6.0 | ||
* (c) 2022 Evan You | ||
* @license MIT | ||
*/ | ||
function t(t,e){for(const n in e)t[n]=e[n];return t}const e=/[!'()*]/g,n=t=>"%"+t.charCodeAt(0).toString(16),r=/%2C/g,o=t=>encodeURIComponent(t).replace(e,n).replace(r,",");function i(t){try{return decodeURIComponent(t)}catch(t){}return t}const s=t=>null==t||"object"==typeof t?t:String(t);function a(t){const e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(t=>{const n=t.replace(/\+/g," ").split("="),r=i(n.shift()),o=n.length>0?i(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),e):e}function c(t){const e=t?Object.keys(t).map(e=>{const n=t[e];if(void 0===n)return"";if(null===n)return o(e);if(Array.isArray(n)){const t=[];return n.forEach(n=>{void 0!==n&&(null===n?t.push(o(e)):t.push(o(e)+"="+o(n)))}),t.join("&")}return o(e)+"="+o(n)}).filter(t=>t.length>0).join("&"):null;return e?"?"+e:""}const u=/\/?$/;function h(t,e,n,r){const o=r&&r.options.stringifyQuery;let i=e.query||{};try{i=l(i)}catch(t){}const s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?f(t):[]};return n&&(s.redirectedFrom=d(n,o)),Object.freeze(s)}function l(t){if(Array.isArray(t))return t.map(l);if(t&&"object"==typeof t){const e={};for(const n in t)e[n]=l(t[n]);return e}return t}const p=h(null,{path:"/"});function f(t){const e=[];for(;t;)e.unshift(t),t=t.parent;return e}function d({path:t,query:e={},hash:n=""},r){return(t||"/")+(r||c)(e)+n}function y(t,e,n){return e===p?t===e:!!e&&(t.path&&e.path?t.path.replace(u,"")===e.path.replace(u,"")&&(n||t.hash===e.hash&&m(t.query,e.query)):!(!t.name||!e.name)&&(t.name===e.name&&(n||t.hash===e.hash&&m(t.query,e.query)&&m(t.params,e.params))))}function m(t={},e={}){if(!t||!e)return t===e;const n=Object.keys(t).sort(),r=Object.keys(e).sort();return n.length===r.length&&n.every((n,o)=>{const i=t[n];if(r[o]!==n)return!1;const s=e[n];return null==i||null==s?i===s:"object"==typeof i&&"object"==typeof s?m(i,s):String(i)===String(s)})}function g(t){for(let e=0;e<t.matched.length;e++){const n=t.matched[e];for(const t in n.instances){const e=n.instances[t],r=n.enteredCbs[t];if(e&&r){delete n.enteredCbs[t];for(let t=0;t<r.length;t++)e._isBeingDestroyed||r[t](e)}}}}var w={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render(e,{props:n,children:r,parent:o,data:i}){i.routerView=!0;const s=o.$createElement,a=n.name,c=o.$route,u=o._routerViewCache||(o._routerViewCache={});let h=0,l=!1;for(;o&&o._routerRoot!==o;){const t=o.$vnode?o.$vnode.data:{};t.routerView&&h++,t.keepAlive&&o._directInactive&&o._inactive&&(l=!0),o=o.$parent}if(i.routerViewDepth=h,l){const t=u[a],e=t&&t.component;return e?(t.configProps&&b(e,i,t.route,t.configProps),s(e,i,r)):s()}const p=c.matched[h],f=p&&p.components[a];if(!p||!f)return u[a]=null,s();u[a]={component:f},i.registerRouteInstance=(t,e)=>{const n=p.instances[a];(e&&n!==t||!e&&n===t)&&(p.instances[a]=e)},(i.hook||(i.hook={})).prepatch=(t,e)=>{p.instances[a]=e.componentInstance},i.hook.init=t=>{t.data.keepAlive&&t.componentInstance&&t.componentInstance!==p.instances[a]&&(p.instances[a]=t.componentInstance),g(c)};const d=p.props&&p.props[a];return d&&(t(u[a],{route:c,configProps:d}),b(f,i,c,d)),s(f,i,r)}};function b(e,n,r,o){let i=n.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(r,o);if(i){i=n.props=t({},i);const r=n.attrs=n.attrs||{};for(const t in i)e.props&&t in e.props||(r[t]=i[t],delete i[t])}}function v(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const o=e.split("/");n&&o[o.length-1]||o.pop();const i=t.replace(/^\//,"").split("/");for(let t=0;t<i.length;t++){const e=i[t];".."===e?o.pop():"."!==e&&o.push(e)}return""!==o[0]&&o.unshift(""),o.join("/")}function x(t){return t.replace(/\/(?:\s*\/)+/g,"/")}var R=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},k=B,E=S,C=function(t,e){return T(S(t,e),e)},A=T,$=U,O=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function S(t,e){for(var n,r=[],o=0,i=0,s="",a=e&&e.delimiter||"/";null!=(n=O.exec(t));){var c=n[0],u=n[1],h=n.index;if(s+=t.slice(i,h),i=h+c.length,u)s+=u[1];else{var l=t[i],p=n[2],f=n[3],d=n[4],y=n[5],m=n[6],g=n[7];s&&(r.push(s),s="");var w=null!=p&&null!=l&&l!==p,b="+"===m||"*"===m,v="?"===m||"*"===m,x=n[2]||a,R=d||y;r.push({name:f||o++,prefix:p||"",delimiter:x,optional:v,repeat:b,partial:w,asterisk:!!g,pattern:R?L(R):g?".*":"[^"+P(x)+"]+?"})}}return i<t.length&&(s+=t.substr(i)),s&&r.push(s),r}function j(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function T(t,e){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"==typeof t[r]&&(n[r]=new RegExp("^(?:"+t[r].pattern+")$",q(e)));return function(e,r){for(var o="",i=e||{},s=(r||{}).pretty?j:encodeURIComponent,a=0;a<t.length;a++){var c=t[a];if("string"!=typeof c){var u,h=i[c.name];if(null==h){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(R(h)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var l=0;l<h.length;l++){if(u=s(h[l]),!n[a].test(u))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(u)+"`");o+=(0===l?c.prefix:c.delimiter)+u}}else{if(u=c.asterisk?encodeURI(h).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):s(h),!n[a].test(u))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+u+'"');o+=c.prefix+u}}else o+=c}return o}}function P(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function L(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function _(t,e){return t.keys=e,t}function q(t){return t&&t.sensitive?"":"i"}function U(t,e,n){R(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",s=0;s<t.length;s++){var a=t[s];if("string"==typeof a)i+=P(a);else{var c=P(a.prefix),u="(?:"+a.pattern+")";e.push(a),a.repeat&&(u+="(?:"+c+u+")*"),i+=u=a.optional?a.partial?c+"("+u+")?":"(?:"+c+"("+u+"))?":c+"("+u+")"}}var h=P(n.delimiter||"/"),l=i.slice(-h.length)===h;return r||(i=(l?i.slice(0,-h.length):i)+"(?:"+h+"(?=$))?"),i+=o?"$":r&&l?"":"(?="+h+"|$)",_(new RegExp("^"+i,q(n)),e)}function B(t,e,n){return R(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return _(t,e)}(t,e):R(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(B(t[o],e,n).source);return _(new RegExp("(?:"+r.join("|")+")",q(n)),e)}(t,e,n):function(t,e,n){return U(S(t,n),e,n)}(t,e,n)}k.parse=E,k.compile=C,k.tokensToFunction=A,k.tokensToRegExp=$;const I=Object.create(null);function M(t,e,n){e=e||{};try{const n=I[t]||(I[t]=k.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function V(e,n,r,o){let i="string"==typeof e?{path:e}:e;if(i._normalized)return i;if(i.name){i=t({},e);const n=i.params;return n&&"object"==typeof n&&(i.params=t({},n)),i}if(!i.path&&i.params&&n){i=t({},i),i._normalized=!0;const e=t(t({},n.params),i.params);if(n.name)i.name=n.name,i.params=e;else if(n.matched.length){const t=n.matched[n.matched.length-1].path;i.path=M(t,e,n.path)}return i}const c=function(t){let e="",n="";const r=t.indexOf("#");r>=0&&(e=t.slice(r),t=t.slice(0,r));const o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(i.path||""),u=n&&n.path||"/",h=c.path?v(c.path,u,r||i.append):u,l=function(t,e={},n){const r=n||a;let o;try{o=r(t||"")}catch(t){o={}}for(const t in e){const n=e[t];o[t]=Array.isArray(n)?n.map(s):s(n)}return o}(c.query,i.query,o&&o.options.parseQuery);let p=i.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:h,query:l,hash:p}}const H=()=>{};var N={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render(e){const n=this.$router,r=this.$route,{location:o,route:i,href:s}=n.resolve(this.to,r,this.append),a={},c=n.options.linkActiveClass,l=n.options.linkExactActiveClass,p=null==c?"router-link-active":c,f=null==l?"router-link-exact-active":l,d=null==this.activeClass?p:this.activeClass,m=null==this.exactActiveClass?f:this.exactActiveClass,g=i.redirectedFrom?h(null,V(i.redirectedFrom),null,n):i;a[m]=y(r,g,this.exactPath),a[d]=this.exact||this.exactPath?a[m]:function(t,e){return 0===t.path.replace(u,"/").indexOf(e.path.replace(u,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(const n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,g);const w=a[m]?this.ariaCurrentValue:null,b=t=>{F(t)&&(this.replace?n.replace(o,H):n.push(o,H))},v={click:F};Array.isArray(this.event)?this.event.forEach(t=>{v[t]=b}):v[this.event]=b;const x={class:a},R=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:i,navigate:b,isActive:a[d],isExactActive:a[m]});if(R){if(1===R.length)return R[0];if(R.length>1||!R.length)return 0===R.length?e():e("span",{},R)}if("a"===this.tag)x.on=v,x.attrs={href:s,"aria-current":w};else{const e=function t(e){if(e){let n;for(let r=0;r<e.length;r++){if(n=e[r],"a"===n.tag)return n;if(n.children&&(n=t(n.children)))return n}}}(this.$slots.default);if(e){e.isStatic=!1;const n=e.data=t({},e.data);n.on=n.on||{};for(const t in n.on){const e=n.on[t];t in v&&(n.on[t]=Array.isArray(e)?e:[e])}for(const t in v)t in n.on?n.on[t].push(v[t]):n.on[t]=b;const r=e.data.attrs=t({},e.data.attrs);r.href=s,r["aria-current"]=w}else x.on=v}return e(this.tag,x,this.$slots.default)}};function F(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}let z;const D="undefined"!=typeof window;function K(t,e,n,r,o){const i=e||[],s=n||Object.create(null),a=r||Object.create(null);t.forEach(t=>{!function t(e,n,r,o,i,s){const{path:a,name:c}=o,u=o.pathToRegexpOptions||{},h=function(t,e,n){n||(t=t.replace(/\/$/,""));return"/"===t[0]||null==e?t:x(`${e.path}/${t}`)}(a,i,u.strict);"boolean"==typeof o.caseSensitive&&(u.sensitive=o.caseSensitive);const l={path:h,regex:J(h,u),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:c,parent:i,matchAs:s,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};o.children&&o.children.forEach(o=>{const i=s?x(`${s}/${o.path}`):void 0;t(e,n,r,o,l,i)});n[l.path]||(e.push(l.path),n[l.path]=l);if(void 0!==o.alias){const s=Array.isArray(o.alias)?o.alias:[o.alias];for(let a=0;a<s.length;++a){const c={path:s[a],children:o.children};t(e,n,r,c,i,l.path||"/")}}c&&(r[c]||(r[c]=l))}(i,s,a,t,o)});for(let t=0,e=i.length;t<e;t++)"*"===i[t]&&(i.push(i.splice(t,1)[0]),e--,t--);return{pathList:i,pathMap:s,nameMap:a}}function J(t,e){return k(t,[],e)}function Q(t,e){const{pathList:n,pathMap:r,nameMap:o}=K(t);function i(t,i,s){const c=V(t,i,!1,e),{name:u}=c;if(u){const t=o[u];if(!t)return a(null,c);const e=t.regex.keys.filter(t=>!t.optional).map(t=>t.name);if("object"!=typeof c.params&&(c.params={}),i&&"object"==typeof i.params)for(const t in i.params)!(t in c.params)&&e.indexOf(t)>-1&&(c.params[t]=i.params[t]);return c.path=M(t.path,c.params),a(t,c,s)}if(c.path){c.params={};for(let t=0;t<n.length;t++){const e=n[t],o=r[e];if(X(o.regex,c.path,c.params))return a(o,c,s)}}return a(null,c)}function s(t,n){const r=t.redirect;let s="function"==typeof r?r(h(t,n,null,e)):r;if("string"==typeof s&&(s={path:s}),!s||"object"!=typeof s)return a(null,n);const c=s,{name:u,path:l}=c;let{query:p,hash:f,params:d}=n;if(p=c.hasOwnProperty("query")?c.query:p,f=c.hasOwnProperty("hash")?c.hash:f,d=c.hasOwnProperty("params")?c.params:d,u)return o[u],i({_normalized:!0,name:u,query:p,hash:f,params:d},void 0,n);if(l){return i({_normalized:!0,path:M(function(t,e){return v(t,e.parent?e.parent.path:"/",!0)}(l,t),d),query:p,hash:f},void 0,n)}return a(null,n)}function a(t,n,r){return t&&t.redirect?s(t,r||n):t&&t.matchAs?function(t,e,n){const r=i({_normalized:!0,path:M(n,e.params)});if(r){const t=r.matched,n=t[t.length-1];return e.params=r.params,a(n,e)}return a(null,e)}(0,n,t.matchAs):h(t,n,r,e)}return{match:i,addRoute:function(t,e){const i="object"!=typeof t?o[t]:void 0;K([e||t],n,r,o,i),i&&i.alias.length&&K(i.alias.map(t=>({path:t,children:[e]})),n,r,o,i)},getRoutes:function(){return n.map(t=>r[t])},addRoutes:function(t){K(t,n,r,o)}}}function X(t,e,n){const r=e.match(t);if(!r)return!1;if(!n)return!0;for(let e=1,o=r.length;e<o;++e){const o=t.keys[e-1];o&&(n[o.name||"pathMatch"]="string"==typeof r[e]?i(r[e]):r[e])}return!0}const Y=D&&window.performance&&window.performance.now?window.performance:Date;function W(){return Y.now().toFixed(3)}let G=W();function Z(){return G}function tt(t){return G=t}const et=Object.create(null);function nt(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");const e=window.location.protocol+"//"+window.location.host,n=window.location.href.replace(e,""),r=t({},window.history.state);return r.key=Z(),window.history.replaceState(r,"",n),window.addEventListener("popstate",it),()=>{window.removeEventListener("popstate",it)}}function rt(t,e,n,r){if(!t.app)return;const o=t.options.scrollBehavior;o&&t.app.$nextTick(()=>{const i=function(){const t=Z();if(t)return et[t]}(),s=o.call(t,e,n,r?i:null);s&&("function"==typeof s.then?s.then(t=>{ht(t,i)}).catch(t=>{}):ht(s,i))})}function ot(){const t=Z();t&&(et[t]={x:window.pageXOffset,y:window.pageYOffset})}function it(t){ot(),t.state&&t.state.key&&tt(t.state.key)}function st(t){return ct(t.x)||ct(t.y)}function at(t){return{x:ct(t.x)?t.x:window.pageXOffset,y:ct(t.y)?t.y:window.pageYOffset}}function ct(t){return"number"==typeof t}const ut=/^#\d/;function ht(t,e){const n="object"==typeof t;if(n&&"string"==typeof t.selector){const n=ut.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(n){let o=t.offset&&"object"==typeof t.offset?t.offset:{};o={x:ct((r=o).x)?r.x:0,y:ct(r.y)?r.y:0},e=function(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left-e.x,y:r.top-n.top-e.y}}(n,o)}else st(t)&&(e=at(t))}else n&&st(t)&&(e=at(t));var r;e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}const lt=D&&function(){const t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"function"==typeof window.history.pushState)}();function pt(e,n){ot();const r=window.history;try{if(n){const n=t({},r.state);n.key=Z(),r.replaceState(n,"",e)}else r.pushState({key:tt(W())},"",e)}catch(t){window.location[n?"replace":"assign"](e)}}function ft(t){pt(t,!0)}function dt(t,e,n){const r=o=>{o>=t.length?n():t[o]?e(t[o],()=>{r(o+1)}):r(o+1)};r(0)}const yt={redirected:2,aborted:4,cancelled:8,duplicated:16};function mt(t,e){return wt(t,e,yt.redirected,`Redirected when going from "${t.fullPath}" to "${function(t){if("string"==typeof t)return t;if("path"in t)return t.path;const e={};return bt.forEach(n=>{n in t&&(e[n]=t[n])}),JSON.stringify(e,null,2)}(e)}" via a navigation guard.`)}function gt(t,e){return wt(t,e,yt.cancelled,`Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`)}function wt(t,e,n,r){const o=new Error(r);return o._isRouter=!0,o.from=t,o.to=e,o.type=n,o}const bt=["params","query","hash"];function vt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function xt(t,e){return vt(t)&&t._isRouter&&(null==e||t.type===e)}function Rt(t){return(e,n,r)=>{let o=!1,i=0,s=null;kt(t,(t,e,n,a)=>{if("function"==typeof t&&void 0===t.cid){o=!0,i++;const e=At(e=>{var o;((o=e).__esModule||Ct&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:z.extend(e),n.components[a]=e,i--,i<=0&&r()}),c=At(t=>{const e=`Failed to resolve async component ${a}: ${t}`;s||(s=vt(t)?t:new Error(e),r(s))});let u;try{u=t(e,c)}catch(t){c(t)}if(u)if("function"==typeof u.then)u.then(e,c);else{const t=u.component;t&&"function"==typeof t.then&&t.then(e,c)}}}),o||r()}}function kt(t,e){return Et(t.map(t=>Object.keys(t.components).map(n=>e(t.components[n],t.instances[n],t,n))))}function Et(t){return Array.prototype.concat.apply([],t)}const Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function At(t){let e=!1;return function(...n){if(!e)return e=!0,t.apply(this,n)}}class $t{constructor(t,e){this.router=t,this.base=function(t){if(!t)if(D){const e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=p,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]}listen(t){this.cb=t}onReady(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))}onError(t){this.errorCbs.push(t)}transitionTo(t,e,n){let r;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach(e=>{e(t)}),t}const o=this.current;this.confirmTransition(r,()=>{this.updateRoute(r),e&&e(r),this.ensureURL(),this.router.afterHooks.forEach(t=>{t&&t(r,o)}),this.ready||(this.ready=!0,this.readyCbs.forEach(t=>{t(r)}))},t=>{n&&n(t),t&&!this.ready&&(xt(t,yt.redirected)&&o===p||(this.ready=!0,this.readyErrorCbs.forEach(e=>{e(t)})))})}confirmTransition(t,e,n){const r=this.current;this.pending=t;const o=t=>{!xt(t)&&vt(t)&&(this.errorCbs.length?this.errorCbs.forEach(e=>{e(t)}):console.error(t)),n&&n(t)},i=t.matched.length-1,s=r.matched.length-1;if(y(t,r)&&i===s&&t.matched[i]===r.matched[s])return this.ensureURL(),t.hash&&rt(this.router,r,t,!1),o(function(t,e){const n=wt(t,e,yt.duplicated,`Avoided redundant navigation to current location: "${t.fullPath}".`);return n.name="NavigationDuplicated",n}(r,t));const{updated:a,deactivated:c,activated:u}=function(t,e){let n;const r=Math.max(t.length,e.length);for(n=0;n<r&&t[n]===e[n];n++);return{updated:e.slice(0,n),activated:e.slice(n),deactivated:t.slice(n)}}(this.current.matched,t.matched),h=[].concat(function(t){return Ot(t,"beforeRouteLeave",St,!0)}(c),this.router.beforeHooks,function(t){return Ot(t,"beforeRouteUpdate",St)}(a),u.map(t=>t.beforeEnter),Rt(u)),l=(e,n)=>{if(this.pending!==t)return o(gt(r,t));try{e(t,r,e=>{!1===e?(this.ensureURL(!0),o(function(t,e){return wt(t,e,yt.aborted,`Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`)}(r,t))):vt(e)?(this.ensureURL(!0),o(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(o(mt(r,t)),"object"==typeof e&&e.replace?this.replace(e):this.push(e)):n(e)})}catch(t){o(t)}};dt(h,l,()=>{dt(function(t){return Ot(t,"beforeRouteEnter",(t,e,n,r)=>function(t,e,n){return function(r,o,i){return t(r,o,t=>{"function"==typeof t&&(e.enteredCbs[n]||(e.enteredCbs[n]=[]),e.enteredCbs[n].push(t)),i(t)})}}(t,n,r))}(u).concat(this.router.resolveHooks),l,()=>{if(this.pending!==t)return o(gt(r,t));this.pending=null,e(t),this.router.app&&this.router.app.$nextTick(()=>{g(t)})})})}updateRoute(t){this.current=t,this.cb&&this.cb(t)}setupListeners(){}teardown(){this.listeners.forEach(t=>{t()}),this.listeners=[],this.current=p,this.pending=null}}function Ot(t,e,n,r){const o=kt(t,(t,r,o,i)=>{const s=function(t,e){"function"!=typeof t&&(t=z.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(t=>n(t,r,o,i)):n(s,r,o,i)});return Et(r?o.reverse():o)}function St(t,e){if(e)return function(){return t.apply(e,arguments)}}class jt extends $t{constructor(t,e){super(t,e),this._startLocation=Tt(this.base)}setupListeners(){if(this.listeners.length>0)return;const t=this.router,e=t.options.scrollBehavior,n=lt&&e;n&&this.listeners.push(nt());const r=()=>{const e=this.current,r=Tt(this.base);this.current===p&&r===this._startLocation||this.transitionTo(r,r=>{n&&rt(t,r,e,!0)})};window.addEventListener("popstate",r),this.listeners.push(()=>{window.removeEventListener("popstate",r)})}go(t){window.history.go(t)}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{pt(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{ft(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}ensureURL(t){if(Tt(this.base)!==this.current.fullPath){const e=x(this.base+this.current.fullPath);t?pt(e):ft(e)}}getCurrentLocation(){return Tt(this.base)}}function Tt(t){let e=window.location.pathname;const n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(x(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}class Pt extends $t{constructor(t,e,n){super(t,e),n&&function(t){const e=Tt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||Lt()}setupListeners(){if(this.listeners.length>0)return;const t=this.router.options.scrollBehavior,e=lt&&t;e&&this.listeners.push(nt());const n=()=>{const t=this.current;Lt()&&this.transitionTo(_t(),n=>{e&&rt(this.router,n,t,!0),lt||Bt(n.fullPath)})},r=lt?"popstate":"hashchange";window.addEventListener(r,n),this.listeners.push(()=>{window.removeEventListener(r,n)})}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{Ut(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{Bt(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}go(t){window.history.go(t)}ensureURL(t){const e=this.current.fullPath;_t()!==e&&(t?Ut(e):Bt(e))}getCurrentLocation(){return _t()}}function Lt(){const t=_t();return"/"===t.charAt(0)||(Bt("/"+t),!1)}function _t(){let t=window.location.href;const e=t.indexOf("#");return e<0?"":(t=t.slice(e+1),t)}function qt(t){const e=window.location.href,n=e.indexOf("#");return`${n>=0?e.slice(0,n):e}#${t}`}function Ut(t){lt?pt(qt(t)):window.location.hash=t}function Bt(t){lt?ft(qt(t)):window.location.replace(qt(t))}class It extends $t{constructor(t,e){super(t,e),this.stack=[],this.index=-1}push(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index+1).concat(t),this.index++,e&&e(t)},n)}replace(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index).concat(t),e&&e(t)},n)}go(t){const e=this.index+t;if(e<0||e>=this.stack.length)return;const n=this.stack[e];this.confirmTransition(n,()=>{const t=this.current;this.index=e,this.updateRoute(n),this.router.afterHooks.forEach(e=>{e&&e(n,t)})},t=>{xt(t,yt.duplicated)&&(this.index=e)})}getCurrentLocation(){const t=this.stack[this.stack.length-1];return t?t.fullPath:"/"}ensureURL(){}}class Mt{constructor(t={}){this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);let e=t.mode||"hash";switch(this.fallback="history"===e&&!lt&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new jt(this,t.base);break;case"hash":this.history=new Pt(this,t.base,this.fallback);break;case"abstract":this.history=new It(this,t.base)}}match(t,e,n){return this.matcher.match(t,e,n)}get currentRoute(){return this.history&&this.history.current}init(t){if(this.apps.push(t),t.$once("hook:destroyed",()=>{const e=this.apps.indexOf(t);e>-1&&this.apps.splice(e,1),this.app===t&&(this.app=this.apps[0]||null),this.app||this.history.teardown()}),this.app)return;this.app=t;const e=this.history;if(e instanceof jt||e instanceof Pt){const t=t=>{const n=e.current,r=this.options.scrollBehavior;lt&&r&&"fullPath"in t&&rt(this,t,n,!1)},n=n=>{e.setupListeners(),t(n)};e.transitionTo(e.getCurrentLocation(),n,n)}e.listen(t=>{this.apps.forEach(e=>{e._route=t})})}beforeEach(t){return Vt(this.beforeHooks,t)}beforeResolve(t){return Vt(this.resolveHooks,t)}afterEach(t){return Vt(this.afterHooks,t)}onReady(t,e){this.history.onReady(t,e)}onError(t){this.history.onError(t)}push(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.push(t,e,n)});this.history.push(t,e,n)}replace(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.replace(t,e,n)});this.history.replace(t,e,n)}go(t){this.history.go(t)}back(){this.go(-1)}forward(){this.go(1)}getMatchedComponents(t){const e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(t=>Object.keys(t.components).map(e=>t.components[e]))):[]}resolve(t,e,n){const r=V(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?x(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}}getRoutes(){return this.matcher.getRoutes()}addRoute(t,e){this.matcher.addRoute(t,e),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}addRoutes(t){this.matcher.addRoutes(t),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}}function Vt(t,e){return t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}}Mt.install=function t(e){if(t.installed&&z===e)return;t.installed=!0,z=e;const n=t=>void 0!==t,r=(t,e)=>{let r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get(){return this._routerRoot._route}}),e.component("RouterView",w),e.component("RouterLink",N);const o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created},Mt.version="3.5.4",Mt.isNavigationFailure=xt,Mt.NavigationFailureType=yt,Mt.START_LOCATION=p,D&&window.Vue&&window.Vue.use(Mt);export default Mt; | ||
function t(t,e){for(const n in e)t[n]=e[n];return t}const e=/[!'()*]/g,n=t=>"%"+t.charCodeAt(0).toString(16),r=/%2C/g,o=t=>encodeURIComponent(t).replace(e,n).replace(r,",");function i(t){try{return decodeURIComponent(t)}catch(t){}return t}const s=t=>null==t||"object"==typeof t?t:String(t);function a(t){const e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(t=>{const n=t.replace(/\+/g," ").split("="),r=i(n.shift()),o=n.length>0?i(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),e):e}function c(t){const e=t?Object.keys(t).map(e=>{const n=t[e];if(void 0===n)return"";if(null===n)return o(e);if(Array.isArray(n)){const t=[];return n.forEach(n=>{void 0!==n&&(null===n?t.push(o(e)):t.push(o(e)+"="+o(n)))}),t.join("&")}return o(e)+"="+o(n)}).filter(t=>t.length>0).join("&"):null;return e?"?"+e:""}const u=/\/?$/;function h(t,e,n,r){const o=r&&r.options.stringifyQuery;let i=e.query||{};try{i=l(i)}catch(t){}const s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?f(t):[]};return n&&(s.redirectedFrom=d(n,o)),Object.freeze(s)}function l(t){if(Array.isArray(t))return t.map(l);if(t&&"object"==typeof t){const e={};for(const n in t)e[n]=l(t[n]);return e}return t}const p=h(null,{path:"/"});function f(t){const e=[];for(;t;)e.unshift(t),t=t.parent;return e}function d({path:t,query:e={},hash:n=""},r){return(t||"/")+(r||c)(e)+n}function y(t,e,n){return e===p?t===e:!!e&&(t.path&&e.path?t.path.replace(u,"")===e.path.replace(u,"")&&(n||t.hash===e.hash&&m(t.query,e.query)):!(!t.name||!e.name)&&(t.name===e.name&&(n||t.hash===e.hash&&m(t.query,e.query)&&m(t.params,e.params))))}function m(t={},e={}){if(!t||!e)return t===e;const n=Object.keys(t).sort(),r=Object.keys(e).sort();return n.length===r.length&&n.every((n,o)=>{const i=t[n];if(r[o]!==n)return!1;const s=e[n];return null==i||null==s?i===s:"object"==typeof i&&"object"==typeof s?m(i,s):String(i)===String(s)})}function g(t){for(let e=0;e<t.matched.length;e++){const n=t.matched[e];for(const t in n.instances){const e=n.instances[t],r=n.enteredCbs[t];if(e&&r){delete n.enteredCbs[t];for(let t=0;t<r.length;t++)e._isBeingDestroyed||r[t](e)}}}}var w={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render(e,{props:n,children:r,parent:o,data:i}){i.routerView=!0;const s=o.$createElement,a=n.name,c=o.$route,u=o._routerViewCache||(o._routerViewCache={});let h=0,l=!1;for(;o&&o._routerRoot!==o;){const t=o.$vnode?o.$vnode.data:{};t.routerView&&h++,t.keepAlive&&o._directInactive&&o._inactive&&(l=!0),o=o.$parent}if(i.routerViewDepth=h,l){const t=u[a],e=t&&t.component;return e?(t.configProps&&b(e,i,t.route,t.configProps),s(e,i,r)):s()}const p=c.matched[h],f=p&&p.components[a];if(!p||!f)return u[a]=null,s();u[a]={component:f},i.registerRouteInstance=(t,e)=>{const n=p.instances[a];(e&&n!==t||!e&&n===t)&&(p.instances[a]=e)},(i.hook||(i.hook={})).prepatch=(t,e)=>{p.instances[a]=e.componentInstance},i.hook.init=t=>{t.data.keepAlive&&t.componentInstance&&t.componentInstance!==p.instances[a]&&(p.instances[a]=t.componentInstance),g(c)};const d=p.props&&p.props[a];return d&&(t(u[a],{route:c,configProps:d}),b(f,i,c,d)),s(f,i,r)}};function b(e,n,r,o){let i=n.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(r,o);if(i){i=n.props=t({},i);const r=n.attrs=n.attrs||{};for(const t in i)e.props&&t in e.props||(r[t]=i[t],delete i[t])}}function v(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const o=e.split("/");n&&o[o.length-1]||o.pop();const i=t.replace(/^\//,"").split("/");for(let t=0;t<i.length;t++){const e=i[t];".."===e?o.pop():"."!==e&&o.push(e)}return""!==o[0]&&o.unshift(""),o.join("/")}function x(t){return t.replace(/\/(?:\s*\/)+/g,"/")}var R=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},k=I,E=T,C=function(t,e){return j(T(t,e),e)},A=j,$=U,O=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function T(t,e){for(var n,r=[],o=0,i=0,s="",a=e&&e.delimiter||"/";null!=(n=O.exec(t));){var c=n[0],u=n[1],h=n.index;if(s+=t.slice(i,h),i=h+c.length,u)s+=u[1];else{var l=t[i],p=n[2],f=n[3],d=n[4],y=n[5],m=n[6],g=n[7];s&&(r.push(s),s="");var w=null!=p&&null!=l&&l!==p,b="+"===m||"*"===m,v="?"===m||"*"===m,x=n[2]||a,R=d||y;r.push({name:f||o++,prefix:p||"",delimiter:x,optional:v,repeat:b,partial:w,asterisk:!!g,pattern:R?P(R):g?".*":"[^"+L(x)+"]+?"})}}return i<t.length&&(s+=t.substr(i)),s&&r.push(s),r}function S(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function j(t,e){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"==typeof t[r]&&(n[r]=new RegExp("^(?:"+t[r].pattern+")$",q(e)));return function(e,r){for(var o="",i=e||{},s=(r||{}).pretty?S:encodeURIComponent,a=0;a<t.length;a++){var c=t[a];if("string"!=typeof c){var u,h=i[c.name];if(null==h){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(R(h)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var l=0;l<h.length;l++){if(u=s(h[l]),!n[a].test(u))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(u)+"`");o+=(0===l?c.prefix:c.delimiter)+u}}else{if(u=c.asterisk?encodeURI(h).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):s(h),!n[a].test(u))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+u+'"');o+=c.prefix+u}}else o+=c}return o}}function L(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function P(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function _(t,e){return t.keys=e,t}function q(t){return t&&t.sensitive?"":"i"}function U(t,e,n){R(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",s=0;s<t.length;s++){var a=t[s];if("string"==typeof a)i+=L(a);else{var c=L(a.prefix),u="(?:"+a.pattern+")";e.push(a),a.repeat&&(u+="(?:"+c+u+")*"),i+=u=a.optional?a.partial?c+"("+u+")?":"(?:"+c+"("+u+"))?":c+"("+u+")"}}var h=L(n.delimiter||"/"),l=i.slice(-h.length)===h;return r||(i=(l?i.slice(0,-h.length):i)+"(?:"+h+"(?=$))?"),i+=o?"$":r&&l?"":"(?="+h+"|$)",_(new RegExp("^"+i,q(n)),e)}function I(t,e,n){return R(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return _(t,e)}(t,e):R(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(I(t[o],e,n).source);return _(new RegExp("(?:"+r.join("|")+")",q(n)),e)}(t,e,n):function(t,e,n){return U(T(t,n),e,n)}(t,e,n)}k.parse=E,k.compile=C,k.tokensToFunction=A,k.tokensToRegExp=$;const B=Object.create(null);function M(t,e,n){e=e||{};try{const n=B[t]||(B[t]=k.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function V(e,n,r,o){let i="string"==typeof e?{path:e}:e;if(i._normalized)return i;if(i.name){i=t({},e);const n=i.params;return n&&"object"==typeof n&&(i.params=t({},n)),i}if(!i.path&&i.params&&n){i=t({},i),i._normalized=!0;const e=t(t({},n.params),i.params);if(n.name)i.name=n.name,i.params=e;else if(n.matched.length){const t=n.matched[n.matched.length-1].path;i.path=M(t,e,n.path)}return i}const c=function(t){let e="",n="";const r=t.indexOf("#");r>=0&&(e=t.slice(r),t=t.slice(0,r));const o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(i.path||""),u=n&&n.path||"/",h=c.path?v(c.path,u,r||i.append):u,l=function(t,e={},n){const r=n||a;let o;try{o=r(t||"")}catch(t){o={}}for(const t in e){const n=e[t];o[t]=Array.isArray(n)?n.map(s):s(n)}return o}(c.query,i.query,o&&o.options.parseQuery);let p=i.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:h,query:l,hash:p}}const N=()=>{};var H={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render(e){const n=this.$router,r=this.$route,{location:o,route:i,href:s}=n.resolve(this.to,r,this.append),a={},c=n.options.linkActiveClass,l=n.options.linkExactActiveClass,p=null==c?"router-link-active":c,f=null==l?"router-link-exact-active":l,d=null==this.activeClass?p:this.activeClass,m=null==this.exactActiveClass?f:this.exactActiveClass,g=i.redirectedFrom?h(null,V(i.redirectedFrom),null,n):i;a[m]=y(r,g,this.exactPath),a[d]=this.exact||this.exactPath?a[m]:function(t,e){return 0===t.path.replace(u,"/").indexOf(e.path.replace(u,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(const n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,g);const w=a[m]?this.ariaCurrentValue:null,b=t=>{F(t)&&(this.replace?n.replace(o,N):n.push(o,N))},v={click:F};Array.isArray(this.event)?this.event.forEach(t=>{v[t]=b}):v[this.event]=b;const x={class:a},R=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:i,navigate:b,isActive:a[d],isExactActive:a[m]});if(R){if(1===R.length)return R[0];if(R.length>1||!R.length)return 0===R.length?e():e("span",{},R)}if("a"===this.tag)x.on=v,x.attrs={href:s,"aria-current":w};else{const e=function t(e){if(e){let n;for(let r=0;r<e.length;r++){if(n=e[r],"a"===n.tag)return n;if(n.children&&(n=t(n.children)))return n}}}(this.$slots.default);if(e){e.isStatic=!1;const n=e.data=t({},e.data);n.on=n.on||{};for(const t in n.on){const e=n.on[t];t in v&&(n.on[t]=Array.isArray(e)?e:[e])}for(const t in v)t in n.on?n.on[t].push(v[t]):n.on[t]=b;const r=e.data.attrs=t({},e.data.attrs);r.href=s,r["aria-current"]=w}else x.on=v}return e(this.tag,x,this.$slots.default)}};function F(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}let z;const D="undefined"!=typeof window;function K(t,e,n,r,o){const i=e||[],s=n||Object.create(null),a=r||Object.create(null);t.forEach(t=>{!function t(e,n,r,o,i,s){const{path:a,name:c}=o,u=o.pathToRegexpOptions||{},h=function(t,e,n){n||(t=t.replace(/\/$/,""));return"/"===t[0]||null==e?t:x(`${e.path}/${t}`)}(a,i,u.strict);"boolean"==typeof o.caseSensitive&&(u.sensitive=o.caseSensitive);const l={path:h,regex:J(h,u),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:c,parent:i,matchAs:s,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};o.children&&o.children.forEach(o=>{const i=s?x(`${s}/${o.path}`):void 0;t(e,n,r,o,l,i)});n[l.path]||(e.push(l.path),n[l.path]=l);if(void 0!==o.alias){const s=Array.isArray(o.alias)?o.alias:[o.alias];for(let a=0;a<s.length;++a){const c={path:s[a],children:o.children};t(e,n,r,c,i,l.path||"/")}}c&&(r[c]||(r[c]=l))}(i,s,a,t,o)});for(let t=0,e=i.length;t<e;t++)"*"===i[t]&&(i.push(i.splice(t,1)[0]),e--,t--);return{pathList:i,pathMap:s,nameMap:a}}function J(t,e){return k(t,[],e)}function Q(t,e){const{pathList:n,pathMap:r,nameMap:o}=K(t);function i(t,i,s){const c=V(t,i,!1,e),{name:u}=c;if(u){const t=o[u];if(!t)return a(null,c);const e=t.regex.keys.filter(t=>!t.optional).map(t=>t.name);if("object"!=typeof c.params&&(c.params={}),i&&"object"==typeof i.params)for(const t in i.params)!(t in c.params)&&e.indexOf(t)>-1&&(c.params[t]=i.params[t]);return c.path=M(t.path,c.params),a(t,c,s)}if(c.path){c.params={};for(let t=0;t<n.length;t++){const e=n[t],o=r[e];if(X(o.regex,c.path,c.params))return a(o,c,s)}}return a(null,c)}function s(t,n){const r=t.redirect;let s="function"==typeof r?r(h(t,n,null,e)):r;if("string"==typeof s&&(s={path:s}),!s||"object"!=typeof s)return a(null,n);const c=s,{name:u,path:l}=c;let{query:p,hash:f,params:d}=n;if(p=c.hasOwnProperty("query")?c.query:p,f=c.hasOwnProperty("hash")?c.hash:f,d=c.hasOwnProperty("params")?c.params:d,u)return o[u],i({_normalized:!0,name:u,query:p,hash:f,params:d},void 0,n);if(l){return i({_normalized:!0,path:M(function(t,e){return v(t,e.parent?e.parent.path:"/",!0)}(l,t),d),query:p,hash:f},void 0,n)}return a(null,n)}function a(t,n,r){return t&&t.redirect?s(t,r||n):t&&t.matchAs?function(t,e,n){const r=i({_normalized:!0,path:M(n,e.params)});if(r){const t=r.matched,n=t[t.length-1];return e.params=r.params,a(n,e)}return a(null,e)}(0,n,t.matchAs):h(t,n,r,e)}return{match:i,addRoute:function(t,e){const i="object"!=typeof t?o[t]:void 0;K([e||t],n,r,o,i),i&&i.alias.length&&K(i.alias.map(t=>({path:t,children:[e]})),n,r,o,i)},getRoutes:function(){return n.map(t=>r[t])},addRoutes:function(t){K(t,n,r,o)}}}function X(t,e,n){const r=e.match(t);if(!r)return!1;if(!n)return!0;for(let e=1,o=r.length;e<o;++e){const o=t.keys[e-1];o&&(n[o.name||"pathMatch"]="string"==typeof r[e]?i(r[e]):r[e])}return!0}const Y=D&&window.performance&&window.performance.now?window.performance:Date;function W(){return Y.now().toFixed(3)}let G=W();function Z(){return G}function tt(t){return G=t}const et=Object.create(null);function nt(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");const e=window.location.protocol+"//"+window.location.host,n=window.location.href.replace(e,""),r=t({},window.history.state);return r.key=Z(),window.history.replaceState(r,"",n),window.addEventListener("popstate",it),()=>{window.removeEventListener("popstate",it)}}function rt(t,e,n,r){if(!t.app)return;const o=t.options.scrollBehavior;o&&t.app.$nextTick(()=>{const i=function(){const t=Z();if(t)return et[t]}(),s=o.call(t,e,n,r?i:null);s&&("function"==typeof s.then?s.then(t=>{ht(t,i)}).catch(t=>{}):ht(s,i))})}function ot(){const t=Z();t&&(et[t]={x:window.pageXOffset,y:window.pageYOffset})}function it(t){ot(),t.state&&t.state.key&&tt(t.state.key)}function st(t){return ct(t.x)||ct(t.y)}function at(t){return{x:ct(t.x)?t.x:window.pageXOffset,y:ct(t.y)?t.y:window.pageYOffset}}function ct(t){return"number"==typeof t}const ut=/^#\d/;function ht(t,e){const n="object"==typeof t;if(n&&"string"==typeof t.selector){const n=ut.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(n){let o=t.offset&&"object"==typeof t.offset?t.offset:{};o={x:ct((r=o).x)?r.x:0,y:ct(r.y)?r.y:0},e=function(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left-e.x,y:r.top-n.top-e.y}}(n,o)}else st(t)&&(e=at(t))}else n&&st(t)&&(e=at(t));var r;e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}const lt=D&&function(){const t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"function"==typeof window.history.pushState)}();function pt(e,n){ot();const r=window.history;try{if(n){const n=t({},r.state);n.key=Z(),r.replaceState(n,"",e)}else r.pushState({key:tt(W())},"",e)}catch(t){window.location[n?"replace":"assign"](e)}}function ft(t){pt(t,!0)}const dt={redirected:2,aborted:4,cancelled:8,duplicated:16};function yt(t,e){return gt(t,e,dt.redirected,`Redirected when going from "${t.fullPath}" to "${function(t){if("string"==typeof t)return t;if("path"in t)return t.path;const e={};return wt.forEach(n=>{n in t&&(e[n]=t[n])}),JSON.stringify(e,null,2)}(e)}" via a navigation guard.`)}function mt(t,e){return gt(t,e,dt.cancelled,`Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`)}function gt(t,e,n,r){const o=new Error(r);return o._isRouter=!0,o.from=t,o.to=e,o.type=n,o}const wt=["params","query","hash"];function bt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function vt(t,e){return bt(t)&&t._isRouter&&(null==e||t.type===e)}function xt(t,e,n){const r=o=>{o>=t.length?n():t[o]?e(t[o],()=>{r(o+1)}):r(o+1)};r(0)}function Rt(t){return(e,n,r)=>{let o=!1,i=0,s=null;kt(t,(t,e,n,a)=>{if("function"==typeof t&&void 0===t.cid){o=!0,i++;const e=At(e=>{var o;((o=e).__esModule||Ct&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:z.extend(e),n.components[a]=e,i--,i<=0&&r()}),c=At(t=>{const e=`Failed to resolve async component ${a}: ${t}`;s||(s=bt(t)?t:new Error(e),r(s))});let u;try{u=t(e,c)}catch(t){c(t)}if(u)if("function"==typeof u.then)u.then(e,c);else{const t=u.component;t&&"function"==typeof t.then&&t.then(e,c)}}}),o||r()}}function kt(t,e){return Et(t.map(t=>Object.keys(t.components).map(n=>e(t.components[n],t.instances[n],t,n))))}function Et(t){return Array.prototype.concat.apply([],t)}const Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function At(t){let e=!1;return function(...n){if(!e)return e=!0,t.apply(this,n)}}class $t{constructor(t,e){this.router=t,this.base=function(t){if(!t)if(D){const e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=p,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]}listen(t){this.cb=t}onReady(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))}onError(t){this.errorCbs.push(t)}transitionTo(t,e,n){let r;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach(e=>{e(t)}),t}const o=this.current;this.confirmTransition(r,()=>{this.updateRoute(r),e&&e(r),this.ensureURL(),this.router.afterHooks.forEach(t=>{t&&t(r,o)}),this.ready||(this.ready=!0,this.readyCbs.forEach(t=>{t(r)}))},t=>{n&&n(t),t&&!this.ready&&(vt(t,dt.redirected)&&o===p||(this.ready=!0,this.readyErrorCbs.forEach(e=>{e(t)})))})}confirmTransition(t,e,n){const r=this.current;this.pending=t;const o=t=>{!vt(t)&&bt(t)&&(this.errorCbs.length?this.errorCbs.forEach(e=>{e(t)}):console.error(t)),n&&n(t)},i=t.matched.length-1,s=r.matched.length-1;if(y(t,r)&&i===s&&t.matched[i]===r.matched[s])return this.ensureURL(),t.hash&&rt(this.router,r,t,!1),o(function(t,e){const n=gt(t,e,dt.duplicated,`Avoided redundant navigation to current location: "${t.fullPath}".`);return n.name="NavigationDuplicated",n}(r,t));const{updated:a,deactivated:c,activated:u}=function(t,e){let n;const r=Math.max(t.length,e.length);for(n=0;n<r&&t[n]===e[n];n++);return{updated:e.slice(0,n),activated:e.slice(n),deactivated:t.slice(n)}}(this.current.matched,t.matched),h=[].concat(function(t){return Ot(t,"beforeRouteLeave",Tt,!0)}(c),this.router.beforeHooks,function(t){return Ot(t,"beforeRouteUpdate",Tt)}(a),u.map(t=>t.beforeEnter),Rt(u)),l=(e,n)=>{if(this.pending!==t)return o(mt(r,t));try{e(t,r,e=>{!1===e?(this.ensureURL(!0),o(function(t,e){return gt(t,e,dt.aborted,`Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`)}(r,t))):bt(e)?(this.ensureURL(!0),o(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(o(yt(r,t)),"object"==typeof e&&e.replace?this.replace(e):this.push(e)):n(e)})}catch(t){o(t)}};xt(h,l,()=>{xt(function(t){return Ot(t,"beforeRouteEnter",(t,e,n,r)=>function(t,e,n){return function(r,o,i){return t(r,o,t=>{"function"==typeof t&&(e.enteredCbs[n]||(e.enteredCbs[n]=[]),e.enteredCbs[n].push(t)),i(t)})}}(t,n,r))}(u).concat(this.router.resolveHooks),l,()=>{if(this.pending!==t)return o(mt(r,t));this.pending=null,e(t),this.router.app&&this.router.app.$nextTick(()=>{g(t)})})})}updateRoute(t){this.current=t,this.cb&&this.cb(t)}setupListeners(){}teardown(){this.listeners.forEach(t=>{t()}),this.listeners=[],this.current=p,this.pending=null}}function Ot(t,e,n,r){const o=kt(t,(t,r,o,i)=>{const s=function(t,e){"function"!=typeof t&&(t=z.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(t=>n(t,r,o,i)):n(s,r,o,i)});return Et(r?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}class St extends $t{constructor(t,e){super(t,e),this._startLocation=jt(this.base)}setupListeners(){if(this.listeners.length>0)return;const t=this.router,e=t.options.scrollBehavior,n=lt&&e;n&&this.listeners.push(nt());const r=()=>{const e=this.current,r=jt(this.base);this.current===p&&r===this._startLocation||this.transitionTo(r,r=>{n&&rt(t,r,e,!0)})};window.addEventListener("popstate",r),this.listeners.push(()=>{window.removeEventListener("popstate",r)})}go(t){window.history.go(t)}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{pt(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{ft(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}ensureURL(t){if(jt(this.base)!==this.current.fullPath){const e=x(this.base+this.current.fullPath);t?pt(e):ft(e)}}getCurrentLocation(){return jt(this.base)}}function jt(t){let e=window.location.pathname;const n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(x(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}class Lt extends $t{constructor(t,e,n){super(t,e),n&&function(t){const e=jt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||Pt()}setupListeners(){if(this.listeners.length>0)return;const t=this.router.options.scrollBehavior,e=lt&&t;e&&this.listeners.push(nt());const n=()=>{const t=this.current;Pt()&&this.transitionTo(_t(),n=>{e&&rt(this.router,n,t,!0),lt||It(n.fullPath)})},r=lt?"popstate":"hashchange";window.addEventListener(r,n),this.listeners.push(()=>{window.removeEventListener(r,n)})}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{Ut(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{It(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}go(t){window.history.go(t)}ensureURL(t){const e=this.current.fullPath;_t()!==e&&(t?Ut(e):It(e))}getCurrentLocation(){return _t()}}function Pt(){const t=_t();return"/"===t.charAt(0)||(It("/"+t),!1)}function _t(){let t=window.location.href;const e=t.indexOf("#");return e<0?"":(t=t.slice(e+1),t)}function qt(t){const e=window.location.href,n=e.indexOf("#");return`${n>=0?e.slice(0,n):e}#${t}`}function Ut(t){lt?pt(qt(t)):window.location.hash=t}function It(t){lt?ft(qt(t)):window.location.replace(qt(t))}class Bt extends $t{constructor(t,e){super(t,e),this.stack=[],this.index=-1}push(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index+1).concat(t),this.index++,e&&e(t)},n)}replace(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index).concat(t),e&&e(t)},n)}go(t){const e=this.index+t;if(e<0||e>=this.stack.length)return;const n=this.stack[e];this.confirmTransition(n,()=>{const t=this.current;this.index=e,this.updateRoute(n),this.router.afterHooks.forEach(e=>{e&&e(n,t)})},t=>{vt(t,dt.duplicated)&&(this.index=e)})}getCurrentLocation(){const t=this.stack[this.stack.length-1];return t?t.fullPath:"/"}ensureURL(){}}class Mt{constructor(t={}){this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);let e=t.mode||"hash";switch(this.fallback="history"===e&&!lt&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Bt(this,t.base)}}match(t,e,n){return this.matcher.match(t,e,n)}get currentRoute(){return this.history&&this.history.current}init(t){if(this.apps.push(t),t.$once("hook:destroyed",()=>{const e=this.apps.indexOf(t);e>-1&&this.apps.splice(e,1),this.app===t&&(this.app=this.apps[0]||null),this.app||this.history.teardown()}),this.app)return;this.app=t;const e=this.history;if(e instanceof St||e instanceof Lt){const t=t=>{const n=e.current,r=this.options.scrollBehavior;lt&&r&&"fullPath"in t&&rt(this,t,n,!1)},n=n=>{e.setupListeners(),t(n)};e.transitionTo(e.getCurrentLocation(),n,n)}e.listen(t=>{this.apps.forEach(e=>{e._route=t})})}beforeEach(t){return Vt(this.beforeHooks,t)}beforeResolve(t){return Vt(this.resolveHooks,t)}afterEach(t){return Vt(this.afterHooks,t)}onReady(t,e){this.history.onReady(t,e)}onError(t){this.history.onError(t)}push(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.push(t,e,n)});this.history.push(t,e,n)}replace(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.replace(t,e,n)});this.history.replace(t,e,n)}go(t){this.history.go(t)}back(){this.go(-1)}forward(){this.go(1)}getMatchedComponents(t){const e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(t=>Object.keys(t.components).map(e=>t.components[e]))):[]}resolve(t,e,n){const r=V(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?x(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}}getRoutes(){return this.matcher.getRoutes()}addRoute(t,e){this.matcher.addRoute(t,e),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}addRoutes(t){this.matcher.addRoutes(t),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}}function Vt(t,e){return t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}}D&&window.Vue&&window.Vue.use(Mt),Mt.install=function t(e){if(t.installed&&z===e)return;t.installed=!0,z=e;const n=t=>void 0!==t,r=(t,e)=>{let r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get(){return this._routerRoot._route}}),e.component("RouterView",w),e.component("RouterLink",H);const o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created},Mt.version="3.6.0",Mt.isNavigationFailure=vt,Mt.NavigationFailureType=dt,Mt.START_LOCATION=p;const Nt="3.6.0";export{dt as NavigationFailureType,H as RouterLink,w as RouterView,p as START_LOCATION,Mt as default,vt as isNavigationFailure,Nt as version}; |
/*! | ||
* vue-router v3.5.4 | ||
* vue-router v3.6.0 | ||
* (c) 2022 Evan You | ||
@@ -7,6 +7,6 @@ * @license MIT | ||
/*! | ||
* vue-router v3.5.4 | ||
* vue-router v3.6.0 | ||
* (c) 2022 Evan You | ||
* @license MIT | ||
*/ | ||
var t,e;t=this,e=function(){"use strict";function t(t,e){for(var r in e)t[r]=e[r];return t}var e=/[!'()*]/g,r=function(t){return"%"+t.charCodeAt(0).toString(16)},n=/%2C/g,o=function(t){return encodeURIComponent(t).replace(e,r).replace(n,",")};function i(t){try{return decodeURIComponent(t)}catch(t){}return t}var a=function(t){return null==t||"object"==typeof t?t:String(t)};function s(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var r=t.replace(/\+/g," ").split("="),n=i(r.shift()),o=r.length>0?i(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}function u(t){var e=t?Object.keys(t).map((function(e){var r=t[e];if(void 0===r)return"";if(null===r)return o(e);if(Array.isArray(r)){var n=[];return r.forEach((function(t){void 0!==t&&(null===t?n.push(o(e)):n.push(o(e)+"="+o(t)))})),n.join("&")}return o(e)+"="+o(r)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var c=/\/?$/;function p(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=f(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?l(t):[]};return r&&(a.redirectedFrom=d(r,o)),Object.freeze(a)}function f(t){if(Array.isArray(t))return t.map(f);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=f(t[r]);return e}return t}var h=p(null,{path:"/"});function l(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function d(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||u)(n)+o}function v(t,e,r){return e===h?t===e:!!e&&(t.path&&e.path?t.path.replace(c,"")===e.path.replace(c,"")&&(r||t.hash===e.hash&&y(t.query,e.query)):!(!t.name||!e.name)&&t.name===e.name&&(r||t.hash===e.hash&&y(t.query,e.query)&&y(t.params,e.params)))}function y(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t).sort(),n=Object.keys(e).sort();return r.length===n.length&&r.every((function(r,o){var i=t[r];if(n[o]!==r)return!1;var a=e[r];return null==i||null==a?i===a:"object"==typeof i&&"object"==typeof a?y(i,a):String(i)===String(a)}))}function m(t){for(var e=0;e<t.matched.length;e++){var r=t.matched[e];for(var n in r.instances){var o=r.instances[n],i=r.enteredCbs[n];if(o&&i){delete r.enteredCbs[n];for(var a=0;a<i.length;a++)o._isBeingDestroyed||i[a](o)}}}}var g={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,r){var n=r.props,o=r.children,i=r.parent,a=r.data;a.routerView=!0;for(var s=i.$createElement,u=n.name,c=i.$route,p=i._routerViewCache||(i._routerViewCache={}),f=0,h=!1;i&&i._routerRoot!==i;){var l=i.$vnode?i.$vnode.data:{};l.routerView&&f++,l.keepAlive&&i._directInactive&&i._inactive&&(h=!0),i=i.$parent}if(a.routerViewDepth=f,h){var d=p[u],v=d&&d.component;return v?(d.configProps&&w(v,a,d.route,d.configProps),s(v,a,o)):s()}var y=c.matched[f],g=y&&y.components[u];if(!y||!g)return p[u]=null,s();p[u]={component:g},a.registerRouteInstance=function(t,e){var r=y.instances[u];(e&&r!==t||!e&&r===t)&&(y.instances[u]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){y.instances[u]=e.componentInstance},a.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==y.instances[u]&&(y.instances[u]=t.componentInstance),m(c)};var b=y.props&&y.props[u];return b&&(t(p[u],{route:c,configProps:b}),w(g,a,c,b)),s(g,a,o)}};function w(e,r,n,o){var i=r.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(n,o);if(i){i=r.props=t({},i);var a=r.attrs=r.attrs||{};for(var s in i)e.props&&s in e.props||(a[s]=i[s],delete i[s])}}function b(t,e,r){var n=t.charAt(0);if("/"===n)return t;if("?"===n||"#"===n)return e+t;var o=e.split("/");r&&o[o.length-1]||o.pop();for(var i=t.replace(/^\//,"").split("/"),a=0;a<i.length;a++){var s=i[a];".."===s?o.pop():"."!==s&&o.push(s)}return""!==o[0]&&o.unshift(""),o.join("/")}function x(t){return t.replace(/\/(?:\s*\/)+/g,"/")}var R=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},k=B,E=j,C=function(t,e){return S(j(t,e),e)},A=S,O=U,_=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function j(t,e){for(var r,n=[],o=0,i=0,a="",s=e&&e.delimiter||"/";null!=(r=_.exec(t));){var u=r[0],c=r[1],p=r.index;if(a+=t.slice(i,p),i=p+u.length,c)a+=c[1];else{var f=t[i],h=r[2],l=r[3],d=r[4],v=r[5],y=r[6],m=r[7];a&&(n.push(a),a="");var g=null!=h&&null!=f&&f!==h,w="+"===y||"*"===y,b="?"===y||"*"===y,x=r[2]||s,R=d||v;n.push({name:l||o++,prefix:h||"",delimiter:x,optional:b,repeat:w,partial:g,asterisk:!!m,pattern:R?L(R):m?".*":"[^"+P(x)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&n.push(a),n}function T(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function S(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(r[n]=new RegExp("^(?:"+t[n].pattern+")$",q(e)));return function(e,n){for(var o="",i=e||{},a=(n||{}).pretty?T:encodeURIComponent,s=0;s<t.length;s++){var u=t[s];if("string"!=typeof u){var c,p=i[u.name];if(null==p){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(R(p)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var f=0;f<p.length;f++){if(c=a(p[f]),!r[s].test(c))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(c)+"`");o+=(0===f?u.prefix:u.delimiter)+c}}else{if(c=u.asterisk?encodeURI(p).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):a(p),!r[s].test(c))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+c+'"');o+=u.prefix+c}}else o+=u}return o}}function P(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function L(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function $(t,e){return t.keys=e,t}function q(t){return t&&t.sensitive?"":"i"}function U(t,e,r){R(e)||(r=e||r,e=[]);for(var n=(r=r||{}).strict,o=!1!==r.end,i="",a=0;a<t.length;a++){var s=t[a];if("string"==typeof s)i+=P(s);else{var u=P(s.prefix),c="(?:"+s.pattern+")";e.push(s),s.repeat&&(c+="(?:"+u+c+")*"),i+=c=s.optional?s.partial?u+"("+c+")?":"(?:"+u+"("+c+"))?":u+"("+c+")"}}var p=P(r.delimiter||"/"),f=i.slice(-p.length)===p;return n||(i=(f?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":n&&f?"":"(?="+p+"|$)",$(new RegExp("^"+i,q(r)),e)}function B(t,e,r){return R(e)||(r=e||r,e=[]),r=r||{},t instanceof RegExp?function(t,e){var r=t.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)e.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return $(t,e)}(t,e):R(t)?function(t,e,r){for(var n=[],o=0;o<t.length;o++)n.push(B(t[o],e,r).source);return $(new RegExp("(?:"+n.join("|")+")",q(r)),e)}(t,e,r):function(t,e,r){return U(j(t,r),e,r)}(t,e,r)}k.parse=E,k.compile=C,k.tokensToFunction=A,k.tokensToRegExp=O;var I=Object.create(null);function M(t,e,r){e=e||{};try{var n=I[t]||(I[t]=k.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function V(e,r,n,o){var i="string"==typeof e?{path:e}:e;if(i._normalized)return i;if(i.name){var u=(i=t({},e)).params;return u&&"object"==typeof u&&(i.params=t({},u)),i}if(!i.path&&i.params&&r){(i=t({},i))._normalized=!0;var c=t(t({},r.params),i.params);if(r.name)i.name=r.name,i.params=c;else if(r.matched.length){var p=r.matched[r.matched.length-1].path;i.path=M(p,c,r.path)}return i}var f=function(t){var e="",r="",n=t.indexOf("#");n>=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(i.path||""),h=r&&r.path||"/",l=f.path?b(f.path,h,n||i.append):h,d=function(t,e,r){void 0===e&&(e={});var n,o=r||s;try{n=o(t||"")}catch(t){n={}}for(var i in e){var u=e[i];n[i]=Array.isArray(u)?u.map(a):a(u)}return n}(f.query,i.query,o&&o.options.parseQuery),v=i.hash||f.hash;return v&&"#"!==v.charAt(0)&&(v="#"+v),{_normalized:!0,path:l,query:d,hash:v}}var H,N=function(){},F={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var r=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),a=i.location,s=i.route,u=i.href,f={},h=n.options.linkActiveClass,l=n.options.linkExactActiveClass,d=null==h?"router-link-active":h,y=null==l?"router-link-exact-active":l,m=null==this.activeClass?d:this.activeClass,g=null==this.exactActiveClass?y:this.exactActiveClass,w=s.redirectedFrom?p(null,V(s.redirectedFrom),null,n):s;f[g]=v(o,w,this.exactPath),f[m]=this.exact||this.exactPath?f[g]:function(t,e){return 0===t.path.replace(c,"/").indexOf(e.path.replace(c,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(o,w);var b=f[g]?this.ariaCurrentValue:null,x=function(t){z(t)&&(r.replace?n.replace(a,N):n.push(a,N))},R={click:z};Array.isArray(this.event)?this.event.forEach((function(t){R[t]=x})):R[this.event]=x;var k={class:f},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:s,navigate:x,isActive:f[m],isExactActive:f[g]});if(E){if(1===E.length)return E[0];if(E.length>1||!E.length)return 0===E.length?e():e("span",{},E)}if("a"===this.tag)k.on=R,k.attrs={href:u,"aria-current":b};else{var C=function t(e){var r;if(e)for(var n=0;n<e.length;n++){if("a"===(r=e[n]).tag)return r;if(r.children&&(r=t(r.children)))return r}}(this.$slots.default);if(C){C.isStatic=!1;var A=C.data=t({},C.data);for(var O in A.on=A.on||{},A.on){var _=A.on[O];O in R&&(A.on[O]=Array.isArray(_)?_:[_])}for(var j in R)j in A.on?A.on[j].push(R[j]):A.on[j]=x;var T=C.data.attrs=t({},C.data.attrs);T.href=u,T["aria-current"]=b}else k.on=R}return e(this.tag,k,this.$slots.default)}};function z(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}var D="undefined"!=typeof window;function K(t,e,r,n,o){var i=e||[],a=r||Object.create(null),s=n||Object.create(null);t.forEach((function(t){!function t(e,r,n,o,i,a){var s=o.path,u=o.name,c=o.pathToRegexpOptions||{},p=function(t,e,r){return r||(t=t.replace(/\/$/,"")),"/"===t[0]||null==e?t:x(e.path+"/"+t)}(s,i,c.strict);"boolean"==typeof o.caseSensitive&&(c.sensitive=o.caseSensitive);var f={path:p,regex:J(p,c),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:u,parent:i,matchAs:a,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};if(o.children&&o.children.forEach((function(o){var i=a?x(a+"/"+o.path):void 0;t(e,r,n,o,f,i)})),r[f.path]||(e.push(f.path),r[f.path]=f),void 0!==o.alias)for(var h=Array.isArray(o.alias)?o.alias:[o.alias],l=0;l<h.length;++l){var d={path:h[l],children:o.children};t(e,r,n,d,i,f.path||"/")}u&&(n[u]||(n[u]=f))}(i,a,s,t,o)}));for(var u=0,c=i.length;u<c;u++)"*"===i[u]&&(i.push(i.splice(u,1)[0]),c--,u--);return{pathList:i,pathMap:a,nameMap:s}}function J(t,e){return k(t,[],e)}function Q(t,e){var r=K(t),n=r.pathList,o=r.pathMap,i=r.nameMap;function a(t,r,a){var s=V(t,r,!1,e),c=s.name;if(c){var p=i[c];if(!p)return u(null,s);var f=p.regex.keys.filter((function(t){return!t.optional})).map((function(t){return t.name}));if("object"!=typeof s.params&&(s.params={}),r&&"object"==typeof r.params)for(var h in r.params)!(h in s.params)&&f.indexOf(h)>-1&&(s.params[h]=r.params[h]);return s.path=M(p.path,s.params),u(p,s,a)}if(s.path){s.params={};for(var l=0;l<n.length;l++){var d=n[l],v=o[d];if(X(v.regex,s.path,s.params))return u(v,s,a)}}return u(null,s)}function s(t,r){var n=t.redirect,o="function"==typeof n?n(p(t,r,null,e)):n;if("string"==typeof o&&(o={path:o}),!o||"object"!=typeof o)return u(null,r);var s=o,c=s.name,f=s.path,h=r.query,l=r.hash,d=r.params;return h=s.hasOwnProperty("query")?s.query:h,l=s.hasOwnProperty("hash")?s.hash:l,d=s.hasOwnProperty("params")?s.params:d,c?(i[c],a({_normalized:!0,name:c,query:h,hash:l,params:d},void 0,r)):f?a({_normalized:!0,path:M(function(t,e){return b(t,e.parent?e.parent.path:"/",!0)}(f,t),d),query:h,hash:l},void 0,r):u(null,r)}function u(t,r,n){return t&&t.redirect?s(t,n||r):t&&t.matchAs?function(t,e,r){var n=a({_normalized:!0,path:M(r,e.params)});if(n){var o=n.matched,i=o[o.length-1];return e.params=n.params,u(i,e)}return u(null,e)}(0,r,t.matchAs):p(t,r,n,e)}return{match:a,addRoute:function(t,e){var r="object"!=typeof t?i[t]:void 0;K([e||t],n,o,i,r),r&&r.alias.length&&K(r.alias.map((function(t){return{path:t,children:[e]}})),n,o,i,r)},getRoutes:function(){return n.map((function(t){return o[t]}))},addRoutes:function(t){K(t,n,o,i)}}}function X(t,e,r){var n=e.match(t);if(!n)return!1;if(!r)return!0;for(var o=1,a=n.length;o<a;++o){var s=t.keys[o-1];s&&(r[s.name||"pathMatch"]="string"==typeof n[o]?i(n[o]):n[o])}return!0}var Y=D&&window.performance&&window.performance.now?window.performance:Date;function W(){return Y.now().toFixed(3)}var G=W();function Z(){return G}function tt(t){return G=t}var et=Object.create(null);function rt(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var e=window.location.protocol+"//"+window.location.host,r=window.location.href.replace(e,""),n=t({},window.history.state);return n.key=Z(),window.history.replaceState(n,"",r),window.addEventListener("popstate",it),function(){window.removeEventListener("popstate",it)}}function nt(t,e,r,n){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick((function(){var i=function(){var t=Z();if(t)return et[t]}(),a=o.call(t,e,r,n?i:null);a&&("function"==typeof a.then?a.then((function(t){pt(t,i)})).catch((function(t){})):pt(a,i))}))}}function ot(){var t=Z();t&&(et[t]={x:window.pageXOffset,y:window.pageYOffset})}function it(t){ot(),t.state&&t.state.key&&tt(t.state.key)}function at(t){return ut(t.x)||ut(t.y)}function st(t){return{x:ut(t.x)?t.x:window.pageXOffset,y:ut(t.y)?t.y:window.pageYOffset}}function ut(t){return"number"==typeof t}var ct=/^#\d/;function pt(t,e){var r,n="object"==typeof t;if(n&&"string"==typeof t.selector){var o=ct.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(o){var i=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){var r=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-r.left-e.x,y:n.top-r.top-e.y}}(o,i={x:ut((r=i).x)?r.x:0,y:ut(r.y)?r.y:0})}else at(t)&&(e=st(t))}else n&&at(t)&&(e=st(t));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}var ft,ht=D&&(-1===(ft=window.navigator.userAgent).indexOf("Android 2.")&&-1===ft.indexOf("Android 4.0")||-1===ft.indexOf("Mobile Safari")||-1!==ft.indexOf("Chrome")||-1!==ft.indexOf("Windows Phone"))&&window.history&&"function"==typeof window.history.pushState;function lt(e,r){ot();var n=window.history;try{if(r){var o=t({},n.state);o.key=Z(),n.replaceState(o,"",e)}else n.pushState({key:tt(W())},"",e)}catch(t){window.location[r?"replace":"assign"](e)}}function dt(t){lt(t,!0)}function vt(t,e,r){var n=function(o){o>=t.length?r():t[o]?e(t[o],(function(){n(o+1)})):n(o+1)};n(0)}var yt={redirected:2,aborted:4,cancelled:8,duplicated:16};function mt(t,e){return wt(t,e,yt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return bt.forEach((function(r){r in t&&(e[r]=t[r])})),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function gt(t,e){return wt(t,e,yt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function wt(t,e,r,n){var o=new Error(n);return o._isRouter=!0,o.from=t,o.to=e,o.type=r,o}var bt=["params","query","hash"];function xt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function Rt(t,e){return xt(t)&&t._isRouter&&(null==e||t.type===e)}function kt(t){return function(e,r,n){var o=!1,i=0,a=null;Et(t,(function(t,e,r,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var u,c=Ot((function(e){var o;((o=e).__esModule||At&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:H.extend(e),r.components[s]=e,--i<=0&&n()})),p=Ot((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=xt(t)?t:new Error(e),n(a))}));try{u=t(c,p)}catch(t){p(t)}if(u)if("function"==typeof u.then)u.then(c,p);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,p)}}})),o||n()}}function Et(t,e){return Ct(t.map((function(t){return Object.keys(t.components).map((function(r){return e(t.components[r],t.instances[r],t,r)}))})))}function Ct(t){return Array.prototype.concat.apply([],t)}var At="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ot(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var _t=function(t,e){this.router=t,this.base=function(t){if(!t)if(D){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=h,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function jt(t,e,r,n){var o=Et(t,(function(t,n,o,i){var a=function(t,e){return"function"!=typeof t&&(t=H.extend(t)),t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return r(t,n,o,i)})):r(a,n,o,i)}));return Ct(n?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}_t.prototype.listen=function(t){this.cb=t},_t.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},_t.prototype.onError=function(t){this.errorCbs.push(t)},_t.prototype.transitionTo=function(t,e,r){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(n,(function(){o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(n,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(n)})))}),(function(t){r&&r(t),t&&!o.ready&&(Rt(t,yt.redirected)&&i===h||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},_t.prototype.confirmTransition=function(t,e,r){var n=this,o=this.current;this.pending=t;var i,a,s=function(t){!Rt(t)&&xt(t)&&(n.errorCbs.length?n.errorCbs.forEach((function(e){e(t)})):console.error(t)),r&&r(t)},u=t.matched.length-1,c=o.matched.length-1;if(v(t,o)&&u===c&&t.matched[u]===o.matched[c])return this.ensureURL(),t.hash&&nt(this.router,o,t,!1),s(((a=wt(i=o,t,yt.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r<n&&t[r]===e[r];r++);return{updated:e.slice(0,r),activated:e.slice(r),deactivated:t.slice(r)}}(this.current.matched,t.matched),f=p.updated,h=p.deactivated,l=p.activated,d=[].concat(function(t){return jt(t,"beforeRouteLeave",Tt,!0)}(h),this.router.beforeHooks,function(t){return jt(t,"beforeRouteUpdate",Tt)}(f),l.map((function(t){return t.beforeEnter})),kt(l)),y=function(e,r){if(n.pending!==t)return s(gt(o,t));try{e(t,o,(function(e){!1===e?(n.ensureURL(!0),s(function(t,e){return wt(t,e,yt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}(o,t))):xt(e)?(n.ensureURL(!0),s(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(s(mt(o,t)),"object"==typeof e&&e.replace?n.replace(e):n.push(e)):r(e)}))}catch(t){s(t)}};vt(d,y,(function(){vt(function(t){return jt(t,"beforeRouteEnter",(function(t,e,r,n){return function(t,e,r){return function(n,o,i){return t(n,o,(function(t){"function"==typeof t&&(e.enteredCbs[r]||(e.enteredCbs[r]=[]),e.enteredCbs[r].push(t)),i(t)}))}}(t,r,n)}))}(l).concat(n.router.resolveHooks),y,(function(){if(n.pending!==t)return s(gt(o,t));n.pending=null,e(t),n.router.app&&n.router.app.$nextTick((function(){m(t)}))}))}))},_t.prototype.updateRoute=function(t){this.current=t,this.cb&&this.cb(t)},_t.prototype.setupListeners=function(){},_t.prototype.teardown=function(){this.listeners.forEach((function(t){t()})),this.listeners=[],this.current=h,this.pending=null};var St=function(t){function e(e,r){t.call(this,e,r),this._startLocation=Pt(this.base)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,r=e.options.scrollBehavior,n=ht&&r;n&&this.listeners.push(rt());var o=function(){var r=t.current,o=Pt(t.base);t.current===h&&o===t._startLocation||t.transitionTo(o,(function(t){n&&nt(e,t,r,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){lt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){dt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.ensureURL=function(t){if(Pt(this.base)!==this.current.fullPath){var e=x(this.base+this.current.fullPath);t?lt(e):dt(e)}},e.prototype.getCurrentLocation=function(){return Pt(this.base)},e}(_t);function Pt(t){var e=window.location.pathname,r=e.toLowerCase(),n=t.toLowerCase();return!t||r!==n&&0!==r.indexOf(x(n+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Lt=function(t){function e(e,r,n){t.call(this,e,r),n&&function(t){var e=Pt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||$t()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,r=ht&&e;r&&this.listeners.push(rt());var n=function(){var e=t.current;$t()&&t.transitionTo(qt(),(function(n){r&&nt(t.router,n,e,!0),ht||It(n.fullPath)}))},o=ht?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push((function(){window.removeEventListener(o,n)}))}},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Bt(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){It(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;qt()!==e&&(t?Bt(e):It(e))},e.prototype.getCurrentLocation=function(){return qt()},e}(_t);function $t(){var t=qt();return"/"===t.charAt(0)||(It("/"+t),!1)}function qt(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ut(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function Bt(t){ht?lt(Ut(t)):window.location.hash=t}function It(t){ht?dt(Ut(t)):window.location.replace(Ut(t))}var Mt=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)}),r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,(function(){var t=e.current;e.index=r,e.updateRoute(n),e.router.afterHooks.forEach((function(e){e&&e(n,t)}))}),(function(t){Rt(t,yt.duplicated)&&(e.index=r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(_t),Vt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ht&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Mt(this,t.base)}},Ht={currentRoute:{configurable:!0}};function Nt(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}return Vt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},Ht.currentRoute.get=function(){return this.history&&this.history.current},Vt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var r=this.history;if(r instanceof St||r instanceof Lt){var n=function(t){r.setupListeners(),function(t){var n=r.current,o=e.options.scrollBehavior;ht&&o&&"fullPath"in t&&nt(e,t,n,!1)}(t)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Vt.prototype.beforeEach=function(t){return Nt(this.beforeHooks,t)},Vt.prototype.beforeResolve=function(t){return Nt(this.resolveHooks,t)},Vt.prototype.afterEach=function(t){return Nt(this.afterHooks,t)},Vt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Vt.prototype.onError=function(t){this.history.onError(t)},Vt.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.push(t,e,r)}));this.history.push(t,e,r)},Vt.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.replace(t,e,r)}));this.history.replace(t,e,r)},Vt.prototype.go=function(t){this.history.go(t)},Vt.prototype.back=function(){this.go(-1)},Vt.prototype.forward=function(){this.go(1)},Vt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Vt.prototype.resolve=function(t,e,r){var n=V(t,e=e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,r){var n="hash"===r?"#"+e:e;return t?x(t+"/"+n):n}(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},Vt.prototype.getRoutes=function(){return this.matcher.getRoutes()},Vt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Vt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Vt.prototype,Ht),Vt.install=function t(e){if(!t.installed||H!==e){t.installed=!0,H=e;var r=function(t){return void 0!==t},n=function(t,e){var n=t.$options._parentVnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};e.mixin({beforeCreate:function(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",g),e.component("RouterLink",F);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Vt.version="3.5.4",Vt.isNavigationFailure=Rt,Vt.NavigationFailureType=yt,Vt.START_LOCATION=h,D&&window.Vue&&window.Vue.use(Vt),Vt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VueRouter=e(); | ||
var t,e;t=this,e=function(){"use strict";function t(t,e){for(var r in e)t[r]=e[r];return t}var e=/[!'()*]/g,r=function(t){return"%"+t.charCodeAt(0).toString(16)},n=/%2C/g,o=function(t){return encodeURIComponent(t).replace(e,r).replace(n,",")};function i(t){try{return decodeURIComponent(t)}catch(t){}return t}var a=function(t){return null==t||"object"==typeof t?t:String(t)};function s(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var r=t.replace(/\+/g," ").split("="),n=i(r.shift()),o=r.length>0?i(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}function u(t){var e=t?Object.keys(t).map((function(e){var r=t[e];if(void 0===r)return"";if(null===r)return o(e);if(Array.isArray(r)){var n=[];return r.forEach((function(t){void 0!==t&&(null===t?n.push(o(e)):n.push(o(e)+"="+o(t)))})),n.join("&")}return o(e)+"="+o(r)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var c=/\/?$/;function p(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=f(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?l(t):[]};return r&&(a.redirectedFrom=d(r,o)),Object.freeze(a)}function f(t){if(Array.isArray(t))return t.map(f);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=f(t[r]);return e}return t}var h=p(null,{path:"/"});function l(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function d(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||u)(n)+o}function v(t,e,r){return e===h?t===e:!!e&&(t.path&&e.path?t.path.replace(c,"")===e.path.replace(c,"")&&(r||t.hash===e.hash&&y(t.query,e.query)):!(!t.name||!e.name)&&t.name===e.name&&(r||t.hash===e.hash&&y(t.query,e.query)&&y(t.params,e.params)))}function y(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t).sort(),n=Object.keys(e).sort();return r.length===n.length&&r.every((function(r,o){var i=t[r];if(n[o]!==r)return!1;var a=e[r];return null==i||null==a?i===a:"object"==typeof i&&"object"==typeof a?y(i,a):String(i)===String(a)}))}function m(t){for(var e=0;e<t.matched.length;e++){var r=t.matched[e];for(var n in r.instances){var o=r.instances[n],i=r.enteredCbs[n];if(o&&i){delete r.enteredCbs[n];for(var a=0;a<i.length;a++)o._isBeingDestroyed||i[a](o)}}}}var g={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,r){var n=r.props,o=r.children,i=r.parent,a=r.data;a.routerView=!0;for(var s=i.$createElement,u=n.name,c=i.$route,p=i._routerViewCache||(i._routerViewCache={}),f=0,h=!1;i&&i._routerRoot!==i;){var l=i.$vnode?i.$vnode.data:{};l.routerView&&f++,l.keepAlive&&i._directInactive&&i._inactive&&(h=!0),i=i.$parent}if(a.routerViewDepth=f,h){var d=p[u],v=d&&d.component;return v?(d.configProps&&w(v,a,d.route,d.configProps),s(v,a,o)):s()}var y=c.matched[f],g=y&&y.components[u];if(!y||!g)return p[u]=null,s();p[u]={component:g},a.registerRouteInstance=function(t,e){var r=y.instances[u];(e&&r!==t||!e&&r===t)&&(y.instances[u]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){y.instances[u]=e.componentInstance},a.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==y.instances[u]&&(y.instances[u]=t.componentInstance),m(c)};var b=y.props&&y.props[u];return b&&(t(p[u],{route:c,configProps:b}),w(g,a,c,b)),s(g,a,o)}};function w(e,r,n,o){var i=r.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(n,o);if(i){i=r.props=t({},i);var a=r.attrs=r.attrs||{};for(var s in i)e.props&&s in e.props||(a[s]=i[s],delete i[s])}}function b(t,e,r){var n=t.charAt(0);if("/"===n)return t;if("?"===n||"#"===n)return e+t;var o=e.split("/");r&&o[o.length-1]||o.pop();for(var i=t.replace(/^\//,"").split("/"),a=0;a<i.length;a++){var s=i[a];".."===s?o.pop():"."!==s&&o.push(s)}return""!==o[0]&&o.unshift(""),o.join("/")}function x(t){return t.replace(/\/(?:\s*\/)+/g,"/")}var R=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},k=B,E=j,C=function(t,e){return S(j(t,e),e)},A=S,O=U,_=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function j(t,e){for(var r,n=[],o=0,i=0,a="",s=e&&e.delimiter||"/";null!=(r=_.exec(t));){var u=r[0],c=r[1],p=r.index;if(a+=t.slice(i,p),i=p+u.length,c)a+=c[1];else{var f=t[i],h=r[2],l=r[3],d=r[4],v=r[5],y=r[6],m=r[7];a&&(n.push(a),a="");var g=null!=h&&null!=f&&f!==h,w="+"===y||"*"===y,b="?"===y||"*"===y,x=r[2]||s,R=d||v;n.push({name:l||o++,prefix:h||"",delimiter:x,optional:b,repeat:w,partial:g,asterisk:!!m,pattern:R?L(R):m?".*":"[^"+P(x)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&n.push(a),n}function T(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function S(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(r[n]=new RegExp("^(?:"+t[n].pattern+")$",q(e)));return function(e,n){for(var o="",i=e||{},a=(n||{}).pretty?T:encodeURIComponent,s=0;s<t.length;s++){var u=t[s];if("string"!=typeof u){var c,p=i[u.name];if(null==p){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(R(p)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var f=0;f<p.length;f++){if(c=a(p[f]),!r[s].test(c))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(c)+"`");o+=(0===f?u.prefix:u.delimiter)+c}}else{if(c=u.asterisk?encodeURI(p).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):a(p),!r[s].test(c))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+c+'"');o+=u.prefix+c}}else o+=u}return o}}function P(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function L(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function $(t,e){return t.keys=e,t}function q(t){return t&&t.sensitive?"":"i"}function U(t,e,r){R(e)||(r=e||r,e=[]);for(var n=(r=r||{}).strict,o=!1!==r.end,i="",a=0;a<t.length;a++){var s=t[a];if("string"==typeof s)i+=P(s);else{var u=P(s.prefix),c="(?:"+s.pattern+")";e.push(s),s.repeat&&(c+="(?:"+u+c+")*"),i+=c=s.optional?s.partial?u+"("+c+")?":"(?:"+u+"("+c+"))?":u+"("+c+")"}}var p=P(r.delimiter||"/"),f=i.slice(-p.length)===p;return n||(i=(f?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":n&&f?"":"(?="+p+"|$)",$(new RegExp("^"+i,q(r)),e)}function B(t,e,r){return R(e)||(r=e||r,e=[]),r=r||{},t instanceof RegExp?function(t,e){var r=t.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)e.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return $(t,e)}(t,e):R(t)?function(t,e,r){for(var n=[],o=0;o<t.length;o++)n.push(B(t[o],e,r).source);return $(new RegExp("(?:"+n.join("|")+")",q(r)),e)}(t,e,r):function(t,e,r){return U(j(t,r),e,r)}(t,e,r)}k.parse=E,k.compile=C,k.tokensToFunction=A,k.tokensToRegExp=O;var I=Object.create(null);function M(t,e,r){e=e||{};try{var n=I[t]||(I[t]=k.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function V(e,r,n,o){var i="string"==typeof e?{path:e}:e;if(i._normalized)return i;if(i.name){var u=(i=t({},e)).params;return u&&"object"==typeof u&&(i.params=t({},u)),i}if(!i.path&&i.params&&r){(i=t({},i))._normalized=!0;var c=t(t({},r.params),i.params);if(r.name)i.name=r.name,i.params=c;else if(r.matched.length){var p=r.matched[r.matched.length-1].path;i.path=M(p,c,r.path)}return i}var f=function(t){var e="",r="",n=t.indexOf("#");n>=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(i.path||""),h=r&&r.path||"/",l=f.path?b(f.path,h,n||i.append):h,d=function(t,e,r){void 0===e&&(e={});var n,o=r||s;try{n=o(t||"")}catch(t){n={}}for(var i in e){var u=e[i];n[i]=Array.isArray(u)?u.map(a):a(u)}return n}(f.query,i.query,o&&o.options.parseQuery),v=i.hash||f.hash;return v&&"#"!==v.charAt(0)&&(v="#"+v),{_normalized:!0,path:l,query:d,hash:v}}var H,N=function(){},F={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var r=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),a=i.location,s=i.route,u=i.href,f={},h=n.options.linkActiveClass,l=n.options.linkExactActiveClass,d=null==h?"router-link-active":h,y=null==l?"router-link-exact-active":l,m=null==this.activeClass?d:this.activeClass,g=null==this.exactActiveClass?y:this.exactActiveClass,w=s.redirectedFrom?p(null,V(s.redirectedFrom),null,n):s;f[g]=v(o,w,this.exactPath),f[m]=this.exact||this.exactPath?f[g]:function(t,e){return 0===t.path.replace(c,"/").indexOf(e.path.replace(c,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(o,w);var b=f[g]?this.ariaCurrentValue:null,x=function(t){z(t)&&(r.replace?n.replace(a,N):n.push(a,N))},R={click:z};Array.isArray(this.event)?this.event.forEach((function(t){R[t]=x})):R[this.event]=x;var k={class:f},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:s,navigate:x,isActive:f[m],isExactActive:f[g]});if(E){if(1===E.length)return E[0];if(E.length>1||!E.length)return 0===E.length?e():e("span",{},E)}if("a"===this.tag)k.on=R,k.attrs={href:u,"aria-current":b};else{var C=function t(e){var r;if(e)for(var n=0;n<e.length;n++){if("a"===(r=e[n]).tag)return r;if(r.children&&(r=t(r.children)))return r}}(this.$slots.default);if(C){C.isStatic=!1;var A=C.data=t({},C.data);for(var O in A.on=A.on||{},A.on){var _=A.on[O];O in R&&(A.on[O]=Array.isArray(_)?_:[_])}for(var j in R)j in A.on?A.on[j].push(R[j]):A.on[j]=x;var T=C.data.attrs=t({},C.data.attrs);T.href=u,T["aria-current"]=b}else k.on=R}return e(this.tag,k,this.$slots.default)}};function z(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}var D="undefined"!=typeof window;function K(t,e,r,n,o){var i=e||[],a=r||Object.create(null),s=n||Object.create(null);t.forEach((function(t){!function t(e,r,n,o,i,a){var s=o.path,u=o.name,c=o.pathToRegexpOptions||{},p=function(t,e,r){return r||(t=t.replace(/\/$/,"")),"/"===t[0]||null==e?t:x(e.path+"/"+t)}(s,i,c.strict);"boolean"==typeof o.caseSensitive&&(c.sensitive=o.caseSensitive);var f={path:p,regex:J(p,c),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:u,parent:i,matchAs:a,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};if(o.children&&o.children.forEach((function(o){var i=a?x(a+"/"+o.path):void 0;t(e,r,n,o,f,i)})),r[f.path]||(e.push(f.path),r[f.path]=f),void 0!==o.alias)for(var h=Array.isArray(o.alias)?o.alias:[o.alias],l=0;l<h.length;++l){var d={path:h[l],children:o.children};t(e,r,n,d,i,f.path||"/")}u&&(n[u]||(n[u]=f))}(i,a,s,t,o)}));for(var u=0,c=i.length;u<c;u++)"*"===i[u]&&(i.push(i.splice(u,1)[0]),c--,u--);return{pathList:i,pathMap:a,nameMap:s}}function J(t,e){return k(t,[],e)}function Q(t,e){var r=K(t),n=r.pathList,o=r.pathMap,i=r.nameMap;function a(t,r,a){var s=V(t,r,!1,e),c=s.name;if(c){var p=i[c];if(!p)return u(null,s);var f=p.regex.keys.filter((function(t){return!t.optional})).map((function(t){return t.name}));if("object"!=typeof s.params&&(s.params={}),r&&"object"==typeof r.params)for(var h in r.params)!(h in s.params)&&f.indexOf(h)>-1&&(s.params[h]=r.params[h]);return s.path=M(p.path,s.params),u(p,s,a)}if(s.path){s.params={};for(var l=0;l<n.length;l++){var d=n[l],v=o[d];if(X(v.regex,s.path,s.params))return u(v,s,a)}}return u(null,s)}function s(t,r){var n=t.redirect,o="function"==typeof n?n(p(t,r,null,e)):n;if("string"==typeof o&&(o={path:o}),!o||"object"!=typeof o)return u(null,r);var s=o,c=s.name,f=s.path,h=r.query,l=r.hash,d=r.params;return h=s.hasOwnProperty("query")?s.query:h,l=s.hasOwnProperty("hash")?s.hash:l,d=s.hasOwnProperty("params")?s.params:d,c?(i[c],a({_normalized:!0,name:c,query:h,hash:l,params:d},void 0,r)):f?a({_normalized:!0,path:M(function(t,e){return b(t,e.parent?e.parent.path:"/",!0)}(f,t),d),query:h,hash:l},void 0,r):u(null,r)}function u(t,r,n){return t&&t.redirect?s(t,n||r):t&&t.matchAs?function(t,e,r){var n=a({_normalized:!0,path:M(r,e.params)});if(n){var o=n.matched,i=o[o.length-1];return e.params=n.params,u(i,e)}return u(null,e)}(0,r,t.matchAs):p(t,r,n,e)}return{match:a,addRoute:function(t,e){var r="object"!=typeof t?i[t]:void 0;K([e||t],n,o,i,r),r&&r.alias.length&&K(r.alias.map((function(t){return{path:t,children:[e]}})),n,o,i,r)},getRoutes:function(){return n.map((function(t){return o[t]}))},addRoutes:function(t){K(t,n,o,i)}}}function X(t,e,r){var n=e.match(t);if(!n)return!1;if(!r)return!0;for(var o=1,a=n.length;o<a;++o){var s=t.keys[o-1];s&&(r[s.name||"pathMatch"]="string"==typeof n[o]?i(n[o]):n[o])}return!0}var Y=D&&window.performance&&window.performance.now?window.performance:Date;function W(){return Y.now().toFixed(3)}var G=W();function Z(){return G}function tt(t){return G=t}var et=Object.create(null);function rt(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var e=window.location.protocol+"//"+window.location.host,r=window.location.href.replace(e,""),n=t({},window.history.state);return n.key=Z(),window.history.replaceState(n,"",r),window.addEventListener("popstate",it),function(){window.removeEventListener("popstate",it)}}function nt(t,e,r,n){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick((function(){var i=function(){var t=Z();if(t)return et[t]}(),a=o.call(t,e,r,n?i:null);a&&("function"==typeof a.then?a.then((function(t){pt(t,i)})).catch((function(t){})):pt(a,i))}))}}function ot(){var t=Z();t&&(et[t]={x:window.pageXOffset,y:window.pageYOffset})}function it(t){ot(),t.state&&t.state.key&&tt(t.state.key)}function at(t){return ut(t.x)||ut(t.y)}function st(t){return{x:ut(t.x)?t.x:window.pageXOffset,y:ut(t.y)?t.y:window.pageYOffset}}function ut(t){return"number"==typeof t}var ct=/^#\d/;function pt(t,e){var r,n="object"==typeof t;if(n&&"string"==typeof t.selector){var o=ct.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(o){var i=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){var r=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-r.left-e.x,y:n.top-r.top-e.y}}(o,i={x:ut((r=i).x)?r.x:0,y:ut(r.y)?r.y:0})}else at(t)&&(e=st(t))}else n&&at(t)&&(e=st(t));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}var ft,ht=D&&(-1===(ft=window.navigator.userAgent).indexOf("Android 2.")&&-1===ft.indexOf("Android 4.0")||-1===ft.indexOf("Mobile Safari")||-1!==ft.indexOf("Chrome")||-1!==ft.indexOf("Windows Phone"))&&window.history&&"function"==typeof window.history.pushState;function lt(e,r){ot();var n=window.history;try{if(r){var o=t({},n.state);o.key=Z(),n.replaceState(o,"",e)}else n.pushState({key:tt(W())},"",e)}catch(t){window.location[r?"replace":"assign"](e)}}function dt(t){lt(t,!0)}var vt={redirected:2,aborted:4,cancelled:8,duplicated:16};function yt(t,e){return gt(t,e,vt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return wt.forEach((function(r){r in t&&(e[r]=t[r])})),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function mt(t,e){return gt(t,e,vt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function gt(t,e,r,n){var o=new Error(n);return o._isRouter=!0,o.from=t,o.to=e,o.type=r,o}var wt=["params","query","hash"];function bt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function xt(t,e){return bt(t)&&t._isRouter&&(null==e||t.type===e)}function Rt(t,e,r){var n=function(o){o>=t.length?r():t[o]?e(t[o],(function(){n(o+1)})):n(o+1)};n(0)}function kt(t){return function(e,r,n){var o=!1,i=0,a=null;Et(t,(function(t,e,r,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var u,c=Ot((function(e){var o;((o=e).__esModule||At&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:H.extend(e),r.components[s]=e,--i<=0&&n()})),p=Ot((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=bt(t)?t:new Error(e),n(a))}));try{u=t(c,p)}catch(t){p(t)}if(u)if("function"==typeof u.then)u.then(c,p);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,p)}}})),o||n()}}function Et(t,e){return Ct(t.map((function(t){return Object.keys(t.components).map((function(r){return e(t.components[r],t.instances[r],t,r)}))})))}function Ct(t){return Array.prototype.concat.apply([],t)}var At="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ot(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var _t=function(t,e){this.router=t,this.base=function(t){if(!t)if(D){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=h,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function jt(t,e,r,n){var o=Et(t,(function(t,n,o,i){var a=function(t,e){return"function"!=typeof t&&(t=H.extend(t)),t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return r(t,n,o,i)})):r(a,n,o,i)}));return Ct(n?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}_t.prototype.listen=function(t){this.cb=t},_t.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},_t.prototype.onError=function(t){this.errorCbs.push(t)},_t.prototype.transitionTo=function(t,e,r){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(n,(function(){o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(n,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(n)})))}),(function(t){r&&r(t),t&&!o.ready&&(xt(t,vt.redirected)&&i===h||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},_t.prototype.confirmTransition=function(t,e,r){var n=this,o=this.current;this.pending=t;var i,a,s=function(t){!xt(t)&&bt(t)&&(n.errorCbs.length?n.errorCbs.forEach((function(e){e(t)})):console.error(t)),r&&r(t)},u=t.matched.length-1,c=o.matched.length-1;if(v(t,o)&&u===c&&t.matched[u]===o.matched[c])return this.ensureURL(),t.hash&&nt(this.router,o,t,!1),s(((a=gt(i=o,t,vt.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r<n&&t[r]===e[r];r++);return{updated:e.slice(0,r),activated:e.slice(r),deactivated:t.slice(r)}}(this.current.matched,t.matched),f=p.updated,h=p.deactivated,l=p.activated,d=[].concat(function(t){return jt(t,"beforeRouteLeave",Tt,!0)}(h),this.router.beforeHooks,function(t){return jt(t,"beforeRouteUpdate",Tt)}(f),l.map((function(t){return t.beforeEnter})),kt(l)),y=function(e,r){if(n.pending!==t)return s(mt(o,t));try{e(t,o,(function(e){!1===e?(n.ensureURL(!0),s(function(t,e){return gt(t,e,vt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}(o,t))):bt(e)?(n.ensureURL(!0),s(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(s(yt(o,t)),"object"==typeof e&&e.replace?n.replace(e):n.push(e)):r(e)}))}catch(t){s(t)}};Rt(d,y,(function(){Rt(function(t){return jt(t,"beforeRouteEnter",(function(t,e,r,n){return function(t,e,r){return function(n,o,i){return t(n,o,(function(t){"function"==typeof t&&(e.enteredCbs[r]||(e.enteredCbs[r]=[]),e.enteredCbs[r].push(t)),i(t)}))}}(t,r,n)}))}(l).concat(n.router.resolveHooks),y,(function(){if(n.pending!==t)return s(mt(o,t));n.pending=null,e(t),n.router.app&&n.router.app.$nextTick((function(){m(t)}))}))}))},_t.prototype.updateRoute=function(t){this.current=t,this.cb&&this.cb(t)},_t.prototype.setupListeners=function(){},_t.prototype.teardown=function(){this.listeners.forEach((function(t){t()})),this.listeners=[],this.current=h,this.pending=null};var St=function(t){function e(e,r){t.call(this,e,r),this._startLocation=Pt(this.base)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,r=e.options.scrollBehavior,n=ht&&r;n&&this.listeners.push(rt());var o=function(){var r=t.current,o=Pt(t.base);t.current===h&&o===t._startLocation||t.transitionTo(o,(function(t){n&&nt(e,t,r,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){lt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){dt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.ensureURL=function(t){if(Pt(this.base)!==this.current.fullPath){var e=x(this.base+this.current.fullPath);t?lt(e):dt(e)}},e.prototype.getCurrentLocation=function(){return Pt(this.base)},e}(_t);function Pt(t){var e=window.location.pathname,r=e.toLowerCase(),n=t.toLowerCase();return!t||r!==n&&0!==r.indexOf(x(n+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Lt=function(t){function e(e,r,n){t.call(this,e,r),n&&function(t){var e=Pt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||$t()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,r=ht&&e;r&&this.listeners.push(rt());var n=function(){var e=t.current;$t()&&t.transitionTo(qt(),(function(n){r&&nt(t.router,n,e,!0),ht||It(n.fullPath)}))},o=ht?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push((function(){window.removeEventListener(o,n)}))}},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Bt(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){It(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;qt()!==e&&(t?Bt(e):It(e))},e.prototype.getCurrentLocation=function(){return qt()},e}(_t);function $t(){var t=qt();return"/"===t.charAt(0)||(It("/"+t),!1)}function qt(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ut(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function Bt(t){ht?lt(Ut(t)):window.location.hash=t}function It(t){ht?dt(Ut(t)):window.location.replace(Ut(t))}var Mt=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)}),r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,(function(){var t=e.current;e.index=r,e.updateRoute(n),e.router.afterHooks.forEach((function(e){e&&e(n,t)}))}),(function(t){xt(t,vt.duplicated)&&(e.index=r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(_t),Vt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ht&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Mt(this,t.base)}},Ht={currentRoute:{configurable:!0}};Vt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},Ht.currentRoute.get=function(){return this.history&&this.history.current},Vt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var r=this.history;if(r instanceof St||r instanceof Lt){var n=function(t){r.setupListeners(),function(t){var n=r.current,o=e.options.scrollBehavior;ht&&o&&"fullPath"in t&&nt(e,t,n,!1)}(t)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Vt.prototype.beforeEach=function(t){return Ft(this.beforeHooks,t)},Vt.prototype.beforeResolve=function(t){return Ft(this.resolveHooks,t)},Vt.prototype.afterEach=function(t){return Ft(this.afterHooks,t)},Vt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Vt.prototype.onError=function(t){this.history.onError(t)},Vt.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.push(t,e,r)}));this.history.push(t,e,r)},Vt.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.replace(t,e,r)}));this.history.replace(t,e,r)},Vt.prototype.go=function(t){this.history.go(t)},Vt.prototype.back=function(){this.go(-1)},Vt.prototype.forward=function(){this.go(1)},Vt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Vt.prototype.resolve=function(t,e,r){var n=V(t,e=e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,r){var n="hash"===r?"#"+e:e;return t?x(t+"/"+n):n}(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},Vt.prototype.getRoutes=function(){return this.matcher.getRoutes()},Vt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Vt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Vt.prototype,Ht);var Nt=Vt;function Ft(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}return D&&window.Vue&&window.Vue.use(Vt),Vt.install=function t(e){if(!t.installed||H!==e){t.installed=!0,H=e;var r=function(t){return void 0!==t},n=function(t,e){var n=t.$options._parentVnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};e.mixin({beforeCreate:function(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",g),e.component("RouterLink",F);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Vt.version="3.6.0",Vt.isNavigationFailure=xt,Vt.NavigationFailureType=vt,Vt.START_LOCATION=h,Nt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VueRouter=e(); |
{ | ||
"name": "vue-router", | ||
"version": "3.5.4", | ||
"version": "3.6.0", | ||
"description": "Official router for Vue.js 2", | ||
@@ -20,2 +20,3 @@ "author": "Evan You", | ||
"dist/*.js", | ||
"dist/*.mjs", | ||
"types/*.d.ts", | ||
@@ -25,2 +26,20 @@ "vetur/tags.json", | ||
], | ||
"exports": { | ||
".": { | ||
"import": { | ||
"node": "./dist/vue-router.mjs", | ||
"default": "./dist/vue-router.esm.js" | ||
}, | ||
"require": "./dist/vue-router.common.js", | ||
"types": "./types/index.d.ts" | ||
}, | ||
"./composables": { | ||
"import": "./dist/composables.mjs", | ||
"require": "./dist/composables.js", | ||
"types": "./types/composables.d.ts" | ||
}, | ||
"./dist/*": "./dist/*", | ||
"./types/*": "./types/*", | ||
"./package.json": "./package.json" | ||
}, | ||
"vetur": { | ||
@@ -78,3 +97,3 @@ "tags": "vetur/tags.json", | ||
"buble": "^0.19.8", | ||
"chromedriver": "^90.0.0", | ||
"chromedriver": "^96.0.0", | ||
"conventional-changelog-cli": "^2.0.11", | ||
@@ -105,7 +124,7 @@ "cross-spawn": "^7.0.3", | ||
"terser": "^4.2.0", | ||
"typescript": "^3.5.2", | ||
"vue": "^2.6.12", | ||
"typescript": "^4.7.0", | ||
"vue": "^2.7.0", | ||
"vue-loader": "^15.9.3", | ||
"vue-server-renderer": "^2.6.12", | ||
"vue-template-compiler": "^2.6.12", | ||
"vue-server-renderer": "^2.7.0", | ||
"vue-template-compiler": "^2.7.0", | ||
"vuepress": "^1.5.3", | ||
@@ -112,0 +131,0 @@ "vuepress-theme-vue": "^1.1.1", |
# vue-router [![Build Status](https://img.shields.io/circleci/project/github/vuejs/vue-router/dev.svg)](https://circleci.com/gh/vuejs/vue-router) | ||
> This is vue-router 3.0 which works only with Vue 2.0. For the 1.x router see the [1.0 branch](https://github.com/vuejs/vue-router/tree/1.0). | ||
> This is vue-router 3.0 which works only with Vue 2.0. | ||
> - For the 1.x router see the [1.0 branch](https://github.com/vuejs/vue-router/tree/1.0). | ||
> - For Vue Router 4 (for Vue 3) see [vuejs/router](https://github.com/vuejs/router). | ||
@@ -13,11 +15,2 @@ <h2 align="center">Supporting Vue Router</h2> | ||
<!--sponsors start--> | ||
<h3 align="center">Platinum Sponsors</h3> | ||
<p align="center"> | ||
<a href="https://www.finclip.com/#/home?from=vue" target="_blank" rel="noopener noreferrer"> | ||
<picture> | ||
<source srcset="https://posva-sponsors.pages.dev/logos/fincliplogo_white_svg.svg" media="(prefers-color-scheme: dark)" height="96px" alt="Finogeeks" /> | ||
<img src="https://posva-sponsors.pages.dev/logos/fincliplogo_black_svg.svg" height="96px" alt="Finogeeks" /> | ||
</picture> | ||
</a> | ||
</p> | ||
@@ -48,8 +41,2 @@ <h4 align="center">Gold Sponsors</h4> | ||
</a> | ||
<a href="https://birdeatsbug.com/?utm_source=vuerouter&utm_medium=sponsor&utm_campaign=silver" target="_blank" rel="noopener noreferrer"> | ||
<picture> | ||
<source srcset="https://posva-sponsors.pages.dev/logos/birdeatsbug-light.svg" media="(prefers-color-scheme: dark)" height="42px" alt="Bird Eats Bug" /> | ||
<img src="https://posva-sponsors.pages.dev/logos/birdeatsbug-dark.svg" height="42px" alt="Bird Eats Bug" /> | ||
</picture> | ||
</a> | ||
</p> | ||
@@ -56,0 +43,0 @@ |
@@ -192,3 +192,3 @@ /* @flow */ | ||
function guardEvent (e) { | ||
export function guardEvent (e: any) { | ||
// don't redirect with control keys | ||
@@ -195,0 +195,0 @@ if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return |
295
src/index.js
@@ -1,294 +0,3 @@ | ||
/* @flow */ | ||
import VueRouter from './entries/cjs' | ||
import { install } from './install' | ||
import { START } from './util/route' | ||
import { assert, warn } from './util/warn' | ||
import { inBrowser } from './util/dom' | ||
import { cleanPath } from './util/path' | ||
import { createMatcher } from './create-matcher' | ||
import { normalizeLocation } from './util/location' | ||
import { supportsPushState } from './util/push-state' | ||
import { handleScroll } from './util/scroll' | ||
import { HashHistory } from './history/hash' | ||
import { HTML5History } from './history/html5' | ||
import { AbstractHistory } from './history/abstract' | ||
import type { Matcher } from './create-matcher' | ||
import { isNavigationFailure, NavigationFailureType } from './util/errors' | ||
export default class VueRouter { | ||
static install: () => void | ||
static version: string | ||
static isNavigationFailure: Function | ||
static NavigationFailureType: any | ||
static START_LOCATION: Route | ||
app: any | ||
apps: Array<any> | ||
ready: boolean | ||
readyCbs: Array<Function> | ||
options: RouterOptions | ||
mode: string | ||
history: HashHistory | HTML5History | AbstractHistory | ||
matcher: Matcher | ||
fallback: boolean | ||
beforeHooks: Array<?NavigationGuard> | ||
resolveHooks: Array<?NavigationGuard> | ||
afterHooks: Array<?AfterNavigationHook> | ||
constructor (options: RouterOptions = {}) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
warn(this instanceof VueRouter, `Router must be called with the new operator.`) | ||
} | ||
this.app = null | ||
this.apps = [] | ||
this.options = options | ||
this.beforeHooks = [] | ||
this.resolveHooks = [] | ||
this.afterHooks = [] | ||
this.matcher = createMatcher(options.routes || [], this) | ||
let mode = options.mode || 'hash' | ||
this.fallback = | ||
mode === 'history' && !supportsPushState && options.fallback !== false | ||
if (this.fallback) { | ||
mode = 'hash' | ||
} | ||
if (!inBrowser) { | ||
mode = 'abstract' | ||
} | ||
this.mode = mode | ||
switch (mode) { | ||
case 'history': | ||
this.history = new HTML5History(this, options.base) | ||
break | ||
case 'hash': | ||
this.history = new HashHistory(this, options.base, this.fallback) | ||
break | ||
case 'abstract': | ||
this.history = new AbstractHistory(this, options.base) | ||
break | ||
default: | ||
if (process.env.NODE_ENV !== 'production') { | ||
assert(false, `invalid mode: ${mode}`) | ||
} | ||
} | ||
} | ||
match (raw: RawLocation, current?: Route, redirectedFrom?: Location): Route { | ||
return this.matcher.match(raw, current, redirectedFrom) | ||
} | ||
get currentRoute (): ?Route { | ||
return this.history && this.history.current | ||
} | ||
init (app: any /* Vue component instance */) { | ||
process.env.NODE_ENV !== 'production' && | ||
assert( | ||
install.installed, | ||
`not installed. Make sure to call \`Vue.use(VueRouter)\` ` + | ||
`before creating root instance.` | ||
) | ||
this.apps.push(app) | ||
// set up app destroyed handler | ||
// https://github.com/vuejs/vue-router/issues/2639 | ||
app.$once('hook:destroyed', () => { | ||
// clean out app from this.apps array once destroyed | ||
const index = this.apps.indexOf(app) | ||
if (index > -1) this.apps.splice(index, 1) | ||
// ensure we still have a main app or null if no apps | ||
// we do not release the router so it can be reused | ||
if (this.app === app) this.app = this.apps[0] || null | ||
if (!this.app) this.history.teardown() | ||
}) | ||
// main app previously initialized | ||
// return as we don't need to set up new history listener | ||
if (this.app) { | ||
return | ||
} | ||
this.app = app | ||
const history = this.history | ||
if (history instanceof HTML5History || history instanceof HashHistory) { | ||
const handleInitialScroll = routeOrError => { | ||
const from = history.current | ||
const expectScroll = this.options.scrollBehavior | ||
const supportsScroll = supportsPushState && expectScroll | ||
if (supportsScroll && 'fullPath' in routeOrError) { | ||
handleScroll(this, routeOrError, from, false) | ||
} | ||
} | ||
const setupListeners = routeOrError => { | ||
history.setupListeners() | ||
handleInitialScroll(routeOrError) | ||
} | ||
history.transitionTo( | ||
history.getCurrentLocation(), | ||
setupListeners, | ||
setupListeners | ||
) | ||
} | ||
history.listen(route => { | ||
this.apps.forEach(app => { | ||
app._route = route | ||
}) | ||
}) | ||
} | ||
beforeEach (fn: Function): Function { | ||
return registerHook(this.beforeHooks, fn) | ||
} | ||
beforeResolve (fn: Function): Function { | ||
return registerHook(this.resolveHooks, fn) | ||
} | ||
afterEach (fn: Function): Function { | ||
return registerHook(this.afterHooks, fn) | ||
} | ||
onReady (cb: Function, errorCb?: Function) { | ||
this.history.onReady(cb, errorCb) | ||
} | ||
onError (errorCb: Function) { | ||
this.history.onError(errorCb) | ||
} | ||
push (location: RawLocation, onComplete?: Function, onAbort?: Function) { | ||
// $flow-disable-line | ||
if (!onComplete && !onAbort && typeof Promise !== 'undefined') { | ||
return new Promise((resolve, reject) => { | ||
this.history.push(location, resolve, reject) | ||
}) | ||
} else { | ||
this.history.push(location, onComplete, onAbort) | ||
} | ||
} | ||
replace (location: RawLocation, onComplete?: Function, onAbort?: Function) { | ||
// $flow-disable-line | ||
if (!onComplete && !onAbort && typeof Promise !== 'undefined') { | ||
return new Promise((resolve, reject) => { | ||
this.history.replace(location, resolve, reject) | ||
}) | ||
} else { | ||
this.history.replace(location, onComplete, onAbort) | ||
} | ||
} | ||
go (n: number) { | ||
this.history.go(n) | ||
} | ||
back () { | ||
this.go(-1) | ||
} | ||
forward () { | ||
this.go(1) | ||
} | ||
getMatchedComponents (to?: RawLocation | Route): Array<any> { | ||
const route: any = to | ||
? to.matched | ||
? to | ||
: this.resolve(to).route | ||
: this.currentRoute | ||
if (!route) { | ||
return [] | ||
} | ||
return [].concat.apply( | ||
[], | ||
route.matched.map(m => { | ||
return Object.keys(m.components).map(key => { | ||
return m.components[key] | ||
}) | ||
}) | ||
) | ||
} | ||
resolve ( | ||
to: RawLocation, | ||
current?: Route, | ||
append?: boolean | ||
): { | ||
location: Location, | ||
route: Route, | ||
href: string, | ||
// for backwards compat | ||
normalizedTo: Location, | ||
resolved: Route | ||
} { | ||
current = current || this.history.current | ||
const location = normalizeLocation(to, current, append, this) | ||
const route = this.match(location, current) | ||
const fullPath = route.redirectedFrom || route.fullPath | ||
const base = this.history.base | ||
const href = createHref(base, fullPath, this.mode) | ||
return { | ||
location, | ||
route, | ||
href, | ||
// for backwards compat | ||
normalizedTo: location, | ||
resolved: route | ||
} | ||
} | ||
getRoutes () { | ||
return this.matcher.getRoutes() | ||
} | ||
addRoute (parentOrRoute: string | RouteConfig, route?: RouteConfig) { | ||
this.matcher.addRoute(parentOrRoute, route) | ||
if (this.history.current !== START) { | ||
this.history.transitionTo(this.history.getCurrentLocation()) | ||
} | ||
} | ||
addRoutes (routes: Array<RouteConfig>) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.') | ||
} | ||
this.matcher.addRoutes(routes) | ||
if (this.history.current !== START) { | ||
this.history.transitionTo(this.history.getCurrentLocation()) | ||
} | ||
} | ||
} | ||
function registerHook (list: Array<any>, fn: Function): Function { | ||
list.push(fn) | ||
return () => { | ||
const i = list.indexOf(fn) | ||
if (i > -1) list.splice(i, 1) | ||
} | ||
} | ||
function createHref (base: string, fullPath: string, mode) { | ||
var path = mode === 'hash' ? '#' + fullPath : fullPath | ||
return base ? cleanPath(base + '/' + path) : path | ||
} | ||
VueRouter.install = install | ||
VueRouter.version = '__VERSION__' | ||
VueRouter.isNavigationFailure = isNavigationFailure | ||
VueRouter.NavigationFailureType = NavigationFailureType | ||
VueRouter.START_LOCATION = START | ||
if (inBrowser && window.Vue) { | ||
window.Vue.use(VueRouter) | ||
} | ||
export default VueRouter |
import './vue' | ||
import { VueRouter } from './router' | ||
import { VueRouter, RouterLink, RouterView } from './router' | ||
export default VueRouter | ||
// TODO: does this really work with the new keyword? | ||
export { RouterView, RouterLink } | ||
export { | ||
export type { | ||
RouterMode, | ||
@@ -22,1 +24,3 @@ RouteMeta, | ||
} from './router' | ||
import './composables' |
@@ -1,2 +0,2 @@ | ||
import Vue, { ComponentOptions, PluginFunction, AsyncComponent } from 'vue' | ||
import Vue, { ComponentOptions, PluginFunction, AsyncComponent, VNode } from 'vue' | ||
@@ -20,2 +20,5 @@ type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent | ||
/** | ||
* Router instance. | ||
*/ | ||
export declare class VueRouter { | ||
@@ -25,34 +28,157 @@ constructor(options?: RouterOptions) | ||
app: Vue | ||
/** | ||
* Original options object passed to create the Router | ||
*/ | ||
options: RouterOptions | ||
/** | ||
* Configured mode when creating the Router instance. | ||
*/ | ||
mode: RouterMode | ||
/** | ||
* Current {@link Route} | ||
*/ | ||
currentRoute: Route | ||
beforeEach(guard: NavigationGuard): Function | ||
beforeResolve(guard: NavigationGuard): Function | ||
afterEach(hook: (to: Route, from: Route) => any): Function | ||
push(location: RawLocation): Promise<Route> | ||
replace(location: RawLocation): Promise<Route> | ||
/** | ||
* Add a navigation guard that executes before any navigation. | ||
* | ||
* @param guard - navigation guard to add | ||
* @returns a function that removes the registered guard | ||
* | ||
* @example | ||
* ```js | ||
* router.beforeEach((to, from, next) => { | ||
* // must call `next` | ||
* }) | ||
* ``` | ||
*/ | ||
beforeEach(guard: NavigationGuard): () => void | ||
/** | ||
* Add a navigation guard that executes before navigation is about to be resolved. At this state all component have | ||
* been fetched and other navigation guards have been successful. | ||
* | ||
* @param guard - navigation guard to add | ||
* @returns a function that removes the registered guard | ||
* | ||
* @example | ||
* ```js | ||
* router.beforeResolve((to, from, next) => { | ||
* // must call `next` | ||
* }) | ||
* ``` | ||
*/ | ||
beforeResolve(guard: NavigationGuard): () => void | ||
/** | ||
* Add a navigation hook that is executed after every navigation. Returns a function that removes the registered hook. | ||
* | ||
* @param hook - navigation hook to add | ||
* @returns a function that removes the registered guard | ||
* | ||
* @example | ||
* ```js | ||
* router.afterEach((to, from) => { | ||
* console.log('after navigation') | ||
* }) | ||
* ``` | ||
*/ | ||
afterEach(hook: (to: Route, from: Route) => any): () => void | ||
/** | ||
* Programmatically navigate to a new URL by pushing an entry in the history stack. | ||
* | ||
* @param to Route location to navigate to | ||
*/ | ||
push(to: RawLocation): Promise<Route> | ||
/** | ||
* Programmatically navigate to a new URL by pushing an entry in the history stack. | ||
* | ||
* @param to Route location to navigate to | ||
* @param onComplete Navigation success callback | ||
* @param onAbort Navigation aborted callback | ||
*/ | ||
push( | ||
location: RawLocation, | ||
onComplete?: Function, | ||
to: RawLocation, | ||
onComplete?: (route: Route) => void, | ||
onAbort?: ErrorHandler | ||
): void | ||
/** | ||
* Programmatically navigate to a new URL by replacing the current entry in the history stack. | ||
* | ||
* @param to Route location to navigate to | ||
*/ | ||
replace(to: RawLocation): Promise<Route> | ||
/** | ||
* Programmatically navigate to a new URL by replacing the current entry in the history stack. | ||
* | ||
* @param to Route location to navigate to | ||
* @param onComplete Navigation success callback | ||
* @param onAbort Navigation aborted callback | ||
*/ | ||
replace( | ||
location: RawLocation, | ||
onComplete?: Function, | ||
to: RawLocation, | ||
onComplete?: (route: Route) => void, | ||
onAbort?: ErrorHandler | ||
): void | ||
/** | ||
* Allows you to move forward or backward through the history. Calls `history.go()`. | ||
* | ||
* @param delta The position in the history to which you want to move, relative to the current page | ||
*/ | ||
go(n: number): void | ||
/** | ||
* Go back in history if possible by calling `history.back()`. Equivalent to `router.go(-1)`. | ||
*/ | ||
back(): void | ||
/** | ||
* Go forward in history if possible by calling `history.forward()`. Equivalent to `router.go(1)`. | ||
*/ | ||
forward(): void | ||
match (raw: RawLocation, current?: Route, redirectedFrom?: Location): Route | ||
getMatchedComponents(to?: RawLocation | Route): Component[] | ||
onReady(cb: Function, errorCb?: ErrorHandler): void | ||
/** | ||
* This method queues a callback to be called when the router has completed the initial navigation, which means it has | ||
* resolved all async enter hooks and async components that are associated with the initial route. | ||
* | ||
* This is useful in server-side rendering to ensure consistent output on both the server and the client. | ||
* @param cb onReady callback. | ||
* @param errorCb errorCb will be called when the initial route resolution runs into an error (e.g. failed to resolve | ||
* an async component). | ||
*/ | ||
onReady(cb: () => void, errorCb?: ErrorHandler): void | ||
/** | ||
* Adds an error handler that is called every time a non caught error happens during navigation. This includes errors | ||
* thrown synchronously and asynchronously, errors returned or passed to `next` in any navigation guard, and errors | ||
* occurred when trying to resolve an async component that is required to render a route. | ||
* | ||
* @param handler - error handler to register | ||
*/ | ||
onError(cb: ErrorHandler): void | ||
/** | ||
* @deprecated use {@link addRoute | router.addRoute()} instead | ||
*/ | ||
addRoutes(routes: RouteConfig[]): void | ||
addRoute(parent: string, route: RouteConfig): void | ||
/** | ||
* Add a new {@link RouteConfig | route record} as the child of an existing route. If the route has a `name` and there | ||
* is already an existing one with the same one, it overwrites it. | ||
* | ||
* @param parentName - Parent Route Record where `route` should be appended at | ||
* @param route - Route Record to add | ||
*/ | ||
addRoute(parentName: string, route: RouteConfig): void | ||
/** | ||
* Add a new {@link RouteConfig | route} to the router. If the route has a `name` and there is already an existing one | ||
* with the same one, it overwrites it. | ||
* @param route - Route Record to add | ||
*/ | ||
addRoute(route: RouteConfig): void | ||
/** | ||
* Get the list of all the active route records. | ||
*/ | ||
getRoutes(): RouteRecordPublic[] | ||
/** | ||
* | ||
* @param to Route location | ||
* @param current current is the current Route by default (most of the time you don't need to change this) | ||
* @param append allows you to append the path to the `current` route (as with `router-link`) | ||
*/ | ||
resolve( | ||
@@ -66,14 +192,18 @@ to: RawLocation, | ||
href: string | ||
// backwards compat | ||
/** | ||
* backwards compat | ||
*/ | ||
normalizedTo: Location | ||
/** | ||
* backwards compat | ||
*/ | ||
resolved: Route | ||
} | ||
/** | ||
* @internal | ||
*/ | ||
static install: PluginFunction<never> | ||
static version: string | ||
static isNavigationFailure: ( | ||
error: any, | ||
type?: number | ||
) => error is NavigationFailure | ||
static isNavigationFailure: typeof isNavigationFailure | ||
static NavigationFailureType: { | ||
@@ -86,27 +216,99 @@ [k in keyof typeof NavigationFailureType]: NavigationFailureType | ||
/** | ||
* Enumeration with all possible types for navigation failures. | ||
* | ||
* Can be passed to {@link isNavigationFailure} to check for specific failures. | ||
*/ | ||
export enum NavigationFailureType { | ||
/** | ||
* @internal | ||
*/ | ||
redirected = 2, | ||
/** | ||
* An aborted navigation is a navigation that failed because a navigation guard returned `false` or called | ||
* `next(false)` | ||
*/ | ||
aborted = 4, | ||
/** | ||
* A cancelled navigation is a navigation that failed because a more recent navigation finished started (not | ||
* necessarily finished). | ||
*/ | ||
cancelled = 8, | ||
/** | ||
* A duplicated navigation is a navigation that failed because it was initiated while already being at the exact same | ||
* location. | ||
*/ | ||
duplicated = 16 | ||
} | ||
/** | ||
* Extended Error that contains extra information regarding a failed navigation. | ||
*/ | ||
export interface NavigationFailure extends Error { | ||
/** | ||
* Route location we were navigating from | ||
*/ | ||
from: Route | ||
/** | ||
* Route location we were navigating to | ||
*/ | ||
to: Route | ||
from: Route | ||
type: number | ||
/** | ||
* Type of the navigation. One of {@link NavigationFailureType} | ||
*/ | ||
type: NavigationFailureType.aborted | NavigationFailureType.cancelled | NavigationFailureType.duplicated | ||
} | ||
/** | ||
* Check if an object is a {@link NavigationFailure}. | ||
*/ | ||
export declare function isNavigationFailure(error: any, type?: NavigationFailureType): error is NavigationFailure | ||
type Position = { x: number; y: number } | ||
type PositionResult = Position | { selector: string; offset?: Position, behavior?: ScrollBehavior } | void | ||
/** | ||
* Options to initialize a {@link VueRouter} instance. | ||
*/ | ||
export interface RouterOptions { | ||
routes?: RouteConfig[] | ||
/** | ||
* Configure the router mode. | ||
* | ||
* default: `"hash"` (in browser) | `"abstract"` (in Node.js) | ||
* | ||
* available values: `"hash" | "history" | "abstract"` | ||
* - `"hash"`: uses the URL hash for routing. Works in all Vue-supported browsers, including those that do not support | ||
* HTML5 History API. | ||
* - `"history"`: requires HTML5 History API and server config. See HTML5 History Mode. | ||
* - `"abstract"`: works in all JavaScript environments, e.g. server-side with Node.js. **The router will | ||
* automatically be forced into this mode if no browser API is present.** | ||
*/ | ||
mode?: RouterMode | ||
fallback?: boolean | ||
base?: string | ||
/** | ||
* Default class applied to active {@link RouterLink}. If none is provided, `router-link-active` will be applied. | ||
*/ | ||
linkActiveClass?: string | ||
/** | ||
* Default class applied to active {@link RouterLink}. If none is provided, `router-link-exact-active` will be | ||
* applied. | ||
*/ | ||
linkExactActiveClass?: string | ||
/** | ||
* Custom implementation to parse a query. See its counterpart, {@link stringifyQuery}. | ||
*/ | ||
parseQuery?: (query: string) => Object | ||
/** | ||
* Custom implementation to stringify a query object. Should not prepend a leading `?`. {@link parseQuery} counterpart | ||
* to handle query parsing. | ||
*/ | ||
stringifyQuery?: (query: Object) => string | ||
/** | ||
* Function to control scrolling when navigating between pages. Can return a Promise to delay scrolling. | ||
* | ||
* For more details see {@link Scroll Behavior}. | ||
*/ | ||
scrollBehavior?: ( | ||
@@ -216,1 +418,152 @@ to: Route, | ||
export interface RouteMeta extends Record<string | number | symbol, any> {} | ||
export interface RouterLinkProps { | ||
/** | ||
* Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to | ||
* `router.push()` internally, so the value can be either a string or a location descriptor object. | ||
*/ | ||
to: string | Location | ||
/** | ||
* Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will | ||
* not create a new history record. | ||
* | ||
* @default false | ||
*/ | ||
replace?: boolean | ||
/** | ||
* Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating | ||
* from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at | ||
* `/a/b`. | ||
* | ||
* @default false | ||
*/ | ||
append?: boolean | ||
/** | ||
* Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to | ||
* render to, and it will still listen to click events for navigation. | ||
* | ||
* @default "a" | ||
*/ | ||
tag?: string | ||
/** | ||
* Configure the active CSS class applied when the link is active. Note the default value can also be configured | ||
* globally via the `linkActiveClass` router constructor option. | ||
* | ||
* @default "router-link-active" | ||
*/ | ||
activeClass?: string | ||
/** | ||
* The default active class matching behavior is **inclusive match**. For example, `<RouterLink to="/a">` will get | ||
* this class applied as long as the current path starts with `/a/` or is `/a`. | ||
* | ||
* @default false | ||
*/ | ||
exact?: boolean | ||
/** | ||
* Allows matching only using the `path` section of the url, effectively ignoring the `query` and the `hash` sections. | ||
* | ||
* @default false | ||
*/ | ||
exactPath?: boolean | ||
/** | ||
* Configure the active CSS class applied when the link is active with exact path match. Note the default value can | ||
* also be configured globally via the `linkExactPathActiveClass` router constructor option. | ||
* | ||
* @default "router-link-exact-path-active" | ||
*/ | ||
exactPathActiveClass?: string | ||
/** | ||
* Specify the event(s) that can trigger the link navigation. | ||
* | ||
* @default 'click' | ||
*/ | ||
event?: string | ReadonlyArray<string> | ||
/** | ||
* Configure the active CSS class applied when the link is active with exact match. Note the default value can also be | ||
* configured globally via the `linkExactActiveClass` router constructor option. | ||
* | ||
* @default "router-link-exact-active" | ||
*/ | ||
exactActiveClass?: string | ||
/** | ||
* Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed | ||
* values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the | ||
* default of page should be the best fit. | ||
* | ||
* @default "page" | ||
*/ | ||
ariaCurrentValue?: | ||
| 'page' | ||
| 'step' | ||
| 'location' | ||
| 'date' | ||
| 'time' | ||
| 'true' | ||
| 'false' | ||
} | ||
export interface RouterLinkSlotArgument { | ||
/** | ||
* resolved url. This would be the `href` attribute of an `a` element | ||
*/ | ||
href: string | ||
/** | ||
* resolved normalized location | ||
*/ | ||
route: Route | ||
/** | ||
* function to trigger the navigation. It will automatically prevent events when necessary, the same way `RouterLink` | ||
* does | ||
*/ | ||
navigate: (e?: MouseEvent) => Promise<undefined | NavigationFailure> | ||
/** | ||
* `true` if the [active class](https://v3.router.vuejs.org/api/#active-class) should be applied. Allows to apply an | ||
* arbitrary class | ||
*/ | ||
isActive: boolean | ||
/** | ||
* `true` if the [exact active class](https://v3.router.vuejs.org/api/#exact-active-class) should be applied. Allows | ||
* to apply an arbitrary class | ||
*/ | ||
isExactActive: boolean | ||
} | ||
/** | ||
* Component to render a link that triggers a navigation on click. | ||
*/ | ||
export declare const RouterLink: new () => { | ||
$props: RouterLinkProps | ||
$scopedSlots: { | ||
default?: ({ | ||
href, | ||
route, | ||
navigate, | ||
isActive, | ||
isExactActive | ||
}: RouterLinkSlotArgument) => VNode[] | undefined | ||
} | ||
} | ||
export interface RouterViewProps { | ||
/** | ||
* When a {@link RouterView | `<RouterView />`} has a name, it will render the component with the corresponding name | ||
* in the matched route record's components option. See [Named | ||
* Views](https://v3.router.vuejs.org/guide/essentials/named-views.html) for an example. | ||
* | ||
* @default "default" | ||
*/ | ||
name?: string | ||
} | ||
/** | ||
* Component to display the current route the user is at. | ||
*/ | ||
export declare const RouterView: new () => { | ||
$props: RouterViewProps | ||
} | ||
/** | ||
* Initial route location where the router is. Can be used in navigation guards to differentiate the initial navigation. | ||
*/ | ||
export declare const START_LOCATION: Route |
@@ -6,3 +6,3 @@ /** | ||
import Vue from 'vue' | ||
import VueRouter, { Route, RawLocation, NavigationGuard } from './index' | ||
import VueRouter, { Route, NavigationGuard } from './index' | ||
@@ -9,0 +9,0 @@ declare module 'vue/types/vue' { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
520538
49
14766
139
39