import{s as Qn,d as xt,u as X,a as Wn,c as z,p as We,r as V,w as Sn,h as kn,n as Zn,b as Le,i as fe,o as Xn,e as eo,f as to,g as $n,_ as De,v as no,j as ze,k as D,l as I,m as d,q as U,t as Y,x as ee,y as Q,z as Oe,A as ve,B as oo,C as me,D as je,E as qe,F as Z,G as xn,H as An,I as we,T as He,J as Ue,K as Ke,L as Tn,S as so,M as W,N as re,O as Se,P as Ze}from"./index-B0IcYqqq.js";/*! * vue-router v4.5.1 * (c) 2025 Eduardo San Martin Morote * @license MIT */const Re=typeof document<"u";function Bn(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function ro(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Bn(e.default)}const F=Object.assign;function Xe(e,t){const o={};for(const n in t){const s=t[n];o[n]=te(s)?s.map(e):e(s)}return o}const Be=()=>{},te=Array.isArray,Nn=/#/g,io=/&/g,ao=/\//g,lo=/=/g,uo=/\?/g,Mn=/\+/g,co=/%5B/g,fo=/%5D/g,In=/%5E/g,mo=/%60/g,Ln=/%7B/g,ho=/%7C/g,Dn=/%7D/g,po=/%20/g;function At(e){return encodeURI(""+e).replace(ho,"|").replace(co,"[").replace(fo,"]")}function go(e){return At(e).replace(Ln,"{").replace(Dn,"}").replace(In,"^")}function Rt(e){return At(e).replace(Mn,"%2B").replace(po,"+").replace(Nn,"%23").replace(io,"%26").replace(mo,"`").replace(Ln,"{").replace(Dn,"}").replace(In,"^")}function vo(e){return Rt(e).replace(lo,"%3D")}function wo(e){return At(e).replace(Nn,"%23").replace(uo,"%3F")}function yo(e){return e==null?"":wo(e).replace(ao,"%2F")}function Me(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const bo=/\/$/,Eo=e=>e.replace(bo,"");function et(e,t,o="/"){let n,s={},r="",a="";const u=t.indexOf("#");let i=t.indexOf("?");return u=0&&(i=-1),i>-1&&(n=t.slice(0,i),r=t.slice(i+1,u>-1?u:t.length),s=e(r)),u>-1&&(n=n||t.slice(0,u),a=t.slice(u,t.length)),n=Ro(n??t,o),{fullPath:n+(r&&"?")+r+a,path:n,query:s,hash:Me(a)}}function Co(e,t){const o=t.query?e(t.query):"";return t.path+(o&&"?")+o+(t.hash||"")}function Nt(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Po(e,t,o){const n=t.matched.length-1,s=o.matched.length-1;return n>-1&&n===s&&ke(t.matched[n],o.matched[s])&&qn(t.params,o.params)&&e(t.query)===e(o.query)&&t.hash===o.hash}function ke(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function qn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const o in e)if(!_o(e[o],t[o]))return!1;return!0}function _o(e,t){return te(e)?Mt(e,t):te(t)?Mt(t,e):e===t}function Mt(e,t){return te(t)?e.length===t.length&&e.every((o,n)=>o===t[n]):e.length===1&&e[0]===t}function Ro(e,t){if(e.startsWith("/"))return e;if(!e)return t;const o=t.split("/"),n=e.split("/"),s=n[n.length-1];(s===".."||s===".")&&n.push("");let r=o.length-1,a,u;for(a=0;a1&&r--;else break;return o.slice(0,r).join("/")+"/"+n.slice(a).join("/")}const ue={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Ie;(function(e){e.pop="pop",e.push="push"})(Ie||(Ie={}));var Ne;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ne||(Ne={}));function So(e){if(!e)if(Re){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Eo(e)}const ko=/^[^#]+#/;function $o(e,t){return e.replace(ko,"#")+t}function xo(e,t){const o=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{behavior:t.behavior,left:n.left-o.left-(t.left||0),top:n.top-o.top-(t.top||0)}}const Ge=()=>({left:window.scrollX,top:window.scrollY});function Ao(e){let t;if("el"in e){const o=e.el,n=typeof o=="string"&&o.startsWith("#"),s=typeof o=="string"?n?document.getElementById(o.slice(1)):document.querySelector(o):o;if(!s)return;t=xo(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function It(e,t){return(history.state?history.state.position-t:-1)+e}const St=new Map;function To(e,t){St.set(e,t)}function Bo(e){const t=St.get(e);return St.delete(e),t}let No=()=>location.protocol+"//"+location.host;function Un(e,t){const{pathname:o,search:n,hash:s}=t,r=e.indexOf("#");if(r>-1){let u=s.includes(e.slice(r))?e.slice(r).length:1,i=s.slice(u);return i[0]!=="/"&&(i="/"+i),Nt(i,"")}return Nt(o,e)+n+s}function Mo(e,t,o,n){let s=[],r=[],a=null;const u=({state:m})=>{const f=Un(e,location),y=o.value,_=t.value;let M=0;if(m){if(o.value=f,t.value=m,a&&a===y){a=null;return}M=_?m.position-_.position:0}else n(f);s.forEach(R=>{R(o.value,y,{delta:M,type:Ie.pop,direction:M?M>0?Ne.forward:Ne.back:Ne.unknown})})};function i(){a=o.value}function l(m){s.push(m);const f=()=>{const y=s.indexOf(m);y>-1&&s.splice(y,1)};return r.push(f),f}function c(){const{history:m}=window;m.state&&m.replaceState(F({},m.state,{scroll:Ge()}),"")}function h(){for(const m of r)m();r=[],window.removeEventListener("popstate",u),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",u),window.addEventListener("beforeunload",c,{passive:!0}),{pauseListeners:i,listen:l,destroy:h}}function Lt(e,t,o,n=!1,s=!1){return{back:e,current:t,forward:o,replaced:n,position:window.history.length,scroll:s?Ge():null}}function Io(e){const{history:t,location:o}=window,n={value:Un(e,o)},s={value:t.state};s.value||r(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(i,l,c){const h=e.indexOf("#"),m=h>-1?(o.host&&document.querySelector("base")?e:e.slice(h))+i:No()+e+i;try{t[c?"replaceState":"pushState"](l,"",m),s.value=l}catch(f){console.error(f),o[c?"replace":"assign"](m)}}function a(i,l){const c=F({},t.state,Lt(s.value.back,i,s.value.forward,!0),l,{position:s.value.position});r(i,c,!0),n.value=i}function u(i,l){const c=F({},s.value,t.state,{forward:i,scroll:Ge()});r(c.current,c,!0);const h=F({},Lt(n.value,i,null),{position:c.position+1},l);r(i,h,!1),n.value=i}return{location:n,state:s,push:u,replace:a}}function Lo(e){e=So(e);const t=Io(e),o=Mo(e,t.state,t.location,t.replace);function n(r,a=!0){a||o.pauseListeners(),history.go(r)}const s=F({location:"",base:e,go:n,createHref:$o.bind(null,e)},t,o);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function Do(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Lo(e)}function qo(e){return typeof e=="string"||e&&typeof e=="object"}function On(e){return typeof e=="string"||typeof e=="symbol"}const Fn=Symbol("");var Dt;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Dt||(Dt={}));function $e(e,t){return F(new Error,{type:e,[Fn]:!0},t)}function ae(e,t){return e instanceof Error&&Fn in e&&(t==null||!!(e.type&t))}const qt="[^/]+?",Uo={sensitive:!1,strict:!1,start:!0,end:!0},Oo=/[.+*?^${}()[\]/\\]/g;function Fo(e,t){const o=F({},Uo,t),n=[];let s=o.start?"^":"";const r=[];for(const l of e){const c=l.length?[]:[90];o.strict&&!l.length&&(s+="/");for(let h=0;ht.length?t.length===1&&t[0]===80?1:-1:0}function Vn(e,t){let o=0;const n=e.score,s=t.score;for(;o0&&t[t.length-1]<0}const Ho={type:0,value:""},zo=/[a-zA-Z0-9_]/;function jo(e){if(!e)return[[]];if(e==="/")return[[Ho]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(f){throw new Error(`ERR (${o})/"${l}": ${f}`)}let o=0,n=o;const s=[];let r;function a(){r&&s.push(r),r=[]}let u=0,i,l="",c="";function h(){l&&(o===0?r.push({type:0,value:l}):o===1||o===2||o===3?(r.length>1&&(i==="*"||i==="+")&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:l,regexp:c,repeatable:i==="*"||i==="+",optional:i==="*"||i==="?"})):t("Invalid state to consume buffer"),l="")}function m(){l+=i}for(;u{a(p)}:Be}function a(h){if(On(h)){const m=n.get(h);m&&(n.delete(h),o.splice(o.indexOf(m),1),m.children.forEach(a),m.alias.forEach(a))}else{const m=o.indexOf(h);m>-1&&(o.splice(m,1),h.record.name&&n.delete(h.record.name),h.children.forEach(a),h.alias.forEach(a))}}function u(){return o}function i(h){const m=Qo(h,o);o.splice(m,0,h),h.record.name&&!Vt(h)&&n.set(h.record.name,h)}function l(h,m){let f,y={},_,M;if("name"in h&&h.name){if(f=n.get(h.name),!f)throw $e(1,{location:h});M=f.record.name,y=F(Ot(m.params,f.keys.filter(p=>!p.optional).concat(f.parent?f.parent.keys.filter(p=>p.optional):[]).map(p=>p.name)),h.params&&Ot(h.params,f.keys.map(p=>p.name))),_=f.stringify(y)}else if(h.path!=null)_=h.path,f=o.find(p=>p.re.test(_)),f&&(y=f.parse(_),M=f.record.name);else{if(f=m.name?n.get(m.name):o.find(p=>p.re.test(m.path)),!f)throw $e(1,{location:h,currentLocation:m});M=f.record.name,y=F({},m.params,h.params),_=f.stringify(y)}const R=[];let C=f;for(;C;)R.unshift(C.record),C=C.parent;return{name:M,path:_,params:y,matched:R,meta:Jo(R)}}e.forEach(h=>r(h));function c(){o.length=0,n.clear()}return{addRoute:r,resolve:l,removeRoute:a,clearRoutes:c,getRoutes:u,getRecordMatcher:s}}function Ot(e,t){const o={};for(const n of t)n in e&&(o[n]=e[n]);return o}function Ft(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Yo(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Yo(e){const t={},o=e.props||!1;if("component"in e)t.default=o;else for(const n in e.components)t[n]=typeof o=="object"?o[n]:o;return t}function Vt(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Jo(e){return e.reduce((t,o)=>F(t,o.meta),{})}function Ht(e,t){const o={};for(const n in e)o[n]=n in t?t[n]:e[n];return o}function Qo(e,t){let o=0,n=t.length;for(;o!==n;){const r=o+n>>1;Vn(e,t[r])<0?n=r:o=r+1}const s=Wo(e);return s&&(n=t.lastIndexOf(s,n-1)),n}function Wo(e){let t=e;for(;t=t.parent;)if(Hn(t)&&Vn(e,t)===0)return t}function Hn({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Zo(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sr&&Rt(r)):[n&&Rt(n)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+o,r!=null&&(t+="="+r))})}return t}function Xo(e){const t={};for(const o in e){const n=e[o];n!==void 0&&(t[o]=te(n)?n.map(s=>s==null?null:""+s):n==null?n:""+n)}return t}const zn=Symbol(""),jt=Symbol(""),Ye=Symbol(""),Tt=Symbol(""),kt=Symbol("");function Ae(){let e=[];function t(n){return e.push(n),()=>{const s=e.indexOf(n);s>-1&&e.splice(s,1)}}function o(){e=[]}return{add:t,list:()=>e.slice(),reset:o}}function es(e,t,o){const n=()=>{e[t].delete(o)};Xn(n),eo(n),to(()=>{e[t].add(o)}),e[t].add(o)}function ts(e){const t=fe(zn,{}).value;t&&es(t,"leaveGuards",e)}function de(e,t,o,n,s,r=a=>a()){const a=n&&(n.enterCallbacks[s]=n.enterCallbacks[s]||[]);return()=>new Promise((u,i)=>{const l=m=>{m===!1?i($e(4,{from:o,to:t})):m instanceof Error?i(m):qo(m)?i($e(2,{from:t,to:m})):(a&&n.enterCallbacks[s]===a&&typeof m=="function"&&a.push(m),u())},c=r(()=>e.call(n&&n.instances[s],t,o,l));let h=Promise.resolve(c);e.length<3&&(h=h.then(l)),h.catch(m=>i(m))})}function tt(e,t,o,n,s=r=>r()){const r=[];for(const a of e)for(const u in a.components){let i=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Bn(i)){const c=(i.__vccOpts||i)[t];c&&r.push(de(c,o,n,a,u,s))}else{let l=i();r.push(()=>l.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);const h=ro(c)?c.default:c;a.mods[u]=c,a.components[u]=h;const f=(h.__vccOpts||h)[t];return f&&de(f,o,n,a,u,s)()}))}}return r}function Kt(e){const t=fe(Ye),o=fe(Tt),n=z(()=>{const i=X(e.to);return t.resolve(i)}),s=z(()=>{const{matched:i}=n.value,{length:l}=i,c=i[l-1],h=o.matched;if(!c||!h.length)return-1;const m=h.findIndex(ke.bind(null,c));if(m>-1)return m;const f=Gt(i[l-2]);return l>1&&Gt(c)===f&&h[h.length-1].path!==f?h.findIndex(ke.bind(null,i[l-2])):m}),r=z(()=>s.value>-1&&is(o.params,n.value.params)),a=z(()=>s.value>-1&&s.value===o.matched.length-1&&qn(o.params,n.value.params));function u(i={}){if(rs(i)){const l=t[X(e.replace)?"replace":"push"](X(e.to)).catch(Be);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>l),l}return Promise.resolve()}return{route:n,href:z(()=>n.value.href),isActive:r,isExactActive:a,navigate:u}}function ns(e){return e.length===1?e[0]:e}const os=xt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Kt,setup(e,{slots:t}){const o=Le(Kt(e)),{options:n}=fe(Ye),s=z(()=>({[Yt(e.activeClass,n.linkActiveClass,"router-link-active")]:o.isActive,[Yt(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive}));return()=>{const r=t.default&&ns(t.default(o));return e.custom?r:kn("a",{"aria-current":o.isExactActive?e.ariaCurrentValue:null,href:o.href,onClick:o.navigate,class:s.value},r)}}}),ss=os;function rs(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function is(e,t){for(const o in t){const n=t[o],s=e[o];if(typeof n=="string"){if(n!==s)return!1}else if(!te(s)||s.length!==n.length||n.some((r,a)=>r!==s[a]))return!1}return!0}function Gt(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Yt=(e,t,o)=>e??t??o,as=xt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:o}){const n=fe(kt),s=z(()=>e.route||n.value),r=fe(jt,0),a=z(()=>{let l=X(r);const{matched:c}=s.value;let h;for(;(h=c[l])&&!h.components;)l++;return l}),u=z(()=>s.value.matched[a.value]);We(jt,z(()=>a.value+1)),We(zn,u),We(kt,s);const i=V();return Sn(()=>[i.value,u.value,e.name],([l,c,h],[m,f,y])=>{c&&(c.instances[h]=l,f&&f!==c&&l&&l===m&&(c.leaveGuards.size||(c.leaveGuards=f.leaveGuards),c.updateGuards.size||(c.updateGuards=f.updateGuards))),l&&c&&(!f||!ke(c,f)||!m)&&(c.enterCallbacks[h]||[]).forEach(_=>_(l))},{flush:"post"}),()=>{const l=s.value,c=e.name,h=u.value,m=h&&h.components[c];if(!m)return Jt(o.default,{Component:m,route:l});const f=h.props[c],y=f?f===!0?l.params:typeof f=="function"?f(l):f:null,M=kn(m,F({},y,t,{onVnodeUnmounted:R=>{R.component.isUnmounted&&(h.instances[c]=null)},ref:i}));return Jt(o.default,{Component:M,route:l})||M}}});function Jt(e,t){if(!e)return null;const o=e(t);return o.length===1?o[0]:o}const ls=as;function us(e){const t=Go(e.routes,e),o=e.parseQuery||Zo,n=e.stringifyQuery||zt,s=e.history,r=Ae(),a=Ae(),u=Ae(),i=Qn(ue);let l=ue;Re&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Xe.bind(null,g=>""+g),h=Xe.bind(null,yo),m=Xe.bind(null,Me);function f(g,k){let P,B;return On(g)?(P=t.getRecordMatcher(g),B=k):B=g,t.addRoute(B,P)}function y(g){const k=t.getRecordMatcher(g);k&&t.removeRoute(k)}function _(){return t.getRoutes().map(g=>g.record)}function M(g){return!!t.getRecordMatcher(g)}function R(g,k){if(k=F({},k||i.value),typeof g=="string"){const q=et(o,g,k.path),K=t.resolve({path:q.path},k),xe=s.createHref(q.fullPath);return F(q,K,{params:m(K.params),hash:Me(q.hash),redirectedFrom:void 0,href:xe})}let P;if(g.path!=null)P=F({},g,{path:et(o,g.path,k.path).path});else{const q=F({},g.params);for(const K in q)q[K]==null&&delete q[K];P=F({},g,{params:h(q)}),k.params=h(k.params)}const B=t.resolve(P,k),H=g.hash||"";B.params=c(m(B.params));const j=Co(n,F({},g,{hash:go(H),path:B.path})),O=s.createHref(j);return F({fullPath:j,hash:H,query:n===zt?Xo(g.query):g.query||{}},B,{redirectedFrom:void 0,href:O})}function C(g){return typeof g=="string"?et(o,g,i.value.path):F({},g)}function p(g,k){if(l!==g)return $e(8,{from:k,to:g})}function T(g){return w(g)}function L(g){return T(F(C(g),{replace:!0}))}function b(g){const k=g.matched[g.matched.length-1];if(k&&k.redirect){const{redirect:P}=k;let B=typeof P=="function"?P(g):P;return typeof B=="string"&&(B=B.includes("?")||B.includes("#")?B=C(B):{path:B},B.params={}),F({query:g.query,hash:g.hash,params:B.path!=null?{}:g.params},B)}}function w(g,k){const P=l=R(g),B=i.value,H=g.state,j=g.force,O=g.replace===!0,q=b(P);if(q)return w(F(C(q),{state:typeof q=="object"?F({},H,q.state):H,force:j,replace:O}),k||P);const K=P;K.redirectedFrom=k;let xe;return!j&&Po(n,B,P)&&(xe=$e(16,{to:K,from:B}),pe(B,B,!0,!1)),(xe?Promise.resolve(xe):x(K,B)).catch(J=>ae(J)?ae(J,2)?J:he(J):oe(J,K,B)).then(J=>{if(J){if(ae(J,2))return w(F({replace:O},C(J.to),{state:typeof J.to=="object"?F({},H,J.to.state):H,force:j}),k||K)}else J=A(K,B,!0,O,H);return S(K,B,J),J})}function v(g,k){const P=p(g,k);return P?Promise.reject(P):Promise.resolve()}function E(g){const k=Ce.values().next().value;return k&&typeof k.runWithContext=="function"?k.runWithContext(g):g()}function x(g,k){let P;const[B,H,j]=cs(g,k);P=tt(B.reverse(),"beforeRouteLeave",g,k);for(const q of B)q.leaveGuards.forEach(K=>{P.push(de(K,g,k))});const O=v.bind(null,g,k);return P.push(O),ie(P).then(()=>{P=[];for(const q of r.list())P.push(de(q,g,k));return P.push(O),ie(P)}).then(()=>{P=tt(H,"beforeRouteUpdate",g,k);for(const q of H)q.updateGuards.forEach(K=>{P.push(de(K,g,k))});return P.push(O),ie(P)}).then(()=>{P=[];for(const q of j)if(q.beforeEnter)if(te(q.beforeEnter))for(const K of q.beforeEnter)P.push(de(K,g,k));else P.push(de(q.beforeEnter,g,k));return P.push(O),ie(P)}).then(()=>(g.matched.forEach(q=>q.enterCallbacks={}),P=tt(j,"beforeRouteEnter",g,k,E),P.push(O),ie(P))).then(()=>{P=[];for(const q of a.list())P.push(de(q,g,k));return P.push(O),ie(P)}).catch(q=>ae(q,8)?q:Promise.reject(q))}function S(g,k,P){u.list().forEach(B=>E(()=>B(g,k,P)))}function A(g,k,P,B,H){const j=p(g,k);if(j)return j;const O=k===ue,q=Re?history.state:{};P&&(B||O?s.replace(g.fullPath,F({scroll:O&&q&&q.scroll},H)):s.push(g.fullPath,H)),i.value=g,pe(g,k,P,O),he()}let $;function N(){$||($=s.listen((g,k,P)=>{if(!Pe.listening)return;const B=R(g),H=b(B);if(H){w(F(H,{replace:!0,force:!0}),B).catch(Be);return}l=B;const j=i.value;Re&&To(It(j.fullPath,P.delta),Ge()),x(B,j).catch(O=>ae(O,12)?O:ae(O,2)?(w(F(C(O.to),{force:!0}),B).then(q=>{ae(q,20)&&!P.delta&&P.type===Ie.pop&&s.go(-1,!1)}).catch(Be),Promise.reject()):(P.delta&&s.go(-P.delta,!1),oe(O,B,j))).then(O=>{O=O||A(B,j,!1),O&&(P.delta&&!ae(O,8)?s.go(-P.delta,!1):P.type===Ie.pop&&ae(O,20)&&s.go(-1,!1)),S(B,j,O)}).catch(Be)}))}let G=Ae(),ne=Ae(),le;function oe(g,k,P){he(g);const B=ne.list();return B.length?B.forEach(H=>H(g,k,P)):console.error(g),Promise.reject(g)}function Qe(){return le&&i.value!==ue?Promise.resolve():new Promise((g,k)=>{G.add([g,k])})}function he(g){return le||(le=!g,N(),G.list().forEach(([k,P])=>g?P(g):k()),G.reset()),g}function pe(g,k,P,B){const{scrollBehavior:H}=e;if(!Re||!H)return Promise.resolve();const j=!P&&Bo(It(g.fullPath,0))||(B||!P)&&history.state&&history.state.scroll||null;return Zn().then(()=>H(g,k,j)).then(O=>O&&Ao(O)).catch(O=>oe(O,g,k))}const Ee=g=>s.go(g);let ge;const Ce=new Set,Pe={currentRoute:i,listening:!0,addRoute:f,removeRoute:y,clearRoutes:t.clearRoutes,hasRoute:M,getRoutes:_,resolve:R,options:e,push:T,replace:L,go:Ee,back:()=>Ee(-1),forward:()=>Ee(1),beforeEach:r.add,beforeResolve:a.add,afterEach:u.add,onError:ne.add,isReady:Qe,install(g){const k=this;g.component("RouterLink",ss),g.component("RouterView",ls),g.config.globalProperties.$router=k,Object.defineProperty(g.config.globalProperties,"$route",{enumerable:!0,get:()=>X(i)}),Re&&!ge&&i.value===ue&&(ge=!0,T(s.location).catch(H=>{}));const P={};for(const H in ue)Object.defineProperty(P,H,{get:()=>i.value[H],enumerable:!0});g.provide(Ye,k),g.provide(Tt,Wn(P)),g.provide(kt,i);const B=g.unmount;Ce.add(g),g.unmount=function(){Ce.delete(g),Ce.size<1&&(l=ue,$&&$(),$=null,i.value=ue,ge=!1,le=!1),B()}}};function ie(g){return g.reduce((k,P)=>k.then(()=>E(P)),Promise.resolve())}return Pe}function cs(e,t){const o=[],n=[],s=[],r=Math.max(t.matched.length,e.matched.length);for(let a=0;ake(l,u))?n.push(u):o.push(u));const i=e.matched[a];i&&(t.matched.find(l=>ke(l,i))||s.push(i))}return[o,n,s]}function Je(){return fe(Ye)}function ds(e){return fe(Tt)}var _e={},nt,Qt;function fs(){return Qt||(Qt=1,nt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),nt}var ot={},ce={},Wt;function ye(){if(Wt)return ce;Wt=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ce.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},ce.getSymbolTotalCodewords=function(n){return t[n]},ce.getBCHDigit=function(o){let n=0;for(;o!==0;)n++,o>>>=1;return n},ce.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},ce.isKanjiModeEnabled=function(){return typeof e<"u"},ce.toSJIS=function(n){return e(n)},ce}var st={},Zt;function Bt(){return Zt||(Zt=1,function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+o)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,s){if(e.isValid(n))return n;try{return t(n)}catch{return s}}}(st)),st}var rt,Xt;function ms(){if(Xt)return rt;Xt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const o=Math.floor(t/8);return(this.buffer[o]>>>7-t%8&1)===1},put:function(t,o){for(let n=0;n>>o-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const o=Math.floor(this.length/8);this.buffer.length<=o&&this.buffer.push(0),t&&(this.buffer[o]|=128>>>this.length%8),this.length++}},rt=e,rt}var it,en;function hs(){if(en)return it;en=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,o,n,s){const r=t*this.size+o;this.data[r]=n,s&&(this.reservedBit[r]=!0)},e.prototype.get=function(t,o){return this.data[t*this.size+o]},e.prototype.xor=function(t,o,n){this.data[t*this.size+o]^=n},e.prototype.isReserved=function(t,o){return this.reservedBit[t*this.size+o]},it=e,it}var at={},tn;function ps(){return tn||(tn=1,function(e){const t=ye().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const s=Math.floor(n/7)+2,r=t(n),a=r===145?26:Math.ceil((r-13)/(2*s-2))*2,u=[r-7];for(let i=1;i=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const r=s.size;let a=0,u=0,i=0,l=null,c=null;for(let h=0;h=5&&(a+=t.N1+(u-5)),l=f,u=1),f=s.get(m,h),f===c?i++:(i>=5&&(a+=t.N1+(i-5)),c=f,i=1)}u>=5&&(a+=t.N1+(u-5)),i>=5&&(a+=t.N1+(i-5))}return a},e.getPenaltyN2=function(s){const r=s.size;let a=0;for(let u=0;u=10&&(u===1488||u===93)&&a++,i=i<<1&2047|s.get(c,l),c>=10&&(i===1488||i===93)&&a++}return a*t.N3},e.getPenaltyN4=function(s){let r=0;const a=s.data.length;for(let i=0;i=0;){const a=r[0];for(let i=0;i0){const u=new Uint8Array(this.degree);return u.set(r,a),u}return r},dt=t,dt}var ft={},mt={},ht={},un;function Kn(){return un||(un=1,ht.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),ht}var se={},cn;function Gn(){if(cn)return se;cn=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let o="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";o=o.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+o+`)(?:.|[\r ]))+`;se.KANJI=new RegExp(o,"g"),se.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),se.BYTE=new RegExp(n,"g"),se.NUMERIC=new RegExp(e,"g"),se.ALPHANUMERIC=new RegExp(t,"g");const s=new RegExp("^"+o+"$"),r=new RegExp("^"+e+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return se.testKanji=function(i){return s.test(i)},se.testNumeric=function(i){return r.test(i)},se.testAlphanumeric=function(i){return a.test(i)},se}var dn;function be(){return dn||(dn=1,function(e){const t=Kn(),o=Gn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,a){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?r.ccBits[0]:a<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return o.testNumeric(r)?e.NUMERIC:o.testAlphanumeric(r)?e.ALPHANUMERIC:o.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function n(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(r,a){if(e.isValid(r))return r;try{return n(r)}catch{return a}}}(mt)),mt}var fn;function Es(){return fn||(fn=1,function(e){const t=ye(),o=jn(),n=Bt(),s=be(),r=Kn(),a=7973,u=t.getBCHDigit(a);function i(m,f,y){for(let _=1;_<=40;_++)if(f<=e.getCapacity(_,y,m))return _}function l(m,f){return s.getCharCountIndicator(m,f)+4}function c(m,f){let y=0;return m.forEach(function(_){const M=l(_.mode,f);y+=M+_.getBitsLength()}),y}function h(m,f){for(let y=1;y<=40;y++)if(c(m,y)<=e.getCapacity(y,f,s.MIXED))return y}e.from=function(f,y){return r.isValid(f)?parseInt(f,10):y},e.getCapacity=function(f,y,_){if(!r.isValid(f))throw new Error("Invalid QR Code version");typeof _>"u"&&(_=s.BYTE);const M=t.getSymbolTotalCodewords(f),R=o.getTotalCodewordsCount(f,y),C=(M-R)*8;if(_===s.MIXED)return C;const p=C-l(_,f);switch(_){case s.NUMERIC:return Math.floor(p/10*3);case s.ALPHANUMERIC:return Math.floor(p/11*2);case s.KANJI:return Math.floor(p/13);case s.BYTE:default:return Math.floor(p/8)}},e.getBestVersionForData=function(f,y){let _;const M=n.from(y,n.M);if(Array.isArray(f)){if(f.length>1)return h(f,M);if(f.length===0)return 1;_=f[0]}else _=f;return i(_.mode,_.getLength(),M)},e.getEncodedBits=function(f){if(!r.isValid(f)||f<7)throw new Error("Invalid QR Code version");let y=f<<12;for(;t.getBCHDigit(y)-u>=0;)y^=a<=0;)i^=t<0&&(r=this.data.substr(s),a=parseInt(r,10),n.put(a,u*3+1))},vt=t,vt}var wt,pn;function _s(){if(pn)return wt;pn=1;const e=be(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(n){this.mode=e.ALPHANUMERIC,this.data=n}return o.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(s){let r;for(r=0;r+2<=this.data.length;r+=2){let a=t.indexOf(this.data[r])*45;a+=t.indexOf(this.data[r+1]),s.put(a,11)}this.data.length%2&&s.put(t.indexOf(this.data[r]),6)},wt=o,wt}var yt,gn;function Rs(){if(gn)return yt;gn=1;const e=be();function t(o){this.mode=e.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}return t.getBitsLength=function(n){return n*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){for(let n=0,s=this.data.length;n=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+` Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),n.put(r,13)}},bt=o,bt}var Et={exports:{}},wn;function ks(){return wn||(wn=1,function(e){var t={single_source_shortest_paths:function(o,n,s){var r={},a={};a[n]=0;var u=t.PriorityQueue.make();u.push(n,0);for(var i,l,c,h,m,f,y,_,M;!u.empty();){i=u.pop(),l=i.value,h=i.cost,m=o[l]||{};for(c in m)m.hasOwnProperty(c)&&(f=m[c],y=h+f,_=a[c],M=typeof a[c]>"u",(M||_>y)&&(a[c]=y,u.push(c,y),r[c]=l))}if(typeof s<"u"&&typeof a[s]>"u"){var R=["Could not find a path from ",n," to ",s,"."].join("");throw new Error(R)}return r},extract_shortest_path_from_predecessor_list:function(o,n){for(var s=[],r=n;r;)s.push(r),o[r],r=o[r];return s.reverse(),s},find_path:function(o,n,s){var r=t.single_source_shortest_paths(o,n,s);return t.extract_shortest_path_from_predecessor_list(r,s)},PriorityQueue:{make:function(o){var n=t.PriorityQueue,s={},r;o=o||{};for(r in n)n.hasOwnProperty(r)&&(s[r]=n[r]);return s.queue=[],s.sorter=o.sorter||n.default_sorter,s},default_sorter:function(o,n){return o.cost-n.cost},push:function(o,n){var s={value:o,cost:n};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t}(Et)),Et.exports}var yn;function $s(){return yn||(yn=1,function(e){const t=be(),o=Ps(),n=_s(),s=Rs(),r=Ss(),a=Gn(),u=ye(),i=ks();function l(R){return unescape(encodeURIComponent(R)).length}function c(R,C,p){const T=[];let L;for(;(L=R.exec(p))!==null;)T.push({data:L[0],index:L.index,mode:C,length:L[0].length});return T}function h(R){const C=c(a.NUMERIC,t.NUMERIC,R),p=c(a.ALPHANUMERIC,t.ALPHANUMERIC,R);let T,L;return u.isKanjiModeEnabled()?(T=c(a.BYTE,t.BYTE,R),L=c(a.KANJI,t.KANJI,R)):(T=c(a.BYTE_KANJI,t.BYTE,R),L=[]),C.concat(p,T,L).sort(function(w,v){return w.index-v.index}).map(function(w){return{data:w.data,mode:w.mode,length:w.length}})}function m(R,C){switch(C){case t.NUMERIC:return o.getBitsLength(R);case t.ALPHANUMERIC:return n.getBitsLength(R);case t.KANJI:return r.getBitsLength(R);case t.BYTE:return s.getBitsLength(R)}}function f(R){return R.reduce(function(C,p){const T=C.length-1>=0?C[C.length-1]:null;return T&&T.mode===p.mode?(C[C.length-1].data+=p.data,C):(C.push(p),C)},[])}function y(R){const C=[];for(let p=0;p=0&&$<=6&&(N===0||N===6)||N>=0&&N<=6&&($===0||$===6)||$>=2&&$<=4&&N>=2&&N<=4?b.set(S+$,A+N,!0,!0):b.set(S+$,A+N,!1,!0))}}function y(b){const w=b.size;for(let v=8;v>$&1)===1,b.set(x,S,A,!0),b.set(S,x,A,!0)}function R(b,w,v){const E=b.size,x=c.getEncodedBits(w,v);let S,A;for(S=0;S<15;S++)A=(x>>S&1)===1,S<6?b.set(S,8,A,!0):S<8?b.set(S+1,8,A,!0):b.set(E-15+S,8,A,!0),S<8?b.set(8,E-S-1,A,!0):S<9?b.set(8,15-S-1+1,A,!0):b.set(8,15-S-1,A,!0);b.set(E-8,8,1,!0)}function C(b,w){const v=b.size;let E=-1,x=v-1,S=7,A=0;for(let $=v-1;$>0;$-=2)for($===6&&$--;;){for(let N=0;N<2;N++)if(!b.isReserved(x,$-N)){let G=!1;A>>S&1)===1),b.set(x,$-N,G),S--,S===-1&&(A++,S=7)}if(x+=E,x<0||v<=x){x-=E,E=-E;break}}}function p(b,w,v){const E=new o;v.forEach(function(N){E.put(N.mode.bit,4),E.put(N.getLength(),h.getCharCountIndicator(N.mode,b)),N.write(E)});const x=e.getSymbolTotalCodewords(b),S=u.getTotalCodewordsCount(b,w),A=(x-S)*8;for(E.getLengthInBits()+4<=A&&E.put(0,4);E.getLengthInBits()%8!==0;)E.putBit(0);const $=(A-E.getLengthInBits())/8;for(let N=0;N<$;N++)E.put(N%2?17:236,8);return T(E,b,w)}function T(b,w,v){const E=e.getSymbolTotalCodewords(w),x=u.getTotalCodewordsCount(w,v),S=E-x,A=u.getBlocksCount(w,v),$=E%A,N=A-$,G=Math.floor(E/A),ne=Math.floor(S/A),le=ne+1,oe=G-ne,Qe=new i(oe);let he=0;const pe=new Array(A),Ee=new Array(A);let ge=0;const Ce=new Uint8Array(b.buffer);for(let P=0;P=7&&M(N,w),C(N,A),isNaN(E)&&(E=a.getBestMask(N,R.bind(null,N,v))),a.applyMask(E,N),R(N,v,E),{modules:N,version:w,errorCorrectionLevel:v,maskPattern:E,segments:x}}return ot.create=function(w,v){if(typeof w>"u"||w==="")throw new Error("No input text");let E=t.M,x,S;return typeof v<"u"&&(E=t.from(v.errorCorrectionLevel,t.M),x=l.from(v.version),S=a.from(v.maskPattern),v.toSJISFunc&&e.setToSJISFunction(v.toSJISFunc)),L(w,x,E,S)},ot}var Ct={},Pt={},En;function Yn(){return En||(En=1,function(e){function t(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let n=o.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+o);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(r){return[r,r]}))),n.length===6&&n.push("F","F");const s=parseInt(n.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const s=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,r=n.width&&n.width>=21?n.width:void 0,a=n.scale||4;return{width:r,scale:r?4:a,margin:s,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,s){return s.width&&s.width>=n+s.margin*2?s.width/(n+s.margin*2):s.scale},e.getImageWidth=function(n,s){const r=e.getScale(n,s);return Math.floor((n+s.margin*2)*r)},e.qrToImageData=function(n,s,r){const a=s.modules.size,u=s.modules.data,i=e.getScale(a,r),l=Math.floor((a+r.margin*2)*i),c=r.margin*i,h=[r.color.light,r.color.dark];for(let m=0;m=c&&f>=c&&m"u"&&(!a||!a.getContext)&&(i=a,a=void 0),a||(l=n()),i=t.getOptions(i);const c=t.getImageWidth(r.modules.size,i),h=l.getContext("2d"),m=h.createImageData(c,c);return t.qrToImageData(m.data,r,i),o(h,l,c),h.putImageData(m,0,0),l},e.renderToDataURL=function(r,a,u){let i=u;typeof i>"u"&&(!a||!a.getContext)&&(i=a,a=void 0),i||(i={});const l=e.render(r,a,i),c=i.type||"image/png",h=i.rendererOpts||{};return l.toDataURL(c,h.quality)}}(Ct)),Ct}var _t={},Pn;function Ts(){if(Pn)return _t;Pn=1;const e=Yn();function t(s,r){const a=s.a/255,u=r+'="'+s.hex+'"';return a<1?u+" "+r+'-opacity="'+a.toFixed(2).slice(1)+'"':u}function o(s,r,a){let u=s+r;return typeof a<"u"&&(u+=" "+a),u}function n(s,r,a){let u="",i=0,l=!1,c=0;for(let h=0;h0&&m>0&&s[h-1]||(u+=l?o("M",m+a,.5+f+a):o("m",i,0),i=0,l=!1),m+1':"",f="',y='viewBox="0 0 '+h+" "+h+'"',M=''+m+f+` `;return typeof u=="function"&&u(null,M),M},_t}var _n;function Bs(){if(_n)return _e;_n=1;const e=fs(),t=xs(),o=As(),n=Ts();function s(r,a,u,i,l){const c=[].slice.call(arguments,1),h=c.length,m=typeof c[h-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=u,u=a,a=i=void 0):h===3&&(a.getContext&&typeof l>"u"?(l=i,i=void 0):(l=i,i=u,u=a,a=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(u=a,a=i=void 0):h===2&&!a.getContext&&(i=u,u=a,a=void 0),new Promise(function(f,y){try{const _=t.create(u,i);f(r(_,a,i))}catch(_){y(_)}})}try{const f=t.create(u,i);l(null,r(f,a,i))}catch(f){l(f)}}return _e.create=t.create,_e.toCanvas=s.bind(null,o.render),_e.toDataURL=s.bind(null,o.renderToDataURL),_e.toString=s.bind(null,function(r,a,u){return n.render(r,u)}),_e}var Ns=Bs();const Ms=$n(Ns),Is={class:"d-flex gap-2 flex-column"},Ls=["id"],Ds={__name:"qrcode",props:["content"],setup(e){const t=e,o=no().toString();return ze(()=>{Ms.toCanvas(document.getElementById(`qrcode_${o}`),t.content,function(n){})}),(n,s)=>(I(),D("div",Is,[d("canvas",{id:"qrcode_"+X(o),class:"rounded-3"},null,8,Ls)]))}},$t=De(Ds,[["__scopeId","data-v-ec841c31"]]),qs={class:"p-2 position-fixed top-0 start-0 vw-100 vh-100 d-flex qrcodeContainer p-3 overflow-scroll flex-column"},Us={class:"m-auto d-flex gap-3 flex-column p-3",style:{"max-width":"400px"}},Os={class:"d-flex flex-column gap-2 align-items-center"},Fs={key:0,class:"d-flex flex-column gap-2 align-items-center"},Vs=["download","href"],Hs={__name:"configurationQRCode",props:["qrcodeData","protocol"],emits:["back"],setup(e,{emit:t}){const o=e,n=t,s=z(()=>{if(o.qrcodeData.amneziaVPN)return btoa(o.qrcodeData.amneziaVPN)}),r=z(()=>URL.createObjectURL(new Blob([o.qrcodeData.file],{type:"text/conf"})));return(a,u)=>(I(),D("div",qs,[d("div",null,[d("a",{role:"button",onClick:u[0]||(u[0]=i=>n("back")),class:"btn btn-outline-body rounded-3 btn-sm"},u[1]||(u[1]=[d("i",{class:"me-2 bi bi-chevron-left"},null,-1),U(" Back ")]))]),d("div",Us,[d("div",Os,[Y($t,{content:o.qrcodeData.file},null,8,["content"]),d("small",null," Scan with "+Q(e.protocol==="wg"?"WireGuard":"AmneziaWG")+" App ",1),s.value?(I(),D("div",Fs,[Y($t,{content:s.value},null,8,["content"]),u[2]||(u[2]=d("small",null," Scan with AmneziaVPN App ",-1))])):ee("",!0),u[4]||(u[4]=d("hr",{class:"border-white w-100 my-2"},null,-1)),d("a",{download:o.qrcodeData.fileName+".conf",href:r.value,class:"btn bg-primary-subtle border-primary-subtle rounded-3"},u[3]||(u[3]=[d("i",{class:"bi bi-download me-2"},null,-1),U("Download ")]),8,Vs)])])]))}},zs=De(Hs,[["__scopeId","data-v-83f277d2"]]);var Ve={exports:{}},js=Ve.exports,Rn;function Ks(){return Rn||(Rn=1,function(e,t){(function(o,n){e.exports=n()})(js,function(){var o,n,s=1e3,r=6e4,a=36e5,u=864e5,i=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,l=31536e6,c=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,m={years:l,months:c,days:u,hours:a,minutes:r,seconds:s,milliseconds:1,weeks:6048e5},f=function(b){return b instanceof T},y=function(b,w,v){return new T(b,v,w.$l)},_=function(b){return n.p(b)+"s"},M=function(b){return b<0},R=function(b){return M(b)?Math.ceil(b):Math.floor(b)},C=function(b){return Math.abs(b)},p=function(b,w){return b?M(b)?{negative:!0,format:""+C(b)+w}:{negative:!1,format:""+b+w}:{negative:!1,format:""}},T=function(){function b(v,E,x){var S=this;if(this.$d={},this.$l=x,v===void 0&&(this.$ms=0,this.parseFromMilliseconds()),E)return y(v*m[_(E)],this);if(typeof v=="number")return this.$ms=v,this.parseFromMilliseconds(),this;if(typeof v=="object")return Object.keys(v).forEach(function(N){S.$d[_(N)]=v[N]}),this.calMilliseconds(),this;if(typeof v=="string"){var A=v.match(h);if(A){var $=A.slice(2).map(function(N){return N!=null?Number(N):0});return this.$d.years=$[0],this.$d.months=$[1],this.$d.weeks=$[2],this.$d.days=$[3],this.$d.hours=$[4],this.$d.minutes=$[5],this.$d.seconds=$[6],this.calMilliseconds(),this}}return this}var w=b.prototype;return w.calMilliseconds=function(){var v=this;this.$ms=Object.keys(this.$d).reduce(function(E,x){return E+(v.$d[x]||0)*m[x]},0)},w.parseFromMilliseconds=function(){var v=this.$ms;this.$d.years=R(v/l),v%=l,this.$d.months=R(v/c),v%=c,this.$d.days=R(v/u),v%=u,this.$d.hours=R(v/a),v%=a,this.$d.minutes=R(v/r),v%=r,this.$d.seconds=R(v/s),v%=s,this.$d.milliseconds=v},w.toISOString=function(){var v=p(this.$d.years,"Y"),E=p(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var S=p(x,"D"),A=p(this.$d.hours,"H"),$=p(this.$d.minutes,"M"),N=this.$d.seconds||0;this.$d.milliseconds&&(N+=this.$d.milliseconds/1e3,N=Math.round(1e3*N)/1e3);var G=p(N,"S"),ne=v.negative||E.negative||S.negative||A.negative||$.negative||G.negative,le=A.format||$.format||G.format?"T":"",oe=(ne?"-":"")+"P"+v.format+E.format+S.format+le+A.format+$.format+G.format;return oe==="P"||oe==="-P"?"P0D":oe},w.toJSON=function(){return this.toISOString()},w.format=function(v){var E=v||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return E.replace(i,function(S,A){return A||String(x[S])})},w.as=function(v){return this.$ms/m[_(v)]},w.get=function(v){var E=this.$ms,x=_(v);return x==="milliseconds"?E%=1e3:E=x==="weeks"?R(E/m[x]):this.$d[x],E||0},w.add=function(v,E,x){var S;return S=E?v*m[_(E)]:f(v)?v.$ms:y(v,this).$ms,y(this.$ms+S*(x?-1:1),this)},w.subtract=function(v,E){return this.add(v,E,!0)},w.locale=function(v){var E=this.clone();return E.$l=v,E},w.clone=function(){return y(this.$ms,this)},w.humanize=function(v){return o().add(this.$ms,"ms").locale(this.$l).fromNow(!v)},w.valueOf=function(){return this.asMilliseconds()},w.milliseconds=function(){return this.get("milliseconds")},w.asMilliseconds=function(){return this.as("milliseconds")},w.seconds=function(){return this.get("seconds")},w.asSeconds=function(){return this.as("seconds")},w.minutes=function(){return this.get("minutes")},w.asMinutes=function(){return this.as("minutes")},w.hours=function(){return this.get("hours")},w.asHours=function(){return this.as("hours")},w.days=function(){return this.get("days")},w.asDays=function(){return this.as("days")},w.weeks=function(){return this.get("weeks")},w.asWeeks=function(){return this.as("weeks")},w.months=function(){return this.get("months")},w.asMonths=function(){return this.as("months")},w.years=function(){return this.get("years")},w.asYears=function(){return this.as("years")},b}(),L=function(b,w,v){return b.add(w.years()*v,"y").add(w.months()*v,"M").add(w.days()*v,"d").add(w.hours()*v,"h").add(w.minutes()*v,"m").add(w.seconds()*v,"s").add(w.milliseconds()*v,"ms")};return function(b,w,v){o=v,n=v().$utils(),v.duration=function(S,A){var $=v.locale();return y(S,{$l:$},A)},v.isDuration=f;var E=w.prototype.add,x=w.prototype.subtract;w.prototype.add=function(S,A){return f(S)?L(this,S,1):E.bind(this)(S,A)},w.prototype.subtract=function(S,A){return f(S)?L(this,S,-1):x.bind(this)(S,A)}}})}(Ve)),Ve.exports}var Gs=Ks();const Ys=$n(Gs),Js={class:"card rounded-3 border-0 shadow"},Qs={class:"card-header rounded-top-3 border-0 align-items-center d-flex p-3 flex-column flex-sm-row gap-2"},Ws={class:"fw-bold"},Zs={class:"card-body p-3 d-flex gap-3 flex-column"},Xs={class:"mb-1 d-flex align-items-center"},er={class:"fw-bold ms-auto"},tr={class:"progress",role:"progressbar","aria-valuenow":"25","aria-valuemin":"0","aria-valuemax":"100",style:{height:"6px"}},nr={class:"mb-1 d-flex align-items-center"},or={class:"fw-bold ms-auto"},sr={__name:"configuration",props:["config"],emits:["select"],setup(e,{emit:t}){Oe.extend(Ys);const o=e;V(!1);const n=z(()=>o.config.jobs.filter(l=>l.Field==="date").sort((l,c)=>Oe(l.Value).isBefore(c.Value)?-1:Oe(l.Value).isAfter(c.Value)?1:0)),s=z(()=>o.config.jobs.filter(l=>l.Field==="total_data").sort((l,c)=>parseFloat(c.Value)-parseFloat(l.Value))),r=z(()=>{if(n.value.length>0)return n.value[0].Value}),a=z(()=>{if(s.value.length>0)return s.value[0].Value}),u=z(()=>a.value?o.config.data/a.value*100:100);window.dayjs=Oe;const i=t;return(l,c)=>(I(),D("div",Js,[d("div",Qs,[d("small",Ws,Q(o.config.name),1),d("span",{class:ve(["badge rounded-3 ms-sm-auto",[o.config.protocol==="wg"?"wireguardBg":"amneziawgBg"]])},Q(o.config.protocol==="wg"?"WireGuard":"AmneziaWG"),3)]),d("div",Zs,[d("div",null,[d("div",Xs,[c[1]||(c[1]=d("small",{class:"text-muted"},[d("i",{class:"bi bi-bar-chart-fill me-1"}),U(" Data Usage ")],-1)),d("small",er,Q(o.config.data.toFixed(4))+" / "+Q(a.value?parseFloat(a.value).toFixed(4):"Unlimited")+" GB ",1)]),d("div",tr,[d("div",{class:"progress-bar bg-primary",style:oo({width:""+u.value+"%"})},null,4)])]),d("div",null,[d("div",nr,[c[2]||(c[2]=d("small",{class:"text-muted"},[d("i",{class:"bi bi-calendar me-1"}),U(" Valid Until ")],-1)),d("small",or,Q(r.value?r.value:"Unlimited Time"),1)])]),d("button",{class:"btn btn-outline-body rounded-3 flex-grow-1 fw-bold w-100",onClick:c[0]||(c[0]=h=>i("select"))},c[3]||(c[3]=[d("i",{class:"bi bi-link-45deg me-2"},null,-1),d("small",null,"Connect",-1)]))])]))}},rr=De(sr,[["__scopeId","data-v-5e50834a"]]),ir={class:"p-sm-3"},ar={class:"w-100 d-flex align-items-center"},lr={class:"nav-link text-body border-start-0","aria-current":"page",href:"#"},ur={class:"ms-auto px-3 d-flex gap-2 nav-links"},cr={key:0,class:"d-flex flex-column gap-3"},dr={key:0,class:"p-3 d-flex flex-column gap-3"},fr={key:1,class:"text-center text-muted"},mr={key:1,class:"d-flex p-3"},hr={__name:"index",async setup(e){let t,o;const n=me(),s=V(!0),r=z(()=>n.configurations),a=V(void 0);[t,o]=je(()=>n.getClientProfile()),await t,o(),ze(async()=>{await n.getConfigurations(),s.value=!1,a.value=setInterval(async()=>{await n.getConfigurations()},5e3)}),ts(()=>{clearInterval(a.value)});const u=Je(),i=V(!1),l=async()=>{clearInterval(a.value),i.value=!0,await Ue.get(Ke("/api/signout")).then(()=>{u.push("/signin")}).catch(()=>{u.push("/signin")}),n.newNotification("Sign out successful","success")},c=V(void 0);return(h,m)=>{const f=qe("RouterLink");return I(),D("div",ir,[d("div",ar,[d("a",lr,[d("strong",null," Hi, "+Q(X(n).clientProfile.Profile.Name?X(n).clientProfile.Profile.Name:X(n).clientProfile.Email),1)]),d("div",ur,[Y(f,{to:"/settings",class:"text-body btn btn-outline-body rounded-3 ms-auto btn-sm","aria-current":"page",href:"#"},{default:Z(()=>m[2]||(m[2]=[d("i",{class:"bi bi-gear-fill me-sm-2"},null,-1),d("span",null,"Settings",-1)])),_:1,__:[2]}),d("a",{role:"button",onClick:m[0]||(m[0]=y=>l()),class:ve(["btn btn-outline-danger rounded-3 btn-sm",{disabled:i.value}]),"aria-current":"page"},[m[3]||(m[3]=d("i",{class:"bi bi-box-arrow-left me-sm-2"},null,-1)),d("span",null,Q(i.value?"Signing out...":"Sign Out"),1)],2)])]),Y(He,{name:"app",mode:"out-in"},{default:Z(()=>[s.value?(I(),D("div",mr,m[5]||(m[5]=[d("div",{class:"bg-body rounded-3 d-flex",style:{width:"100%",height:"211px"}},[d("div",{class:"spinner-border m-auto"})],-1)]))):(I(),D("div",cr,[r.value.length>0?(I(),D("div",dr,[(I(!0),D(xn,null,An(r.value,y=>(I(),we(rr,{onSelect:_=>c.value=y,config:y},null,8,["onSelect","config"]))),256))])):(I(),D("div",fr,m[4]||(m[4]=[d("small",null,"No configuration available",-1)])))]))]),_:1}),Y(He,{name:"app"},{default:Z(()=>[c.value!==void 0?(I(),we(zs,{key:0,config:c.value.config,protocol:c.value.protocol,onBack:m[1]||(m[1]=y=>c.value=void 0),"qrcode-data":c.value.peer_configuration_data},null,8,["config","protocol","qrcode-data"])):ee("",!0)]),_:1})])}}},pr=De(hr,[["__scopeId","data-v-9bb8c5cf"]]),gr=["href"],vr={__name:"oidcBtn",props:["provider","name"],async setup(e){let t,o;const n=e,s=V(!1),r=V({}),a=new URLSearchParams({client_id:n.provider.client_id,redirect_uri:window.location.protocol+"//"+window.location.host+window.location.pathname,response_type:"code",state:n.name,scope:"openid email profile"}).toString(),u=V(void 0);try{const i=([t,o]=je(()=>Ue(`${n.provider.issuer}/.well-known/openid-configuration`)),t=await t,o(),t);console.log(i),s.value=!0,r.value=i.data,console.log(r.value),u.value=new URL(r.value.authorization_endpoint),u.value.search=a}catch{console.log("Provider not available",n.provider)}return(i,l)=>s.value?(I(),D("a",{key:0,class:"btn btn-sm btn-outline-body rounded-3",href:u.value,style:{flex:"1 1 0px"}},Q(e.name),9,gr)):ee("",!0)}},wr={key:0},yr={class:"d-flex gap-2"},br={__name:"oidc",async setup(e){let t,o;const n=V(!1),s=V(void 0),r=([t,o]=je(()=>Tn("/api/signin/oidc/providers")),t=await t,o(),t);return r&&Object.keys(r.data).length>0&&(n.value=!0,s.value=r.data,console.log(s.value)),(a,u)=>s.value?(I(),D("div",wr,[u[1]||(u[1]=d("hr",null,null,-1)),u[2]||(u[2]=d("h6",{class:"text-center text-muted mb-3"},[d("small",null,"Sign in with")],-1)),d("div",yr,[(I(),we(so,null,{fallback:Z(()=>u[0]||(u[0]=[d("a",{class:"btn btn-sm btn-outline-body rounded-3 w-100 disabled"}," Loading... ",-1)])),default:Z(()=>[(I(!0),D(xn,null,An(s.value,(i,l)=>(I(),we(vr,{provider:i,name:l},null,8,["provider","name"]))),256))]),_:1}))]),u[3]||(u[3]=d("hr",null,null,-1))])):ee("",!0)}},Er={class:"form-floating"},Cr=["disabled"],Pr={class:"form-floating"},_r=["disabled"],Rr={class:"d-flex"},Sr=["disabled"],kr={key:0,class:"d-block"},$r={key:1,class:"d-block"},xr={key:0},Ar={class:"d-flex align-items-center"},Tr={__name:"signInForm",emits:["totpToken"],setup(e,{emit:t}){const o=V(!1),n=Le({Email:"",Password:""}),s=t;V("");const r=me(),a=async l=>{if(l.preventDefault(),!u){r.newNotification("Please fill in all fields","warning");return}o.value=!0;const c=await Se("/api/signin",n);c.status?s("totpToken",c.message):(r.newNotification(c.message,"danger"),o.value=!1)},u=z(()=>Object.values(n).find(l=>!l)===void 0),i=ds();return i.query.Email&&(n.Email=i.query.Email),(l,c)=>{const h=qe("RouterLink");return I(),D("div",null,[c[10]||(c[10]=d("div",{class:"text-center"},[d("h1",{class:"display-4"},"Welcome"),d("p",{class:"text-muted"},[U("Sign in to access your "),d("strong",null,"WGDashboard Client"),U(" account")])],-1)),Y(br),d("form",{class:"mt-4 d-flex flex-column gap-3",onSubmit:c[2]||(c[2]=m=>a(m))},[d("div",Er,[W(d("input",{type:"text",required:"",disabled:o.value,"onUpdate:modelValue":c[0]||(c[0]=m=>n.Email=m),name:"email",autocomplete:"email",autofocus:"",class:"form-control rounded-3 border-0",id:"email",placeholder:"email"},null,8,Cr),[[re,n.Email]]),c[3]||(c[3]=d("label",{for:"email",class:"d-flex"},[d("i",{class:"bi bi-person-circle me-2"}),U(" Email ")],-1))]),d("div",Pr,[W(d("input",{type:"password",required:"",disabled:o.value,"onUpdate:modelValue":c[1]||(c[1]=m=>n.Password=m),name:"password",autocomplete:"current-password",class:"form-control rounded-3 border-0",id:"password",placeholder:"Password"},null,8,_r),[[re,n.Password]]),c[4]||(c[4]=d("label",{for:"password",class:"d-flex"},[d("i",{class:"bi bi-key me-2"}),U(" Password ")],-1))]),d("div",Rr,[Y(h,{to:"forgotPassword",class:"text-body text-decoration-none ms-auto btn btn-sm rounded-3"},{default:Z(()=>c[5]||(c[5]=[U(" Forgot Password? ")])),_:1,__:[5]})]),d("button",{disabled:!u.value||o.value,class:"btn btn-primary rounded-3 btn-body px-3 py-2 fw-bold"},[o.value?(I(),D("span",$r,c[6]||(c[6]=[U(" Loading..."),d("i",{class:"ms-2 spinner-border spinner-border-sm"},null,-1)]))):(I(),D("span",kr," Sign In "))],8,Sr)],32),X(r).serverInformation.SignUp.enable?(I(),D("div",xr,[c[9]||(c[9]=d("hr",{class:"my-4"},null,-1)),d("div",Ar,[c[8]||(c[8]=d("span",{class:"text-muted"}," Don't have an account yet? ",-1)),Y(h,{to:"/signup",class:"text-body text-decoration-none ms-auto fw-bold btn btn-sm btn-outline-body rounded-3"},{default:Z(()=>c[7]||(c[7]=[U(" Sign Up ")])),_:1,__:[7]})])])):ee("",!0)])}}},Br={key:0,class:"card rounded-3 text-center"},Nr={class:"card-body d-flex gap-3 flex-column align-items-center"},Mr={class:"card rounded-3 w-100"},Ir={class:"card-body"},Lr=["href"],Dr={key:0},qr={class:"d-flex flex-column gap-3 text-center"},Ur=["disabled"],Or=["disabled"],Fr={key:0,class:"d-block"},Vr={key:1,class:"d-block"},Hr={__name:"totpForm",props:["totpToken"],emits:["clearToken"],setup(e,{emit:t}){const o=e,n=V(""),s=Le({TOTP:""}),r=V(!0),a=()=>{s.TOTP=s.TOTP.replace(/\D/i,"")},u=z(()=>/^[0-9]{6}$/.test(s.TOTP)),i=me(),l=Je();ze(()=>{Ue.get(Ke("/api/signin/totp"),{params:{Token:o.totpToken}}).then(m=>{let f=m.data;r.value=!1,f.status?f.message&&(n.value=f.message):(i.newNotification(f.message,"danger"),l.push("/signin"))})});const c=t,h=async m=>{if(m&&m.preventDefault(),u){r.value=!0;const f=await Se("/api/signin/totp",{Token:o.totpToken,UserProvidedTOTP:s.TOTP});r.value=!1,f?f.status?(i.clientProfile=f.data,l.push("/")):i.newNotification(f.message,"danger"):(i.newNotification("Sign in status is invalid","danger"),c("clearToken"))}};return Sn(u,()=>{h()}),(m,f)=>(I(),D("form",{class:"d-flex flex-column gap-3",onSubmit:f[3]||(f[3]=y=>h(y))},[d("div",null,[d("a",{role:"button",onClick:f[0]||(f[0]=y=>c("clearToken")),class:"btn btn-outline-body btn-sm rounded-3"},f[4]||(f[4]=[d("i",{class:"me-2 bi bi-chevron-left"},null,-1),U(" Back ")]))]),d("div",null,[f[9]||(f[9]=d("h1",{class:"mb-3 text-center"},"Multi-Factor Authentication (MFA)",-1)),n.value?(I(),D("div",Br,[d("div",Nr,[f[5]||(f[5]=d("h2",{class:"mb-0"},"Initial Setup",-1)),f[6]||(f[6]=d("p",{class:"mb-0"},"Please scan the following QR Code to generate TOTP with your choice of authenticator",-1)),Y($t,{content:n.value},null,8,["content"]),f[7]||(f[7]=d("p",{class:"mb-0"},"Or you can click the link below:",-1)),d("div",Mr,[d("div",Ir,[d("a",{href:n.value,style:{"text-wrap":"auto"}},Q(n.value),9,Lr)])]),f[8]||(f[8]=d("div",{class:"alert alert-warning mb-0 rounded-3"},[d("strong",null," Please note: You won't be able to see this QR Code again, so please save it somewhere safe in case you need to recover your TOTP key ")],-1))])])):ee("",!0)]),n.value?(I(),D("hr",Dr)):ee("",!0),d("div",qr,[f[12]||(f[12]=d("label",{for:"totp"},"Enter the TOTP generated by your authenticator to verify",-1)),W(d("input",{class:"form-control form-control-lg rounded-3 text-center",id:"totp",disabled:r.value,autofocus:"",onKeyup:f[1]||(f[1]=y=>a()),maxlength:"6",type:"text",inputmode:"numeric",placeholder:"- - - - - -",autocomplete:"one-time-code","onUpdate:modelValue":f[2]||(f[2]=y=>s.TOTP=y)},null,40,Ur),[[re,s.TOTP]]),d("button",{disabled:!u.value||r.value,class:"btn btn-body rounded-3 px-3 py-2 fw-bold"},[r.value?(I(),D("span",Vr,f[11]||(f[11]=[U(" Loading... "),d("i",{class:"ms-2 spinner-border spinner-border-sm"},null,-1)]))):(I(),D("span",Fr,f[10]||(f[10]=[U(" Continue "),d("i",{class:"ms-2 bi bi-arrow-right"},null,-1)])))],8,Or)])],32))}},zr=De(Hr,[["__scopeId","data-v-c81aa653"]]),jr={class:"p-3 p-sm-5"},Kr={__name:"signin",setup(e){const t=V("");return(o,n)=>(I(),D("div",jr,[Y(He,{name:"app",mode:"out-in"},{default:Z(()=>[t.value?(I(),we(zr,{key:1,onClearToken:n[1]||(n[1]=s=>t.value=""),"totp-token":t.value},null,8,["totp-token"])):(I(),we(Tr,{key:0,onTotpToken:n[0]||(n[0]=s=>{t.value=s})}))]),_:1})]))}},Gr={class:"p-3 p-sm-5"},Yr={class:"form-floating"},Jr=["disabled"],Qr={class:"row gx-3"},Wr={class:"col-6"},Zr={class:"form-floating"},Xr=["disabled"],ei={class:"col-6"},ti={class:"form-floating"},ni=["disabled"],oi=["disabled"],si={key:0,class:"d-block"},ri={key:1,class:"d-block"},ii={class:"d-flex align-items-center"},ai={__name:"signup",setup(e){const t=me(),o=Le({Email:"",Password:"",ConfirmPassword:""}),n=V(!1),s=Je(),r=async i=>{if(i.preventDefault(),!u){t.newNotification("Please fill in all fields","warning");return}a&&(n.value=!0,await Ue.post(Ke("/api/signup"),o).then(l=>{let c=l.data;c.status?(t.newNotification("Sign up successfully!","success"),s.push({path:"/signin",query:{Email:o.Email}})):(t.newNotification(c.message,"danger"),n.value=!1)}))},a=z(()=>o.Password&&o.ConfirmPassword?o.Password===o.ConfirmPassword:!1),u=z(()=>Object.values(o).find(i=>!i)===void 0);return ze(()=>{document.querySelectorAll("input[type=password]").forEach(i=>i.addEventListener("blur",()=>{o.Password&&o.ConfirmPassword&&document.querySelectorAll("input[type=password]").forEach(l=>{a.value?l.classList.remove("is-invalid"):l.classList.add("is-invalid")})}))}),(i,l)=>{const c=qe("RouterLink");return I(),D("div",Gr,[l[13]||(l[13]=d("div",{class:"text-center"},[d("h1",{class:"display-4"},"Hi, nice to meet you"),d("p",{class:"text-muted"},[U("Sign up to use "),d("strong",null,"WGDashboard Client")])],-1)),d("form",{class:"mt-4 d-flex flex-column gap-3",onSubmit:l[3]||(l[3]=h=>r(h))},[d("div",Yr,[W(d("input",{type:"text",disabled:n.value,required:"","onUpdate:modelValue":l[0]||(l[0]=h=>o.Email=h),name:"email",autocomplete:"email",autofocus:"",class:"form-control rounded-3",id:"email",placeholder:"email"},null,8,Jr),[[re,o.Email]]),l[4]||(l[4]=d("label",{for:"email",class:"d-flex"},[d("i",{class:"bi bi-person-circle me-2"}),U(" Email ")],-1))]),d("div",Qr,[d("div",Wr,[d("div",Zr,[W(d("input",{type:"password",required:"",disabled:n.value,"onUpdate:modelValue":l[1]||(l[1]=h=>o.Password=h),name:"password",autocomplete:"new-password",autofocus:"",class:"form-control rounded-3",id:"password",placeholder:"password"},null,8,Xr),[[re,o.Password]]),l[5]||(l[5]=d("label",{for:"password",class:"d-flex"},[d("i",{class:"bi bi-key me-2"}),U(" Password ")],-1))])]),d("div",ei,[d("div",ti,[W(d("input",{type:"password",required:"",disabled:n.value,"onUpdate:modelValue":l[2]||(l[2]=h=>o.ConfirmPassword=h),name:"confirm_password",autocomplete:"new-password",autofocus:"",class:"form-control rounded-3",id:"confirm_password",placeholder:"confirm_password"},null,8,ni),[[re,o.ConfirmPassword]]),l[6]||(l[6]=d("label",{for:"confirm_password",class:"d-flex"},[d("i",{class:"bi bi-key me-2"}),U(" Confirm Password ")],-1)),l[7]||(l[7]=d("div",{id:"validationServer03Feedback",class:"invalid-feedback"}," Passwords does not match ",-1))])])]),d("button",{disabled:!u.value||!a.value||n.value,class:"btn btn-primary rounded-3 btn-body px-3 py-2 fw-bold"},[n.value?(I(),D("span",ri,l[9]||(l[9]=[U(" Loading... "),d("i",{class:"spinner-border spinner-border-sm"},null,-1)]))):(I(),D("span",si,l[8]||(l[8]=[U(" Continue "),d("i",{class:"ms-2 bi bi-arrow-right"},null,-1)])))],8,oi)],32),d("div",null,[l[12]||(l[12]=d("hr",{class:"my-4"},null,-1)),d("div",ii,[l[11]||(l[11]=d("span",{class:"text-muted"}," Already have an account? ",-1)),Y(c,{to:"/signin",class:"text-body text-decoration-none ms-auto fw-bold btn btn-sm btn-outline-body rounded-3"},{default:Z(()=>l[10]||(l[10]=[U(" Sign In ")])),_:1,__:[10]})])])])}}},li={class:"d-flex align-items-start"},ui={key:0,class:"alert alert-danger rounded-3 mt-3"},ci={class:"row g-2 mb-3"},di={class:"col-sm-12"},fi=["type"],mi={class:"col-sm-6"},hi=["type"],pi={class:"col-sm-6"},gi=["type"],vi={__name:"updatePassword",setup(e){const t=Le({CurrentPassword:"",NewPassword:"",ConfirmNewPassword:""}),o=()=>{t.CurrentPassword="",t.NewPassword="",t.ConfirmNewPassword=""},n=me(),s=async i=>{i.preventDefault(),document.querySelectorAll("#updatePasswordForm input").forEach(c=>c.blur());const l=await Se("/api/settings/updatePassword",t);l?l.status?(a.value=!1,n.newNotification("Password updated!","success"),o()):(a.value=!0,u.value=l.message):(a.value=!0,u.value="Error occurred")},r=V(!1),a=V(!1),u=V("");return(i,l)=>(I(),D("form",{onSubmit:l[4]||(l[4]=c=>s(c)),id:"updatePasswordForm",onReset:l[5]||(l[5]=c=>o()),class:"p-3"},[d("div",li,[l[6]||(l[6]=d("h5",null," Update Password ",-1)),d("a",{role:"button",onClick:l[0]||(l[0]=c=>r.value=!r.value),class:"text-muted ms-auto text-decoration-none"},[d("small",null,[d("i",{class:ve([[r.value?"bi-eye-slash-fill":"bi-eye-fill"],"bi me-2"])},null,2),U(Q(r.value?"Hide":"Show")+" Password ",1)])])]),a.value?(I(),D("div",ui,Q(u.value),1)):ee("",!0),d("div",ci,[d("div",di,[l[7]||(l[7]=d("label",{class:"text-muted form-label",for:"CurrentPassword"},[d("small",null,"Current Password")],-1)),W(d("input",{class:ve(["form-control rounded-3",{"is-invalid":a.value}]),required:"",type:r.value?"text":"password",autocomplete:"current-password",id:"CurrentPassword","onUpdate:modelValue":l[1]||(l[1]=c=>t.CurrentPassword=c)},null,10,fi),[[Ze,t.CurrentPassword]])]),d("div",mi,[l[8]||(l[8]=d("label",{class:"text-muted form-label",for:"NewPassword"},[d("small",null,"New Password")],-1)),W(d("input",{class:ve(["form-control rounded-3",{"is-invalid":a.value}]),required:"",type:r.value?"text":"password",id:"NewPassword",autocomplete:"new-password","onUpdate:modelValue":l[2]||(l[2]=c=>t.NewPassword=c)},null,10,hi),[[Ze,t.NewPassword]])]),d("div",pi,[l[9]||(l[9]=d("label",{class:"text-muted form-label",for:"ConfirmNewPassword"},[d("small",null,"Confirm New Password")],-1)),W(d("input",{class:ve(["form-control rounded-3",{"is-invalid":a.value}]),required:"",type:r.value?"text":"password",id:"ConfirmNewPassword",autocomplete:"new-password","onUpdate:modelValue":l[3]||(l[3]=c=>t.ConfirmNewPassword=c)},null,10,gi),[[Ze,t.ConfirmNewPassword]])])]),l[10]||(l[10]=d("div",{class:"d-flex gap-2"},[d("button",{class:"btn btn-sm btn-secondary rounded-3 ms-auto",type:"reset"},"Clear"),d("button",{class:"btn btn-sm btn-danger rounded-3",type:"submit"},"Update")],-1))],32))}},wi={class:"p-sm-3"},yi={class:"w-100 d-flex align-items-center p-3"},bi={__name:"settings",async setup(e){let t,o;const n=me();return[t,o]=je(()=>n.getClientProfile()),await t,o(),(s,r)=>{const a=qe("RouterLink");return I(),D("div",wi,[d("div",yi,[Y(a,{to:"/",class:"text-body btn btn-outline-body rounded-3 btn-sm","aria-current":"page",href:"#"},{default:Z(()=>r[0]||(r[0]=[d("i",{class:"bi bi-chevron-left me-sm-2"},null,-1),d("span",null,"Back",-1)])),_:1,__:[0]}),r[1]||(r[1]=d("strong",{class:"ms-auto"},"Settings",-1))]),X(n).clientProfile.SignInMethod==="local"?(I(),we(vi,{key:0})):ee("",!0)])}}},Ei={class:"p-3 p-sm-5"},Ci={key:0},Pi={class:"form-floating"},_i=["disabled"],Ri=["disabled"],Si={key:0,class:"d-block"},ki={key:1,class:"d-block"},$i={key:1},xi={class:"text-center"},Ai={key:0,class:"text-muted"},Ti={class:"form-floating"},Bi=["disabled"],Ni=["disabled"],Mi={key:0,class:"d-block"},Ii={key:1,class:"d-block"},Li={key:2},Di={class:"form-floating"},qi=["disabled"],Ui={class:"form-floating"},Oi=["disabled"],Fi=["disabled"],Vi={key:0,class:"d-block"},Hi={key:1,class:"d-block"},zi={class:"d-flex align-items-center"},ji=xt({__name:"forgotPassword",setup(e){const t=V(""),o=V(!1),n=V(!1),s=me(),r=V(void 0),a=V(120),u=async C=>{C&&C.preventDefault(),o.value=!0;const p=await Se("/api/resetPassword/generateResetToken",{Email:t.value});o.value=!1,p.status?(n.value=!0,a.value=120,r.value=setInterval(()=>{a.value--,a.value===0&&clearInterval(r.value)},1e3)):s.newNotification(p.message,"danger")},i=V(""),l=()=>{i.value=i.value.replace(/\D/i,""),i.value=i.value.slice(0,6)},c=z(()=>/^[0-9]{6}$/.test(i.value)),h=V(!1),m=async C=>{C&&C.preventDefault(),o.value=!0;let p=await Se("/api/resetPassword/validateResetToken",{Email:t.value,Token:i.value});o.value=!1,p.status?h.value=!0:s.newNotification("Your verification code is either invalid or expired","danger")},f=V(""),y=V(""),_=z(()=>f.value&&y.value&&f.value===y.value),M=Je(),R=async C=>{C&&C.preventDefault(),o.value=!0,(await Se("/api/resetPassword",{Email:t.value,Token:i.value,Password:f.value,ConfirmPassword:y.value})).status&&(s.newNotification("Password reset! Now you can sign in with your new password","success"),await M.push("/signin"))};return(C,p)=>{const T=qe("RouterLink");return I(),D("div",Ei,[Y(He,{name:"app",mode:"out-in"},{default:Z(()=>[n.value?n.value&&!h.value?(I(),D("div",$i,[d("a",{role:"button",class:"text-decoration-none text-body",onClick:p[2]||(p[2]=L=>{n.value=!1,i.value=""})},p[16]||(p[16]=[d("i",{class:"me-2 bi bi-chevron-left"},null,-1),U(" Back ")])),d("div",xi,[p[17]||(p[17]=d("h1",{class:"display-4"},"Almost there",-1)),p[18]||(p[18]=d("p",{class:"text-muted"},"Enter the code you received below to retrieve a reset your password",-1)),a.value>0?(I(),D("p",Ai,"Didn't get the code? Maybe check your Spam/Junk mailbox. You can get another code in "+Q(a.value)+" seconds.",1)):a.value===0&&!o.value?(I(),D("a",{key:1,role:"button",class:ve({disabled:o.value}),onClick:p[3]||(p[3]=L=>u())},"Resend",2)):ee("",!0)]),d("form",{class:"mt-4 d-flex flex-column gap-3",onSubmit:p[6]||(p[6]=L=>m(L))},[d("div",Ti,[W(d("input",{type:"text",inputmode:"numeric",required:"",disabled:o.value,"onUpdate:modelValue":p[4]||(p[4]=L=>i.value=L),onKeyup:p[5]||(p[5]=L=>l()),autocomplete:"one-time-code",autofocus:"",class:"form-control rounded-3 border-0",id:"token",placeholder:"token"},null,40,Bi),[[re,i.value]]),p[19]||(p[19]=d("label",{for:"email",class:"d-flex"},[d("i",{class:"bi bi-person-circle me-2"}),U(" 6 Digits Verification Code ")],-1))]),d("button",{disabled:!c.value||o.value,type:"submit",class:"btn btn-primary rounded-3 btn-body px-3 py-2 fw-bold"},[o.value?(I(),D("span",Ii,p[21]||(p[21]=[U(" Loading..."),d("i",{class:"ms-2 spinner-border spinner-border-sm"},null,-1)]))):(I(),D("span",Mi,p[20]||(p[20]=[U(" Continue "),d("i",{class:"bi bi-arrow-right ms-2"},null,-1)])))],8,Ni)],32)])):n.value&&h.value?(I(),D("div",Li,[d("a",{role:"button",class:"text-decoration-none text-body",onClick:p[7]||(p[7]=L=>{n.value=!1,i.value="",h.value=!1})},p[22]||(p[22]=[d("i",{class:"me-2 bi bi-chevron-left"},null,-1),U(" Back ")])),p[28]||(p[28]=d("div",{class:"text-center"},[d("h1",{class:"display-4"},"Last step"),d("p",{class:"text-muted"},"Enter your new password below")],-1)),d("form",{class:"mt-4 d-flex flex-column gap-3",onSubmit:p[10]||(p[10]=L=>R(L))},[d("div",Di,[W(d("input",{type:"password",required:"",disabled:o.value,"onUpdate:modelValue":p[8]||(p[8]=L=>f.value=L),name:"password",autocomplete:"new-password",autofocus:"",class:"form-control rounded-3",id:"password",placeholder:"password"},null,8,qi),[[re,f.value]]),p[23]||(p[23]=d("label",{for:"password",class:"d-flex"},[d("i",{class:"bi bi-key me-2"}),U(" Password ")],-1))]),d("div",Ui,[W(d("input",{type:"password",required:"",disabled:o.value,"onUpdate:modelValue":p[9]||(p[9]=L=>y.value=L),name:"confirm_password",autocomplete:"new-password",autofocus:"",class:"form-control rounded-3",id:"confirm_password",placeholder:"confirm_password"},null,8,Oi),[[re,y.value]]),p[24]||(p[24]=d("label",{for:"confirm_password",class:"d-flex"},[d("i",{class:"bi bi-key me-2"}),U(" Confirm Password ")],-1)),p[25]||(p[25]=d("div",{id:"validationServer03Feedback",class:"invalid-feedback"}," Passwords does not match ",-1))]),d("button",{disabled:!_.value||o.value,type:"submit",class:"btn btn-primary rounded-3 btn-body px-3 py-2 fw-bold"},[o.value?(I(),D("span",Hi,p[27]||(p[27]=[U(" Loading..."),d("i",{class:"ms-2 spinner-border spinner-border-sm"},null,-1)]))):(I(),D("span",Vi,p[26]||(p[26]=[U(" Continue "),d("i",{class:"bi bi-arrow-right ms-2"},null,-1)])))],8,Fi)],32)])):ee("",!0):(I(),D("div",Ci,[Y(T,{to:"signin",role:"button",class:"btn btn-outline-body btn-sm rounded-3"},{default:Z(()=>p[11]||(p[11]=[d("i",{class:"me-2 bi bi-chevron-left"},null,-1),U(" Back ")])),_:1,__:[11]}),p[15]||(p[15]=d("div",{class:"text-center"},[d("h1",{class:"display-4"},"No worries"),d("p",{class:"text-muted"},[U("Enter the email address of your "),d("strong",null,"WGDashboard Client"),U(" account below to receive a verification code")])],-1)),d("form",{class:"mt-4 d-flex flex-column gap-3",onSubmit:p[1]||(p[1]=L=>u(L))},[d("div",Pi,[W(d("input",{type:"text",required:"",disabled:o.value,"onUpdate:modelValue":p[0]||(p[0]=L=>t.value=L),name:"email",autocomplete:"email",autofocus:"",class:"form-control rounded-3 border-0",id:"email",placeholder:"email"},null,8,_i),[[re,t.value]]),p[12]||(p[12]=d("label",{for:"email",class:"d-flex"},[d("i",{class:"bi bi-person-circle me-2"}),U(" Email ")],-1))]),d("button",{disabled:!t.value||o.value,type:"submit",class:"btn btn-primary rounded-3 btn-body px-3 py-2 fw-bold"},[o.value?(I(),D("span",ki,p[14]||(p[14]=[U(" Loading..."),d("i",{class:"ms-2 spinner-border spinner-border-sm"},null,-1)]))):(I(),D("span",Si,p[13]||(p[13]=[U(" Continue "),d("i",{class:"bi bi-arrow-right ms-2"},null,-1)])))],8,Ri)],32)]))]),_:1}),d("div",null,[p[31]||(p[31]=d("hr",{class:"my-4"},null,-1)),d("div",zi,[p[30]||(p[30]=d("span",{class:"text-muted"}," Don't have an account yet? ",-1)),Y(T,{to:"/signup",class:"text-body text-decoration-none ms-auto fw-bold btn btn-sm btn-outline-body rounded-3"},{default:Z(()=>p[29]||(p[29]=[U(" Sign Up ")])),_:1,__:[29]})])])])}}}),Jn=us({history:Do(),routes:[{path:"/",component:pr,meta:{auth:!0},name:"Home"},{path:"/settings",component:bi,meta:{auth:!0},name:"Settings"},{path:"/signin",component:Kr,name:"Sign In"},{path:"/signup",component:ai,name:"Sign Up"},{path:"/signout",name:"Sign Out"},{path:"/forgotPassword",name:"Forgot Password",component:ji}]});Jn.beforeEach(async(e,t,o)=>{const n=me();e.path==="/signup"&&!n.serverInformation.SignUp.enable&&(o("/signin"),n.newNotification("Sign up is disabled. Please contact administrator for more information","warning")),e.path==="/signout"?(await Ue.get(Ke("/api/signout")).then(()=>{o("/signin")}).catch(()=>{o("/signin")}),n.newNotification("Sign in session ended, please sign in again","warning")):e.meta.auth?await Tn("/api/validateAuthentication")?o():(n.newNotification("Sign in session ended, please sign in again","warning"),o("/signin")):o()});Jn.afterEach((e,t,o)=>{document.title=e.name+" | WGDashboard Client"});export{Jn as default};