80 lines
1.1 MiB
JavaScript
Raw Normal View History

2024-10-31 22:13:44 +08:00
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();var sx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VM(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function WM(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}),n}var zM={exports:{}},ri="top",Mi="bottom",Ii="right",oi="left",ef="auto",Kl=[ri,Mi,Ii,oi],aa="start",gl="end",rx="clippingParents",Ym="viewport",Ua="popper",ox="reference",Dp=Kl.reduce(function(t,e){return t.concat([e+"-"+aa,e+"-"+gl])},[]),Hm=[].concat(Kl,[ef]).reduce(function(t,e){return t.concat([e,e+"-"+aa,e+"-"+gl])},[]),ax="beforeRead",lx="read",cx="afterRead",ux="beforeMain",dx="main",hx="afterMain",fx="beforeWrite",gx="write",px="afterWrite",mx=[ax,lx,cx,ux,dx,hx,fx,gx,px];function Ns(t){return t?(t.nodeName||"").toLowerCase():null}function Di(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function la(t){var e=Di(t).Element;return t instanceof e||t instanceof Element}function Yi(t){var e=Di(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function jm(t){if(typeof ShadowRoot>"u")return!1;var e=Di(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function YM(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},s=e.attributes[n]||{},r=e.elements[n];!Yi(r)||!Ns(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function HM(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],r=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Yi(s)||!Ns(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const Km={name:"applyStyles",enabled:!0,phase:"write",fn:YM,effect:HM,requires:["computeStyles"]};function Rs(t){return t.split("-")[0]}var ea=Math.max,gh=Math.min,pl=Math.round;function Rp(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _x(){return!/^((?!chrome|android).)*safari/i.test(Rp())}function ml(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),s=1,r=1;e&&Yi(t)&&(s=t.offsetWidth>0&&pl(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&pl(i.height)/t.offsetHeight||1);var o=la(t)?Di(t):window,a=o.visualViewport,l=!_x()&&n,c=(i.left+(l&&a?a.offsetLeft:0))/s,u=(i.top+(l&&a?a.offsetTop:0))/r,d=i.width/s,f=i.height/r;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Um(t){var e=ml(t),n=t.offsetWidth,i=
2024-10-04 16:58:47 +08:00
* Bootstrap v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2024-10-31 22:13:44 +08:00
*/(function(t,e){(function(n,i){t.exports=i(II)})(sx,function(n){function i(G){const _=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(G){for(const M in G)if(M!=="default"){const q=Object.getOwnPropertyDescriptor(G,M);Object.defineProperty(_,M,q.get?q:{enumerable:!0,get:()=>G[M]})}}return _.default=G,Object.freeze(_)}const s=i(n),r=new Map,o={set(G,_,M){r.has(G)||r.set(G,new Map);const q=r.get(G);if(!q.has(_)&&q.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(q.keys())[0]}.`);return}q.set(_,M)},get(G,_){return r.has(G)&&r.get(G).get(_)||null},remove(G,_){if(!r.has(G))return;const M=r.get(G);M.delete(_),M.size===0&&r.delete(G)}},a=1e6,l=1e3,c="transitionend",u=G=>(G&&window.CSS&&window.CSS.escape&&(G=G.replace(/#([^\s"#']+)/g,(_,M)=>`#${CSS.escape(M)}`)),G),d=G=>G==null?`${G}`:Object.prototype.toString.call(G).match(/\s([a-z]+)/i)[1].toLowerCase(),f=G=>{do G+=Math.floor(Math.random()*a);while(document.getElementById(G));return G},g=G=>{if(!G)return 0;let{transitionDuration:_,transitionDelay:M}=window.getComputedStyle(G);const q=Number.parseFloat(_),ye=Number.parseFloat(M);return!q&&!ye?0:(_=_.split(",")[0],M=M.split(",")[0],(Number.parseFloat(_)+Number.parseFloat(M))*l)},p=G=>{G.dispatchEvent(new Event(c))},m=G=>!G||typeof G!="object"?!1:(typeof G.jquery<"u"&&(G=G[0]),typeof G.nodeType<"u"),v=G=>m(G)?G.jquery?G[0]:G:typeof G=="string"&&G.length>0?document.querySelector(u(G)):null,y=G=>{if(!m(G)||G.getClientRects().length===0)return!1;const _=getComputedStyle(G).getPropertyValue("visibility")==="visible",M=G.closest("details:not([open])");if(!M)return _;if(M!==G){const q=G.closest("summary");if(q&&q.parentNode!==M||q===null)return!1}return _},x=G=>!G||G.nodeType!==Node.ELEMENT_NODE||G.classList.contains("disabled")?!0:typeof G.disabled<"u"?G.disabled:G.hasAttribute("disabled")&&G.getAttribute("disabled")!=="false",E=G=>{if(!document.documentElement.attachShadow)return null;if(typeof G.getRootNode=="function"){const _=G.getRootNode();return _ instanceof ShadowRoot?_:null}return G instanceof ShadowRoot?G:G.parentNode?E(G.parentNode):null},w=()=>{},b=G=>{G.offsetHeight},C=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,k=[],T=G=>{document.readyState==="loading"?(k.length||document.addEventListener("DOMContentLoaded",()=>{for(const _ of k)_()}),k.push(G)):G()},A=()=>document.documentElement.dir==="rtl",I=G=>{T(()=>{const _=C();if(_){const M=G.NAME,q=_.fn[M];_.fn[M]=G.jQueryInterface,_.fn[M].Constructor=G,_.fn[M].noConflict=()=>(_.fn[M]=q,G.jQueryInterface)}})},V=(G,_=[],M=G)=>typeof G=="function"?G(..._):M,Y=(G,_,M=!0)=>{if(!M){V(G);return}const ye=g(_)+5;let Oe=!1;const $e=({target:rt})=>{rt===_&&(Oe=!0,_.removeEventListener(c,$e),V(G))};_.addEventListener(c,$e),setTimeout(()=>{Oe||p(_)},ye)},ne=(G,_,M,q)=>{const ye=G.length;let Oe=G.indexOf(_);return Oe===-1?!M&&q?G[ye-1]:G[0]:(Oe+=M?1:-1,q&&(Oe=(Oe+ye)%ye),G[Math.max(0,Math.min(Oe,ye-1))])},N=/[^.]*(?=\..*)\.|.*/,B=/\..*/,R=/::\d+$/,W={};let X=1;const J={mouseenter:"mouseover",mouseleave:"mouseout"},H=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ce(G,_){return _&&`${_}::${X++}`||G.uidEvent||X++}function ie(G){const _=ce(G);return G.uidEvent=_,W[_]=W[_]||{},W[_]}function te(G,_){return function M(q){return fe(q,{delegateTarget:G}),M.oneOff&&z.off(G,q.type,_),_.apply(G,[q])}}function D(G,_,M){return function q(ye){const Oe=G.querySelectorAll(_);for(let{target:$e}=ye;$e&&$e!==this;$e=$e.parentNode)for(const rt of Oe)if(rt===$e)return fe(ye,{delegateT
2024-10-04 16:58:47 +08:00
* @vue/shared v3.5.11
2024-06-18 03:16:42 +08:00
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
2024-10-31 22:13:44 +08:00
**//*! #__NO_SIDE_EFFECTS__ */function t_(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Mt={},rl=[],$s=()=>{},DI=()=>!1,sf=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),n_=t=>t.startsWith("onUpdate:"),vn=Object.assign,i_=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},RI=Object.prototype.hasOwnProperty,xt=(t,e)=>RI.call(t,e),Ke=Array.isArray,ol=t=>Lu(t)==="[object Map]",Ul=t=>Lu(t)==="[object Set]",Gy=t=>Lu(t)==="[object Date]",Je=t=>typeof t=="function",Kt=t=>typeof t=="string",Fs=t=>typeof t=="symbol",It=t=>t!==null&&typeof t=="object",Px=t=>(It(t)||Je(t))&&Je(t.then)&&Je(t.catch),Mx=Object.prototype.toString,Lu=t=>Mx.call(t),$I=t=>Lu(t).slice(8,-1),Ix=t=>Lu(t)==="[object Object]",s_=t=>Kt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Lc=t_(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),rf=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},LI=/-(\w)/g,Ui=rf(t=>t.replace(LI,(e,n)=>n?n.toUpperCase():"")),OI=/\B([A-Z])/g,go=rf(t=>t.replace(OI,"-$1").toLowerCase()),of=rf(t=>t.charAt(0).toUpperCase()+t.slice(1)),vg=rf(t=>t?`on${of(t)}`:""),so=(t,e)=>!Object.is(t,e),nh=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},Dx=(t,e,n,i=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},ph=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Rx=t=>{const e=Kt(t)?Number(t):NaN;return isNaN(e)?t:e};let Xy;const $x=()=>Xy||(Xy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mn(t){if(Ke(t)){const e={};for(let n=0;n<t.length;n++){const i=t[n],s=Kt(i)?VI(i):Mn(i);if(s)for(const r in s)e[r]=s[r]}return e}else if(Kt(t)||It(t))return t}const NI=/;(?![^(]*\))/g,FI=/:([^]+)/,BI=/\/\*[^]*?\*\//g;function VI(t){const e={};return t.replace(BI,"").split(NI).forEach(n=>{if(n){const i=n.split(FI);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Ee(t){let e="";if(Kt(t))e=t;else if(Ke(t))for(let n=0;n<t.length;n++){const i=Ee(t[n]);i&&(e+=i+" ")}else if(It(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function In(t){if(!t)return null;let{class:e,style:n}=t;return e&&!Kt(e)&&(t.class=Ee(e)),n&&(t.style=Mn(n)),t}const WI="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",zI=t_(WI);function Lx(t){return!!t||t===""}function YI(t,e){if(t.length!==e.length)return!1;let n=!0;for(let i=0;n&&i<t.length;i++)n=ca(t[i],e[i]);return n}function ca(t,e){if(t===e)return!0;let n=Gy(t),i=Gy(e);if(n||i)return n&&i?t.getTime()===e.getTime():!1;if(n=Fs(t),i=Fs(e),n||i)return t===e;if(n=Ke(t),i=Ke(e),n||i)return n&&i?YI(t,e):!1;if(n=It(t),i=It(e),n||i){if(!n||!i)return!1;const s=Object.keys(t).length,r=Object.keys(e).length;if(s!==r)return!1;for(const o in t){const a=t.hasOwnProperty(o),l=e.hasOwnProperty(o);if(a&&!l||!a&&l||!ca(t[o],e[o]))return!1}}return String(t)===String(e)}function r_(t,e){return t.findIndex(n=>ca(n,e))}const Ox=t=>!!(t&&t.__v_isRef===!0),pe=t=>Kt(t)?t:t==null?"":Ke(t)||It(t)&&(t.toString===Mx||!Je(t.toString))?Ox(t)?pe(t.value):JSON.stringify(t,Nx,2):String(t),Nx=(t,e)=>Ox(e)?Nx(t,e.value):ol(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,s],r)=>(n[yg(i,r)+" =>"]=s,n),{})}:Ul(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>yg(n))}:Fs(e)?yg(e):It(e)&&!Ke(e)&&!Ix(e)?String(e):e,yg=(t,e="")=>{var n;return Fs(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
2024-10-04 16:58:47 +08:00
* @vue/reactivity v3.5.11
2024-06-18 03:16:42 +08:00
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
2024-10-31 22:13:44 +08:00
**/let ei;class Fx{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ei,!e&&ei&&(this.index=(ei.scopes||(ei.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=ei;try{return ei=this,e()}finally{ei=n}}}on(){ei=this}off(){ei=this.parent}stop(e){if(this._active){let n,i;for(n=0,i=this.effects.length;n<i;n++)this.effects[n].stop();for(n=0,i=this.cleanups.length;n<i;n++)this.cleanups[n]();if(this.scopes)for(n=0,i=this.scopes.length;n<i;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!e){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0,this._active=!1}}}function Bx(t){return new Fx(t)}function af(){return ei}function o_(t,e=!1){ei&&ei.cleanups.push(t)}let Rt;const bg=new WeakSet;class Vx{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ei&&ei.active&&ei.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,bg.has(this)&&(bg.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||zx(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,qy(this),Yx(this);const e=Rt,n=us;Rt=this,us=!0;try{return this.fn()}finally{Hx(this),Rt=e,us=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)c_(e);this.deps=this.depsTail=void 0,qy(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?bg.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Lp(this)&&this.run()}get dirty(){return Lp(this)}}let Wx=0,Oc,Nc;function zx(t,e=!1){if(t.flags|=8,e){t.next=Nc,Nc=t;return}t.next=Oc,Oc=t}function a_(){Wx++}function l_(){if(--Wx>0)return;if(Nc){let e=Nc;for(Nc=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Oc;){let e=Oc;for(Oc=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function Yx(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Hx(t){let e,n=t.depsTail,i=n;for(;i;){const s=i.prevDep;i.version===-1?(i===n&&(n=s),c_(i),HI(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}t.deps=e,t.depsTail=n}function Lp(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(jx(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function jx(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Qc))return;t.globalVersion=Qc;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!Lp(t)){t.flags&=-3;return}const n=Rt,i=us;Rt=t,us=!0;try{Yx(t);const s=t.fn(t._value);(e.version===0||so(s,t._value))&&(t._value=s,e.version++)}catch(s){throw e.version++,s}finally{Rt=n,us=i,Hx(t),t.flags&=-3}}function c_(t,e=!1){const{dep:n,prevSub:i,nextSub:s}=t;if(i&&(i.nextSub=s,t.prevSub=void 0),s&&(s.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i),!n.subs&&n.computed){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)c_(r,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function HI(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let us=!0;const Kx=[];function po(){Kx.push(us),us=!1}function mo(){const t=Kx.pop();us=t===void 0?!0:t}function qy(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Rt;Rt=void 0;try{e()}finally{Rt=n}}}let Qc=0;class jI{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class u_{constructor(e){this.compute
2024-10-04 16:58:47 +08:00
* @vue/runtime-core v3.5.11
2024-06-18 03:16:42 +08:00
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
2024-10-31 22:13:44 +08:00
**/function Nu(t,e,n,i){try{return i?t(...i):t()}catch(s){Fu(s,e,n)}}function fs(t,e,n,i){if(Je(t)){const s=Nu(t,e,n,i);return s&&Px(s)&&s.catch(r=>{Fu(r,e,n)}),s}if(Ke(t)){const s=[];for(let r=0;r<t.length;r++)s.push(fs(t[r],e,n,i));return s}}function Fu(t,e,n,i=!0){const s=e?e.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||Mt;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](t,l,c)===!1)return}a=a.parent}if(r){po(),Nu(r,null,10,[t,l,c]),mo();return}}wD(t,n,s,i,o)}function wD(t,e,n,i=!0,s=!1){if(s)throw t;console.error(t)}const ti=[];let ws=-1;const al=[];let Vr=null,Ga=0;const rE=Promise.resolve();let vh=null;function Rn(t){const e=vh||rE;return t?e.then(this?t.bind(this):t):e}function xD(t){let e=ws+1,n=ti.length;for(;e<n;){const i=e+n>>>1,s=ti[i],r=nu(s);r<t||r===t&&s.flags&2?e=i+1:n=i}return e}function p_(t){if(!(t.flags&1)){const e=nu(t),n=ti[ti.length-1];!n||!(t.flags&2)&&e>=nu(n)?ti.push(t):ti.splice(xD(e),0,t),t.flags|=1,oE()}}function oE(){vh||(vh=rE.then(lE))}function Np(t){Ke(t)?al.push(...t):Vr&&t.id===-1?Vr.splice(Ga+1,0,t):t.flags&1||(al.push(t),t.flags|=1),oE()}function nb(t,e,n=ws+1){for(;n<ti.length;n++){const i=ti[n];if(i&&i.flags&2){if(t&&i.id!==t.uid)continue;ti.splice(n,1),n--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function aE(t){if(al.length){const e=[...new Set(al)].sort((n,i)=>nu(n)-nu(i));if(al.length=0,Vr){Vr.push(...e);return}for(Vr=e,Ga=0;Ga<Vr.length;Ga++){const n=Vr[Ga];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Vr=null,Ga=0}}const nu=t=>t.id==null?t.flags&2?-1:1/0:t.id;function lE(t){try{for(ws=0;ws<ti.length;ws++){const e=ti[ws];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Nu(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ws<ti.length;ws++){const e=ti[ws];e&&(e.flags&=-2)}ws=-1,ti.length=0,aE(),vh=null,(ti.length||al.length)&&lE()}}let wn=null,cE=null;function yh(t){const e=wn;return wn=t,cE=t&&t.type.__scopeId||null,e}function Pe(t,e=wn,n){if(!e||t._n)return t;const i=(...s)=>{i._d&&pb(-1);const r=yh(e);let o;try{o=t(...s)}finally{yh(r),i._d&&pb(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Re(t,e){if(wn===null)return t;const n=_f(wn),i=t.dirs||(t.dirs=[]);for(let s=0;s<e.length;s++){let[r,o,a,l=Mt]=e[s];r&&(Je(r)&&(r={mounted:r,updated:r}),r.deep&&rr(o),i.push({dir:r,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return t}function Ro(t,e,n,i){const s=t.dirs,r=e&&e.dirs;for(let o=0;o<s.length;o++){const a=s[o];r&&(a.oldValue=r[o].value);let l=a.dir[i];l&&(po(),fs(l,n,8,[t.el,a,t,e]),mo())}}const uE=Symbol("_vte"),dE=t=>t.__isTeleport,Fc=t=>t&&(t.disabled||t.disabled===""),ED=t=>t&&(t.defer||t.defer===""),ib=t=>typeof SVGElement<"u"&&t instanceof SVGElement,sb=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Fp=(t,e)=>{const n=t&&t.to;return Kt(n)?e?e(n):null:n},CD={name:"Teleport",__isTeleport:!0,process(t,e,n,i,s,r,o,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:g,querySelector:p,createText:m,createComment:v}}=c,y=Fc(e.props);let{shapeFlag:x,children:E,dynamicChildren:w}=e;if(t==null){const b=e.el=m(""),C=e.anchor=m("");g(b,n,i),g(C,n,i);const k=(A,I)=>{x&16&&(s&&s.isCE&&(s.ce._teleportTarget=A),u(E,A,I,s,r,o,a,l))},T=()=>{const A=e.target=Fp(e.props,p),I=hE(A,e,m,g);A&&(o!=="svg"&&ib(A)?o="svg":o!=="mathml"&&sb(A)&&(o="mathml"),y||(k(A,I),ih(e)))};y&&(k(n,C),ih(e)),ED(e.props)?fi(T,r):T()}else{e.el=t.el,e.targetStart=t.targetStart;const b=e.anchor=t.anchor,C=e.target=t.target,k=e.targetAnchor=t.targetAnchor,T=Fc(t.props),A=T?n:C,I=T?b:k;if(o==="svg"||ib(C)?o="svg":(o==="mathml"||sb(C))&&(o="mathml"),w?(f(t.dynamicChildren,w,A,s,r,o,a),y_(t,e,!0)):l||d(t,e,A,I,s,r,o,a,!1),y)T?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):xd(e,n,b,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const V=e.target=Fp(e.props,p);V&&xd(e,V,null,c,0)}else T&&xd(e,C,k,c,1);ih(e)}},remove(t,e,n,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:
2024-10-04 16:58:47 +08:00
* @vue/runtime-dom v3.5.11
2024-06-18 03:16:42 +08:00
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
2024-10-31 22:13:44 +08:00
**/let Gp;const vb=typeof window<"u"&&window.trustedTypes;if(vb)try{Gp=vb.createPolicy("vue",{createHTML:t=>t})}catch{}const JE=Gp?t=>Gp.createHTML(t):t=>t,AR="http://www.w3.org/2000/svg",PR="http://www.w3.org/1998/Math/MathML",tr=typeof document<"u"?document:null,yb=tr&&tr.createElement("template"),MR={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const s=e==="svg"?tr.createElementNS(AR,t):e==="mathml"?tr.createElementNS(PR,t):n?tr.createElement(t,{is:n}):tr.createElement(t);return t==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:t=>tr.createTextNode(t),createComment:t=>tr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>tr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,s,r){const o=n?n.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),n),!(s===r||!(s=s.nextSibling)););else{yb.innerHTML=JE(i==="svg"?`<svg>${t}</svg>`:i==="mathml"?`<math>${t}</math>`:t);const a=yb.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Tr="transition",oc="animation",wl=Symbol("_vtc"),QE={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},eC=vn({},gE,QE),IR=t=>(t.displayName="Transition",t.props=eC,t),vt=IR((t,{slots:e})=>ha(AD,tC(t),e)),Lo=(t,e=[])=>{Ke(t)?t.forEach(n=>n(...e)):t&&t(...e)},bb=t=>t?Ke(t)?t.some(e=>e.length>1):t.length>1:!1;function tC(t){const e={};for(const Y in t)Y in QE||(e[Y]=t[Y]);if(t.css===!1)return e;const{name:n="v",type:i,duration:s,enterFromClass:r=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=t,p=DR(s),m=p&&p[0],v=p&&p[1],{onBeforeEnter:y,onEnter:x,onEnterCancelled:E,onLeave:w,onLeaveCancelled:b,onBeforeAppear:C=y,onAppear:k=x,onAppearCancelled:T=E}=e,A=(Y,ne,N)=>{Or(Y,ne?u:a),Or(Y,ne?c:o),N&&N()},I=(Y,ne)=>{Y._isLeaving=!1,Or(Y,d),Or(Y,g),Or(Y,f),ne&&ne()},V=Y=>(ne,N)=>{const B=Y?k:x,R=()=>A(ne,Y,N);Lo(B,[ne,R]),wb(()=>{Or(ne,Y?l:r),qs(ne,Y?u:a),bb(B)||xb(ne,i,m,R)})};return vn(e,{onBeforeEnter(Y){Lo(y,[Y]),qs(Y,r),qs(Y,o)},onBeforeAppear(Y){Lo(C,[Y]),qs(Y,l),qs(Y,c)},onEnter:V(!1),onAppear:V(!0),onLeave(Y,ne){Y._isLeaving=!0;const N=()=>I(Y,ne);qs(Y,d),qs(Y,f),iC(),wb(()=>{Y._isLeaving&&(Or(Y,d),qs(Y,g),bb(w)||xb(Y,i,v,N))}),Lo(w,[Y,N])},onEnterCancelled(Y){A(Y,!1),Lo(E,[Y])},onAppearCancelled(Y){A(Y,!0),Lo(T,[Y])},onLeaveCancelled(Y){I(Y),Lo(b,[Y])}})}function DR(t){if(t==null)return null;if(It(t))return[Tg(t.enter),Tg(t.leave)];{const e=Tg(t);return[e,e]}}function Tg(t){return Rx(t)}function qs(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[wl]||(t[wl]=new Set)).add(e)}function Or(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.remove(i));const n=t[wl];n&&(n.delete(e),n.size||(t[wl]=void 0))}function wb(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let RR=0;function xb(t,e,n,i){const s=t._endId=++RR,r=()=>{s===t._endId&&i()};if(n!=null)return setTimeout(r,n);const{type:o,timeout:a,propCount:l}=nC(t,e);if(!o)return i();const c=o+"end";let u=0;const d=()=>{t.removeEventListener(c,f),r()},f=g=>{g.target===t&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),t.addEventListener(c,f)}function nC(t,e){const n=window.getComputedStyle(t),i=p=>(n[p]||"").split(", "),s=i(`${Tr}Delay`),r=i(`${Tr}Duration`),o=Eb(s,r),a=i(`${oc}Delay`),l=i(`${oc}Duration`),c=Eb(a,l);let u=null,d=0,f=0;e===Tr?o>0&&(u=Tr,d=o,f=r.length
2024-10-04 16:58:47 +08:00
* pinia v2.2.4
* (c) 2024 Eduardo San Martin Morote
* @license MIT
2024-10-31 22:13:44 +08:00
*/let fC;const vf=t=>fC=t,gC=Symbol();function qp(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Wc;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Wc||(Wc={}));function u$(){const t=Bx(!0),e=t.run(()=>me({}));let n=[],i=[];const s=uf({install(r){vf(s),s._a=r,r.provide(gC,s),r.config.globalProperties.$pinia=s,i.forEach(o=>n.push(o)),i=[]},use(r){return!this._a&&!c$?i.push(r):n.push(r),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return s}const pC=()=>{};function Bb(t,e,n,i=pC){t.push(e);const s=()=>{const r=t.indexOf(e);r>-1&&(t.splice(r,1),i())};return!n&&af()&&o_(s),s}function Ra(t,...e){t.slice().forEach(n=>{n(...e)})}const d$=t=>t(),Vb=Symbol(),Mg=Symbol();function Zp(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,i)=>t.set(i,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n],s=t[n];qp(s)&&qp(i)&&t.hasOwnProperty(n)&&!Ht(i)&&!Qr(i)?t[n]=Zp(s,i):t[n]=i}return t}const h$=Symbol();function f$(t){return!qp(t)||!t.hasOwnProperty(h$)}const{assign:Nr}=Object;function g$(t){return!!(Ht(t)&&t.effect)}function p$(t,e,n,i){const{state:s,actions:r,getters:o}=e,a=n.state.value[t];let l;function c(){a||(n.state.value[t]=s?s():{});const u=gD(n.state.value[t]);return Nr(u,r,Object.keys(o||{}).reduce((d,f)=>(d[f]=uf(ve(()=>{vf(n);const g=n._s.get(t);return o[f].call(g,g)})),d),{}))}return l=mC(t,c,e,n,i,!0),l}function mC(t,e,n={},i,s,r){let o;const a=Nr({actions:{}},n),l={deep:!0};let c,u,d=[],f=[],g;const p=i.state.value[t];!r&&!p&&(i.state.value[t]={}),me({});let m;function v(T){let A;c=u=!1,typeof T=="function"?(T(i.state.value[t]),A={type:Wc.patchFunction,storeId:t,events:g}):(Zp(i.state.value[t],T),A={type:Wc.patchObject,payload:T,storeId:t,events:g});const I=m=Symbol();Rn().then(()=>{m===I&&(c=!0)}),u=!0,Ra(d,A,i.state.value[t])}const y=r?function(){const{state:A}=n,I=A?A():{};this.$patch(V=>{Nr(V,I)})}:pC;function x(){o.stop(),d=[],f=[],i._s.delete(t)}const E=(T,A="")=>{if(Vb in T)return T[Mg]=A,T;const I=function(){vf(i);const V=Array.from(arguments),Y=[],ne=[];function N(W){Y.push(W)}function B(W){ne.push(W)}Ra(f,{args:V,name:I[Mg],store:b,after:N,onError:B});let R;try{R=T.apply(this&&this.$id===t?this:b,V)}catch(W){throw Ra(ne,W),W}return R instanceof Promise?R.then(W=>(Ra(Y,W),W)).catch(W=>(Ra(ne,W),Promise.reject(W))):(Ra(Y,R),R)};return I[Vb]=!0,I[Mg]=A,I},w={_p:i,$id:t,$onAction:Bb.bind(null,f),$patch:v,$reset:y,$subscribe(T,A={}){const I=Bb(d,T,A.detached,()=>V()),V=o.run(()=>jt(()=>i.state.value[t],Y=>{(A.flush==="sync"?u:c)&&T({storeId:t,type:Wc.direct,events:g},Y)},Nr({},l,A)));return I},$dispose:x},b=Ei(w);i._s.set(t,b);const k=(i._a&&i._a.runWithContext||d$)(()=>i._e.run(()=>(o=Bx()).run(()=>e({action:E}))));for(const T in k){const A=k[T];if(Ht(A)&&!g$(A)||Qr(A))r||(p&&f$(A)&&(Ht(A)?A.value=p[T]:Zp(A,p[T])),i.state.value[t][T]=A);else if(typeof A=="function"){const I=E(A,T);k[T]=I,a.actions[T]=A}}return Nr(b,k),Nr(lt(b),k),Object.defineProperty(b,"$state",{get:()=>i.state.value[t],set:T=>{v(A=>{Nr(A,T)})}}),i._p.forEach(T=>{Nr(b,o.run(()=>T({store:b,app:i._a,pinia:i,options:a})))}),p&&r&&n.hydrate&&n.hydrate(b.$state,p),c=!0,u=!0,b}function _C(t,e,n){let i,s;const r=typeof e=="function";typeof t=="string"?(i=t,s=r?n:e):(s=t,i=t.id);function o(a,l){const c=jD();return a=a||(c?ji(gC,null):null),a&&vf(a),a=fC,a._s.has(i)||(r?mC(i,e,s,a):p$(i,s,a)),a._s.get(i)}return o.$id=i,o}/*!
2024-10-04 16:58:47 +08:00
* vue-router v4.4.5
* (c) 2024 Eduardo San Martin Morote
* @license MIT
2024-10-31 22:13:44 +08:00
*/const Xa=typeof document<"u";function vC(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function m$(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&vC(t.default)}const kt=Object.assign;function Ig(t,e){const n={};for(const i in e){const s=e[i];n[i]=gs(s)?s.map(t):t(s)}return n}const zc=()=>{},gs=Array.isArray,yC=/#/g,_$=/&/g,v$=/\//g,y$=/=/g,b$=/\?/g,bC=/\+/g,w$=/%5B/g,x$=/%5D/g,wC=/%5E/g,E$=/%60/g,xC=/%7B/g,C$=/%7C/g,EC=/%7D/g,S$=/%20/g;function C_(t){return encodeURI(""+t).replace(C$,"|").replace(w$,"[").replace(x$,"]")}function k$(t){return C_(t).replace(xC,"{").replace(EC,"}").replace(wC,"^")}function Jp(t){return C_(t).replace(bC,"%2B").replace(S$,"+").replace(yC,"%23").replace(_$,"%26").replace(E$,"`").replace(xC,"{").replace(EC,"}").replace(wC,"^")}function T$(t){return Jp(t).replace(y$,"%3D")}function A$(t){return C_(t).replace(yC,"%23").replace(b$,"%3F")}function P$(t){return t==null?"":A$(t).replace(v$,"%2F")}function ou(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const M$=/\/$/,I$=t=>t.replace(M$,"");function Dg(t,e,n="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a<l&&a>=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=t(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=L$(i??e,n),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:ou(o)}}function D$(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function Wb(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function R$(t,e,n){const i=e.matched.length-1,s=n.matched.length-1;return i>-1&&i===s&&El(e.matched[i],n.matched[s])&&CC(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function El(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function CC(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!$$(t[n],e[n]))return!1;return!0}function $$(t,e){return gs(t)?zb(t,e):gs(e)?zb(e,t):t===e}function zb(t,e){return gs(e)?t.length===e.length&&t.every((n,i)=>n===e[i]):t.length===1&&t[0]===e}function L$(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),i=t.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=n.length-1,o,a;for(o=0;o<i.length;o++)if(a=i[o],a!==".")if(a==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const Ar={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var au;(function(t){t.pop="pop",t.push="push"})(au||(au={}));var Yc;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Yc||(Yc={}));function O$(t){if(!t)if(Xa){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),I$(t)}const N$=/^[^#]+#/;function F$(t,e){return t.replace(N$,"#")+e}function B$(t,e){const n=document.documentElement.getBoundingClientRect(),i=t.getBoundingClientRect();return{behavior:e.behavior,left:i.left-n.left-(e.left||0),top:i.top-n.top-(e.top||0)}}const yf=()=>({left:window.scrollX,top:window.scrollY});function V$(t){let e;if("el"in t){const n=t.el,i=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?i?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;e=B$(s,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Yb(t,e){return(history.state?history.state.position-e:-1)+t}const Qp=new Map;function W$(t,e){Qp.set(t,e)}function z$(t){const e=Qp.get(t);return Qp.delete(t),e}let Y$=()=>location.protocol+"//"+location.host;function SC(t,e){const{pathname:n,search:i,hash:s}=e,r=t.indexOf("#");if(r>-1){let a=s.includes(t.slice(r))?t.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),Wb(l,"")}return Wb(n,t)+i+s}function H$(t,e,n,i){let s=[],r=[],o=null;const a=({state:f})=>{const g=SC(t,location),p=n.value,m=e.value;let v=0;if(f){if(n.value=g,e.value=f,o&&o===p){o=null;return}v=m?f.position
2024-04-03 01:16:56 -04:00
(?:
2024-10-26 13:54:08 +08:00
(?:${_n}:){7}(?:${_n}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
(?:${_n}:){6}(?:${ns}|:${_n}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
(?:${_n}:){5}(?::${ns}|(?::${_n}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
(?:${_n}:){4}(?:(?::${_n}){0,1}:${ns}|(?::${_n}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
(?:${_n}:){3}(?:(?::${_n}){0,2}:${ns}|(?::${_n}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
(?:${_n}:){2}(?:(?::${_n}){0,3}:${ns}|(?::${_n}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
(?:${_n}:){1}(?:(?::${_n}){0,4}:${ns}|(?::${_n}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
(?::(?:(?::${_n}){0,5}:${ns}|(?::${_n}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
2024-04-03 01:16:56 -04:00
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
2024-11-02 14:26:47 +06:00
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),yL=new RegExp(`(?:^${ns}$)|(?:^${wf}$)`),bL=new RegExp(`^${ns}$`),wL=new RegExp(`^${wf}$`),xf=t=>t&&t.exact?yL:new RegExp(`(?:${jr(t)}${ns}${jr(t)})|(?:${jr(t)}${wf}${jr(t)})`,"g");xf.v4=t=>t&&t.exact?bL:new RegExp(`${jr(t)}${ns}${jr(t)}`,"g");xf.v6=t=>t&&t.exact?wL:new RegExp(`${jr(t)}${wf}${jr(t)}`,"g");const DC={exact:!1},RC=`${xf.v4().source}\\/(3[0-2]|[12]?[0-9])`,$C=`${xf.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,xL=new RegExp(`^${RC}$`),EL=new RegExp(`^${$C}$`),CL=({exact:t}=DC)=>t?xL:new RegExp(RC,"g"),SL=({exact:t}=DC)=>t?EL:new RegExp($C,"g"),LC=CL({exact:!0}),OC=SL({exact:!0}),k_=t=>LC.test(t)?4:OC.test(t)?6:0;k_.v4=t=>LC.test(t);k_.v6=t=>OC.test(t);const At=t=>{const e=Xe();if(e.Locale===null)return t;const i=Object.keys(e.Locale).filter(s=>t.match(new RegExp("^"+s+"$","gi"))!==null);return i.length===0||i.length>1?t:t.replace(new RegExp(i[0],"gi"),e.Locale[i[0]])},$n=_C("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:"",ConfigurationListInterval:void 0,PeerScheduleJobs:{dropdowns:{Field:[{display:At("Total Received"),value:"total_receive",unit:"GB",type:"number"},{display:At("Total Sent"),value:"total_sent",unit:"GB",type:"number"},{display:At("Total Usage"),value:"total_data",unit:"GB",type:"number"},{display:At("Date"),value:"date",type:"date"}],Operator:[{display:At("larger than"),value:"lgt"}],Action:[{display:At("Restrict Peer"),value:"restrict"},{display:At("Delete Peer"),value:"delete"}]}}}),actions:{async getConfigurations(){await Pt("/api/getWireguardConfigurations",{},t=>{t.status&&(this.Configurations=t.data)})},regexCheckIP(t){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(t)},checkCIDR(t){return k_(t)!==0},checkWGKeyLength(t){return console.log(t),/^[A-Za-z0-9+/]{43}=?=?$/.test(t)}}}),ze=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},kL={name:"localeText",props:{t:""},computed:{getLocaleText(){return At(this.t)}}};function TL(t,e,n,i,s,r){return pe(this.getLocaleText)}const Le=ze(kL,[["render",TL]]),AL={name:"navbar",components:{LocaleText:Le},setup(){const t=$n(),e=Xe();return{wireguardConfigurationsStore:t,dashboardConfigurationStore:e}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:""}},mounted(){Pt("/api/getDashboardUpdate",{},t=>{t.status?(t.data&&(this.updateAvailable=!0,this.updateUrl=t.data),this.updateMessage=t.message):(this.updateMessage=At("Failed to check available update"),console.log(`Failed to get update: ${t.message}`))})}},PL=["data-bs-theme"],ML={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},IL={class:"sidebar-sticky"},DL={class:"nav flex-column px-2"},RL={class:"nav-item"},$L={class:"nav-item"},LL={class:"nav-item"},OL={class:"nav-link rounded-3",target:"_blank",href:"https://donaldzou.github.io/WGDashboard-Documentation/user-guides.h
*
* Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
2024-10-31 22:13:44 +08:00
*/(function(){function t(b){var C=new Float64Array(16);if(b)for(var k=0;k<b.length;++k)C[k]=b[k];return C}function e(b,C){for(var k,T=t(),A=t(),I=0;I<16;++I)A[I]=C[I];n(A),n(A),n(A);for(var V=0;V<2;++V){T[0]=A[0]-65517;for(var I=1;I<15;++I)T[I]=A[I]-65535-(T[I-1]>>16&1),T[I-1]&=65535;T[15]=A[15]-32767-(T[14]>>16&1),k=T[15]>>16&1,T[14]&=65535,i(A,T,1-k)}for(var I=0;I<16;++I)b[2*I]=A[I]&255,b[2*I+1]=A[I]>>8}function n(b){for(var C=0;C<16;++C)b[(C+1)%16]+=(C<15?1:38)*Math.floor(b[C]/65536),b[C]&=65535}function i(b,C,k){for(var T,A=~(k-1),I=0;I<16;++I)T=A&(b[I]^C[I]),b[I]^=T,C[I]^=T}function s(b,C,k){for(var T=0;T<16;++T)b[T]=C[T]+k[T]|0}function r(b,C,k){for(var T=0;T<16;++T)b[T]=C[T]-k[T]|0}function o(b,C,k){for(var T=new Float64Array(31),A=0;A<16;++A)for(var I=0;I<16;++I)T[A+I]+=C[A]*k[I];for(var A=0;A<15;++A)T[A]+=38*T[A+16];for(var A=0;A<16;++A)b[A]=T[A];n(b),n(b)}function a(b,C){for(var k=t(),T=0;T<16;++T)k[T]=C[T];for(var T=253;T>=0;--T)o(k,k,k),T!==2&&T!==4&&o(k,k,C);for(var T=0;T<16;++T)b[T]=k[T]}function l(b){b[31]=b[31]&127|64,b[0]&=248}function c(b){for(var C,k=new Uint8Array(32),T=t([1]),A=t([9]),I=t(),V=t([1]),Y=t(),ne=t(),N=t([56129,1]),B=t([9]),R=0;R<32;++R)k[R]=b[R];l(k);for(var R=254;R>=0;--R)C=k[R>>>3]>>>(R&7)&1,i(T,A,C),i(I,V,C),s(Y,T,I),r(T,T,I),s(I,A,V),r(A,A,V),o(V,Y,Y),o(ne,T,T),o(T,I,T),o(I,A,Y),s(Y,T,I),r(T,T,I),o(A,T,T),r(I,V,ne),o(T,I,N),s(T,T,V),o(I,I,T),o(T,V,ne),o(V,A,B),o(A,Y,Y),i(T,A,C),i(I,V,C);return a(I,I),o(T,T,I),e(k,T),k}function u(){var b=new Uint8Array(32);return window.crypto.getRandomValues(b),b}function d(){var b=u();return l(b),b}function f(b,C){for(var k=Uint8Array.from([C[0]>>2&63,(C[0]<<4|C[1]>>4)&63,(C[1]<<2|C[2]>>6)&63,C[2]&63]),T=0;T<4;++T)b[T]=k[T]+65+(25-k[T]>>8&6)-(51-k[T]>>8&75)-(61-k[T]>>8&15)+(62-k[T]>>8&3)}function g(b){var C,k=new Uint8Array(44);for(C=0;C<32/3;++C)f(k.subarray(C*4),b.subarray(C*3));return f(k.subarray(C*4),Uint8Array.from([b[C*3+0],b[C*3+1],0])),k[43]=61,String.fromCharCode.apply(null,k)}function p(b){let C=window.atob(b),k=C.length,T=new Uint8Array(k);for(let I=0;I<k;I++)T[I]=C.charCodeAt(I);return new Uint8Array(T.buffer)}function m(b,C){b.push(C&255,C>>>8&255,C>>>16&255,C>>>24&255)}function v(b,C){b.push(C&255,C>>>8&255)}function y(b,C){for(var k=0;k<C.length;++k)b.push(C[k]&255)}function x(b){for(var C=unescape(encodeURIComponent(b)),k=new Uint8Array(C.length),T=0;T<C.length;++T)k[T]=C.charCodeAt(T);return k}function E(b){if(!E.table){E.table=[];for(var C=0,k=0;k<256;C=++k){for(var T=0;T<8;++T)C=C&1?3988292384^C>>>1:C>>>1;E.table[k]=C}}for(var A=-1,I=0;I<b.length;++I)A=A>>>8^E.table[(A^b[I])&255];return(A^-1)>>>0}function w(b){for(var C=[],k=[],T=0,A=0;A<b.length;++A){var I=x(b[A].fileName),V=x(b[A].file),Y=E(V);m(C,67324752),v(C,20),v(C,0),v(C,0),v(C,0),v(C,0),m(C,Y),m(C,V.length),m(C,V.length),v(C,I.length),v(C,0),y(C,I),y(C,V),m(k,33639248),v(k,0),v(k,20),v(k,0),v(k,0),v(k,0),v(k,0),m(k,Y),m(k,V.length),m(k,V.length),v(k,I.length),v(k,0),v(k,0),v(k,0),v(k,0),m(k,32),m(k,T),y(k,I),T+=30+V.length+I.length}return y(C,k),m(C,101010256),v(C,0),v(C,0),v(C,b.length),v(C,b.length),m(C,k.length),m(C,T),v(C,0),Uint8Array.from(C)}window.wireguard={generateKeypair:function(){var b=d(),C=c(b),k=u();return{publicKey:g(C),privateKey:g(b),presharedKey:g(k)}},generatePublicKey:function(b){return b=p(b),g(c(b))},generateZipFiles:function(b,C){var k=b.data,T=w(k),A=new Blob([T],{type:"application/zip"}),I=document.createElement("a");I.download=C,I.href=URL.createObjectURL(A),I.style.display="none",document.body.appendChild(I),I.click(),document.body.removeChild(I)}}})();const T8={name:"newConfiguration",components:{LocaleText:Le},setup(){return{store:$n()}},data(){return{newConfiguration:{ConfigurationName:"",Address:"",ListenPort:"",PrivateKey:"",PublicKey:"",PresharedKey:"",PreUp:"",PreDown:"",PostUp:"",PostDown:""},numberOfAvailableIPs:"0",error:!1,errorMessage:"",success:!1,loading:!1}},created(){this.wireguardGenerateKeypair()},methods:{wireguardGenerateKeypair(){const t=window.wireguard.generateKeypair();this.newConfiguration.PrivateKey=t.privateKey,this
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
2024-10-31 22:13:44 +08:00
*/function Ku(t){return t+.5|0}const Ur=(t,e,n)=>Math.max(Math.min(t,n),e);function Ec(t){return Ur(Ku(t*2.55),0,255)}function no(t){return Ur(Ku(t*255),0,255)}function ir(t){return Ur(Ku(t/2.55)/100,0,1)}function A0(t){return Ur(Ku(t*100),0,100)}const Bi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},lm=[..."0123456789ABCDEF"],qz=t=>lm[t&15],Zz=t=>lm[(t&240)>>4]+lm[t&15],Ad=t=>(t&240)>>4===(t&15),Jz=t=>Ad(t.r)&&Ad(t.g)&&Ad(t.b)&&Ad(t.a);function Qz(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Bi[t[1]]*17,g:255&Bi[t[2]]*17,b:255&Bi[t[3]]*17,a:e===5?Bi[t[4]]*17:255}:(e===7||e===9)&&(n={r:Bi[t[1]]<<4|Bi[t[2]],g:Bi[t[3]]<<4|Bi[t[4]],b:Bi[t[5]]<<4|Bi[t[6]],a:e===9?Bi[t[7]]<<4|Bi[t[8]]:255})),n}const eY=(t,e)=>t<255?e(t):"";function tY(t){var e=Jz(t)?qz:Zz;return t?"#"+e(t.r)+e(t.g)+e(t.b)+eY(t.a,e):void 0}const nY=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function PS(t,e,n){const i=e*Math.min(n,1-n),s=(r,o=(r+t/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function iY(t,e,n){const i=(s,r=(s+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function sY(t,e,n){const i=PS(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)i[s]*=1-e-n,i[s]+=e;return i}function rY(t,e,n,i,s){return t===s?(e-n)/i+(e<n?6:0):e===s?(n-t)/i+2:(t-e)/i+4}function U_(t){const n=t.r/255,i=t.g/255,s=t.b/255,r=Math.max(n,i,s),o=Math.min(n,i,s),a=(r+o)/2;let l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=rY(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function G_(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(no)}function X_(t,e,n){return G_(PS,t,e,n)}function oY(t,e,n){return G_(sY,t,e,n)}function aY(t,e,n){return G_(iY,t,e,n)}function MS(t){return(t%360+360)%360}function lY(t){const e=nY.exec(t);let n=255,i;if(!e)return;e[5]!==i&&(n=e[6]?Ec(+e[5]):no(+e[5]));const s=MS(+e[2]),r=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=oY(s,r,o):e[1]==="hsv"?i=aY(s,r,o):i=X_(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function cY(t,e){var n=U_(t);n[0]=MS(n[0]+e),n=X_(n),t.r=n[0],t.g=n[1],t.b=n[2]}function uY(t){if(!t)return;const e=U_(t),n=e[0],i=A0(e[1]),s=A0(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${s}%, ${ir(t.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const P0={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},M0={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
2024-10-04 16:58:47 +08:00
* Chart.js v4.4.4
* https://www.chartjs.org
2024-10-04 16:58:47 +08:00
* (c) 2024 Chart.js Contributors
* Released under the MIT License
2024-10-31 22:13:44 +08:00
*/function Us(){}const vY=(()=>{let t=0;return()=>t++})();function gt(t){return t===null||typeof t>"u"}function Yt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ut(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function nn(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Si(t,e){return nn(t)?t:e}function it(t,e){return typeof t>"u"?e:t}const yY=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,DS=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function $t(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Tt(t,e,n,i){let s,r,o;if(Yt(t))for(r=t.length,s=0;s<r;s++)e.call(n,t[s],s);else if(ut(t))for(o=Object.keys(t),r=o.length,s=0;s<r;s++)e.call(n,t[o[s]],o[s])}function Ah(t,e){let n,i,s,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(s=t[n],r=e[n],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Ph(t){if(Yt(t))return t.map(Ph);if(ut(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let s=0;for(;s<i;++s)e[n[s]]=Ph(t[n[s]]);return e}return t}function RS(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function bY(t,e,n,i){if(!RS(t))return;const s=e[t],r=n[t];ut(s)&&ut(r)?hu(s,r,i):e[t]=Ph(r)}function hu(t,e,n){const i=Yt(e)?e:[e],s=i.length;if(!ut(t))return t;n=n||{};const r=n.merger||bY;let o;for(let a=0;a<s;++a){if(o=i[a],!ut(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],t,o,n)}return t}function Kc(t,e){return hu(t,e,{merger:wY})}function wY(t,e,n){if(!RS(t))return;const i=e[t],s=n[t];ut(i)&&ut(s)?Kc(i,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ph(s))}const D0={"":t=>t,x:t=>t.x,y:t=>t.y};function xY(t){const e=t.split("."),n=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function EY(t){const e=xY(t);return n=>{for(const i of e){if(i==="")break;n=n&&n[i]}return n}}function lo(t,e){return(D0[e]||(D0[e]=EY(e)))(t)}function q_(t){return t.charAt(0).toUpperCase()+t.slice(1)}const fu=t=>typeof t<"u",co=t=>typeof t=="function",R0=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function CY(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Bt=Math.PI,Ft=2*Bt,SY=Ft+Bt,Mh=Number.POSITIVE_INFINITY,kY=Bt/180,dn=Bt/2,Oo=Bt/4,$0=Bt*2/3,Gr=Math.log10,Os=Math.sign;function Uc(t,e,n){return Math.abs(t-e)<n}function L0(t){const e=Math.round(t);t=Uc(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Gr(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function TY(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(n|0)&&e.push(n),e.sort((s,r)=>s-r).pop(),e}function Il(t){return!isNaN(parseFloat(t))&&isFinite(t)}function AY(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function $S(t,e,n){let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i][n],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function ls(t){return t*(Bt/180)}function Z_(t){return t*(180/Bt)}function O0(t){if(!nn(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function LS(t,e){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i);let r=Math.atan2(i,n);return r<-.5*Bt&&(r+=Ft),{angle:r,distance:s}}function cm(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function PY(t,e){return(t-e+SY)%Ft-Bt}function ki(t){return(t%Ft+Ft)%Ft}function gu(t,e,n,i){const s=ki(t),r=ki(e),o=ki(n),a=ki(r-s),l=ki(o-s),c=ki(s-r),u=ki(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Dn(t,e,n){return Math.max(e,Math.min(n,t))}function MY(t){return Dn(t,-32768,32767)}function lr(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function J_(t,e,n){n=n||(o=>t[o]<e);let i=t.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const cr=(t,e,n,i)=>J_(t,n,i?s=>{const r=t[s][e];return r<n||r===n&&t[s+1][e]===n}:s=>t[s][e]<n),IY=(t,e,n)=>J_(t,n,i=>t[i][e]>=n);function DY(t,e,n){let i=0
2024-10-04 16:58:47 +08:00
* Chart.js v4.4.4
* https://www.chartjs.org
2024-10-04 16:58:47 +08:00
* (c) 2024 Chart.js Contributors
* Released under the MIT License
2024-10-31 22:13:44 +08:00
*/class LH{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,i,s){const r=n.listeners[s],o=n.duration;r.forEach(a=>a({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=FS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,e,"progress")),r.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),n+=r.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Zs=new LH;const q0="transparent",OH={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=V0(t||q0),s=i.valid&&V0(e||q0);return s&&s.valid?s.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class NH{constructor(e,n,i,s){const r=n[i];s=Cc([e.to,s,r,e.from]);const o=Cc([e.from,r,s]);this._active=!0,this._fn=e.fn||OH[e.type||typeof o],this._easing=Gc[e.easing]||Gc.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=Cc([e.to,n,s,e.from]),this._from=Cc([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=r;return}l=n/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class nk{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!ut(e))return;const n=Object.keys(sn.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const r=e[s];if(!ut(r))return;const o={};for(const a of n)o[a]=r[a];(Yt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(e,n){const i=n.options,s=BH(e,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&FH(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,n){const i=this._properties,s=[],r=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[c];let d=r[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){e[c]=u;continue}r[c]=d=new NH(f,e,c,u),s.push(d)}return s}update(e,n){if(this._properties.size
2024-09-09 23:43:55 +08:00
`)>-1?t.split(`
2024-10-31 22:13:44 +08:00
`):t}function wU(t,e){const{element:n,datasetIndex:i,index:s}=e,r=t.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function $1(t,e){const n=t.chart.ctx,{body:i,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=En(e.bodyFont),c=En(e.titleFont),u=En(e.footerFont),d=r.length,f=s.length,g=i.length,p=Zn(e.padding);let m=p.height,v=0,y=i.reduce((w,b)=>w+b.before.length+b.lines.length+b.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),y){const w=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=g*w+(y-g)*l.lineHeight+(y-1)*e.bodySpacing}f&&(m+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let x=0;const E=function(w){v=Math.max(v,n.measureText(w).width+x)};return n.save(),n.font=c.string,Tt(t.title,E),n.font=l.string,Tt(t.beforeBody.concat(t.afterBody),E),x=e.displayColors?o+2+e.boxPadding:0,Tt(i,w=>{Tt(w.before,E),Tt(w.lines,E),Tt(w.after,E)}),x=0,n.font=u.string,Tt(t.footer,E),n.restore(),v+=p.width,{width:v,height:m}}function xU(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}function EU(t,e,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(t==="left"&&s+r+o>e.width||t==="right"&&s-r-o<0)return!0}function CU(t,e,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),EU(c,t,e,n)&&(c="center"),c}function L1(t,e,n){const i=n.yAlign||e.yAlign||xU(t,n);return{xAlign:n.xAlign||e.xAlign||CU(t,e,n,i),yAlign:i}}function SU(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function kU(t,e,n){let{y:i,height:s}=t;return e==="top"?i+=n:e==="bottom"?i-=s+n:i-=s/2,i}function O1(t,e,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=ra(o);let p=SU(e,a);const m=kU(e,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Dn(p,0,i.width-e.width),y:Dn(m,0,i.height-e.height)}}function Bd(t,e,n){const i=Zn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function N1(t){return bs([],Js(t))}function TU(t,e,n){return wo(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function F1(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Sk={beforeTitle:Us,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:Us,beforeBody:Us,beforeLabel:Us,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return gt(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Us,afterBody:Us,beforeFooter:Us,footer:Us,afterFooter:Us};function hi(t,e,n,i){const s=t[e].call(n,i);return typeof s>"u"?Sk[e].call(n,i):s}class B1 extends xr{static positioners=kc;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void
]))+`;Vs.KANJI=new RegExp(vu,"g");Vs.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Vs.BYTE=new RegExp(e9,"g");Vs.NUMERIC=new RegExp(Gk,"g");Vs.ALPHANUMERIC=new RegExp(Q7,"g");const t9=new RegExp("^"+vu+"$"),n9=new RegExp("^"+Gk+"$"),i9=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Vs.testKanji=function(e){return t9.test(e)};Vs.testNumeric=function(e){return n9.test(e)};Vs.testAlphanumeric=function(e){return i9.test(e)};(function(t){const e=hv,n=Vs;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(r,o){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?r.ccBits[0]:o<27?r.ccBits[1]:r.ccBits[2]},t.getBestModeForData=function(r){return n.testNumeric(r)?t.NUMERIC:n.testAlphanumeric(r)?t.ALPHANUMERIC:n.testKanji(r)?t.KANJI:t.BYTE},t.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},t.isValid=function(r){return r&&r.bit&&r.ccBits};function i(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+s)}}t.from=function(r,o){if(t.isValid(r))return r;try{return i(r)}catch{return o}}})(Co);(function(t){const e=Ri,n=Of,i=Lf,s=Co,r=hv,o=7973,a=e.getBCHDigit(o);function l(f,g,p){for(let m=1;m<=40;m++)if(g<=t.getCapacity(m,p,f))return m}function c(f,g){return s.getCharCountIndicator(f,g)+4}function u(f,g){let p=0;return f.forEach(function(m){const v=c(m.mode,g);p+=v+m.getBitsLength()}),p}function d(f,g){for(let p=1;p<=40;p++)if(u(f,p)<=t.getCapacity(p,g,s.MIXED))return p}t.from=function(g,p){return r.isValid(g)?parseInt(g,10):p},t.getCapacity=function(g,p,m){if(!r.isValid(g))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=s.BYTE);const v=e.getSymbolTotalCodewords(g),y=n.getTotalCodewordsCount(g,p),x=(v-y)*8;if(m===s.MIXED)return x;const E=x-c(m,g);switch(m){case s.NUMERIC:return Math.floor(E/10*3);case s.ALPHANUMERIC:return Math.floor(E/11*2);case s.KANJI:return Math.floor(E/13);case s.BYTE:default:return Math.floor(E/8)}},t.getBestVersionForData=function(g,p){let m;const v=i.from(p,i.M);if(Array.isArray(g)){if(g.length>1)return d(g,v);if(g.length===0)return 1;m=g[0]}else m=g;return l(m.mode,m.getLength(),v)},t.getEncodedBits=function(g){if(!r.isValid(g)||g<7)throw new Error("Invalid QR Code version");let p=g<<12;for(;e.getBCHDigit(p)-a>=0;)p^=o<<e.getBCHDigit(p)-a;return g<<12|p}})(Uk);var Xk={};const Cm=Ri,qk=1335,s9=21522,nw=Cm.getBCHDigit(qk);Xk.getEncodedBits=function(e,n){const i=e.bit<<3|n;let s=i<<10;for(;Cm.getBCHDigit(s)-nw>=0;)s^=qk<<Cm.getBCHDigit(s)-nw;return(i<<10|s)^s9};var Zk={};const r9=Co;function $l(t){this.mode=r9.NUMERIC,this.data=t.toString()}$l.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};$l.prototype.getLength=function(){return this.data.length};$l.prototype.getBitsLength=function(){return $l.getBitsLength(this.data.length)};$l.prototype.write=function(e){let n,i,s;for(n=0;n+3<=this.data.length;n+=3)i=this.data.substr(n,3),s=parseInt(i,10),e.put(s,10);const r=this.data.length-n;r>0&&(i=this.data.substr(n),s=parseInt(i,10),e.put(s,r*3+1))};var o9=$l;const a9=Co,ap=["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 Ll(t){this.mode=a9.ALPHANUMERIC,this.data=t}Ll.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Ll.prototype.getLength=function(){return this.data.length};Ll.prototype.getBitsLength=function(){return Ll.getBitsLength(this.data.length)};Ll.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let i=ap.indexOf(this.data[n])*45;i+=ap.indexOf(this.data[n+1]),e.put(i,11)}this.data.length%2&&e.put(ap.indexOf(this.data[n]),6)};var l9
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var f9=Nl,Jk={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,i,s){var r={},o={};o[i]=0;var a=e.PriorityQueue.make();a.push(i,0);for(var l,c,u,d,f,g,p,m,v;!a.empty();){l=a.pop(),c=l.value,d=l.cost,f=n[c]||{};for(u in f)f.hasOwnProperty(u)&&(g=f[u],p=d+g,m=o[u],v=typeof o[u]>"u",(v||m>p)&&(o[u]=p,a.push(u,p),r[u]=c))}if(typeof s<"u"&&typeof o[s]>"u"){var y=["Could not find a path from ",i," to ",s,"."].join("");throw new Error(y)}return r},extract_shortest_path_from_predecessor_list:function(n,i){for(var s=[],r=i;r;)s.push(r),n[r],r=n[r];return s.reverse(),s},find_path:function(n,i,s){var r=e.single_source_shortest_paths(n,i,s);return e.extract_shortest_path_from_predecessor_list(r,s)},PriorityQueue:{make:function(n){var i=e.PriorityQueue,s={},r;n=n||{};for(r in i)i.hasOwnProperty(r)&&(s[r]=i[r]);return s.queue=[],s.sorter=n.sorter||i.default_sorter,s},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var s={value:n,cost:i};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Jk);var g9=Jk.exports;(function(t){const e=Co,n=o9,i=l9,s=u9,r=f9,o=Vs,a=Ri,l=g9;function c(y){return unescape(encodeURIComponent(y)).length}function u(y,x,E){const w=[];let b;for(;(b=y.exec(E))!==null;)w.push({data:b[0],index:b.index,mode:x,length:b[0].length});return w}function d(y){const x=u(o.NUMERIC,e.NUMERIC,y),E=u(o.ALPHANUMERIC,e.ALPHANUMERIC,y);let w,b;return a.isKanjiModeEnabled()?(w=u(o.BYTE,e.BYTE,y),b=u(o.KANJI,e.KANJI,y)):(w=u(o.BYTE_KANJI,e.BYTE,y),b=[]),x.concat(E,w,b).sort(function(k,T){return k.index-T.index}).map(function(k){return{data:k.data,mode:k.mode,length:k.length}})}function f(y,x){switch(x){case e.NUMERIC:return n.getBitsLength(y);case e.ALPHANUMERIC:return i.getBitsLength(y);case e.KANJI:return r.getBitsLength(y);case e.BYTE:return s.getBitsLength(y)}}function g(y){return y.reduce(function(x,E){const w=x.length-1>=0?x[x.length-1]:null;return w&&w.mode===E.mode?(x[x.length-1].data+=E.data,x):(x.push(E),x)},[])}function p(y){const x=[];for(let E=0;E<y.length;E++){const w=y[E];switch(w.mode){case e.NUMERIC:x.push([w,{data:w.data,mode:e.ALPHANUMERIC,length:w.length},{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.ALPHANUMERIC:x.push([w,{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.KANJI:x.push([w,{data:w.data,mode:e.BYTE,length:c(w.data)}]);break;case e.BYTE:x.push([{data:w.data,mode:e.BYTE,length:c(w.data)}])}}return x}function m(y,x){const E={},w={start:{}};let b=["start"];for(let C=0;C<y.length;C++){const k=y[C],T=[];for(let A=0;A<k.length;A++){const I=k[A],V=""+C+A;T.push(V),E[V]={node:I,lastCount:0},w[V]={};for(let Y=0;Y<b.length;Y++){const ne=b[Y];E[ne]&&E[ne].node.mode===I.mode?(w[ne][V]=f(E[ne].lastCount+I.length,I.mode)-f(E[ne].lastCount,I.mode),E[ne].lastCount+=I.length):(E[ne]&&(E[ne].lastCount=I.length),w[ne][V]=f(I.length,I.mode)+4+e.getCharCountIndicator(I.mode,x))}}b=T}for(let C=0;C<b.length;C++)w[b[C]].end=0;return{map:w,table:E}}function v(y,x){let E;const w=e.getBestModeForData(y);if(E=e.from(x,w),E!==e.BYTE&&E.bit<w.bit)throw new Error('"'+y+'" cannot be encoded with mode '+e.toString(E)+`.
Suggested mode is: `+e.toString(w));switch(E===e.KANJI&&!a.isKanjiModeEnabled()&&(E=e.BYTE),E){case e.NUMERIC:return new n(y);case e.ALPHANUMERIC:return new i(y);case e.KANJI:return new r(y);case e.BYTE:return new s(y)}}t.fromArray=function(x){return x.reduce(function(E,w){return typeof w=="string"?E.push(v(w,null)):w.data&&E.push(v(w.data,w.mode)),E},[])},t.fromString=function(x,E){const w=d(x,a.isKanjiModeEnabled()),b=p(w),C=m(b,E),k=l.find_path(C.map,"start","end"),T=[];for(let A=1;A<k.length-1;A++)T.push(C.table[k[A]].node);return t.fromArray(g(T))},t.rawSplit=function(x){return t.fromArray(d(x,a.isKanjiModeEnabled()))}})(Zk);const Ff=Ri,lp=Lf,p9=X7,m9=q7,_9=zk,v9=Yk,Sm=Hk,km=Of,y9=J7,Fh=Uk,b9=Xk,w9=Co,cp=Zk;function x9(t,e){const n=t.size,i=v9.getPositions(e);for(let s=0;s<i.length;s++){const r=i[s][0],o=i[s][1];for(let a=-1;a<=7;a++)if(!(r+a<=-1||n<=r+a))for(let l=-1;l<=7;l++)o+l<=-1||n<=o+l||(a>=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(r+a,o+l,!0,!0):t.set(r+a,o+l,!1,!0))}}function E9(t){const e=t.size;for(let n=8;n<e-8;n++){const i=n%2===0;t.set(n,6,i,!0),t.set(6,n,i,!0)}}function C9(t,e){const n=_9.getPositions(e);for(let i=0;i<n.length;i++){const s=n[i][0],r=n[i][1];for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?t.set(s+o,r+a,!0,!0):t.set(s+o,r+a,!1,!0)}}function S9(t,e){const n=t.size,i=Fh.getEncodedBits(e);let s,r,o;for(let a=0;a<18;a++)s=Math.floor(a/3),r=a%3+n-8-3,o=(i>>a&1)===1,t.set(s,r,o,!0),t.set(r,s,o,!0)}function up(t,e,n){const i=t.size,s=b9.getEncodedBits(e,n);let r,o;for(r=0;r<15;r++)o=(s>>r&1)===1,r<6?t.set(r,8,o,!0):r<8?t.set(r+1,8,o,!0):t.set(i-15+r,8,o,!0),r<8?t.set(8,i-r-1,o,!0):r<9?t.set(8,15-r-1+1,o,!0):t.set(8,15-r-1,o,!0);t.set(i-8,8,1,!0)}function k9(t,e){const n=t.size;let i=-1,s=n-1,r=7,o=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(s,a-l)){let c=!1;o<e.length&&(c=(e[o]>>>r&1)===1),t.set(s,a-l,c),r--,r===-1&&(o++,r=7)}if(s+=i,s<0||n<=s){s-=i,i=-i;break}}}function T9(t,e,n){const i=new p9;n.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),w9.getCharCountIndicator(l.mode,t)),l.write(i)});const s=Ff.getSymbolTotalCodewords(t),r=km.getTotalCodewordsCount(t,e),o=(s-r)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const a=(o-i.getLengthInBits())/8;for(let l=0;l<a;l++)i.put(l%2?17:236,8);return A9(i,t,e)}function A9(t,e,n){const i=Ff.getSymbolTotalCodewords(e),s=km.getTotalCodewordsCount(e,n),r=i-s,o=km.getBlocksCount(e,n),a=i%o,l=o-a,c=Math.floor(i/o),u=Math.floor(r/o),d=u+1,f=c-u,g=new y9(f);let p=0;const m=new Array(o),v=new Array(o);let y=0;const x=new Uint8Array(t.buffer);for(let k=0;k<o;k++){const T=k<l?u:d;m[k]=x.slice(p,p+T),v[k]=g.encode(m[k]),p+=T,y=Math.max(y,T)}const E=new Uint8Array(i);let w=0,b,C;for(b=0;b<y;b++)for(C=0;C<o;C++)b<m[C].length&&(E[w++]=m[C][b]);for(b=0;b<f;b++)for(C=0;C<o;C++)E[w++]=v[C][b];return E}function P9(t,e,n,i){let s;if(Array.isArray(t))s=cp.fromArray(t);else if(typeof t=="string"){let c=e;if(!c){const u=cp.rawSplit(t);c=Fh.getBestVersionForData(u,n)}s=cp.fromString(t,c||40)}else throw new Error("Invalid data");const r=Fh.getBestVersionForData(s,n);if(!r)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=r;else if(e<r)throw new Error(`
2024-08-05 15:39:11 -04:00
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+r+`.
2024-10-31 22:13:44 +08:00
`);const o=T9(e,n,s),a=Ff.getSymbolSize(e),l=new m9(a);return x9(l,e),E9(l),C9(l,e),up(l,n,0),e>=7&&S9(l,e),k9(l,o),isNaN(i)&&(i=Sm.getBestMask(l,up.bind(null,l,n))),Sm.applyMask(i,l),up(l,n,i),{modules:l,version:e,errorCorrectionLevel:n,maskPattern:i,segments:s}}Vk.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let i=lp.M,s,r;return typeof n<"u"&&(i=lp.from(n.errorCorrectionLevel,lp.M),s=Fh.from(n.version),r=Sm.from(n.maskPattern),n.toSJISFunc&&Ff.setToSJISFunction(n.toSJISFunc)),P9(e,s,i,r)};var Qk={},fv={};(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(r){return[r,r]}))),i.length===6&&i.push("F","F");const s=parseInt(i.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const s=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,r=i.width&&i.width>=21?i.width:void 0,o=i.scale||4;return{width:r,scale:r?4:o,margin:s,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,s){return s.width&&s.width>=i+s.margin*2?s.width/(i+s.margin*2):s.scale},t.getImageWidth=function(i,s){const r=t.getScale(i,s);return Math.floor((i+s.margin*2)*r)},t.qrToImageData=function(i,s,r){const o=s.modules.size,a=s.modules.data,l=t.getScale(o,r),c=Math.floor((o+r.margin*2)*l),u=r.margin*l,d=[r.color.light,r.color.dark];for(let f=0;f<c;f++)for(let g=0;g<c;g++){let p=(f*c+g)*4,m=r.color.light;if(f>=u&&g>=u&&f<c-u&&g<c-u){const v=Math.floor((f-u)/l),y=Math.floor((g-u)/l);m=d[a[v*o+y]?1:0]}i[p++]=m.r,i[p++]=m.g,i[p++]=m.b,i[p]=m.a}}})(fv);(function(t){const e=fv;function n(s,r,o){s.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=o,r.width=o,r.style.height=o+"px",r.style.width=o+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(r,o,a){let l=a,c=o;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(c=i()),l=e.getOptions(l);const u=e.getImageWidth(r.modules.size,l),d=c.getContext("2d"),f=d.createImageData(u,u);return e.qrToImageData(f.data,r,l),n(d,c,u),d.putImageData(f,0,0),c},t.renderToDataURL=function(r,o,a){let l=a;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const c=t.render(r,o,l),u=l.type||"image/png",d=l.rendererOpts||{};return c.toDataURL(u,d.quality)}})(Qk);var eT={};const M9=fv;function iw(t,e){const n=t.a/255,i=e+'="'+t.hex+'"';return n<1?i+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function dp(t,e,n){let i=t+e;return typeof n<"u"&&(i+=" "+n),i}function I9(t,e,n){let i="",s=0,r=!1,o=0;for(let a=0;a<t.length;a++){const l=Math.floor(a%e),c=Math.floor(a/e);!l&&!r&&(r=!0),t[a]?(o++,a>0&&l>0&&t[a-1]||(i+=r?dp("M",l+n,.5+c+n):dp("m",s,0),s=0,r=!1),l+1<e&&t[a+1]||(i+=dp("h",o),o=0)):s++}return i}eT.render=function(e,n,i){const s=M9.getOptions(n),r=e.modules.size,o=e.modules.data,a=r+s.margin*2,l=s.color.light.a?"<path "+iw(s.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",c="<path "+iw(s.color.dark,"stroke")+' d="'+I9(o,r,s.margin)+'"/>',u='viewBox="0 0 '+a+" "+a+'"',f='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+u+' shape-rendering="crispEdges">'+l+c+`</svg>
2024-11-02 14:26:47 +06:00
`;return typeof i=="function"&&i(null,f),f};const D9=U7,Tm=Vk,tT=Qk,R9=eT;function gv(t,e,n,i,s){const r=[].slice.call(arguments,1),o=r.length,a=typeof r[o-1]=="function";if(!a&&!D9())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(s=n,n=e,e=i=void 0):o===3&&(e.getContext&&typeof s>"u"?(s=i,i=void 0):(s=i,i=n,n=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(n=e,e=i=void 0):o===2&&!e.getContext&&(i=n,n=e,e=void 0),new Promise(function(l,c){try{const u=Tm.create(n,i);l(t(u,e,i))}catch(u){c(u)}})}try{const l=Tm.create(n,i);s(null,t(l,e,i))}catch(l){s(l)}}wa.create=Tm.create;wa.toCanvas=gv.bind(null,tT.render);wa.toDataURL=gv.bind(null,tT.renderToDataURL);wa.toString=gv.bind(null,function(t,e,n){return R9.render(t,n)});const $9={name:"peerQRCode",components:{LocaleText:Le},props:{peerConfigData:String},mounted(){wa.toCanvas(document.querySelector("#qrcode"),this.peerConfigData,t=>{t&&console.error(t)})}},L9={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},O9={class:"container d-flex h-100 w-100"},N9={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},F9={class:"card rounded-3 shadow"},B9={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},V9={class:"mb-0"},W9={class:"card-body"},z9={id:"qrcode",class:"rounded-3 shadow",ref:"qrcode"};function Y9(t,e,n,i,s,r){const o=Se("LocaleText");return P(),F("div",L9,[h("div",O9,[h("div",N9,[h("div",F9,[h("div",B9,[h("h4",V9,[$(o,{t:"QR Code"})]),h("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>this.$emit("close"))})]),h("div",W9,[h("canvas",z9,null,512)])])])])])}const H9=ze($9,[["render",Y9]]),j9={name:"nameInput",components:{LocaleText:Le},props:{bulk:Boolean,data:Object,saving:Boolean}},K9={for:"peer_name_textbox",class:"form-label"},U9={class:"text-muted"},G9=["disabled"];function X9(t,e,n,i,s,r){const o=Se("LocaleText");return P(),F("div",{class:Ee({inactiveField:this.bulk})},[h("label",K9,[h("small",U9,[$(o,{t:"Name"})])]),Re(h("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||this.bulk,"onUpdate:modelValue":e[0]||(e[0]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,G9),[[We,this.data.name]])],2)}const q9=ze(j9,[["render",X9]]),Z9={name:"privatePublicKeyInput",components:{LocaleText:Le},props:{data:Object,saving:Boolean,bulk:Boolean},setup(){const t=Xe(),e=$n();return{dashboardStore:t,wgStore:e}},data(){return{keypair:{publicKey:"",privateKey:"",presharedKey:""},editKey:!1,error:!1}},methods:{genKeyPair(){this.editKey=!1,this.keypair=window.wireguard.generateKeypair(),this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey},testKey(t){return/^[A-Za-z0-9+/]{43}=?=?$/.test(t)},checkMatching(){try{this.keypair.privateKey&&this.wgStore.checkWGKeyLength(this.keypair.privateKey)&&(this.keypair.publicKey=window.wireguard.generatePublicKey(this.keypair.privateKey),window.wireguard.generatePublicKey(this.keypair.privateKey)!==this.keypair.publicKey?(this.error=!0,this.dashboardStore.newMessage("WGDashboard","Private key does not match with the public key","danger")):(this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey))}catch{this.error=!0,this.data.private_key="",this.data.public_key=""}}},mounted(){this.genKeyPair()},watch:{keypair:{deep:!0,handler(){this.error=!1,this.checkMatching()}}}},J9={for:"peer_private_key_textbox",class:"form-label"},Q9={class:"text-muted"},eX={class:"input-group"},tX=["disabled"],nX=["disabled"],iX={class:"d-flex"},sX={for:"public_key",class:"form-label"},rX={class:"text-muted"},oX={class:"form-check form-switch ms-auto"},aX=["disabled"],lX={class:"form-check-label",for:"enablePublicKeyEdit"},cX=["disabled"];function uX(t,e,n,i,s,r){const o=Se("LocaleText");return P(),F("div",{class:Ee(["d-flex gap-2 flex-column",{inactiveField:this.bulk}])},[h("div",null,[h("label",J9,[h("small",Q9,[$(o,{t:"Private Key"}),h("code
2024-10-29 14:57:29 +08:00
`);a(p,m,v)?(qu($m),Ja=null,Rm=void 0,er.set(g,100)):(er.set(g,er.get(g)+1,!0),c=!1)}}c&&(clearInterval(r),r=void 0)}return function(c){const u=NT(c);if(!u)return;const d=u.families;for(let f=0,g=d.length;f<g;++f){const p=d[f],m=u.style+`
`+u.weight+`
2024-10-31 22:13:44 +08:00
`+p;er.get(m)===void 0&&(er.set(m,100,!0),a(u.style,u.weight,p)||(er.set(m,0,!0),r===void 0&&(r=setInterval(l,32))))}}}(),Vie=function(){let t;return function(e){let n=$m[e];if(n==null){if($T){const i=NT(e),s=BT(e,"Žg");n=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);$m[e]=n}return n}}();function BT(t,e){return Ja||(Ja=hn(1,1)),t!=Rm&&(Ja.font=t,Rm=Ja.font),Ja.measureText(e)}function Kh(t,e){return BT(t,e).width}function Iw(t,e,n){if(e in n)return n[e];const i=e.split(`
`).reduce((s,r)=>Math.max(s,Kh(t,r)),0);return n[e]=i,i}function Wie(t,e){const n=[],i=[],s=[];let r=0,o=0,a=0,l=0;for(let c=0,u=e.length;c<=u;c+=2){const d=e[c];if(d===`
`||c===u){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const f=e[c+1]||t.font,g=Kh(f,d);n.push(g),o+=g;const p=Vie(f);i.push(p),l=Math.max(l,p)}return{width:r,height:a,widths:n,heights:i,lineWidths:s}}function zie(t,e,n,i,s,r,o,a,l,c,u){t.save(),n!==1&&(t.globalAlpha===void 0?t.globalAlpha=d=>d.globalAlpha*=n:t.globalAlpha*=n),e&&t.transform.apply(t,e),i.contextInstructions?(t.translate(l,c),t.scale(u[0],u[1]),Yie(i,t)):u[0]<0||u[1]<0?(t.translate(l,c),t.scale(u[0],u[1]),t.drawImage(i,s,r,o,a,0,0,o,a)):t.drawImage(i,s,r,o,a,l,c,o*u[0],a*u[1]),t.restore()}function Yie(t,e){const n=t.contextInstructions;for(let i=0,s=n.length;i<s;i+=2)Array.isArray(n[i+1])?e[n[i]].apply(e,n[i+1]):e[n[i]]=n[i+1]}class Qf extends Zf{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode}),this.canvases_,this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?ot.LOADING:ot.LOADED,this.imageState_===ot.LOADING&&this.ready().then(()=>this.imageState_=ot.LOADED),this.render()}clone(){const e=this.getScale(),n=new Qf({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){const e=this.size_,n=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-n[0]/i[0],e[1]/2+n[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){let n=this.canvases_[e];if(!n){const i=this.renderOptions_,s=hn(i.size*e,i.size*e);this.draw_(i,s,e),n=s.canvas,this.canvases_[e]=n}return n}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,n,i){if(n===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return n;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s<r){const C=s;s=r,r=C}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=r*Math.sin(a),c=Math.sqrt(r*r-l*l),u=s-c,d=Math.sqrt(l*l+u*u),f=d/l;if(e==="miter"&&f<=i)return f*n;const g=n/2/f,p=n/2*(u/d),v=Math.sqrt((s+g)*(s+g)+p*p)-s;if(this.radius2_===void 0||e==="bevel")return v*2;const y=s*Math.sin(a),x=Math.sqrt(s*s-y*y),E=r-x,b=Math.sqrt(y*y+E*E)/y;if(b<=i){const C=b*n/2-r-s;return 2*Math.max(v,C)}return v*2}createRenderOptions(){let e=Yl,n=Hl,i=0,s=null,r=0,o,a=0;this.stroke_&&(o=Ds(this.stroke_.getColor()??Au),a=this.stroke_.getWidth()??Mu,s=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset()??0,n=this.stroke_.getLineJoin()??Hl,e=this.stroke_.getLineCap()??Yl,i=this.stroke_.getMiterLimit()??Tu);const l=this.calculateLineJoinSize_(n,a,i),c=Math.max(this.radius,this.radius2_||0),u=Math.ceil(2*c+l);return{strokeStyle:o,strokeWidth:a,size:u,lineCap:e,lineDash:s,lineDashOffset:r,lineJoin:n,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.canvases_={},this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,n,i){if
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Mre(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,i){}}class Dre extends Jv{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Rre,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:nA,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!fp(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||fp(n,e)))return this.tileGrid;const i=Et(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=cA(e)),this.tileGridForProjection[i]}createTile_(e,n,i,s,r,o){const a=[e,n,i],l=this.getTileCoordForTileUrlFunction(a,r),c=l?this.tileUrlFunction(l,s,r):void 0,u=new this.tileClass(a,c!==void 0?Ve.IDLE:Ve.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(tt.CHANGE,this.handleTileChange.bind(this)),u}getTile(e,n,i,s,r){const o=this.getProjection();if(!o||!r||fp(o,r))return this.getTileInternal(e,n,i,s,o||r);const a=[e,n,i],l=this.getKey(),c=this.getTileGridForProjection(o),u=this.getTileGridForProjection(r),d=this.getTileCoordForTileUrlFunction(a,r),f=new Bm(o,c,r,u,a,d,this.getTilePixelRatio(s),this.getGutter(),(g,p,m,v)=>this.getTileInternal(g,p,m,v,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return f.key=l,f}getTileInternal(e,n,i,s,r){const o=this.getKey();return this.createTile_(e,n,i,s,r,o)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const i=Xi(e);if(i){const s=Et(i);s in this.tileGridForProjection||(this.tileGridForProjection[s]=n)}}}function Rre(t,e){t.getImage().src=e}class $re extends Dre{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",i=e.tileGrid!==void 0?e.tileGrid:yre({extent:Zv(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const Lre='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class Ore extends $re{constructor(e){e=e||{};let n;e.attributions!==void 0?n=e.attributions:n=[Lre];const i=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:n,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:i,interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})}}const Qd={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Nre extends qf{constructor(e){e=e||{};const n=Object.assign({},e),i=e.cacheSize;delete e.cacheSize,delete n.preload,delete n.useInterimTilesOnError,supe
`,""),t.push(e,""),t}class aoe{constructor(e,n,i,s,r){this.overlaps=i,this.pixelRatio=n,this.resolution=e,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=hs(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new dA:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,n,i,s){const r=e+n+i+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=i?this.fillStates[i]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],d=l.justify?Qh[l.justify]:Mp(Array.isArray(e)?e[0]:e,l.textAlign||Pu),f=s&&o.lineWidth?o.lineWidth:0,g=Array.isArray(e)?e:String(e).split(`
`).reduce(ooe,[]),{width:p,height:m,widths:v,heights:y,lineWidths:x}=Wie(l,g),E=p+f,w=[],b=(E+2)*u[0],C=(m+f)*u[1],k={width:b<0?Math.floor(b):Math.ceil(b),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:w};(u[0]!=1||u[1]!=1)&&w.push("scale",u),s&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",f),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)),i&&w.push("fillStyle",a.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");const T=.5-d;let A=d*E+T*f;const I=[],V=[];let Y=0,ne=0,N=0,B=0,R;for(let W=0,X=g.length;W<X;W+=2){const J=g[W];if(J===`
`){ne+=Y,Y=0,A=d*E+T*f,++B;continue}const H=g[W+1]||l.font;H!==R&&(s&&I.push("font",H),i&&V.push("font",H),R=H),Y=Math.max(Y,y[N]);const ce=[J,A+T*v[N]+d*(v[N]-x[B]),.5*(f+Y)+ne];A+=v[N],s&&I.push("strokeText",ce),i&&V.push("fillText",ce),++N}return Array.prototype.push.apply(w,I),Array.prototype.push.apply(w,V),this.labels_[r]=k,k}replayTextBackground_(e,n,i,s,r,o,a){e.beginPath(),e.moveTo.apply(e,n),e.lineTo.apply(e,i),e.lineTo.apply(e,s),e.lineTo.apply(e,r),e.lineTo.apply(e,n),o&&(this.alignAndScaleFill_=o[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())}calculateImageOrLabelDimensions_(e,n,i,s,r,o,a,l,c,u,d,f,g,p,m,v){a*=f[0],l*=f[1];let y=i-a,x=s-l;const E=r+c>e?e-c:r,w=o+u>n?n-u:o,b=p[3]+E*f[0]+p[1],C=p[0]+w*f[1]+p[2],k=y-p[3],T=x-p[0];(m||d!==0)&&(Rr[0]=k,$r[0]=k,Rr[1]=T,Gs[1]=T,Gs[0]=k+b,Xs[0]=Gs[0],Xs[1]=T+C,$r[1]=Xs[1]);let A;return d!==0?(A=br(hs(),i,s,1,1,d,-i,-s),On(A,Rr),On(A,Gs),On(A,Xs),On(A,$r),uo(Math.min(Rr[0],Gs[0],Xs[0],$r[0]),Math.min(Rr[1],Gs[1],Xs[1],$r[1]),Math.max(Rr[0],Gs[0],Xs[0],$r[0]),Math.max(Rr[1],Gs[1],Xs[1],$r[1]),Ka)):uo(Math.min(k,k+b),Math.min(T,T+C),Math.max(k,k+b),Math.max(T,T+C),Ka),g&&(y=Math.round(y),x=Math.round(x)),{drawImageX:y,drawImageY:x,drawImageW:E,drawImageH:w,originX:c,originY:u,declutterBox:{minX:Ka[0],minY:Ka[1],maxX:Ka[2],maxY:Ka[3],value:v},canvasTransform:A,scale:f}}replayImageOrLabel_(e,n,i,s,r,o,a){const l=!!(o||a),c=s.declutterBox,u=a?a[2]*s.scale[0]/2:0;return c.minX-u<=n[0]&&c.maxX+u>=0&&c.minY-u<=n[1]&&c.maxY+u>=0&&(l&&this.replayTextBackground_(e,Rr,Gs,Xs,$r,o,a),zie(e,s.canvasTransform,r,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(e){const n=this.alignAndScaleFill_;if(n){const i=On(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;e.save(),e.translate(i[0]%s,i[1]%s),n!==1&&e.scale(n,n),e.rotate(this.viewRotation_)}e.fill(),n&&e.restore()}setStrokeStyle_(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.lineDashOffset=n[7],e.setLineDash(n[6])}drawLabelWithPointPlacement_(e,n,i,s){const r=this.textStates[n],o=this.createLabel(e,n,s,i),a=this.strokeStates[i],l=this.pixelRatio,c=Mp(Array.isArray(e)?e[0]:e,r.textAlign||Pu),u=Qh[r.textBaseline||jh],d=a&&a.lineWidth?a.lineWidth:0,f=o.width/l-2*r.scale[0],g=c*f+2*(.5-c)*d,p=u*o.height/l+2*(.5-u)*d;return{label:o,anchorX:g,anchorY:p}}execute_(e,n,i,s,r,o,a,l){const c=this.zIndexContext_;let u;this.pixelCoordinates_&&So(i,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=io(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Yne(this.renderedTransform_,i));let d=0;const f=s.length;let g=0,p,m,v,y,x,E,w,b,C,k,T,A,I,V=0,Y=0,ne=null,N=null;const B=this.coordinateCache_,R=this.viewRotation_,W=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,X={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:R},J=this.instructions!=s||this.overlaps?0:200;let H,ce,ie,te;for(;d<f;){const D=s[d];switch(D[0]){case Ue.BEGIN_GEOMETRY:H=D[1],te=D[3],H.getGeometry()?a!==void 0&&!vi(a,te.getExtent())?d=D[2]+1:++d:d=D[2],c&&(c.zIndex=D[4]);break;case Ue.BEGIN_PATH:V>J&&(this.fill_(e),V=0),Y>J&&(e.stroke(),Y=0),!V&&!Y&&(e.beginPath(),x=NaN,E=NaN),++d;break;case Ue.CIRCLE:g=D[1];const ue=u[g],L=u[g+1],le=u[g+2],de=u[g+3],xe=le-ue,z=de-L,fe=Math.sqrt(xe*xe+z*z);e.moveTo(ue+fe,L),e.arc(ue,L,fe,0,2*Math.PI,!0),++d;break;case Ue.CLOSE_PATH:e.closePath(),++d;break;case Ue.CUSTOM:g=D[1],p=D[2];const S=D[3],O=D[4],K=D[5];X.geometry=S,X.feature=H,d in B||(B[d]=[]);const U=B[d];K?K(u,g,p,2,U):(U[0]=u[g],U[1]=u[g+1],U.length=2),c&&(c.zIndex=D[6]),O(U,X),++d;break;case Ue.DRAW_IMAGE:g=D[1],p=D[2],C=D[3],m=D[4],v=D[5];let oe=D[6];const j=D[7],re=D[8],Q=D[9],ge=D[10];let be=D[11];const we=D[12];let Me=D[13];y=D[14]||"declutter";const De=D[15];if(!C&&D.length>=20){k=D[19],T=D[20],A=D[21],I=D[22];const mn=this.drawLabelWithPointPlacement_(k,T,A,I);C=mn.label,D[3]=C;const Cn=D[23];m=(mn.anchorX-Cn)*this.pixelRatio,D[4]=m;const Sn=D[24];v=(mn.anchorY-Sn)*this.pixelRatio
`);for(let E of i){if(E==="[Peer]")break;if(E.length>0){let w=E.replace(" = ","=").split("=");w[0]==="ListenPort"?n[w[0]]=parseInt(w[1]):n[w[0]]=w[1]}}const s=me(!1),r=me(!1),o=me(""),a=$n(),l=ve(()=>/^[a-zA-Z0-9_=+.-]{1,15}$/.test(n.ConfigurationName)&&n.ConfigurationName.length>0&&!a.Configurations.find(E=>E.Name===n.ConfigurationName)),c=ve(()=>{try{wireguard.generatePublicKey(n.PrivateKey)}catch{return!1}return!0}),u=ve(()=>n.ListenPort>0&&n.ListenPort<=65353&&Number.isInteger(n.ListenPort)&&!a.Configurations.find(E=>parseInt(E.ListenPort)===n.ListenPort)),d=ve(()=>{try{return am(n.Address),!0}catch{return!1}}),f=ve(()=>d.value&&u.value&&c.value&&l.value);Vt(()=>{document.querySelector("main").scrollTo({top:0,behavior:"smooth"}),jt(()=>c,E=>{E&&(n.PublicKey=wireguard.generatePublicKey(n.PrivateKey))},{immediate:!0})});const g=ve(()=>{let E;try{E=am(n.Address)}catch{return 0}return E.end-E.start}),p=ve(()=>e.selectedConfigurationBackup.database?e.selectedConfigurationBackup.databaseContent.split(`
2024-10-29 14:57:29 +08:00
`).filter(w=>w.search('INSERT INTO "(.*)"')>=0).length:0),m=ve(()=>e.selectedConfigurationBackup.database?e.selectedConfigurationBackup.databaseContent.split(`
2024-10-31 22:13:44 +08:00
`).filter(w=>w.search('INSERT INTO "(.*)_restrict_access"')>=0).length:0),v=Xe(),y=IC(),x=async()=>{f.value&&await dt("/api/addWireguardConfiguration",n,async E=>{E.status&&(v.newMessage("Server","Configuration restored","success"),await a.getConfigurations(),await y.push(`/configuration/${n.ConfigurationName}/peers`))})};return(E,w)=>(P(),F("div",Lle,[h("form",Ole,[h("div",Nle,[h("h4",Fle,[$(Le,{t:"Configuration File"})])]),h("div",null,[h("label",Ble,[h("small",null,[$(Le,{t:"Configuration Name"})])]),Re(h("input",{type:"text",class:Ee(["form-control rounded-3",[l.value?"is-valid":"is-invalid"]]),placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":w[0]||(w[0]=b=>n.ConfigurationName=b),disabled:"",required:""},null,2),[[We,n.ConfigurationName]]),h("div",Vle,[s.value?(P(),F("div",Wle,pe(o.value),1)):(P(),F("div",zle,[$(Le,{t:"Configuration name is invalid. Possible reasons:"}),h("ul",Yle,[h("li",null,[$(Le,{t:"Configuration name already exist."})]),h("li",null,[$(Le,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])]),h("div",Hle,[h("div",jle,[h("div",null,[h("label",Kle,[h("small",null,[$(Le,{t:"Private Key"})])]),h("div",Ule,[Re(h("input",{type:"text",class:Ee(["form-control rounded-start-3",[c.value?"is-valid":"is-invalid"]]),id:"PrivateKey",required:"","onUpdate:modelValue":w[1]||(w[1]=b=>n.PrivateKey=b),disabled:""},null,2),[[We,n.PrivateKey]])])])]),h("div",Gle,[h("div",null,[h("label",Xle,[h("small",null,[$(Le,{t:"Public Key"})])]),Re(h("input",{type:"text",class:"form-control rounded-3",id:"PublicKey","onUpdate:modelValue":w[2]||(w[2]=b=>n.PublicKey=b),disabled:""},null,512),[[We,n.PublicKey]])])])]),h("div",null,[h("label",qle,[h("small",null,[$(Le,{t:"Listen Port"})])]),Re(h("input",{type:"number",class:Ee(["form-control rounded-3",[u.value?"is-valid":"is-invalid"]]),placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":w[3]||(w[3]=b=>n.ListenPort=b),disabled:"",required:""},null,2),[[We,n.ListenPort]]),h("div",Zle,[s.value?(P(),F("div",Jle,pe(o.value),1)):(P(),F("div",Qle,[$(Le,{t:"Listen Port is invalid. Possible reasons:"}),h("ul",ece,[h("li",null,[$(Le,{t:"Invalid port."})]),h("li",null,[$(Le,{t:"Port is assigned to existing WireGuard Configuration. "})])])]))])]),h("div",null,[h("label",tce,[h("small",null,[$(Le,{t:"IP Address/CIDR"})]),h("small",{class:Ee(["ms-auto",[g.value>0?"text-success":"text-danger"]])},pe(g.value)+" Available IP Address ",3)]),Re(h("input",{type:"text",class:Ee(["form-control",[d.value?"is-valid":"is-invalid"]]),placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":w[4]||(w[4]=b=>n.Address=b),disabled:"",required:""},null,2),[[We,n.Address]]),h("div",nce,[s.value?(P(),F("div",ice,pe(o.value),1)):(P(),F("div",sce,[$(Le,{t:"IP Address/CIDR is invalid"})]))])]),h("div",rce,[h("div",oce,[h("h2",ace,[h("button",lce,[$(Le,{t:"Optional Settings"})])]),h("div",cce,[h("div",uce,[h("div",null,[h("label",dce,[h("small",null,[$(Le,{t:"PreUp"})])]),Re(h("input",{type:"text",class:"form-control rounded-3",id:"PreUp",disabled:"","onUpdate:modelValue":w[5]||(w[5]=b=>n.PreUp=b)},null,512),[[We,n.PreUp]])]),h("div",null,[h("label",hce,[h("small",null,[$(Le,{t:"PreDown"})])]),Re(h("input",{type:"text",class:"form-control rounded-3",id:"PreDown",disabled:"","onUpdate:modelValue":w[6]||(w[6]=b=>n.PreDown=b)},null,512),[[We,n.PreDown]])]),h("div",null,[h("label",fce,[h("small",null,[$(Le,{t:"PostUp"})])]),Re(h("input",{type:"text",class:"form-control rounded-3",id:"PostUp",disabled:"","onUpdate:modelValue":w[7]||(w[7]=b=>n.PostUp=b)},null,512),[[We,n.PostUp]])]),h("div",null,[h("label",gce,[h("small",null,[$(Le,{t:"PostDown"})])]),Re(h("input",{type:"text",class:"form-control rounded-3",id:"PostDown",disabled:"","onUpdate:modelValue":w[8]||(w[8]=b=>n.PostDown=b)},null,512),[[We,n.PostDown]])])])])])])]),h("div",pce,[h("div",mce,[h("h4",_ce,[$(Le,{t:"Database File"})]),h("h4",{class:Ee(["mb-0 ms-auto",[t.selectedConfigurationBackup.database?"text-success":"t