@kitbag/router 0.19.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(A,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(A=typeof globalThis<"u"?globalThis:A||self,c(A["@kitbag/router"]={},A.Vue))})(this,function(A,c){"use strict";var lo=Object.defineProperty;var ho=(A,c,Z)=>c in A?lo(A,c,{enumerable:!0,configurable:!0,writable:!0,value:Z}):A[c]=Z;var W=(A,c,Z)=>ho(A,typeof c!="symbol"?c+"":c,Z);function Z(e){return typeof e!="string"?!1:/^(https?:\/\/|\/).*/g.test(e)}function Ve(e){return Z(e)?e:`/${e}`}class ot extends Error{constructor(t){super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`)}}class at extends Error{constructor(t){super(`Child property on meta for ${t} conflicts with the parent meta.`)}}class Y extends Error{constructor(){super("Router not installed")}}class st extends Error{constructor(t,n){super(`useRoute called with incorrect route. Given ${t}, expected ${n}`)}}const ct=Symbol();function we(){const e=c.inject(ct);if(!e)throw new Y;return e}function se(e){return Array.isArray(e)?e:[e]}function it(e,t){return e.filter(n=>t===n).length}function ce(...e){const t=e.flatMap(n=>Array.isArray(n)?n:Object.keys(n));for(const n of t)if(it(t,n)>1)throw new ot(n)}class G extends Error{}const pe="[",Ee="]";function Rn(e){return e!==String&&e!==Boolean&&e!==Number&&e!==Date}function wn(e){return typeof e=="function"&&Rn(e)}function be(e){return typeof e=="object"&&"get"in e&&typeof e.get=="function"&&"set"in e&&typeof e.set=="function"}function ut(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ft(e,t){return be(e)?{...e,defaultValue:t??e.defaultValue}:{get:n=>X(n,e),set:n=>ee(n,e),defaultValue:t}}function En(e){return be(e)&&e.defaultValue!==void 0}function bn(e,t){return ft(e,t)}function lt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function F(e){return typeof e=="string"&&e.length>0}let b=null;async function Pn(){const{ZodSchema:e,ZodString:t,ZodBoolean:n,ZodDate:r,ZodNumber:o,ZodLiteral:a,ZodObject:s,ZodEnum:h,ZodNativeEnum:p,ZodArray:i,ZodTuple:g,ZodUnion:S,ZodDiscriminatedUnion:V,ZodRecord:k,ZodMap:E,ZodSet:y,ZodIntersection:d,ZodPromise:w,ZodFunction:l}=await import("zod");return{ZodSchema:e,ZodString:t,ZodBoolean:n,ZodDate:r,ZodNumber:o,ZodLiteral:a,ZodObject:s,ZodEnum:h,ZodNativeEnum:p,ZodArray:i,ZodTuple:g,ZodUnion:S,ZodDiscriminatedUnion:V,ZodRecord:k,ZodMap:E,ZodSet:y,ZodIntersection:d,ZodPromise:w,ZodFunction:l}}function Sn(e){return Object.values(e).some(t=>Object.values(t.host.params).some(n=>Ne(n))||Object.values(t.path.params).some(n=>Ne(n))||Object.values(t.query.params).some(n=>Ne(n)))}function Ne(e){return typeof e=="object"&&"parse"in e&&typeof e.parse=="function"}async function vn(){try{b=await Pn()}catch{throw new Error("Failed to initialize Zod")}}function ht(e){return b?e instanceof b.ZodSchema:!1}function dt(e){return{get:(t,{invalid:n})=>{try{return xe(t,e)}catch{throw n()}},set:(t,{invalid:n})=>{try{return je(t,e)}catch{throw n()}}}}const An=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function ie(e,t){if(typeof t=="string"&&An.test(t)){const n=new Date(t);return isNaN(n.getTime())?t:n}return t}function ue(e){for(const t of e)try{return t()}catch{continue}throw new Error("All functions failed")}function Pe(e,t){return b!=null&&b.ZodString&&e instanceof b.ZodString?1:b!=null&&b.ZodString&&t instanceof b.ZodString?-1:0}function xe(e,t){if(!b)throw new Error("Zod is not initialized");if(t instanceof b.ZodString)return t.parse(e);if(t instanceof b.ZodBoolean)return t.parse(!!e);if(t instanceof b.ZodDate)return t.parse(new Date(e));if(t instanceof b.ZodNumber)return t.parse(Number(e));if(t instanceof b.ZodLiteral)return ue([()=>t.parse(Number(e)),()=>t.parse(!!e),()=>t.parse(e)]);if(t instanceof b.ZodObject)return t.parse(JSON.parse(e,ie));if(t instanceof b.ZodEnum)return t.parse(e);if(t instanceof b.ZodNativeEnum)return ue([()=>t.parse(Number(e)),()=>t.parse(e)]);if(t instanceof b.ZodArray||t instanceof b.ZodTuple)return t.parse(JSON.parse(e,ie));if(t instanceof b.ZodUnion){const n=Array.from(t._def.options).sort(Pe).map(r=>()=>xe(e,r));return ue(n)}if(t instanceof b.ZodDiscriminatedUnion){const n=Array.from(t.options).sort(Pe).map(r=>()=>xe(e,r));return ue(n)}if(t instanceof b.ZodRecord)return t.parse(JSON.parse(e,ie));if(t instanceof b.ZodMap)return t.parse(new Map(JSON.parse(e,ie)));if(t instanceof b.ZodSet)return t.parse(new Set(JSON.parse(e,ie)));if(t instanceof b.ZodIntersection)throw new Error("Intersection schemas are not supported");if(t instanceof b.ZodPromise)throw new Error("Promise schemas are not supported");if(t instanceof b.ZodFunction)throw new Error("Function schemas are not supported");return t.parse(e)}function je(e,t){if(!b)throw new Error("Zod is not initialized");if(t instanceof b.ZodString)return t.parse(e);if(t instanceof b.ZodBoolean)return t.parse(e).toString();if(t instanceof b.ZodDate)return t.parse(e).toISOString();if(t instanceof b.ZodNumber)return t.parse(Number(e)).toString();if(t instanceof b.ZodLiteral)return t.parse(e).toString();if(t instanceof b.ZodObject)return JSON.stringify(t.parse(e));if(t instanceof b.ZodEnum)return t.parse(e);if(t instanceof b.ZodNativeEnum)return t.parse(e).toString();if(t instanceof b.ZodArray||t instanceof b.ZodTuple)return JSON.stringify(t.parse(e));if(t instanceof b.ZodUnion){const n=Array.from(t._def.options).sort(Pe).map(r=>()=>je(e,r));return ue(n)}if(t instanceof b.ZodDiscriminatedUnion){const n=Array.from(t.options).sort(Pe).map(r=>()=>je(e,r));return ue(n)}if(t instanceof b.ZodRecord)return JSON.stringify(t.parse(e));if(t instanceof b.ZodMap){const n=t.parse(e);return JSON.stringify(Array.from(n.entries()))}if(t instanceof b.ZodSet){const n=t.parse(e);return JSON.stringify(Array.from(n.values()))}if(t instanceof b.ZodIntersection)throw new Error("Intersection schemas are not supported");if(t instanceof b.ZodPromise)throw new Error("Promise schemas are not supported");if(t instanceof b.ZodFunction)throw new Error("Function schemas are not supported");return JSON.stringify(t.parse(e))}function kn(e,t){return e[t]??String}const j={invalid:e=>{throw new G(e)}},pt={get:e=>e,set:(e,{invalid:t})=>{if(typeof e!="string")throw t();return e}},Ze={get:(e,{invalid:t})=>{if(e==="true")return!0;if(e==="false")return!1;throw t()},set:(e,{invalid:t})=>{if(typeof e!="boolean")throw t();return e.toString()}},Oe={get:(e,{invalid:t})=>{const n=Number(e);if(isNaN(n))throw t();return n},set:(e,{invalid:t})=>{if(typeof e!="number")throw t();return e.toString()}},mt={get:(e,{invalid:t})=>{const n=new Date(e);if(isNaN(n.getTime()))throw t();return n},set:(e,{invalid:t})=>{if(typeof e!="object"||!(e instanceof Date))throw t();return e.toISOString()}},yt={get:(e,{invalid:t})=>{try{return JSON.parse(e)}catch{throw t()}},set:(e,{invalid:t})=>{try{return JSON.stringify(e)}catch{throw t()}}};function Un(e,t){switch(typeof t){case"string":return pt.get(e,j)===t;case"number":return Oe.get(e,j)===t;case"boolean":return Ze.get(e,j)===t;default:return!1}}function X(e,t,n=!1){if(e===void 0||!F(e)){if(En(t))return t.defaultValue;if(n)return;throw new G}if(t===String)return pt.get(e,j);if(t===Boolean)return Ze.get(e,j);if(t===Number)return Oe.get(e,j);if(t===Date)return mt.get(e,j);if(t===JSON)return yt.get(e,j);if(wn(t))return t(e,j);if(be(t))return t.get(e,j);if(t instanceof RegExp){if(t.test(e))return e;throw new G}if(ut(t)){if(Un(e,t))return t;throw new G}return ht(t)?dt(t).get(e,j):e}function Ln(e,t,n=!1){try{return X(e,t,n)}catch(r){if(r instanceof G)return;throw r}}function Cn(e,t,n=!1){try{return ee(e,t,n)}catch(r){if(r instanceof G)return;throw r}}function ee(e,t,n=!1){if(e===void 0){if(n)return"";throw new G}if(t===Boolean)return Ze.set(e,j);if(t===Number)return Oe.set(e,j);if(t===Date)return mt.set(e,j);if(t===JSON)return yt.set(e,j);if(be(t))return t.set(e,j);if(ut(t)){if(t!==e)throw new G;return e.toString()}if(ht(t))return dt(t).set(e,j);try{return e.toString()}catch{throw new G}}function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bn(e,t){const n=Array.from(e.matchAll(t));if(n.length===0)return[e];let r=0;const o=n.reduce((s,h)=>{const p=$e(e.slice(r,h.index));p.length&&s.push(p);const[i]=h;return s.push(i),r=h.index+i.length,s},[]),a=e.slice(r);return a&&o.push(a),o}function Vn(e){const t=gt(e.path.value);return new RegExp(`^${t}$`,"i")}function Nn(e){const t=new URLSearchParams(e.query.value);return Array.from(t.entries()).filter(([,n])=>!_e(n)).map(([n,r])=>{const o=gt(r);return new RegExp(`${$e(n)}=${o}(&|$)`,"i")})}function gt(e){return Bn(e,new RegExp(Se,"g")).map(t=>t.startsWith(pe)?Rt(t):$e(t)).join("")}function Rt(e){return e.replace(new RegExp(Se,"g"),".+")}function xn(e,t){const n=wt(t);return e.replace(n,"(.*)")}function He(e,t){return Zn(t).test(e.value)}function _e(e){return new RegExp(jn,"g").test(e)}const Se=`\\${pe}\\??([\\w-_]+)\\${Ee}`,jn=`\\${pe}\\?([\\w-_]+)\\${Ee}`;function qe(e){const[t]=Et(e,new RegExp(Se,"g"));return t}function wt(e){return new RegExp(`\\${pe}\\??${e}\\${Ee}`,"g")}function Zn(e){return new RegExp(`\\${pe}\\?${e}\\${Ee}`,"g")}function Et(e,t){return Array.from(e.matchAll(t)).flatMap(([,...r])=>r.map(o=>F(o)?o:""))}function On(e="",t={}){return F(e)?Array.from(e.matchAll(new RegExp(Se,"g"))).reduce((r,[o,a])=>{const s=qe(o);if(!s)return r;const h=kn(t,s);return ce([s],r),r[a]=h,r},{}):{}}function $n(e){return lt(e)&&typeof e.value=="string"}function te(e){return e===void 0?M():$n(e)?e:M(e,{})}function M(e,t){return{value:e??"",params:On(e,t)}}function bt(e,t){ce(e.params,t.params);const n=`${e.value}${t.value}`;return M(n,{...e.params,...t.params})}function Hn(e,t){return bt(e,t)}function _n(e,t){return qn(e,t),{...e,...t}}function qn(e,t){const n=Object.keys(e).find(r=>r in t&&typeof t[r]!=typeof e[r]);if(n)throw new at(n)}function In(e,t){ce(e.params,t.params);const n=[e.value,t.value].filter(F).join("&");return M(n,{...e.params,...t.params})}function Dn(e,t){return ce(e,t),{...e,...t}}function Pt(e){return"parent"in e&&!!e.parent}function St(e){return"component"in e&&!!e.component}function vt(e){return"props"in e&&typeof e.props=="function"}function At(e){return"components"in e&&!!e.components}function kt(e){return"props"in e&&typeof e.props=="object"}function Ut(e,t){return{...t,path:bt(e.path,t.path),query:In(e.query,t.query),meta:_n(e.meta,t.meta),state:Dn(e.state,t.state),hash:Hn(e.hash,t.hash),matches:[...e.matches,t.matched],host:e.host,depth:e.depth+1}}function Ie(){return typeof window<"u"&&typeof window.document<"u"}function De(e){const t=new URLSearchParams(e);return{get:(...n)=>t.get(...n),getAll:(...n)=>t.getAll(...n),set:(...n)=>{t.set(...n)},append:(...n)=>{t.append(...n)},delete:(...n)=>{t.delete(...n)},toString:(...n)=>t.toString(...n),forEach:(...n)=>{t.forEach(...n)},entries:(...n)=>t.entries(...n),keys:(...n)=>t.keys(...n),values:(...n)=>t.values(...n),has:(...n)=>t.has(...n),size:t.size,sort:()=>{t.sort()},[Symbol.iterator]:()=>t[Symbol.iterator]()}}function Te(){let e=0;return()=>(++e).toString()}const Tn=Te()();function Fn(e){return e===Tn}const Fe=Te();function Lt(e){return e===void 0?"":e}function ne(e,t){const n=Fe(),r=Lt(e.name),o=te(e.path),a=te(e.query),s=te(e.hash),h=e.meta??{},p=e.state??{},i=c.markRaw({id:n,meta:h,state:p,...e,props:t}),g={id:n,matched:i,matches:[i],name:r,path:o,query:a,hash:s,meta:h,state:p,depth:1,host:M(),prefetch:e.prefetch},S=Pt(e)?Ut(e.parent,g):g;return ce(S.path.params,S.query.params,S.hash.params),S}const ve={template:"<div>This is component</div>"},Me=ne({name:"parentA",path:"/parentA/[paramA]"}),Ct=ne({parent:Me,name:"parentA.childA",path:"/childA/[?paramB]"}),Mn=ne({parent:Me,name:"parentA.childB",path:"/childB/[paramD]",component:ve}),Jn=ne({parent:Ct,name:"parentA.childA.grandChildA",path:"/[paramC]",component:ve});ne({name:"parentB",path:"/parentB",component:ve}),ne({name:"parentC",path:"/",component:ve});const Wn="lazy",Gn={components:!0,props:!1};function Ae(e){return["eager","lazy","intent"].includes(e)}function Bt({routerPrefetch:e,routePrefetch:t,linkPrefetch:n},r){const o=Je(n,r),a=Je(t,r),s=Je(e,r),h=[o,a,s,Gn[r],Wn].reduce((p,i)=>Ae(p)?p:p===!0&&Ae(i)?i:p===!0&&!Ae(i)?p:p===void 0?i:p,void 0);return Ae(h)?h:!1}function Je(e,t){return lt(e)?e[t]:e}class Vt extends Error{constructor(){super("Uncaught CallbackContextAbortError");W(this,"response");this.response={status:"ABORT"}}}class fe extends Error{constructor(n){super("Uncaught CallbackContextPushError");W(this,"response");this.response={status:"PUSH",to:n}}}class ke extends Error{constructor(n){super("Uncaught CallbackContextRejectionError");W(this,"response");this.response={status:"REJECT",type:n}}}function Nt(){return{reject:o=>{throw new ke(o)},push:(...o)=>{throw new fe(o)},replace:(o,a,s)=>{if(Z(o)){const i=a??{};throw new fe([o,{...i,replace:!0}])}const h=a,p=s??{};throw new fe([o,h,{...p,replace:!0}])},abort:()=>{throw new Vt}}}function xt(e){return typeof e=="object"&&e!==null&&"then"in e}function jt(e){try{const t=e();return xt(t)?t.catch(n=>n):t}catch(t){return t}}function Zt(){let e=null;function t(r){e=r}function n(r){return e?e.runWithContext(r):r()}return{setVueApp:t,runWithContext:n}}const Ot=Symbol();function zn(){const{setVueApp:e,runWithContext:t}=Zt(),n=c.reactive(new Map),{push:r,replace:o,reject:a}=Nt(),s=(y,d,w)=>d.matches.filter(l=>Bt({...w,routePrefetch:l.prefetch},"props")===y).flatMap(l=>k(l)).reduce((l,{id:u,name:P,props:L})=>{if(!L)return l;const U=V(u,P,d),R=t(()=>jt(()=>L(d,{push:r,replace:o,reject:a,parent:g(d,!0)})));return l[U]=R,l},{}),h=y=>{Object.entries(y).forEach(([d,w])=>{n.set(d,w)})},p=async y=>{const d=y.matches.flatMap(k),w=[],l=[];for(const{id:u,name:P,props:L}of d){if(!L)continue;const U=V(u,P,y);if(w.push(U),!n.has(U)){const R=t(()=>jt(()=>L(y,{push:r,replace:o,reject:a,parent:g(y)})));n.set(U,R)}l.push((async()=>{const R=await n.get(U);if(R instanceof Error)throw R})())}E(w);try{return await Promise.all(l),{status:"SUCCESS"}}catch(u){if(u instanceof fe||u instanceof ke)return u.response;throw u}},i=(y,d,w)=>{const l=V(y,d,w);return n.get(l)};function g(y,d=!1){const w=y.matches.at(-2);if(w)return vt(w)?{name:w.name??"",get props(){return S(w,"default",y,d)}}:kt(w)?{name:w.name??"",props:new Proxy({},{get(l,u){return typeof u!="string"?Reflect.get(l,u):S(w,u,y,d)}})}:{name:w.name??"",props:void 0}}function S(y,d,w,l=!1){const u=i(y.id,d,w);if(l&&!u){const P=y.name??"unknown",L=w.name||"unknown";console.warn(`
2
- Unable to access parent props "${d}" from route "${P}" while prefetching props for route "${L}".
1
+ (function(v,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(v=typeof globalThis<"u"?globalThis:v||self,i(v["@kitbag/router"]={},v.Vue))})(this,function(v,i){"use strict";var So=Object.defineProperty;var Po=(v,i,Z)=>i in v?So(v,i,{enumerable:!0,configurable:!0,writable:!0,value:Z}):v[i]=Z;var G=(v,i,Z)=>Po(v,typeof i!="symbol"?i+"":i,Z);function Z(t){return typeof t!="string"?!1:/^(https?:\/\/|\/).*/g.test(t)}function Zt(t){return Z(t)?t:`/${t}`}class pe extends Error{constructor(e){super(`Invalid Param "${e}": Router does not support multiple params by the same name. All param names must be unique.`)}}class de extends Error{constructor(e){super(`Child property on meta for ${e} conflicts with the parent meta.`)}}class X extends Error{constructor(){super("Router not installed")}}class he extends Error{constructor(e,r){super(`useRoute called with incorrect route. Given ${e}, expected ${r}`)}}const ye=Symbol();function Pt(){const t=i.inject(ye);if(!t)throw new X;return t}function it(t){return Array.isArray(t)?t:[t]}function me(t,e){return t.filter(r=>e===r).length}function ct(...t){const e=t.flatMap(r=>Array.isArray(r)?r:Object.keys(r));for(const r of e)if(me(e,r)>1)throw new pe(r)}class z extends Error{}const Rt="[",At="]";function vr(t){return t!==String&&t!==Boolean&&t!==Number&&t!==Date}function kr(t){return typeof t=="function"&&vr(t)}function vt(t){return typeof t=="object"&&"get"in t&&typeof t.get=="function"&&"set"in t&&typeof t.set=="function"}function ge(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function Re(t,e){return vt(t)?{...t,defaultValue:e??t.defaultValue}:{get:r=>tt(r,t),set:r=>et(r,t),defaultValue:e}}function Ur(t){return vt(t)&&t.defaultValue!==void 0}function Lr(t,e){return Re(t,e)}function ut(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function F(t){return typeof t=="string"&&t.length>0}let b=null;async function Nr(){const{ZodSchema:t,ZodString:e,ZodBoolean:r,ZodDate:n,ZodNumber:o,ZodLiteral:a,ZodObject:s,ZodEnum:p,ZodNativeEnum:h,ZodArray:c,ZodTuple:g,ZodUnion:P,ZodDiscriminatedUnion:C,ZodRecord:k,ZodMap:E,ZodSet:m,ZodIntersection:d,ZodPromise:w,ZodFunction:l}=await import("zod");return{ZodSchema:t,ZodString:e,ZodBoolean:r,ZodDate:n,ZodNumber:o,ZodLiteral:a,ZodObject:s,ZodEnum:p,ZodNativeEnum:h,ZodArray:c,ZodTuple:g,ZodUnion:P,ZodDiscriminatedUnion:C,ZodRecord:k,ZodMap:E,ZodSet:m,ZodIntersection:d,ZodPromise:w,ZodFunction:l}}function Vr(t){return Object.values(t).some(e=>Object.values(e.host.params).some(r=>$t(r))||Object.values(e.path.params).some(r=>$t(r))||Object.values(e.query.params).some(r=>$t(r)))}function $t(t){return ut(t)&&"parse"in t&&typeof t.parse=="function"&&"~standard"in t&&ut(t["~standard"])&&"vendor"in t["~standard"]&&t["~standard"].vendor==="zod"}async function Br(){try{b=await Nr()}catch{throw new Error("Failed to initialize Zod")}}function we(t){return b?t instanceof b.ZodSchema:!1}function Ee(t){return{get:(e,{invalid:r})=>{try{return Ht(e,t)}catch{throw r()}},set:(e,{invalid:r})=>{try{return _t(e,t)}catch{throw r()}}}}const Cr=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function ft(t,e){if(typeof e=="string"&&Cr.test(e)){const r=new Date(e);return isNaN(r.getTime())?e:r}return e}function lt(t){for(const e of t)try{return e()}catch{continue}throw new Error("All functions failed")}function kt(t,e){return b!=null&&b.ZodString&&t instanceof b.ZodString?1:b!=null&&b.ZodString&&e instanceof b.ZodString?-1:0}function Ht(t,e){if(!b)throw new Error("Zod is not initialized");if(e instanceof b.ZodString)return e.parse(t);if(e instanceof b.ZodBoolean)return e.parse(!!t);if(e instanceof b.ZodDate)return e.parse(new Date(t));if(e instanceof b.ZodNumber)return e.parse(Number(t));if(e instanceof b.ZodLiteral)return lt([()=>e.parse(Number(t)),()=>e.parse(!!t),()=>e.parse(t)]);if(e instanceof b.ZodObject)return e.parse(JSON.parse(t,ft));if(e instanceof b.ZodEnum)return e.parse(t);if(e instanceof b.ZodNativeEnum)return lt([()=>e.parse(Number(t)),()=>e.parse(t)]);if(e instanceof b.ZodArray||e instanceof b.ZodTuple)return e.parse(JSON.parse(t,ft));if(e instanceof b.ZodUnion){const r=Array.from(e._def.options).sort(kt).map(n=>()=>Ht(t,n));return lt(r)}if(e instanceof b.ZodDiscriminatedUnion){const r=Array.from(e.options).sort(kt).map(n=>()=>Ht(t,n));return lt(r)}if(e instanceof b.ZodRecord)return e.parse(JSON.parse(t,ft));if(e instanceof b.ZodMap)return e.parse(new Map(JSON.parse(t,ft)));if(e instanceof b.ZodSet)return e.parse(new Set(JSON.parse(t,ft)));if(e instanceof b.ZodIntersection)throw new Error("Intersection schemas are not supported");if(e instanceof b.ZodPromise)throw new Error("Promise schemas are not supported");if(e instanceof b.ZodFunction)throw new Error("Function schemas are not supported");return e.parse(t)}function _t(t,e){if(!b)throw new Error("Zod is not initialized");if(e instanceof b.ZodString)return e.parse(t);if(e instanceof b.ZodBoolean)return e.parse(t).toString();if(e instanceof b.ZodDate)return e.parse(t).toISOString();if(e instanceof b.ZodNumber)return e.parse(Number(t)).toString();if(e instanceof b.ZodLiteral)return e.parse(t).toString();if(e instanceof b.ZodObject)return JSON.stringify(e.parse(t));if(e instanceof b.ZodEnum)return e.parse(t);if(e instanceof b.ZodNativeEnum)return e.parse(t).toString();if(e instanceof b.ZodArray||e instanceof b.ZodTuple)return JSON.stringify(e.parse(t));if(e instanceof b.ZodUnion){const r=Array.from(e._def.options).sort(kt).map(n=>()=>_t(t,n));return lt(r)}if(e instanceof b.ZodDiscriminatedUnion){const r=Array.from(e.options).sort(kt).map(n=>()=>_t(t,n));return lt(r)}if(e instanceof b.ZodRecord)return JSON.stringify(e.parse(t));if(e instanceof b.ZodMap){const r=e.parse(t);return JSON.stringify(Array.from(r.entries()))}if(e instanceof b.ZodSet){const r=e.parse(t);return JSON.stringify(Array.from(r.values()))}if(e instanceof b.ZodIntersection)throw new Error("Intersection schemas are not supported");if(e instanceof b.ZodPromise)throw new Error("Promise schemas are not supported");if(e instanceof b.ZodFunction)throw new Error("Function schemas are not supported");return JSON.stringify(e.parse(t))}function qt(t){return typeof t=="object"&&t!==null&&"then"in t}function V(t,e){const r=t["~standard"].validate(e);if(qt(r))throw new Error("Promise schemas are not supported");if(r.issues)throw new Error("Validation failed");return r.value}function xr(t){return ut(t)&&"type"in t&&typeof t.type=="string"&&"~standard"in t&&ut(t["~standard"])&&"vendor"in t["~standard"]&&t["~standard"].vendor==="valibot"}function be(t){return xr(t)}function Se(t){return{get:(e,{invalid:r})=>{try{return It(e,t)}catch{throw r()}},set:(e,{invalid:r})=>{try{return Dt(e,t)}catch{throw r()}}}}const jr=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function pt(t,e){if(typeof e=="string"&&jr.test(e)){const r=new Date(e);return isNaN(r.getTime())?e:r}return e}function dt(t){for(const e of t)try{return e()}catch{continue}throw new Error("All functions failed")}function Ut(t,e){return t.type==="string"?1:e.type==="string"?-1:0}function It(t,e){if(e.type==="boolean")return V(e,!!t);if(e.type==="date")return V(e,new Date(t));if(e.type==="number")return V(e,Number(t));if(e.type==="literal")return dt([()=>V(e,Number(t)),()=>V(e,!!t),()=>V(e,t)]);if(e.type==="object")return V(e,JSON.parse(t,pt));if(e.type==="enum")return dt([()=>V(e,Number(t)),()=>V(e,!!t),()=>V(e,t)]);if(e.type==="array"||e.type==="tuple")return V(e,JSON.parse(t,pt));if(e.type==="union"&&"options"in e){const r=e.options.sort(Ut).map(n=>()=>It(t,n));return dt(r)}if(e.type==="variant"&&"options"in e){const r=e.options.sort(Ut).map(n=>()=>It(t,n));return dt(r)}if(e.type==="record")return V(e,JSON.parse(t,pt));if(e.type==="map")return V(e,new Map(JSON.parse(t,pt)));if(e.type==="set")return V(e,new Set(JSON.parse(t,pt)));if(e.type==="intersection")throw new Error("Intersection schemas are not supported");if(e.type==="promise")throw new Error("Promise schemas are not supported");if(e.type==="function")throw new Error("Function schemas are not supported");return V(e,t)}function Dt(t,e){if(e.type==="string"||e.type==="boolean")return V(e,t).toString();if(e.type==="date")return V(e,t).toISOString();if(e.type==="number")return V(e,Number(t)).toString();if(e.type==="literal")return V(e,t).toString();if(e.type==="object")return JSON.stringify(V(e,t));if(e.type==="enum"||e.type==="nativeEnum")return V(e,t).toString();if(e.type==="array"||e.type==="tuple")return JSON.stringify(V(e,t));if(e.type==="union"&&"options"in e){const r=e.options.sort(Ut).map(n=>()=>Dt(t,n));return dt(r)}if(e.type==="variant"&&"options"in e){const r=e.options.sort(Ut).map(n=>()=>Dt(t,n));return dt(r)}if(e.type==="record")return JSON.stringify(V(e,t));if(e.type==="map"){const r=V(e,t);return JSON.stringify(Array.from(r.entries()))}if(e.type==="set"){const r=V(e,t);return JSON.stringify(Array.from(r.values()))}if(e.type==="intersection")throw new Error("Intersection schemas are not supported");if(e.type==="promise")throw new Error("Promise schemas are not supported");if(e.type==="function")throw new Error("Function schemas are not supported");return JSON.stringify(V(e,t))}function Or(t,e){return t[e]??String}const j={invalid:t=>{throw new z(t)}},Pe={get:t=>t,set:(t,{invalid:e})=>{if(typeof t!="string")throw e();return t}},Jt={get:(t,{invalid:e})=>{if(t==="true")return!0;if(t==="false")return!1;throw e()},set:(t,{invalid:e})=>{if(typeof t!="boolean")throw e();return t.toString()}},Tt={get:(t,{invalid:e})=>{const r=Number(t);if(isNaN(r))throw e();return r},set:(t,{invalid:e})=>{if(typeof t!="number")throw e();return t.toString()}},Ae={get:(t,{invalid:e})=>{const r=new Date(t);if(isNaN(r.getTime()))throw e();return r},set:(t,{invalid:e})=>{if(typeof t!="object"||!(t instanceof Date))throw e();return t.toISOString()}},ve={get:(t,{invalid:e})=>{try{return JSON.parse(t)}catch{throw e()}},set:(t,{invalid:e})=>{try{return JSON.stringify(t)}catch{throw e()}}};function Zr(t,e){switch(typeof e){case"string":return Pe.get(t,j)===e;case"number":return Tt.get(t,j)===e;case"boolean":return Jt.get(t,j)===e;default:return!1}}function tt(t,e,r=!1){if(t===void 0||!F(t)){if(Ur(e))return e.defaultValue;if(r)return;throw new z}if(e===String)return Pe.get(t,j);if(e===Boolean)return Jt.get(t,j);if(e===Number)return Tt.get(t,j);if(e===Date)return Ae.get(t,j);if(e===JSON)return ve.get(t,j);if(kr(e))return e(t,j);if(vt(e))return e.get(t,j);if(e instanceof RegExp){if(e.test(t))return t;throw new z}if(ge(e)){if(Zr(t,e))return e;throw new z}return we(e)?Ee(e).get(t,j):be(e)?Se(e).get(t,j):t}function $r(t,e,r=!1){try{return tt(t,e,r)}catch(n){if(n instanceof z)return;throw n}}function Hr(t,e,r=!1){try{return et(t,e,r)}catch(n){if(n instanceof z)return;throw n}}function et(t,e,r=!1){if(t===void 0){if(r)return"";throw new z}if(e===Boolean)return Jt.set(t,j);if(e===Number)return Tt.set(t,j);if(e===Date)return Ae.set(t,j);if(e===JSON)return ve.set(t,j);if(vt(e))return e.set(t,j);if(ge(e)){if(e!==t)throw new z;return t.toString()}if(we(e))return Ee(e).set(t,j);if(be(e))return Se(e).set(t,j);try{return t.toString()}catch{throw new z}}function Ft(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _r(t,e){const r=Array.from(t.matchAll(e));if(r.length===0)return[t];let n=0;const o=r.reduce((s,p)=>{const h=Ft(t.slice(n,p.index));h.length&&s.push(h);const[c]=p;return s.push(c),n=p.index+c.length,s},[]),a=t.slice(n);return a&&o.push(a),o}function qr(t){const e=ke(t.path.value);return new RegExp(`^${e}$`,"i")}function Ir(t){const e=new URLSearchParams(t.query.value);return Array.from(e.entries()).filter(([,r])=>!Wt(r)).map(([r,n])=>{const o=ke(n);return new RegExp(`${Ft(r)}=${o}(&|$)`,"i")})}function ke(t){return _r(t,new RegExp(Lt,"g")).map(e=>e.startsWith(Rt)?Ue(e):Ft(e)).join("")}function Ue(t){return t.replace(new RegExp(Lt,"g"),".+")}function Dr(t,e){const r=Le(e);return t.replace(r,"(.*)")}function Mt(t,e){return Tr(e).test(t.value)}function Wt(t){return new RegExp(Jr,"g").test(t)}const Lt=`\\${Rt}\\??([\\w-_]+)\\${At}`,Jr=`\\${Rt}\\?([\\w-_]+)\\${At}`;function Gt(t){const[e]=Ne(t,new RegExp(Lt,"g"));return e}function Le(t){return new RegExp(`\\${Rt}\\??${t}\\${At}`,"g")}function Tr(t){return new RegExp(`\\${Rt}\\?${t}\\${At}`,"g")}function Ne(t,e){return Array.from(t.matchAll(e)).flatMap(([,...n])=>n.map(o=>F(o)?o:""))}function Fr(t="",e={}){return F(t)?Array.from(t.matchAll(new RegExp(Lt,"g"))).reduce((n,[o,a])=>{const s=Gt(o);if(!s)return n;const p=Or(e,s);return ct([s],n),n[a]=p,n},{}):{}}function Mr(t){return ut(t)&&typeof t.value=="string"}function rt(t){return t===void 0?M():Mr(t)?t:M(t,{})}function M(t,e){return{value:t??"",params:Fr(t,e)}}function Ve(t,e){ct(t.params,e.params);const r=`${t.value}${e.value}`;return M(r,{...t.params,...e.params})}function Wr(t,e){return Ve(t,e)}function Gr(t,e){return zr(t,e),{...t,...e}}function zr(t,e){const r=Object.keys(t).find(n=>n in e&&typeof e[n]!=typeof t[n]);if(r)throw new de(r)}function Qr(t,e){ct(t.params,e.params);const r=[t.value,e.value].filter(F).join("&");return M(r,{...t.params,...e.params})}function Kr(t,e){return ct(t,e),{...t,...e}}function Be(t){return"parent"in t&&!!t.parent}function Ce(t){return"component"in t&&!!t.component}function xe(t){return"props"in t&&typeof t.props=="function"}function je(t){return"components"in t&&!!t.components}function Oe(t){return"props"in t&&typeof t.props=="object"}function Ze(t,e){return{...e,path:Ve(t.path,e.path),query:Qr(t.query,e.query),meta:Gr(t.meta,e.meta),state:Kr(t.state,e.state),hash:Wr(t.hash,e.hash),matches:[...t.matches,e.matched],host:t.host,depth:t.depth+1}}function zt(){return typeof window<"u"&&typeof window.document<"u"}function Qt(t){const e=new URLSearchParams(t);return{get:(...r)=>e.get(...r),getAll:(...r)=>e.getAll(...r),set:(...r)=>{e.set(...r)},append:(...r)=>{e.append(...r)},delete:(...r)=>{e.delete(...r)},toString:(...r)=>e.toString(...r),forEach:(...r)=>{e.forEach(...r)},entries:(...r)=>e.entries(...r),keys:(...r)=>e.keys(...r),values:(...r)=>e.values(...r),has:(...r)=>e.has(...r),size:e.size,sort:()=>{e.sort()},[Symbol.iterator]:()=>e[Symbol.iterator]()}}function Kt(){let t=0;return()=>(++t).toString()}const Yr=Kt()();function Xr(t){return t===Yr}const Yt=Kt();function $e(t){return t===void 0?"":t}function nt(t,e){const r=Yt(),n=$e(t.name),o=rt(t.path),a=rt(t.query),s=rt(t.hash),p=t.meta??{},h=t.state??{},c=i.markRaw({id:r,meta:p,state:h,...t,props:e}),g={id:r,matched:c,matches:[c],name:n,path:o,query:a,hash:s,meta:p,state:h,depth:1,host:M(),prefetch:t.prefetch},P=Be(t)?Ze(t.parent,g):g;return ct(P.path.params,P.query.params,P.hash.params),P}const Nt={template:"<div>This is component</div>"},Xt=nt({name:"parentA",path:"/parentA/[paramA]"}),He=nt({parent:Xt,name:"parentA.childA",path:"/childA/[?paramB]"}),tn=nt({parent:Xt,name:"parentA.childB",path:"/childB/[paramD]",component:Nt}),en=nt({parent:He,name:"parentA.childA.grandChildA",path:"/[paramC]",component:Nt});nt({name:"parentB",path:"/parentB",component:Nt}),nt({name:"parentC",path:"/",component:Nt});const rn="lazy",nn={components:!0,props:!1};function Vt(t){return["eager","lazy","intent"].includes(t)}function _e({routerPrefetch:t,routePrefetch:e,linkPrefetch:r},n){const o=te(r,n),a=te(e,n),s=te(t,n),p=[o,a,s,nn[n],rn].reduce((h,c)=>Vt(h)?h:h===!0&&Vt(c)?c:h===!0&&!Vt(c)?h:h===void 0?c:h,void 0);return Vt(p)?p:!1}function te(t,e){return ut(t)?t[e]:t}class qe extends Error{constructor(){super("Uncaught CallbackContextAbortError");G(this,"response");this.response={status:"ABORT"}}}class ht extends Error{constructor(r){super("Uncaught CallbackContextPushError");G(this,"response");this.response={status:"PUSH",to:r}}}class Bt extends Error{constructor(r){super("Uncaught CallbackContextRejectionError");G(this,"response");this.response={status:"REJECT",type:r}}}function Ie(){return{reject:o=>{throw new Bt(o)},push:(...o)=>{throw new ht(o)},replace:(o,a,s)=>{if(Z(o)){const c=a??{};throw new ht([o,{...c,replace:!0}])}const p=a,h=s??{};throw new ht([o,p,{...h,replace:!0}])},abort:()=>{throw new qe}}}function De(t){try{const e=t();return qt(e)?e.catch(r=>r):e}catch(e){return e}}function Je(){let t=null;function e(n){t=n}function r(n){return t?t.runWithContext(n):n()}return{setVueApp:e,runWithContext:r}}const Te=Symbol();function on(){const{setVueApp:t,runWithContext:e}=Je(),r=i.reactive(new Map),{push:n,replace:o,reject:a}=Ie(),s=(m,d,w)=>d.matches.filter(l=>_e({...w,routePrefetch:l.prefetch},"props")===m).flatMap(l=>k(l)).reduce((l,{id:u,name:S,props:L})=>{if(!L)return l;const U=C(u,S,d),R=e(()=>De(()=>L(d,{push:n,replace:o,reject:a,parent:g(d,!0)})));return l[U]=R,l},{}),p=m=>{Object.entries(m).forEach(([d,w])=>{r.set(d,w)})},h=async m=>{const d=m.matches.flatMap(k),w=[],l=[];for(const{id:u,name:S,props:L}of d){if(!L)continue;const U=C(u,S,m);if(w.push(U),!r.has(U)){const R=e(()=>De(()=>L(m,{push:n,replace:o,reject:a,parent:g(m)})));r.set(U,R)}l.push((async()=>{const R=await r.get(U);if(R instanceof Error)throw R})())}E(w);try{return await Promise.all(l),{status:"SUCCESS"}}catch(u){if(u instanceof ht||u instanceof Bt)return u.response;throw u}},c=(m,d,w)=>{const l=C(m,d,w);return r.get(l)};function g(m,d=!1){const w=m.matches.at(-2);if(w)return xe(w)?{name:w.name??"",get props(){return P(w,"default",m,d)}}:Oe(w)?{name:w.name??"",props:new Proxy({},{get(l,u){return typeof u!="string"?Reflect.get(l,u):P(w,u,m,d)}})}:{name:w.name??"",props:void 0}}function P(m,d,w,l=!1){const u=c(m.id,d,w);if(l&&!u){const S=m.name??"unknown",L=w.name||"unknown";console.warn(`
2
+ Unable to access parent props "${d}" from route "${S}" while prefetching props for route "${L}".
3
3
  This may occur if the parent route's props were not also prefetched.
4
- `)}return u}function V(y,d,w){return[y,d,w.id,JSON.stringify(w.params)].join("-")}function k(y){return vt(y)?[{id:y.id,name:"default",props:y.props}]:kt(y)?Object.entries(y.props).map(([d,w])=>({id:y.id,name:d,props:w})):[]}function E(y){for(const d of n.keys())y.includes(d)||n.delete(d)}return{getPrefetchProps:s,setPrefetchProps:h,getProps:i,setProps:p,setVueApp:e}}function $t(){const e=c.inject(Ot);if(!e)throw new Y;return e}const Qn=c.defineAsyncComponent(()=>new Promise(e=>{e({default:{template:"foo"}})}));function Ht(e){return e.name===Qn.name&&"__asyncLoader"in e}const _t=Symbol("visibilityObserver");function Kn(e){const t=c.inject(_t);if(!t)throw new Y;return c.watch(e,(r,o)=>{r&&t.observe(r),o&&t.unobserve(o)},{immediate:!0}),c.onUnmounted(()=>{e.value&&t.unobserve(e.value)}),{isElementVisible:c.computed(()=>e.value?t.isElementVisible(e.value):!1)}}function qt(e,t,n){c.watch(e,(r,o)=>{r&&r.addEventListener(t,n),o&&o.removeEventListener(t,n)},{immediate:!0}),c.onUnmounted(()=>{e.value&&e.value.removeEventListener(t,n)})}function Yn(e){const t=new Map,n=c.ref(),{getPrefetchProps:r,setPrefetchProps:o}=$t(),{isElementVisible:a}=Kn(n),s=()=>{const i=Array.from(t.values()).reduce((g,S)=>(Object.assign(g,S),g),{});o(i)};c.watch(()=>c.toValue(e),({route:i,...g})=>{t.clear(),i&&p("eager",i,g)},{immediate:!0}),c.watch(a,i=>{const{route:g,...S}=c.toValue(e);!g||!i||p("lazy",g,S)},{immediate:!0}),qt(n,"focusin",h),qt(n,"mouseover",h);function h(){const{route:i,...g}=c.toValue(e);i&&p("intent",i,g)}function p(i,g,S){Xn(i,g,S),t.has(i)||t.set(i,r(i,g,S))}return{element:n,commit:s}}function Xn(e,t,n){t.matches.forEach(r=>{Bt({...n,routePrefetch:r.prefetch},"components")===e&&(St(r)&&Ht(r.component)&&r.component.__asyncLoader(),At(r)&&Object.values(r.components).forEach(a=>{Ht(a)&&a.__asyncLoader()}))})}const It=Symbol("isRouterRouteSymbol");function er(e){return typeof e=="object"&&e!==null&&It in e}function tr(e,t){function n(d,w,l){if(typeof d=="object"){const P={...e.params,...d};return t(e.name,P,w)}const u={...e.params,[d]:w};return t(e.name,u,l)}const r=(...d)=>{const w=new URLSearchParams(e.query);w.set(...d),n({},{query:w})},o=(...d)=>{const w=new URLSearchParams(e.query);w.append(...d),n({},{query:w})},a=(...d)=>{const w=new URLSearchParams(e.query);w.delete(...d),n({},{query:w})},{id:s,matched:h,matches:p,name:i,hash:g,href:S}=c.toRefs(e),V=c.computed({get(){return new Proxy(e.params,{set(d,w,l){return n(w,l),!0}})},set(d){n(d)}}),k=c.computed({get(){return new Proxy(e.query,{get(d,w,l){switch(w){case"append":return o;case"set":return r;case"delete":return a;default:return Reflect.get(d,w,l)}}})},set(d){n({},{query:d})}}),E=c.computed({get(){return new Proxy(e.state,{set(d,w,l){return n({},{state:{...e.state,[w]:l}}),!0}})},set(d){n({},{state:d})}});return c.reactive({id:s,matched:h,matches:p,state:E,query:k,hash:g,params:V,name:i,href:S,update:n,[It]:!0})}function We(e,t,{exact:n}={}){return er(e)?t===void 0?!0:n?e.matched.name===t:e.matches.map(r=>r.name).includes(t):!1}function Ge(...e){const t=new URLSearchParams;for(const n of e){const r=new URLSearchParams(n);for(const[o,a]of r.entries())t.append(o,a)}return t}function Dt(e,t={},n={}){const r=we(),o=c.computed(()=>{const E=c.toValue(e);return typeof E!="string"?E:Z(E)?r.find(E,c.toValue(n)):r.resolve(E,c.toValue(t),c.toValue(n))}),a=c.computed(()=>{if(o.value)return o.value.href;const E=c.toValue(e);if(Z(E))return E;console.error(new Error("Failed to resolve route in RouterLink."))}),s=c.computed(()=>We(r.route)&&r.route.matches.some(E=>{var y;return E.id===((y=o.value)==null?void 0:y.id)})),h=c.computed(()=>{var E;return r.route.id===((E=o.value)==null?void 0:E.id)}),p=c.computed(()=>!!a.value&&r.isExternal(a.value)),i=c.computed(()=>{const E=c.toValue(e);return typeof E!="string"||Z(E)?c.toValue(t):c.toValue(n)}),{element:g,commit:S}=Yn(()=>({route:o.value,routerPrefetch:r.prefetch,linkPrefetch:i.value.prefetch})),V=E=>{S();const y={replace:(E==null?void 0:E.replace)??i.value.replace,query:Ge(i.value.query,E==null?void 0:E.query),hash:(E==null?void 0:E.hash)??i.value.hash,state:{...i.value.state,...E==null?void 0:E.state}},d=c.toValue(e);return Z(d)||typeof d=="object"?r.push(d,y):r.push(d,c.toValue(t),y)};return{element:g,route:o,href:a,isMatch:s,isExactMatch:h,isExternal:p,push:V,replace:E=>V({...E,replace:!0})}}const nr=["href"],Tt=c.defineComponent({__name:"routerLink",props:{to:{},prefetch:{type:[Boolean,String,Object],default:void 0},query:{},hash:{},replace:{type:Boolean},state:{}},setup(e){const t=e,n=we(),r=c.computed(()=>V(t.to)),o=c.computed(()=>k(t.to)),a=c.computed(()=>{const{to:y,...d}=t;return d}),{element:s,isMatch:h,isExactMatch:p,isExternal:i,push:g}=Dt(()=>typeof t.to=="function"?t.to(n.resolve):t.to,a),S=c.computed(()=>({"router-link--match":h.value,"router-link--exact-match":p.value}));function V(y){if(typeof y=="function"){const d=y(n.resolve);return V(d)}return Z(y)?n.find(y):y}function k(y){if(typeof y=="function"){const d=y(n.resolve);return k(d)}return Z(y)?y:y==null?void 0:y.href}function E(y){y.preventDefault(),g()}return(y,d)=>(c.openBlock(),c.createElementBlock("a",{ref_key:"element",ref:s,href:o.value,class:c.normalizeClass(["router-link",S.value]),onClick:E},[c.renderSlot(y.$slots,"default",c.normalizeProps(c.guardReactiveProps({route:r.value,isMatch:c.unref(h),isExactMatch:c.unref(p),isExternal:c.unref(i)})))],10,nr))}}),Ft=Symbol();function rr(){const e=c.inject(Ft);if(!e)throw new Y;return e}function ze(e,t){const n=we();function r(){if(!e)return;if(!We(n.route,e,t))throw new st(e,n.route.name)}return c.watch(n.route,r,{immediate:!0,deep:!0}),n.route}const Mt=Symbol();function Qe(){return c.inject(Mt,0)}function or(e,t,n){return c.defineComponent({name:"PropsWrapper",expose:[],setup(){const r=c.getCurrentInstance(),o=$t(),a=ze();return()=>{const s=o.getProps(e.id,t,a);return s instanceof Error?"":xt(s)?r!=null&&r.suspense?c.h(sr,{component:n,props:s}):c.h(ar,{component:n,props:s}):c.h(n,s)}}})}const ar=c.defineComponent(e=>{const t=c.ref();return c.watch(()=>e.props,async n=>{t.value=await n},{immediate:!0,deep:!0}),()=>t.value instanceof Error?"":t.value?c.h(e.component,t.value):""},{props:["component","props"]}),sr=c.defineComponent(async e=>{const t=c.ref();return t.value=await e.props,c.watch(()=>t.value,async n=>{t.value=await n},{deep:!0}),()=>t.value instanceof Error?"":t.value?c.h(e.component,t.value):""},{props:["component","props"]}),Jt=Symbol();function cr(){const e=new Map;return{getRouteComponents:n=>{const r=e.get(n.id);if(r)return r;const o=ir(n);return e.set(n.id,o),o}}}function ir(e){return At(e)?Wt(e,e.components):St(e)?Wt(e,{default:e.component}):{default:Ke}}function Wt(e,t){return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,or(e,n,r)]))}function ur(){const e=c.inject(Jt);if(!e)throw new Y;return e}const Ke=c.defineComponent({__name:"routerView",props:{name:{default:"default"}},setup(e){const t=ze(),n=rr(),r=Qe(),{getRouteComponents:o}=ur();c.provide(Mt,r+1);const a=c.computed(()=>{if(n.value)return n.value.component;const s=t.matches.at(r);return s?o(s)[e.name]:null});return(s,h)=>a.value?c.renderSlot(s.$slots,"default",c.normalizeProps(c.mergeProps({key:0},{route:c.unref(t),component:a.value,rejection:c.unref(n)})),()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(a.value)))]):c.createCommentVNode("",!0)}});class re{constructor(){W(this,"onBeforeRouteEnter",new Set);W(this,"onBeforeRouteUpdate",new Set);W(this,"onBeforeRouteLeave",new Set);W(this,"onAfterRouteEnter",new Set);W(this,"onAfterRouteUpdate",new Set);W(this,"onAfterRouteLeave",new Set)}}const me=(e,t,n)=>{var a,s;const r=e.matches,o=(t==null?void 0:t.matches)??[];return((a=r.at(n))==null?void 0:a.id)!==((s=o.at(n))==null?void 0:s.id)},ye=(e,t,n)=>{var a,s;const r=e.matches,o=(t==null?void 0:t.matches)??[];return((a=r.at(n))==null?void 0:a.id)!==((s=o.at(n))==null?void 0:s.id)},ge=(e,t,n)=>{var r,o;return((r=e.matches.at(n))==null?void 0:r.id)===((o=t==null?void 0:t.matches.at(n))==null?void 0:o.id)};function Gt(e){switch(e){case"onBeforeRouteEnter":case"onAfterRouteEnter":return me;case"onBeforeRouteUpdate":case"onAfterRouteUpdate":return ge;case"onBeforeRouteLeave":case"onAfterRouteLeave":return ye;default:throw new Error(`Switch is not exhaustive for lifecycle: ${e}`)}}function fr(e,t){const n=new re;return e.matches.forEach((r,o)=>{r.onBeforeRouteEnter&&me(e,t,o)&&se(r.onBeforeRouteEnter).forEach(a=>n.onBeforeRouteEnter.add(a)),r.onBeforeRouteUpdate&&ge(e,t,o)&&se(r.onBeforeRouteUpdate).forEach(a=>n.onBeforeRouteUpdate.add(a))}),t==null||t.matches.forEach((r,o)=>{r.onBeforeRouteLeave&&ye(e,t,o)&&se(r.onBeforeRouteLeave).forEach(a=>n.onBeforeRouteLeave.add(a))}),n}function lr(e,t){const n=new re;return e.matches.forEach((r,o)=>{r.onAfterRouteEnter&&me(e,t,o)&&se(r.onAfterRouteEnter).forEach(a=>n.onAfterRouteEnter.add(a)),r.onAfterRouteUpdate&&ge(e,t,o)&&se(r.onAfterRouteUpdate).forEach(a=>n.onAfterRouteUpdate.add(a))}),t==null||t.matches.forEach((r,o)=>{r.onAfterRouteLeave&&ye(e,t,o)&&se(r.onAfterRouteLeave).forEach(a=>n.onAfterRouteLeave.add(a))}),n}function hr(e,t,n){const r=new re;return e.matches.forEach((o,a)=>{me(e,t,a)&&n.onBeforeRouteEnter.forEach(s=>r.onBeforeRouteEnter.add(s)),ge(e,t,a)&&n.onBeforeRouteUpdate.forEach(s=>r.onBeforeRouteUpdate.add(s))}),t==null||t.matches.forEach((o,a)=>{ye(e,t,a)&&n.onBeforeRouteLeave.forEach(s=>r.onBeforeRouteLeave.add(s))}),r}function dr(e,t,n){const r=new re;return e.matches.forEach((o,a)=>{me(e,t,a)&&n.onAfterRouteEnter.forEach(s=>r.onAfterRouteEnter.add(s)),ge(e,t,a)&&n.onAfterRouteUpdate.forEach(s=>r.onAfterRouteUpdate.add(s))}),t==null||t.matches.forEach((o,a)=>{ye(e,t,a)&&n.onAfterRouteLeave.forEach(s=>r.onAfterRouteLeave.add(s))}),r}const zt=Symbol();function pr(){const{setVueApp:e,runWithContext:t}=Zt(),n={global:new re,component:new re},{reject:r,push:o,replace:a,abort:s}=Nt(),h=l=>(n.global.onBeforeRouteEnter.add(l),()=>n.global.onBeforeRouteEnter.delete(l)),p=l=>(n.global.onBeforeRouteUpdate.add(l),()=>n.global.onBeforeRouteUpdate.delete(l)),i=l=>(n.global.onBeforeRouteLeave.add(l),()=>n.global.onBeforeRouteLeave.delete(l)),g=l=>(n.global.onAfterRouteEnter.add(l),()=>n.global.onAfterRouteEnter.delete(l)),S=l=>(n.global.onAfterRouteUpdate.add(l),()=>n.global.onAfterRouteUpdate.delete(l)),V=l=>(n.global.onAfterRouteLeave.add(l),()=>n.global.onAfterRouteLeave.delete(l));async function k({to:l,from:u}){const{global:P,component:L}=n,U=fr(l,u),R=hr(l,u,P),f=[...R.onBeforeRouteEnter,...U.onBeforeRouteEnter,...R.onBeforeRouteUpdate,...U.onBeforeRouteUpdate,...L.onBeforeRouteUpdate,...R.onBeforeRouteLeave,...U.onBeforeRouteLeave,...L.onBeforeRouteLeave];try{const m=f.map(C=>t(()=>C(l,{from:u,reject:r,push:o,replace:a,abort:s})));await Promise.all(m)}catch(m){if(m instanceof fe||m instanceof ke||m instanceof Vt)return m.response;throw m}return{status:"SUCCESS"}}async function E({to:l,from:u}){const{global:P,component:L}=n,U=lr(l,u),R=dr(l,u,P),f=[...L.onAfterRouteLeave,...U.onAfterRouteLeave,...R.onAfterRouteLeave,...L.onAfterRouteUpdate,...U.onAfterRouteUpdate,...R.onAfterRouteUpdate,...L.onAfterRouteEnter,...U.onAfterRouteEnter,...R.onAfterRouteEnter];try{const m=f.map(C=>t(()=>C(l,{from:u,reject:r,push:o,replace:a})));await Promise.all(m)}catch(m){if(m instanceof fe||m instanceof ke)return m.response;throw m}return{status:"SUCCESS"}}return{runBeforeRouteHooks:k,runAfterRouteHooks:E,addComponentBeforeRouteHook:({lifecycle:l,depth:u,hook:P})=>{const L=Gt(l),U=n.component[l],R=(f,m)=>{if(L(f,m.from,u))return P(f,m)};return U.add(R),()=>U.delete(R)},addComponentAfterRouteHook:({lifecycle:l,depth:u,hook:P})=>{const L=Gt(l),U=n.component[l],R=(f,m)=>{if(L(f,m.from,u))return P(f,m)};return U.add(R),()=>U.delete(R)},addGlobalRouteHooks:l=>{l.onBeforeRouteEnter.forEach(u=>h(u)),l.onBeforeRouteUpdate.forEach(u=>p(u)),l.onBeforeRouteLeave.forEach(u=>i(u)),l.onAfterRouteEnter.forEach(u=>g(u)),l.onAfterRouteUpdate.forEach(u=>S(u)),l.onAfterRouteLeave.forEach(u=>V(u))},onBeforeRouteEnter:h,onBeforeRouteUpdate:p,onBeforeRouteLeave:i,onAfterRouteEnter:g,onAfterRouteUpdate:S,onAfterRouteLeave:V,setVueApp:e}}function Qt(){const e=c.inject(zt);if(!e)throw new Y;return e}function Kt(e){return t=>{const n=Qe(),o=Qt().addComponentBeforeRouteHook({lifecycle:e,hook:t,depth:n-1});return c.onUnmounted(o),o}}function Yt(e){return t=>{const n=Qe(),o=Qt().addComponentAfterRouteHook({lifecycle:e,hook:t,depth:n-1});return c.onUnmounted(o),o}}const mr=Kt("onBeforeRouteLeave"),yr=Kt("onBeforeRouteUpdate"),gr=Yt("onAfterRouteLeave"),Rr=Yt("onAfterRouteUpdate");function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(null,arguments)}var $;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})($||($={}));var le=process.env.NODE_ENV!=="production"?function(e){return Object.freeze(e)}:function(e){return e};function oe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}var Ue="beforeunload",wr="hashchange",Xt="popstate";function en(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,o=r.history;function a(){var R=r.location,f=R.pathname,m=R.search,C=R.hash,B=o.state||{};return[B.idx,le({pathname:f,search:m,hash:C,state:B.usr||null,key:B.key||"default"})]}var s=null;function h(){if(s)k.call(s),s=null;else{var R=$.Pop,f=a(),m=f[0],C=f[1];if(k.length)if(m!=null){var B=g-m;B&&(s={action:R,location:C,retry:function(){L(B*-1)}},L(B))}else process.env.NODE_ENV!=="production"&&oe(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else l(R)}}r.addEventListener(Xt,h);var p=$.Pop,i=a(),g=i[0],S=i[1],V=he(),k=he();g==null&&(g=0,o.replaceState(Q({},o.state,{idx:g}),""));function E(R){return typeof R=="string"?R:ae(R)}function y(R,f){return f===void 0&&(f=null),le(Q({pathname:S.pathname,hash:"",search:""},typeof R=="string"?Re(R):R,{state:f,key:Ce()}))}function d(R,f){return[{usr:R.state,key:R.key,idx:f},E(R)]}function w(R,f,m){return!k.length||(k.call({action:R,location:f,retry:m}),!1)}function l(R){p=R;var f=a();g=f[0],S=f[1],V.call({action:p,location:S})}function u(R,f){var m=$.Push,C=y(R,f);function B(){u(R,f)}if(w(m,C,B)){var x=d(C,g+1),O=x[0],H=x[1];try{o.pushState(O,"",H)}catch{r.location.assign(H)}l(m)}}function P(R,f){var m=$.Replace,C=y(R,f);function B(){P(R,f)}if(w(m,C,B)){var x=d(C,g),O=x[0],H=x[1];o.replaceState(O,"",H),l(m)}}function L(R){o.go(R)}var U={get action(){return p},get location(){return S},createHref:E,push:u,replace:P,go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(f){return V.push(f)},block:function(f){var m=k.push(f);return k.length===1&&r.addEventListener(Ue,Le),function(){m(),k.length||r.removeEventListener(Ue,Le)}}};return U}function Er(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,o=r.history;function a(){var f=Re(r.location.hash.substr(1)),m=f.pathname,C=m===void 0?"/":m,B=f.search,x=B===void 0?"":B,O=f.hash,H=O===void 0?"":O,I=o.state||{};return[I.idx,le({pathname:C,search:x,hash:H,state:I.usr||null,key:I.key||"default"})]}var s=null;function h(){if(s)k.call(s),s=null;else{var f=$.Pop,m=a(),C=m[0],B=m[1];if(k.length)if(C!=null){var x=g-C;x&&(s={action:f,location:B,retry:function(){U(x*-1)}},U(x))}else process.env.NODE_ENV!=="production"&&oe(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else u(f)}}r.addEventListener(Xt,h),r.addEventListener(wr,function(){var f=a(),m=f[1];ae(m)!==ae(S)&&h()});var p=$.Pop,i=a(),g=i[0],S=i[1],V=he(),k=he();g==null&&(g=0,o.replaceState(Q({},o.state,{idx:g}),""));function E(){var f=document.querySelector("base"),m="";if(f&&f.getAttribute("href")){var C=r.location.href,B=C.indexOf("#");m=B===-1?C:C.slice(0,B)}return m}function y(f){return E()+"#"+(typeof f=="string"?f:ae(f))}function d(f,m){return m===void 0&&(m=null),le(Q({pathname:S.pathname,hash:"",search:""},typeof f=="string"?Re(f):f,{state:m,key:Ce()}))}function w(f,m){return[{usr:f.state,key:f.key,idx:m},y(f)]}function l(f,m,C){return!k.length||(k.call({action:f,location:m,retry:C}),!1)}function u(f){p=f;var m=a();g=m[0],S=m[1],V.call({action:p,location:S})}function P(f,m){var C=$.Push,B=d(f,m);function x(){P(f,m)}if(process.env.NODE_ENV!=="production"&&oe(B.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.push("+JSON.stringify(f)+")"),l(C,B,x)){var O=w(B,g+1),H=O[0],I=O[1];try{o.pushState(H,"",I)}catch{r.location.assign(I)}u(C)}}function L(f,m){var C=$.Replace,B=d(f,m);function x(){L(f,m)}if(process.env.NODE_ENV!=="production"&&oe(B.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.replace("+JSON.stringify(f)+")"),l(C,B,x)){var O=w(B,g),H=O[0],I=O[1];o.replaceState(H,"",I),u(C)}}function U(f){o.go(f)}var R={get action(){return p},get location(){return S},createHref:y,push:P,replace:L,go:U,back:function(){U(-1)},forward:function(){U(1)},listen:function(m){return V.push(m)},block:function(m){var C=k.push(m);return k.length===1&&r.addEventListener(Ue,Le),function(){C(),k.length||r.removeEventListener(Ue,Le)}}};return R}function tn(e){e===void 0&&(e={});var t=e,n=t.initialEntries,r=n===void 0?["/"]:n,o=t.initialIndex,a=r.map(function(u){var P=le(Q({pathname:"/",search:"",hash:"",state:null,key:Ce()},typeof u=="string"?Re(u):u));return process.env.NODE_ENV!=="production"&&oe(P.pathname.charAt(0)==="/","Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(u)+")"),P}),s=nn(o??a.length-1,0,a.length-1),h=$.Pop,p=a[s],i=he(),g=he();function S(u){return typeof u=="string"?u:ae(u)}function V(u,P){return P===void 0&&(P=null),le(Q({pathname:p.pathname,search:"",hash:""},typeof u=="string"?Re(u):u,{state:P,key:Ce()}))}function k(u,P,L){return!g.length||(g.call({action:u,location:P,retry:L}),!1)}function E(u,P){h=u,p=P,i.call({action:h,location:p})}function y(u,P){var L=$.Push,U=V(u,P);function R(){y(u,P)}process.env.NODE_ENV!=="production"&&oe(p.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.push("+JSON.stringify(u)+")"),k(L,U,R)&&(s+=1,a.splice(s,a.length,U),E(L,U))}function d(u,P){var L=$.Replace,U=V(u,P);function R(){d(u,P)}process.env.NODE_ENV!=="production"&&oe(p.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.replace("+JSON.stringify(u)+")"),k(L,U,R)&&(a[s]=U,E(L,U))}function w(u){var P=nn(s+u,0,a.length-1),L=$.Pop,U=a[P];function R(){w(u)}k(L,U,R)&&(s=P,E(L,U))}var l={get index(){return s},get action(){return h},get location(){return p},createHref:S,push:y,replace:d,go:w,back:function(){w(-1)},forward:function(){w(1)},listen:function(P){return i.push(P)},block:function(P){return g.push(P)}};return l}function nn(e,t,n){return Math.min(Math.max(e,t),n)}function Le(e){e.preventDefault(),e.returnValue=""}function he(){var e=[];return{get length(){return e.length},push:function(n){return e.push(n),function(){e=e.filter(function(r){return r!==n})}},call:function(n){e.forEach(function(r){return r&&r(n)})}}}function Ce(){return Math.random().toString(36).substr(2,8)}function ae(e){var t=e.pathname,n=t===void 0?"/":t,r=e.search,o=r===void 0?"":r,a=e.hash,s=a===void 0?"":a;return o&&o!=="?"&&(n+=o.charAt(0)==="?"?o:"?"+o),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Re(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}const rn=Symbol();function br(e,t){const n=c.reactive({...e}),r=s=>{Object.assign(n,{[rn]:!1,...s})},o=n,a=tr(o,t);return{currentRoute:o,routerRoute:a,updateRoute:r}}function _(e){return!e.startsWith("http")?Sr(e):Pr(e)}function Pr(e){const{protocol:t,host:n,pathname:r,search:o,searchParams:a,hash:s}=new URL(e,e);return{protocol:t,host:n,pathname:r,search:o,searchParams:a,hash:s}}function Sr(e){const{pathname:t,search:n,searchParams:r,hash:o}=new URL(e,"https://localhost");return{pathname:t,search:n,searchParams:r,hash:o}}function vr(e){return t=>{const{host:n}=_(t);return!(n===void 0||n===e)}}function Ar({mode:e,listener:t}){const n=kr(e),r=(p,i)=>{if(i!=null&&i.replace){n.replace(p,i.state);return}n.push(p,i==null?void 0:i.state)},o=()=>{const p=ae(n.location);n.replace(p)};let a;return{...n,update:r,refresh:o,startListening:()=>{a==null||a(),a=n.listen(t)},stopListening:()=>{a==null||a()}}}function kr(e="auto"){switch(e){case"auto":return Ie()?en():tn();case"browser":return en();case"memory":return tn();case"hash":return Er();default:const t=e;throw new Error(`Switch is not exhaustive for mode: ${t}`)}}function Ur(e){return c.defineComponent(()=>()=>c.h("h1",e),{name:e,props:[]})}function Lr(e){const t=a=>c.markRaw(e[a]??Ur(a)),n=a=>{const s=c.markRaw(t(a)),h={id:Fe(),component:s,meta:{},state:{}};return{id:h.id,matched:h,matches:[h],name:a,query:De(""),params:{},state:{},href:"/",hash:"",[rn]:!0}},r=a=>{if(!a){o.value=null;return}const s=t(a);o.value={type:a,component:s}},o=c.ref(null);return{setRejection:r,rejection:o,getRejectionRoute:n}}class Cr extends Error{constructor(){super("initialUrl must be set if window.location is unavailable")}}function Br(e){if(e)return e;if(Ie())return window.location.toString();throw new Cr}function on(e){return!!e&&typeof e=="object"}const Be=!0;function Vr(e,t,n){if(on(e)&&t in e){const r=e[t];return typeof r=="string"?X(r,n,Be):r}return X(void 0,n,Be)}function an(e,t){const n={};for(const[r,o]of Object.entries(e)){const a=Vr(t,r,o);n[r]=a}return n}function Nr(e,t,n){if(on(e)&&t in e){const r=e[t];return ee(r,n,Be)}return ee(void 0,n,Be)}const sn=(e,t)=>{const n={};for(const[r,o]of Object.entries(e)){const a=Nr(t,r,o);n[r]=a}return n};function xr(){const e=c.reactive(new Map),t=Ie()?s():null,n=h=>{e.set(h,!1),t==null||t.observe(h)},r=h=>{e.delete(h),t==null||t.unobserve(h)},o=()=>{t==null||t.disconnect()},a=h=>e.get(h)??!1;function s(){return new IntersectionObserver(h=>{h.forEach(p=>{e.set(p.target,p.isIntersecting)})})}return{observe:n,unobserve:r,disconnect:o,isElementVisible:a}}class jr extends Error{constructor(t){super(`Route not found: "${t}"`)}}function cn(e,t,n){const r=xn(t.value,n),o=Rt(r),[a]=Et(e,new RegExp(o,"g"));return a}function un(e,t,n,r){const o=He(t,n),a=ee(r,t.params[n],o);return e.replace(wt(n),a)}function fn({protocol:e,host:t,pathname:n,search:r,searchParams:o,hash:a}){const s=new URL("https://localhost");e&&(s.protocol=e),t&&(s.host=t),n&&(s.pathname=n),o?s.search=new URLSearchParams(o).toString():r&&(s.search=r),a&&(s.hash=a);const h=s.toString().replace(/^https:\/\/localhost\/*/,"/");return Ve(h)}function Zr(e,t={}){const{params:n={},query:r}=t,o=$r(e.query,n),a=Ge(o,r),s=ln(e.path,n),h=e.hash.value?ln(e.hash,n):t.hash,p=Or(e.host,n),{protocol:i,host:g}=_(p);return fn({protocol:i,host:g,pathname:s,searchParams:a,hash:h})}function Or(e,t){const n=e.value&&!e.value.startsWith("http")?`https://${e.value}`:e.value;return Object.keys(e.params).reduce((r,o)=>un(r,e,o,t[o]),n)}function ln(e,t){return Object.keys(e.params).reduce((n,r)=>un(n,e,r,t[r]),e.value)}function $r(e,t){const n=new URLSearchParams(e.value);if(!e.value)return n;for(const[r,o]of Array.from(n.entries())){const a=qe(o);if(!a)continue;const h=_e(o),p=ee(t[a],e.params[a],h),i=t[a]===void 0&&p==="";h&&i?n.delete(r,o):n.set(r,p)}return n}const Hr=(e,t)=>{try{Ye(e,t)}catch{return!1}return!0},Ye=(e,t)=>{const{protocol:n,host:r,pathname:o,search:a,hash:s}=_(t);return{...Xe(e.host,`${n}//${r}`),...Xe(e.path,o),..._r(e.query,a),...Xe(e.hash,s)}};function Xe(e,t){const n={},r=decodeURIComponent(t);for(const[o,a]of Object.entries(e.params)){const s=cn(r,e,o),h=He(e,o),p=X(s,a,h);n[o]=p}return n}function _r(e,t){const n={},r=new URLSearchParams(e.value),o=new URLSearchParams(t);for(const[a,s]of Array.from(r.entries())){const h=qe(s);if(!h)continue;const i=_e(s),g=o.get(a)??void 0,S=X(g,e.params[h],i);n[h]=S}return n}function qr(e,t={},n={}){const r=Zr(e,{params:t,query:n.query,hash:n.hash}),{search:o,hash:a}=_(r);return{id:e.id,matched:e.matched,matches:e.matches,name:e.name,query:De(o),params:Ye(e,r),state:an(e.state,n.state),hash:a,href:r}}const Ir=e=>"name"in e.matched&&!!e.matched.name,Dr=(e,t)=>{const{pathname:n}=_(t);return Vn(e).test(n)},Tr=(e,t)=>{const{search:n}=_(t);return Nn(e).every(o=>o.test(n))},et=(e,t)=>{const{hash:n}=_(t),{value:r}=e.hash;return F(r)?`#${r.replace(/^#*/,"")}`.toLowerCase()===n.toLowerCase():!0};function Fr(e){const{searchParams:t,pathname:n}=_(e),r=-1,o=1;return(a,s)=>{const h=dn(a,t),p=hn(a,n),i=dn(s,t),g=hn(s,n);return a.depth>s.depth?r:a.depth<s.depth?o:h+p>i+g?r:h+p<i+g?o:et(a,e)?r:et(s,e)?o:0}}function hn(e,t){const n=Object.keys(e.path.params).filter(o=>He(e.path,o)).map(o=>o),r=n.filter(o=>cn(t,e.path,o)===void 0);return n.length-r.length}function dn(e,t){const n=new URLSearchParams(t),r=new URLSearchParams(e.query.value),o=Array.from(r.keys()),a=o.filter(s=>!n.has(s));return o.length-a.length}const Mr=[Ir,Dr,Tr,et,Hr];function Jr(e,t){const n=Fr(t);return e.filter(r=>Mr.every(o=>o(r,t))).sort(n)}function Wr(e,t,n){const r=Jr(e,t);if(!r.length)return;const[o]=r,{searchParams:a,hash:s}=_(t);return{id:o.id,matched:o.matched,matches:o.matches,name:o.name,query:De(a),params:Ye(o,t),state:an(o.state,n),hash:s,href:Ve(t)}}function pn(e,t){const n=typeof e=="string"?_(e):e,r=typeof t=="string"?_(t):t,o=n.searchParams??new URLSearchParams(n.search),a=r.searchParams??new URLSearchParams(r.search);return fn({protocol:F(r.protocol)?r.protocol:n.protocol,host:F(r.host)?r.host:n.host,pathname:F(r.pathname)?r.pathname:n.pathname,searchParams:Ge(a,o),hash:F(r.hash)?r.hash:n.hash})}function Gr(e,t){return F(t)?e.map(n=>{const r=`${t}${n.path.value}`;return{...n,path:M(r,n.path.params)}}):e}class zr extends Error{constructor(t){super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`)}}function Qr(e){const t=e.map(({name:n})=>n);for(const n of t)if(it(t,n)>1)throw new zr(n)}function Kr(e,t=[],n){const r=[...e,...t.map(o=>o.routes)].flat();return Qr(r),Gr(r,n)}function Yr(e={},t=[]){const n=new re;return de("onBeforeRouteEnter",e,t).forEach(r=>n.onBeforeRouteEnter.add(r)),de("onBeforeRouteUpdate",e,t).forEach(r=>n.onBeforeRouteUpdate.add(r)),de("onBeforeRouteLeave",e,t).forEach(r=>n.onBeforeRouteLeave.add(r)),de("onAfterRouteEnter",e,t).forEach(r=>n.onAfterRouteEnter.add(r)),de("onAfterRouteUpdate",e,t).forEach(r=>n.onAfterRouteUpdate.add(r)),de("onAfterRouteLeave",e,t).forEach(r=>n.onAfterRouteLeave.add(r)),n}function de(e,t,n){return[t[e],...n.map(o=>o[e])].flat().filter(o=>o!==void 0)}function Xr(e,t,n=[]){const r=Kr(e,n,t==null?void 0:t.base),o=pr();o.addGlobalRouteHooks(Yr(t,n));const a=Te(),s=zn(),h=cr(),p=xr(),i=Ar({mode:t==null?void 0:t.historyMode,listener:({location:v})=>{const N=ae(v);S(N,{state:v.state,replace:!0})}});function g(v,N={}){return Wr(r,v,N.state)}async function S(v,N={}){const z=a();if(i.stopListening(),C(v)){i.update(v,N);return}const D=g(v,N)??l("NotFound"),q=yn(z),K=await o.runBeforeRouteHooks({to:D,from:q});switch(K.status){case"ABORT":return;case"PUSH":i.update(v,N),await k(...K.to);return;case"REJECT":i.update(v,N),d(K.type);break;case"SUCCESS":i.update(v,N),d(null);break;default:throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(K)}`)}const tt=z;s.setProps(D).then(T=>{if(tt===z)switch(T.status){case"SUCCESS":break;case"PUSH":k(...T.to);break;case"REJECT":d(T.type);break;default:const nt=T;throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(nt)}`)}}),U(D);const J=await o.runAfterRouteHooks({to:D,from:q});switch(J.status){case"PUSH":await k(...J.to);break;case"REJECT":d(J.type);break;case"SUCCESS":break;default:const T=J;throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(T)}`)}i.startListening()}const V=(v,N={},z={})=>{const D=r.find(q=>q.name===v);if(!D)throw new jr(String(v));return qr(D,N,z)},k=(v,N,z)=>{if(Z(v)){const J={...N},T=pn(v,{searchParams:J.query,hash:J.hash});return S(T,J)}if(typeof v=="string"){const{replace:J,...T}={...z},nt={...N},rt=V(v,nt,T),fo=sn({...rt.matched.state},{...rt.state,...T.state});return S(rt.href,{replace:J,state:fo})}const{replace:D,...q}={...N},K=sn({...v.matched.state},{...v.state,...q.state}),tt=pn(v.href,{searchParams:q.query,hash:q.hash});return S(tt,{replace:D,state:K})},E=(v,N,z)=>{if(Z(v)){const q={...N,replace:!0};return k(v,q)}if(typeof v=="string"){const q={...z,replace:!0},K={...N};return k(v,K,q)}const D={...N,replace:!0};return k(v,D)},y=v=>{d(v)},{setRejection:d,rejection:w,getRejectionRoute:l}=Lr({...n.reduce((v,N)=>({...v,...N.rejections}),{}),...t==null?void 0:t.rejections}),u=l("NotFound"),{currentRoute:P,routerRoute:L,updateRoute:U}=br(u,k),R=Br(t==null?void 0:t.initialUrl),f=i.location.state,{host:m}=_(R),C=vr(m);let B=!1;const{promise:x,resolve:O}=Promise.withResolvers();async function H(){if(B)return x;Sn(r)&&await vn(),B=!0,await S(R,{replace:!0,state:f}),i.startListening(),O()}function I(){i.stopListening()}function yn(v){return Fn(v)?null:{...P}}function uo(v){o.setVueApp(v),s.setVueApp(v),v.component("RouterView",Ke),v.component("RouterLink",Tt),v.provide(Ft,w),v.provide(zt,o),v.provide(Ot,s),v.provide(Jt,h),v.provide(_t,p),v.provide(ct,gn),H()}const gn={route:L,resolve:V,find:g,push:k,replace:E,reject:y,refresh:i.refresh,forward:i.forward,back:i.back,go:i.go,install:uo,isExternal:C,onBeforeRouteEnter:o.onBeforeRouteEnter,onBeforeRouteUpdate:o.onBeforeRouteUpdate,onBeforeRouteLeave:o.onBeforeRouteLeave,onAfterRouteEnter:o.onAfterRouteEnter,onAfterRouteUpdate:o.onAfterRouteUpdate,onAfterRouteLeave:o.onAfterRouteLeave,prefetch:t==null?void 0:t.prefetch,start:H,stop:I};return gn}function eo(e){return{routes:e.routes??[],rejections:e.rejections??{},...e}}function mn(e){return{get:(t,{invalid:n})=>{for(const r of e){const o=Ln(t,r);if(o!==void 0)return o}throw n(`Value ${t} does not satisfy any of the possible values`)},set:(t,{invalid:n})=>{for(const r of e){const o=Cn(t,r);if(o!==void 0)return o}throw n(`Value ${t} does not satisfy any of the possible values`)}}}const to={separator:","};function no(e,t={}){const{separator:n}={...to,...t},r=mn(e);return{get:(o,a)=>o.split(n).map(s=>r.get(s,a)),set:(o,a)=>{if(!Array.isArray(o))throw a.invalid("Expected an array");return o.map(s=>r.set(s,a)).join(n)}}}const ro={separator:","};function oo(e,t={}){const{separator:n}={...ro,...t};return{get:r=>{const o=r.split(n);return e.map((a,s)=>X(o.at(s),a))},set:(r,{invalid:o})=>{if(!Array.isArray(r))throw o("Expected a tuple");if(r.length!==e.length)throw o(`Expected tuple with ${e.length} values but received ${r.length} values`);return e.map((a,s)=>ee(r.at(s),a)).join(n)}}}const ao=M,so=M,co=M;function io(e){const t=Fe(),n=Lt(e.name),r=te(e.path),o=te(e.query),a=te(e.hash),s=e.meta??{},h=te(e.host),p=c.markRaw({id:t,meta:{},state:{},...e}),i={id:t,matched:p,matches:[p],name:n,host:h,path:r,query:o,hash:a,meta:s,depth:1,state:{}},g=Pt(e)?Ut(e.parent,i):i;return ce(g.path.params,g.query.params,g.host.params,g.hash.params),g}A.DuplicateParamsError=ot,A.MetaPropertyConflict=at,A.RouterLink=Tt,A.RouterNotInstalledError=Y,A.RouterView=Ke,A.UseRouteInvalidError=st,A.arrayOf=no,A.asUrl=Ve,A.createExternalRoute=io,A.createParam=ft,A.createRoute=ne,A.createRouter=Xr,A.createRouterPlugin=eo,A.host=so,A.isRoute=We,A.isUrl=Z,A.onAfterRouteLeave=gr,A.onAfterRouteUpdate=Rr,A.onBeforeRouteLeave=mr,A.onBeforeRouteUpdate=yr,A.path=ao,A.query=co,A.tupleOf=oo,A.unionOf=mn,A.useLink=Dt,A.useRoute=ze,A.useRouter=we,A.withDefault=bn,A.withParams=M,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
4
+ `)}return u}function C(m,d,w){return[m,d,w.id,JSON.stringify(w.params)].join("-")}function k(m){return xe(m)?[{id:m.id,name:"default",props:m.props}]:Oe(m)?Object.entries(m.props).map(([d,w])=>({id:m.id,name:d,props:w})):[]}function E(m){for(const d of r.keys())m.includes(d)||r.delete(d)}return{getPrefetchProps:s,setPrefetchProps:p,getProps:c,setProps:h,setVueApp:t}}function Fe(){const t=i.inject(Te);if(!t)throw new X;return t}const an=i.defineAsyncComponent(()=>new Promise(t=>{t({default:{template:"foo"}})}));function Me(t){return t.name===an.name&&"__asyncLoader"in t}const We=Symbol("visibilityObserver");function sn(t){const e=i.inject(We);if(!e)throw new X;return i.watch(t,(n,o)=>{n&&e.observe(n),o&&e.unobserve(o)},{immediate:!0}),i.onUnmounted(()=>{t.value&&e.unobserve(t.value)}),{isElementVisible:i.computed(()=>t.value?e.isElementVisible(t.value):!1)}}function Ge(t,e,r){i.watch(t,(n,o)=>{n&&n.addEventListener(e,r),o&&o.removeEventListener(e,r)},{immediate:!0}),i.onUnmounted(()=>{t.value&&t.value.removeEventListener(e,r)})}function cn(t){const e=new Map,r=i.ref(),{getPrefetchProps:n,setPrefetchProps:o}=Fe(),{isElementVisible:a}=sn(r),s=()=>{const c=Array.from(e.values()).reduce((g,P)=>(Object.assign(g,P),g),{});o(c)};i.watch(()=>i.toValue(t),({route:c,...g})=>{e.clear(),c&&h("eager",c,g)},{immediate:!0}),i.watch(a,c=>{const{route:g,...P}=i.toValue(t);!g||!c||h("lazy",g,P)},{immediate:!0}),Ge(r,"focusin",p),Ge(r,"mouseover",p);function p(){const{route:c,...g}=i.toValue(t);c&&h("intent",c,g)}function h(c,g,P){un(c,g,P),e.has(c)||e.set(c,n(c,g,P))}return{element:r,commit:s}}function un(t,e,r){e.matches.forEach(n=>{_e({...r,routePrefetch:n.prefetch},"components")===t&&(Ce(n)&&Me(n.component)&&n.component.__asyncLoader(),je(n)&&Object.values(n.components).forEach(a=>{Me(a)&&a.__asyncLoader()}))})}const ze=Symbol("isRouterRouteSymbol");function fn(t){return typeof t=="object"&&t!==null&&ze in t}function ln(t,e){function r(d,w,l){if(typeof d=="object"){const S={...t.params,...d};return e(t.name,S,w)}const u={...t.params,[d]:w};return e(t.name,u,l)}const n=(...d)=>{const w=new URLSearchParams(t.query);w.set(...d),r({},{query:w})},o=(...d)=>{const w=new URLSearchParams(t.query);w.append(...d),r({},{query:w})},a=(...d)=>{const w=new URLSearchParams(t.query);w.delete(...d),r({},{query:w})},{id:s,matched:p,matches:h,name:c,hash:g,href:P}=i.toRefs(t),C=i.computed({get(){return new Proxy(t.params,{set(d,w,l){return r(w,l),!0}})},set(d){r(d)}}),k=i.computed({get(){return new Proxy(t.query,{get(d,w,l){switch(w){case"append":return o;case"set":return n;case"delete":return a;default:return Reflect.get(d,w,l)}}})},set(d){r({},{query:d})}}),E=i.computed({get(){return new Proxy(t.state,{set(d,w,l){return r({},{state:{...t.state,[w]:l}}),!0}})},set(d){r({},{state:d})}});return i.reactive({id:s,matched:p,matches:h,state:E,query:k,hash:g,params:C,name:c,href:P,update:r,[ze]:!0})}function ee(t,e,{exact:r}={}){return fn(t)?e===void 0?!0:r?t.matched.name===e:t.matches.map(n=>n.name).includes(e):!1}function re(...t){const e=new URLSearchParams;for(const r of t){const n=new URLSearchParams(r);for(const[o,a]of n.entries())e.append(o,a)}return e}function Qe(t,e={},r={}){const n=Pt(),o=i.computed(()=>{const E=i.toValue(t);return typeof E!="string"?E:Z(E)?n.find(E,i.toValue(r)):n.resolve(E,i.toValue(e),i.toValue(r))}),a=i.computed(()=>{if(o.value)return o.value.href;const E=i.toValue(t);if(Z(E))return E;console.error(new Error("Failed to resolve route in RouterLink."))}),s=i.computed(()=>ee(n.route)&&n.route.matches.some(E=>{var m;return E.id===((m=o.value)==null?void 0:m.id)})),p=i.computed(()=>{var E;return n.route.id===((E=o.value)==null?void 0:E.id)}),h=i.computed(()=>!!a.value&&n.isExternal(a.value)),c=i.computed(()=>{const E=i.toValue(t);return typeof E!="string"||Z(E)?i.toValue(e):i.toValue(r)}),{element:g,commit:P}=cn(()=>({route:o.value,routerPrefetch:n.prefetch,linkPrefetch:c.value.prefetch})),C=E=>{P();const m={replace:(E==null?void 0:E.replace)??c.value.replace,query:re(c.value.query,E==null?void 0:E.query),hash:(E==null?void 0:E.hash)??c.value.hash,state:{...c.value.state,...E==null?void 0:E.state}},d=i.toValue(t);return Z(d)||typeof d=="object"?n.push(d,m):n.push(d,i.toValue(e),m)};return{element:g,route:o,href:a,isMatch:s,isExactMatch:p,isExternal:h,push:C,replace:E=>C({...E,replace:!0})}}const pn=["href"],Ke=i.defineComponent({__name:"routerLink",props:{to:{},prefetch:{type:[Boolean,String,Object],default:void 0},query:{},hash:{},replace:{type:Boolean},state:{}},setup(t){const e=t,r=Pt(),n=i.computed(()=>C(e.to)),o=i.computed(()=>k(e.to)),a=i.computed(()=>{const{to:m,...d}=e;return d}),{element:s,isMatch:p,isExactMatch:h,isExternal:c,push:g}=Qe(()=>typeof e.to=="function"?e.to(r.resolve):e.to,a),P=i.computed(()=>({"router-link--match":p.value,"router-link--exact-match":h.value}));function C(m){if(typeof m=="function"){const d=m(r.resolve);return C(d)}return Z(m)?r.find(m):m}function k(m){if(typeof m=="function"){const d=m(r.resolve);return k(d)}return Z(m)?m:m==null?void 0:m.href}function E(m){m.preventDefault(),g()}return(m,d)=>(i.openBlock(),i.createElementBlock("a",{ref_key:"element",ref:s,href:o.value,class:i.normalizeClass(["router-link",P.value]),onClick:E},[i.renderSlot(m.$slots,"default",i.normalizeProps(i.guardReactiveProps({route:n.value,isMatch:i.unref(p),isExactMatch:i.unref(h),isExternal:i.unref(c)})))],10,pn))}}),Ye=Symbol();function dn(){const t=i.inject(Ye);if(!t)throw new X;return t}function ne(t,e){const r=Pt();function n(){if(!t)return;if(!ee(r.route,t,e))throw new he(t,r.route.name)}return i.watch(r.route,n,{immediate:!0,deep:!0}),r.route}const Xe=Symbol();function oe(){return i.inject(Xe,0)}function hn(t,e,r){return i.defineComponent({name:"PropsWrapper",expose:[],setup(){const n=i.getCurrentInstance(),o=Fe(),a=ne();return()=>{const s=o.getProps(t.id,e,a);return s instanceof Error?"":qt(s)?n!=null&&n.suspense?i.h(mn,{component:r,props:s}):i.h(yn,{component:r,props:s}):i.h(r,s)}}})}const yn=i.defineComponent(t=>{const e=i.ref();return i.watch(()=>t.props,async r=>{e.value=await r},{immediate:!0,deep:!0}),()=>e.value instanceof Error?"":e.value?i.h(t.component,e.value):""},{props:["component","props"]}),mn=i.defineComponent(async t=>{const e=i.ref();return e.value=await t.props,i.watch(()=>e.value,async r=>{e.value=await r},{deep:!0}),()=>e.value instanceof Error?"":e.value?i.h(t.component,e.value):""},{props:["component","props"]}),tr=Symbol();function gn(){const t=new Map;return{getRouteComponents:r=>{const n=t.get(r.id);if(n)return n;const o=Rn(r);return t.set(r.id,o),o}}}function Rn(t){return je(t)?er(t,t.components):Ce(t)?er(t,{default:t.component}):{default:ae}}function er(t,e){return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,hn(t,r,n)]))}function wn(){const t=i.inject(tr);if(!t)throw new X;return t}const ae=i.defineComponent({__name:"routerView",props:{name:{default:"default"}},setup(t){const e=ne(),r=dn(),n=oe(),{getRouteComponents:o}=wn();i.provide(Xe,n+1);const a=i.computed(()=>{if(r.value)return r.value.component;const s=e.matches.at(n);return s?o(s)[t.name]:null});return(s,p)=>a.value?i.renderSlot(s.$slots,"default",i.normalizeProps(i.mergeProps({key:0},{route:i.unref(e),component:a.value,rejection:i.unref(r)})),()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.value)))]):i.createCommentVNode("",!0)}});class ot{constructor(){G(this,"onBeforeRouteEnter",new Set);G(this,"onBeforeRouteUpdate",new Set);G(this,"onBeforeRouteLeave",new Set);G(this,"onAfterRouteEnter",new Set);G(this,"onAfterRouteUpdate",new Set);G(this,"onAfterRouteLeave",new Set)}}const wt=(t,e,r)=>{var a,s;const n=t.matches,o=(e==null?void 0:e.matches)??[];return((a=n.at(r))==null?void 0:a.id)!==((s=o.at(r))==null?void 0:s.id)},Et=(t,e,r)=>{var a,s;const n=t.matches,o=(e==null?void 0:e.matches)??[];return((a=n.at(r))==null?void 0:a.id)!==((s=o.at(r))==null?void 0:s.id)},bt=(t,e,r)=>{var n,o;return((n=t.matches.at(r))==null?void 0:n.id)===((o=e==null?void 0:e.matches.at(r))==null?void 0:o.id)};function rr(t){switch(t){case"onBeforeRouteEnter":case"onAfterRouteEnter":return wt;case"onBeforeRouteUpdate":case"onAfterRouteUpdate":return bt;case"onBeforeRouteLeave":case"onAfterRouteLeave":return Et;default:throw new Error(`Switch is not exhaustive for lifecycle: ${t}`)}}function En(t,e){const r=new ot;return t.matches.forEach((n,o)=>{n.onBeforeRouteEnter&&wt(t,e,o)&&it(n.onBeforeRouteEnter).forEach(a=>r.onBeforeRouteEnter.add(a)),n.onBeforeRouteUpdate&&bt(t,e,o)&&it(n.onBeforeRouteUpdate).forEach(a=>r.onBeforeRouteUpdate.add(a))}),e==null||e.matches.forEach((n,o)=>{n.onBeforeRouteLeave&&Et(t,e,o)&&it(n.onBeforeRouteLeave).forEach(a=>r.onBeforeRouteLeave.add(a))}),r}function bn(t,e){const r=new ot;return t.matches.forEach((n,o)=>{n.onAfterRouteEnter&&wt(t,e,o)&&it(n.onAfterRouteEnter).forEach(a=>r.onAfterRouteEnter.add(a)),n.onAfterRouteUpdate&&bt(t,e,o)&&it(n.onAfterRouteUpdate).forEach(a=>r.onAfterRouteUpdate.add(a))}),e==null||e.matches.forEach((n,o)=>{n.onAfterRouteLeave&&Et(t,e,o)&&it(n.onAfterRouteLeave).forEach(a=>r.onAfterRouteLeave.add(a))}),r}function Sn(t,e,r){const n=new ot;return t.matches.forEach((o,a)=>{wt(t,e,a)&&r.onBeforeRouteEnter.forEach(s=>n.onBeforeRouteEnter.add(s)),bt(t,e,a)&&r.onBeforeRouteUpdate.forEach(s=>n.onBeforeRouteUpdate.add(s))}),e==null||e.matches.forEach((o,a)=>{Et(t,e,a)&&r.onBeforeRouteLeave.forEach(s=>n.onBeforeRouteLeave.add(s))}),n}function Pn(t,e,r){const n=new ot;return t.matches.forEach((o,a)=>{wt(t,e,a)&&r.onAfterRouteEnter.forEach(s=>n.onAfterRouteEnter.add(s)),bt(t,e,a)&&r.onAfterRouteUpdate.forEach(s=>n.onAfterRouteUpdate.add(s))}),e==null||e.matches.forEach((o,a)=>{Et(t,e,a)&&r.onAfterRouteLeave.forEach(s=>n.onAfterRouteLeave.add(s))}),n}const nr=Symbol();function An(){const{setVueApp:t,runWithContext:e}=Je(),r={global:new ot,component:new ot},{reject:n,push:o,replace:a,abort:s}=Ie(),p=l=>(r.global.onBeforeRouteEnter.add(l),()=>r.global.onBeforeRouteEnter.delete(l)),h=l=>(r.global.onBeforeRouteUpdate.add(l),()=>r.global.onBeforeRouteUpdate.delete(l)),c=l=>(r.global.onBeforeRouteLeave.add(l),()=>r.global.onBeforeRouteLeave.delete(l)),g=l=>(r.global.onAfterRouteEnter.add(l),()=>r.global.onAfterRouteEnter.delete(l)),P=l=>(r.global.onAfterRouteUpdate.add(l),()=>r.global.onAfterRouteUpdate.delete(l)),C=l=>(r.global.onAfterRouteLeave.add(l),()=>r.global.onAfterRouteLeave.delete(l));async function k({to:l,from:u}){const{global:S,component:L}=r,U=En(l,u),R=Sn(l,u,S),f=[...R.onBeforeRouteEnter,...U.onBeforeRouteEnter,...R.onBeforeRouteUpdate,...U.onBeforeRouteUpdate,...L.onBeforeRouteUpdate,...R.onBeforeRouteLeave,...U.onBeforeRouteLeave,...L.onBeforeRouteLeave];try{const y=f.map(N=>e(()=>N(l,{from:u,reject:n,push:o,replace:a,abort:s})));await Promise.all(y)}catch(y){if(y instanceof ht||y instanceof Bt||y instanceof qe)return y.response;throw y}return{status:"SUCCESS"}}async function E({to:l,from:u}){const{global:S,component:L}=r,U=bn(l,u),R=Pn(l,u,S),f=[...L.onAfterRouteLeave,...U.onAfterRouteLeave,...R.onAfterRouteLeave,...L.onAfterRouteUpdate,...U.onAfterRouteUpdate,...R.onAfterRouteUpdate,...L.onAfterRouteEnter,...U.onAfterRouteEnter,...R.onAfterRouteEnter];try{const y=f.map(N=>e(()=>N(l,{from:u,reject:n,push:o,replace:a})));await Promise.all(y)}catch(y){if(y instanceof ht||y instanceof Bt)return y.response;throw y}return{status:"SUCCESS"}}return{runBeforeRouteHooks:k,runAfterRouteHooks:E,addComponentBeforeRouteHook:({lifecycle:l,depth:u,hook:S})=>{const L=rr(l),U=r.component[l],R=(f,y)=>{if(L(f,y.from,u))return S(f,y)};return U.add(R),()=>U.delete(R)},addComponentAfterRouteHook:({lifecycle:l,depth:u,hook:S})=>{const L=rr(l),U=r.component[l],R=(f,y)=>{if(L(f,y.from,u))return S(f,y)};return U.add(R),()=>U.delete(R)},addGlobalRouteHooks:l=>{l.onBeforeRouteEnter.forEach(u=>p(u)),l.onBeforeRouteUpdate.forEach(u=>h(u)),l.onBeforeRouteLeave.forEach(u=>c(u)),l.onAfterRouteEnter.forEach(u=>g(u)),l.onAfterRouteUpdate.forEach(u=>P(u)),l.onAfterRouteLeave.forEach(u=>C(u))},onBeforeRouteEnter:p,onBeforeRouteUpdate:h,onBeforeRouteLeave:c,onAfterRouteEnter:g,onAfterRouteUpdate:P,onAfterRouteLeave:C,setVueApp:t}}function or(){const t=i.inject(nr);if(!t)throw new X;return t}function ar(t){return e=>{const r=oe(),o=or().addComponentBeforeRouteHook({lifecycle:t,hook:e,depth:r-1});return i.onUnmounted(o),o}}function sr(t){return e=>{const r=oe(),o=or().addComponentAfterRouteHook({lifecycle:t,hook:e,depth:r-1});return i.onUnmounted(o),o}}const vn=ar("onBeforeRouteLeave"),kn=ar("onBeforeRouteUpdate"),Un=sr("onAfterRouteLeave"),Ln=sr("onAfterRouteUpdate");function K(){return K=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},K.apply(null,arguments)}var H;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(H||(H={}));var yt=process.env.NODE_ENV!=="production"?function(t){return Object.freeze(t)}:function(t){return t};function at(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}var Ct="beforeunload",Nn="hashchange",ir="popstate";function cr(t){t===void 0&&(t={});var e=t,r=e.window,n=r===void 0?document.defaultView:r,o=n.history;function a(){var R=n.location,f=R.pathname,y=R.search,N=R.hash,B=o.state||{};return[B.idx,yt({pathname:f,search:y,hash:N,state:B.usr||null,key:B.key||"default"})]}var s=null;function p(){if(s)k.call(s),s=null;else{var R=H.Pop,f=a(),y=f[0],N=f[1];if(k.length)if(y!=null){var B=g-y;B&&(s={action:R,location:N,retry:function(){L(B*-1)}},L(B))}else process.env.NODE_ENV!=="production"&&at(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else l(R)}}n.addEventListener(ir,p);var h=H.Pop,c=a(),g=c[0],P=c[1],C=mt(),k=mt();g==null&&(g=0,o.replaceState(K({},o.state,{idx:g}),""));function E(R){return typeof R=="string"?R:st(R)}function m(R,f){return f===void 0&&(f=null),yt(K({pathname:P.pathname,hash:"",search:""},typeof R=="string"?St(R):R,{state:f,key:jt()}))}function d(R,f){return[{usr:R.state,key:R.key,idx:f},E(R)]}function w(R,f,y){return!k.length||(k.call({action:R,location:f,retry:y}),!1)}function l(R){h=R;var f=a();g=f[0],P=f[1],C.call({action:h,location:P})}function u(R,f){var y=H.Push,N=m(R,f);function B(){u(R,f)}if(w(y,N,B)){var O=d(N,g+1),$=O[0],_=O[1];try{o.pushState($,"",_)}catch{n.location.assign(_)}l(y)}}function S(R,f){var y=H.Replace,N=m(R,f);function B(){S(R,f)}if(w(y,N,B)){var O=d(N,g),$=O[0],_=O[1];o.replaceState($,"",_),l(y)}}function L(R){o.go(R)}var U={get action(){return h},get location(){return P},createHref:E,push:u,replace:S,go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(f){return C.push(f)},block:function(f){var y=k.push(f);return k.length===1&&n.addEventListener(Ct,xt),function(){y(),k.length||n.removeEventListener(Ct,xt)}}};return U}function Vn(t){t===void 0&&(t={});var e=t,r=e.window,n=r===void 0?document.defaultView:r,o=n.history;function a(){var f=St(n.location.hash.substr(1)),y=f.pathname,N=y===void 0?"/":y,B=f.search,O=B===void 0?"":B,$=f.hash,_=$===void 0?"":$,D=o.state||{};return[D.idx,yt({pathname:N,search:O,hash:_,state:D.usr||null,key:D.key||"default"})]}var s=null;function p(){if(s)k.call(s),s=null;else{var f=H.Pop,y=a(),N=y[0],B=y[1];if(k.length)if(N!=null){var O=g-N;O&&(s={action:f,location:B,retry:function(){U(O*-1)}},U(O))}else process.env.NODE_ENV!=="production"&&at(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else u(f)}}n.addEventListener(ir,p),n.addEventListener(Nn,function(){var f=a(),y=f[1];st(y)!==st(P)&&p()});var h=H.Pop,c=a(),g=c[0],P=c[1],C=mt(),k=mt();g==null&&(g=0,o.replaceState(K({},o.state,{idx:g}),""));function E(){var f=document.querySelector("base"),y="";if(f&&f.getAttribute("href")){var N=n.location.href,B=N.indexOf("#");y=B===-1?N:N.slice(0,B)}return y}function m(f){return E()+"#"+(typeof f=="string"?f:st(f))}function d(f,y){return y===void 0&&(y=null),yt(K({pathname:P.pathname,hash:"",search:""},typeof f=="string"?St(f):f,{state:y,key:jt()}))}function w(f,y){return[{usr:f.state,key:f.key,idx:y},m(f)]}function l(f,y,N){return!k.length||(k.call({action:f,location:y,retry:N}),!1)}function u(f){h=f;var y=a();g=y[0],P=y[1],C.call({action:h,location:P})}function S(f,y){var N=H.Push,B=d(f,y);function O(){S(f,y)}if(process.env.NODE_ENV!=="production"&&at(B.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.push("+JSON.stringify(f)+")"),l(N,B,O)){var $=w(B,g+1),_=$[0],D=$[1];try{o.pushState(_,"",D)}catch{n.location.assign(D)}u(N)}}function L(f,y){var N=H.Replace,B=d(f,y);function O(){L(f,y)}if(process.env.NODE_ENV!=="production"&&at(B.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.replace("+JSON.stringify(f)+")"),l(N,B,O)){var $=w(B,g),_=$[0],D=$[1];o.replaceState(_,"",D),u(N)}}function U(f){o.go(f)}var R={get action(){return h},get location(){return P},createHref:m,push:S,replace:L,go:U,back:function(){U(-1)},forward:function(){U(1)},listen:function(y){return C.push(y)},block:function(y){var N=k.push(y);return k.length===1&&n.addEventListener(Ct,xt),function(){N(),k.length||n.removeEventListener(Ct,xt)}}};return R}function ur(t){t===void 0&&(t={});var e=t,r=e.initialEntries,n=r===void 0?["/"]:r,o=e.initialIndex,a=n.map(function(u){var S=yt(K({pathname:"/",search:"",hash:"",state:null,key:jt()},typeof u=="string"?St(u):u));return process.env.NODE_ENV!=="production"&&at(S.pathname.charAt(0)==="/","Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(u)+")"),S}),s=fr(o??a.length-1,0,a.length-1),p=H.Pop,h=a[s],c=mt(),g=mt();function P(u){return typeof u=="string"?u:st(u)}function C(u,S){return S===void 0&&(S=null),yt(K({pathname:h.pathname,search:"",hash:""},typeof u=="string"?St(u):u,{state:S,key:jt()}))}function k(u,S,L){return!g.length||(g.call({action:u,location:S,retry:L}),!1)}function E(u,S){p=u,h=S,c.call({action:p,location:h})}function m(u,S){var L=H.Push,U=C(u,S);function R(){m(u,S)}process.env.NODE_ENV!=="production"&&at(h.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.push("+JSON.stringify(u)+")"),k(L,U,R)&&(s+=1,a.splice(s,a.length,U),E(L,U))}function d(u,S){var L=H.Replace,U=C(u,S);function R(){d(u,S)}process.env.NODE_ENV!=="production"&&at(h.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.replace("+JSON.stringify(u)+")"),k(L,U,R)&&(a[s]=U,E(L,U))}function w(u){var S=fr(s+u,0,a.length-1),L=H.Pop,U=a[S];function R(){w(u)}k(L,U,R)&&(s=S,E(L,U))}var l={get index(){return s},get action(){return p},get location(){return h},createHref:P,push:m,replace:d,go:w,back:function(){w(-1)},forward:function(){w(1)},listen:function(S){return c.push(S)},block:function(S){return g.push(S)}};return l}function fr(t,e,r){return Math.min(Math.max(t,e),r)}function xt(t){t.preventDefault(),t.returnValue=""}function mt(){var t=[];return{get length(){return t.length},push:function(r){return t.push(r),function(){t=t.filter(function(n){return n!==r})}},call:function(r){t.forEach(function(n){return n&&n(r)})}}}function jt(){return Math.random().toString(36).substr(2,8)}function st(t){var e=t.pathname,r=e===void 0?"/":e,n=t.search,o=n===void 0?"":n,a=t.hash,s=a===void 0?"":a;return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),s&&s!=="#"&&(r+=s.charAt(0)==="#"?s:"#"+s),r}function St(t){var e={};if(t){var r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}const lr=Symbol();function Bn(t,e){const r=i.reactive({...t}),n=s=>{Object.assign(r,{[lr]:!1,...s})},o=r,a=ln(o,e);return{currentRoute:o,routerRoute:a,updateRoute:n}}function q(t){return!t.startsWith("http")?xn(t):Cn(t)}function Cn(t){const{protocol:e,host:r,pathname:n,search:o,searchParams:a,hash:s}=new URL(t,t);return{protocol:e,host:r,pathname:n,search:o,searchParams:a,hash:s}}function xn(t){const{pathname:e,search:r,searchParams:n,hash:o}=new URL(t,"https://localhost");return{pathname:e,search:r,searchParams:n,hash:o}}function jn(t){return e=>{const{host:r}=q(e);return!(r===void 0||r===t)}}function On({mode:t,listener:e}){const r=Zn(t),n=(h,c)=>{if(c!=null&&c.replace){r.replace(h,c.state);return}r.push(h,c==null?void 0:c.state)},o=()=>{const h=st(r.location);r.replace(h)};let a;return{...r,update:n,refresh:o,startListening:()=>{a==null||a(),a=r.listen(e)},stopListening:()=>{a==null||a()}}}function Zn(t="auto"){switch(t){case"auto":return zt()?cr():ur();case"browser":return cr();case"memory":return ur();case"hash":return Vn();default:const e=t;throw new Error(`Switch is not exhaustive for mode: ${e}`)}}function $n(t){return i.defineComponent(()=>()=>i.h("h1",t),{name:t,props:[]})}function Hn(t){const e=a=>i.markRaw(t[a]??$n(a)),r=a=>{const s=i.markRaw(e(a)),p={id:Yt(),component:s,meta:{},state:{}};return{id:p.id,matched:p,matches:[p],name:a,query:Qt(""),params:{},state:{},href:"/",hash:"",[lr]:!0}},n=a=>{if(!a){o.value=null;return}const s=e(a);o.value={type:a,component:s}},o=i.ref(null);return{setRejection:n,rejection:o,getRejectionRoute:r}}class _n extends Error{constructor(){super("initialUrl must be set if window.location is unavailable")}}function qn(t){if(t)return t;if(zt())return window.location.toString();throw new _n}function pr(t){return!!t&&typeof t=="object"}const Ot=!0;function In(t,e,r){if(pr(t)&&e in t){const n=t[e];return typeof n=="string"?tt(n,r,Ot):n}return tt(void 0,r,Ot)}function dr(t,e){const r={};for(const[n,o]of Object.entries(t)){const a=In(e,n,o);r[n]=a}return r}function Dn(t,e,r){if(pr(t)&&e in t){const n=t[e];return et(n,r,Ot)}return et(void 0,r,Ot)}const hr=(t,e)=>{const r={};for(const[n,o]of Object.entries(t)){const a=Dn(e,n,o);r[n]=a}return r};function Jn(){const t=i.reactive(new Map),e=zt()?s():null,r=p=>{t.set(p,!1),e==null||e.observe(p)},n=p=>{t.delete(p),e==null||e.unobserve(p)},o=()=>{e==null||e.disconnect()},a=p=>t.get(p)??!1;function s(){return new IntersectionObserver(p=>{p.forEach(h=>{t.set(h.target,h.isIntersecting)})})}return{observe:r,unobserve:n,disconnect:o,isElementVisible:a}}class Tn extends Error{constructor(e){super(`Route not found: "${e}"`)}}function yr(t,e,r){const n=Dr(e.value,r),o=Ue(n),[a]=Ne(t,new RegExp(o,"g"));return a}function mr(t,e,r,n){const o=Mt(e,r),a=et(n,e.params[r],o);return t.replace(Le(r),a)}function gr({protocol:t,host:e,pathname:r,search:n,searchParams:o,hash:a}){const s=new URL("https://localhost");t&&(s.protocol=t),e&&(s.host=e),r&&(s.pathname=r),o?s.search=new URLSearchParams(o).toString():n&&(s.search=n),a&&(s.hash=a);const p=s.toString().replace(/^https:\/\/localhost\/*/,"/");return Zt(p)}function Fn(t,e={}){const{params:r={},query:n}=e,o=Wn(t.query,r),a=re(o,n),s=Rr(t.path,r),p=t.hash.value?Rr(t.hash,r):e.hash,h=Mn(t.host,r),{protocol:c,host:g}=q(h);return gr({protocol:c,host:g,pathname:s,searchParams:a,hash:p})}function Mn(t,e){const r=t.value&&!t.value.startsWith("http")?`https://${t.value}`:t.value;return Object.keys(t.params).reduce((n,o)=>mr(n,t,o,e[o]),r)}function Rr(t,e){return Object.keys(t.params).reduce((r,n)=>mr(r,t,n,e[n]),t.value)}function Wn(t,e){const r=new URLSearchParams(t.value);if(!t.value)return r;for(const[n,o]of Array.from(r.entries())){const a=Gt(o);if(!a)continue;const p=Wt(o),h=et(e[a],t.params[a],p),c=e[a]===void 0&&h==="";p&&c?r.delete(n,o):r.set(n,h)}return r}const Gn=(t,e)=>{try{se(t,e)}catch{return!1}return!0},se=(t,e)=>{const{protocol:r,host:n,pathname:o,search:a,hash:s}=q(e);return{...ie(t.host,`${r}//${n}`),...ie(t.path,o),...zn(t.query,a),...ie(t.hash,s)}};function ie(t,e){const r={},n=decodeURIComponent(e);for(const[o,a]of Object.entries(t.params)){const s=yr(n,t,o),p=Mt(t,o),h=tt(s,a,p);r[o]=h}return r}function zn(t,e){const r={},n=new URLSearchParams(t.value),o=new URLSearchParams(e);for(const[a,s]of Array.from(n.entries())){const p=Gt(s);if(!p)continue;const c=Wt(s),g=o.get(a)??void 0,P=tt(g,t.params[p],c);r[p]=P}return r}function Qn(t,e={},r={}){const n=Fn(t,{params:e,query:r.query,hash:r.hash}),{search:o,hash:a}=q(n);return{id:t.id,matched:t.matched,matches:t.matches,name:t.name,query:Qt(o),params:se(t,n),state:dr(t.state,r.state),hash:a,href:n}}const Kn=t=>"name"in t.matched&&!!t.matched.name,Yn=(t,e)=>{const{pathname:r}=q(e);return qr(t).test(r)},Xn=(t,e)=>{const{search:r}=q(e);return Ir(t).every(o=>o.test(r))},ce=(t,e)=>{const{hash:r}=q(e),{value:n}=t.hash;return F(n)?`#${n.replace(/^#*/,"")}`.toLowerCase()===r.toLowerCase():!0};function to(t){const{searchParams:e,pathname:r}=q(t),n=-1,o=1;return(a,s)=>{const p=Er(a,e),h=wr(a,r),c=Er(s,e),g=wr(s,r);return a.depth>s.depth?n:a.depth<s.depth?o:p+h>c+g?n:p+h<c+g?o:ce(a,t)?n:ce(s,t)?o:0}}function wr(t,e){const r=Object.keys(t.path.params).filter(o=>Mt(t.path,o)).map(o=>o),n=r.filter(o=>yr(e,t.path,o)===void 0);return r.length-n.length}function Er(t,e){const r=new URLSearchParams(e),n=new URLSearchParams(t.query.value),o=Array.from(n.keys()),a=o.filter(s=>!r.has(s));return o.length-a.length}const eo=[Kn,Yn,Xn,ce,Gn];function ro(t,e){const r=to(e);return t.filter(n=>eo.every(o=>o(n,e))).sort(r)}function no(t,e,r){const n=ro(t,e);if(!n.length)return;const[o]=n,{searchParams:a,hash:s}=q(e);return{id:o.id,matched:o.matched,matches:o.matches,name:o.name,query:Qt(a),params:se(o,e),state:dr(o.state,r),hash:s,href:Zt(e)}}function br(t,e){const r=typeof t=="string"?q(t):t,n=typeof e=="string"?q(e):e,o=r.searchParams??new URLSearchParams(r.search),a=n.searchParams??new URLSearchParams(n.search);return gr({protocol:F(n.protocol)?n.protocol:r.protocol,host:F(n.host)?n.host:r.host,pathname:F(n.pathname)?n.pathname:r.pathname,searchParams:re(a,o),hash:F(n.hash)?n.hash:r.hash})}function oo(t,e){return F(e)?t.map(r=>{const n=`${e}${r.path.value}`;return{...r,path:M(n,r.path.params)}}):t}class ao extends Error{constructor(e){super(`Invalid Name "${e}": Router does not support multiple routes with the same name. All name names must be unique.`)}}function so(t){const e=t.map(({name:r})=>r);for(const r of e)if(me(e,r)>1)throw new ao(r)}function io(t,e=[],r){const n=[...t,...e.map(o=>o.routes)].flat();return so(n),oo(n,r)}function co(t={},e=[]){const r=new ot;return gt("onBeforeRouteEnter",t,e).forEach(n=>r.onBeforeRouteEnter.add(n)),gt("onBeforeRouteUpdate",t,e).forEach(n=>r.onBeforeRouteUpdate.add(n)),gt("onBeforeRouteLeave",t,e).forEach(n=>r.onBeforeRouteLeave.add(n)),gt("onAfterRouteEnter",t,e).forEach(n=>r.onAfterRouteEnter.add(n)),gt("onAfterRouteUpdate",t,e).forEach(n=>r.onAfterRouteUpdate.add(n)),gt("onAfterRouteLeave",t,e).forEach(n=>r.onAfterRouteLeave.add(n)),r}function gt(t,e,r){return[e[t],...r.map(o=>o[t])].flat().filter(o=>o!==void 0)}function uo(t,e,r=[]){const n=io(t,r,e==null?void 0:e.base),o=An();o.addGlobalRouteHooks(co(e,r));const a=Kt(),s=on(),p=gn(),h=Jn(),c=On({mode:e==null?void 0:e.historyMode,listener:({location:A})=>{const x=st(A);P(x,{state:A.state,replace:!0})}});function g(A,x={}){return no(n,A,x.state)}async function P(A,x={}){const Q=a();if(c.stopListening(),N(A)){c.update(A,x);return}const J=g(A,x)??l("NotFound"),I=Pr(Q),Y=await o.runBeforeRouteHooks({to:J,from:I});switch(Y.status){case"ABORT":return;case"PUSH":c.update(A,x),await k(...Y.to);return;case"REJECT":c.update(A,x),d(Y.type);break;case"SUCCESS":c.update(A,x),d(null);break;default:throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(Y)}`)}const ue=Q;s.setProps(J).then(T=>{if(ue===Q)switch(T.status){case"SUCCESS":break;case"PUSH":k(...T.to);break;case"REJECT":d(T.type);break;default:const fe=T;throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(fe)}`)}}),U(J);const W=await o.runAfterRouteHooks({to:J,from:I});switch(W.status){case"PUSH":await k(...W.to);break;case"REJECT":d(W.type);break;case"SUCCESS":break;default:const T=W;throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(T)}`)}c.startListening()}const C=(A,x={},Q={})=>{const J=n.find(I=>I.name===A);if(!J)throw new Tn(String(A));return Qn(J,x,Q)},k=(A,x,Q)=>{if(Z(A)){const W={...x},T=br(A,{searchParams:W.query,hash:W.hash});return P(T,W)}if(typeof A=="string"){const{replace:W,...T}={...Q},fe={...x},le=C(A,fe,T),bo=hr({...le.matched.state},{...le.state,...T.state});return P(le.href,{replace:W,state:bo})}const{replace:J,...I}={...x},Y=hr({...A.matched.state},{...A.state,...I.state}),ue=br(A.href,{searchParams:I.query,hash:I.hash});return P(ue,{replace:J,state:Y})},E=(A,x,Q)=>{if(Z(A)){const I={...x,replace:!0};return k(A,I)}if(typeof A=="string"){const I={...Q,replace:!0},Y={...x};return k(A,Y,I)}const J={...x,replace:!0};return k(A,J)},m=A=>{d(A)},{setRejection:d,rejection:w,getRejectionRoute:l}=Hn({...r.reduce((A,x)=>({...A,...x.rejections}),{}),...e==null?void 0:e.rejections}),u=l("NotFound"),{currentRoute:S,routerRoute:L,updateRoute:U}=Bn(u,k),R=qn(e==null?void 0:e.initialUrl),f=c.location.state,{host:y}=q(R),N=jn(y);let B=!1;const{promise:O,resolve:$}=Promise.withResolvers();async function _(){if(B)return O;Vr(n)&&await Br(),B=!0,await P(R,{replace:!0,state:f}),c.startListening(),$()}function D(){c.stopListening()}function Pr(A){return Xr(A)?null:{...S}}function Eo(A){o.setVueApp(A),s.setVueApp(A),A.component("RouterView",ae),A.component("RouterLink",Ke),A.provide(Ye,w),A.provide(nr,o),A.provide(Te,s),A.provide(tr,p),A.provide(We,h),A.provide(ye,Ar),_()}const Ar={route:L,resolve:C,find:g,push:k,replace:E,reject:m,refresh:c.refresh,forward:c.forward,back:c.back,go:c.go,install:Eo,isExternal:N,onBeforeRouteEnter:o.onBeforeRouteEnter,onBeforeRouteUpdate:o.onBeforeRouteUpdate,onBeforeRouteLeave:o.onBeforeRouteLeave,onAfterRouteEnter:o.onAfterRouteEnter,onAfterRouteUpdate:o.onAfterRouteUpdate,onAfterRouteLeave:o.onAfterRouteLeave,prefetch:e==null?void 0:e.prefetch,start:_,stop:D};return Ar}function fo(t){return{routes:t.routes??[],rejections:t.rejections??{},...t}}function Sr(t){return{get:(e,{invalid:r})=>{for(const n of t){const o=$r(e,n);if(o!==void 0)return o}throw r(`Value ${e} does not satisfy any of the possible values`)},set:(e,{invalid:r})=>{for(const n of t){const o=Hr(e,n);if(o!==void 0)return o}throw r(`Value ${e} does not satisfy any of the possible values`)}}}const lo={separator:","};function po(t,e={}){const{separator:r}={...lo,...e},n=Sr(t);return{get:(o,a)=>o.split(r).map(s=>n.get(s,a)),set:(o,a)=>{if(!Array.isArray(o))throw a.invalid("Expected an array");return o.map(s=>n.set(s,a)).join(r)}}}const ho={separator:","};function yo(t,e={}){const{separator:r}={...ho,...e};return{get:n=>{const o=n.split(r);return t.map((a,s)=>tt(o.at(s),a))},set:(n,{invalid:o})=>{if(!Array.isArray(n))throw o("Expected a tuple");if(n.length!==t.length)throw o(`Expected tuple with ${t.length} values but received ${n.length} values`);return t.map((a,s)=>et(n.at(s),a)).join(r)}}}const mo=M,go=M,Ro=M;function wo(t){const e=Yt(),r=$e(t.name),n=rt(t.path),o=rt(t.query),a=rt(t.hash),s=t.meta??{},p=rt(t.host),h=i.markRaw({id:e,meta:{},state:{},...t}),c={id:e,matched:h,matches:[h],name:r,host:p,path:n,query:o,hash:a,meta:s,depth:1,state:{}},g=Be(t)?Ze(t.parent,c):c;return ct(g.path.params,g.query.params,g.host.params,g.hash.params),g}v.DuplicateParamsError=pe,v.MetaPropertyConflict=de,v.RouterLink=Ke,v.RouterNotInstalledError=X,v.RouterView=ae,v.UseRouteInvalidError=he,v.arrayOf=po,v.asUrl=Zt,v.createExternalRoute=wo,v.createParam=Re,v.createRoute=nt,v.createRouter=uo,v.createRouterPlugin=fo,v.host=go,v.isRoute=ee,v.isUrl=Z,v.onAfterRouteLeave=Un,v.onAfterRouteUpdate=Ln,v.onBeforeRouteLeave=vn,v.onBeforeRouteUpdate=kn,v.path=mo,v.query=Ro,v.tupleOf=yo,v.unionOf=Sr,v.useLink=Qe,v.useRoute=ne,v.useRouter=Pt,v.withDefault=Lr,v.withParams=M,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kitbag/router",
3
3
  "private": false,
4
- "version": "0.19.0",
4
+ "version": "0.20.1",
5
5
  "bugs": {
6
6
  "url": "https://github.com/kitbagjs/router/issues"
7
7
  },
@@ -41,20 +41,21 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@kitbag/eslint-config": "1.0.2",
44
- "@vitejs/plugin-vue": "^5.2.1",
44
+ "@vitejs/plugin-vue": "^5.2.3",
45
45
  "@vue/test-utils": "^2.4.6",
46
- "eslint": "^9.20.1",
47
- "globals": "^15.15.0",
48
- "happy-dom": "^17.1.0",
49
- "typedoc": "^0.27.7",
46
+ "eslint": "^9.23.0",
47
+ "globals": "^16.0.0",
48
+ "happy-dom": "^17.4.4",
49
+ "typedoc": "^0.27.9",
50
50
  "typedoc-plugin-markdown": "^4.4.2",
51
51
  "typedoc-vitepress-theme": "^1.1.2",
52
- "typescript": "^5.7.3",
53
- "vite": "^6.1.0",
54
- "vite-plugin-dts": "^4.5.0",
52
+ "typescript": "^5.8.2",
53
+ "valibot": "^1.0.0",
54
+ "vite": "^6.2.3",
55
+ "vite-plugin-dts": "^4.5.3",
55
56
  "vitepress": "^1.6.3",
56
- "vitest": "^3.0.5",
57
- "vue-tsc": "^2.2.2"
57
+ "vitest": "^3.0.9",
58
+ "vue-tsc": "^2.2.8"
58
59
  },
59
60
  "peerDependencies": {
60
61
  "vue": "^3.5.0",
@@ -66,6 +67,7 @@
66
67
  }
67
68
  },
68
69
  "dependencies": {
70
+ "@standard-schema/spec": "^1.0.0",
69
71
  "history": "^5.3.0"
70
72
  }
71
73
  }