@drocketxx/pm2me 1.1.36 โ 1.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/app.js +109 -63
- package/backend/public/assets/index-BBA5OG2n.css +1 -0
- package/backend/public/assets/index-OyOipAZ9.js +16 -0
- package/backend/public/index.html +2 -2
- package/backend/routes/api.js +239 -303
- package/backend/services/systemService.js +12 -18
- package/package.json +53 -53
- package/backend/public/assets/index-BDEN18Iq.css +0 -1
- package/backend/public/assets/index-DF5VxOtp.js +0 -22
- package/c:VsCodemyPM2Metmp_old_dashboard.vue +0 -390
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function s(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(o){if(o.ep)return;o.ep=!0;const r=s(o);fetch(o.href,r)}})();function Po(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const we={},us=[],bt=()=>{},wi=()=>!1,Cn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),No=e=>e.startsWith("onUpdate:"),Pe=Object.assign,Lo=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},ua=Object.prototype.hasOwnProperty,he=(e,t)=>ua.call(e,t),se=Array.isArray,ds=e=>Ks(e)==="[object Map]",xs=e=>Ks(e)==="[object Set]",ur=e=>Ks(e)==="[object Date]",le=e=>typeof e=="function",Ee=e=>typeof e=="string",wt=e=>typeof e=="symbol",me=e=>e!==null&&typeof e=="object",_i=e=>(me(e)||le(e))&&le(e.then)&&le(e.catch),ki=Object.prototype.toString,Ks=e=>ki.call(e),da=e=>Ks(e).slice(8,-1),Ci=e=>Ks(e)==="[object Object]",Io=e=>Ee(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ms=Po(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Sn=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},fa=/-\w/g,nt=Sn(e=>e.replace(fa,t=>t.slice(1).toUpperCase())),pa=/\B([A-Z])/g,Kt=Sn(e=>e.replace(pa,"-$1").toLowerCase()),En=Sn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Hn=Sn(e=>e?`on${En(e)}`:""),Ft=(e,t)=>!Object.is(e,t),nn=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},Si=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},$n=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ha=e=>{const t=Ee(e)?Number(e):NaN;return isNaN(t)?e:t};let dr;const An=()=>dr||(dr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function xt(e){if(se(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],o=Ee(n)?ba(n):xt(n);if(o)for(const r in o)t[r]=o[r]}return t}else if(Ee(e)||me(e))return e}const ma=/;(?![^(]*\))/g,ga=/:([^]+)/,va=/\/\*[^]*?\*\//g;function ba(e){const t={};return e.replace(va,"").split(ma).forEach(s=>{if(s){const n=s.split(ga);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function oe(e){let t="";if(Ee(e))t=e;else if(se(e))for(let s=0;s<e.length;s++){const n=oe(e[s]);n&&(t+=n+" ")}else if(me(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const xa="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ya=Po(xa);function Ei(e){return!!e||e===""}function wa(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=zt(e[n],t[n]);return s}function zt(e,t){if(e===t)return!0;let s=ur(e),n=ur(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=wt(e),n=wt(t),s||n)return e===t;if(s=se(e),n=se(t),s||n)return s&&n?wa(e,t):!1;if(s=me(e),n=me(t),s||n){if(!s||!n)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const l in e){const c=e.hasOwnProperty(l),a=t.hasOwnProperty(l);if(c&&!a||!c&&a||!zt(e[l],t[l]))return!1}}return String(e)===String(t)}function jo(e,t){return e.findIndex(s=>zt(s,t))}const $i=e=>!!(e&&e.__v_isRef===!0),j=e=>Ee(e)?e:e==null?"":se(e)||me(e)&&(e.toString===ki||!le(e.toString))?$i(e)?j(e.value):JSON.stringify(e,Ai,2):String(e),Ai=(e,t)=>$i(t)?Ai(e,t.value):ds(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,o],r)=>(s[Fn(n,r)+" =>"]=o,s),{})}:xs(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Fn(s))}:wt(t)?Fn(t):me(t)&&!se(t)&&!Ci(t)?String(t):t,Fn=(e,t="")=>{var s;return wt(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};let Ge;class _a{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Ge,!t&&Ge&&(this.index=(Ge.scopes||(Ge.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=Ge;try{return Ge=this,t()}finally{Ge=s}}}on(){++this._on===1&&(this.prevScope=Ge,Ge=this)}off(){this._on>0&&--this._on===0&&(Ge=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function ka(){return Ge}let ke;const Un=new WeakSet;class Ti{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ge&&Ge.active&&Ge.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Un.has(this)&&(Un.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ri(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,fr(this),Oi(this);const t=ke,s=it;ke=this,it=!0;try{return this.fn()}finally{Bi(this),ke=t,it=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ho(t);this.deps=this.depsTail=void 0,fr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Un.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){io(this)&&this.run()}get dirty(){return io(this)}}let Mi=0,Rs,Os;function Ri(e,t=!1){if(e.flags|=8,t){e.next=Os,Os=e;return}e.next=Rs,Rs=e}function Do(){Mi++}function Vo(){if(--Mi>0)return;if(Os){let t=Os;for(Os=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Rs;){let t=Rs;for(Rs=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Oi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Bi(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),Ho(n),Ca(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function io(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Pi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Pi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ds)||(e.globalVersion=Ds,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!io(e))))return;e.flags|=2;const t=e.dep,s=ke,n=it;ke=e,it=!0;try{Oi(e);const o=e.fn(e._value);(t.version===0||Ft(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ke=s,it=n,Bi(e),e.flags&=-3}}function Ho(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let r=s.computed.deps;r;r=r.nextDep)Ho(r,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Ca(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let it=!0;const Ni=[];function Ot(){Ni.push(it),it=!1}function Bt(){const e=Ni.pop();it=e===void 0?!0:e}function fr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ke;ke=void 0;try{t()}finally{ke=s}}}let Ds=0;class Sa{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Fo{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ke||!it||ke===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ke)s=this.activeLink=new Sa(ke,this),ke.deps?(s.prevDep=ke.depsTail,ke.depsTail.nextDep=s,ke.depsTail=s):ke.deps=ke.depsTail=s,Li(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ke.depsTail,s.nextDep=void 0,ke.depsTail.nextDep=s,ke.depsTail=s,ke.deps===s&&(ke.deps=n)}return s}trigger(t){this.version++,Ds++,this.notify(t)}notify(t){Do();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Vo()}}}function Li(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Li(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const lo=new WeakMap,ss=Symbol(""),ao=Symbol(""),Vs=Symbol("");function Ie(e,t,s){if(it&&ke){let n=lo.get(e);n||lo.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new Fo),o.map=n,o.key=s),o.track()}}function At(e,t,s,n,o,r){const l=lo.get(e);if(!l){Ds++;return}const c=a=>{a&&a.trigger()};if(Do(),t==="clear")l.forEach(c);else{const a=se(e),f=a&&Io(s);if(a&&s==="length"){const d=Number(n);l.forEach((p,b)=>{(b==="length"||b===Vs||!wt(b)&&b>=d)&&c(p)})}else switch((s!==void 0||l.has(void 0))&&c(l.get(s)),f&&c(l.get(Vs)),t){case"add":a?f&&c(l.get("length")):(c(l.get(ss)),ds(e)&&c(l.get(ao)));break;case"delete":a||(c(l.get(ss)),ds(e)&&c(l.get(ao)));break;case"set":ds(e)&&c(l.get(ss));break}}Vo()}function ls(e){const t=fe(e);return t===e?t:(Ie(t,"iterate",Vs),tt(e)?t:t.map(at))}function Tn(e){return Ie(e=fe(e),"iterate",Vs),e}function jt(e,t){return Pt(e)?ms(ns(e)?at(t):t):at(t)}const Ea={__proto__:null,[Symbol.iterator](){return zn(this,Symbol.iterator,e=>jt(this,e))},concat(...e){return ls(this).concat(...e.map(t=>se(t)?ls(t):t))},entries(){return zn(this,"entries",e=>(e[1]=jt(this,e[1]),e))},every(e,t){return kt(this,"every",e,t,void 0,arguments)},filter(e,t){return kt(this,"filter",e,t,s=>s.map(n=>jt(this,n)),arguments)},find(e,t){return kt(this,"find",e,t,s=>jt(this,s),arguments)},findIndex(e,t){return kt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return kt(this,"findLast",e,t,s=>jt(this,s),arguments)},findLastIndex(e,t){return kt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return kt(this,"forEach",e,t,void 0,arguments)},includes(...e){return qn(this,"includes",e)},indexOf(...e){return qn(this,"indexOf",e)},join(e){return ls(this).join(e)},lastIndexOf(...e){return qn(this,"lastIndexOf",e)},map(e,t){return kt(this,"map",e,t,void 0,arguments)},pop(){return _s(this,"pop")},push(...e){return _s(this,"push",e)},reduce(e,...t){return pr(this,"reduce",e,t)},reduceRight(e,...t){return pr(this,"reduceRight",e,t)},shift(){return _s(this,"shift")},some(e,t){return kt(this,"some",e,t,void 0,arguments)},splice(...e){return _s(this,"splice",e)},toReversed(){return ls(this).toReversed()},toSorted(e){return ls(this).toSorted(e)},toSpliced(...e){return ls(this).toSpliced(...e)},unshift(...e){return _s(this,"unshift",e)},values(){return zn(this,"values",e=>jt(this,e))}};function zn(e,t,s){const n=Tn(e),o=n[t]();return n!==e&&!tt(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=s(r.value)),r}),o}const $a=Array.prototype;function kt(e,t,s,n,o,r){const l=Tn(e),c=l!==e&&!tt(e),a=l[t];if(a!==$a[t]){const p=a.apply(e,r);return c?at(p):p}let f=s;l!==e&&(c?f=function(p,b){return s.call(this,jt(e,p),b,e)}:s.length>2&&(f=function(p,b){return s.call(this,p,b,e)}));const d=a.call(l,f,n);return c&&o?o(d):d}function pr(e,t,s,n){const o=Tn(e);let r=s;return o!==e&&(tt(e)?s.length>3&&(r=function(l,c,a){return s.call(this,l,c,a,e)}):r=function(l,c,a){return s.call(this,l,jt(e,c),a,e)}),o[t](r,...n)}function qn(e,t,s){const n=fe(e);Ie(n,"iterate",Vs);const o=n[t](...s);return(o===-1||o===!1)&&qo(s[0])?(s[0]=fe(s[0]),n[t](...s)):o}function _s(e,t,s=[]){Ot(),Do();const n=fe(e)[t].apply(e,s);return Vo(),Bt(),n}const Aa=Po("__proto__,__v_isRef,__isVue"),Ii=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(wt));function Ta(e){wt(e)||(e=String(e));const t=fe(this);return Ie(t,"has",e),t.hasOwnProperty(e)}class ji{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return r;if(s==="__v_raw")return n===(o?r?Da:Fi:r?Hi:Vi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const l=se(t);if(!o){let a;if(l&&(a=Ea[s]))return a;if(s==="hasOwnProperty")return Ta}const c=Reflect.get(t,s,Ve(t)?t:n);if((wt(s)?Ii.has(s):Aa(s))||(o||Ie(t,"get",s),r))return c;if(Ve(c)){const a=l&&Io(s)?c:c.value;return o&&me(a)?uo(a):a}return me(c)?o?uo(c):Mn(c):c}}class Di extends ji{constructor(t=!1){super(!1,t)}set(t,s,n,o){let r=t[s];const l=se(t)&&Io(s);if(!this._isShallow){const f=Pt(r);if(!tt(n)&&!Pt(n)&&(r=fe(r),n=fe(n)),!l&&Ve(r)&&!Ve(n))return f||(r.value=n),!0}const c=l?Number(s)<t.length:he(t,s),a=Reflect.set(t,s,n,Ve(t)?t:o);return t===fe(o)&&(c?Ft(n,r)&&At(t,"set",s,n):At(t,"add",s,n)),a}deleteProperty(t,s){const n=he(t,s);t[s];const o=Reflect.deleteProperty(t,s);return o&&n&&At(t,"delete",s,void 0),o}has(t,s){const n=Reflect.has(t,s);return(!wt(s)||!Ii.has(s))&&Ie(t,"has",s),n}ownKeys(t){return Ie(t,"iterate",se(t)?"length":ss),Reflect.ownKeys(t)}}class Ma extends ji{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Ra=new Di,Oa=new Ma,Ba=new Di(!0);const co=e=>e,Ys=e=>Reflect.getPrototypeOf(e);function Pa(e,t,s){return function(...n){const o=this.__v_raw,r=fe(o),l=ds(r),c=e==="entries"||e===Symbol.iterator&&l,a=e==="keys"&&l,f=o[e](...n),d=s?co:t?ms:at;return!t&&Ie(r,"iterate",a?ao:ss),Pe(Object.create(f),{next(){const{value:p,done:b}=f.next();return b?{value:p,done:b}:{value:c?[d(p[0]),d(p[1])]:d(p),done:b}}})}}function Xs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Na(e,t){const s={get(o){const r=this.__v_raw,l=fe(r),c=fe(o);e||(Ft(o,c)&&Ie(l,"get",o),Ie(l,"get",c));const{has:a}=Ys(l),f=t?co:e?ms:at;if(a.call(l,o))return f(r.get(o));if(a.call(l,c))return f(r.get(c));r!==l&&r.get(o)},get size(){const o=this.__v_raw;return!e&&Ie(fe(o),"iterate",ss),o.size},has(o){const r=this.__v_raw,l=fe(r),c=fe(o);return e||(Ft(o,c)&&Ie(l,"has",o),Ie(l,"has",c)),o===c?r.has(o):r.has(o)||r.has(c)},forEach(o,r){const l=this,c=l.__v_raw,a=fe(c),f=t?co:e?ms:at;return!e&&Ie(a,"iterate",ss),c.forEach((d,p)=>o.call(r,f(d),f(p),l))}};return Pe(s,e?{add:Xs("add"),set:Xs("set"),delete:Xs("delete"),clear:Xs("clear")}:{add(o){!t&&!tt(o)&&!Pt(o)&&(o=fe(o));const r=fe(this);return Ys(r).has.call(r,o)||(r.add(o),At(r,"add",o,o)),this},set(o,r){!t&&!tt(r)&&!Pt(r)&&(r=fe(r));const l=fe(this),{has:c,get:a}=Ys(l);let f=c.call(l,o);f||(o=fe(o),f=c.call(l,o));const d=a.call(l,o);return l.set(o,r),f?Ft(r,d)&&At(l,"set",o,r):At(l,"add",o,r),this},delete(o){const r=fe(this),{has:l,get:c}=Ys(r);let a=l.call(r,o);a||(o=fe(o),a=l.call(r,o)),c&&c.call(r,o);const f=r.delete(o);return a&&At(r,"delete",o,void 0),f},clear(){const o=fe(this),r=o.size!==0,l=o.clear();return r&&At(o,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=Pa(o,e,t)}),s}function Uo(e,t){const s=Na(e,t);return(n,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(he(s,o)&&o in n?s:n,o,r)}const La={get:Uo(!1,!1)},Ia={get:Uo(!1,!0)},ja={get:Uo(!0,!1)};const Vi=new WeakMap,Hi=new WeakMap,Fi=new WeakMap,Da=new WeakMap;function Va(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ha(e){return e.__v_skip||!Object.isExtensible(e)?0:Va(da(e))}function Mn(e){return Pt(e)?e:zo(e,!1,Ra,La,Vi)}function Ui(e){return zo(e,!1,Ba,Ia,Hi)}function uo(e){return zo(e,!0,Oa,ja,Fi)}function zo(e,t,s,n,o){if(!me(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=Ha(e);if(r===0)return e;const l=o.get(e);if(l)return l;const c=new Proxy(e,r===2?n:s);return o.set(e,c),c}function ns(e){return Pt(e)?ns(e.__v_raw):!!(e&&e.__v_isReactive)}function Pt(e){return!!(e&&e.__v_isReadonly)}function tt(e){return!!(e&&e.__v_isShallow)}function qo(e){return e?!!e.__v_raw:!1}function fe(e){const t=e&&e.__v_raw;return t?fe(t):e}function Fa(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&Si(e,"__v_skip",!0),e}const at=e=>me(e)?Mn(e):e,ms=e=>me(e)?uo(e):e;function Ve(e){return e?e.__v_isRef===!0:!1}function H(e){return zi(e,!1)}function Ua(e){return zi(e,!0)}function zi(e,t){return Ve(e)?e:new za(e,t)}class za{constructor(t,s){this.dep=new Fo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:fe(t),this._value=s?t:at(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||tt(t)||Pt(t);t=n?t:fe(t),Ft(t,s)&&(this._rawValue=t,this._value=n?t:at(t),this.dep.trigger())}}function fs(e){return Ve(e)?e.value:e}const qa={get:(e,t,s)=>t==="__v_raw"?e:fs(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Ve(o)&&!Ve(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function qi(e){return ns(e)?e:new Proxy(e,qa)}class Wa{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new Fo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ke!==this)return Ri(this,!0),!0}get value(){const t=this.dep.track();return Pi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ka(e,t,s=!1){let n,o;return le(e)?n=e:(n=e.get,o=e.set),new Wa(n,o,s)}const Qs={},hn=new WeakMap;let Zt;function Ga(e,t=!1,s=Zt){if(s){let n=hn.get(s);n||hn.set(s,n=[]),n.push(e)}}function Ja(e,t,s=we){const{immediate:n,deep:o,once:r,scheduler:l,augmentJob:c,call:a}=s,f=V=>o?V:tt(V)||o===!1||o===0?Tt(V,1):Tt(V);let d,p,b,y,E=!1,$=!1;if(Ve(e)?(p=()=>e.value,E=tt(e)):ns(e)?(p=()=>f(e),E=!0):se(e)?($=!0,E=e.some(V=>ns(V)||tt(V)),p=()=>e.map(V=>{if(Ve(V))return V.value;if(ns(V))return f(V);if(le(V))return a?a(V,2):V()})):le(e)?t?p=a?()=>a(e,2):e:p=()=>{if(b){Ot();try{b()}finally{Bt()}}const V=Zt;Zt=d;try{return a?a(e,3,[y]):e(y)}finally{Zt=V}}:p=bt,t&&o){const V=p,Z=o===!0?1/0:o;p=()=>Tt(V(),Z)}const L=ka(),q=()=>{d.stop(),L&&L.active&&Lo(L.effects,d)};if(r&&t){const V=t;t=(...Z)=>{V(...Z),q()}}let N=$?new Array(e.length).fill(Qs):Qs;const K=V=>{if(!(!(d.flags&1)||!d.dirty&&!V))if(t){const Z=d.run();if(o||E||($?Z.some((ne,re)=>Ft(ne,N[re])):Ft(Z,N))){b&&b();const ne=Zt;Zt=d;try{const re=[Z,N===Qs?void 0:$&&N[0]===Qs?[]:N,y];N=Z,a?a(t,3,re):t(...re)}finally{Zt=ne}}}else d.run()};return c&&c(K),d=new Ti(p),d.scheduler=l?()=>l(K,!1):K,y=V=>Ga(V,!1,d),b=d.onStop=()=>{const V=hn.get(d);if(V){if(a)a(V,4);else for(const Z of V)Z();hn.delete(d)}},t?n?K(!0):N=d.run():l?l(K.bind(null,!0),!0):d.run(),q.pause=d.pause.bind(d),q.resume=d.resume.bind(d),q.stop=q,q}function Tt(e,t=1/0,s){if(t<=0||!me(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Ve(e))Tt(e.value,t,s);else if(se(e))for(let n=0;n<e.length;n++)Tt(e[n],t,s);else if(xs(e)||ds(e))e.forEach(n=>{Tt(n,t,s)});else if(Ci(e)){for(const n in e)Tt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Tt(e[n],t,s)}return e}function Gs(e,t,s,n){try{return n?e(...n):e()}catch(o){Rn(o,t,s)}}function ct(e,t,s,n){if(le(e)){const o=Gs(e,t,s,n);return o&&_i(o)&&o.catch(r=>{Rn(r,t,s)}),o}if(se(e)){const o=[];for(let r=0;r<e.length;r++)o.push(ct(e[r],t,s,n));return o}}function Rn(e,t,s,n=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||we;if(t){let c=t.parent;const a=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const d=c.ec;if(d){for(let p=0;p<d.length;p++)if(d[p](e,a,f)===!1)return}c=c.parent}if(r){Ot(),Gs(r,null,10,[e,a,f]),Bt();return}}Ya(e,s,o,n,l)}function Ya(e,t,s,n=!0,o=!1){if(o)throw e;console.error(e)}const Ue=[];let mt=-1;const ps=[];let Dt=null,as=0;const Wi=Promise.resolve();let mn=null;function Ht(e){const t=mn||Wi;return e?t.then(this?e.bind(this):e):t}function Xa(e){let t=mt+1,s=Ue.length;for(;t<s;){const n=t+s>>>1,o=Ue[n],r=Hs(o);r<e||r===e&&o.flags&2?t=n+1:s=n}return t}function Wo(e){if(!(e.flags&1)){const t=Hs(e),s=Ue[Ue.length-1];!s||!(e.flags&2)&&t>=Hs(s)?Ue.push(e):Ue.splice(Xa(t),0,e),e.flags|=1,Ki()}}function Ki(){mn||(mn=Wi.then(Ji))}function Qa(e){se(e)?ps.push(...e):Dt&&e.id===-1?Dt.splice(as+1,0,e):e.flags&1||(ps.push(e),e.flags|=1),Ki()}function hr(e,t,s=mt+1){for(;s<Ue.length;s++){const n=Ue[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;Ue.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Gi(e){if(ps.length){const t=[...new Set(ps)].sort((s,n)=>Hs(s)-Hs(n));if(ps.length=0,Dt){Dt.push(...t);return}for(Dt=t,as=0;as<Dt.length;as++){const s=Dt[as];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}Dt=null,as=0}}const Hs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ji(e){try{for(mt=0;mt<Ue.length;mt++){const t=Ue[mt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Gs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;mt<Ue.length;mt++){const t=Ue[mt];t&&(t.flags&=-2)}mt=-1,Ue.length=0,Gi(),mn=null,(Ue.length||ps.length)&&Ji()}}let Ye=null,Yi=null;function gn(e){const t=Ye;return Ye=e,Yi=e&&e.type.__scopeId||null,t}function fo(e,t=Ye,s){if(!t||e._n)return e;const n=(...o)=>{n._d&&xn(-1);const r=gn(t);let l;try{l=e(...o)}finally{gn(r),n._d&&xn(1)}return l};return n._n=!0,n._c=!0,n._d=!0,n}function xe(e,t){if(Ye===null)return e;const s=Ln(Ye),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,l,c,a=we]=t[o];r&&(le(r)&&(r={mounted:r,updated:r}),r.deep&&Tt(l),n.push({dir:r,instance:s,value:l,oldValue:void 0,arg:c,modifiers:a}))}return e}function Jt(e,t,s,n){const o=e.dirs,r=t&&t.dirs;for(let l=0;l<o.length;l++){const c=o[l];r&&(c.oldValue=r[l].value);let a=c.dir[n];a&&(Ot(),ct(a,s,8,[e.el,c,e,t]),Bt())}}function on(e,t){if(je){let s=je.provides;const n=je.parent&&je.parent.provides;n===s&&(s=je.provides=Object.create(n)),s[e]=t}}function lt(e,t,s=!1){const n=Ml();if(n||hs){let o=hs?hs._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return s&&le(t)?t.call(n&&n.proxy):t}}const Za=Symbol.for("v-scx"),ec=()=>lt(Za);function Rt(e,t,s){return Xi(e,t,s)}function Xi(e,t,s=we){const{immediate:n,deep:o,flush:r,once:l}=s,c=Pe({},s),a=t&&n||!t&&r!=="post";let f;if(zs){if(r==="sync"){const y=ec();f=y.__watcherHandles||(y.__watcherHandles=[])}else if(!a){const y=()=>{};return y.stop=bt,y.resume=bt,y.pause=bt,y}}const d=je;c.call=(y,E,$)=>ct(y,d,E,$);let p=!1;r==="post"?c.scheduler=y=>{Le(y,d&&d.suspense)}:r!=="sync"&&(p=!0,c.scheduler=(y,E)=>{E?y():Wo(y)}),c.augmentJob=y=>{t&&(y.flags|=4),p&&(y.flags|=2,d&&(y.id=d.uid,y.i=d))};const b=Ja(e,t,c);return zs&&(f?f.push(b):a&&b()),b}function tc(e,t,s){const n=this.proxy,o=Ee(e)?e.includes(".")?Qi(n,e):()=>n[e]:e.bind(n,n);let r;le(t)?r=t:(r=t.handler,s=t);const l=Js(this),c=Xi(o,r.bind(n),s);return l(),c}function Qi(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;o<s.length&&n;o++)n=n[s[o]];return n}}const Zi=Symbol("_vte"),el=e=>e.__isTeleport,Bs=e=>e&&(e.disabled||e.disabled===""),mr=e=>e&&(e.defer||e.defer===""),gr=e=>typeof SVGElement<"u"&&e instanceof SVGElement,vr=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,po=(e,t)=>{const s=e&&e.to;return Ee(s)?t?t(s):null:s},tl={name:"Teleport",__isTeleport:!0,process(e,t,s,n,o,r,l,c,a,f){const{mc:d,pc:p,pbc:b,o:{insert:y,querySelector:E,createText:$,createComment:L}}=f,q=Bs(t.props);let{shapeFlag:N,children:K,dynamicChildren:V}=t;if(e==null){const Z=t.el=$(""),ne=t.anchor=$("");y(Z,s,n),y(ne,s,n);const re=(C,P)=>{N&16&&d(K,C,P,o,r,l,c,a)},Q=()=>{const C=t.target=po(t.props,E),P=ho(C,t,$,y);C&&(l!=="svg"&&gr(C)?l="svg":l!=="mathml"&&vr(C)&&(l="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(C),q||(re(C,P),rn(t,!1)))};q&&(re(s,ne),rn(t,!0)),mr(t.props)?(t.el.__isMounted=!1,Le(()=>{Q(),delete t.el.__isMounted},r)):Q()}else{if(mr(t.props)&&e.el.__isMounted===!1){Le(()=>{tl.process(e,t,s,n,o,r,l,c,a,f)},r);return}t.el=e.el,t.targetStart=e.targetStart;const Z=t.anchor=e.anchor,ne=t.target=e.target,re=t.targetAnchor=e.targetAnchor,Q=Bs(e.props),C=Q?s:ne,P=Q?Z:re;if(l==="svg"||gr(ne)?l="svg":(l==="mathml"||vr(ne))&&(l="mathml"),V?(b(e.dynamicChildren,V,C,o,r,l,c),Jo(e,t,!0)):a||p(e,t,C,P,o,r,l,c,!1),q)Q?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Zs(t,s,Z,f,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=po(t.props,E);D&&Zs(t,D,null,f,0)}else Q&&Zs(t,ne,re,f,1);rn(t,q)}},remove(e,t,s,{um:n,o:{remove:o}},r){const{shapeFlag:l,children:c,anchor:a,targetStart:f,targetAnchor:d,target:p,props:b}=e;if(p&&(o(f),o(d)),r&&o(a),l&16){const y=r||!Bs(b);for(let E=0;E<c.length;E++){const $=c[E];n($,t,s,y,!!$.dynamicChildren)}}},move:Zs,hydrate:sc};function Zs(e,t,s,{o:{insert:n},m:o},r=2){r===0&&n(e.targetAnchor,t,s);const{el:l,anchor:c,shapeFlag:a,children:f,props:d}=e,p=r===2;if(p&&n(l,t,s),(!p||Bs(d))&&a&16)for(let b=0;b<f.length;b++)o(f[b],t,s,2);p&&n(c,t,s)}function sc(e,t,s,n,o,r,{o:{nextSibling:l,parentNode:c,querySelector:a,insert:f,createText:d}},p){function b(L,q){let N=q;for(;N;){if(N&&N.nodeType===8){if(N.data==="teleport start anchor")t.targetStart=N;else if(N.data==="teleport anchor"){t.targetAnchor=N,L._lpa=t.targetAnchor&&l(t.targetAnchor);break}}N=l(N)}}function y(L,q){q.anchor=p(l(L),q,c(L),s,n,o,r)}const E=t.target=po(t.props,a),$=Bs(t.props);if(E){const L=E._lpa||E.firstChild;t.shapeFlag&16&&($?(y(e,t),b(E,L),t.targetAnchor||ho(E,t,d,f,c(e)===E?e:null)):(t.anchor=l(e),b(E,L),t.targetAnchor||ho(E,t,d,f),p(L&&l(L),t,E,s,n,o,r))),rn(t,$)}else $&&t.shapeFlag&16&&(y(e,t),t.targetStart=e,t.targetAnchor=l(e));return t.anchor&&l(t.anchor)}const nc=tl;function rn(e,t){const s=e.ctx;if(s&&s.ut){let n,o;for(t?(n=e.el,o=e.anchor):(n=e.targetStart,o=e.targetAnchor);n&&n!==o;)n.nodeType===1&&n.setAttribute("data-v-owner",s.uid),n=n.nextSibling;s.ut()}}function ho(e,t,s,n,o=null){const r=t.targetStart=s(""),l=t.targetAnchor=s("");return r[Zi]=l,e&&(n(r,e,o),n(l,e,o)),l}const gt=Symbol("_leaveCb"),ks=Symbol("_enterCb");function oc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Gt(()=>{e.isMounted=!0}),ul(()=>{e.isUnmounting=!0}),e}const Ze=[Function,Array],sl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ze,onEnter:Ze,onAfterEnter:Ze,onEnterCancelled:Ze,onBeforeLeave:Ze,onLeave:Ze,onAfterLeave:Ze,onLeaveCancelled:Ze,onBeforeAppear:Ze,onAppear:Ze,onAfterAppear:Ze,onAppearCancelled:Ze},nl=e=>{const t=e.subTree;return t.component?nl(t.component):t},rc={name:"BaseTransition",props:sl,setup(e,{slots:t}){const s=Ml(),n=oc();return()=>{const o=t.default&&il(t.default(),!0);if(!o||!o.length)return;const r=ol(o),l=fe(e),{mode:c}=l;if(n.isLeaving)return Wn(r);const a=br(r);if(!a)return Wn(r);let f=mo(a,l,n,s,p=>f=p);a.type!==ze&&Fs(a,f);let d=s.subTree&&br(s.subTree);if(d&&d.type!==ze&&!es(d,a)&&nl(s).type!==ze){let p=mo(d,l,n,s);if(Fs(d,p),c==="out-in"&&a.type!==ze)return n.isLeaving=!0,p.afterLeave=()=>{n.isLeaving=!1,s.job.flags&8||s.update(),delete p.afterLeave,d=void 0},Wn(r);c==="in-out"&&a.type!==ze?p.delayLeave=(b,y,E)=>{const $=rl(n,d);$[String(d.key)]=d,b[gt]=()=>{y(),b[gt]=void 0,delete f.delayedLeave,d=void 0},f.delayedLeave=()=>{E(),delete f.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return r}}};function ol(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==ze){t=s;break}}return t}const ic=rc;function rl(e,t){const{leavingVNodes:s}=e;let n=s.get(t.type);return n||(n=Object.create(null),s.set(t.type,n)),n}function mo(e,t,s,n,o){const{appear:r,mode:l,persisted:c=!1,onBeforeEnter:a,onEnter:f,onAfterEnter:d,onEnterCancelled:p,onBeforeLeave:b,onLeave:y,onAfterLeave:E,onLeaveCancelled:$,onBeforeAppear:L,onAppear:q,onAfterAppear:N,onAppearCancelled:K}=t,V=String(e.key),Z=rl(s,e),ne=(C,P)=>{C&&ct(C,n,9,P)},re=(C,P)=>{const D=P[1];ne(C,P),se(C)?C.every(A=>A.length<=1)&&D():C.length<=1&&D()},Q={mode:l,persisted:c,beforeEnter(C){let P=a;if(!s.isMounted)if(r)P=L||a;else return;C[gt]&&C[gt](!0);const D=Z[V];D&&es(e,D)&&D.el[gt]&&D.el[gt](),ne(P,[C])},enter(C){if(Z[V]===e)return;let P=f,D=d,A=p;if(!s.isMounted)if(r)P=q||f,D=N||d,A=K||p;else return;let F=!1;C[ks]=k=>{F||(F=!0,k?ne(A,[C]):ne(D,[C]),Q.delayedLeave&&Q.delayedLeave(),C[ks]=void 0)};const U=C[ks].bind(null,!1);P?re(P,[C,U]):U()},leave(C,P){const D=String(e.key);if(C[ks]&&C[ks](!0),s.isUnmounting)return P();ne(b,[C]);let A=!1;C[gt]=U=>{A||(A=!0,P(),U?ne($,[C]):ne(E,[C]),C[gt]=void 0,Z[D]===e&&delete Z[D])};const F=C[gt].bind(null,!1);Z[D]=e,y?re(y,[C,F]):F()},clone(C){const P=mo(C,t,s,n,o);return o&&o(P),P}};return Q}function Wn(e){if(On(e))return e=qt(e),e.children=null,e}function br(e){if(!On(e))return el(e.type)&&e.children?ol(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&le(s.default))return s.default()}}function Fs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Fs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function il(e,t=!1,s){let n=[],o=0;for(let r=0;r<e.length;r++){let l=e[r];const c=s==null?l.key:String(s)+String(l.key!=null?l.key:r);l.type===ve?(l.patchFlag&128&&o++,n=n.concat(il(l.children,t,c))):(t||l.type!==ze)&&n.push(c!=null?qt(l,{key:c}):l)}if(o>1)for(let r=0;r<n.length;r++)n[r].patchFlag=-2;return n}function ll(e,t){return le(e)?Pe({name:e.name},t,{setup:e}):e}function al(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function xr(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const vn=new WeakMap;function Ps(e,t,s,n,o=!1){if(se(e)){e.forEach(($,L)=>Ps($,t&&(se(t)?t[L]:t),s,n,o));return}if(Ns(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Ps(e,t,s,n.component.subTree);return}const r=n.shapeFlag&4?Ln(n.component):n.el,l=o?null:r,{i:c,r:a}=e,f=t&&t.r,d=c.refs===we?c.refs={}:c.refs,p=c.setupState,b=fe(p),y=p===we?wi:$=>xr(d,$)?!1:he(b,$),E=($,L)=>!(L&&xr(d,L));if(f!=null&&f!==a){if(yr(t),Ee(f))d[f]=null,y(f)&&(p[f]=null);else if(Ve(f)){const $=t;E(f,$.k)&&(f.value=null),$.k&&(d[$.k]=null)}}if(le(a))Gs(a,c,12,[l,d]);else{const $=Ee(a),L=Ve(a);if($||L){const q=()=>{if(e.f){const N=$?y(a)?p[a]:d[a]:E()||!e.k?a.value:d[e.k];if(o)se(N)&&Lo(N,r);else if(se(N))N.includes(r)||N.push(r);else if($)d[a]=[r],y(a)&&(p[a]=d[a]);else{const K=[r];E(a,e.k)&&(a.value=K),e.k&&(d[e.k]=K)}}else $?(d[a]=l,y(a)&&(p[a]=l)):L&&(E(a,e.k)&&(a.value=l),e.k&&(d[e.k]=l))};if(l){const N=()=>{q(),vn.delete(e)};N.id=-1,vn.set(e,N),Le(N,s)}else yr(e),q()}}}function yr(e){const t=vn.get(e);t&&(t.flags|=8,vn.delete(e))}An().requestIdleCallback;An().cancelIdleCallback;const Ns=e=>!!e.type.__asyncLoader,On=e=>e.type.__isKeepAlive;function lc(e,t){cl(e,"a",t)}function ac(e,t){cl(e,"da",t)}function cl(e,t,s=je){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Bn(t,n,s),s){let o=s.parent;for(;o&&o.parent;)On(o.parent.vnode)&&cc(n,t,s,o),o=o.parent}}function cc(e,t,s,n){const o=Bn(t,e,n,!0);is(()=>{Lo(n[t],o)},s)}function Bn(e,t,s=je,n=!1){if(s){const o=s[e]||(s[e]=[]),r=t.__weh||(t.__weh=(...l)=>{Ot();const c=Js(s),a=ct(t,s,e,l);return c(),Bt(),a});return n?o.unshift(r):o.push(r),r}}const Nt=e=>(t,s=je)=>{(!zs||e==="sp")&&Bn(e,(...n)=>t(...n),s)},uc=Nt("bm"),Gt=Nt("m"),dc=Nt("bu"),fc=Nt("u"),ul=Nt("bum"),is=Nt("um"),pc=Nt("sp"),hc=Nt("rtg"),mc=Nt("rtc");function gc(e,t=je){Bn("ec",e,t)}const vc="components";function bc(e,t){return yc(vc,e,!0,t)||e}const xc=Symbol.for("v-ndc");function yc(e,t,s=!0,n=!1){const o=Ye||je;if(o){const r=o.type;{const c=ou(r,!1);if(c&&(c===t||c===nt(t)||c===En(nt(t))))return r}const l=wr(o[e]||r[e],t)||wr(o.appContext[e],t);return!l&&n?r:l}}function wr(e,t){return e&&(e[t]||e[nt(t)]||e[En(nt(t))])}function De(e,t,s,n){let o;const r=s,l=se(e);if(l||Ee(e)){const c=l&&ns(e);let a=!1,f=!1;c&&(a=!tt(e),f=Pt(e),e=Tn(e)),o=new Array(e.length);for(let d=0,p=e.length;d<p;d++)o[d]=t(a?f?ms(at(e[d])):at(e[d]):e[d],d,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let c=0;c<e;c++)o[c]=t(c+1,c,void 0,r)}else if(me(e))if(e[Symbol.iterator])o=Array.from(e,(c,a)=>t(c,a,void 0,r));else{const c=Object.keys(e);o=new Array(c.length);for(let a=0,f=c.length;a<f;a++){const d=c[a];o[a]=t(e[d],d,a,r)}}else o=[];return o}const go=e=>e?Rl(e)?Ln(e):go(e.parent):null,Ls=Pe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>go(e.parent),$root:e=>go(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>fl(e),$forceUpdate:e=>e.f||(e.f=()=>{Wo(e.update)}),$nextTick:e=>e.n||(e.n=Ht.bind(e.proxy)),$watch:e=>tc.bind(e)}),Kn=(e,t)=>e!==we&&!e.__isScriptSetup&&he(e,t),wc={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:r,accessCache:l,type:c,appContext:a}=e;if(t[0]!=="$"){const b=l[t];if(b!==void 0)switch(b){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return r[t]}else{if(Kn(n,t))return l[t]=1,n[t];if(o!==we&&he(o,t))return l[t]=2,o[t];if(he(r,t))return l[t]=3,r[t];if(s!==we&&he(s,t))return l[t]=4,s[t];vo&&(l[t]=0)}}const f=Ls[t];let d,p;if(f)return t==="$attrs"&&Ie(e.attrs,"get",""),f(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(s!==we&&he(s,t))return l[t]=4,s[t];if(p=a.config.globalProperties,he(p,t))return p[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:r}=e;return Kn(o,t)?(o[t]=s,!0):n!==we&&he(n,t)?(n[t]=s,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:r,type:l}},c){let a;return!!(s[c]||e!==we&&c[0]!=="$"&&he(e,c)||Kn(t,c)||he(r,c)||he(n,c)||he(Ls,c)||he(o.config.globalProperties,c)||(a=l.__cssModules)&&a[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:he(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function _r(e){return se(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let vo=!0;function _c(e){const t=fl(e),s=e.proxy,n=e.ctx;vo=!1,t.beforeCreate&&kr(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:l,watch:c,provide:a,inject:f,created:d,beforeMount:p,mounted:b,beforeUpdate:y,updated:E,activated:$,deactivated:L,beforeDestroy:q,beforeUnmount:N,destroyed:K,unmounted:V,render:Z,renderTracked:ne,renderTriggered:re,errorCaptured:Q,serverPrefetch:C,expose:P,inheritAttrs:D,components:A,directives:F,filters:U}=t;if(f&&kc(f,n,null),l)for(const ce in l){const ae=l[ce];le(ae)&&(n[ce]=ae.bind(s))}if(o){const ce=o.call(s,s);me(ce)&&(e.data=Mn(ce))}if(vo=!0,r)for(const ce in r){const ae=r[ce],$e=le(ae)?ae.bind(s,s):le(ae.get)?ae.get.bind(s,s):bt,be=!le(ae)&&le(ae.set)?ae.set.bind(s):bt,Re=Te({get:$e,set:be});Object.defineProperty(n,ce,{enumerable:!0,configurable:!0,get:()=>Re.value,set:ye=>Re.value=ye})}if(c)for(const ce in c)dl(c[ce],n,s,ce);if(a){const ce=le(a)?a.call(s):a;Reflect.ownKeys(ce).forEach(ae=>{on(ae,ce[ae])})}d&&kr(d,e,"c");function G(ce,ae){se(ae)?ae.forEach($e=>ce($e.bind(s))):ae&&ce(ae.bind(s))}if(G(uc,p),G(Gt,b),G(dc,y),G(fc,E),G(lc,$),G(ac,L),G(gc,Q),G(mc,ne),G(hc,re),G(ul,N),G(is,V),G(pc,C),se(P))if(P.length){const ce=e.exposed||(e.exposed={});P.forEach(ae=>{Object.defineProperty(ce,ae,{get:()=>s[ae],set:$e=>s[ae]=$e,enumerable:!0})})}else e.exposed||(e.exposed={});Z&&e.render===bt&&(e.render=Z),D!=null&&(e.inheritAttrs=D),A&&(e.components=A),F&&(e.directives=F),C&&al(e)}function kc(e,t,s=bt){se(e)&&(e=bo(e));for(const n in e){const o=e[n];let r;me(o)?"default"in o?r=lt(o.from||n,o.default,!0):r=lt(o.from||n):r=lt(o),Ve(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:l=>r.value=l}):t[n]=r}}function kr(e,t,s){ct(se(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function dl(e,t,s,n){let o=n.includes(".")?Qi(s,n):()=>s[n];if(Ee(e)){const r=t[e];le(r)&&Rt(o,r)}else if(le(e))Rt(o,e.bind(s));else if(me(e))if(se(e))e.forEach(r=>dl(r,t,s,n));else{const r=le(e.handler)?e.handler.bind(s):t[e.handler];le(r)&&Rt(o,r,e)}}function fl(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:l}}=e.appContext,c=r.get(t);let a;return c?a=c:!o.length&&!s&&!n?a=t:(a={},o.length&&o.forEach(f=>bn(a,f,l,!0)),bn(a,t,l)),me(t)&&r.set(t,a),a}function bn(e,t,s,n=!1){const{mixins:o,extends:r}=t;r&&bn(e,r,s,!0),o&&o.forEach(l=>bn(e,l,s,!0));for(const l in t)if(!(n&&l==="expose")){const c=Cc[l]||s&&s[l];e[l]=c?c(e[l],t[l]):t[l]}return e}const Cc={data:Cr,props:Sr,emits:Sr,methods:As,computed:As,beforeCreate:He,created:He,beforeMount:He,mounted:He,beforeUpdate:He,updated:He,beforeDestroy:He,beforeUnmount:He,destroyed:He,unmounted:He,activated:He,deactivated:He,errorCaptured:He,serverPrefetch:He,components:As,directives:As,watch:Ec,provide:Cr,inject:Sc};function Cr(e,t){return t?e?function(){return Pe(le(e)?e.call(this,this):e,le(t)?t.call(this,this):t)}:t:e}function Sc(e,t){return As(bo(e),bo(t))}function bo(e){if(se(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function He(e,t){return e?[...new Set([].concat(e,t))]:t}function As(e,t){return e?Pe(Object.create(null),e,t):t}function Sr(e,t){return e?se(e)&&se(t)?[...new Set([...e,...t])]:Pe(Object.create(null),_r(e),_r(t??{})):t}function Ec(e,t){if(!e)return t;if(!t)return e;const s=Pe(Object.create(null),e);for(const n in t)s[n]=He(e[n],t[n]);return s}function pl(){return{app:null,config:{isNativeTag:wi,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let $c=0;function Ac(e,t){return function(n,o=null){le(n)||(n=Pe({},n)),o!=null&&!me(o)&&(o=null);const r=pl(),l=new WeakSet,c=[];let a=!1;const f=r.app={_uid:$c++,_component:n,_props:o,_container:null,_context:r,_instance:null,version:iu,get config(){return r.config},set config(d){},use(d,...p){return l.has(d)||(d&&le(d.install)?(l.add(d),d.install(f,...p)):le(d)&&(l.add(d),d(f,...p))),f},mixin(d){return r.mixins.includes(d)||r.mixins.push(d),f},component(d,p){return p?(r.components[d]=p,f):r.components[d]},directive(d,p){return p?(r.directives[d]=p,f):r.directives[d]},mount(d,p,b){if(!a){const y=f._ceVNode||Ae(n,o);return y.appContext=r,b===!0?b="svg":b===!1&&(b=void 0),e(y,d,b),a=!0,f._container=d,d.__vue_app__=f,Ln(y.component)}},onUnmount(d){c.push(d)},unmount(){a&&(ct(c,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(d,p){return r.provides[d]=p,f},runWithContext(d){const p=hs;hs=f;try{return d()}finally{hs=p}}};return f}}let hs=null;const Tc=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${nt(t)}Modifiers`]||e[`${Kt(t)}Modifiers`];function Mc(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||we;let o=s;const r=t.startsWith("update:"),l=r&&Tc(n,t.slice(7));l&&(l.trim&&(o=s.map(d=>Ee(d)?d.trim():d)),l.number&&(o=s.map($n)));let c,a=n[c=Hn(t)]||n[c=Hn(nt(t))];!a&&r&&(a=n[c=Hn(Kt(t))]),a&&ct(a,e,6,o);const f=n[c+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,ct(f,e,6,o)}}const Rc=new WeakMap;function hl(e,t,s=!1){const n=s?Rc:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const r=e.emits;let l={},c=!1;if(!le(e)){const a=f=>{const d=hl(f,t,!0);d&&(c=!0,Pe(l,d))};!s&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!c?(me(e)&&n.set(e,null),null):(se(r)?r.forEach(a=>l[a]=null):Pe(l,r),me(e)&&n.set(e,l),l)}function Pn(e,t){return!e||!Cn(t)?!1:(t=t.slice(2).replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,Kt(t))||he(e,t))}function Er(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[r],slots:l,attrs:c,emit:a,render:f,renderCache:d,props:p,data:b,setupState:y,ctx:E,inheritAttrs:$}=e,L=gn(e);let q,N;try{if(s.shapeFlag&4){const V=o||n,Z=V;q=vt(f.call(Z,V,d,p,y,b,E)),N=c}else{const V=t;q=vt(V.length>1?V(p,{attrs:c,slots:l,emit:a}):V(p,null)),N=t.props?c:Oc(c)}}catch(V){Is.length=0,Rn(V,e,1),q=Ae(ze)}let K=q;if(N&&$!==!1){const V=Object.keys(N),{shapeFlag:Z}=K;V.length&&Z&7&&(r&&V.some(No)&&(N=Bc(N,r)),K=qt(K,N,!1,!0))}return s.dirs&&(K=qt(K,null,!1,!0),K.dirs=K.dirs?K.dirs.concat(s.dirs):s.dirs),s.transition&&Fs(K,s.transition),q=K,gn(L),q}const Oc=e=>{let t;for(const s in e)(s==="class"||s==="style"||Cn(s))&&((t||(t={}))[s]=e[s]);return t},Bc=(e,t)=>{const s={};for(const n in e)(!No(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Pc(e,t,s){const{props:n,children:o,component:r}=e,{props:l,children:c,patchFlag:a}=t,f=r.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&a>=0){if(a&1024)return!0;if(a&16)return n?$r(n,l,f):!!l;if(a&8){const d=t.dynamicProps;for(let p=0;p<d.length;p++){const b=d[p];if(ml(l,n,b)&&!Pn(f,b))return!0}}}else return(o||c)&&(!c||!c.$stable)?!0:n===l?!1:n?l?$r(n,l,f):!0:!!l;return!1}function $r(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let o=0;o<n.length;o++){const r=n[o];if(ml(t,e,r)&&!Pn(s,r))return!0}return!1}function ml(e,t,s){const n=e[s],o=t[s];return s==="style"&&me(n)&&me(o)?!zt(n,o):n!==o}function Nc({vnode:e,parent:t},s){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=s,t=t.parent;else break}}const gl={},vl=()=>Object.create(gl),bl=e=>Object.getPrototypeOf(e)===gl;function Lc(e,t,s,n=!1){const o={},r=vl();e.propsDefaults=Object.create(null),xl(e,t,o,r);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);s?e.props=n?o:Ui(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function Ic(e,t,s,n){const{props:o,attrs:r,vnode:{patchFlag:l}}=e,c=fe(o),[a]=e.propsOptions;let f=!1;if((n||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let p=0;p<d.length;p++){let b=d[p];if(Pn(e.emitsOptions,b))continue;const y=t[b];if(a)if(he(r,b))y!==r[b]&&(r[b]=y,f=!0);else{const E=nt(b);o[E]=xo(a,c,E,y,e,!1)}else y!==r[b]&&(r[b]=y,f=!0)}}}else{xl(e,t,o,r)&&(f=!0);let d;for(const p in c)(!t||!he(t,p)&&((d=Kt(p))===p||!he(t,d)))&&(a?s&&(s[p]!==void 0||s[d]!==void 0)&&(o[p]=xo(a,c,p,void 0,e,!0)):delete o[p]);if(r!==c)for(const p in r)(!t||!he(t,p))&&(delete r[p],f=!0)}f&&At(e.attrs,"set","")}function xl(e,t,s,n){const[o,r]=e.propsOptions;let l=!1,c;if(t)for(let a in t){if(Ms(a))continue;const f=t[a];let d;o&&he(o,d=nt(a))?!r||!r.includes(d)?s[d]=f:(c||(c={}))[d]=f:Pn(e.emitsOptions,a)||(!(a in n)||f!==n[a])&&(n[a]=f,l=!0)}if(r){const a=fe(s),f=c||we;for(let d=0;d<r.length;d++){const p=r[d];s[p]=xo(o,a,p,f[p],e,!he(f,p))}}return l}function xo(e,t,s,n,o,r){const l=e[s];if(l!=null){const c=he(l,"default");if(c&&n===void 0){const a=l.default;if(l.type!==Function&&!l.skipFactory&&le(a)){const{propsDefaults:f}=o;if(s in f)n=f[s];else{const d=Js(o);n=f[s]=a.call(null,t),d()}}else n=a;o.ce&&o.ce._setProp(s,n)}l[0]&&(r&&!c?n=!1:l[1]&&(n===""||n===Kt(s))&&(n=!0))}return n}const jc=new WeakMap;function yl(e,t,s=!1){const n=s?jc:t.propsCache,o=n.get(e);if(o)return o;const r=e.props,l={},c=[];let a=!1;if(!le(e)){const d=p=>{a=!0;const[b,y]=yl(p,t,!0);Pe(l,b),y&&c.push(...y)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!r&&!a)return me(e)&&n.set(e,us),us;if(se(r))for(let d=0;d<r.length;d++){const p=nt(r[d]);Ar(p)&&(l[p]=we)}else if(r)for(const d in r){const p=nt(d);if(Ar(p)){const b=r[d],y=l[p]=se(b)||le(b)?{type:b}:Pe({},b),E=y.type;let $=!1,L=!0;if(se(E))for(let q=0;q<E.length;++q){const N=E[q],K=le(N)&&N.name;if(K==="Boolean"){$=!0;break}else K==="String"&&(L=!1)}else $=le(E)&&E.name==="Boolean";y[0]=$,y[1]=L,($||he(y,"default"))&&c.push(p)}}const f=[l,c];return me(e)&&n.set(e,f),f}function Ar(e){return e[0]!=="$"&&!Ms(e)}const Ko=e=>e==="_"||e==="_ctx"||e==="$stable",Go=e=>se(e)?e.map(vt):[vt(e)],Dc=(e,t,s)=>{if(t._n)return t;const n=fo((...o)=>Go(t(...o)),s);return n._c=!1,n},wl=(e,t,s)=>{const n=e._ctx;for(const o in e){if(Ko(o))continue;const r=e[o];if(le(r))t[o]=Dc(o,r,n);else if(r!=null){const l=Go(r);t[o]=()=>l}}},_l=(e,t)=>{const s=Go(t);e.slots.default=()=>s},kl=(e,t,s)=>{for(const n in t)(s||!Ko(n))&&(e[n]=t[n])},Vc=(e,t,s)=>{const n=e.slots=vl();if(e.vnode.shapeFlag&32){const o=t._;o?(kl(n,t,s),s&&Si(n,"_",o,!0)):wl(t,n)}else t&&_l(e,t)},Hc=(e,t,s)=>{const{vnode:n,slots:o}=e;let r=!0,l=we;if(n.shapeFlag&32){const c=t._;c?s&&c===1?r=!1:kl(o,t,s):(r=!t.$stable,wl(t,o)),l=t}else t&&(_l(e,t),l={default:1});if(r)for(const c in o)!Ko(c)&&l[c]==null&&delete o[c]},Le=Wc;function Fc(e){return Uc(e)}function Uc(e,t){const s=An();s.__VUE__=!0;const{insert:n,remove:o,patchProp:r,createElement:l,createText:c,createComment:a,setText:f,setElementText:d,parentNode:p,nextSibling:b,setScopeId:y=bt,insertStaticContent:E}=e,$=(m,g,x,T=null,S=null,M=null,W=void 0,z=null,I=!!g.dynamicChildren)=>{if(m===g)return;m&&!es(m,g)&&(T=B(m),ye(m,S,M,!0),m=null),g.patchFlag===-2&&(I=!1,g.dynamicChildren=null);const{type:O,ref:ee,shapeFlag:J}=g;switch(O){case Nn:L(m,g,x,T);break;case ze:q(m,g,x,T);break;case ln:m==null&&N(g,x,T,W);break;case ve:A(m,g,x,T,S,M,W,z,I);break;default:J&1?Z(m,g,x,T,S,M,W,z,I):J&6?F(m,g,x,T,S,M,W,z,I):(J&64||J&128)&&O.process(m,g,x,T,S,M,W,z,I,h)}ee!=null&&S?Ps(ee,m&&m.ref,M,g||m,!g):ee==null&&m&&m.ref!=null&&Ps(m.ref,null,M,m,!0)},L=(m,g,x,T)=>{if(m==null)n(g.el=c(g.children),x,T);else{const S=g.el=m.el;g.children!==m.children&&f(S,g.children)}},q=(m,g,x,T)=>{m==null?n(g.el=a(g.children||""),x,T):g.el=m.el},N=(m,g,x,T)=>{[m.el,m.anchor]=E(m.children,g,x,T,m.el,m.anchor)},K=({el:m,anchor:g},x,T)=>{let S;for(;m&&m!==g;)S=b(m),n(m,x,T),m=S;n(g,x,T)},V=({el:m,anchor:g})=>{let x;for(;m&&m!==g;)x=b(m),o(m),m=x;o(g)},Z=(m,g,x,T,S,M,W,z,I)=>{if(g.type==="svg"?W="svg":g.type==="math"&&(W="mathml"),m==null)ne(g,x,T,S,M,W,z,I);else{const O=m.el&&m.el._isVueCE?m.el:null;try{O&&O._beginPatch(),C(m,g,S,M,W,z,I)}finally{O&&O._endPatch()}}},ne=(m,g,x,T,S,M,W,z)=>{let I,O;const{props:ee,shapeFlag:J,transition:te,dirs:ie}=m;if(I=m.el=l(m.type,M,ee&&ee.is,ee),J&8?d(I,m.children):J&16&&Q(m.children,I,null,T,S,Gn(m,M),W,z),ie&&Jt(m,null,T,"created"),re(I,m,m.scopeId,W,T),ee){for(const _e in ee)_e!=="value"&&!Ms(_e)&&r(I,_e,null,ee[_e],M,T);"value"in ee&&r(I,"value",null,ee.value,M),(O=ee.onVnodeBeforeMount)&&ht(O,T,m)}ie&&Jt(m,null,T,"beforeMount");const de=zc(S,te);de&&te.beforeEnter(I),n(I,g,x),((O=ee&&ee.onVnodeMounted)||de||ie)&&Le(()=>{O&&ht(O,T,m),de&&te.enter(I),ie&&Jt(m,null,T,"mounted")},S)},re=(m,g,x,T,S)=>{if(x&&y(m,x),T)for(let M=0;M<T.length;M++)y(m,T[M]);if(S){let M=S.subTree;if(g===M||El(M.type)&&(M.ssContent===g||M.ssFallback===g)){const W=S.vnode;re(m,W,W.scopeId,W.slotScopeIds,S.parent)}}},Q=(m,g,x,T,S,M,W,z,I=0)=>{for(let O=I;O<m.length;O++){const ee=m[O]=z?$t(m[O]):vt(m[O]);$(null,ee,g,x,T,S,M,W,z)}},C=(m,g,x,T,S,M,W)=>{const z=g.el=m.el;let{patchFlag:I,dynamicChildren:O,dirs:ee}=g;I|=m.patchFlag&16;const J=m.props||we,te=g.props||we;let ie;if(x&&Yt(x,!1),(ie=te.onVnodeBeforeUpdate)&&ht(ie,x,g,m),ee&&Jt(g,m,x,"beforeUpdate"),x&&Yt(x,!0),(J.innerHTML&&te.innerHTML==null||J.textContent&&te.textContent==null)&&d(z,""),O?P(m.dynamicChildren,O,z,x,T,Gn(g,S),M):W||ae(m,g,z,null,x,T,Gn(g,S),M,!1),I>0){if(I&16)D(z,J,te,x,S);else if(I&2&&J.class!==te.class&&r(z,"class",null,te.class,S),I&4&&r(z,"style",J.style,te.style,S),I&8){const de=g.dynamicProps;for(let _e=0;_e<de.length;_e++){const ge=de[_e],We=J[ge],Ke=te[ge];(Ke!==We||ge==="value")&&r(z,ge,We,Ke,S,x)}}I&1&&m.children!==g.children&&d(z,g.children)}else!W&&O==null&&D(z,J,te,x,S);((ie=te.onVnodeUpdated)||ee)&&Le(()=>{ie&&ht(ie,x,g,m),ee&&Jt(g,m,x,"updated")},T)},P=(m,g,x,T,S,M,W)=>{for(let z=0;z<g.length;z++){const I=m[z],O=g[z],ee=I.el&&(I.type===ve||!es(I,O)||I.shapeFlag&198)?p(I.el):x;$(I,O,ee,null,T,S,M,W,!0)}},D=(m,g,x,T,S)=>{if(g!==x){if(g!==we)for(const M in g)!Ms(M)&&!(M in x)&&r(m,M,g[M],null,S,T);for(const M in x){if(Ms(M))continue;const W=x[M],z=g[M];W!==z&&M!=="value"&&r(m,M,z,W,S,T)}"value"in x&&r(m,"value",g.value,x.value,S)}},A=(m,g,x,T,S,M,W,z,I)=>{const O=g.el=m?m.el:c(""),ee=g.anchor=m?m.anchor:c("");let{patchFlag:J,dynamicChildren:te,slotScopeIds:ie}=g;ie&&(z=z?z.concat(ie):ie),m==null?(n(O,x,T),n(ee,x,T),Q(g.children||[],x,ee,S,M,W,z,I)):J>0&&J&64&&te&&m.dynamicChildren&&m.dynamicChildren.length===te.length?(P(m.dynamicChildren,te,x,S,M,W,z),(g.key!=null||S&&g===S.subTree)&&Jo(m,g,!0)):ae(m,g,x,ee,S,M,W,z,I)},F=(m,g,x,T,S,M,W,z,I)=>{g.slotScopeIds=z,m==null?g.shapeFlag&512?S.ctx.activate(g,x,T,W,I):U(g,x,T,S,M,W,I):k(m,g,I)},U=(m,g,x,T,S,M,W)=>{const z=m.component=Zc(m,T,S);if(On(m)&&(z.ctx.renderer=h),eu(z,!1,W),z.asyncDep){if(S&&S.registerDep(z,G,W),!m.el){const I=z.subTree=Ae(ze);q(null,I,g,x),m.placeholder=I.el}}else G(z,m,g,x,S,M,W)},k=(m,g,x)=>{const T=g.component=m.component;if(Pc(m,g,x))if(T.asyncDep&&!T.asyncResolved){ce(T,g,x);return}else T.next=g,T.update();else g.el=m.el,T.vnode=g},G=(m,g,x,T,S,M,W)=>{const z=()=>{if(m.isMounted){let{next:J,bu:te,u:ie,parent:de,vnode:_e}=m;{const ft=Cl(m);if(ft){J&&(J.el=_e.el,ce(m,J,W)),ft.asyncDep.then(()=>{Le(()=>{m.isUnmounted||O()},S)});return}}let ge=J,We;Yt(m,!1),J?(J.el=_e.el,ce(m,J,W)):J=_e,te&&nn(te),(We=J.props&&J.props.onVnodeBeforeUpdate)&&ht(We,de,J,_e),Yt(m,!0);const Ke=Er(m),dt=m.subTree;m.subTree=Ke,$(dt,Ke,p(dt.el),B(dt),m,S,M),J.el=Ke.el,ge===null&&Nc(m,Ke.el),ie&&Le(ie,S),(We=J.props&&J.props.onVnodeUpdated)&&Le(()=>ht(We,de,J,_e),S)}else{let J;const{el:te,props:ie}=g,{bm:de,m:_e,parent:ge,root:We,type:Ke}=m,dt=Ns(g);Yt(m,!1),de&&nn(de),!dt&&(J=ie&&ie.onVnodeBeforeMount)&&ht(J,ge,g),Yt(m,!0);{We.ce&&We.ce._hasShadowRoot()&&We.ce._injectChildStyle(Ke);const ft=m.subTree=Er(m);$(null,ft,x,T,m,S,M),g.el=ft.el}if(_e&&Le(_e,S),!dt&&(J=ie&&ie.onVnodeMounted)){const ft=g;Le(()=>ht(J,ge,ft),S)}(g.shapeFlag&256||ge&&Ns(ge.vnode)&&ge.vnode.shapeFlag&256)&&m.a&&Le(m.a,S),m.isMounted=!0,g=x=T=null}};m.scope.on();const I=m.effect=new Ti(z);m.scope.off();const O=m.update=I.run.bind(I),ee=m.job=I.runIfDirty.bind(I);ee.i=m,ee.id=m.uid,I.scheduler=()=>Wo(ee),Yt(m,!0),O()},ce=(m,g,x)=>{g.component=m;const T=m.vnode.props;m.vnode=g,m.next=null,Ic(m,g.props,T,x),Hc(m,g.children,x),Ot(),hr(m),Bt()},ae=(m,g,x,T,S,M,W,z,I=!1)=>{const O=m&&m.children,ee=m?m.shapeFlag:0,J=g.children,{patchFlag:te,shapeFlag:ie}=g;if(te>0){if(te&128){be(O,J,x,T,S,M,W,z,I);return}else if(te&256){$e(O,J,x,T,S,M,W,z,I);return}}ie&8?(ee&16&&Ce(O,S,M),J!==O&&d(x,J)):ee&16?ie&16?be(O,J,x,T,S,M,W,z,I):Ce(O,S,M,!0):(ee&8&&d(x,""),ie&16&&Q(J,x,T,S,M,W,z,I))},$e=(m,g,x,T,S,M,W,z,I)=>{m=m||us,g=g||us;const O=m.length,ee=g.length,J=Math.min(O,ee);let te;for(te=0;te<J;te++){const ie=g[te]=I?$t(g[te]):vt(g[te]);$(m[te],ie,x,null,S,M,W,z,I)}O>ee?Ce(m,S,M,!0,!1,J):Q(g,x,T,S,M,W,z,I,J)},be=(m,g,x,T,S,M,W,z,I)=>{let O=0;const ee=g.length;let J=m.length-1,te=ee-1;for(;O<=J&&O<=te;){const ie=m[O],de=g[O]=I?$t(g[O]):vt(g[O]);if(es(ie,de))$(ie,de,x,null,S,M,W,z,I);else break;O++}for(;O<=J&&O<=te;){const ie=m[J],de=g[te]=I?$t(g[te]):vt(g[te]);if(es(ie,de))$(ie,de,x,null,S,M,W,z,I);else break;J--,te--}if(O>J){if(O<=te){const ie=te+1,de=ie<ee?g[ie].el:T;for(;O<=te;)$(null,g[O]=I?$t(g[O]):vt(g[O]),x,de,S,M,W,z,I),O++}}else if(O>te)for(;O<=J;)ye(m[O],S,M,!0),O++;else{const ie=O,de=O,_e=new Map;for(O=de;O<=te;O++){const Je=g[O]=I?$t(g[O]):vt(g[O]);Je.key!=null&&_e.set(Je.key,O)}let ge,We=0;const Ke=te-de+1;let dt=!1,ft=0;const ws=new Array(Ke);for(O=0;O<Ke;O++)ws[O]=0;for(O=ie;O<=J;O++){const Je=m[O];if(We>=Ke){ye(Je,S,M,!0);continue}let pt;if(Je.key!=null)pt=_e.get(Je.key);else for(ge=de;ge<=te;ge++)if(ws[ge-de]===0&&es(Je,g[ge])){pt=ge;break}pt===void 0?ye(Je,S,M,!0):(ws[pt-de]=O+1,pt>=ft?ft=pt:dt=!0,$(Je,g[pt],x,null,S,M,W,z,I),We++)}const lr=dt?qc(ws):us;for(ge=lr.length-1,O=Ke-1;O>=0;O--){const Je=de+O,pt=g[Je],ar=g[Je+1],cr=Je+1<ee?ar.el||Sl(ar):T;ws[O]===0?$(null,pt,x,cr,S,M,W,z,I):dt&&(ge<0||O!==lr[ge]?Re(pt,x,cr,2):ge--)}}},Re=(m,g,x,T,S=null)=>{const{el:M,type:W,transition:z,children:I,shapeFlag:O}=m;if(O&6){Re(m.component.subTree,g,x,T);return}if(O&128){m.suspense.move(g,x,T);return}if(O&64){W.move(m,g,x,h);return}if(W===ve){n(M,g,x);for(let J=0;J<I.length;J++)Re(I[J],g,x,T);n(m.anchor,g,x);return}if(W===ln){K(m,g,x);return}if(T!==2&&O&1&&z)if(T===0)z.beforeEnter(M),n(M,g,x),Le(()=>z.enter(M),S);else{const{leave:J,delayLeave:te,afterLeave:ie}=z,de=()=>{m.ctx.isUnmounted?o(M):n(M,g,x)},_e=()=>{M._isLeaving&&M[gt](!0),J(M,()=>{de(),ie&&ie()})};te?te(M,de,_e):_e()}else n(M,g,x)},ye=(m,g,x,T=!1,S=!1)=>{const{type:M,props:W,ref:z,children:I,dynamicChildren:O,shapeFlag:ee,patchFlag:J,dirs:te,cacheIndex:ie}=m;if(J===-2&&(S=!1),z!=null&&(Ot(),Ps(z,null,x,m,!0),Bt()),ie!=null&&(g.renderCache[ie]=void 0),ee&256){g.ctx.deactivate(m);return}const de=ee&1&&te,_e=!Ns(m);let ge;if(_e&&(ge=W&&W.onVnodeBeforeUnmount)&&ht(ge,g,m),ee&6)Qe(m.component,x,T);else{if(ee&128){m.suspense.unmount(x,T);return}de&&Jt(m,null,g,"beforeUnmount"),ee&64?m.type.remove(m,g,x,h,T):O&&!O.hasOnce&&(M!==ve||J>0&&J&64)?Ce(O,g,x,!1,!0):(M===ve&&J&384||!S&&ee&16)&&Ce(I,g,x),T&&qe(m)}(_e&&(ge=W&&W.onVnodeUnmounted)||de)&&Le(()=>{ge&&ht(ge,g,m),de&&Jt(m,null,g,"unmounted")},x)},qe=m=>{const{type:g,el:x,anchor:T,transition:S}=m;if(g===ve){Ne(x,T);return}if(g===ln){V(m);return}const M=()=>{o(x),S&&!S.persisted&&S.afterLeave&&S.afterLeave()};if(m.shapeFlag&1&&S&&!S.persisted){const{leave:W,delayLeave:z}=S,I=()=>W(x,M);z?z(m.el,M,I):I()}else M()},Ne=(m,g)=>{let x;for(;m!==g;)x=b(m),o(m),m=x;o(g)},Qe=(m,g,x)=>{const{bum:T,scope:S,job:M,subTree:W,um:z,m:I,a:O}=m;Tr(I),Tr(O),T&&nn(T),S.stop(),M&&(M.flags|=8,ye(W,m,g,x)),z&&Le(z,g),Le(()=>{m.isUnmounted=!0},g)},Ce=(m,g,x,T=!1,S=!1,M=0)=>{for(let W=M;W<m.length;W++)ye(m[W],g,x,T,S)},B=m=>{if(m.shapeFlag&6)return B(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const g=b(m.anchor||m.el),x=g&&g[Zi];return x?b(x):g};let v=!1;const u=(m,g,x)=>{let T;m==null?g._vnode&&(ye(g._vnode,null,null,!0),T=g._vnode.component):$(g._vnode||null,m,g,null,null,null,x),g._vnode=m,v||(v=!0,hr(T),Gi(),v=!1)},h={p:$,um:ye,m:Re,r:qe,mt:U,mc:Q,pc:ae,pbc:P,n:B,o:e};return{render:u,hydrate:void 0,createApp:Ac(u)}}function Gn({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function Yt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function zc(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Jo(e,t,s=!1){const n=e.children,o=t.children;if(se(n)&&se(o))for(let r=0;r<n.length;r++){const l=n[r];let c=o[r];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=o[r]=$t(o[r]),c.el=l.el),!s&&c.patchFlag!==-2&&Jo(l,c)),c.type===Nn&&(c.patchFlag===-1&&(c=o[r]=$t(c)),c.el=l.el),c.type===ze&&!c.el&&(c.el=l.el)}}function qc(e){const t=e.slice(),s=[0];let n,o,r,l,c;const a=e.length;for(n=0;n<a;n++){const f=e[n];if(f!==0){if(o=s[s.length-1],e[o]<f){t[n]=o,s.push(n);continue}for(r=0,l=s.length-1;r<l;)c=r+l>>1,e[s[c]]<f?r=c+1:l=c;f<e[s[r]]&&(r>0&&(t[n]=s[r-1]),s[r]=n)}}for(r=s.length,l=s[r-1];r-- >0;)s[r]=l,l=t[l];return s}function Cl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Cl(t)}function Tr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Sl(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Sl(t.subTree):null}const El=e=>e.__isSuspense;function Wc(e,t){t&&t.pendingBranch?se(e)?t.effects.push(...e):t.effects.push(e):Qa(e)}const ve=Symbol.for("v-fgt"),Nn=Symbol.for("v-txt"),ze=Symbol.for("v-cmt"),ln=Symbol.for("v-stc"),Is=[];let Xe=null;function w(e=!1){Is.push(Xe=e?null:[])}function Kc(){Is.pop(),Xe=Is[Is.length-1]||null}let Us=1;function xn(e,t=!1){Us+=e,e<0&&Xe&&t&&(Xe.hasOnce=!0)}function $l(e){return e.dynamicChildren=Us>0?Xe||us:null,Kc(),Us>0&&Xe&&Xe.push(e),e}function _(e,t,s,n,o,r){return $l(i(e,t,s,n,o,r,!0))}function Al(e,t,s,n,o){return $l(Ae(e,t,s,n,o,!0))}function yn(e){return e?e.__v_isVNode===!0:!1}function es(e,t){return e.type===t.type&&e.key===t.key}const Tl=({key:e})=>e??null,an=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Ee(e)||Ve(e)||le(e)?{i:Ye,r:e,k:t,f:!!s}:e:null);function i(e,t=null,s=null,n=0,o=null,r=e===ve?0:1,l=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Tl(t),ref:t&&an(t),scopeId:Yi,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ye};return c?(Yo(a,s),r&128&&e.normalize(a)):s&&(a.shapeFlag|=Ee(s)?8:16),Us>0&&!l&&Xe&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&Xe.push(a),a}const Ae=Gc;function Gc(e,t=null,s=null,n=0,o=null,r=!1){if((!e||e===xc)&&(e=ze),yn(e)){const c=qt(e,t,!0);return s&&Yo(c,s),Us>0&&!r&&Xe&&(c.shapeFlag&6?Xe[Xe.indexOf(e)]=c:Xe.push(c)),c.patchFlag=-2,c}if(ru(e)&&(e=e.__vccOpts),t){t=Jc(t);let{class:c,style:a}=t;c&&!Ee(c)&&(t.class=oe(c)),me(a)&&(qo(a)&&!se(a)&&(a=Pe({},a)),t.style=xt(a))}const l=Ee(e)?1:El(e)?128:el(e)?64:me(e)?4:le(e)?2:0;return i(e,t,s,n,o,l,r,!0)}function Jc(e){return e?qo(e)||bl(e)?Pe({},e):e:null}function qt(e,t,s=!1,n=!1){const{props:o,ref:r,patchFlag:l,children:c,transition:a}=e,f=t?Yc(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Tl(f),ref:t&&t.ref?s&&r?se(r)?r.concat(an(t)):[r,an(t)]:an(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ve?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&qt(e.ssContent),ssFallback:e.ssFallback&&qt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&n&&Fs(d,a.clone(d)),d}function Y(e=" ",t=0){return Ae(Nn,null,e,t)}function rt(e,t){const s=Ae(ln,null,e);return s.staticCount=t,s}function X(e="",t=!1){return t?(w(),Al(ze,null,e)):Ae(ze,null,e)}function vt(e){return e==null||typeof e=="boolean"?Ae(ze):se(e)?Ae(ve,null,e.slice()):yn(e)?$t(e):Ae(Nn,null,String(e))}function $t(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:qt(e)}function Yo(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(se(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),Yo(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!bl(t)?t._ctx=Ye:o===3&&Ye&&(Ye.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else le(t)?(t={default:t,_ctx:Ye},s=32):(t=String(t),n&64?(s=16,t=[Y(t)]):s=8);e.children=t,e.shapeFlag|=s}function Yc(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=oe([t.class,n.class]));else if(o==="style")t.style=xt([t.style,n.style]);else if(Cn(o)){const r=t[o],l=n[o];l&&r!==l&&!(se(r)&&r.includes(l))&&(t[o]=r?[].concat(r,l):l)}else o!==""&&(t[o]=n[o])}return t}function ht(e,t,s,n=null){ct(e,t,7,[s,n])}const Xc=pl();let Qc=0;function Zc(e,t,s){const n=e.type,o=(t?t.appContext:e.appContext)||Xc,r={uid:Qc++,vnode:e,type:n,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new _a(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:yl(n,o),emitsOptions:hl(n,o),emit:null,emitted:null,propsDefaults:we,inheritAttrs:n.inheritAttrs,ctx:we,data:we,props:we,attrs:we,slots:we,refs:we,setupState:we,setupContext:null,suspense:s,suspenseId:s?s.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=Mc.bind(null,r),e.ce&&e.ce(r),r}let je=null;const Ml=()=>je||Ye;let wn,yo;{const e=An(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),r=>{o.length>1?o.forEach(l=>l(r)):o[0](r)}};wn=t("__VUE_INSTANCE_SETTERS__",s=>je=s),yo=t("__VUE_SSR_SETTERS__",s=>zs=s)}const Js=e=>{const t=je;return wn(e),e.scope.on(),()=>{e.scope.off(),wn(t)}},Mr=()=>{je&&je.scope.off(),wn(null)};function Rl(e){return e.vnode.shapeFlag&4}let zs=!1;function eu(e,t=!1,s=!1){t&&yo(t);const{props:n,children:o}=e.vnode,r=Rl(e);Lc(e,n,r,t),Vc(e,o,s||t);const l=r?tu(e,t):void 0;return t&&yo(!1),l}function tu(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wc);const{setup:n}=s;if(n){Ot();const o=e.setupContext=n.length>1?nu(e):null,r=Js(e),l=Gs(n,e,0,[e.props,o]),c=_i(l);if(Bt(),r(),(c||e.sp)&&!Ns(e)&&al(e),c){if(l.then(Mr,Mr),t)return l.then(a=>{Rr(e,a)}).catch(a=>{Rn(a,e,0)});e.asyncDep=l}else Rr(e,l)}else Ol(e)}function Rr(e,t,s){le(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:me(t)&&(e.setupState=qi(t)),Ol(e)}function Ol(e,t,s){const n=e.type;e.render||(e.render=n.render||bt);{const o=Js(e);Ot();try{_c(e)}finally{Bt(),o()}}}const su={get(e,t){return Ie(e,"get",""),e[t]}};function nu(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,su),slots:e.slots,emit:e.emit,expose:t}}function Ln(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(qi(Fa(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in Ls)return Ls[s](e)},has(t,s){return s in t||s in Ls}})):e.proxy}function ou(e,t=!0){return le(e)?e.displayName||e.name:e.name||t&&e.__name}function ru(e){return le(e)&&"__vccOpts"in e}const Te=(e,t)=>Ka(e,t,zs);function Xo(e,t,s){try{xn(-1);const n=arguments.length;return n===2?me(t)&&!se(t)?yn(t)?Ae(e,null,[t]):Ae(e,t):Ae(e,null,t):(n>3?s=Array.prototype.slice.call(arguments,2):n===3&&yn(s)&&(s=[s]),Ae(e,t,s))}finally{xn(1)}}const iu="3.5.29";let wo;const Or=typeof window<"u"&&window.trustedTypes;if(Or)try{wo=Or.createPolicy("vue",{createHTML:e=>e})}catch{}const Bl=wo?e=>wo.createHTML(e):e=>e,lu="http://www.w3.org/2000/svg",au="http://www.w3.org/1998/Math/MathML",Et=typeof document<"u"?document:null,Br=Et&&Et.createElement("template"),cu={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?Et.createElementNS(lu,e):t==="mathml"?Et.createElementNS(au,e):s?Et.createElement(e,{is:s}):Et.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>Et.createTextNode(e),createComment:e=>Et.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Et.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,r){const l=s?s.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===r||!(o=o.nextSibling)););else{Br.innerHTML=Bl(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const c=Br.content;if(n==="svg"||n==="mathml"){const a=c.firstChild;for(;a.firstChild;)c.appendChild(a.firstChild);c.removeChild(a)}t.insertBefore(c,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Lt="transition",Cs="animation",qs=Symbol("_vtc"),Pl={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},uu=Pe({},sl,Pl),du=e=>(e.displayName="Transition",e.props=uu,e),Pr=du((e,{slots:t})=>Xo(ic,fu(e),t)),Xt=(e,t=[])=>{se(e)?e.forEach(s=>s(...t)):e&&e(...t)},Nr=e=>e?se(e)?e.some(t=>t.length>1):e.length>1:!1;function fu(e){const t={};for(const A in e)A in Pl||(t[A]=e[A]);if(e.css===!1)return t;const{name:s="v",type:n,duration:o,enterFromClass:r=`${s}-enter-from`,enterActiveClass:l=`${s}-enter-active`,enterToClass:c=`${s}-enter-to`,appearFromClass:a=r,appearActiveClass:f=l,appearToClass:d=c,leaveFromClass:p=`${s}-leave-from`,leaveActiveClass:b=`${s}-leave-active`,leaveToClass:y=`${s}-leave-to`}=e,E=pu(o),$=E&&E[0],L=E&&E[1],{onBeforeEnter:q,onEnter:N,onEnterCancelled:K,onLeave:V,onLeaveCancelled:Z,onBeforeAppear:ne=q,onAppear:re=N,onAppearCancelled:Q=K}=t,C=(A,F,U,k)=>{A._enterCancelled=k,Qt(A,F?d:c),Qt(A,F?f:l),U&&U()},P=(A,F)=>{A._isLeaving=!1,Qt(A,p),Qt(A,y),Qt(A,b),F&&F()},D=A=>(F,U)=>{const k=A?re:N,G=()=>C(F,A,U);Xt(k,[F,G]),Lr(()=>{Qt(F,A?a:r),Ct(F,A?d:c),Nr(k)||Ir(F,n,$,G)})};return Pe(t,{onBeforeEnter(A){Xt(q,[A]),Ct(A,r),Ct(A,l)},onBeforeAppear(A){Xt(ne,[A]),Ct(A,a),Ct(A,f)},onEnter:D(!1),onAppear:D(!0),onLeave(A,F){A._isLeaving=!0;const U=()=>P(A,F);Ct(A,p),A._enterCancelled?(Ct(A,b),Vr(A)):(Vr(A),Ct(A,b)),Lr(()=>{A._isLeaving&&(Qt(A,p),Ct(A,y),Nr(V)||Ir(A,n,L,U))}),Xt(V,[A,U])},onEnterCancelled(A){C(A,!1,void 0,!0),Xt(K,[A])},onAppearCancelled(A){C(A,!0,void 0,!0),Xt(Q,[A])},onLeaveCancelled(A){P(A),Xt(Z,[A])}})}function pu(e){if(e==null)return null;if(me(e))return[Jn(e.enter),Jn(e.leave)];{const t=Jn(e);return[t,t]}}function Jn(e){return ha(e)}function Ct(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.add(s)),(e[qs]||(e[qs]=new Set)).add(t)}function Qt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const s=e[qs];s&&(s.delete(t),s.size||(e[qs]=void 0))}function Lr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let hu=0;function Ir(e,t,s,n){const o=e._endId=++hu,r=()=>{o===e._endId&&n()};if(s!=null)return setTimeout(r,s);const{type:l,timeout:c,propCount:a}=mu(e,t);if(!l)return n();const f=l+"end";let d=0;const p=()=>{e.removeEventListener(f,b),r()},b=y=>{y.target===e&&++d>=a&&p()};setTimeout(()=>{d<a&&p()},c+1),e.addEventListener(f,b)}function mu(e,t){const s=window.getComputedStyle(e),n=E=>(s[E]||"").split(", "),o=n(`${Lt}Delay`),r=n(`${Lt}Duration`),l=jr(o,r),c=n(`${Cs}Delay`),a=n(`${Cs}Duration`),f=jr(c,a);let d=null,p=0,b=0;t===Lt?l>0&&(d=Lt,p=l,b=r.length):t===Cs?f>0&&(d=Cs,p=f,b=a.length):(p=Math.max(l,f),d=p>0?l>f?Lt:Cs:null,b=d?d===Lt?r.length:a.length:0);const y=d===Lt&&/\b(?:transform|all)(?:,|$)/.test(n(`${Lt}Property`).toString());return{type:d,timeout:p,propCount:b,hasTransform:y}}function jr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((s,n)=>Dr(s)+Dr(e[n])))}function Dr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Vr(e){return(e?e.ownerDocument:document).body.offsetHeight}function gu(e,t,s){const n=e[qs];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const _n=Symbol("_vod"),Nl=Symbol("_vsh"),Yn={name:"show",beforeMount(e,{value:t},{transition:s}){e[_n]=e.style.display==="none"?"":e.style.display,s&&t?s.beforeEnter(e):Ss(e,t)},mounted(e,{value:t},{transition:s}){s&&t&&s.enter(e)},updated(e,{value:t,oldValue:s},{transition:n}){!t!=!s&&(n?t?(n.beforeEnter(e),Ss(e,!0),n.enter(e)):n.leave(e,()=>{Ss(e,!1)}):Ss(e,t))},beforeUnmount(e,{value:t}){Ss(e,t)}};function Ss(e,t){e.style.display=t?e[_n]:"none",e[Nl]=!t}const vu=Symbol(""),bu=/(?:^|;)\s*display\s*:/;function xu(e,t,s){const n=e.style,o=Ee(s);let r=!1;if(s&&!o){if(t)if(Ee(t))for(const l of t.split(";")){const c=l.slice(0,l.indexOf(":")).trim();s[c]==null&&cn(n,c,"")}else for(const l in t)s[l]==null&&cn(n,l,"");for(const l in s)l==="display"&&(r=!0),cn(n,l,s[l])}else if(o){if(t!==s){const l=n[vu];l&&(s+=";"+l),n.cssText=s,r=bu.test(s)}}else t&&e.removeAttribute("style");_n in e&&(e[_n]=r?n.display:"",e[Nl]&&(n.display="none"))}const Hr=/\s*!important$/;function cn(e,t,s){if(se(s))s.forEach(n=>cn(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=yu(e,t);Hr.test(s)?e.setProperty(Kt(n),s.replace(Hr,""),"important"):e[n]=s}}const Fr=["Webkit","Moz","ms"],Xn={};function yu(e,t){const s=Xn[t];if(s)return s;let n=nt(t);if(n!=="filter"&&n in e)return Xn[t]=n;n=En(n);for(let o=0;o<Fr.length;o++){const r=Fr[o]+n;if(r in e)return Xn[t]=r}return t}const Ur="http://www.w3.org/1999/xlink";function zr(e,t,s,n,o,r=ya(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(Ur,t.slice(6,t.length)):e.setAttributeNS(Ur,t,s):s==null||r&&!Ei(s)?e.removeAttribute(t):e.setAttribute(t,r?"":wt(s)?String(s):s)}function qr(e,t,s,n,o){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?Bl(s):s);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const c=r==="OPTION"?e.getAttribute("value")||"":e.value,a=s==null?e.type==="checkbox"?"on":"":String(s);(c!==a||!("_value"in e))&&(e.value=a),s==null&&e.removeAttribute(t),e._value=s;return}let l=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=Ei(s):s==null&&c==="string"?(s="",l=!0):c==="number"&&(s=0,l=!0)}try{e[t]=s}catch{}l&&e.removeAttribute(o||t)}function Mt(e,t,s,n){e.addEventListener(t,s,n)}function wu(e,t,s,n){e.removeEventListener(t,s,n)}const Wr=Symbol("_vei");function _u(e,t,s,n,o=null){const r=e[Wr]||(e[Wr]={}),l=r[t];if(n&&l)l.value=n;else{const[c,a]=ku(t);if(n){const f=r[t]=Eu(n,o);Mt(e,c,f,a)}else l&&(wu(e,c,l,a),r[t]=void 0)}}const Kr=/(?:Once|Passive|Capture)$/;function ku(e){let t;if(Kr.test(e)){t={};let n;for(;n=e.match(Kr);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Kt(e.slice(2)),t]}let Qn=0;const Cu=Promise.resolve(),Su=()=>Qn||(Cu.then(()=>Qn=0),Qn=Date.now());function Eu(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;ct($u(n,s.value),t,5,[n])};return s.value=e,s.attached=Su(),s}function $u(e,t){if(se(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>o=>!o._stopped&&n&&n(o))}else return t}const Gr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Au=(e,t,s,n,o,r)=>{const l=o==="svg";t==="class"?gu(e,n,l):t==="style"?xu(e,s,n):Cn(t)?No(t)||_u(e,t,s,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tu(e,t,n,l))?(qr(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zr(e,t,n,l,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Ee(n))?qr(e,nt(t),n,r,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),zr(e,t,n,l))};function Tu(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Gr(t)&&le(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Gr(t)&&Ee(s)?!1:t in e}const Wt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return se(t)?s=>nn(t,s):t};function Mu(e){e.target.composing=!0}function Jr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const st=Symbol("_assign");function Yr(e,t,s){return t&&(e=e.trim()),s&&(e=$n(e)),e}const Be={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e[st]=Wt(o);const r=n||o.props&&o.props.type==="number";Mt(e,t?"change":"input",l=>{l.target.composing||e[st](Yr(e.value,s,r))}),(s||r)&&Mt(e,"change",()=>{e.value=Yr(e.value,s,r)}),t||(Mt(e,"compositionstart",Mu),Mt(e,"compositionend",Jr),Mt(e,"change",Jr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:r}},l){if(e[st]=Wt(l),e.composing)return;const c=(r||e.type==="number")&&!/^0\d/.test(e.value)?$n(e.value):e.value,a=t??"";c!==a&&(document.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===a)||(e.value=a))}},_o={deep:!0,created(e,t,s){e[st]=Wt(s),Mt(e,"change",()=>{const n=e._modelValue,o=gs(e),r=e.checked,l=e[st];if(se(n)){const c=jo(n,o),a=c!==-1;if(r&&!a)l(n.concat(o));else if(!r&&a){const f=[...n];f.splice(c,1),l(f)}}else if(xs(n)){const c=new Set(n);r?c.add(o):c.delete(o),l(c)}else l(Ll(e,r))})},mounted:Xr,beforeUpdate(e,t,s){e[st]=Wt(s),Xr(e,t,s)}};function Xr(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(se(t))o=jo(t,n.props.value)>-1;else if(xs(t))o=t.has(n.props.value);else{if(t===s)return;o=zt(t,Ll(e,!0))}e.checked!==o&&(e.checked=o)}const un={created(e,{value:t},s){e.checked=zt(t,s.props.value),e[st]=Wt(s),Mt(e,"change",()=>{e[st](gs(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[st]=Wt(n),t!==s&&(e.checked=zt(t,n.props.value))}},ko={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const o=xs(t);Mt(e,"change",()=>{const r=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>s?$n(gs(l)):gs(l));e[st](e.multiple?o?new Set(r):r:r[0]),e._assigning=!0,Ht(()=>{e._assigning=!1})}),e[st]=Wt(n)},mounted(e,{value:t}){Qr(e,t)},beforeUpdate(e,t,s){e[st]=Wt(s)},updated(e,{value:t}){e._assigning||Qr(e,t)}};function Qr(e,t){const s=e.multiple,n=se(t);if(!(s&&!n&&!xs(t))){for(let o=0,r=e.options.length;o<r;o++){const l=e.options[o],c=gs(l);if(s)if(n){const a=typeof c;a==="string"||a==="number"?l.selected=t.some(f=>String(f)===String(c)):l.selected=jo(t,c)>-1}else l.selected=t.has(c);else if(zt(gs(l),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function gs(e){return"_value"in e?e._value:e.value}function Ll(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ru={created(e,t,s){en(e,t,s,null,"created")},mounted(e,t,s){en(e,t,s,null,"mounted")},beforeUpdate(e,t,s,n){en(e,t,s,n,"beforeUpdate")},updated(e,t,s,n){en(e,t,s,n,"updated")}};function Ou(e,t){switch(e){case"SELECT":return ko;case"TEXTAREA":return Be;default:switch(t){case"checkbox":return _o;case"radio":return un;default:return Be}}}function en(e,t,s,n,o){const l=Ou(e.tagName,s.props&&s.props.type)[o];l&&l(e,t,s,n)}const Bu=["ctrl","shift","alt","meta"],Pu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Bu.some(s=>e[`${s}Key`]&&!t.includes(s))},os=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((o,...r)=>{for(let l=0;l<t.length;l++){const c=Pu[t[l]];if(c&&c(o,t))return}return e(o,...r)}))},Nu={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},kn=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const r=Kt(o.key);if(t.some(l=>l===r||Nu[l]===r))return e(o)}))},Lu=Pe({patchProp:Au},cu);let Zr;function Iu(){return Zr||(Zr=Fc(Lu))}const ju=((...e)=>{const t=Iu().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=Vu(n);if(!o)return;const r=t._component;!le(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const l=s(o,!1,Du(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t});function Du(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vu(e){return Ee(e)?document.querySelector(e):e}const Hu="/icon.png";const cs=typeof document<"u";function Il(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Fu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Il(e.default)}const pe=Object.assign;function Zn(e,t){const s={};for(const n in t){const o=t[n];s[n]=ut(o)?o.map(e):e(o)}return s}const js=()=>{},ut=Array.isArray;function ei(e,t){const s={};for(const n in e)s[n]=n in t?t[n]:e[n];return s}let Se=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const jl=Symbol("");Se.MATCHER_NOT_FOUND+"",Se.NAVIGATION_GUARD_REDIRECT+"",Se.NAVIGATION_ABORTED+"",Se.NAVIGATION_CANCELLED+"",Se.NAVIGATION_DUPLICATED+"";function vs(e,t){return pe(new Error,{type:e,[jl]:!0},t)}function St(e,t){return e instanceof Error&&jl in e&&(t==null||!!(e.type&t))}const Uu=["params","query","hash"];function zu(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const s of Uu)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}const qu=Symbol(""),ti=Symbol(""),In=Symbol(""),Qo=Symbol(""),Co=Symbol("");function Zo(){return lt(In)}function Wu(e){return lt(Qo)}const Dl=/#/g,Ku=/&/g,Gu=/\//g,Ju=/=/g,Yu=/\?/g,Vl=/\+/g,Xu=/%5B/g,Qu=/%5D/g,Hl=/%5E/g,Zu=/%60/g,Fl=/%7B/g,ed=/%7C/g,Ul=/%7D/g,td=/%20/g;function er(e){return e==null?"":encodeURI(""+e).replace(ed,"|").replace(Xu,"[").replace(Qu,"]")}function sd(e){return er(e).replace(Fl,"{").replace(Ul,"}").replace(Hl,"^")}function So(e){return er(e).replace(Vl,"%2B").replace(td,"+").replace(Dl,"%23").replace(Ku,"%26").replace(Zu,"`").replace(Fl,"{").replace(Ul,"}").replace(Hl,"^")}function nd(e){return So(e).replace(Ju,"%3D")}function od(e){return er(e).replace(Dl,"%23").replace(Yu,"%3F")}function rd(e){return od(e).replace(Gu,"%2F")}function Ws(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const id=/\/$/,ld=e=>e.replace(id,"");function eo(e,t,s="/"){let n,o={},r="",l="";const c=t.indexOf("#");let a=t.indexOf("?");return a=c>=0&&a>c?-1:a,a>=0&&(n=t.slice(0,a),r=t.slice(a,c>0?c:t.length),o=e(r.slice(1))),c>=0&&(n=n||t.slice(0,c),l=t.slice(c,t.length)),n=dd(n??t,s),{fullPath:n+r+l,path:n,query:o,hash:Ws(l)}}function ad(e,t){const s=t.query?e(t.query):"";return t.path+(s&&"?")+s+(t.hash||"")}function si(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function cd(e,t,s){const n=t.matched.length-1,o=s.matched.length-1;return n>-1&&n===o&&bs(t.matched[n],s.matched[o])&&zl(t.params,s.params)&&e(t.query)===e(s.query)&&t.hash===s.hash}function bs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function zl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var s in e)if(!ud(e[s],t[s]))return!1;return!0}function ud(e,t){return ut(e)?ni(e,t):ut(t)?ni(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function ni(e,t){return ut(t)?e.length===t.length&&e.every((s,n)=>s===t[n]):e.length===1&&e[0]===t}function dd(e,t){if(e.startsWith("/"))return e;if(!e)return t;const s=t.split("/"),n=e.split("/"),o=n[n.length-1];(o===".."||o===".")&&n.push("");let r=s.length-1,l,c;for(l=0;l<n.length;l++)if(c=n[l],c!==".")if(c==="..")r>1&&r--;else break;return s.slice(0,r).join("/")+"/"+n.slice(l).join("/")}const It={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Eo=(function(e){return e.pop="pop",e.push="push",e})({}),to=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function fd(e){if(!e)if(cs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),ld(e)}const pd=/^[^#]+#/;function hd(e,t){return e.replace(pd,"#")+t}function md(e,t){const s=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{behavior:t.behavior,left:n.left-s.left-(t.left||0),top:n.top-s.top-(t.top||0)}}const jn=()=>({left:window.scrollX,top:window.scrollY});function gd(e){let t;if("el"in e){const s=e.el,n=typeof s=="string"&&s.startsWith("#"),o=typeof s=="string"?n?document.getElementById(s.slice(1)):document.querySelector(s):s;if(!o)return;t=md(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function oi(e,t){return(history.state?history.state.position-t:-1)+e}const $o=new Map;function vd(e,t){$o.set(e,t)}function bd(e){const t=$o.get(e);return $o.delete(e),t}function xd(e){return typeof e=="string"||e&&typeof e=="object"}function ql(e){return typeof e=="string"||typeof e=="symbol"}function yd(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let n=0;n<s.length;++n){const o=s[n].replace(Vl," "),r=o.indexOf("="),l=Ws(r<0?o:o.slice(0,r)),c=r<0?null:Ws(o.slice(r+1));if(l in t){let a=t[l];ut(a)||(a=t[l]=[a]),a.push(c)}else t[l]=c}return t}function ri(e){let t="";for(let s in e){const n=e[s];if(s=nd(s),n==null){n!==void 0&&(t+=(t.length?"&":"")+s);continue}(ut(n)?n.map(o=>o&&So(o)):[n&&So(n)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function wd(e){const t={};for(const s in e){const n=e[s];n!==void 0&&(t[s]=ut(n)?n.map(o=>o==null?null:""+o):n==null?n:""+n)}return t}function Es(){let e=[];function t(n){return e.push(n),()=>{const o=e.indexOf(n);o>-1&&e.splice(o,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function Vt(e,t,s,n,o,r=l=>l()){const l=n&&(n.enterCallbacks[o]=n.enterCallbacks[o]||[]);return()=>new Promise((c,a)=>{const f=b=>{b===!1?a(vs(Se.NAVIGATION_ABORTED,{from:s,to:t})):b instanceof Error?a(b):xd(b)?a(vs(Se.NAVIGATION_GUARD_REDIRECT,{from:t,to:b})):(l&&n.enterCallbacks[o]===l&&typeof b=="function"&&l.push(b),c())},d=r(()=>e.call(n&&n.instances[o],t,s,f));let p=Promise.resolve(d);e.length<3&&(p=p.then(f)),p.catch(b=>a(b))})}function so(e,t,s,n,o=r=>r()){const r=[];for(const l of e)for(const c in l.components){let a=l.components[c];if(!(t!=="beforeRouteEnter"&&!l.instances[c]))if(Il(a)){const f=(a.__vccOpts||a)[t];f&&r.push(Vt(f,s,n,l,c,o))}else{let f=a();r.push(()=>f.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${c}" at "${l.path}"`);const p=Fu(d)?d.default:d;l.mods[c]=d,l.components[c]=p;const b=(p.__vccOpts||p)[t];return b&&Vt(b,s,n,l,c,o)()}))}}return r}function _d(e,t){const s=[],n=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let l=0;l<r;l++){const c=t.matched[l];c&&(e.matched.find(f=>bs(f,c))?n.push(c):s.push(c));const a=e.matched[l];a&&(t.matched.find(f=>bs(f,a))||o.push(a))}return[s,n,o]}let kd=()=>location.protocol+"//"+location.host;function Wl(e,t){const{pathname:s,search:n,hash:o}=t,r=e.indexOf("#");if(r>-1){let l=o.includes(e.slice(r))?e.slice(r).length:1,c=o.slice(l);return c[0]!=="/"&&(c="/"+c),si(c,"")}return si(s,e)+n+o}function Cd(e,t,s,n){let o=[],r=[],l=null;const c=({state:b})=>{const y=Wl(e,location),E=s.value,$=t.value;let L=0;if(b){if(s.value=y,t.value=b,l&&l===E){l=null;return}L=$?b.position-$.position:0}else n(y);o.forEach(q=>{q(s.value,E,{delta:L,type:Eo.pop,direction:L?L>0?to.forward:to.back:to.unknown})})};function a(){l=s.value}function f(b){o.push(b);const y=()=>{const E=o.indexOf(b);E>-1&&o.splice(E,1)};return r.push(y),y}function d(){if(document.visibilityState==="hidden"){const{history:b}=window;if(!b.state)return;b.replaceState(pe({},b.state,{scroll:jn()}),"")}}function p(){for(const b of r)b();r=[],window.removeEventListener("popstate",c),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",c),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:a,listen:f,destroy:p}}function ii(e,t,s,n=!1,o=!1){return{back:e,current:t,forward:s,replaced:n,position:window.history.length,scroll:o?jn():null}}function Sd(e){const{history:t,location:s}=window,n={value:Wl(e,s)},o={value:t.state};o.value||r(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(a,f,d){const p=e.indexOf("#"),b=p>-1?(s.host&&document.querySelector("base")?e:e.slice(p))+a:kd()+e+a;try{t[d?"replaceState":"pushState"](f,"",b),o.value=f}catch(y){console.error(y),s[d?"replace":"assign"](b)}}function l(a,f){r(a,pe({},t.state,ii(o.value.back,a,o.value.forward,!0),f,{position:o.value.position}),!0),n.value=a}function c(a,f){const d=pe({},o.value,t.state,{forward:a,scroll:jn()});r(d.current,d,!0),r(a,pe({},ii(n.value,a,null),{position:d.position+1},f),!1),n.value=a}return{location:n,state:o,push:c,replace:l}}function Ed(e){e=fd(e);const t=Sd(e),s=Cd(e,t.state,t.location,t.replace);function n(r,l=!0){l||s.pauseListeners(),history.go(r)}const o=pe({location:"",base:e,go:n,createHref:hd.bind(null,e)},t,s);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}let ts=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Oe=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Oe||{});const $d={type:ts.Static,value:""},Ad=/[a-zA-Z0-9_]/;function Td(e){if(!e)return[[]];if(e==="/")return[[$d]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${s})/"${f}": ${y}`)}let s=Oe.Static,n=s;const o=[];let r;function l(){r&&o.push(r),r=[]}let c=0,a,f="",d="";function p(){f&&(s===Oe.Static?r.push({type:ts.Static,value:f}):s===Oe.Param||s===Oe.ParamRegExp||s===Oe.ParamRegExpEnd?(r.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),r.push({type:ts.Param,value:f,regexp:d,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),f="")}function b(){f+=a}for(;c<e.length;){if(a=e[c++],a==="\\"&&s!==Oe.ParamRegExp){n=s,s=Oe.EscapeNext;continue}switch(s){case Oe.Static:a==="/"?(f&&p(),l()):a===":"?(p(),s=Oe.Param):b();break;case Oe.EscapeNext:b(),s=n;break;case Oe.Param:a==="("?s=Oe.ParamRegExp:Ad.test(a)?b():(p(),s=Oe.Static,a!=="*"&&a!=="?"&&a!=="+"&&c--);break;case Oe.ParamRegExp:a===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+a:s=Oe.ParamRegExpEnd:d+=a;break;case Oe.ParamRegExpEnd:p(),s=Oe.Static,a!=="*"&&a!=="?"&&a!=="+"&&c--,d="";break;default:t("Unknown state");break}}return s===Oe.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),p(),l(),o}const li="[^/]+?",Md={sensitive:!1,strict:!1,start:!0,end:!0};var Fe=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Fe||{});const Rd=/[.+*?^${}()[\]/\\]/g;function Od(e,t){const s=pe({},Md,t),n=[];let o=s.start?"^":"";const r=[];for(const f of e){const d=f.length?[]:[Fe.Root];s.strict&&!f.length&&(o+="/");for(let p=0;p<f.length;p++){const b=f[p];let y=Fe.Segment+(s.sensitive?Fe.BonusCaseSensitive:0);if(b.type===ts.Static)p||(o+="/"),o+=b.value.replace(Rd,"\\$&"),y+=Fe.Static;else if(b.type===ts.Param){const{value:E,repeatable:$,optional:L,regexp:q}=b;r.push({name:E,repeatable:$,optional:L});const N=q||li;if(N!==li){y+=Fe.BonusCustomRegExp;try{new RegExp(`(${N})`)}catch(V){throw new Error(`Invalid custom RegExp for param "${E}" (${N}): `+V.message)}}let K=$?`((?:${N})(?:/(?:${N}))*)`:`(${N})`;p||(K=L&&f.length<2?`(?:/${K})`:"/"+K),L&&(K+="?"),o+=K,y+=Fe.Dynamic,L&&(y+=Fe.BonusOptional),$&&(y+=Fe.BonusRepeatable),N===".*"&&(y+=Fe.BonusWildcard)}d.push(y)}n.push(d)}if(s.strict&&s.end){const f=n.length-1;n[f][n[f].length-1]+=Fe.BonusStrict}s.strict||(o+="/?"),s.end?o+="$":s.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const l=new RegExp(o,s.sensitive?"":"i");function c(f){const d=f.match(l),p={};if(!d)return null;for(let b=1;b<d.length;b++){const y=d[b]||"",E=r[b-1];p[E.name]=y&&E.repeatable?y.split("/"):y}return p}function a(f){let d="",p=!1;for(const b of e){(!p||!d.endsWith("/"))&&(d+="/"),p=!1;for(const y of b)if(y.type===ts.Static)d+=y.value;else if(y.type===ts.Param){const{value:E,repeatable:$,optional:L}=y,q=E in f?f[E]:"";if(ut(q)&&!$)throw new Error(`Provided param "${E}" is an array but it is not repeatable (* or + modifiers)`);const N=ut(q)?q.join("/"):q;if(!N)if(L)b.length<2&&(d.endsWith("/")?d=d.slice(0,-1):p=!0);else throw new Error(`Missing required param "${E}"`);d+=N}}return d||"/"}return{re:l,score:n,keys:r,parse:c,stringify:a}}function Bd(e,t){let s=0;for(;s<e.length&&s<t.length;){const n=t[s]-e[s];if(n)return n;s++}return e.length<t.length?e.length===1&&e[0]===Fe.Static+Fe.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Fe.Static+Fe.Segment?1:-1:0}function Kl(e,t){let s=0;const n=e.score,o=t.score;for(;s<n.length&&s<o.length;){const r=Bd(n[s],o[s]);if(r)return r;s++}if(Math.abs(o.length-n.length)===1){if(ai(n))return 1;if(ai(o))return-1}return o.length-n.length}function ai(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Pd={strict:!1,end:!0,sensitive:!1};function Nd(e,t,s){const n=Od(Td(e.path),s),o=pe(n,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function Ld(e,t){const s=[],n=new Map;t=ei(Pd,t);function o(p){return n.get(p)}function r(p,b,y){const E=!y,$=ui(p);$.aliasOf=y&&y.record;const L=ei(t,p),q=[$];if("alias"in p){const V=typeof p.alias=="string"?[p.alias]:p.alias;for(const Z of V)q.push(ui(pe({},$,{components:y?y.record.components:$.components,path:Z,aliasOf:y?y.record:$})))}let N,K;for(const V of q){const{path:Z}=V;if(b&&Z[0]!=="/"){const ne=b.record.path,re=ne[ne.length-1]==="/"?"":"/";V.path=b.record.path+(Z&&re+Z)}if(N=Nd(V,b,L),y?y.alias.push(N):(K=K||N,K!==N&&K.alias.push(N),E&&p.name&&!di(N)&&l(p.name)),Gl(N)&&a(N),$.children){const ne=$.children;for(let re=0;re<ne.length;re++)r(ne[re],N,y&&y.children[re])}y=y||N}return K?()=>{l(K)}:js}function l(p){if(ql(p)){const b=n.get(p);b&&(n.delete(p),s.splice(s.indexOf(b),1),b.children.forEach(l),b.alias.forEach(l))}else{const b=s.indexOf(p);b>-1&&(s.splice(b,1),p.record.name&&n.delete(p.record.name),p.children.forEach(l),p.alias.forEach(l))}}function c(){return s}function a(p){const b=Dd(p,s);s.splice(b,0,p),p.record.name&&!di(p)&&n.set(p.record.name,p)}function f(p,b){let y,E={},$,L;if("name"in p&&p.name){if(y=n.get(p.name),!y)throw vs(Se.MATCHER_NOT_FOUND,{location:p});L=y.record.name,E=pe(ci(b.params,y.keys.filter(K=>!K.optional).concat(y.parent?y.parent.keys.filter(K=>K.optional):[]).map(K=>K.name)),p.params&&ci(p.params,y.keys.map(K=>K.name))),$=y.stringify(E)}else if(p.path!=null)$=p.path,y=s.find(K=>K.re.test($)),y&&(E=y.parse($),L=y.record.name);else{if(y=b.name?n.get(b.name):s.find(K=>K.re.test(b.path)),!y)throw vs(Se.MATCHER_NOT_FOUND,{location:p,currentLocation:b});L=y.record.name,E=pe({},b.params,p.params),$=y.stringify(E)}const q=[];let N=y;for(;N;)q.unshift(N.record),N=N.parent;return{name:L,path:$,params:E,matched:q,meta:jd(q)}}e.forEach(p=>r(p));function d(){s.length=0,n.clear()}return{addRoute:r,resolve:f,removeRoute:l,clearRoutes:d,getRoutes:c,getRecordMatcher:o}}function ci(e,t){const s={};for(const n of t)n in e&&(s[n]=e[n]);return s}function ui(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Id(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Id(e){const t={},s=e.props||!1;if("component"in e)t.default=s;else for(const n in e.components)t[n]=typeof s=="object"?s[n]:s;return t}function di(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function jd(e){return e.reduce((t,s)=>pe(t,s.meta),{})}function Dd(e,t){let s=0,n=t.length;for(;s!==n;){const r=s+n>>1;Kl(e,t[r])<0?n=r:s=r+1}const o=Vd(e);return o&&(n=t.lastIndexOf(o,n-1)),n}function Vd(e){let t=e;for(;t=t.parent;)if(Gl(t)&&Kl(e,t)===0)return t}function Gl({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function fi(e){const t=lt(In),s=lt(Qo),n=Te(()=>{const a=fs(e.to);return t.resolve(a)}),o=Te(()=>{const{matched:a}=n.value,{length:f}=a,d=a[f-1],p=s.matched;if(!d||!p.length)return-1;const b=p.findIndex(bs.bind(null,d));if(b>-1)return b;const y=pi(a[f-2]);return f>1&&pi(d)===y&&p[p.length-1].path!==y?p.findIndex(bs.bind(null,a[f-2])):b}),r=Te(()=>o.value>-1&&qd(s.params,n.value.params)),l=Te(()=>o.value>-1&&o.value===s.matched.length-1&&zl(s.params,n.value.params));function c(a={}){if(zd(a)){const f=t[fs(e.replace)?"replace":"push"](fs(e.to)).catch(js);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:n,href:Te(()=>n.value.href),isActive:r,isExactActive:l,navigate:c}}function Hd(e){return e.length===1?e[0]:e}const Fd=ll({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:fi,setup(e,{slots:t}){const s=Mn(fi(e)),{options:n}=lt(In),o=Te(()=>({[hi(e.activeClass,n.linkActiveClass,"router-link-active")]:s.isActive,[hi(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:s.isExactActive}));return()=>{const r=t.default&&Hd(t.default(s));return e.custom?r:Xo("a",{"aria-current":s.isExactActive?e.ariaCurrentValue:null,href:s.href,onClick:s.navigate,class:o.value},r)}}}),Ud=Fd;function zd(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function qd(e,t){for(const s in t){const n=t[s],o=e[s];if(typeof n=="string"){if(n!==o)return!1}else if(!ut(o)||o.length!==n.length||n.some((r,l)=>r.valueOf()!==o[l].valueOf()))return!1}return!0}function pi(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const hi=(e,t,s)=>e??t??s,Wd=ll({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:s}){const n=lt(Co),o=Te(()=>e.route||n.value),r=lt(ti,0),l=Te(()=>{let f=fs(r);const{matched:d}=o.value;let p;for(;(p=d[f])&&!p.components;)f++;return f}),c=Te(()=>o.value.matched[l.value]);on(ti,Te(()=>l.value+1)),on(qu,c),on(Co,o);const a=H();return Rt(()=>[a.value,c.value,e.name],([f,d,p],[b,y,E])=>{d&&(d.instances[p]=f,y&&y!==d&&f&&f===b&&(d.leaveGuards.size||(d.leaveGuards=y.leaveGuards),d.updateGuards.size||(d.updateGuards=y.updateGuards))),f&&d&&(!y||!bs(d,y)||!b)&&(d.enterCallbacks[p]||[]).forEach($=>$(f))},{flush:"post"}),()=>{const f=o.value,d=e.name,p=c.value,b=p&&p.components[d];if(!b)return mi(s.default,{Component:b,route:f});const y=p.props[d],E=y?y===!0?f.params:typeof y=="function"?y(f):y:null,L=Xo(b,pe({},E,t,{onVnodeUnmounted:q=>{q.component.isUnmounted&&(p.instances[d]=null)},ref:a}));return mi(s.default,{Component:L,route:f})||L}}});function mi(e,t){if(!e)return null;const s=e(t);return s.length===1?s[0]:s}const Kd=Wd;function Gd(e){const t=Ld(e.routes,e),s=e.parseQuery||yd,n=e.stringifyQuery||ri,o=e.history,r=Es(),l=Es(),c=Es(),a=Ua(It);let f=It;cs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Zn.bind(null,B=>""+B),p=Zn.bind(null,rd),b=Zn.bind(null,Ws);function y(B,v){let u,h;return ql(B)?(u=t.getRecordMatcher(B),h=v):h=B,t.addRoute(h,u)}function E(B){const v=t.getRecordMatcher(B);v&&t.removeRoute(v)}function $(){return t.getRoutes().map(B=>B.record)}function L(B){return!!t.getRecordMatcher(B)}function q(B,v){if(v=pe({},v||a.value),typeof B=="string"){const x=eo(s,B,v.path),T=t.resolve({path:x.path},v),S=o.createHref(x.fullPath);return pe(x,T,{params:b(T.params),hash:Ws(x.hash),redirectedFrom:void 0,href:S})}let u;if(B.path!=null)u=pe({},B,{path:eo(s,B.path,v.path).path});else{const x=pe({},B.params);for(const T in x)x[T]==null&&delete x[T];u=pe({},B,{params:p(x)}),v.params=p(v.params)}const h=t.resolve(u,v),R=B.hash||"";h.params=d(b(h.params));const m=ad(n,pe({},B,{hash:sd(R),path:h.path})),g=o.createHref(m);return pe({fullPath:m,hash:R,query:n===ri?wd(B.query):B.query||{}},h,{redirectedFrom:void 0,href:g})}function N(B){return typeof B=="string"?eo(s,B,a.value.path):pe({},B)}function K(B,v){if(f!==B)return vs(Se.NAVIGATION_CANCELLED,{from:v,to:B})}function V(B){return re(B)}function Z(B){return V(pe(N(B),{replace:!0}))}function ne(B,v){const u=B.matched[B.matched.length-1];if(u&&u.redirect){const{redirect:h}=u;let R=typeof h=="function"?h(B,v):h;return typeof R=="string"&&(R=R.includes("?")||R.includes("#")?R=N(R):{path:R},R.params={}),pe({query:B.query,hash:B.hash,params:R.path!=null?{}:B.params},R)}}function re(B,v){const u=f=q(B),h=a.value,R=B.state,m=B.force,g=B.replace===!0,x=ne(u,h);if(x)return re(pe(N(x),{state:typeof x=="object"?pe({},R,x.state):R,force:m,replace:g}),v||u);const T=u;T.redirectedFrom=v;let S;return!m&&cd(n,h,u)&&(S=vs(Se.NAVIGATION_DUPLICATED,{to:T,from:h}),Re(h,h,!0,!1)),(S?Promise.resolve(S):P(T,h)).catch(M=>St(M)?St(M,Se.NAVIGATION_GUARD_REDIRECT)?M:be(M):ae(M,T,h)).then(M=>{if(M){if(St(M,Se.NAVIGATION_GUARD_REDIRECT))return re(pe({replace:g},N(M.to),{state:typeof M.to=="object"?pe({},R,M.to.state):R,force:m}),v||T)}else M=A(T,h,!0,g,R);return D(T,h,M),M})}function Q(B,v){const u=K(B,v);return u?Promise.reject(u):Promise.resolve()}function C(B){const v=Ne.values().next().value;return v&&typeof v.runWithContext=="function"?v.runWithContext(B):B()}function P(B,v){let u;const[h,R,m]=_d(B,v);u=so(h.reverse(),"beforeRouteLeave",B,v);for(const x of h)x.leaveGuards.forEach(T=>{u.push(Vt(T,B,v))});const g=Q.bind(null,B,v);return u.push(g),Ce(u).then(()=>{u=[];for(const x of r.list())u.push(Vt(x,B,v));return u.push(g),Ce(u)}).then(()=>{u=so(R,"beforeRouteUpdate",B,v);for(const x of R)x.updateGuards.forEach(T=>{u.push(Vt(T,B,v))});return u.push(g),Ce(u)}).then(()=>{u=[];for(const x of m)if(x.beforeEnter)if(ut(x.beforeEnter))for(const T of x.beforeEnter)u.push(Vt(T,B,v));else u.push(Vt(x.beforeEnter,B,v));return u.push(g),Ce(u)}).then(()=>(B.matched.forEach(x=>x.enterCallbacks={}),u=so(m,"beforeRouteEnter",B,v,C),u.push(g),Ce(u))).then(()=>{u=[];for(const x of l.list())u.push(Vt(x,B,v));return u.push(g),Ce(u)}).catch(x=>St(x,Se.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function D(B,v,u){c.list().forEach(h=>C(()=>h(B,v,u)))}function A(B,v,u,h,R){const m=K(B,v);if(m)return m;const g=v===It,x=cs?history.state:{};u&&(h||g?o.replace(B.fullPath,pe({scroll:g&&x&&x.scroll},R)):o.push(B.fullPath,R)),a.value=B,Re(B,v,u,g),be()}let F;function U(){F||(F=o.listen((B,v,u)=>{if(!Qe.listening)return;const h=q(B),R=ne(h,Qe.currentRoute.value);if(R){re(pe(R,{replace:!0,force:!0}),h).catch(js);return}f=h;const m=a.value;cs&&vd(oi(m.fullPath,u.delta),jn()),P(h,m).catch(g=>St(g,Se.NAVIGATION_ABORTED|Se.NAVIGATION_CANCELLED)?g:St(g,Se.NAVIGATION_GUARD_REDIRECT)?(re(pe(N(g.to),{force:!0}),h).then(x=>{St(x,Se.NAVIGATION_ABORTED|Se.NAVIGATION_DUPLICATED)&&!u.delta&&u.type===Eo.pop&&o.go(-1,!1)}).catch(js),Promise.reject()):(u.delta&&o.go(-u.delta,!1),ae(g,h,m))).then(g=>{g=g||A(h,m,!1),g&&(u.delta&&!St(g,Se.NAVIGATION_CANCELLED)?o.go(-u.delta,!1):u.type===Eo.pop&&St(g,Se.NAVIGATION_ABORTED|Se.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),D(h,m,g)}).catch(js)}))}let k=Es(),G=Es(),ce;function ae(B,v,u){be(B);const h=G.list();return h.length?h.forEach(R=>R(B,v,u)):console.error(B),Promise.reject(B)}function $e(){return ce&&a.value!==It?Promise.resolve():new Promise((B,v)=>{k.add([B,v])})}function be(B){return ce||(ce=!B,U(),k.list().forEach(([v,u])=>B?u(B):v()),k.reset()),B}function Re(B,v,u,h){const{scrollBehavior:R}=e;if(!cs||!R)return Promise.resolve();const m=!u&&bd(oi(B.fullPath,0))||(h||!u)&&history.state&&history.state.scroll||null;return Ht().then(()=>R(B,v,m)).then(g=>g&&gd(g)).catch(g=>ae(g,B,v))}const ye=B=>o.go(B);let qe;const Ne=new Set,Qe={currentRoute:a,listening:!0,addRoute:y,removeRoute:E,clearRoutes:t.clearRoutes,hasRoute:L,getRoutes:$,resolve:q,options:e,push:V,replace:Z,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:l.add,afterEach:c.add,onError:G.add,isReady:$e,install(B){B.component("RouterLink",Ud),B.component("RouterView",Kd),B.config.globalProperties.$router=Qe,Object.defineProperty(B.config.globalProperties,"$route",{enumerable:!0,get:()=>fs(a)}),cs&&!qe&&a.value===It&&(qe=!0,V(o.location).catch(h=>{}));const v={};for(const h in It)Object.defineProperty(v,h,{get:()=>a.value[h],enumerable:!0});B.provide(In,Qe),B.provide(Qo,Ui(v)),B.provide(Co,a);const u=B.unmount;Ne.add(B),B.unmount=function(){Ne.delete(B),Ne.size<1&&(f=It,F&&F(),F=null,a.value=It,qe=!1,ce=!1),u()}}};function Ce(B){return B.reduce((v,u)=>v.then(()=>C(u)),Promise.resolve())}return Qe}const Jd={class:"min-h-screen bg-slate-900 text-slate-200 font-sans"},Yd={key:0,class:"border-b border-slate-800 bg-slate-900/50 backdrop-blur-xl sticky top-0 z-50"},Xd={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},Qd={class:"flex justify-between h-16 items-center"},Zd={class:"flex items-center space-x-3"},ef={class:"flex items-center space-x-1 sm:space-x-2"},tf={__name:"App",setup(e){const t=Zo(),s=Wu(),n=H(!!localStorage.getItem("pm2me_token"));Rt(s,()=>{n.value=!!localStorage.getItem("pm2me_token")});const o=()=>{localStorage.removeItem("pm2me_token"),n.value=!1,t.push("/login")};return(r,l)=>{const c=bc("router-view");return w(),_("div",Jd,[n.value&&!["/setup","/login"].includes(r.$route.path)?(w(),_("nav",Yd,[i("div",Xd,[i("div",Qd,[i("div",Zd,[i("img",{src:Hu,alt:"PM2Me",class:"w-8 h-8 rounded-lg shadow-lg shadow-blue-500/30 cursor-pointer",onClick:l[0]||(l[0]=a=>r.$router.push("/"))}),i("span",{class:"text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-400 to-indigo-400 cursor-pointer",onClick:l[1]||(l[1]=a=>r.$router.push("/"))},"PM2Me")]),i("div",ef,[i("button",{onClick:l[2]||(l[2]=a=>r.$router.push("/")),class:oe(["flex items-center space-x-2 px-3 py-2 rounded-xl text-sm font-medium transition-all duration-200",r.$route.path==="/"?"bg-blue-600/10 text-blue-400 shadow-sm border border-blue-500/20":"text-slate-400 hover:text-white hover:bg-slate-800"])},[...l[6]||(l[6]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})],-1),i("span",null,"Home",-1)])],2),i("button",{onClick:[l[3]||(l[3]=a=>r.$router.push("/settings")),l[4]||(l[4]=os(a=>r.$router.push("/nginx"),["prevent"]))],class:oe(["flex items-center space-x-2 px-3 py-2 rounded-xl text-sm font-medium transition-all duration-200",r.$route.path==="/nginx"?"bg-blue-600/10 text-blue-400 shadow-sm border border-blue-500/20":"text-slate-400 hover:text-white hover:bg-slate-800"])},[...l[7]||(l[7]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})],-1),i("span",null,"Nginx",-1)])],2),i("button",{onClick:l[5]||(l[5]=a=>r.$router.push("/settings")),class:oe(["flex items-center space-x-2 px-3 py-2 rounded-xl text-sm font-medium transition-all duration-200",r.$route.path==="/settings"?"bg-blue-600/10 text-blue-400 shadow-sm border border-blue-500/20":"text-slate-400 hover:text-white hover:bg-slate-800"])},[...l[8]||(l[8]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1),i("span",null,"Settings",-1)])],2),l[10]||(l[10]=i("div",{class:"w-px h-4 bg-slate-800 mx-1 hidden sm:block"},null,-1)),i("button",{onClick:o,class:"flex items-center space-x-2 px-3 py-2 rounded-xl text-sm font-medium text-slate-400 hover:text-red-400 hover:bg-red-400/10 transition-all duration-200"},[...l[9]||(l[9]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),i("span",{class:"hidden sm:inline"},"Logout",-1)])])])])])])):X("",!0),i("main",null,[Ae(c)])])}}},sf={class:"min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8"},nf={class:"max-w-md w-full space-y-8 bg-slate-800 p-10 rounded-2xl shadow-2xl border border-slate-700/50 backdrop-blur-sm relative overflow-hidden"},of={class:"rounded-md shadow-sm -space-y-px"},rf={key:0,class:"text-red-400 text-sm text-center bg-red-400/10 py-2 rounded-lg border border-red-400/20"},lf=["disabled"],af={key:0,class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",fill:"none",viewBox:"0 0 24 24"},cf={key:1,class:"absolute left-0 inset-y-0 flex items-center pl-3"},uf={__name:"Login",setup(e){const t=Zo(),s=H(""),n=H(""),o=H(!1);Gt(async()=>{try{(await(await fetch("/api/setup/status")).json()).needsSetup&&(window.location.href="/setup")}catch{}});const r=async()=>{o.value=!0,n.value="";try{const l=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:s.value})}),c=await l.json();l.ok&&c.token?(localStorage.setItem("pm2me_token",c.token),t.push("/")):n.value=c.error||"Login failed"}catch{n.value="Failed to connect to server"}finally{o.value=!1}};return(l,c)=>(w(),_("div",sf,[i("div",nf,[c[5]||(c[5]=rt('<div class="absolute -top-10 -right-10 w-40 h-40 bg-blue-500 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-pulse"></div><div class="absolute -bottom-10 -left-10 w-40 h-40 bg-indigo-500 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-pulse"></div><div class="relative z-10 text-center"><div class="mx-auto w-16 h-16 rounded-2xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center text-white text-3xl font-bold shadow-lg shadow-blue-500/30 mb-6"> P </div><h2 class="mt-2 text-3xl font-extrabold text-white tracking-tight">PM2Me</h2><p class="mt-2 text-sm text-slate-400">Sign in to manage your deployments</p></div>',3)),i("form",{class:"relative z-10 mt-8 space-y-6",onSubmit:os(r,["prevent"])},[i("div",of,[i("div",null,[c[1]||(c[1]=i("label",{for:"password",class:"sr-only"},"Password",-1)),xe(i("input",{id:"password","onUpdate:modelValue":c[0]||(c[0]=a=>s.value=a),name:"password",type:"password",required:"",class:"appearance-none rounded-lg relative block w-full px-4 py-3 border border-slate-600 bg-slate-900/50 placeholder-slate-400 text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 sm:text-sm",placeholder:"Admin Password (or set initial)"},null,512),[[Be,s.value]])])]),n.value?(w(),_("div",rf,j(n.value),1)):X("",!0),i("div",null,[i("button",{type:"submit",disabled:o.value,class:"group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 focus:ring-offset-slate-900 shadow-lg shadow-blue-500/30 transition-all duration-200 disabled:opacity-70 disabled:cursor-not-allowed"},[o.value?(w(),_("svg",af,[...c[2]||(c[2]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("span",cf,[...c[3]||(c[3]=[i("svg",{class:"h-5 w-5 text-indigo-300 group-hover:text-indigo-200 transition-colors",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[i("path",{"fill-rule":"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z","clip-rule":"evenodd"})],-1)])])),c[4]||(c[4]=Y(" Sign in ",-1))],8,lf)])],32)])]))}},_t=Object.create(null);_t.open="0";_t.close="1";_t.ping="2";_t.pong="3";_t.message="4";_t.upgrade="5";_t.noop="6";const dn=Object.create(null);Object.keys(_t).forEach(e=>{dn[_t[e]]=e});const Ao={type:"error",data:"parser error"},Jl=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Yl=typeof ArrayBuffer=="function",Xl=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,tr=({type:e,data:t},s,n)=>Jl&&t instanceof Blob?s?n(t):gi(t,n):Yl&&(t instanceof ArrayBuffer||Xl(t))?s?n(t):gi(new Blob([t]),n):n(_t[e]+(t||"")),gi=(e,t)=>{const s=new FileReader;return s.onload=function(){const n=s.result.split(",")[1];t("b"+(n||""))},s.readAsDataURL(e)};function vi(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let no;function df(e,t){if(Jl&&e.data instanceof Blob)return e.data.arrayBuffer().then(vi).then(t);if(Yl&&(e.data instanceof ArrayBuffer||Xl(e.data)))return t(vi(e.data));tr(e,!1,s=>{no||(no=new TextEncoder),t(no.encode(s))})}const bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ts=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<bi.length;e++)Ts[bi.charCodeAt(e)]=e;const ff=e=>{let t=e.length*.75,s=e.length,n,o=0,r,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),d=new Uint8Array(f);for(n=0;n<s;n+=4)r=Ts[e.charCodeAt(n)],l=Ts[e.charCodeAt(n+1)],c=Ts[e.charCodeAt(n+2)],a=Ts[e.charCodeAt(n+3)],d[o++]=r<<2|l>>4,d[o++]=(l&15)<<4|c>>2,d[o++]=(c&3)<<6|a&63;return f},pf=typeof ArrayBuffer=="function",sr=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ql(e,t)};const s=e.charAt(0);return s==="b"?{type:"message",data:hf(e.substring(1),t)}:dn[s]?e.length>1?{type:dn[s],data:e.substring(1)}:{type:dn[s]}:Ao},hf=(e,t)=>{if(pf){const s=ff(e);return Ql(s,t)}else return{base64:!0,data:e}},Ql=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,Zl="",mf=(e,t)=>{const s=e.length,n=new Array(s);let o=0;e.forEach((r,l)=>{tr(r,!1,c=>{n[l]=c,++o===s&&t(n.join(Zl))})})},gf=(e,t)=>{const s=e.split(Zl),n=[];for(let o=0;o<s.length;o++){const r=sr(s[o],t);if(n.push(r),r.type==="error")break}return n};function vf(){return new TransformStream({transform(e,t){df(e,s=>{const n=s.length;let o;if(n<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,n);else if(n<65536){o=new Uint8Array(3);const r=new DataView(o.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{o=new Uint8Array(9);const r=new DataView(o.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(s)})}})}let oo;function tn(e){return e.reduce((t,s)=>t+s.length,0)}function sn(e,t){if(e[0].length===t)return e.shift();const s=new Uint8Array(t);let n=0;for(let o=0;o<t;o++)s[o]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),s}function bf(e,t){oo||(oo=new TextDecoder);const s=[];let n=0,o=-1,r=!1;return new TransformStream({transform(l,c){for(s.push(l);;){if(n===0){if(tn(s)<1)break;const a=sn(s,1);r=(a[0]&128)===128,o=a[0]&127,o<126?n=3:o===126?n=1:n=2}else if(n===1){if(tn(s)<2)break;const a=sn(s,2);o=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),n=3}else if(n===2){if(tn(s)<8)break;const a=sn(s,8),f=new DataView(a.buffer,a.byteOffset,a.length),d=f.getUint32(0);if(d>Math.pow(2,21)-1){c.enqueue(Ao);break}o=d*Math.pow(2,32)+f.getUint32(4),n=3}else{if(tn(s)<o)break;const a=sn(s,o);c.enqueue(sr(r?a:oo.decode(a),t)),n=0}if(o===0||o>e){c.enqueue(Ao);break}}}})}const ea=4;function Me(e){if(e)return xf(e)}function xf(e){for(var t in Me.prototype)e[t]=Me.prototype[t];return e}Me.prototype.on=Me.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Me.prototype.once=function(e,t){function s(){this.off(e,s),t.apply(this,arguments)}return s.fn=t,this.on(e,s),this};Me.prototype.off=Me.prototype.removeListener=Me.prototype.removeAllListeners=Me.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+e];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,o=0;o<s.length;o++)if(n=s[o],n===t||n.fn===t){s.splice(o,1);break}return s.length===0&&delete this._callbacks["$"+e],this};Me.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),s=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(s){s=s.slice(0);for(var n=0,o=s.length;n<o;++n)s[n].apply(this,t)}return this};Me.prototype.emitReserved=Me.prototype.emit;Me.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Me.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Dn=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,s)=>s(t,0),et=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),yf="arraybuffer";function ta(e,...t){return t.reduce((s,n)=>(e.hasOwnProperty(n)&&(s[n]=e[n]),s),{})}const wf=et.setTimeout,_f=et.clearTimeout;function Vn(e,t){t.useNativeTimers?(e.setTimeoutFn=wf.bind(et),e.clearTimeoutFn=_f.bind(et)):(e.setTimeoutFn=et.setTimeout.bind(et),e.clearTimeoutFn=et.clearTimeout.bind(et))}const kf=1.33;function Cf(e){return typeof e=="string"?Sf(e):Math.ceil((e.byteLength||e.size)*kf)}function Sf(e){let t=0,s=0;for(let n=0,o=e.length;n<o;n++)t=e.charCodeAt(n),t<128?s+=1:t<2048?s+=2:t<55296||t>=57344?s+=3:(n++,s+=4);return s}function sa(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ef(e){let t="";for(let s in e)e.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(e[s]));return t}function $f(e){let t={},s=e.split("&");for(let n=0,o=s.length;n<o;n++){let r=s[n].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}class Af extends Error{constructor(t,s,n){super(t),this.description=s,this.context=n,this.type="TransportError"}}class nr extends Me{constructor(t){super(),this.writable=!1,Vn(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,s,n){return super.emitReserved("error",new Af(t,s,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const s=sr(t,this.socket.binaryType);this.onPacket(s)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,s={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(s)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const s=Ef(t);return s.length?"?"+s:""}}class Tf extends nr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const s=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||s()})),this.writable||(n++,this.once("drain",function(){--n||s()}))}else s()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const s=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};gf(t,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,mf(t,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=sa()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(t,s)}}let na=!1;try{na=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Mf=na;function Rf(){}class Of extends Tf{constructor(t){if(super(t),typeof location<"u"){const s=location.protocol==="https:";let n=location.port;n||(n=s?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,s){const n=this.request({method:"POST",data:t});n.on("success",s),n.on("error",(o,r)=>{this.onError("xhr post error",o,r)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(s,n)=>{this.onError("xhr poll error",s,n)}),this.pollXhr=t}}class yt extends Me{constructor(t,s,n){super(),this.createRequest=t,Vn(this,n),this._opts=n,this._method=n.method||"GET",this._uri=s,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const s=ta(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(s);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&n.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var o;n.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=yt.requestsCount++,yt.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Rf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete yt.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}yt.requestsCount=0;yt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",xi);else if(typeof addEventListener=="function"){const e="onpagehide"in et?"pagehide":"unload";addEventListener(e,xi,!1)}}function xi(){for(let e in yt.requests)yt.requests.hasOwnProperty(e)&&yt.requests[e].abort()}const Bf=(function(){const e=oa({xdomain:!1});return e&&e.responseType!==null})();class Pf extends Of{constructor(t){super(t);const s=t&&t.forceBase64;this.supportsBinary=Bf&&!s}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new yt(oa,this.uri(),t)}}function oa(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Mf))return new XMLHttpRequest}catch{}if(!t)try{return new et[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ra=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Nf extends nr{get name(){return"websocket"}doOpen(){const t=this.uri(),s=this.opts.protocols,n=ra?{}:ta(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,s,n)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let s=0;s<t.length;s++){const n=t[s],o=s===t.length-1;tr(n,this.supportsBinary,r=>{try{this.doWrite(n,r)}catch{}o&&Dn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=sa()),this.supportsBinary||(s.b64=1),this.createUri(t,s)}}const ro=et.WebSocket||et.MozWebSocket;class Lf extends Nf{createSocket(t,s,n){return ra?new ro(t,s,n):s?new ro(t,s):new ro(t)}doWrite(t,s){this.ws.send(s)}}class If extends nr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const s=bf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(s).getReader(),o=vf();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const r=()=>{n.read().then(({done:c,value:a})=>{c||(this.onPacket(a),r())}).catch(c=>{})};r();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let s=0;s<t.length;s++){const n=t[s],o=s===t.length-1;this._writer.write(n).then(()=>{o&&Dn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const jf={websocket:Lf,webtransport:If,polling:Pf},Df=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function To(e){if(e.length>8e3)throw"URI too long";const t=e,s=e.indexOf("["),n=e.indexOf("]");s!=-1&&n!=-1&&(e=e.substring(0,s)+e.substring(s,n).replace(/:/g,";")+e.substring(n,e.length));let o=Df.exec(e||""),r={},l=14;for(;l--;)r[Vf[l]]=o[l]||"";return s!=-1&&n!=-1&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=Hf(r,r.path),r.queryKey=Ff(r,r.query),r}function Hf(e,t){const s=/\/{2,9}/g,n=t.replace(s,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Ff(e,t){const s={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,r){o&&(s[o]=r)}),s}const Mo=typeof addEventListener=="function"&&typeof removeEventListener=="function",fn=[];Mo&&addEventListener("offline",()=>{fn.forEach(e=>e())},!1);class Ut extends Me{constructor(t,s){if(super(),this.binaryType=yf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){const n=To(t);s.hostname=n.host,s.secure=n.protocol==="https"||n.protocol==="wss",s.port=n.port,n.query&&(s.query=n.query)}else s.host&&(s.hostname=To(s.host).host);Vn(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(n=>{const o=n.prototype.name;this.transports.push(o),this._transportsByName[o]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=$f(this.opts.query)),Mo&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},fn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const s=Object.assign({},this.opts.query);s.EIO=ea,s.transport=t,this.id&&(s.sid=this.id);const n=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ut.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",Ut.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let n=0;n<this.writeBuffer.length;n++){const o=this.writeBuffer[n].data;if(o&&(s+=Cf(o)),n>0&&s>this._maxPayload)return this.writeBuffer.slice(0,n);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Dn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,n){return this._sendPacket("message",t,s,n),this}send(t,s,n){return this._sendPacket("message",t,s,n),this}_sendPacket(t,s,n,o){if(typeof s=="function"&&(o=s,s=void 0),typeof n=="function"&&(o=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const r={type:t,data:s,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},n=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(Ut.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Mo&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=fn.indexOf(this._offlineEventListener);n!==-1&&fn.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}Ut.protocol=ea;class Uf extends Ut{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let s=this.createTransport(t),n=!1;Ut.priorWebsocketSuccess=!1;const o=()=>{n||(s.send([{type:"ping",data:"probe"}]),s.once("packet",p=>{if(!n)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;Ut.priorWebsocketSuccess=s.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(d(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=s.name,this.emitReserved("upgradeError",b)}}))};function r(){n||(n=!0,d(),s.close(),s=null)}const l=p=>{const b=new Error("probe error: "+p);b.transport=s.name,r(),this.emitReserved("upgradeError",b)};function c(){l("transport closed")}function a(){l("socket closed")}function f(p){s&&p.name!==s.name&&r()}const d=()=>{s.removeListener("open",o),s.removeListener("error",l),s.removeListener("close",c),this.off("close",a),this.off("upgrading",f)};s.once("open",o),s.once("error",l),s.once("close",c),this.once("close",a),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||s.open()},200):s.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const s=[];for(let n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&s.push(t[n]);return s}}let zf=class extends Uf{constructor(t,s={}){const n=typeof t=="object"?t:s;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(o=>jf[o]).filter(o=>!!o)),super(t,n)}};function qf(e,t="",s){let n=e;s=s||typeof location<"u"&&location,e==null&&(e=s.protocol+"//"+s.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=s.protocol+e:e=s.host+e),/^(https?|wss?):\/\//.test(e)||(typeof s<"u"?e=s.protocol+"//"+e:e="https://"+e),n=To(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const r=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port+t,n.href=n.protocol+"://"+r+(s&&s.port===n.port?"":":"+n.port),n}const Wf=typeof ArrayBuffer=="function",Kf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ia=Object.prototype.toString,Gf=typeof Blob=="function"||typeof Blob<"u"&&ia.call(Blob)==="[object BlobConstructor]",Jf=typeof File=="function"||typeof File<"u"&&ia.call(File)==="[object FileConstructor]";function or(e){return Wf&&(e instanceof ArrayBuffer||Kf(e))||Gf&&e instanceof Blob||Jf&&e instanceof File}function pn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let s=0,n=e.length;s<n;s++)if(pn(e[s]))return!0;return!1}if(or(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return pn(e.toJSON(),!0);for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&pn(e[s]))return!0;return!1}function Yf(e){const t=[],s=e.data,n=e;return n.data=Ro(s,t),n.attachments=t.length,{packet:n,buffers:t}}function Ro(e,t){if(!e)return e;if(or(e)){const s={_placeholder:!0,num:t.length};return t.push(e),s}else if(Array.isArray(e)){const s=new Array(e.length);for(let n=0;n<e.length;n++)s[n]=Ro(e[n],t);return s}else if(typeof e=="object"&&!(e instanceof Date)){const s={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(s[n]=Ro(e[n],t));return s}return e}function Xf(e,t){return e.data=Oo(e.data,t),delete e.attachments,e}function Oo(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let s=0;s<e.length;s++)e[s]=Oo(e[s],t);else if(typeof e=="object")for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(e[s]=Oo(e[s],t));return e}const Qf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ue;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ue||(ue={}));class Zf{constructor(t){this.replacer=t}encode(t){return(t.type===ue.EVENT||t.type===ue.ACK)&&pn(t)?this.encodeAsBinary({type:t.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let s=""+t.type;return(t.type===ue.BINARY_EVENT||t.type===ue.BINARY_ACK)&&(s+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(s+=t.nsp+","),t.id!=null&&(s+=t.id),t.data!=null&&(s+=JSON.stringify(t.data,this.replacer)),s}encodeAsBinary(t){const s=Yf(t),n=this.encodeAsString(s.packet),o=s.buffers;return o.unshift(n),o}}class rr extends Me{constructor(t){super(),this.reviver=t}add(t){let s;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(t);const n=s.type===ue.BINARY_EVENT;n||s.type===ue.BINARY_ACK?(s.type=n?ue.EVENT:ue.ACK,this.reconstructor=new e0(s),s.attachments===0&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else if(or(t)||t.base64)if(this.reconstructor)s=this.reconstructor.takeBinaryData(t),s&&(this.reconstructor=null,super.emitReserved("decoded",s));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let s=0;const n={type:Number(t.charAt(0))};if(ue[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===ue.BINARY_EVENT||n.type===ue.BINARY_ACK){const r=s+1;for(;t.charAt(++s)!=="-"&&s!=t.length;);const l=t.substring(r,s);if(l!=Number(l)||t.charAt(s)!=="-")throw new Error("Illegal attachments");n.attachments=Number(l)}if(t.charAt(s+1)==="/"){const r=s+1;for(;++s&&!(t.charAt(s)===","||s===t.length););n.nsp=t.substring(r,s)}else n.nsp="/";const o=t.charAt(s+1);if(o!==""&&Number(o)==o){const r=s+1;for(;++s;){const l=t.charAt(s);if(l==null||Number(l)!=l){--s;break}if(s===t.length)break}n.id=Number(t.substring(r,s+1))}if(t.charAt(++s)){const r=this.tryParse(t.substr(s));if(rr.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,s){switch(t){case ue.CONNECT:return yi(s);case ue.DISCONNECT:return s===void 0;case ue.CONNECT_ERROR:return typeof s=="string"||yi(s);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&Qf.indexOf(s[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class e0{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const s=Xf(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function yi(e){return Object.prototype.toString.call(e)==="[object Object]"}const t0=Object.freeze(Object.defineProperty({__proto__:null,Decoder:rr,Encoder:Zf,get PacketType(){return ue}},Symbol.toStringTag,{value:"Module"}));function ot(e,t,s){return e.on(t,s),function(){e.off(t,s)}}const s0=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class la extends Me{constructor(t,s,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=s,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ot(t,"open",this.onopen.bind(this)),ot(t,"packet",this.onpacket.bind(this)),ot(t,"error",this.onerror.bind(this)),ot(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...s){var n,o,r;if(s0.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(s.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;const l={type:ue.EVENT,data:s};if(l.options={},l.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){const d=this.ids++,p=s.pop();this._registerAckCallback(d,p),l.id=d}const c=(o=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||o===void 0?void 0:o.writable,a=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l)),this.flags={},this}_registerAckCallback(t,s){var n;const o=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(o===void 0){this.acks[t]=s;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);s.call(this,new Error("operation has timed out"))},o),l=(...c)=>{this.io.clearTimeoutFn(r),s.apply(this,c)};l.withError=!0,this.acks[t]=l}emitWithAck(t,...s){return new Promise((n,o)=>{const r=(l,c)=>l?o(l):n(c);r.withError=!0,s.push(r),this.emit(t,...s)})}_addToQueue(t){let s;typeof t[t.length-1]=="function"&&(s=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...r)=>(this._queue[0],o!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),s&&s(o)):(this._queue.shift(),s&&s(null,...r)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const s=this._queue[0];s.pending&&!t||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ue.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ue.EVENT:case ue.BINARY_EVENT:this.onevent(t);break;case ue.ACK:case ue.BINARY_ACK:this.onack(t);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const s=t.data||[];t.id!=null&&s.push(this.ack(t.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const s=this._anyListeners.slice();for(const n of s)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const s=this;let n=!1;return function(...o){n||(n=!0,s.packet({type:ue.ACK,id:t,data:o}))}}onack(t){const s=this.acks[t.id];typeof s=="function"&&(delete this.acks[t.id],s.withError&&t.data.unshift(null),s.apply(this,t.data))}onconnect(t,s){this.id=t,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const s=this._anyListeners;for(let n=0;n<s.length;n++)if(t===s[n])return s.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const s=this._anyOutgoingListeners;for(let n=0;n<s.length;n++)if(t===s[n])return s.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const s=this._anyOutgoingListeners.slice();for(const n of s)n.apply(this,t.data)}}}function ys(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ys.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-s:e+s}return Math.min(e,this.max)|0};ys.prototype.reset=function(){this.attempts=0};ys.prototype.setMin=function(e){this.ms=e};ys.prototype.setMax=function(e){this.max=e};ys.prototype.setJitter=function(e){this.jitter=e};class Bo extends Me{constructor(t,s){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(s=t,t=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,Vn(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((n=s.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new ys({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=t;const o=s.parser||t0;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var s;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(s=this.backoff)===null||s===void 0||s.setMin(t),this)}randomizationFactor(t){var s;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(s=this.backoff)===null||s===void 0||s.setJitter(t),this)}reconnectionDelayMax(t){var s;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(s=this.backoff)===null||s===void 0||s.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new zf(this.uri,this.opts);const s=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const o=ot(s,"open",function(){n.onopen(),t&&t()}),r=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},l=ot(s,"error",r);if(this._timeout!==!1){const c=this._timeout,a=this.setTimeoutFn(()=>{o(),r(new Error("timeout")),s.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(o),this.subs.push(l),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ot(t,"ping",this.onping.bind(this)),ot(t,"data",this.ondata.bind(this)),ot(t,"error",this.onerror.bind(this)),ot(t,"close",this.onclose.bind(this)),ot(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(s){this.onclose("parse error",s)}}ondecoded(t){Dn(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,s){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new la(this,t,s),this.nsps[t]=n),n}_destroy(t){const s=Object.keys(this.nsps);for(const n of s)if(this.nsps[n].active)return;this._close()}_packet(t){const s=this.encoder.encode(t);for(let n=0;n<s.length;n++)this.engine.write(s[n],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,s){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const s=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},s);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const $s={};function rs(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const s=qf(e,t.path||"/socket.io"),n=s.source,o=s.id,r=s.path,l=$s[o]&&r in $s[o].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let a;return c?a=new Bo(n,t):($s[o]||($s[o]=new Bo(n,t)),a=$s[o]),s.query&&!t.query&&(t.query=s.queryKey),a.socket(s.path,t)}Object.assign(rs,{Manager:Bo,Socket:la,io:rs,connect:rs});const ir=(e,t)=>{const s=e.__vccOpts||e;for(const[n,o]of t)s[n]=o;return s},n0={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 bg-slate-900/80 backdrop-blur-sm"},o0={class:"bg-slate-800 rounded-2xl shadow-xl border border-slate-700 w-full max-w-2xl flex flex-col max-h-[90vh]"},r0={class:"flex items-center justify-between p-6 border-b border-slate-700"},i0={class:"text-xl font-bold text-white"},l0={class:"overflow-y-auto p-6 flex-1 custom-scrollbar"},a0={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},c0={class:"md:col-span-2"},u0={class:"flex space-x-2"},d0=["label"],f0=["value"],p0=["disabled"],h0={key:0,class:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m0={key:1,class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},g0={key:0,class:"mt-2 text-xs text-yellow-500"},v0={class:"md:col-span-2"},b0={class:"flex space-x-2"},x0={key:0,value:"",disabled:""},y0=["value"],w0=["disabled"],_0={key:0,class:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},k0={key:1,class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},C0={class:"md:col-span-2"},S0={class:"md:col-span-2 grid grid-cols-1 sm:grid-cols-2 gap-4"},E0={class:"flex items-center justify-between p-4 bg-slate-900/50 rounded-xl border border-slate-700/50 group hover:border-blue-500/30 transition-colors"},$0={class:"relative inline-flex items-center cursor-pointer"},A0={class:"flex items-center justify-between p-4 bg-slate-900/50 rounded-xl border border-slate-700/50 group hover:border-emerald-500/30 transition-colors"},T0={class:"relative inline-flex items-center cursor-pointer"},M0={class:"md:col-span-2"},R0={class:"flex items-center space-x-6 mb-4"},O0={class:"inline-flex items-center cursor-pointer"},B0={class:"inline-flex items-center cursor-pointer"},P0={class:"inline-flex items-center cursor-pointer"},N0={key:0,class:"pl-2 border-l-2 border-slate-600"},L0={class:"flex items-center"},I0={key:1,class:"pl-2 border-l-2 border-slate-600 mt-4"},j0={class:"flex items-center"},D0={class:"md:col-span-2"},V0={class:"flex items-center justify-between mb-2"},H0={class:"flex gap-2"},F0={class:"space-y-3"},U0=["onUpdate:modelValue","title"],z0=["onUpdate:modelValue"],q0=["onClick"],W0={key:0,class:"text-xs text-yellow-500 flex items-center"},K0={key:1,class:"text-sm text-slate-500 italic py-1 px-2 border border-dashed border-slate-700 rounded text-center"},G0={class:"p-6 border-t border-slate-700 bg-slate-800/50 flex justify-between items-center rounded-b-2xl"},J0={class:"flex space-x-4"},Y0=["disabled"],X0={key:0,class:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24"},Q0={__name:"DeployModal",props:{isOpen:Boolean,appToEdit:Object},emits:["close","deploy","delete"],setup(e,{emit:t}){const s=e,n=t,o=H({name:"",branch:"main",buildScript:"",npmScript:"start",customScript:"app.js",autoSync:!1,zeroDowntime:!0}),r=H(""),l=H([]),c=H(!1),a=H("npm"),f=H([]),d=H(!1),p=H([]),b=H(!1),y=H(!1),E=Te(()=>{const Q=f.value.map(C=>C.name.trim()).filter(C=>C!=="");return Q.filter((C,P)=>Q.indexOf(C)!==P)});Rt(()=>s.isOpen,async Q=>{if(Q)if(l.value.length===0&&await $(),s.appToEdit){y.value=!0,o.value.name=s.appToEdit.name,o.value.branch=s.appToEdit.branch,o.value.buildScript=s.appToEdit.buildScript||"",o.value.autoSync=!!s.appToEdit.autoSync,o.value.zeroDowntime=s.appToEdit.zeroDowntime!==!1,s.appToEdit.ecosystemFile?a.value="ecosystem":s.appToEdit.pm2Script&&s.appToEdit.pm2Script!=="npm"?(a.value="script",o.value.customScript=s.appToEdit.pm2Script):(a.value="npm",o.value.npmScript=s.appToEdit.pm2Args?s.appToEdit.pm2Args.replace("run ",""):"start");const C=Object.keys(s.appToEdit.env||{});f.value=C.map(D=>({name:D,value:s.appToEdit.env[D]}));let P=null;for(const D of l.value){const A=D.repositories.find(F=>F.cloneUrl===s.appToEdit.repoUrl);if(A){P={url:A.cloneUrl,token:D.token,name:A.name};break}}P&&(r.value=P,await Z(),o.value.branch=s.appToEdit.branch)}else y.value=!1,o.value={name:"",branch:"main",buildScript:"",npmScript:"start",customScript:"app.js",autoSync:!1,zeroDowntime:!0},r.value="",a.value="npm",f.value=[],p.value=[]}),Rt(r,Q=>{Q&&Q.name&&!y.value&&(o.value.name=Q.name),p.value=[],Q&&Q.url&&Z()});const $=async()=>{c.value=!0;try{const Q=await fetch("/api/git/repositories",{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}});l.value=await Q.json()}catch{console.error("Failed to load repositories")}finally{c.value=!1}},L=()=>{f.value.push({name:"",value:""})},q=Q=>{f.value.splice(Q,1)},N=H(null),K=()=>{N.value&&N.value.click()},V=Q=>{const C=Q.target.files[0];if(!C)return;const P=new FileReader;P.onload=D=>{const F=D.target.result.split(`
|
|
2
|
+
`);let U=0;const k=[...f.value];F.forEach(G=>{let ce=G.trim();if(!ce||ce.startsWith("#"))return;ce.startsWith("export ")&&(ce=ce.substring(7).trim());const ae=ce.match(/^([^=]+)=(.*)$/);if(ae){let $e=ae[1].trim(),be=ae[2].trim();(be.startsWith('"')&&be.endsWith('"')||be.startsWith("'")&&be.endsWith("'"))&&(be=be.substring(1,be.length-1));const Re=k.findIndex(ye=>ye.name===$e);if(Re>=0)k[Re].value=be,U++;else{const ye=k.findIndex(qe=>qe.name.trim()===""&&qe.value.trim()==="");ye>=0?(k[ye].name=$e,k[ye].value=be):k.push({name:$e,value:be}),U++}}}),f.value=k,U===0&&alert("No valid environment variables found in this file."),Q.target.value=""},P.readAsText(C)},Z=async()=>{if(!r.value||!r.value.url){alert("Please select a repository first");return}d.value=!0,p.value=[o.value.branch];try{const C=await(await fetch("/api/git/branches",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`},body:JSON.stringify({repoUrl:r.value.url,token:r.value.token})})).json();C.length>0?(p.value=C,o.value.branch||(o.value.branch=C.find(P=>P==="main"||P==="master")||C[0])):alert("No branches found or repo is private (needs token)")}catch{alert("Failed to fetch branches")}finally{d.value=!1}},ne=async()=>{let Q={};if(f.value.forEach(P=>{P.name.trim()&&(Q[P.name.trim()]=P.value.trim())}),!r.value||!r.value.url){alert("Please select a repository");return}const C={...o.value,repoUrl:r.value.url,token:r.value.token,env:Q,pm2Script:a.value==="script"?o.value.customScript:a.value==="npm"?"npm":null,pm2Args:a.value==="npm"?`run ${o.value.npmScript||"start"}`:null,ecosystemFile:a.value==="ecosystem"?"ecosystem.config.cjs":null};b.value=!0;try{const P=s.appToEdit?`/api/apps/${s.appToEdit.id}`:"/api/apps",D=s.appToEdit?"PUT":"POST",F=await(await fetch(P,{method:D,headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`},body:JSON.stringify(C)})).json();fetch(`/api/deploy/${s.appToEdit?s.appToEdit.id:F.id}`,{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}}),n("deploy"),n("close")}catch{alert("Failed to save app configuration")}finally{b.value=!1}},re=()=>{n("delete",s.appToEdit),n("close")};return(Q,C)=>e.isOpen?(w(),_("div",n0,[i("div",o0,[i("div",r0,[i("h3",i0,j(e.appToEdit?"Edit Application":"Deploy New Application"),1),i("button",{onClick:C[0]||(C[0]=P=>Q.$emit("close")),class:"text-slate-400 hover:text-white transition-colors"},[...C[14]||(C[14]=[i("svg",{class:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),i("div",l0,[i("form",{onSubmit:os(ne,["prevent"]),class:"space-y-6"},[i("div",a0,[i("div",c0,[C[18]||(C[18]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"GitHub Repository",-1)),i("div",u0,[xe(i("select",{"onUpdate:modelValue":C[1]||(C[1]=P=>r.value=P),required:"",class:"flex-1 bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all appearance-none cursor-pointer"},[C[15]||(C[15]=i("option",{value:"",disabled:""},"Select a repository...",-1)),(w(!0),_(ve,null,De(l.value,P=>(w(),_("optgroup",{key:P.accountId,label:"@"+P.account},[(w(!0),_(ve,null,De(P.repositories,D=>(w(),_("option",{key:D.id,value:{url:D.cloneUrl,token:P.token,name:D.name}},j(D.name)+" "+j(D.private?"๐":""),9,f0))),128))],8,d0))),128))],512),[[ko,r.value]]),i("button",{type:"button",onClick:$,disabled:c.value,class:"px-3 py-2 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded-lg transition-colors border border-slate-600 disabled:opacity-50",title:"Refresh Repositories"},[c.value?(w(),_("svg",h0,[...C[16]||(C[16]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",m0,[...C[17]||(C[17]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])]))],8,p0)]),l.value.length===0?(w(),_("p",g0,"No repositories found. Go to Settings to connect a GitHub Account.")):X("",!0)]),i("div",v0,[C[19]||(C[19]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"App Name",-1)),xe(i("input",{"onUpdate:modelValue":C[2]||(C[2]=P=>o.value.name=P),onInput:C[3]||(C[3]=P=>y.value=!0),required:"",type:"text",class:"w-full bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all placeholder-slate-500",placeholder:"my-awesome-app"},null,544),[[Be,o.value.name]])]),i("div",null,[C[22]||(C[22]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"Branch",-1)),i("div",b0,[xe(i("select",{"onUpdate:modelValue":C[4]||(C[4]=P=>o.value.branch=P),required:"",class:"flex-1 bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all appearance-none cursor-pointer"},[p.value.length===0?(w(),_("option",x0,"Select a repository first...")):X("",!0),(w(!0),_(ve,null,De(p.value,P=>(w(),_("option",{key:P,value:P},j(P),9,y0))),128))],512),[[ko,o.value.branch]]),i("button",{type:"button",onClick:Z,disabled:d.value||!r.value,class:"px-3 py-2 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded-lg transition-colors border border-slate-600 disabled:opacity-50",title:"Refresh Branches"},[d.value?(w(),_("svg",_0,[...C[20]||(C[20]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",k0,[...C[21]||(C[21]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])]))],8,w0)])]),i("div",C0,[C[23]||(C[23]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"Build Script (Optional)",-1)),xe(i("textarea",{"onUpdate:modelValue":C[5]||(C[5]=P=>o.value.buildScript=P),rows:"2",class:"w-full bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all placeholder-slate-500 custom-scrollbar",placeholder:`npm install
|
|
3
|
+
npm run build`},null,512),[[Be,o.value.buildScript]])]),i("div",S0,[i("div",E0,[C[25]||(C[25]=rt('<div class="flex items-center space-x-3" data-v-395317fb><div class="p-2 bg-blue-500/10 rounded-lg text-blue-400 group-hover:bg-blue-500/20 transition-colors" data-v-395317fb><svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" data-v-395317fb><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-395317fb></path></svg></div><div data-v-395317fb><span class="block text-sm font-semibold text-white" data-v-395317fb>Auto Sync</span><span class="block text-[10px] text-slate-500" data-v-395317fb>Auto pull & deploy on push</span></div></div>',1)),i("label",$0,[xe(i("input",{type:"checkbox","onUpdate:modelValue":C[6]||(C[6]=P=>o.value.autoSync=P),class:"sr-only peer"},null,512),[[_o,o.value.autoSync]]),C[24]||(C[24]=i("div",{class:"w-11 h-6 bg-slate-700 rounded-full peer peer-focus:ring-2 peer-focus:ring-blue-500/50 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"},null,-1))])]),i("div",A0,[C[27]||(C[27]=rt('<div class="flex items-center space-x-3" data-v-395317fb><div class="p-2 bg-emerald-500/10 rounded-lg text-emerald-400 group-hover:bg-emerald-500/20 transition-colors" data-v-395317fb><svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" data-v-395317fb><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" data-v-395317fb></path></svg></div><div data-v-395317fb><span class="block text-sm font-semibold text-white" data-v-395317fb>Zero Downtime</span><span class="block text-[10px] text-slate-500" data-v-395317fb>Use PM2 reload</span></div></div>',1)),i("label",T0,[xe(i("input",{type:"checkbox","onUpdate:modelValue":C[7]||(C[7]=P=>o.value.zeroDowntime=P),class:"sr-only peer"},null,512),[[_o,o.value.zeroDowntime]]),C[26]||(C[26]=i("div",{class:"w-11 h-6 bg-slate-700 rounded-full peer peer-focus:ring-2 peer-focus:ring-emerald-500/50 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-emerald-500"},null,-1))])])]),i("div",M0,[C[34]||(C[34]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"PM2 Execution Mode",-1)),i("div",R0,[i("label",O0,[xe(i("input",{type:"radio","onUpdate:modelValue":C[8]||(C[8]=P=>a.value=P),value:"npm",class:"form-radio text-blue-500 bg-slate-900 border-slate-600 focus:ring-blue-500/50"},null,512),[[un,a.value]]),C[28]||(C[28]=i("span",{class:"ml-2 text-slate-300"},"Run NPM Script",-1))]),i("label",B0,[xe(i("input",{type:"radio","onUpdate:modelValue":C[9]||(C[9]=P=>a.value=P),value:"ecosystem",class:"form-radio text-blue-500 bg-slate-900 border-slate-600 focus:ring-blue-500/50"},null,512),[[un,a.value]]),C[29]||(C[29]=i("span",{class:"ml-2 text-slate-300"},"Ecosystem File",-1))]),i("label",P0,[xe(i("input",{type:"radio","onUpdate:modelValue":C[10]||(C[10]=P=>a.value=P),value:"script",class:"form-radio text-blue-500 bg-slate-900 border-slate-600 focus:ring-blue-500/50"},null,512),[[un,a.value]]),C[30]||(C[30]=i("span",{class:"ml-2 text-slate-300"},"Run Custom Script",-1))])]),a.value==="npm"?(w(),_("div",N0,[C[32]||(C[32]=i("label",{class:"block text-xs font-medium text-slate-400 mb-1"},"NPM Script Name (e.g. start, dev, prod)",-1)),i("div",L0,[C[31]||(C[31]=i("span",{class:"text-slate-500 mr-2 font-mono"},"npm run",-1)),xe(i("input",{"onUpdate:modelValue":C[11]||(C[11]=P=>o.value.npmScript=P),type:"text",class:"flex-1 bg-slate-900 border border-slate-600 rounded-lg px-3 py-2 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all placeholder-slate-500 font-mono",placeholder:"start"},null,512),[[Be,o.value.npmScript]])])])):X("",!0),a.value==="script"?(w(),_("div",I0,[C[33]||(C[33]=i("label",{class:"block text-xs font-medium text-slate-400 mb-1"},"Script Path (e.g. app.js, dist/main.js)",-1)),i("div",j0,[xe(i("input",{"onUpdate:modelValue":C[12]||(C[12]=P=>o.value.customScript=P),type:"text",class:"flex-1 bg-slate-900 border border-slate-600 rounded-lg px-3 py-2 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all placeholder-slate-500 font-mono",placeholder:"app.js"},null,512),[[Be,o.value.customScript]])])])):X("",!0)]),i("div",D0,[i("div",V0,[C[37]||(C[37]=i("label",{class:"block text-sm font-medium text-slate-300"},"Environment Variables",-1)),i("div",H0,[i("button",{type:"button",onClick:K,class:"text-xs px-2 py-1 bg-slate-700 text-slate-300 hover:bg-slate-600 rounded border border-slate-600 transition-colors flex items-center"},[...C[35]||(C[35]=[i("svg",{class:"w-3 h-3 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})],-1),Y(" Import .env ",-1)])]),i("input",{type:"file",ref_key:"envFileInput",ref:N,onChange:V,accept:".env, *.*",class:"hidden"},null,544),i("button",{type:"button",onClick:L,class:"text-xs px-2 py-1 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 rounded border border-blue-500/20 transition-colors flex items-center"},[...C[36]||(C[36]=[i("svg",{class:"w-3 h-3 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),Y(" Add Variable ",-1)])])])]),i("div",F0,[(w(!0),_(ve,null,De(f.value,(P,D)=>(w(),_("div",{key:D,class:"flex items-center gap-2"},[xe(i("input",{"onUpdate:modelValue":A=>P.name=A,type:"text",class:oe(["w-1/3 bg-slate-900 border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:border-transparent outline-none transition-all placeholder-slate-500 font-mono",E.value.includes(P.name)&&P.name.trim()!==""?"border-yellow-500 text-yellow-400 focus:ring-yellow-500":"border-slate-600 text-white focus:ring-blue-500"]),placeholder:"KEY",title:E.value.includes(P.name)&&P.name.trim()!==""?"Duplicate key":""},null,10,U0),[[Be,P.name]]),C[39]||(C[39]=i("span",{class:"text-slate-500"},"=",-1)),xe(i("input",{"onUpdate:modelValue":A=>P.value=A,type:"text",class:"flex-1 bg-slate-900 border border-slate-600 rounded-lg px-3 py-2 text-sm text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all placeholder-slate-500 font-mono",placeholder:"VALUE"},null,8,z0),[[Be,P.value]]),i("button",{type:"button",onClick:A=>q(D),class:"p-1.5 text-red-400 hover:bg-red-500/10 hover:text-red-300 rounded transition-colors",title:"Remove"},[...C[38]||(C[38]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])],8,q0)]))),128)),E.value.length>0?(w(),_("div",W0,[...C[40]||(C[40]=[i("svg",{class:"w-4 h-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})],-1),Y(" Warning: Duplicate environment variable keys detected. ",-1)])])):X("",!0),f.value.length===0?(w(),_("div",K0," No environment variables defined. ")):X("",!0)])])])],32)]),i("div",G0,[i("div",null,[e.appToEdit?(w(),_("button",{key:0,type:"button",onClick:re,class:"px-4 py-2.5 text-sm font-medium text-red-400 hover:text-white bg-red-500/10 hover:bg-red-500 rounded-lg transition-colors border border-red-500/20"}," Delete Application ")):X("",!0)]),i("div",J0,[i("button",{type:"button",onClick:C[13]||(C[13]=P=>Q.$emit("close")),class:"px-5 py-2.5 text-sm font-medium text-slate-300 hover:text-white bg-slate-700 hover:bg-slate-600 rounded-lg transition-colors border border-slate-600"},"Cancel"),i("button",{onClick:ne,disabled:b.value,class:"px-5 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-lg transition-all shadow-lg shadow-blue-500/30 disabled:opacity-70 flex items-center"},[b.value?(w(),_("svg",X0,[...C[41]||(C[41]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):X("",!0),Y(" "+j(e.appToEdit?"Update App":"Deploy App"),1)],8,Y0)])])])])):X("",!0)}},Z0=ir(Q0,[["__scopeId","data-v-395317fb"]]),ep={class:"flex items-center gap-2.5"},tp={class:"flex gap-1.5 shrink-0"},sp={class:"text-[11px] font-mono text-slate-400 tracking-widest"},np={class:"text-slate-200 font-semibold"},op={key:0,class:"flex items-center gap-1.5"},rp={class:"flex items-center shrink-0 px-3 gap-0.5",style:{background:"#13171f","border-bottom":"1px solid rgba(255,255,255,0.06)"}},ip=["onClick"],lp={class:"relative z-10 flex items-center gap-1.5"},ap={class:"ml-auto flex items-center gap-1 py-1"},cp=["title"],up={key:0,class:"flex flex-col items-center justify-center h-full text-slate-700 select-none"},dp={class:"text-[11px]"},fp={key:1,class:"p-3 space-y-0"},pp={class:"shrink-0 text-slate-700 text-[10px] w-7 text-right mt-px select-none group-hover:text-slate-500 transition-colors"},hp=["title"],mp={class:"break-words whitespace-pre-wrap flex-1"},gp=500,vp={__name:"LogViewer",props:{isOpen:Boolean,appId:String,appName:String},emits:["close"],setup(e,{emit:t}){const s=e,n=H([]),o=H([]),r=H(null),l=H(!1),c=H(!1),a=H(!1),f=H("events"),d=H(!0),p=H({x:Math.max(0,window.innerWidth-860),y:Math.max(0,window.innerHeight-560)}),b=H({w:840,h:540});let y=null;const E=[{id:"events",label:"Event Log",accent:"#6366f1"},{id:"build",label:"Build Script",accent:"#f59e0b"},{id:"pm2",label:"PM2 Logs",accent:"#10b981"}],$=D=>({text:String(D).trim(),ts:new Date().toISOString()}),L=D=>{const A=new Date(D),F=U=>U.toString().padStart(2,"0");return`${F(A.getHours())}:${F(A.getMinutes())}:${F(A.getSeconds())}`},q=D=>D.includes("[pm2me]")||D.includes("[SYSTEM]")?"text-indigo-400":D.startsWith("[stderr]")||/error|fail|exception/i.test(D)?"text-red-400":/success|done|complet|onlin/i.test(D)?"text-emerald-400":/warn/i.test(D)?"text-yellow-400":/start|clone|sync|pull|build|deploy/i.test(D)?"text-sky-400":"text-slate-300",N=(D,A)=>{const F=String(A).split(`
|
|
4
|
+
`).map(U=>U.trim()).filter(Boolean);for(const U of F)D.value.push($(U)),D.value.length>gp&&D.value.shift()},K=()=>{d.value&&Ht(()=>{r.value&&(r.value.scrollTop=r.value.scrollHeight)})},V=()=>{if(!r.value)return;const{scrollTop:D,scrollHeight:A,clientHeight:F}=r.value;d.value=A-D-F<80},Z=Te(()=>{const D={events:[],build:[]};let A=!1;for(const F of n.value){if(F.text.includes("Executing Build Script")){A=!0,D.build.push(F);continue}if(F.text.includes("Build Script Completed")){D.build.push(F),A=!1;continue}A?D.build.push(F):D.events.push(F)}return D}),ne=Te(()=>f.value==="pm2"?o.value:Z.value[f.value]||[]),re=()=>{f.value==="pm2"?o.value=[]:n.value=[]},Q=()=>{const D=ne.value.map(A=>`[${L(A.ts)}] ${A.text}`).join(`
|
|
5
|
+
`);navigator.clipboard.writeText(D).catch(()=>{})},C=D=>{if(D.target.tagName==="BUTTON")return;c.value=!0;const A=D.clientX-p.value.x,F=D.clientY-p.value.y,U=G=>{p.value.x=Math.max(0,Math.min(G.clientX-A,window.innerWidth-80)),p.value.y=Math.max(0,Math.min(G.clientY-F,window.innerHeight-44))},k=()=>{c.value=!1,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",U),document.addEventListener("mouseup",k)},P=D=>{a.value=!0;const A=D.clientX-b.value.w,F=D.clientY-b.value.h,U=G=>{b.value.w=Math.max(480,G.clientX-A),b.value.h=Math.max(300,G.clientY-F)},k=()=>{a.value=!1,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",U),document.addEventListener("mouseup",k)};return Rt(()=>s.isOpen,async D=>{if(D&&s.appId){n.value=[],o.value=[],f.value="events",d.value=!0,p.value.x=Math.min(p.value.x,window.innerWidth-80),p.value.y=Math.min(p.value.y,window.innerHeight-44);try{const A=await fetch(`/api/deploy/${s.appId}/logs`,{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}});A.ok&&((await A.text()).split(`
|
|
6
|
+
`).filter(U=>U.trim()).forEach(U=>N(n,U)),K())}catch{}try{const A=await fetch(`/api/apps/${s.appId}/pm2-logs`,{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}});A.ok&&(await A.text()).split(`
|
|
7
|
+
`).filter(U=>U.trim()).forEach(U=>N(o,U))}catch{}y=rs(),y.on(`deploy-log-${s.appId}`,A=>{N(n,A),f.value!=="pm2"&&K()}),y.on(`pm2-log-${s.appId}`,A=>{N(o,A),f.value==="pm2"&&K()})}else y&&(y.disconnect(),y=null)}),Rt(f,()=>{K()}),is(()=>{y&&y.disconnect()}),(D,A)=>(w(),Al(nc,{to:"body"},[e.isOpen?(w(),_("div",{key:0,class:oe(["fixed z-[9999] flex flex-col rounded-xl shadow-2xl border border-slate-700/80 overflow-hidden",{"transition-[left,top] duration-150":!c.value}]),style:xt({left:p.value.x+"px",top:p.value.y+"px",width:l.value?"280px":b.value.w+"px",height:l.value?"44px":b.value.h+"px",maxHeight:"90vh",maxWidth:"98vw",backgroundColor:"#0e1117",boxShadow:"0 25px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05)"})},[i("div",{class:"flex items-center justify-between px-3 py-2 select-none cursor-move shrink-0",style:{background:"linear-gradient(135deg, #1a1f2e 0%, #161b27 100%)","border-bottom":"1px solid rgba(255,255,255,0.05)"},onMousedown:C},[i("div",ep,[i("div",tp,[i("button",{onClick:A[0]||(A[0]=os(F=>D.$emit("close"),["stop"])),class:"w-3 h-3 rounded-full bg-red-500 hover:bg-red-400 transition-colors flex items-center justify-center group",title:"Close"},[...A[3]||(A[3]=[i("span",{class:"hidden group-hover:block text-[7px] text-red-900 font-bold leading-none"},"โ",-1)])]),i("button",{onClick:A[1]||(A[1]=os(F=>l.value=!l.value,["stop"])),class:"w-3 h-3 rounded-full bg-yellow-500 hover:bg-yellow-400 transition-colors flex items-center justify-center group",title:"Minimize"},[...A[4]||(A[4]=[i("span",{class:"hidden group-hover:block text-[7px] text-yellow-900 font-bold leading-none"},"โ",-1)])]),A[5]||(A[5]=i("div",{class:"w-3 h-3 rounded-full bg-green-600 opacity-40 cursor-default"},null,-1))]),i("span",sp,[A[6]||(A[6]=Y(" โฌ ",-1)),i("span",np,j(e.appName),1)])]),l.value?X("",!0):(w(),_("div",op,[...A[7]||(A[7]=[i("div",{class:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse shadow-sm shadow-emerald-400/50"},null,-1),i("span",{class:"text-[9px] text-emerald-400 font-mono tracking-widest uppercase"},"live",-1)])]))],32),xe(i("div",rp,[(w(),_(ve,null,De(E,F=>i("button",{key:F.id,onClick:U=>f.value=F.id,class:oe(["relative px-3.5 py-2.5 text-[11px] font-semibold transition-all",f.value===F.id?"text-white":"text-slate-500 hover:text-slate-300"])},[i("span",lp,[i("span",null,j(F.label),1),F.id!=="pm2"&&Z.value[F.id]?.length?(w(),_("span",{key:0,class:oe(["px-1 py-0.5 rounded text-[9px] leading-none font-bold",f.value===F.id?"bg-slate-600 text-slate-200":"bg-slate-800 text-slate-500"])},j(Z.value[F.id].length),3)):X("",!0),F.id==="pm2"&&o.value.length?(w(),_("span",{key:1,class:oe(["px-1 py-0.5 rounded text-[9px] leading-none font-bold",f.value===F.id?"bg-blue-600/70 text-blue-100":"bg-slate-800 text-slate-500"])},j(o.value.length),3)):X("",!0)]),f.value===F.id?(w(),_("span",{key:0,class:"absolute bottom-0 left-0 right-0 h-0.5 rounded-t",style:xt({background:F.accent})},null,4)):X("",!0)],10,ip)),64)),i("div",ap,[i("button",{onClick:re,title:"Clear",class:"p-1 rounded text-slate-600 hover:text-slate-300 hover:bg-slate-700/50 transition-colors"},[...A[8]||(A[8]=[i("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])]),i("button",{onClick:Q,title:"Copy all",class:"p-1 rounded text-slate-600 hover:text-slate-300 hover:bg-slate-700/50 transition-colors"},[...A[9]||(A[9]=[i("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)])]),i("button",{onClick:A[2]||(A[2]=F=>d.value=!d.value),title:d.value?"Disable auto-scroll":"Enable auto-scroll",class:oe(["p-1 rounded transition-colors",d.value?"text-emerald-400 bg-emerald-400/10":"text-slate-600 hover:text-slate-300 hover:bg-slate-700/50"])},[...A[10]||(A[10]=[i("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})],-1)])],10,cp)])],512),[[Yn,!l.value]]),xe(i("div",{ref_key:"logContainer",ref:r,class:"flex-1 overflow-y-auto font-mono text-xs leading-relaxed",style:{background:"#0a0d12"},onScroll:V},[ne.value.length===0?(w(),_("div",up,[A[11]||(A[11]=i("svg",{class:"w-8 h-8 mb-2 opacity-30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),i("p",dp,j(f.value==="pm2"?"No PM2 output yet":"No events yet"),1)])):(w(),_("div",fp,[(w(!0),_(ve,null,De(ne.value,(F,U)=>(w(),_("div",{key:U,class:oe(["group flex items-start gap-2 py-px hover:bg-white/[0.02] px-1 rounded",q(F.text)])},[i("span",pp,j(U+1),1),i("span",{class:"shrink-0 text-slate-600 text-[10px] mt-px select-none whitespace-nowrap",title:F.ts},j(L(F.ts)),9,hp),i("span",mp,j(F.text),1)],2))),128))]))],544),[[Yn,!l.value]]),xe(i("div",{class:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize opacity-30 hover:opacity-70 transition-opacity",onMousedown:os(P,["prevent"])},[...A[12]||(A[12]=[i("svg",{viewBox:"0 0 10 10",class:"w-full h-full text-slate-400",fill:"currentColor"},[i("path",{d:"M7 0l3 3v-3zM3 4l6 6h-3l-6-6zM0 7l3 3h-3z"})],-1)])],544),[[Yn,!l.value]])],6)):X("",!0)]))}},bp=ir(vp,[["__scopeId","data-v-20dd4948"]]),xp={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4 mb-8"},yp={class:"bg-slate-800/80 backdrop-blur-sm p-4 rounded-2xl border border-slate-700 shadow-lg group hover:border-purple-500/50 transition-all duration-300"},wp={class:"flex flex-col space-y-1"},_p={class:"flex items-center justify-between"},kp={class:"text-sm font-bold text-white font-mono"},Cp={class:"flex items-center justify-between"},Sp={class:"text-sm font-bold text-white font-mono"},Ep={class:"bg-slate-800/80 backdrop-blur-sm p-5 rounded-2xl border border-slate-700 shadow-lg group hover:border-blue-500/50 transition-all duration-300"},$p={class:"flex items-end justify-between"},Ap={class:"text-2xl font-bold text-white tracking-tight"},Tp={class:"text-xs text-slate-500 mt-1 truncate max-w-[150px]"},Mp={class:"w-20 h-1.5 bg-slate-700 rounded-full overflow-hidden"},Rp={class:"bg-slate-800/80 backdrop-blur-sm p-5 rounded-2xl border border-slate-700 shadow-lg group hover:border-emerald-500/50 transition-all duration-300"},Op={class:"flex items-end justify-between"},Bp={class:"text-2xl font-bold text-white tracking-tight"},Pp={class:"text-xs text-slate-500 mt-1"},Np={class:"w-20 h-1.5 bg-slate-700 rounded-full overflow-hidden"},Lp={class:"bg-slate-800/80 backdrop-blur-sm p-5 rounded-2xl border border-slate-700 shadow-lg group hover:border-orange-500/50 transition-all duration-300"},Ip={class:"flex items-center justify-between mb-3"},jp={class:"text-slate-400 text-sm font-medium"},Dp={class:"flex items-end justify-between"},Vp={class:"text-2xl font-bold text-white tracking-tight"},Hp={class:"text-xs text-slate-500 mt-1"},Fp={class:"w-20 h-1.5 bg-slate-700 rounded-full overflow-hidden"},Up={class:"bg-slate-800/80 backdrop-blur-sm p-5 rounded-2xl border border-slate-700 shadow-lg group hover:border-indigo-500/50 transition-all duration-300"},zp={class:"flex flex-col"},qp={class:"text-2xl font-bold text-white tracking-tight"},Wp={class:"text-xs text-slate-500 mt-1"},Kp={__name:"ServerStats",setup(e){const t=H({platform:"linux",cpu:{usage:0,model:"Loading...",cores:0},memory:{total:0,free:0,used:0,percentage:0},disk:{total:0,free:0,used:0,percentage:0},network:{down:0,up:0},uptime:0,hostname:"..."}),s=Te(()=>t.value.platform==="win32"?"Storage (C:)":"Storage (/)");let n=null;const o=async()=>{try{const a=await fetch("/api/system/stats",{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}});a.ok&&(t.value=await a.json())}catch(a){console.error("Failed to fetch system stats",a)}},r=a=>{if(a===0)return"0 B/s";const f=1024,d=["B/s","KB/s","MB/s","GB/s"],p=Math.floor(Math.log(a)/Math.log(f));return parseFloat((a/Math.pow(f,p)).toFixed(1))+" "+d[p]},l=a=>{if(a===0)return"0 B";const f=1024,d=["B","KB","MB","GB","TB"],p=Math.floor(Math.log(a)/Math.log(f));return parseFloat((a/Math.pow(f,p)).toFixed(2))+" "+d[p]},c=a=>{const f=Math.floor(a/86400),d=Math.floor(a%(3600*24)/3600),p=Math.floor(a%3600/60);return f>0?`${f}d ${d}h ${p}m`:d>0?`${d}h ${p}m`:`${p}m`};return Gt(()=>{o(),n=rs(window.location.origin),n.on("system-stats",a=>{t.value=a}),n.on("connect_error",a=>{console.error("Socket connection error:",a)})}),is(()=>{n&&n.disconnect()}),(a,f)=>(w(),_("div",xp,[i("div",yp,[f[2]||(f[2]=rt('<div class="flex items-center justify-between mb-2"><span class="text-slate-400 text-xs font-medium">Network</span><div class="p-1.5 bg-purple-500/10 rounded-lg text-purple-400"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"></path></svg></div></div>',1)),i("div",wp,[i("div",_p,[f[0]||(f[0]=i("div",{class:"flex items-center text-slate-400 text-[10px]"},[i("svg",{class:"w-3 h-3 mr-1 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})]),Y(" Down ")],-1)),i("div",kp,j(r(t.value.network.down)),1)]),i("div",Cp,[f[1]||(f[1]=i("div",{class:"flex items-center text-slate-400 text-[10px]"},[i("svg",{class:"w-3 h-3 mr-1 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 10l7-7m0 0l7 7m-7-7v18"})]),Y(" Up ")],-1)),i("div",Sp,j(r(t.value.network.up)),1)])])]),i("div",Ep,[f[3]||(f[3]=rt('<div class="flex items-center justify-between mb-3"><span class="text-slate-400 text-sm font-medium">Processor</span><div class="p-2 bg-blue-500/10 rounded-lg text-blue-400"><svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div></div>',1)),i("div",$p,[i("div",null,[i("div",Ap,j(t.value.cpu.usage.toFixed(1))+"%",1),i("div",Tp,j(t.value.cpu.model),1)]),i("div",Mp,[i("div",{class:"h-full bg-blue-500 rounded-full transition-all duration-500",style:xt({width:t.value.cpu.usage+"%"})},null,4)])])]),i("div",Rp,[f[4]||(f[4]=rt('<div class="flex items-center justify-between mb-3"><span class="text-slate-400 text-sm font-medium">Memory (RAM)</span><div class="p-2 bg-emerald-500/10 rounded-lg text-emerald-400"><svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div></div>',1)),i("div",Op,[i("div",null,[i("div",Bp,j(t.value.memory.percentage.toFixed(1))+"%",1),i("div",Pp,j(l(t.value.memory.used))+" / "+j(l(t.value.memory.total)),1)]),i("div",Np,[i("div",{class:"h-full bg-emerald-500 rounded-full transition-all duration-500",style:xt({width:t.value.memory.percentage+"%"})},null,4)])])]),i("div",Lp,[i("div",Ip,[i("span",jp,j(s.value),1),f[5]||(f[5]=i("div",{class:"p-2 bg-orange-500/10 rounded-lg text-orange-400"},[i("svg",{class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})])],-1))]),i("div",Dp,[i("div",null,[i("div",Vp,j(t.value.disk.percentage.toFixed(1))+"%",1),i("div",Hp,j(l(t.value.disk.used))+" / "+j(l(t.value.disk.total)),1)]),i("div",Fp,[i("div",{class:"h-full bg-orange-500 rounded-full transition-all duration-500",style:xt({width:t.value.disk.percentage+"%"})},null,4)])])]),i("div",Up,[f[6]||(f[6]=rt('<div class="flex items-center justify-between mb-3"><span class="text-slate-400 text-sm font-medium">System Uptime</span><div class="p-2 bg-indigo-500/10 rounded-lg text-indigo-400"><svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div></div>',1)),i("div",zp,[i("div",qp,j(c(t.value.uptime)),1),i("div",Wp,j(t.value.hostname),1)])])]))}},Gp={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-8"},Jp={class:"flex items-center space-x-4"},Yp={key:0,class:"animate-spin w-5 h-5 text-slate-400",fill:"none",viewBox:"0 0 24 24"},Xp={key:1,class:"w-5 h-5 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Qp={key:2,class:"w-5 h-5 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Zp={key:3,class:"w-5 h-5 text-emerald-400",fill:"currentColor",viewBox:"0 0 20 20"},eh={key:0,class:"text-sm font-semibold text-slate-400"},th={key:1,class:"text-sm font-semibold text-red-400"},sh={key:2,class:"text-sm font-semibold text-amber-400"},nh={key:3,class:"text-sm font-semibold text-emerald-400"},oh={key:4,class:"text-xs text-slate-500 mt-0.5"},rh={class:"text-slate-300 font-mono"},ih={key:0},lh={class:"text-amber-300 font-mono"},ah={key:5,class:"text-xs text-slate-500 mt-0.5"},ch={class:"flex items-center space-x-2 flex-shrink-0"},uh={key:0,disabled:"",class:"flex items-center px-4 py-2 rounded-xl text-sm font-medium bg-slate-700 text-slate-400 cursor-wait"},dh=["disabled"],fh={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center space-y-4 sm:space-y-0"},ph={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-6"},hh={class:"flex items-start justify-between mb-4 gap-3"},mh={class:"flex items-start space-x-3 min-w-0 flex-1"},gh={class:"min-w-0 flex-1"},vh={class:"flex items-center gap-2 flex-wrap"},bh=["title"],xh={class:"flex items-center space-x-2 text-xs font-medium mt-1.5"},yh={class:"relative flex h-2 w-2 flex-shrink-0"},wh={key:0,class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"},_h={key:0,class:"text-slate-500 whitespace-nowrap"},kh={class:"flex items-center space-x-1.5 flex-shrink-0"},Ch=["onClick"],Sh=["onClick"],Eh=["onClick"],$h={key:0,class:"grid grid-cols-2 gap-4 mb-4 text-sm"},Ah={class:"bg-slate-900/50 rounded-lg p-3 border border-slate-700"},Th={class:"font-semibold text-slate-200"},Mh={class:"bg-slate-900/50 rounded-lg p-3 border border-slate-700"},Rh={class:"font-semibold text-slate-200"},Oh={class:"bg-slate-900/50 rounded-lg p-3 border border-slate-700"},Bh={class:"font-semibold text-slate-200"},Ph={class:"bg-slate-900/50 rounded-lg p-3 border border-slate-700"},Nh={class:"font-semibold text-slate-200"},Lh={key:1,class:"mb-4 text-[11px] bg-slate-900/50 border border-slate-700/50 p-2 rounded-lg text-slate-400 font-mono flex items-start",title:"Latest Commit"},Ih={class:"truncate"},jh={key:0,class:"text-blue-400 font-bold mr-1"},Dh={key:1,class:"text-slate-600 mr-1"},Vh={key:2,class:"mb-4 text-[10px] bg-red-500/10 border border-red-500/20 p-2 rounded-lg text-red-400 font-mono flex flex-col gap-1 shadow-[0_0_10px_rgba(239,68,68,0.1)]"},Hh={class:"flex items-start"},Fh={class:"truncate opacity-80"},Uh={key:0,class:"mt-4 pt-5 border-t border-slate-700/30 mb-6"},zh={class:"flex items-center justify-between mb-4 px-1"},qh={key:0,class:"flex items-center gap-2"},Wh={key:0,class:"relative flex h-2 w-2"},Kh={class:"relative flex items-center justify-between px-4 pb-2"},Gh={key:1,class:"w-4 h-4 text-white relative z-10 drop-shadow-md",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Jh={key:2,class:"w-4 h-4 text-white relative z-10 drop-shadow-md",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Yh={key:3,class:"w-2.5 h-2.5 bg-white rounded-full relative z-10 shadow-[0_0_8px_rgba(255,255,255,0.8)]"},Xh={key:4,class:"w-1.5 h-1.5 bg-slate-500 rounded-full relative z-10 opacity-50 group-hover:opacity-100 transition-opacity"},Qh={class:"mt-auto grid grid-cols-3 gap-2"},Zh=["onClick","disabled"],e1={key:0,class:"animate-spin h-4 w-4 mr-1.5",viewBox:"0 0 24 24"},t1={key:1,class:"w-4 h-4 mr-1.5",fill:"currentColor",viewBox:"0 0 20 20"},s1=["onClick","disabled"],n1={key:0,class:"animate-spin h-4 w-4 mr-1.5",viewBox:"0 0 24 24"},o1={key:1,class:"w-4 h-4 mr-1.5",fill:"currentColor",viewBox:"0 0 20 20"},r1=["onClick","disabled"],i1={key:0,class:"animate-spin h-4 w-4 mr-1.5",viewBox:"0 0 24 24"},l1={key:1,class:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a1=["onClick","disabled"],c1={key:0,class:"animate-spin h-4 w-4 mr-1.5",viewBox:"0 0 24 24"},u1={key:1,class:"w-4 h-4 mr-1.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},d1={key:2,class:"ml-1 px-1.5 py-0.5 text-[10px] bg-purple-500/20 text-purple-300 rounded-full border border-purple-500/30 font-bold"},f1={key:0,class:"absolute inset-0 bg-blue-500/5 animate-pulse rounded-2xl blur-xl -z-10"},p1={class:"flex items-start justify-between mb-4 gap-3"},h1={class:"flex items-start space-x-3 min-w-0 flex-1"},m1={key:0,class:"animate-spin h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},g1={key:1,class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},v1={class:"min-w-0 flex-1"},b1=["title"],x1={class:"flex items-center space-x-2 text-xs font-medium mt-1.5 flex-wrap"},y1={key:0,class:"text-[10px] bg-slate-700/50 border border-slate-600 px-1.5 py-0.5 rounded text-slate-300 font-mono inline-block max-w-full truncate align-bottom mt-1 sm:mt-0",title:"Deployed Commit"},w1={class:"flex items-center space-x-1.5 flex-shrink-0"},_1=["onClick"],k1=["onClick"],C1={key:0,class:"mt-4 pt-5 border-t border-slate-700/30 mb-6"},S1={class:"flex items-center justify-between mb-4 px-1"},E1={class:"flex items-center gap-2"},$1={key:0,class:"relative flex h-2 w-2"},A1={class:"relative flex items-center justify-between px-4 pb-2"},T1={key:1,class:"w-4 h-4 text-white relative z-10 drop-shadow-md",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},M1={key:2,class:"w-4 h-4 text-white relative z-10 drop-shadow-md",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},R1={key:3,class:"w-2.5 h-2.5 bg-white rounded-full relative z-10 shadow-[0_0_8px_rgba(255,255,255,0.8)]"},O1={key:4,class:"w-1.5 h-1.5 bg-slate-500 rounded-full relative z-10 opacity-50 group-hover:opacity-100 transition-opacity"},B1=["onClick","disabled"],P1={key:0,class:"animate-spin h-4 w-4 mr-1.5",viewBox:"0 0 24 24"},N1={key:1,class:"w-4 h-4 mr-1.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},L1={key:2,class:"ml-2 px-1.5 py-0.5 text-[10px] bg-purple-500/20 text-purple-300 rounded-full border border-purple-500/30 font-bold"},I1={key:0,class:"flex flex-col items-center justify-center p-12 bg-slate-800/30 rounded-3xl border border-slate-700/50 border-dashed"},j1={key:1,class:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-900/90 backdrop-blur-md"},D1={class:"bg-slate-800 border border-slate-700 rounded-3xl shadow-2xl max-w-md w-full p-8 text-center transform transition-all scale-100"},V1={class:"text-slate-400 mb-8 leading-relaxed"},H1={class:"text-white font-semibold"},F1={class:"flex flex-col sm:flex-row gap-3"},U1={__name:"Dashboard",setup(e){const t=H([]),s=H([]),n=H(!1),o=H(!1),r=H(""),l=H(""),c=H(null),a=H({}),f=H({}),d=H({}),p=H({}),b=H(!1),y=H(null),E=H({loaded:!1,installed:!1,version:null,latestVersion:null,hasUpdate:!1,isChecking:!1,isActing:!1}),$=async()=>{E.value.isChecking=!0;try{const u=await(await fetch("/api/pm2/version-check",{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}})).json();E.value={...E.value,...u,loaded:!0,isChecking:!1}}catch{E.value.isChecking=!1,E.value.loaded=!0}},L=async()=>{E.value.isActing=!0;try{await fetch("/api/pm2/install-update",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}}),await $()}catch{}finally{E.value.isActing=!1}};let q=null,N;const K=Te(()=>{const v=(t.value||[]).map(u=>u?.id).filter(Boolean);return(s.value||[]).filter(u=>u&&!v.includes(u.id))}),V=async()=>{try{const u={Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`},[h,R]=await Promise.all([fetch("/api/pm2/list",{headers:u}),fetch("/api/apps",{headers:u})]);if(h.ok&&(t.value=await h.json()),R.ok){const x=await R.json();s.value=x.map(T=>{let S=T.pipelineState;return S==="online"&&(S="hidden"),T.pipelineState=d.value[T.id]||S||"hidden",T})}let m=[];t.value.forEach(x=>{if(!x)return;const T=s.value.filter(S=>S&&S.name===x.name);if(T.length>0)T.forEach(S=>{const M=JSON.parse(JSON.stringify(x));M.id=S.id,M.commitHash=S.commitHash,M.commitMessage=S.commitMessage,M.branch=S.branch,M.rollbackOccurred=S.rollbackOccurred,M.failedCommitHash=S.failedCommitHash,M.failedCommitMessage=S.failedCommitMessage,M.pipelineState=d.value[S.id]||S.pipelineState||"hidden",M.unique_key=`pm2_${M.pm_id}_db_${S.id}`,m.push(M)});else{const S=JSON.parse(JSON.stringify(x));S.pipelineState="hidden",S.unique_key=`pm2_${S.pm_id}`,m.push(S)}}),t.value=m.filter(Boolean),s.value.forEach(x=>{Z(x.id)})}catch(v){console.error("Fetch apps error:",v)}},Z=async v=>{try{const u=localStorage.getItem("pm2me_token"),R=await(await fetch(`/api/apps/${v}/sync-status`,{headers:{Authorization:`Bearer ${u}`}})).json();R.behindCount!==void 0&&(f.value[v]=R.behindCount)}catch(u){console.error("Failed to fetch sync status",u)}},ne=async(v,u)=>{const h=`${u}-${v}`;a.value[h]=!0;try{await fetch(`/api/pm2/${v}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`},body:JSON.stringify({nameOrId:u})}),await V()}catch{alert(`Failed to ${v} app`)}finally{a.value[h]=!1}},re=async v=>{try{await fetch(`/api/apps/${v}`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}}),await V()}catch(u){console.error("Failed to remove db app",u)}},Q=async v=>{v&&C(v)},C=v=>{y.value=v,b.value=!0},P=async()=>{const v=y.value;if(v){b.value=!1,y.value=null;try{await fetch("/api/pm2/delete",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`},body:JSON.stringify({nameOrId:v.name})})}catch{console.error("Failed to delete PM2 process, proceeding to DB removal")}await re(v.id)}},D=async(v,u)=>{const h=`${u||v}-deploy`;a.value[h]=!0;try{await fetch(`/api/deploy/${v}`,{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}}),await V()}catch{alert("Failed to trigger deployment restart.")}finally{a.value[h]=!1}},A=v=>{if(v.id)D(v.id,v.name);else{const u=s.value.find(h=>h.name===v.name);u?D(u.id,v.name):alert("Cannot deploy this app as it was not deployed via PM2Me (No config found).")}},F=v=>{if(l.value=v.name,v.id)r.value=v.id;else{const u=s.value.find(h=>h.name===v.name);r.value=u?u.id:v.name}o.value=!0},U=v=>{l.value=v.name,r.value=v.id,o.value=!0},k=(v,u=!1)=>{let h=v;if(u&&(h=s.value.find(R=>R.name===v.name),!h)){alert("Cannot edit this app as it was not deployed via PM2Me (No config found).");return}c.value=h,n.value=!0},G=v=>{if(!v)return"0s";const u=Date.now()-v,h=Math.floor(u/1e3),R=Math.floor(h/(3600*24)),m=Math.floor(h%(3600*24)/3600),g=Math.floor(h%3600/60);return R>0?`${R}d ${m}h`:m>0?`${m}h ${g}m`:g>0?`${g}m`:`${h}s`},ce=v=>{if(!v)return"0 B";const u=1024,h=["B","KB","MB","GB"],R=Math.floor(Math.log(v)/Math.log(u));return parseFloat((v/Math.pow(u,R)).toFixed(2))+" "+h[R]},ae=v=>v==="online"?"bg-emerald-500":v==="stopping"||v==="stopped"?"bg-amber-500":v==="errored"?"bg-red-500":"bg-slate-500",$e=v=>v==="online"?"text-emerald-400":v==="stopping"||v==="stopped"?"text-amber-400":v==="errored"?"text-red-400":"text-slate-400",be=["pulling","building","starting","online"],Re=v=>({pulling:"Pull",building:"Build",starting:"Run",online:"Online"})[v]||v,ye=v=>v&&typeof v=="string"&&v.startsWith("failed:")?v.split(":")[1]:v,qe=v=>{const u=ye(v),h=be.indexOf(u);if(h===-1)return"0%";const R=h/(be.length-1)*100;return`calc(${R}% - ${R/100*48}px)`},Ne=(v,u)=>{if(u==="online"&&v==="online")return!0;const h=ye(u),R=be.indexOf(v),m=be.indexOf(h);return R<m},Qe=(v,u)=>Ce(v,u)?"bg-red-500 border-red-400 shadow-[0_0_15px_rgba(239,68,68,0.6)] border-0 scale-110":Ne(v,u)?v==="online"&&u==="online"?"bg-gradient-to-br from-emerald-500 to-green-600 shadow-[0_0_15px_rgba(16,185,129,0.5)] border-0 scale-110":"bg-gradient-to-br from-indigo-500 to-blue-600 shadow-[0_0_10px_rgba(99,102,241,0.4)] border-0":ye(u)===v?"bg-slate-800 border-[1.5px] border-blue-400 shadow-[0_0_15px_rgba(96,165,250,0.5)] scale-110":"bg-slate-800/50 border border-slate-700/50 backdrop-blur-sm shadow-inner",Ce=(v,u)=>u&&typeof u=="string"&&u.startsWith("failed:")?v===u.split(":")[1]:u==="failed"&&v==="starting",B=()=>{q||(q=rs()),s.value.forEach(v=>{q.off(`pipeline-state-${v.id}`),q.on(`pipeline-state-${v.id}`,u=>{p.value[v.id]&&(clearTimeout(p.value[v.id]),delete p.value[v.id]),d.value[v.id]=u;const h=R=>{const m=t.value.find(x=>x.name===v.name);m&&(m.pipelineState=R);const g=s.value.find(x=>x.id===v.id);g&&(g.pipelineState=R)};h(u),u==="online"&&(V(),p.value[v.id]=setTimeout(()=>{d.value[v.id]="hidden",h("hidden")},2e3))})})};return Gt(async()=>{await V(),B(),N=setInterval(V,12345),$()}),is(()=>{q&&q.disconnect(),clearInterval(N)}),(v,u)=>(w(),_("div",Gp,[Ae(Kp),i("div",{class:oe(["rounded-2xl border flex items-center justify-between px-6 py-4 shadow-xl backdrop-blur-sm transition-all",!E.value.loaded||E.value.isChecking?"bg-slate-800/60 border-slate-700":E.value.installed?E.value.hasUpdate?"bg-amber-500/5 border-amber-500/30":"bg-emerald-500/5 border-emerald-500/20":"bg-red-500/5 border-red-500/30"])},[i("div",Jp,[i("div",{class:oe(["w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0",!E.value.loaded||E.value.isChecking?"bg-slate-700":E.value.installed?E.value.hasUpdate?"bg-amber-500/20":"bg-emerald-500/20":"bg-red-500/20"])},[!E.value.loaded||E.value.isChecking?(w(),_("svg",Yp,[...u[5]||(u[5]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):E.value.installed?E.value.hasUpdate?(w(),_("svg",Qp,[...u[7]||(u[7]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])):(w(),_("svg",Zp,[...u[8]||(u[8]=[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)])])):(w(),_("svg",Xp,[...u[6]||(u[6]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M5.07 19H19a2 2 0 001.75-2.96L13.75 4a2 2 0 00-3.5 0L3.25 16.04A2 2 0 005.07 19z"},null,-1)])]))],2),i("div",null,[!E.value.loaded||E.value.isChecking?(w(),_("p",eh,"Checking PM2 status...")):E.value.installed?E.value.hasUpdate?(w(),_("p",sh,"PM2 update available")):(w(),_("p",nh,"PM2 is up to date")):(w(),_("p",th,"PM2 is not installed")),E.value.loaded&&!E.value.isChecking&&E.value.installed?(w(),_("p",oh,[u[10]||(u[10]=Y(" Installed: ",-1)),i("span",rh,"v"+j(E.value.version),1),E.value.hasUpdate?(w(),_("span",ih,[u[9]||(u[9]=Y(" โ Latest: ",-1)),i("span",lh,"v"+j(E.value.latestVersion),1)])):X("",!0)])):E.value.loaded&&!E.value.isChecking&&!E.value.installed?(w(),_("p",ah,"PM2 is required to run and manage applications")):X("",!0)])]),i("div",ch,[E.value.loaded&&!E.value.isChecking&&E.value.isActing?(w(),_("button",uh,[u[11]||(u[11]=i("svg",{class:"animate-spin w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24"},[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),Y(" "+j(E.value.installed?"Updating...":"Installing..."),1)])):E.value.loaded&&!E.value.isChecking&&!E.value.installed?(w(),_("button",{key:1,onClick:L,class:"flex items-center px-4 py-2 rounded-xl text-sm font-medium bg-blue-600 hover:bg-blue-500 text-white transition-all shadow-lg shadow-blue-500/20"},[...u[12]||(u[12]=[i("svg",{class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1),Y(" Install PM2 ",-1)])])):E.value.loaded&&!E.value.isChecking&&E.value.hasUpdate?(w(),_("button",{key:2,onClick:L,class:"flex items-center px-4 py-2 rounded-xl text-sm font-medium bg-amber-500 hover:bg-amber-400 text-white transition-all shadow-lg shadow-amber-500/20"},[...u[13]||(u[13]=[i("svg",{class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Y(" Update PM2 ",-1)])])):X("",!0),i("button",{onClick:$,disabled:E.value.isChecking,class:"p-2 text-slate-400 hover:text-white transition-colors",title:"Refresh"},[(w(),_("svg",{class:oe(["w-4 h-4",{"animate-spin":E.value.isChecking}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...u[14]||(u[14]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))],8,dh)])],2),i("div",fh,[u[16]||(u[16]=i("div",null,[i("h1",{class:"text-3xl font-bold text-white tracking-tight"},"Applications"),i("p",{class:"text-sm text-slate-400 mt-1"},"Manage and monitor your PM2 deployments")],-1)),i("button",{onClick:u[0]||(u[0]=h=>n.value=!0),class:"flex items-center px-4 py-2.5 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white text-sm font-medium rounded-xl transition-all shadow-lg shadow-blue-500/30 transform hover:-translate-y-0.5"},[...u[15]||(u[15]=[i("svg",{class:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),Y(" Deploy New App ",-1)])])]),i("div",ph,[(w(!0),_(ve,null,De(t.value,h=>(w(),_("div",{key:h.unique_key,class:"bg-slate-800/80 backdrop-blur-sm rounded-2xl shadow-xl border border-slate-700 p-6 flex flex-col transition-all hover:border-slate-600 hover:shadow-2xl"},[i("div",hh,[i("div",mh,[u[17]||(u[17]=i("div",{class:"w-10 h-10 rounded-xl bg-slate-700/50 flex items-center justify-center border border-slate-600 flex-shrink-0 mt-0.5"},[i("svg",{class:"h-6 w-6 text-slate-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})])],-1)),i("div",gh,[i("div",vh,[i("h2",{class:"text-lg font-bold text-white truncate",title:h.name},j(h.name),9,bh)]),i("div",xh,[i("span",yh,[h.pm2_env.status==="online"?(w(),_("span",wh)):X("",!0),i("span",{class:oe(["relative inline-flex rounded-full h-2 w-2",ae(h.pm2_env.status)])},null,2)]),i("span",{class:oe([$e(h.pm2_env.status),"capitalize"])},j(h.pm2_env.status),3),h.pm2_env.pm_uptime?(w(),_("span",_h,j(G(h.pm2_env.pm_uptime)),1)):X("",!0)])])]),i("div",kh,[h.id?(w(),_("button",{key:0,onClick:R=>k(h,!0),class:"p-2 text-slate-400 hover:text-blue-400 bg-slate-700/50 hover:bg-slate-700 rounded-lg transition-colors border border-slate-600 focus:outline-none",title:"Edit Config"},[...u[18]||(u[18]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)])],8,Ch)):X("",!0),i("button",{onClick:R=>F(h),class:"p-2 text-slate-400 hover:text-white bg-slate-700/50 hover:bg-slate-700 rounded-lg transition-colors border border-slate-600 focus:outline-none",title:"View Logs"},[...u[19]||(u[19]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)])],8,Sh),i("button",{onClick:R=>C(h),class:"p-2 text-slate-400 hover:text-red-400 bg-slate-700/50 hover:bg-red-500/10 rounded-lg transition-colors border border-slate-600 focus:outline-none",title:"Delete Application"},[...u[20]||(u[20]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])],8,Eh)])]),h.status!=="deploying"?(w(),_("div",$h,[i("div",Ah,[u[21]||(u[21]=i("p",{class:"text-slate-500 mb-1 leading-none text-xs"},"CPU Usage",-1)),i("p",Th,j(h.monit?h.monit.cpu:0)+"%",1)]),i("div",Mh,[u[22]||(u[22]=i("p",{class:"text-slate-500 mb-1 leading-none text-xs"},"Memory",-1)),i("p",Rh,j(ce(h.monit?h.monit.memory:0)),1)]),i("div",Oh,[u[23]||(u[23]=i("p",{class:"text-slate-500 mb-1 leading-none text-xs"},"Restarts",-1)),i("p",Bh,j(h.pm2_env.restart_time),1)]),i("div",Ph,[u[24]||(u[24]=i("p",{class:"text-slate-500 mb-1 leading-none text-xs"},"App Id",-1)),i("p",Nh,j(h.pm_id),1)])])):X("",!0),h.commitMessage&&h.status!=="deploying"?(w(),_("div",Lh,[u[25]||(u[25]=i("svg",{xmlns:"http://www.w3.org/2000/svg",class:"mr-2",width:"14",height:"14",viewBox:"0 0 24 24"},[i("path",{fill:"currentColor","fill-rule":"evenodd",d:"M15 2H9v6h2v3H3v5H1v6h6v-6H5v-3h6v3H9v6h6v-6h-2v-3h6v3h-2v6h6v-6h-2v-5h-8V8h2z","clip-rule":"evenodd"})],-1)),i("span",Ih,[h.branch?(w(),_("span",jh,j(h.branch),1)):X("",!0),h.branch?(w(),_("span",Dh,"โข")):X("",!0),Y(" "+j(h.commitMessage),1)])])):X("",!0),h.rollbackOccurred&&h.failedCommitMessage?(w(),_("div",Vh,[u[27]||(u[27]=i("div",{class:"flex items-center gap-1 font-bold uppercase tracking-wider text-[9px]"},[i("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 12 12",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})]),Y(" Deployment Failed - Rolled Back ")],-1)),i("div",Hh,[u[26]||(u[26]=i("svg",{class:"w-3.5 h-3.5 mr-2 mt-0.5 flex-shrink-0 text-red-500/60",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("circle",{cx:"12",cy:"12",r:"3","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),i("line",{x1:"3",y1:"12",x2:"9",y2:"12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),i("line",{x1:"15",y1:"12",x2:"21",y2:"12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)),i("span",Fh,j(h.failedCommitMessage),1)]),u[28]||(u[28]=i("p",{class:"text-[9px] text-red-500/50 mt-1 italic"},"The system is currently running on the previous stable version.",-1))])):X("",!0),Ae(Pr,{"enter-active-class":"transition-all duration-500 ease-out","enter-from-class":"opacity-0 -translate-y-2","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition-all duration-500 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-2"},{default:fo(()=>[h.pipelineState&&h.pipelineState!=="hidden"?(w(),_("div",Uh,[i("div",zh,[u[30]||(u[30]=i("span",{class:"text-[10px] font-bold text-slate-400 uppercase tracking-widest flex items-center gap-2"},[i("svg",{class:"w-3.5 h-3.5 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})]),Y(" Deployment State ")],-1)),h.pipelineState?(w(),_("div",qh,[h.pipelineState!=="online"&&h.pipelineState!=="failed"?(w(),_("span",Wh,[...u[29]||(u[29]=[i("span",{class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"},null,-1),i("span",{class:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"},null,-1)])])):X("",!0),i("span",{class:oe(["text-[10px] font-mono whitespace-nowrap px-2 py-0.5 rounded-full border uppercase tracking-wider backdrop-blur-sm",h.pipelineState==="failed"?"text-red-400 bg-red-500/10 border-red-500/20":h.pipelineState==="online"?"text-emerald-400 bg-emerald-500/10 border-emerald-500/20":"text-blue-400 bg-blue-500/10 border-blue-500/20"])},j(h.pipelineState&&h.pipelineState.startsWith("failed:")?"FAILED":h.pipelineState),3)])):X("",!0)]),i("div",Kh,[u[33]||(u[33]=i("div",{class:"absolute left-6 right-6 h-1 bg-slate-800/80 rounded-full top-1/2 -translate-y-1/2 z-0 border border-slate-700/50 shadow-inner"},null,-1)),i("div",{class:oe(["absolute left-6 h-1 bg-gradient-to-r top-1/2 -translate-y-1/2 z-0 transition-all duration-700 ease-out",h.pipelineState==="failed"?"from-red-600 to-rose-400 shadow-[0_0_10px_rgba(248,113,113,0.5)]":h.pipelineState==="online"?"from-emerald-500 to-indigo-400 shadow-[0_0_10px_rgba(16,185,129,0.5)]":"from-blue-600 to-indigo-400 shadow-[0_0_10px_rgba(96,165,250,0.5)]"]),style:xt({width:qe(h.pipelineState)})},null,6),(w(),_(ve,null,De(["pulling","building","starting","online"],(R,m)=>i("div",{key:R,class:"relative z-10 flex flex-col items-center group"},[m<3?(w(),_("div",{key:0,class:oe(["absolute h-1 top-1/2 -translate-y-1/2 left-full w-full z-[-1] pointer-events-none transition-colors duration-500",Ne(R,h.pipelineState)?h.pipelineState==="failed"||h.pipelineState&&h.pipelineState.startsWith("failed:")?"bg-red-500/20":h.pipelineState==="online"?"bg-emerald-500/20":"bg-indigo-500/20":"bg-transparent"])},null,2)):X("",!0),i("div",{class:oe(["w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 relative",Qe(R,h.pipelineState)])},[h.pipelineState===R&&h.pipelineState!=="online"?(w(),_("div",{key:0,class:oe(["absolute inset-0 rounded-full animate-ping",h.pipelineState==="failed"?"bg-red-400/20":"bg-blue-400/20"])},null,2)):X("",!0),Ne(R,h.pipelineState)?(w(),_("svg",Gh,[...u[31]||(u[31]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):h.pipelineState==="failed"&&Ce(R,h.pipelineState)?(w(),_("svg",Jh,[...u[32]||(u[32]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)])])):h.pipelineState===R?(w(),_("div",Yh)):(w(),_("div",Xh))],2),i("span",{class:oe(["text-[9px] mt-2.5 font-bold uppercase tracking-wider transition-all duration-300",h.pipelineState===R?h.pipelineState==="failed"?"text-red-300 drop-shadow-[0_0_2px_rgba(252,165,165,0.8)]":h.pipelineState==="online"?"text-emerald-300 drop-shadow-[0_0_2px_rgba(110,231,183,0.8)]":"text-blue-300 drop-shadow-[0_0_2px_rgba(147,197,253,0.8)]":Ne(R,h.pipelineState)?"text-slate-300":"text-slate-500"])},j(Re(R)),3)])),64))])])):X("",!0)]),_:2},1024),i("div",Qh,[h.pm2_env.status==="online"?(w(),_("button",{key:0,onClick:R=>ne("stop",h.name),disabled:a.value[`${h.name}-stop`],class:"flex items-center justify-center p-2 text-sm font-medium text-amber-500 bg-amber-500/10 hover:bg-amber-500/20 rounded-lg transition-colors border border-amber-500/20"},[a.value[`${h.name}-stop`]?(w(),_("svg",e1,[...u[34]||(u[34]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",t1,[...u[35]||(u[35]=[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z","clip-rule":"evenodd"},null,-1)])])),Y(" "+j(a.value[`${h.name}-stop`]?"Stopping":"Stop"),1)],8,Zh)):(w(),_("button",{key:1,onClick:R=>ne("start",h.name),disabled:a.value[`${h.name}-start`],class:"flex items-center justify-center p-2 text-sm font-medium text-emerald-500 bg-emerald-500/10 hover:bg-emerald-500/20 rounded-lg transition-colors border border-emerald-500/20"},[a.value[`${h.name}-start`]?(w(),_("svg",n1,[...u[36]||(u[36]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",o1,[...u[37]||(u[37]=[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"},null,-1)])])),Y(" "+j(a.value[`${h.name}-start`]?"Starting":"Start"),1)],8,s1)),i("button",{onClick:R=>ne("restart",h.name),disabled:a.value[`${h.name}-restart`],class:"flex items-center justify-center p-2 text-sm font-medium text-blue-400 bg-blue-400/10 hover:bg-blue-400/20 rounded-lg transition-colors border border-blue-400/20"},[a.value[`${h.name}-restart`]?(w(),_("svg",i1,[...u[38]||(u[38]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",l1,[...u[39]||(u[39]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])),Y(" "+j(a.value[`${h.name}-restart`]?"...":"Restart"),1)],8,r1),h.id?(w(),_("button",{key:2,onClick:R=>A(h),disabled:a.value[`${h.name}-deploy`],class:"flex items-center justify-center p-2 text-sm font-medium text-purple-400 bg-purple-400/10 hover:bg-purple-400/20 rounded-lg transition-colors border border-purple-400/20 text-nowrap"},[a.value[`${h.name}-deploy`]?(w(),_("svg",c1,[...u[40]||(u[40]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",u1,[...u[41]||(u[41]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"},null,-1)])])),Y(" "+j(a.value[`${h.name}-deploy`]?"Syncing":"Sync")+" ",1),!a.value[`${h.name}-deploy`]&&f.value[h.id]?(w(),_("span",d1,j(f.value[h.id]),1)):X("",!0)],8,a1)):X("",!0)])]))),128)),(w(!0),_(ve,null,De(K.value,h=>(w(),_("div",{key:h.id,class:"bg-slate-800/80 backdrop-blur-sm rounded-2xl shadow-xl border border-slate-700/50 p-6 flex flex-col relative overflow-hidden"},[h.status==="deploying"?(w(),_("div",f1)):X("",!0),i("div",p1,[i("div",h1,[i("div",{class:oe(["w-10 h-10 rounded-xl bg-slate-700/50 flex items-center justify-center border border-slate-600 flex-shrink-0 mt-0.5",h.status==="deploying"?"text-blue-500":"text-red-500"])},[h.status==="deploying"?(w(),_("svg",m1,[...u[42]||(u[42]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",g1,[...u[43]||(u[43]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])]))],2),i("div",v1,[i("h2",{class:"text-lg font-bold text-white truncate",title:h.name},j(h.name),9,b1),i("div",x1,[i("span",{class:oe(["capitalize flex-shrink-0",h.status==="deploying"?"text-blue-400":"text-red-400"])},j(h.status),3),h.commitMessage?(w(),_("span",y1,[u[44]||(u[44]=i("svg",{class:"w-3 h-3 inline pb-[1px] mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("circle",{cx:"12",cy:"12",r:"3","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),i("line",{x1:"3",y1:"12",x2:"9",y2:"12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),i("line",{x1:"15",y1:"12",x2:"21",y2:"12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)),Y(j(h.commitMessage),1)])):X("",!0)])])]),i("div",w1,[i("button",{onClick:R=>k(h,!1),class:"p-2 text-slate-400 hover:text-blue-400 bg-slate-700/50 hover:bg-slate-700 rounded-lg transition-colors border border-slate-600 focus:outline-none",title:"Edit Config"},[...u[45]||(u[45]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)])],8,_1),i("button",{onClick:R=>U(h),class:"p-2 text-slate-400 hover:text-white bg-slate-700/50 hover:bg-slate-700 rounded-lg transition-colors border border-slate-600 focus:outline-none",title:"View Logs"},[...u[46]||(u[46]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)])],8,k1)])]),Ae(Pr,{"enter-active-class":"transition-all duration-500 ease-out","enter-from-class":"opacity-0 -translate-y-2","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition-all duration-500 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-2"},{default:fo(()=>[h.pipelineState&&h.pipelineState!=="hidden"?(w(),_("div",C1,[i("div",S1,[u[48]||(u[48]=i("span",{class:"text-[10px] font-bold text-slate-400 uppercase tracking-widest flex items-center gap-2"},[i("svg",{class:"w-3.5 h-3.5 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})]),Y(" Deployment State ")],-1)),i("div",E1,[h.pipelineState!=="online"&&h.pipelineState!=="failed"?(w(),_("span",$1,[...u[47]||(u[47]=[i("span",{class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"},null,-1),i("span",{class:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"},null,-1)])])):X("",!0),i("span",{class:oe(["text-[10px] font-mono whitespace-nowrap px-2 py-0.5 rounded-full border uppercase tracking-wider backdrop-blur-sm",h.pipelineState==="failed"||h.pipelineState&&h.pipelineState.startsWith("failed:")?"text-red-400 bg-red-500/10 border-red-500/20":h.pipelineState==="online"?"text-emerald-400 bg-emerald-500/10 border-emerald-500/20":"text-blue-400 bg-blue-500/10 border-blue-500/20"])},j(h.pipelineState&&h.pipelineState.startsWith("failed:")?"FAILED":h.pipelineState),3)])]),i("div",A1,[u[51]||(u[51]=i("div",{class:"absolute left-6 right-6 h-1 bg-slate-800/80 rounded-full top-1/2 -translate-y-1/2 z-0 border border-slate-700/50 shadow-inner"},null,-1)),i("div",{class:oe(["absolute left-6 h-1 bg-gradient-to-r top-1/2 -translate-y-1/2 z-0 transition-all duration-700 ease-out",h.pipelineState==="failed"?"from-red-600 to-rose-400 shadow-[0_0_10px_rgba(248,113,113,0.5)]":h.pipelineState==="online"?"from-emerald-500 to-indigo-400 shadow-[0_0_10px_rgba(16,185,129,0.5)]":"from-blue-600 to-indigo-400 shadow-[0_0_10px_rgba(96,165,250,0.5)]"]),style:xt({width:qe(h.pipelineState)})},null,6),(w(),_(ve,null,De(["pulling","building","starting","online"],(R,m)=>i("div",{key:R,class:"relative z-10 flex flex-col items-center group"},[m<3?(w(),_("div",{key:0,class:oe(["absolute h-1 top-1/2 -translate-y-1/2 left-full w-full z-[-1] pointer-events-none transition-colors duration-500",Ne(R,h.pipelineState)?h.pipelineState==="failed"||h.pipelineState&&h.pipelineState.startsWith("failed:")?"bg-red-500/20":h.pipelineState==="online"?"bg-emerald-500/20":"bg-indigo-500/20":"bg-transparent"])},null,2)):X("",!0),i("div",{class:oe(["w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 relative",Qe(R,h.pipelineState)])},[h.pipelineState===R&&h.pipelineState!=="online"?(w(),_("div",{key:0,class:oe(["absolute inset-0 rounded-full animate-ping",h.pipelineState==="failed"?"bg-red-400/20":"bg-blue-400/20"])},null,2)):X("",!0),Ne(R,h.pipelineState)?(w(),_("svg",T1,[...u[49]||(u[49]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):h.pipelineState==="failed"&&Ce(R,h.pipelineState)?(w(),_("svg",M1,[...u[50]||(u[50]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)])])):h.pipelineState===R?(w(),_("div",R1)):(w(),_("div",O1))],2),i("span",{class:oe(["text-[9px] mt-2.5 font-bold uppercase tracking-wider transition-all duration-300",h.pipelineState===R?h.pipelineState==="failed"?"text-red-300 drop-shadow-[0_0_2px_rgba(252,165,165,0.8)]":h.pipelineState==="online"?"text-emerald-300 drop-shadow-[0_0_2px_rgba(110,231,183,0.8)]":"text-blue-300 drop-shadow-[0_0_2px_rgba(147,197,253,0.8)]":Ne(R,h.pipelineState)?"text-slate-300":"text-slate-500"])},j(Re(R)),3)])),64))])])):X("",!0)]),_:2},1024),h.status!=="deploying"?(w(),_("button",{key:1,onClick:R=>D(h.id),disabled:a.value[`${h.name}-deploy`],class:"flex items-center justify-center p-2 mt-auto text-sm font-medium text-purple-400 bg-purple-400/10 hover:bg-purple-400/20 rounded-lg transition-colors border border-purple-400/20 w-full"},[a.value[`${h.name}-deploy`]?(w(),_("svg",P1,[...u[52]||(u[52]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",N1,[...u[53]||(u[53]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"},null,-1)])])),Y(" "+j(a.value[`${h.name}-deploy`]?"Syncing...":"Deploy")+" ",1),!a.value[`${h.name}-deploy`]&&f.value[h.id]?(w(),_("span",L1,j(f.value[h.id]),1)):X("",!0)],8,B1)):X("",!0)]))),128))]),t.value.length===0&&K.value.length===0?(w(),_("div",I1,[u[54]||(u[54]=rt('<div class="w-20 h-20 rounded-full bg-slate-800 flex items-center justify-center mb-6 shadow-inner ring-1 ring-slate-700/50"><svg class="h-10 w-10 text-slate-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"></path></svg></div><h3 class="text-xl font-bold text-white mb-2">No Applications Found</h3><p class="text-slate-400 text-center max-w-sm mb-6">You haven't deployed any applications yet or PM2 is not managing any processes.</p>',3)),i("button",{onClick:u[1]||(u[1]=h=>n.value=!0),class:"px-6 py-3 bg-slate-700 hover:bg-slate-600 text-white font-medium rounded-xl transition-all shadow-lg border border-slate-600"}," Deploy Your First App ")])):X("",!0),Ae(Z0,{isOpen:n.value,appToEdit:c.value,onClose:u[2]||(u[2]=h=>{n.value=!1,c.value=null}),onDeploy:V,onDelete:Q},null,8,["isOpen","appToEdit"]),Ae(bp,{isOpen:o.value,appId:r.value,appName:l.value,onClose:u[3]||(u[3]=h=>o.value=!1)},null,8,["isOpen","appId","appName"]),b.value?(w(),_("div",j1,[i("div",D1,[u[57]||(u[57]=i("div",{class:"w-20 h-20 bg-red-500/10 rounded-full flex items-center justify-center mx-auto mb-6 border border-red-500/20"},[i("svg",{class:"w-10 h-10 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1)),u[58]||(u[58]=i("h3",{class:"text-2xl font-bold text-white mb-2"},"Delete Application?",-1)),i("p",V1,[u[55]||(u[55]=Y(" Are you sure you want to delete ",-1)),i("span",H1,j(y.value?.name),1),u[56]||(u[56]=Y("? This will stop the PM2 process and permanently remove the configuration. ",-1))]),i("div",F1,[i("button",{onClick:u[4]||(u[4]=h=>{b.value=!1,y.value=null}),class:"flex-1 px-6 py-3 bg-slate-700 hover:bg-slate-600 text-white font-medium rounded-xl transition-all border border-slate-600"}," Keep Application "),i("button",{onClick:P,class:"flex-1 px-6 py-3 bg-red-600 hover:bg-red-500 text-white font-bold rounded-xl transition-all shadow-lg shadow-red-600/20"}," Yes, Delete it ")])])])):X("",!0)]))}},z1={class:"max-w-4xl mx-auto px-4 py-8"},q1={class:"bg-slate-800/80 backdrop-blur-sm rounded-2xl shadow-xl border border-slate-700 overflow-hidden"},W1={class:"p-6 space-y-6"},K1={class:"flex items-center justify-between mb-2"},G1={class:"w-3.5 h-3.5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},J1={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"},Y1={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},X1=["disabled"],Q1={class:"space-y-3 mb-4"},Z1={class:"flex items-center space-x-3"},em=["src","alt"],tm={class:"text-white font-medium"},sm=["onClick"],nm={key:0,class:"text-sm text-slate-500 italic"},om={class:"flex gap-2"},rm=["disabled"],im={key:0,class:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24"},lm={key:1},am={key:2},cm={class:"flex items-center justify-between mb-2"},um={class:"relative"},dm=["value"],fm={class:"flex items-center justify-between mb-2"},pm={class:"flex items-center space-x-3"},hm={class:"relative"},mm=["type"],gm={key:0,class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},vm={key:1,class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},bm={class:"mt-4 p-4 bg-blue-500/5 border border-blue-500/20 rounded-xl space-y-3"},xm={class:"text-xs text-slate-400 space-y-2 list-decimal list-inside"},ym={class:"text-blue-300 font-mono"},wm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},_m={class:"p-6 border-t border-slate-700 bg-slate-800/50 flex justify-end"},km=["disabled"],Cm={key:0,class:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24"},Sm={key:1,class:"h-5 w-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Em={class:"mt-8 bg-slate-800/80 backdrop-blur-sm rounded-2xl shadow-xl border border-slate-700 overflow-hidden"},$m={class:"p-6 border-b border-slate-700 flex items-center justify-between"},Am=["disabled"],Tm={class:"p-6"},Mm={class:"grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6"},Rm={class:"bg-slate-900/60 rounded-xl p-4 border border-slate-700"},Om={class:"text-lg font-bold text-white font-mono"},Bm={class:"bg-slate-900/60 rounded-xl p-4 border border-slate-700"},Pm={class:"bg-slate-900/60 rounded-xl p-4 border border-slate-700 flex flex-col justify-center"},Nm={key:0,class:"inline-flex items-center gap-1.5 text-amber-400 text-sm font-medium"},Lm={key:1,class:"inline-flex items-center gap-1.5 text-emerald-400 text-sm font-medium"},Im={key:2,class:"text-slate-500 text-sm italic"},jm={key:3,class:"text-slate-500 text-sm"},Dm={key:0,class:"mb-4 p-4 bg-slate-900/60 rounded-xl border border-slate-700"},Vm={class:"text-xs text-slate-300 whitespace-pre-wrap font-mono max-h-32 overflow-y-auto"},Hm=["href"],Fm={key:1,class:"flex items-center gap-4"},Um=["disabled"],zm={key:0,class:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24"},qm={key:1,class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Wm={key:2,class:"mt-4 p-4 bg-slate-900/80 rounded-xl border border-slate-700 font-mono text-xs text-slate-300 whitespace-pre-wrap max-h-40 overflow-y-auto"},Km={class:"mt-8 bg-slate-800/80 backdrop-blur-sm rounded-2xl shadow-xl border border-slate-700 overflow-hidden"},Gm={class:"p-6 border-b border-slate-700 flex items-center justify-between"},Jm={class:"overflow-x-auto"},Ym={class:"w-full text-left border-collapse"},Xm={class:"divide-y divide-slate-700/50"},Qm={class:"px-6 py-4 text-slate-300 font-mono whitespace-nowrap"},Zm={class:"px-6 py-4"},eg={class:"px-6 py-4 text-slate-300"},tg={class:"px-6 py-4"},sg={key:0,class:"text-emerald-400 flex items-center"},ng={key:1,class:"text-red-400 flex items-center"},og={key:2,class:"text-slate-400 flex items-center"},rg=["title"],ig={key:0},lg={__name:"Settings",setup(e){const t=H({webhookSecret:"",discordWebhook:"",telegramBotToken:"",telegramChatId:"",appsPath:""}),s=H([]),n=H(!1),o=H(!1),r=H(!1),l=H(!1),c=H(""),a=H(!1),f=H(""),d=H([]),p=H({current:null,latest:null,hasUpdate:!1,releaseUrl:null,changelog:""}),b=H(!1),y=H(!1),E=H(!1),$=H("");let L=null;const q=U=>U?new Date(U).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-",N=Te(()=>window.location.origin+"/api/webhook"),K=()=>{const U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let k="";for(let G=0;G<32;G++)k+=U.charAt(Math.floor(Math.random()*U.length));t.value.webhookSecret=k,a.value=!0},V=async(U,k)=>{if(U)try{await navigator.clipboard.writeText(U),f.value=k,setTimeout(()=>{f.value===k&&(f.value="")},2e3)}catch(G){console.error("Failed to copy text: ",G)}},Z=async()=>{try{const U=await fetch("/api/git/accounts",{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}});s.value=await U.json()}catch{console.error("Failed to load accounts")}},ne=async()=>{if(c.value){o.value=!0;try{const k=await(await fetch("/api/git/accounts",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`},body:JSON.stringify({token:c.value})})).json();k.success?(c.value="",await Z()):alert(k.error||"Invalid GitHub Token")}catch{alert("Error connecting to GitHub")}finally{o.value=!1}}},re=async U=>{if(confirm("Are you sure you want to disconnect this account?"))try{await fetch(`/api/git/accounts/${U}`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}}),await Z()}catch{alert("Failed to delete account")}},Q=async()=>{try{const k=await(await fetch("/api/settings",{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}})).json();t.value={...t.value,...k}}catch(U){console.error("Failed to load settings",U)}},C=async()=>{n.value=!0;try{await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`},body:JSON.stringify(t.value)}),l.value=!1,alert("Settings Saved Successfully")}catch{alert("Failed to save settings")}finally{n.value=!1}},P=async()=>{r.value=!0;try{const U=await fetch("/api/settings/webhook-logs",{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}});d.value=await U.json()}catch{console.error("Failed to load webhook logs")}finally{r.value=!1}},D=()=>{L||(L=rs()),L.off("webhook-log"),L.on("webhook-log",U=>{d.value.unshift(U),d.value.length>50&&(d.value=d.value.slice(0,50))})},A=async()=>{b.value=!0;try{const U=await fetch("/api/system/version-check",{headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`}});p.value=await U.json(),y.value=!0}finally{b.value=!1}},F=async()=>{if(confirm("Update PM2Me? The server will restart.")){E.value=!0,$.value="";try{const k=await(await fetch("/api/system/update",{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("pm2me_token")}`,"Content-Type":"application/json"}})).json();$.value=k.output||k.error||"Done",k.success&&await A()}finally{E.value=!1}}};return Gt(async()=>{Q(),Z(),await P(),D(),A()}),is(()=>{L&&L.disconnect()}),(U,k)=>(w(),_("div",z1,[k[61]||(k[61]=i("h1",{class:"text-3xl font-bold text-white tracking-tight mb-8"},"Settings",-1)),i("div",q1,[k[42]||(k[42]=rt('<div class="p-6 border-b border-slate-700"><h2 class="text-xl font-bold text-white flex items-center"><svg class="w-6 h-6 mr-2 text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg> System Configurations </h2><p class="text-sm text-slate-400 mt-1">Configure Webhooks and Integrations</p></div>',1)),i("div",W1,[i("div",null,[i("div",K1,[k[10]||(k[10]=i("label",{class:"block text-sm font-medium text-slate-300"},"Apps Storage Path",-1)),i("button",{onClick:k[0]||(k[0]=G=>l.value=!l.value),class:oe(["text-xs flex items-center transition-colors",l.value?"text-amber-400 hover:text-amber-300":"text-blue-400 hover:text-blue-300"])},[(w(),_("svg",G1,[l.value?(w(),_("path",Y1)):(w(),_("path",J1))])),Y(" "+j(l.value?"Cancel Edit":"Edit"),1)],2)]),xe(i("input",{type:"text","onUpdate:modelValue":k[1]||(k[1]=G=>t.value.appsPath=G),disabled:!l.value,class:"w-full bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all disabled:opacity-50 disabled:cursor-not-allowed",placeholder:"e.g. /home/user/.pm2me/apps or C:\\pm2me\\apps"},null,8,X1),[[Be,t.value.appsPath]]),k[11]||(k[11]=i("p",{class:"mt-1 text-xs text-slate-500"},"The directory where GitHub repositories will be cloned. Leave empty for default. (Requires server restart if changed)",-1))]),k[35]||(k[35]=i("hr",{class:"border-slate-700"},null,-1)),i("div",null,[k[13]||(k[13]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"Connected GitHub Accounts",-1)),i("div",Q1,[(w(!0),_(ve,null,De(s.value,G=>(w(),_("div",{key:G.id,class:"flex items-center justify-between p-3 bg-slate-900 border border-slate-700 rounded-lg"},[i("div",Z1,[i("img",{src:G.avatarUrl,alt:G.username,class:"w-8 h-8 rounded-full border border-slate-600"},null,8,em),i("span",tm,"@"+j(G.username),1)]),i("button",{type:"button",onClick:ce=>re(G.id),class:"text-sm text-red-400 hover:text-red-300 transition-colors"},"Disconnect",8,sm)]))),128)),s.value.length===0?(w(),_("p",nm,"No accounts connected yet.")):X("",!0)]),k[14]||(k[14]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"Add New Account (Personal Access Token)",-1)),i("div",om,[xe(i("input",{type:"password","onUpdate:modelValue":k[2]||(k[2]=G=>c.value=G),class:"flex-1 bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all",placeholder:"ghp_xxxxxxxxxxxxxxxxxxxx"},null,512),[[Be,c.value]]),i("button",{type:"button",onClick:ne,disabled:o.value,class:"px-5 py-2.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded-lg transition-colors border border-slate-600 disabled:opacity-50 whitespace-nowrap font-medium flex items-center"},[o.value?(w(),_("svg",im,[...k[12]||(k[12]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):X("",!0),o.value?(w(),_("span",lm,"Testing...")):(w(),_("span",am,"Connect"))],8,rm)]),k[15]||(k[15]=i("p",{class:"mt-1 text-xs text-slate-500"},"Used to fetch repositories and branches automatically when deploying. ",-1))]),k[36]||(k[36]=i("hr",{class:"border-slate-700"},null,-1)),i("div",null,[i("div",cm,[k[17]||(k[17]=i("label",{class:"block text-sm font-medium text-slate-300"},"GitHub Webhook URL",-1)),i("button",{onClick:k[3]||(k[3]=G=>V(N.value,"URL")),class:"text-xs text-blue-400 hover:text-blue-300 flex items-center transition-colors"},[k[16]||(k[16]=i("svg",{class:"w-3.5 h-3.5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})],-1)),Y(" "+j(f.value==="URL"?"Copied!":"Copy URL"),1)])]),i("div",um,[i("input",{type:"text",value:N.value,readonly:"",class:"w-full bg-slate-900/50 border border-slate-700 rounded-lg px-4 py-2.5 text-slate-400 text-sm font-mono outline-none transition-all cursor-default",placeholder:"Calculating..."},null,8,dm)]),k[18]||(k[18]=i("p",{class:"mt-1 text-[11px] text-slate-500 italic"},"Provide this URL to your GitHub repository's Webhook settings.",-1))]),i("div",null,[i("div",fm,[k[21]||(k[21]=i("label",{class:"block text-sm font-medium text-slate-300"},"GitHub Webhook Secret",-1)),i("div",pm,[i("button",{onClick:K,class:"text-xs text-emerald-400 hover:text-emerald-300 flex items-center transition-colors"},[...k[19]||(k[19]=[i("svg",{class:"w-3.5 h-3.5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Y(" Generate ",-1)])]),i("button",{onClick:k[4]||(k[4]=G=>V(t.value.webhookSecret,"Secret")),class:"text-xs text-blue-400 hover:text-blue-300 flex items-center transition-colors"},[k[20]||(k[20]=i("svg",{class:"w-3.5 h-3.5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})],-1)),Y(" "+j(f.value==="Secret"?"Copied!":"Copy Secret"),1)])])]),i("div",hm,[xe(i("input",{type:a.value?"text":"password","onUpdate:modelValue":k[5]||(k[5]=G=>t.value.webhookSecret=G),class:"w-full bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all pr-12",placeholder:"Secret for verifying GitHub payloads"},null,8,mm),[[Ru,t.value.webhookSecret]]),i("button",{onClick:k[6]||(k[6]=G=>a.value=!a.value),class:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300 p-1"},[a.value?(w(),_("svg",gm,[...k[22]||(k[22]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.882 9.882L9.881 9.882M9.882 9.882A3.001 3.001 0 0014.15 14.15l-4.268-4.268zm7.665 7.665l2.484 2.484M15.904 15.904a10.023 10.023 0 01-3.904 1.096m-4.06-1.121A10.053 10.053 0 013 12c.5-2.015 1.581-3.76 3.061-5.061m10.878 10.878l-4.243-4.243m4.243 4.243L19 19m-4.732-4.732l-4.242-4.242M4.732 4.732L2 2"},null,-1)])])):(w(),_("svg",vm,[...k[23]||(k[23]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])]))])]),i("div",bm,[k[30]||(k[30]=i("h3",{class:"text-sm font-bold text-blue-400 flex items-center"},[i("svg",{class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),Y(" How to setup GitHub Webhook ")],-1)),i("ol",xm,[k[25]||(k[25]=i("li",null,"Open your repository on GitHub.",-1)),k[26]||(k[26]=i("li",null,[Y("Go to "),i("span",{class:"text-slate-200"},"Settings"),Y(" > "),i("span",{class:"text-slate-200"},"Webhooks"),Y(" > "),i("span",{class:"text-slate-200"},"Add webhook"),Y(". ")],-1)),i("li",null,[k[24]||(k[24]=Y("Payload URL: ",-1)),i("span",ym,j(N.value),1)]),k[27]||(k[27]=i("li",null,[Y("Content type: "),i("span",{class:"text-orange-400 font-bold"},"application/json")],-1)),k[28]||(k[28]=i("li",null,[Y("Secret: "),i("span",{class:"text-slate-200"},"Paste your Webhook Secret above")],-1)),k[29]||(k[29]=i("li",null,[Y("Which events: "),i("span",{class:"text-slate-200"},"Just the push event"),Y(".")],-1))]),k[31]||(k[31]=i("p",{class:"text-[10px] text-slate-500 italic"},"This allows PM2Me to automatically deploy your apps when you push code.",-1))])]),k[37]||(k[37]=i("hr",{class:"border-slate-700"},null,-1)),i("div",null,[k[32]||(k[32]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"Discord Webhook URL",-1)),xe(i("input",{type:"url","onUpdate:modelValue":k[7]||(k[7]=G=>t.value.discordWebhook=G),class:"w-full bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all",placeholder:"https://discord.com/api/webhooks/..."},null,512),[[Be,t.value.discordWebhook]])]),k[38]||(k[38]=i("hr",{class:"border-slate-700"},null,-1)),i("div",wm,[i("div",null,[k[33]||(k[33]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"Telegram Bot Token",-1)),xe(i("input",{type:"password","onUpdate:modelValue":k[8]||(k[8]=G=>t.value.telegramBotToken=G),class:"w-full bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all",placeholder:"123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"},null,512),[[Be,t.value.telegramBotToken]])]),i("div",null,[k[34]||(k[34]=i("label",{class:"block text-sm font-medium text-slate-300 mb-2"},"Telegram Chat ID",-1)),xe(i("input",{type:"text","onUpdate:modelValue":k[9]||(k[9]=G=>t.value.telegramChatId=G),class:"w-full bg-slate-900 border border-slate-600 rounded-lg px-4 py-2.5 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all",placeholder:"-1001234567890"},null,512),[[Be,t.value.telegramChatId]])])])]),i("div",_m,[i("button",{onClick:C,disabled:n.value,class:"px-6 py-2.5 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white font-medium rounded-lg transition-all shadow-lg flex items-center disabled:opacity-70"},[n.value?(w(),_("svg",Cm,[...k[39]||(k[39]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(w(),_("svg",Sm,[...k[40]||(k[40]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])),k[41]||(k[41]=Y(" Save Settings ",-1))],8,km)])]),i("div",Em,[i("div",$m,[k[45]||(k[45]=i("div",null,[i("h2",{class:"text-xl font-bold text-white flex items-center gap-2"},[i("svg",{class:"w-5 h-5 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})]),Y(" App Version ")]),i("p",{class:"text-sm text-slate-400 mt-1"},"Check for updates and manage the PM2Me version")],-1)),i("button",{onClick:A,disabled:b.value,class:"flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium bg-slate-700 hover:bg-slate-600 text-slate-300 transition-all disabled:opacity-50"},[(w(),_("svg",{class:oe(["w-4 h-4",{"animate-spin":b.value}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...k[43]||(k[43]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2)),k[44]||(k[44]=Y(" Check for Update ",-1))],8,Am)]),i("div",Tm,[i("div",Mm,[i("div",Rm,[k[46]||(k[46]=i("p",{class:"text-xs text-slate-500 mb-1"},"Current Version",-1)),i("p",Om,"v"+j(p.value.current||"..."),1)]),i("div",Bm,[k[47]||(k[47]=i("p",{class:"text-xs text-slate-500 mb-1"},"Latest Release",-1)),i("p",{class:oe(["text-lg font-bold font-mono",p.value.hasUpdate?"text-amber-400":"text-emerald-400"])},j(p.value.latest?"v"+p.value.latest:"-"),3)]),i("div",Pm,[p.value.hasUpdate?(w(),_("span",Nm,[...k[48]||(k[48]=[i("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Y(" Update available! ",-1)])])):p.value.latest?(w(),_("span",Lm,[...k[49]||(k[49]=[i("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1),Y(" Up to date ",-1)])])):y.value?(w(),_("span",Im," No releases found on GitHub ")):(w(),_("span",jm,"Not checked"))])]),p.value.changelog?(w(),_("div",Dm,[k[50]||(k[50]=i("p",{class:"text-xs text-slate-500 mb-2 font-medium uppercase tracking-wider"},"Release Notes",-1)),i("pre",Vm,j(p.value.changelog),1),p.value.releaseUrl?(w(),_("a",{key:0,href:p.value.releaseUrl,target:"_blank",class:"inline-flex items-center gap-1 mt-2 text-xs text-blue-400 hover:text-blue-300"}," View on GitHub โ ",8,Hm)):X("",!0)])):X("",!0),p.value.hasUpdate?(w(),_("div",Fm,[i("button",{onClick:F,disabled:E.value,class:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-semibold bg-blue-600 hover:bg-blue-500 text-white transition-all disabled:opacity-50"},[E.value?(w(),_("svg",zm,[...k[51]||(k[51]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):(w(),_("svg",qm,[...k[52]||(k[52]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"},null,-1)])])),Y(" "+j(E.value?"Updating...":"Update Now"),1)],8,Um),k[53]||(k[53]=i("p",{class:"text-xs text-slate-500"},"Server will restart after update",-1))])):X("",!0),$.value?(w(),_("div",Wm,j($.value),1)):X("",!0)])]),i("div",Km,[i("div",Gm,[k[55]||(k[55]=i("div",null,[i("h2",{class:"text-xl font-bold text-white flex items-center"},[i("svg",{class:"w-6 h-6 mr-2 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),Y(" Webhook History ")]),i("p",{class:"text-sm text-slate-400 mt-1"},"Last 50 recorded events (Push, Ping, etc.)")],-1)),i("button",{onClick:P,class:"p-2 text-slate-400 hover:text-white transition-colors",title:"Refresh Logs"},[(w(),_("svg",{class:oe(["w-5 h-5",{"animate-spin":r.value}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...k[54]||(k[54]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))])]),i("div",Jm,[i("table",Ym,[k[60]||(k[60]=i("thead",{class:"bg-slate-900/50 text-slate-400 text-xs font-medium uppercase tracking-wider"},[i("tr",null,[i("th",{class:"px-6 py-3 border-b border-slate-700"},"Time"),i("th",{class:"px-6 py-3 border-b border-slate-700"},"Event"),i("th",{class:"px-6 py-3 border-b border-slate-700"},"Repository"),i("th",{class:"px-6 py-3 border-b border-slate-700"},"Status"),i("th",{class:"px-6 py-3 border-b border-slate-700"},"Details")])],-1)),i("tbody",Xm,[(w(!0),_(ve,null,De(d.value,G=>(w(),_("tr",{key:G.id,class:"hover:bg-slate-700/30 transition-colors text-sm"},[i("td",Qm,j(q(G.timestamp)),1),i("td",Zm,[i("span",{class:oe(["px-2 py-0.5 rounded text-[10px] font-bold uppercase",G.eventType==="push"?"bg-blue-500/20 text-blue-400":"bg-slate-700 text-slate-400"])},j(G.eventType),3)]),i("td",eg,j(G.repository),1),i("td",tg,[G.status==="success"?(w(),_("span",sg,[...k[56]||(k[56]=[i("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1),Y(" Success ",-1)])])):G.status==="error"?(w(),_("span",ng,[...k[57]||(k[57]=[i("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"})],-1),Y(" Error ",-1)])])):(w(),_("span",og,[k[58]||(k[58]=i("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[i("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})],-1)),Y(" "+j(G.status),1)]))]),i("td",{class:"px-6 py-4 text-slate-500 text-xs truncate max-w-xs",title:G.details},j(G.details),9,rg)]))),128)),d.value.length===0?(w(),_("tr",ig,[...k[59]||(k[59]=[i("td",{colspan:"5",class:"px-6 py-12 text-center text-slate-500 italic"},' No webhook events recorded yet. Perform a Push or click "Test" on GitHub. ',-1)])])):X("",!0)])])])])]))}},ag={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6"},cg={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4"},ug={class:"flex items-center gap-3"},dg={class:"relative flex h-2 w-2"},fg={key:0,class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"},pg=["disabled"],hg={class:"grid grid-cols-1 sm:grid-cols-3 gap-4"},mg={class:"bg-slate-800/60 rounded-2xl border border-slate-700 p-4"},gg={class:"text-sm font-semibold text-slate-200 flex items-center gap-2"},vg={class:"text-lg"},bg={class:"bg-slate-800/60 rounded-2xl border border-slate-700 p-4"},xg={class:"bg-slate-800/60 rounded-2xl border border-slate-700 p-4"},yg={class:"text-xs font-mono text-slate-300 break-all"},wg={class:"bg-slate-800/60 rounded-2xl border border-slate-700 p-5"},_g={class:"flex flex-wrap gap-3"},kg=["disabled"],Cg=["disabled"],Sg=["disabled"],Eg=["disabled"],$g=["disabled"],Ag={key:0,class:"flex items-center gap-2 text-slate-400 text-sm"},Tg={key:0,class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},Mg={key:1,class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},Rg={class:"bg-slate-800/60 rounded-2xl border border-slate-700 overflow-hidden"},Og={class:"flex",style:{"min-height":"600px"}},Bg={class:"flex-shrink-0 bg-slate-900/60 border-r border-slate-700",style:{width:"220px"}},Pg={class:"flex items-center justify-between px-3 py-2 border-b border-slate-700/50"},Ng={key:0,class:"px-2 py-2 border-b border-slate-700/50"},Lg={class:"flex gap-1 mt-1"},Ig={class:"overflow-y-auto",style:{"max-height":"560px"}},jg={key:0,class:"px-3 py-4 text-xs text-slate-600 text-center"},Dg=["onClick"],Vg={class:"flex-1 text-xs font-mono truncate"},Hg=["onClick"],Fg={key:1,class:"border-t border-slate-700/50 p-2"},Ug=["disabled"],zg={key:0,class:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24"},qg={class:"text-[10px] text-slate-600 text-center mt-1"},Wg={class:"flex-1 flex flex-col overflow-hidden"},Kg={class:"flex items-center justify-between px-4 py-3 border-b border-slate-700 bg-slate-900/30"},Gg={class:"flex items-center gap-2"},Jg={class:"text-sm font-semibold text-slate-300"},Yg={class:"text-xs text-slate-600 font-mono"},Xg={key:0,class:"text-xs text-amber-400 flex items-center gap-1"},Qg={class:"flex items-center gap-2"},Zg=["disabled"],ev={key:0,class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},tv={key:1,class:"animate-spin w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24"},sv={key:0,class:"flex-1 flex items-center justify-center text-slate-600 text-sm"},nv={class:"flex overflow-hidden flex-1",style:{background:"#030712"}},ov=["textContent"],rv=["innerHTML"],iv={class:"flex items-center justify-between px-4 py-1.5 border-t border-slate-800 text-xs font-mono",style:{background:"#020617"}},lv={class:"flex items-center gap-4"},av={key:0,class:"text-slate-300"},cv={key:1,class:"text-slate-600 text-xs"},uv={class:"text-slate-600"},dv={__name:"Nginx",setup(e){const t=()=>localStorage.getItem("pm2me_token"),s=()=>({Authorization:`Bearer ${t()}`,"Content-Type":"application/json"}),n=H({os:"",confFile:"",confDir:"",installed:!1,version:""}),o=H({running:!1,checking:!1}),r=H([]),l=H(!0),c=H(null),a=H(""),f=H(!1),d=H(!1),p=H(!1),b=H(null),y=H(!1),E=H(!1),$=H(!1),L=H(""),q=H(null),N=H(null),K=H(null),V=H(!1),Z=H({line:1,col:1}),ne=/^(server_name|server|location|upstream|http|events|listen|root|index|include|proxy_pass|proxy_set_header|proxy_hide_header|proxy_redirect|proxy_connect_timeout|proxy_read_timeout|proxy_send_timeout|fastcgi_pass|fastcgi_param|fastcgi_index|ssl_certificate|ssl_certificate_key|ssl_protocols|ssl_ciphers|ssl_prefer_server_ciphers|ssl_session_cache|ssl_session_timeout|add_header|return|rewrite|if|set|map|geo|break|last|redirect|permanent|worker_processes|worker_connections|keepalive_timeout|keepalive|gzip|gzip_types|gzip_comp_level|gzip_min_length|gzip_vary|client_max_body_size|client_body_timeout|client_header_timeout|access_log|error_log|log_format|sendfile|tcp_nopush|tcp_nodelay|default_type|charset|expires|autoindex|alias|deny|allow|auth_basic|auth_basic_user_file|limit_req|limit_req_zone|limit_conn|limit_conn_zone|resolver|resolver_timeout|user|pid|daemon|types|pcre_jit|load_module|open_file_cache|open_file_cache_valid|error_page|try_files|internal|proxy_cache|proxy_cache_valid|proxy_buffering)\b/,re=v=>!v||/[\s;{}()"',]/.test(v);function Q(v){return v.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function C(v){const u=v.match(/^(\s*)(#.*)$/);if(u)return`${Q(u[1])}<span class="hl-comment">${Q(u[2])}</span>`;let h="",R=0;for(;R<v.length;){const m=v.slice(R),g=v[R-1];if(v[R]==="#"&&(R===0||/\s/.test(g))){h+=`<span class="hl-comment">${Q(m)}</span>`;break}if(v[R]==='"'){let S=R+1;for(;S<v.length&&v[S]!=='"';)v[S]==="\\"&&S++,S++;h+=`<span class="hl-string">${Q(v.slice(R,S+1))}</span>`,R=S+1;continue}if(v[R]==="'"){let S=R+1;for(;S<v.length&&v[S]!=="'";)v[S]==="\\"&&S++,S++;h+=`<span class="hl-string">${Q(v.slice(R,S+1))}</span>`,R=S+1;continue}if(v[R]==="$"){const S=m.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*)/);if(S){h+=`<span class="hl-variable">${Q(S[1])}</span>`,R+=S[1].length;continue}}const x=m.match(ne);if(x&&re(g)&&re(v[R+x[1].length])){h+=`<span class="hl-keyword">${x[1]}</span>`,R+=x[1].length;continue}const T=m.match(/^(on|off|none|any)\b/);if(T&&re(g)){h+=`<span class="hl-special">${T[1]}</span>`,R+=T[1].length;continue}if(/\d/.test(v[R])&&re(g)){const S=m.match(/^(\d+[a-z]*)/);if(S&&re(v[R+S[1].length])){h+=`<span class="hl-number">${S[1]}</span>`,R+=S[1].length;continue}}if(v[R]==="{"||v[R]==="}"){h+=`<span class="hl-brace">${v[R]}</span>`,R++;continue}if(v[R]===";"){h+='<span class="hl-semi">;</span>',R++;continue}h+=Q(v[R]),R++}return h}const P=Te(()=>a.value.split(`
|
|
8
|
+
`).map(C).join(`
|
|
9
|
+
`)),D=Te(()=>Math.max(1,a.value.split(`
|
|
10
|
+
`).length)),A=v=>{const u=v.target,R=u.value.substring(0,u.selectionStart).split(`
|
|
11
|
+
`);Z.value={line:R.length,col:R[R.length-1].length+1}},F=()=>{!K.value||!N.value||(N.value.scrollTop=K.value.scrollTop)},U=async()=>{if(await Ht(),!q.value||!K.value)return;const v=K.value.querySelector('[aria-hidden="true"]');v&&(q.value.style.height=v.offsetHeight+"px")},k=v=>{f.value=!0,A(v),U()},G=v=>{const u=v.target,{selectionStart:h,selectionEnd:R,value:m}=u;if(v.key==="s"&&(v.ctrlKey||v.metaKey)){v.preventDefault(),ye();return}if(v.key==="Tab"&&!v.ctrlKey&&!v.metaKey){v.preventDefault();const x=" ",T=m.split(`
|
|
12
|
+
`);if(h===R)a.value=m.slice(0,h)+x+m.slice(R),Ht(()=>{u.selectionStart=u.selectionEnd=h+x.length,A({target:u}),U()});else{let S=0,M=0,W=0;for(let I=0;I<T.length;I++){const O=S+T[I].length;S<=h&&h<=O+1&&(M=I),S<=R&&R<=O+1&&(W=I),S+=T[I].length+1}const z=(W-M+1)*x.length;for(let I=M;I<=W;I++)T[I]=v.shiftKey?T[I].replace(new RegExp(`^ {1,${x.length}}`),""):x+T[I];a.value=T.join(`
|
|
13
|
+
`),Ht(()=>{u.selectionStart=h+x.length,u.selectionEnd=R+z,A({target:u}),U()})}f.value=!0;return}if((v.key==="/"||v.code==="Slash"||v.code==="NumpadDivide")&&(v.ctrlKey||v.metaKey)){v.preventDefault();const x=m.split(`
|
|
14
|
+
`);let T=0,S=0,M=0;for(let O=0;O<x.length;O++){const ee=T+x[O].length;T<=h&&h<=ee+1&&(S=O),T<=R&&R<=ee+1&&(M=O),T+=x[O].length+1}if(M>S){let O=0;for(let ee=0;ee<M;ee++)O+=x[ee].length+1;R===O&&M--}for(;M>S&&x[M].trim()==="";)M--;const W=x.slice(S,M+1).filter(O=>O.trim()!==""),z=W.length>0&&W.every(O=>/^\s*#/.test(O));for(let O=S;O<=M;O++)x[O].trim()!==""&&(x[O]=z?x[O].replace(/^(\s*)# ?/,"$1"):x[O].replace(/^(\s*)/,"$1# "));a.value=x.join(`
|
|
15
|
+
`),f.value=!0;const I=z?-2:2;Ht(()=>{u.selectionStart=Math.max(0,h+I),u.selectionEnd=Math.max(0,R+(M-S+1)*I),A({target:u})});return}},ce=async()=>{const v=await fetch("/api/nginx/info",{headers:s()});n.value=await v.json()},ae=async()=>{o.value.checking=!0;try{o.value.running=(await(await fetch("/api/nginx/status",{headers:s()})).json()).running}finally{o.value.checking=!1}},$e=async()=>{const u=await(await fetch("/api/nginx/files",{headers:s()})).json();r.value=u.files||[],l.value=u.isWindows,!c.value&&r.value.length>0&&await be(r.value[0])},be=async v=>{f.value&&c.value&&!confirm(`Discard unsaved changes to ${c.value.name}?`)||(c.value=v,f.value=!1,await Re())},Re=async()=>{if(!c.value)return;const u=await(await fetch(`/api/nginx/config?file=${encodeURIComponent(c.value.path)}`,{headers:s()})).json();a.value=u.content,f.value=!1,await U()},ye=async()=>{if(c.value){d.value=!0;try{await fetch("/api/nginx/config",{method:"POST",headers:s(),body:JSON.stringify({content:a.value,file:c.value.path})}),f.value=!1}finally{d.value=!1}}},qe=async()=>{if(c.value){E.value=!0;try{const v=c.value.enabled?"/api/nginx/disable":"/api/nginx/enable";await fetch(v,{method:"POST",headers:s(),body:JSON.stringify({filePath:c.value.path,name:c.value.name})}),await $e();const u=r.value.find(h=>h.path===c.value?.path);u&&(c.value=u)}finally{E.value=!1}}},Ne=async()=>{if(!L.value.trim())return;const u=await(await fetch("/api/nginx/files/new",{method:"POST",headers:s(),body:JSON.stringify({name:L.value.trim()})})).json();if($.value=!1,L.value="",u.success){await $e();const h=r.value.find(R=>R.name===u.name);h&&await be(h)}},Qe=async v=>{confirm(`Delete ${v.name}?`)&&(await fetch("/api/nginx/files",{method:"DELETE",headers:s(),body:JSON.stringify({filePath:v.path})}),c.value?.path===v.path&&(c.value=null,a.value=""),await $e())},Ce=async v=>{p.value=!0,b.value=null;try{const h=await(await fetch("/api/nginx/action",{method:"POST",headers:s(),body:JSON.stringify({action:v})})).json();b.value=h.output||h.error||"",y.value=h.success,["start","reload","stop","quit"].includes(v)&&setTimeout(ae,800)}finally{p.value=!1}};let B=null;return Gt(async()=>{await ce(),await ae(),await $e(),B=setInterval(ae,5e3)}),is(()=>clearInterval(B)),(v,u)=>(w(),_("div",ag,[i("div",cg,[u[15]||(u[15]=rt('<div data-v-8287dcd4><h1 class="text-3xl font-bold text-white tracking-tight flex items-center gap-3" data-v-8287dcd4><div class="w-10 h-10 rounded-xl bg-emerald-500/20 flex items-center justify-center border border-emerald-500/30" data-v-8287dcd4><svg class="w-5 h-5 text-emerald-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" data-v-8287dcd4><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" data-v-8287dcd4></path></svg></div> Nginx </h1><p class="text-sm text-slate-400 mt-1" data-v-8287dcd4>Manage nginx configuration and process</p></div>',1)),i("div",ug,[i("div",{class:oe(["flex items-center gap-2 px-4 py-2 rounded-xl border text-sm font-medium",o.value.running?"bg-emerald-500/10 border-emerald-500/30 text-emerald-400":"bg-slate-800 border-slate-700 text-slate-400"])},[i("span",dg,[o.value.running?(w(),_("span",fg)):X("",!0),i("span",{class:oe(["relative inline-flex rounded-full h-2 w-2",o.value.running?"bg-emerald-400":"bg-slate-500"])},null,2)]),Y(" "+j(o.value.running?"Running":"Stopped"),1)],2),i("button",{onClick:ae,disabled:o.value.checking,class:"p-2 text-slate-400 hover:text-white transition-colors rounded-lg hover:bg-slate-800"},[(w(),_("svg",{class:oe(["w-4 h-4",{"animate-spin":o.value.checking}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...u[14]||(u[14]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))],8,pg)])]),i("div",hg,[i("div",mg,[u[16]||(u[16]=i("p",{class:"text-xs text-slate-500 mb-1"},"OS Platform",-1)),i("p",gg,[i("span",vg,j(n.value.os==="windows"?"๐ช":"๐ง"),1),Y(" "+j(n.value.os==="windows"?"Windows":"Linux"),1)])]),i("div",bg,[u[17]||(u[17]=i("p",{class:"text-xs text-slate-500 mb-1"},"Nginx Version",-1)),i("p",{class:oe(["text-sm font-semibold",n.value.installed?"text-emerald-400":"text-red-400"])},j(n.value.installed?`v${n.value.version}`:"Not installed"),3)]),i("div",xg,[u[18]||(u[18]=i("p",{class:"text-xs text-slate-500 mb-1"},"Config Dir",-1)),i("p",yg,j(n.value.confDir),1)])]),i("div",wg,[u[27]||(u[27]=i("h2",{class:"text-sm font-semibold text-slate-300 mb-4"},"Process Control",-1)),i("div",_g,[i("button",{onClick:u[0]||(u[0]=h=>Ce("test")),disabled:p.value,class:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all bg-blue-600/20 hover:bg-blue-600/40 border border-blue-500/30 text-blue-400 disabled:opacity-50"},[...u[19]||(u[19]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Y(" Test Config ",-1)])],8,kg),i("button",{onClick:u[1]||(u[1]=h=>Ce("start")),disabled:p.value||o.value.running,class:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all bg-emerald-600/20 hover:bg-emerald-600/40 border border-emerald-500/30 text-emerald-400 disabled:opacity-30"},[...u[20]||(u[20]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Y(" Start ",-1)])],8,Cg),i("button",{onClick:u[2]||(u[2]=h=>Ce("reload")),disabled:p.value||!o.value.running,class:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all bg-amber-500/20 hover:bg-amber-500/40 border border-amber-500/30 text-amber-400 disabled:opacity-30"},[...u[21]||(u[21]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Y(" Reload ",-1)])],8,Sg),i("button",{onClick:u[3]||(u[3]=h=>Ce("quit")),disabled:p.value||!o.value.running,class:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all bg-slate-700 hover:bg-slate-600 border border-slate-600 text-slate-300 disabled:opacity-30"},[...u[22]||(u[22]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"})],-1),Y(" Quit ",-1)])],8,Eg),i("button",{onClick:u[4]||(u[4]=h=>Ce("stop")),disabled:p.value||!o.value.running,class:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all bg-red-600/20 hover:bg-red-600/40 border border-red-500/30 text-red-400 disabled:opacity-30"},[...u[23]||(u[23]=[i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),Y(" Stop ",-1)])],8,$g),p.value?(w(),_("div",Ag,[...u[24]||(u[24]=[i("svg",{class:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24"},[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1),Y(" Running... ",-1)])])):X("",!0)]),b.value!==null?(w(),_("div",{key:0,class:oe(["mt-4 rounded-xl bg-slate-900/80 border p-4 font-mono text-sm whitespace-pre-wrap",y.value?"border-emerald-500/30 text-emerald-300":"border-red-500/30 text-red-300"])},[i("div",{class:oe(["flex items-center gap-2 mb-2 text-xs font-sans",y.value?"text-emerald-500":"text-red-500"])},[y.value?(w(),_("svg",Tg,[...u[25]||(u[25]=[i("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)])])):(w(),_("svg",Mg,[...u[26]||(u[26]=[i("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)])])),Y(" "+j(y.value?"Success":"Error"),1)],2),Y(" "+j(b.value||"(no output)"),1)],2)):X("",!0)]),i("div",Rg,[i("div",Og,[i("div",Bg,[i("div",Pg,[u[29]||(u[29]=i("span",{class:"text-xs font-semibold text-slate-400 uppercase tracking-wider"},"Files",-1)),i("button",{onClick:u[5]||(u[5]=h=>$.value=!0),title:"New file",class:"p-1 rounded hover:bg-slate-700 text-slate-500 hover:text-white transition-colors"},[...u[28]||(u[28]=[i("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])])]),$.value?(w(),_("div",Ng,[xe(i("input",{"onUpdate:modelValue":u[6]||(u[6]=h=>L.value=h),onKeydown:[kn(Ne,["enter"]),u[7]||(u[7]=kn(h=>{$.value=!1,L.value=""},["escape"]))],placeholder:"filename.conf",class:"w-full bg-slate-800 border border-blue-500/50 rounded px-2 py-1 text-xs text-slate-200 focus:outline-none focus:border-blue-400",autofocus:""},null,544),[[Be,L.value]]),i("div",Lg,[i("button",{onClick:Ne,class:"flex-1 text-xs px-2 py-1 bg-blue-600/30 hover:bg-blue-600/50 text-blue-400 rounded"},"Create"),i("button",{onClick:u[8]||(u[8]=h=>{$.value=!1,L.value=""}),class:"flex-1 text-xs px-2 py-1 bg-slate-700 hover:bg-slate-600 text-slate-400 rounded"},"Cancel")])])):X("",!0),i("div",Ig,[r.value.length===0?(w(),_("div",jg,"No config files found")):X("",!0),(w(!0),_(ve,null,De(r.value,h=>(w(),_("div",{key:h.path,onClick:R=>be(h),class:oe(["group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors border-l-2",c.value?.path===h.path?"bg-slate-700/60 border-blue-500 text-slate-100":"border-transparent hover:bg-slate-800/60 text-slate-400 hover:text-slate-200"])},[u[31]||(u[31]=i("svg",{class:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),i("span",Vg,j(h.name),1),!l.value&&h.enabledPath?(w(),_("span",{key:0,class:oe(["text-[10px] px-1 rounded font-medium flex-shrink-0",h.enabled?"bg-emerald-500/20 text-emerald-400":"bg-slate-700 text-slate-500"])},j(h.enabled?"on":"off"),3)):X("",!0),h.name!=="nginx.conf"?(w(),_("button",{key:1,onClick:os(R=>Qe(h),["stop"]),class:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-red-500/20 text-slate-500 hover:text-red-400 transition-all flex-shrink-0",title:"Delete"},[...u[30]||(u[30]=[i("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Hg)):X("",!0)],10,Dg))),128))]),!l.value&&c.value&&c.value.enabledPath?(w(),_("div",Fg,[i("button",{onClick:qe,disabled:E.value,class:oe(["w-full text-xs px-3 py-2 rounded-lg font-medium transition-all flex items-center justify-center gap-1.5",c.value.enabled?"bg-red-600/20 hover:bg-red-600/30 border border-red-500/30 text-red-400":"bg-emerald-600/20 hover:bg-emerald-600/30 border border-emerald-500/30 text-emerald-400"])},[E.value?(w(),_("svg",zg,[...u[32]||(u[32]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):(w(),_(ve,{key:1},[Y(j(c.value.enabled?"โ Disable site":"โ
Enable site"),1)],64))],10,Ug),i("p",qg,j(c.value.enabled?"Will unlink from sites-enabled":"Will symlink to sites-enabled"),1)])):X("",!0)]),i("div",Wg,[i("div",Kg,[i("div",Gg,[u[34]||(u[34]=i("svg",{class:"w-4 h-4 text-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),i("span",Jg,j(c.value?.name||"No file selected"),1),i("span",Yg,j(c.value?.path),1),f.value?(w(),_("span",Xg,[...u[33]||(u[33]=[i("svg",{class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 8 8"},[i("circle",{cx:"4",cy:"4",r:"4"})],-1),Y(" Unsaved ",-1)])])):X("",!0)]),i("div",Qg,[i("button",{onClick:ye,disabled:d.value||!f.value||!c.value,class:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-blue-600 hover:bg-blue-500 text-white transition-all disabled:opacity-40"},[d.value?(w(),_("svg",tv,[...u[36]||(u[36]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):(w(),_("svg",ev,[...u[35]||(u[35]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"},null,-1)])])),u[37]||(u[37]=Y(" Save ",-1))],8,Zg),i("button",{onClick:Re,class:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-slate-700 hover:bg-slate-600 text-slate-300 transition-all"},[...u[38]||(u[38]=[i("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})],-1),Y(" Reload ",-1)])])])]),c.value?(w(),_(ve,{key:1},[i("div",nv,[i("div",{ref_key:"gutterRef",ref:N,class:"select-none flex-shrink-0 text-right font-mono text-[13px] leading-relaxed border-r border-slate-800",style:{"min-width":"3.5rem",overflow:"hidden","pointer-events":"none",padding:"12px 10px 12px 8px",background:"#020617"}},[(w(!0),_(ve,null,De(D.value,h=>(w(),_("div",{key:h,class:oe(["transition-colors",h===Z.value.line&&V.value?"text-slate-300":"text-slate-600"])},j(h),3))),128))],512),i("div",{ref_key:"scrollWrap",ref:K,class:"relative flex-1 editor-scroll",style:{"overflow-y":"scroll","overflow-x":"auto"},onScroll:F},[i("div",{"aria-hidden":"true",class:"invisible pointer-events-none whitespace-pre editor-line-height",style:{padding:"12px 16px"},textContent:j(a.value+`
|
|
16
|
+
`)},null,8,ov),i("pre",{ref:"highlightPre","aria-hidden":"true",class:"absolute top-0 left-0 w-full m-0 pointer-events-none editor-line-height whitespace-pre",style:{padding:"12px 16px"},innerHTML:P.value},null,8,rv),xe(i("textarea",{ref_key:"editorRef",ref:q,"onUpdate:modelValue":u[9]||(u[9]=h=>a.value=h),onInput:k,onClick:u[10]||(u[10]=h=>A(h)),onKeydown:G,onKeyup:u[11]||(u[11]=h=>A(h)),onFocus:u[12]||(u[12]=h=>V.value=!0),onBlur:u[13]||(u[13]=h=>V.value=!1),spellcheck:"false",class:"absolute top-0 left-0 w-full focus:outline-none resize-none editor-textarea editor-line-height",style:{padding:"12px 16px",height:"100%","caret-color":"#60a5fa",color:"transparent",background:"transparent","tab-size":"4","white-space":"pre",overflow:"hidden","z-index":"1"},placeholder:""},null,544),[[Be,a.value]])],544)]),i("div",iv,[i("div",lv,[V.value?(w(),_("span",av,"Ln "+j(Z.value.line)+", Col "+j(Z.value.col),1)):(w(),_("span",cv,"Ctrl+S Save ยท Ctrl+/ Comment ยท Tab Indent"))]),i("div",uv,j(D.value)+" lines",1)])],64)):(w(),_("div",sv," Select a file from the sidebar to edit "))])])])]))}},fv=ir(dv,[["__scopeId","data-v-8287dcd4"]]),pv={class:"min-h-screen flex items-center justify-center px-4",style:{background:"linear-gradient(135deg, #0f172a 0%, #1e293b 100%)"}},hv={class:"w-full max-w-lg"},mv={class:"flex items-center justify-center gap-2 mb-8"},gv={key:0,class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},vv={key:1},bv={class:"bg-slate-800/80 backdrop-blur-md rounded-3xl border border-slate-700 p-8 shadow-2xl"},xv={key:0},yv={class:"space-y-4"},wv={key:0,class:"text-red-400 text-xs mt-1"},_v={key:0,class:"mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-xl text-red-400 text-sm"},kv=["disabled"],Cv={key:1},Sv=["placeholder"],Ev={class:"text-slate-500 text-xs mt-1.5"},$v={class:"flex flex-wrap gap-2 mt-4"},Av=["onClick"],Tv={key:0,class:"mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-xl text-red-400 text-sm"},Mv={class:"flex gap-3 mt-6"},Rv=["disabled"],Ov={key:0,class:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24"},Bv={class:"text-center text-slate-600 text-xs mt-6"},Pv={__name:"Setup",setup(e){Zo();const t=H(1),s=H(""),n=H(""),o=H(""),r=H(!1),l=H(""),c=H("1.0.0"),a=Te(()=>n.value.length>0&&s.value!==n.value),f=H(!1),d=H("/opt/pm2me/apps"),p=H(["/opt/pm2me/apps","/home/apps","/var/pm2me/apps"]);Gt(async()=>{try{const $=await(await fetch("/api/setup/info")).json();f.value=$.isWindows,d.value=$.defaultPath,p.value=$.pathPresets,$.version&&(c.value=$.version)}catch(E){console.error("Failed to fetch server OS info:",E)}});const b=()=>{if(l.value="",!s.value){l.value="Password is required";return}if(a.value){l.value="Passwords do not match";return}o.value=o.value||d.value,t.value=2},y=async()=>{if(!o.value){l.value="Apps path is required";return}r.value=!0,l.value="";try{const E=await fetch("/api/setup/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminPassword:s.value,appsPath:o.value})}),$=await E.json();if(!E.ok){l.value=$.error||"Setup failed";return}window.location.href="/login"}catch(E){l.value=E.message}finally{r.value=!1}};return(E,$)=>(w(),_("div",pv,[i("div",hv,[$[16]||($[16]=rt('<div class="text-center mb-8"><div class="inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-blue-500/20 border border-blue-500/30 mb-4"><svg class="w-8 h-8 text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></div><h1 class="text-3xl font-bold text-white">PM2Me Setup</h1><p class="text-slate-400 mt-1 text-sm">Configure your instance in a few steps</p></div>',1)),i("div",mv,[(w(),_(ve,null,De(2,L=>i("div",{key:L,class:"flex items-center gap-2"},[i("div",{class:oe(["w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all",t.value>L?"bg-emerald-500 text-white":t.value===L?"bg-blue-500 text-white":"bg-slate-700 text-slate-500"])},[t.value>L?(w(),_("svg",gv,[...$[4]||($[4]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):(w(),_("span",vv,j(L),1))],2),L<2?(w(),_("div",{key:0,class:oe(["w-12 h-0.5 rounded",t.value>L?"bg-emerald-500":"bg-slate-700"])},null,2)):X("",!0)])),64))]),i("div",bv,[t.value===1?(w(),_("div",xv,[$[8]||($[8]=i("h2",{class:"text-xl font-semibold text-white mb-1"},"Admin Password",-1)),$[9]||($[9]=i("p",{class:"text-slate-400 text-sm mb-6"},"Set a secure password for your PM2Me admin account.",-1)),i("div",yv,[i("div",null,[$[5]||($[5]=i("label",{class:"block text-xs font-medium text-slate-400 mb-1.5"},"Password",-1)),xe(i("input",{"onUpdate:modelValue":$[0]||($[0]=L=>s.value=L),type:"password",placeholder:"Enter admin password",class:"w-full bg-slate-900/80 border border-slate-600 rounded-xl px-4 py-3 text-sm text-white focus:outline-none focus:border-blue-500 transition-colors",onKeydown:kn(b,["enter"])},null,544),[[Be,s.value]])]),i("div",null,[$[6]||($[6]=i("label",{class:"block text-xs font-medium text-slate-400 mb-1.5"},"Confirm Password",-1)),xe(i("input",{"onUpdate:modelValue":$[1]||($[1]=L=>n.value=L),type:"password",placeholder:"Confirm password",class:"w-full bg-slate-900/80 border border-slate-600 rounded-xl px-4 py-3 text-sm text-white focus:outline-none focus:border-blue-500 transition-colors",onKeydown:kn(b,["enter"])},null,544),[[Be,n.value]]),a.value?(w(),_("p",wv,"Passwords do not match")):X("",!0)])]),l.value?(w(),_("div",_v,j(l.value),1)):X("",!0),i("button",{onClick:b,disabled:!s.value||a.value,class:"mt-6 w-full py-3 rounded-xl font-semibold text-sm bg-blue-600 hover:bg-blue-500 text-white transition-all disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2"},[...$[7]||($[7]=[Y(" Continue ",-1),i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],8,kv)])):X("",!0),t.value===2?(w(),_("div",Cv,[$[14]||($[14]=i("h2",{class:"text-xl font-semibold text-white mb-1"},"Apps Storage Path",-1)),$[15]||($[15]=i("p",{class:"text-slate-400 text-sm mb-6"},"Where should PM2Me store your deployed apps?",-1)),i("div",null,[$[10]||($[10]=i("label",{class:"block text-xs font-medium text-slate-400 mb-1.5"},"Directory Path",-1)),xe(i("input",{"onUpdate:modelValue":$[2]||($[2]=L=>o.value=L),type:"text",placeholder:d.value,class:"w-full bg-slate-900/80 border border-slate-600 rounded-xl px-4 py-3 text-sm text-white font-mono focus:outline-none focus:border-blue-500 transition-colors"},null,8,Sv),[[Be,o.value]]),i("p",Ev,"Directory will be created if it doesn't exist. (Server OS: "+j(f.value?"Windows":"Linux")+")",1)]),i("div",$v,[(w(!0),_(ve,null,De(p.value,L=>(w(),_("button",{key:L,onClick:q=>o.value=L,class:"text-xs px-3 py-1.5 rounded-lg bg-slate-700 hover:bg-slate-600 text-slate-300 font-mono transition-colors"},j(L),9,Av))),128))]),l.value?(w(),_("div",Tv,j(l.value),1)):X("",!0),i("div",Mv,[i("button",{onClick:$[3]||($[3]=L=>t.value=1),class:"px-4 py-3 rounded-xl text-sm text-slate-400 hover:text-white bg-slate-700 hover:bg-slate-600 transition-all"}," Back "),i("button",{onClick:y,disabled:!o.value||r.value,class:"flex-1 py-3 rounded-xl font-semibold text-sm bg-emerald-600 hover:bg-emerald-500 text-white transition-all disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2"},[r.value?(w(),_("svg",Ov,[...$[11]||($[11]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):(w(),_(ve,{key:1},[$[12]||($[12]=i("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),$[13]||($[13]=Y(" Complete Setup ",-1))],64))],8,Rv)])])):X("",!0)]),i("p",Bv,"PM2Me v"+j(c.value),1)])]))}},Nv=[{path:"/setup",name:"Setup",component:Pv},{path:"/login",name:"Login",component:uf},{path:"/",name:"Dashboard",component:U1,meta:{requiresAuth:!0}},{path:"/nginx",name:"Nginx",component:fv,meta:{requiresAuth:!0}},{path:"/settings",name:"Settings",component:lg,meta:{requiresAuth:!0}}],aa=Gd({history:Ed(),routes:Nv});aa.beforeEach(async(e,t,s)=>{let n=!1;try{n=(await(await fetch("/api/setup/status")).json()).needsSetup}catch{n=!1}if(!n&&e.name==="Setup")return s({name:"Login"});if(n&&e.name!=="Setup")return s({name:"Setup"});const o=localStorage.getItem("pm2me_token");if(e.meta.requiresAuth&&!o)return s({name:"Login"});s()});const ca=ju(tf);ca.use(aa);ca.mount("#app");
|