12345 |
- import{aT as rt,q as T,u as F,k as L,l as qe,n as st,x as ot,au as it,aq as at,d as Ge,aa as ze,aB as ce,b as ct,w as lt}from"./@vue-cb50a1c4.js";/*!
- * vue-router v4.1.5
- * (c) 2022 Eduardo San Martin Morote
- * @license MIT
- */const G=typeof window<"u";function ut(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const S=Object.assign;function le(e,t){const n={};for(const r in t){const s=t[r];n[r]=N(s)?s.map(e):e(s)}return n}const W=()=>{},N=Array.isArray,ft=/\/$/,ht=e=>e.replace(ft,"");function ue(e,t,n="/"){let r,s={},l="",d="";const g=t.indexOf("#");let a=t.indexOf("?");return g<a&&g>=0&&(a=-1),a>-1&&(r=t.slice(0,a),l=t.slice(a+1,g>-1?g:t.length),s=e(l)),g>-1&&(r=r||t.slice(0,g),d=t.slice(g,t.length)),r=gt(r??t,n),{fullPath:r+(l&&"?")+l+d,path:r,query:s,hash:d}}function dt(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function be(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function pt(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&z(t.matched[r],n.matched[s])&&Ue(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function z(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ue(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!mt(e[n],t[n]))return!1;return!0}function mt(e,t){return N(e)?ke(e,t):N(t)?ke(t,e):e===t}function ke(e,t){return N(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function gt(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let s=n.length-1,l,d;for(l=0;l<r.length;l++)if(d=r[l],d!==".")if(d==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(l-(l===r.length?1:0)).join("/")}var X;(function(e){e.pop="pop",e.push="push"})(X||(X={}));var Y;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Y||(Y={}));function vt(e){if(!e)if(G){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),ht(e)}const yt=/^[^#]+#/;function Rt(e,t){return e.replace(yt,"#")+t}function Et(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const ee=()=>({left:window.pageXOffset,top:window.pageYOffset});function Pt(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=Et(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Ce(e,t){return(history.state?history.state.position-t:-1)+e}const he=new Map;function wt(e,t){he.set(e,t)}function St(e){const t=he.get(e);return he.delete(e),t}let bt=()=>location.protocol+"//"+location.host;function Ke(e,t){const{pathname:n,search:r,hash:s}=t,l=e.indexOf("#");if(l>-1){let g=s.includes(e.slice(l))?e.slice(l).length:1,a=s.slice(g);return a[0]!=="/"&&(a="/"+a),be(a,"")}return be(n,e)+r+s}function kt(e,t,n,r){let s=[],l=[],d=null;const g=({state:u})=>{const m=Ke(e,location),R=n.value,C=t.value;let k=0;if(u){if(n.value=m,t.value=u,d&&d===R){d=null;return}k=C?u.position-C.position:0}else r(m);s.forEach(w=>{w(n.value,R,{delta:k,type:X.pop,direction:k?k>0?Y.forward:Y.back:Y.unknown})})};function a(){d=n.value}function f(u){s.push(u);const m=()=>{const R=s.indexOf(u);R>-1&&s.splice(R,1)};return l.push(m),m}function o(){const{history:u}=window;u.state&&u.replaceState(S({},u.state,{scroll:ee()}),"")}function c(){for(const u of l)u();l=[],window.removeEventListener("popstate",g),window.removeEventListener("beforeunload",o)}return window.addEventListener("popstate",g),window.addEventListener("beforeunload",o),{pauseListeners:a,listen:f,destroy:c}}function Ae(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ee():null}}function Ct(e){const{history:t,location:n}=window,r={value:Ke(e,n)},s={value:t.state};s.value||l(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(a,f,o){const c=e.indexOf("#"),u=c>-1?(n.host&&document.querySelector("base")?e:e.slice(c))+a:bt()+e+a;try{t[o?"replaceState":"pushState"](f,"",u),s.value=f}catch(m){console.error(m),n[o?"replace":"assign"](u)}}function d(a,f){const o=S({},t.state,Ae(s.value.back,a,s.value.forward,!0),f,{position:s.value.position});l(a,o,!0),r.value=a}function g(a,f){const o=S({},s.value,t.state,{forward:a,scroll:ee()});l(o.current,o,!0);const c=S({},Ae(r.value,a,null),{position:o.position+1},f);l(a,c,!1),r.value=a}return{location:r,state:s,push:g,replace:d}}function hn(e){e=vt(e);const t=Ct(e),n=kt(e,t.state,t.location,t.replace);function r(l,d=!0){d||n.pauseListeners(),history.go(l)}const s=S({location:"",base:e,go:r,createHref:Rt.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function At(e){return typeof e=="string"||e&&typeof e=="object"}function Ve(e){return typeof e=="string"||typeof e=="symbol"}const $={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},De=Symbol("");var _e;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(_e||(_e={}));function U(e,t){return S(new Error,{type:e,[De]:!0},t)}function I(e,t){return e instanceof Error&&De in e&&(t==null||!!(e.type&t))}const Oe="[^/]+?",_t={sensitive:!1,strict:!1,start:!0,end:!0},Ot=/[.+*?^${}()[\]/\\]/g;function xt(e,t){const n=S({},_t,t),r=[];let s=n.start?"^":"";const l=[];for(const f of e){const o=f.length?[]:[90];n.strict&&!f.length&&(s+="/");for(let c=0;c<f.length;c++){const u=f[c];let m=40+(n.sensitive?.25:0);if(u.type===0)c||(s+="/"),s+=u.value.replace(Ot,"\\$&"),m+=40;else if(u.type===1){const{value:R,repeatable:C,optional:k,regexp:w}=u;l.push({name:R,repeatable:C,optional:k});const P=w||Oe;if(P!==Oe){m+=10;try{new RegExp(`(${P})`)}catch(M){throw new Error(`Invalid custom RegExp for param "${R}" (${P}): `+M.message)}}let O=C?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;c||(O=k&&f.length<2?`(?:/${O})`:"/"+O),k&&(O+="?"),s+=O,m+=20,k&&(m+=-8),C&&(m+=-20),P===".*"&&(m+=-50)}o.push(m)}r.push(o)}if(n.strict&&n.end){const f=r.length-1;r[f][r[f].length-1]+=.7000000000000001}n.strict||(s+="/?"),n.end?s+="$":n.strict&&(s+="(?:/|$)");const d=new RegExp(s,n.sensitive?"":"i");function g(f){const o=f.match(d),c={};if(!o)return null;for(let u=1;u<o.length;u++){const m=o[u]||"",R=l[u-1];c[R.name]=m&&R.repeatable?m.split("/"):m}return c}function a(f){let o="",c=!1;for(const u of e){(!c||!o.endsWith("/"))&&(o+="/"),c=!1;for(const m of u)if(m.type===0)o+=m.value;else if(m.type===1){const{value:R,repeatable:C,optional:k}=m,w=R in f?f[R]:"";if(N(w)&&!C)throw new Error(`Provided param "${R}" is an array but it is not repeatable (* or + modifiers)`);const P=N(w)?w.join("/"):w;if(!P)if(k)u.length<2&&(o.endsWith("/")?o=o.slice(0,-1):c=!0);else throw new Error(`Missing required param "${R}"`);o+=P}}return o||"/"}return{re:d,score:r,keys:l,parse:g,stringify:a}}function Mt(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?e.length===1&&e[0]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function Lt(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const l=Mt(r[n],s[n]);if(l)return l;n++}if(Math.abs(s.length-r.length)===1){if(xe(r))return 1;if(xe(s))return-1}return s.length-r.length}function xe(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Nt={type:0,value:""},Bt=/[a-zA-Z0-9_]/;function It(e){if(!e)return[[]];if(e==="/")return[[Nt]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=0,r=n;const s=[];let l;function d(){l&&s.push(l),l=[]}let g=0,a,f="",o="";function c(){f&&(n===0?l.push({type:0,value:f}):n===1||n===2||n===3?(l.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),l.push({type:1,value:f,regexp:o,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),f="")}function u(){f+=a}for(;g<e.length;){if(a=e[g++],a==="\\"&&n!==2){r=n,n=4;continue}switch(n){case 0:a==="/"?(f&&c(),d()):a===":"?(c(),n=1):u();break;case 4:u(),n=r;break;case 1:a==="("?n=2:Bt.test(a)?u():(c(),n=0,a!=="*"&&a!=="?"&&a!=="+"&&g--);break;case 2:a===")"?o[o.length-1]=="\\"?o=o.slice(0,-1)+a:n=3:o+=a;break;case 3:c(),n=0,a!=="*"&&a!=="?"&&a!=="+"&&g--,o="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${f}"`),c(),d(),s}function Tt(e,t,n){const r=xt(It(e.path),n),s=S(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function $t(e,t){const n=[],r=new Map;t=Ne({strict:!1,end:!0,sensitive:!1},t);function s(o){return r.get(o)}function l(o,c,u){const m=!u,R=Ht(o);R.aliasOf=u&&u.record;const C=Ne(t,o),k=[R];if("alias"in o){const O=typeof o.alias=="string"?[o.alias]:o.alias;for(const M of O)k.push(S({},R,{components:u?u.record.components:R.components,path:M,aliasOf:u?u.record:R}))}let w,P;for(const O of k){const{path:M}=O;if(c&&M[0]!=="/"){const j=c.record.path,B=j[j.length-1]==="/"?"":"/";O.path=c.record.path+(M&&B+M)}if(w=Tt(O,c,C),u?u.alias.push(w):(P=P||w,P!==w&&P.alias.push(w),m&&o.name&&!Le(w)&&d(o.name)),R.children){const j=R.children;for(let B=0;B<j.length;B++)l(j[B],w,u&&u.children[B])}u=u||w,a(w)}return P?()=>{d(P)}:W}function d(o){if(Ve(o)){const c=r.get(o);c&&(r.delete(o),n.splice(n.indexOf(c),1),c.children.forEach(d),c.alias.forEach(d))}else{const c=n.indexOf(o);c>-1&&(n.splice(c,1),o.record.name&&r.delete(o.record.name),o.children.forEach(d),o.alias.forEach(d))}}function g(){return n}function a(o){let c=0;for(;c<n.length&&Lt(o,n[c])>=0&&(o.record.path!==n[c].record.path||!Qe(o,n[c]));)c++;n.splice(c,0,o),o.record.name&&!Le(o)&&r.set(o.record.name,o)}function f(o,c){let u,m={},R,C;if("name"in o&&o.name){if(u=r.get(o.name),!u)throw U(1,{location:o});C=u.record.name,m=S(Me(c.params,u.keys.filter(P=>!P.optional).map(P=>P.name)),o.params&&Me(o.params,u.keys.map(P=>P.name))),R=u.stringify(m)}else if("path"in o)R=o.path,u=n.find(P=>P.re.test(R)),u&&(m=u.parse(R),C=u.record.name);else{if(u=c.name?r.get(c.name):n.find(P=>P.re.test(c.path)),!u)throw U(1,{location:o,currentLocation:c});C=u.record.name,m=S({},c.params,o.params),R=u.stringify(m)}const k=[];let w=u;for(;w;)k.unshift(w.record),w=w.parent;return{name:C,path:R,params:m,matched:k,meta:qt(k)}}return e.forEach(o=>l(o)),{addRoute:l,resolve:f,removeRoute:d,getRoutes:g,getRecordMatcher:s}}function Me(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Ht(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:jt(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function jt(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function Le(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function qt(e){return e.reduce((t,n)=>S(t,n.meta),{})}function Ne(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function Qe(e,t){return t.children.some(n=>n===e||Qe(e,n))}const Fe=/#/g,Gt=/&/g,zt=/\//g,Ut=/=/g,Kt=/\?/g,We=/\+/g,Vt=/%5B/g,Dt=/%5D/g,Ye=/%5E/g,Qt=/%60/g,Xe=/%7B/g,Ft=/%7C/g,Ze=/%7D/g,Wt=/%20/g;function me(e){return encodeURI(""+e).replace(Ft,"|").replace(Vt,"[").replace(Dt,"]")}function Yt(e){return me(e).replace(Xe,"{").replace(Ze,"}").replace(Ye,"^")}function de(e){return me(e).replace(We,"%2B").replace(Wt,"+").replace(Fe,"%23").replace(Gt,"%26").replace(Qt,"`").replace(Xe,"{").replace(Ze,"}").replace(Ye,"^")}function Xt(e){return de(e).replace(Ut,"%3D")}function Zt(e){return me(e).replace(Fe,"%23").replace(Kt,"%3F")}function Jt(e){return e==null?"":Zt(e).replace(zt,"%2F")}function J(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function en(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;s<r.length;++s){const l=r[s].replace(We," "),d=l.indexOf("="),g=J(d<0?l:l.slice(0,d)),a=d<0?null:J(l.slice(d+1));if(g in t){let f=t[g];N(f)||(f=t[g]=[f]),f.push(a)}else t[g]=a}return t}function Be(e){let t="";for(let n in e){const r=e[n];if(n=Xt(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(N(r)?r.map(l=>l&&de(l)):[r&&de(r)]).forEach(l=>{l!==void 0&&(t+=(t.length?"&":"")+n,l!=null&&(t+="="+l))})}return t}function tn(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=N(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const ge=Symbol(""),Ie=Symbol(""),te=Symbol(""),ve=Symbol(""),pe=Symbol("");function Q(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function Je(e,t,n){const r=()=>{e[t].delete(n)};ot(r),it(r),at(()=>{e[t].add(n)}),e[t].add(n)}function dn(e){const t=T(ge,{}).value;t&&Je(t,"leaveGuards",e)}function pn(e){const t=T(ge,{}).value;t&&Je(t,"updateGuards",e)}function H(e,t,n,r,s){const l=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((d,g)=>{const a=c=>{c===!1?g(U(4,{from:n,to:t})):c instanceof Error?g(c):At(c)?g(U(2,{from:t,to:c})):(l&&r.enterCallbacks[s]===l&&typeof c=="function"&&l.push(c),d())},f=e.call(r&&r.instances[s],t,n,a);let o=Promise.resolve(f);e.length<3&&(o=o.then(a)),o.catch(c=>g(c))})}function fe(e,t,n,r){const s=[];for(const l of e)for(const d in l.components){let g=l.components[d];if(!(t!=="beforeRouteEnter"&&!l.instances[d]))if(nn(g)){const f=(g.__vccOpts||g)[t];f&&s.push(H(f,n,r,l,d))}else{let a=g();s.push(()=>a.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${d}" at "${l.path}"`));const o=ut(f)?f.default:f;l.components[d]=o;const u=(o.__vccOpts||o)[t];return u&&H(u,n,r,l,d)()}))}}return s}function nn(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Te(e){const t=T(te),n=T(ve),r=L(()=>t.resolve(F(e.to))),s=L(()=>{const{matched:a}=r.value,{length:f}=a,o=a[f-1],c=n.matched;if(!o||!c.length)return-1;const u=c.findIndex(z.bind(null,o));if(u>-1)return u;const m=$e(a[f-2]);return f>1&&$e(o)===m&&c[c.length-1].path!==m?c.findIndex(z.bind(null,a[f-2])):u}),l=L(()=>s.value>-1&&an(n.params,r.value.params)),d=L(()=>s.value>-1&&s.value===n.matched.length-1&&Ue(n.params,r.value.params));function g(a={}){return on(a)?t[F(e.replace)?"replace":"push"](F(e.to)).catch(W):Promise.resolve()}return{route:r,href:L(()=>r.value.href),isActive:l,isExactActive:d,navigate:g}}const rn=Ge({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Te,setup(e,{slots:t}){const n=qe(Te(e)),{options:r}=T(te),s=L(()=>({[He(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[He(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&t.default(n);return e.custom?l:ze("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},l)}}}),sn=rn;function on(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function an(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!N(s)||s.length!==r.length||r.some((l,d)=>l!==s[d]))return!1}return!0}function $e(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const He=(e,t,n)=>e??t??n,cn=Ge({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=T(pe),s=L(()=>e.route||r.value),l=T(Ie,0),d=L(()=>{let f=F(l);const{matched:o}=s.value;let c;for(;(c=o[f])&&!c.components;)f++;return f}),g=L(()=>s.value.matched[d.value]);ce(Ie,L(()=>d.value+1)),ce(ge,g),ce(pe,s);const a=ct();return lt(()=>[a.value,g.value,e.name],([f,o,c],[u,m,R])=>{o&&(o.instances[c]=f,m&&m!==o&&f&&f===u&&(o.leaveGuards.size||(o.leaveGuards=m.leaveGuards),o.updateGuards.size||(o.updateGuards=m.updateGuards))),f&&o&&(!m||!z(o,m)||!u)&&(o.enterCallbacks[c]||[]).forEach(C=>C(f))},{flush:"post"}),()=>{const f=s.value,o=e.name,c=g.value,u=c&&c.components[o];if(!u)return je(n.default,{Component:u,route:f});const m=c.props[o],R=m?m===!0?f.params:typeof m=="function"?m(f):m:null,k=ze(u,S({},R,t,{onVnodeUnmounted:w=>{w.component.isUnmounted&&(c.instances[o]=null)},ref:a}));return je(n.default,{Component:k,route:f})||k}}});function je(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const ln=cn;function mn(e){const t=$t(e.routes,e),n=e.parseQuery||en,r=e.stringifyQuery||Be,s=e.history,l=Q(),d=Q(),g=Q(),a=rt($);let f=$;G&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const o=le.bind(null,i=>""+i),c=le.bind(null,Jt),u=le.bind(null,J);function m(i,p){let h,v;return Ve(i)?(h=t.getRecordMatcher(i),v=p):v=i,t.addRoute(v,h)}function R(i){const p=t.getRecordMatcher(i);p&&t.removeRoute(p)}function C(){return t.getRoutes().map(i=>i.record)}function k(i){return!!t.getRecordMatcher(i)}function w(i,p){if(p=S({},p||a.value),typeof i=="string"){const y=ue(n,i,p.path),_=t.resolve({path:y.path},p),D=s.createHref(y.fullPath);return S(y,_,{params:u(_.params),hash:J(y.hash),redirectedFrom:void 0,href:D})}let h;if("path"in i)h=S({},i,{path:ue(n,i.path,p.path).path});else{const y=S({},i.params);for(const _ in y)y[_]==null&&delete y[_];h=S({},i,{params:c(i.params)}),p.params=c(p.params)}const v=t.resolve(h,p),b=i.hash||"";v.params=o(u(v.params));const A=dt(r,S({},i,{hash:Yt(b),path:v.path})),E=s.createHref(A);return S({fullPath:A,hash:b,query:r===Be?tn(i.query):i.query||{}},v,{redirectedFrom:void 0,href:E})}function P(i){return typeof i=="string"?ue(n,i,a.value.path):S({},i)}function O(i,p){if(f!==i)return U(8,{from:p,to:i})}function M(i){return K(i)}function j(i){return M(S(P(i),{replace:!0}))}function B(i){const p=i.matched[i.matched.length-1];if(p&&p.redirect){const{redirect:h}=p;let v=typeof h=="function"?h(i):h;return typeof v=="string"&&(v=v.includes("?")||v.includes("#")?v=P(v):{path:v},v.params={}),S({query:i.query,hash:i.hash,params:"path"in v?{}:i.params},v)}}function K(i,p){const h=f=w(i),v=a.value,b=i.state,A=i.force,E=i.replace===!0,y=B(h);if(y)return K(S(P(y),{state:typeof y=="object"?S({},b,y.state):b,force:A,replace:E}),p||h);const _=h;_.redirectedFrom=p;let D;return!A&&pt(r,v,h)&&(D=U(16,{to:_,from:v}),we(v,v,!0,!1)),(D?Promise.resolve(D):ye(_,v)).catch(x=>I(x)?I(x,2)?x:se(x):re(x,_,v)).then(x=>{if(x){if(I(x,2))return K(S({replace:E},P(x.to),{state:typeof x.to=="object"?S({},b,x.to.state):b,force:A}),p||_)}else x=Ee(_,v,!0,E,b);return Re(_,v,x),x})}function et(i,p){const h=O(i,p);return h?Promise.reject(h):Promise.resolve()}function ye(i,p){let h;const[v,b,A]=un(i,p);h=fe(v.reverse(),"beforeRouteLeave",i,p);for(const y of v)y.leaveGuards.forEach(_=>{h.push(H(_,i,p))});const E=et.bind(null,i,p);return h.push(E),q(h).then(()=>{h=[];for(const y of l.list())h.push(H(y,i,p));return h.push(E),q(h)}).then(()=>{h=fe(b,"beforeRouteUpdate",i,p);for(const y of b)y.updateGuards.forEach(_=>{h.push(H(_,i,p))});return h.push(E),q(h)}).then(()=>{h=[];for(const y of i.matched)if(y.beforeEnter&&!p.matched.includes(y))if(N(y.beforeEnter))for(const _ of y.beforeEnter)h.push(H(_,i,p));else h.push(H(y.beforeEnter,i,p));return h.push(E),q(h)}).then(()=>(i.matched.forEach(y=>y.enterCallbacks={}),h=fe(A,"beforeRouteEnter",i,p),h.push(E),q(h))).then(()=>{h=[];for(const y of d.list())h.push(H(y,i,p));return h.push(E),q(h)}).catch(y=>I(y,8)?y:Promise.reject(y))}function Re(i,p,h){for(const v of g.list())v(i,p,h)}function Ee(i,p,h,v,b){const A=O(i,p);if(A)return A;const E=p===$,y=G?history.state:{};h&&(v||E?s.replace(i.fullPath,S({scroll:E&&y&&y.scroll},b)):s.push(i.fullPath,b)),a.value=i,we(i,p,h,E),se()}let V;function tt(){V||(V=s.listen((i,p,h)=>{if(!Se.listening)return;const v=w(i),b=B(v);if(b){K(S(b,{replace:!0}),v).catch(W);return}f=v;const A=a.value;G&&wt(Ce(A.fullPath,h.delta),ee()),ye(v,A).catch(E=>I(E,12)?E:I(E,2)?(K(E.to,v).then(y=>{I(y,20)&&!h.delta&&h.type===X.pop&&s.go(-1,!1)}).catch(W),Promise.reject()):(h.delta&&s.go(-h.delta,!1),re(E,v,A))).then(E=>{E=E||Ee(v,A,!1),E&&(h.delta&&!I(E,8)?s.go(-h.delta,!1):h.type===X.pop&&I(E,20)&&s.go(-1,!1)),Re(v,A,E)}).catch(W)}))}let ne=Q(),Pe=Q(),Z;function re(i,p,h){se(i);const v=Pe.list();return v.length?v.forEach(b=>b(i,p,h)):console.error(i),Promise.reject(i)}function nt(){return Z&&a.value!==$?Promise.resolve():new Promise((i,p)=>{ne.add([i,p])})}function se(i){return Z||(Z=!i,tt(),ne.list().forEach(([p,h])=>i?h(i):p()),ne.reset()),i}function we(i,p,h,v){const{scrollBehavior:b}=e;if(!G||!b)return Promise.resolve();const A=!h&&St(Ce(i.fullPath,0))||(v||!h)&&history.state&&history.state.scroll||null;return st().then(()=>b(i,p,A)).then(E=>E&&Pt(E)).catch(E=>re(E,i,p))}const oe=i=>s.go(i);let ie;const ae=new Set,Se={currentRoute:a,listening:!0,addRoute:m,removeRoute:R,hasRoute:k,getRoutes:C,resolve:w,options:e,push:M,replace:j,go:oe,back:()=>oe(-1),forward:()=>oe(1),beforeEach:l.add,beforeResolve:d.add,afterEach:g.add,onError:Pe.add,isReady:nt,install(i){const p=this;i.component("RouterLink",sn),i.component("RouterView",ln),i.config.globalProperties.$router=p,Object.defineProperty(i.config.globalProperties,"$route",{enumerable:!0,get:()=>F(a)}),G&&!ie&&a.value===$&&(ie=!0,M(s.location).catch(b=>{}));const h={};for(const b in $)h[b]=L(()=>a.value[b]);i.provide(te,p),i.provide(ve,qe(h)),i.provide(pe,a);const v=i.unmount;ae.add(i),i.unmount=function(){ae.delete(i),ae.size<1&&(f=$,V&&V(),V=null,a.value=$,ie=!1,Z=!1),v()}}};return Se}function q(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function un(e,t){const n=[],r=[],s=[],l=Math.max(t.matched.length,e.matched.length);for(let d=0;d<l;d++){const g=t.matched[d];g&&(e.matched.find(f=>z(f,g))?r.push(g):n.push(g));const a=e.matched[d];a&&(t.matched.find(f=>z(f,a))||s.push(a))}return[n,r,s]}function gn(){return T(te)}function vn(){return T(ve)}export{hn as a,pn as b,mn as c,vn as d,dn as o,gn as u};
|