vue-router
Version:
## Status: Alpha
8 lines (7 loc) • 19.2 kB
JavaScript
/*!
* vue-router v4.0.0-alpha.6
* (c) 2020 Eduardo San Martin Morote
* @license MIT
*/
var VueRouter=function(e,t){"use strict";const n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=e=>n?Symbol(e):"_vr_"+e,o=r("rvlm"),a=r("rvd"),c=r("r"),i=r("rl"),s="undefined"!=typeof window;function u(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}function l(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function f(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!p(e[n],t[n]))return!1;return!0}function p(e,t){return Array.isArray(e)?h(e,t):Array.isArray(t)?h(t,e):e===t}function h(e,t){return Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):1===e.length&&e[0]===t}var d,m;!function(e){e.pop="pop",e.push="push"}(d||(d={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(m||(m={}));const g={fullPath:""};function y(e){return{fullPath:e.fullPath||e}}function v(e){if(!e)if(s){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e.charAt(0)&&"#"!==e.charAt(0)&&(e="/"+e),e.replace(/\/$/,"")}function w(e){return e?{x:e.scrollLeft,y:e.scrollTop}:{x:window.pageXOffset,y:window.pageYOffset}}const b=/^#\d/;function R(e){let t=null;if("selector"in e){const n=b.test(e.selector)?document.getElementById(e.selector.slice(1)):document.querySelector(e.selector);if(n){t=function(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:r.left-n.left-t.x,y:r.top-n.top-t.y}}(n,e.offset||{x:0,y:0})}}else t={x:e.x,y:e.y};s&&t&&window.scrollTo(t.x,t.y)}const E=new Map;function x(e,t){return(s&&history.state?history.state.position-t:-1)+e}function A(e,t){return t&&0===e.indexOf(t)?e.replace(t,"")||"/":e}function O(e,t){const{pathname:n,search:r,hash:o}=t;if(e.indexOf("#")>-1){let e=o.slice(1);return"/"!==e.charAt(0)&&(e="/"+e),y(A(e,""))}return y(A(n,e)+r+o)}function k(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?w():null}}function P(e){const n=function(e){const{history:n}=window;let r={value:O(e,window.location)},o={value:n.state};function a(r,a,c){const i=e+r.fullPath;try{n[c?"replaceState":"pushState"](a,"",i),o.value=a}catch(e){t.warn("[vue-router]: Error with push/replace State",e),window.location[c?"replace":"assign"](i)}}return o.value||a(r.value,{back:null,current:r.value,forward:null,position:n.length-1,replaced:!0,scroll:w()},!0),{location:r,state:o,push:function(e,t){const o=y(e),c={...n.state,forward:o,scroll:w()};a(c.current,c,!0),a(o,{...k(r.value,o,null),position:c.position+1,...t},!1),r.value=o},replace:function(e,t){const c=y(e);a(c,{...k(o.value.back,c,o.value.forward,!0),...n.state,...t,position:o.value.position},!0),r.value=c}}}(e=v(e)),r=function(e,t,n,r){let o=[],a=[],c=null;const i=({state:a})=>{const i=O(e,window.location);if(!a)return r(i.fullPath);const s=n.value,u=t.value;if(n.value=i,t.value=a,c&&c.fullPath===s.fullPath)return void(c=null);const l=(u?a.position-u.position:"")||0;o.forEach(e=>{e(n.value,s,{distance:l,type:d.pop,direction:l?l>0?m.forward:m.back:m.unknown})})};function s(){const{history:e}=window;e.state&&e.replaceState({...e.state,scroll:w()},"")}return window.addEventListener("popstate",i),window.addEventListener("beforeunload",s),{pauseListeners:function(){c=n.value},listen:function(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return a.push(t),t},destroy:function(){for(const e of a)e();a=[],window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",s)}}}(e,n.state,n.location,n.replace);const o={location:"",base:e,go:function(e,t=!0){t||r.pauseListeners(),history.go(e)},...n,...r};return Object.defineProperty(o,"location",{get:()=>n.location.value}),Object.defineProperty(o,"state",{get:()=>n.state.value}),o}const $=/#/g,j=/&/g,S=/\//g,C=/=/g,L=/\?/g,T=/%5B/g,M=/%5D/g,q=/%5E/g,B=/%60/g,F=/%7B/g,I=/%7C/g,V=/%7D/g;function _(e){return encodeURI(""+e).replace(I,"|").replace(T,"[").replace(M,"]")}function D(e){return _(e).replace($,"%23").replace(j,"%26").replace(C,"%3D").replace(B,"`").replace(F,"{").replace(V,"}").replace(q,"^")}function U(e){return function(e){return _(e).replace($,"%23").replace(L,"%3F")}(e).replace(S,"%2F")}function G(e){try{return decodeURIComponent(e)}catch(e){}return e}function H(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){let[r,o]=n[e].split("=");r=G(r);let a=null==o?null:G(o);if(r in t){let e=t[r];Array.isArray(e)||(e=t[r]=[e]),e.push(a)}else t[r]=a}return t}function K(e){let t="";for(let n in e){t.length&&(t+="&");const r=e[n];if(n=D(n),null==r){void 0!==r&&(t+=n);continue}let o=Array.isArray(r)?r.map(e=>e&&D(e)):[r&&D(r)];for(let e=0;e<o.length;e++)t+=(e?"&":"")+n,null!=o[e]&&(t+="="+o[e])}return t}function Q(e){const t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=Array.isArray(r)?r.map(e=>null==e?null:""+e):null==r?r:""+r)}return t}function N(e){return"string"==typeof e||"symbol"==typeof e}const W=t.markRaw({path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0});var z;function X(e,t){return Object.assign(new Error,{type:e},t)}(z=e.NavigationFailureType||(e.NavigationFailureType={}))[z.cancelled=3]="cancelled",z[z.aborted=2]="aborted";const Y={sensitive:!1,strict:!1,start:!0,end:!0},Z=/[.+*?^${}()[\]/\\]/g;function J(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function ee(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=J(r[n],o[n]);if(e)return e;n++}return o.length-r.length}const te={type:0,value:""},ne=/[a-zA-Z0-9_]/;function re(e,t,n){const r={...function(e,t){const n={...Y,...t};let r=[],o=n.start?"^":"";const a=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(o+="/");for(let r=0;r<t.length;r++){const c=t[r];let i=40+(n.sensitive?.25:0);if(0===c.type)r||(o+="/"),o+=c.value.replace(Z,"\\$&"),i+=40;else if(1===c.type){const{value:e,repeatable:t,optional:n,regexp:s}=c;a.push({name:e,repeatable:t,optional:n});const u=s||"[^/]+?";if("[^/]+?"!==u){i+=10;try{new RegExp(`(${u})`)}catch(t){throw new Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let l=t?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(l=n?`(?:/${l})`:"/"+l),n&&(l+="?"),o+=l,i+=20,n&&(i+=-8),t&&(i+=-20),".*"===u&&(i+=-50)}e.push(i)}r.push(e)}if(n.strict&&n.end){const e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const c=new RegExp(o,n.sensitive?"":"i");return{re:c,score:r,keys:a,parse:function(e){const t=e.match(c),n={};if(!t)return null;for(let e=1;e<t.length;e++){const r=t[e]||"",o=a[e-1];n[o.name]=r&&o.repeatable?r.split("/"):r}return n},stringify:function(t){let n="",r=!1;for(const o of e){r&&"/"===n[n.length-1]||(n+="/"),r=!1;for(const e of o)if(0===e.type)n+=e.value;else if(1===e.type){const{value:o,repeatable:a,optional:c}=e,i=o in t?t[o]:"";if(Array.isArray(i)&&!a)throw new Error(`Provided param "${o}" is an array but it is not repeatable (* or + modifiers)`);const s=Array.isArray(i)?i.join("/"):i;if(!s){if(!c)throw new Error(`Missing required param "${o}"`);r=!0}n+=s}}return n}}}(function(e){if(!e)return[[]];if("/"===e)return[[te]];if("/"!==e[0])throw new Error('A non-empty path must start with "/"');function t(e){throw new Error(`ERR (${n})/"${u}": ${e}`)}let n=0,r=n;const o=[];let a;function c(){a&&o.push(a),a=[]}let i,s=0,u="",l="";function f(){u&&(0===n?a.push({type:0,value:u}):1===n||2===n||3===n?(a.length>1&&("*"===i||"+"===i)&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:u,regexp:l,repeatable:"*"===i||"+"===i,optional:"*"===i||"?"===i})):t("Invalid state to consume buffer"),u="")}function p(){u+=i}for(;s<e.length;)if(i=e[s++],"\\"!==i||2===n)switch(n){case 0:"/"===i?(u&&f(),c()):":"===i?(f(),n=1):p();break;case 4:p(),n=r;break;case 1:"("===i?(n=2,l=""):ne.test(i)?p():(f(),n=0,"*"!==i&&"?"!==i&&"+"!==i&&s--);break;case 2:")"===i?"\\"==l[l.length-1]?l=l.slice(0,-1)+i:n=3:l+=i;break;case 3:f(),n=0,"*"!==i&&"?"!==i&&"+"!==i&&s--;break;default:t("Unknown state")}else r=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${u}"`),f(),c(),o}(e.path),n),record:e,parent:t,children:[],alias:[]};return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}let oe=()=>{};function ae(e,t){const n=[],r=new Map;function o(e,n,r){let i=function(e){const t={path:e.path,name:e.name,meta:e.meta||{},aliasOf:void 0,components:{}};return"redirect"in e?{...t,redirect:e.redirect}:{...t,beforeEnter:e.beforeEnter,props:e.props||!1,children:e.children||[],instances:{},leaveGuards:[],components:"components"in e?e.components:{default:e.component}}}(e);i.aliasOf=r&&r.record;const s={...t,...e.options},u=[i];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)u.push({...i,components:r?r.record.components:i.components,path:e,aliasOf:r?r.record:i})}let l,f;for(const e of u){let{path:t}=e;if(n&&"/"!==t[0]){let r=n.record.path,o="/"===r[r.length-1]?"":"/";e.path=n.record.path+(t&&o+t)}if(l=re(e,n,s),r?r.alias.push(l):(f=f||l,f!==l&&f.alias.push(l)),"children"in i){let e=i.children;for(let t=0;t<e.length;t++)o(e[t],l,r&&r.children[t])}r=r||l,c(l)}return f?()=>{a(f)}:oe}function a(e){if(N(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(a),t.alias.forEach(a))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(a),e.alias.forEach(a))}}function c(e){let t=0;for(;t<n.length&&ee(e,n[t])>=0;)t++;n.splice(t,0,e),e.record.name&&!function(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}(e)&&r.set(e.record.name,e)}return e.forEach(e=>o(e)),{addRoute:o,resolve:function(e,t){let o,a,c,i={};if("name"in e&&e.name){if(o=r.get(e.name),!o)throw X(0,{location:e});c=o.record.name,i=e.params||t.params,a=o.stringify(i)}else if("path"in e)o=n.find(t=>t.re.test(e.path)),a=e.path,o&&(i=o.parse(e.path),c=o.record.name);else{if(o=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!o)throw X(0,{location:e,currentLocation:t});c=o.record.name,i=e.params||t.params,a=o.stringify(i)}const s=[];let u=o;for(;u;)s.unshift(u.record),u=u.parent;return{name:c,path:a,params:i,matched:s,meta:ce(s)}},removeRoute:a,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function ce(e){return e.reduce((e,t)=>({...e,...t.meta}),{})}function ie(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function se(e){const n=t.inject(c),r=t.inject(i),o=t.computed(()=>n.resolve(t.unref(e.to))),a=t.computed(()=>{const e=o.value.matched[o.value.matched.length-1];return e?r.matched.findIndex(l.bind(null,e)):-1}),s=t.computed(()=>a.value>-1&&function(e,t){for(let n in t){let r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!Array.isArray(o)||o.length!==r.length||r.some((e,t)=>e!==o[t]))return!1}return!0}(r.params,o.value.params)),u=t.computed(()=>a.value>-1&&a.value===r.matched.length-1&&f(r.params,o.value.params));return{route:o,href:t.computed(()=>o.value.href),isActive:s,isExactActive:u,navigate:function(e={}){(function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0})(e)&&n.push(o.value)}}}const ue=t.defineComponent({name:"RouterLink",props:{to:{type:[String,Object],required:!0},activeClass:{type:String,default:"router-link-active"},exactActiveClass:{type:String,default:"router-link-exact-active"},custom:Boolean},setup(e,{slots:n,attrs:r}){const o=t.reactive(se(e)),a=t.computed(()=>({[e.activeClass]:o.isActive,[e.exactActiveClass]:o.isExactActive}));return()=>{const c=n.default&&n.default(o);return e.custom?c:t.h("a",{"aria-current":o.isExactActive?"page":null,onClick:o.navigate,href:o.href,...r,class:a.value},c)}}});const le=t.defineComponent({name:"RouterView",props:{name:{type:String,default:"default"},route:Object},setup(e,{attrs:n,slots:r}){const c=t.inject(i),s=t.computed(()=>e.route||c),u=t.inject(a,0);t.provide(a,u+1);const l=t.computed(()=>s.value.matched[u]),f=t.computed(()=>l.value&&l.value.components[e.name]),p=t.computed(()=>{const{props:e}=l.value;return e?!0===e?s.value.params:"object"==typeof e?e:e(s.value):{}});t.provide(o,l);const h=t.ref();function d(){l.value.instances[e.name]=h.value}return()=>{const o=l.value;let a=f.value;const c={...a&&p.value,...n,onVnodeMounted:d,onVnodeUnmounted:function(){o&&(o.instances[e.name]=null)},ref:h},i=a&&r.default&&r.default({Component:a,props:c});return i||(a?t.h(a,c):null)}}});function fe(e,t,n,r){return()=>new Promise((o,a)=>{Promise.resolve(e.call(r,t,n,e=>{var r;!1===e?a(X(2,{from:n,to:t})):e instanceof Error?a(e):"string"==typeof(r=e)||r&&"object"==typeof r?a(X(1,{from:t,to:e})):o()})).catch(e=>a(e))})}function pe(e,t,r,o){const a=[];for(const c of e)for(const e in c.components){const i=c.components[e];if("function"==typeof i){const s=i().catch(()=>null);a.push(async()=>{const a=await s;if(!a)throw new Error("TODO: error while fetching");const i=(u=a).__esModule||n&&"Module"===u[Symbol.toStringTag]?a.default:a;var u;c.components[e]=i;const l=i[t];return l&&fe(l,r,o,c.instances[e])()})}else{const n=i[t];n&&a.push(fe(n,r,o,c.instances[e]))}}return a}async function he(e){for(const t of e)await t()}function de(e,t){const n=[],r=[],o=[];for(const o of t.matched)e.matched.indexOf(o)<0?n.push(o):r.push(o);for(const n of e.matched)t.matched.indexOf(n)<0&&o.push(n);return[n,r,o]}return e.Link=ue,e.START_LOCATION=W,e.View=le,e.createMemoryHistory=function(e=""){let t=[],n=[g],r=0;function o(e){r++,r===n.length||n.splice(r),n.push(e)}const a={location:g,state:{},base:e,replace(e){const t=y(e);n.splice(r--,1),o(t)},push(e,t){o(y(e))},listen:e=>(t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}),destroy(){t=[]},go(e,o=!0){const a=this.location,c=e<0?m.back:m.forward;r=Math.max(0,Math.min(r+e,n.length-1)),o&&function(e,n,{direction:r,distance:o}){const a={direction:r,distance:o,type:d.pop};for(let r of t)r(e,n,a)}(this.location,a,{direction:c,distance:e})}};return Object.defineProperty(a,"location",{get:()=>n[r]}),a},e.createRouter=function({history:e,routes:n,scrollBehavior:r,parseQuery:o=H,stringifyQuery:a=K}){const p=ae(n,{}),h=ie(),d=ie(),m=t.ref(W);let g=W;s&&"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");const y=u.bind(null,U),v=u.bind(null,G);function b(t,n){if(n=n||m.value,"string"==typeof t){let r=function(e,t){let n="",r={},o="",a="";const c=t.indexOf("?"),i=t.indexOf("#",c>-1?c:0);return c>-1&&(n=t.slice(0,c),o=t.slice(c+1,i>-1?i:t.length),r=e(o)),i>-1&&(n=n||t.slice(0,i),a=t.slice(i,t.length)),n=n||t,{fullPath:t,path:n,query:r,hash:a}}(o,t),a=p.resolve({path:r.path},n);return{...r,...a,params:v(a.params),redirectedFrom:void 0,href:e.base+r.fullPath}}let r=p.resolve("params"in t?{...t,params:y(t.params)}:t,n);r.params="params"in t?t.params:v(r.params);const c=function(e,t){let n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(a,{...t,path:r.path});return{fullPath:c,hash:t.hash||"",query:Q(t.query),...r,redirectedFrom:void 0,href:e.base+c}}function A(e){return O(e,void 0)}async function O(e,t){const n=g=b(e),r=m.value,o=e.state;if(!e.force&&function(e,t){let n=e.matched.length-1,r=t.matched.length-1;return n>-1&&n===r&&l(e.matched[n],t.matched[r])&&f(e.params,t.params)&&f(e.query,t.query)&&e.hash===t.hash}(r,n))return;const a=n.matched[n.matched.length-1];if(a&&"redirect"in a){const{redirect:e}=a;return O("function"==typeof e?e(n):e,t||n)}const c=n;let i;c.redirectedFrom=t;try{await k(c,r)}catch(e){if(g!==c)i=X(3,{from:r,to:c});else if(2===e.type)i=e;else{if(1===e.type)return O(e.to,t||c);L(e,!0)}}return i=i||$(c,r,!0,!0===e.replace,o),P(c,r,i),i}async function k(e,t){let n;n=pe(t.matched.filter(t=>e.matched.indexOf(t)<0).reverse(),"beforeRouteLeave",e,t);const[r]=de(e,t);for(const o of r)for(const r of o.leaveGuards)n.push(fe(r,e,t));await he(n),n=[];for(const r of h.list())n.push(fe(r,e,t));await he(n),n=pe(e.matched.filter(e=>t.matched.indexOf(e)>-1),"beforeRouteUpdate",e,t),await he(n),n=[];for(const r of e.matched)if(r.beforeEnter&&t.matched.indexOf(r)<0)if(Array.isArray(r.beforeEnter))for(const o of r.beforeEnter)n.push(fe(o,e,t));else n.push(fe(r.beforeEnter,e,t));await he(n),n=pe(e.matched.filter(e=>t.matched.indexOf(e)<0),"beforeRouteEnter",e,t),await he(n)}function P(e,t,n){for(const r of d.list())r(e,t,n)}function $(n,o,a,c,i){if(g!==n)return X(3,{from:o,to:n});const[u]=de(n,o);for(const e of u)e.leaveGuards=[],e.instances={};a&&(c||o===W?e.replace(n,i):e.push(n,i)),m.value=t.markRaw(n);const l=a||!s?{}:window.history.state;var f;(async function(e,n,o){if(!r)return;await t.nextTick();const a=await r(e,n,o||null);a&&R(a)})(n,o,(f=x(n.fullPath,0),E.get(f))||l&&l.scroll).catch(e=>L(e)),T()}e.listen(async(t,n,r)=>{const o=b(t.fullPath);g=o;const a=m.value;var c;let i;c=x(a.fullPath,r.distance),E.set(c,s?w():{x:0,y:0});try{await k(o,a)}catch(t){if(g!==o)i=X(3,{from:a,to:o});else{if(2!==t.type)return 1===t.type?(e.go(-r.distance,!1),O(t.to,o).catch(()=>{})):(e.go(-r.distance,!1),L(t));i=t}}i=i||$(o,a,!1),i&&e.go(-r.distance,!1),P(o,a,i)});let j,S=ie(),C=ie();function L(e,t=!1){if(T(e),C.list().forEach(t=>t(e)),t)throw e}function T(e){j||(j=!0,S.list().forEach(([t,n])=>e?n(e):t()),S.reset())}return{currentRoute:m,addRoute:function(e,t){let n,r;return N(e)?(n=p.getRecordMatcher(e),r=t):r=e,p.addRoute(r,n)},removeRoute:function(e){let t=p.getRecordMatcher(e);t&&p.removeRoute(t)},hasRoute:function(e){return!!p.getRecordMatcher(e)},getRoutes:function(){return p.getRoutes().map(e=>e.record)},push:A,replace:function(e){return A({..."string"==typeof e?{path:e}:e,replace:!0})},resolve:b,beforeEach:h.add,afterEach:d.add,onError:C.add,isReady:function(){return j&&m.value!==W?Promise.resolve():new Promise((e,t)=>{S.add([e,t])})},history:e,install(e){!function(e,n){e.component("RouterLink",ue),e.component("RouterView",le),e.config.globalProperties.$router=n,Object.defineProperty(e.config.globalProperties,"$route",{get:()=>n.currentRoute.value});let r=!1;s&&e.mixin({beforeCreate(){r||(n.push(n.history.location.fullPath).catch(e=>e),r=!0)}});const o={};for(let e in W)o[e]=t.computed(()=>n.currentRoute.value[e]);e.provide(c,n),e.provide(i,t.reactive(o))}(e,this)}}},e.createWebHashHistory=function(e){return P(location.host?v(e)+"/#":"#")},e.createWebHistory=P,e.onBeforeRouteLeave=function(e){const n=t.getCurrentInstance();if(!n)return;const r=t.inject(o,{}).value;r&&r.leaveGuards.push(e.bind(n.proxy))},e.parseQuery=H,e.stringifyQuery=K,e.useLink=se,e.useRoute=function(){return t.inject(i)},e.useRouter=function(){return t.inject(c)},e}({},Vue);
//# sourceMappingURL=vue-router.global.prod.js.map