Files
zsglpt/static/app/assets/AccountsPage-D8z2pFq6.js
yuyx a3060e4cd9 feat: Vue SPA 添加 KDocs 在线状态显示 + 清理废弃模板
功能更新:
- AccountsPage.vue: 工具栏显示 KDocs 在线状态(就绪/离线)
- settings.js: 添加 fetchKdocsStatus API 函数
- 每60秒自动刷新状态

代码清理:
- 删除废弃的 legacy 模板文件(约170KB)
  - templates/index.html
  - templates/login.html
  - templates/register.html
  - templates/reset_password.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:31:42 +08:00

2 lines
59 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{f as Jt,b as je,a as Ze,c as Xt,s as Qt,d as Gt,t as jt,e as Zt,g as es,u as ts,h as ss}from"./accounts-DOetW5YJ.js";import{p as ns,_ as rs,n as is,a as L,r as W,q as be,c as M,o as os,m as as,b as P,d as c,h as ee,i as Y,w as h,e as A,s as ls,x as cs,f as T,g as y,t as k,k as w,y as us,F as oe,z as ke,A as hs,E as g,B as te}from"./index-7hTgh8K-.js";async function ds(){const{data:n}=await ns.get("/run_stats");return n}const U=Object.create(null);U.open="0";U.close="1";U.ping="2";U.pong="3";U.message="4";U.upgrade="5";U.noop="6";const ue=Object.create(null);Object.keys(U).forEach(n=>{ue[U[n]]=n});const Se={type:"error",data:"parser error"},ot=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",at=typeof ArrayBuffer=="function",lt=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,Ne=({type:n,data:e},t,s)=>ot&&e instanceof Blob?t?s(e):et(e,s):at&&(e instanceof ArrayBuffer||lt(e))?t?s(e):et(new Blob([e]),s):s(U[n]+(e||"")),et=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function tt(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Ee;function fs(n,e){if(ot&&n.data instanceof Blob)return n.data.arrayBuffer().then(tt).then(e);if(at&&(n.data instanceof ArrayBuffer||lt(n.data)))return e(tt(n.data));Ne(n,!1,t=>{Ee||(Ee=new TextEncoder),e(Ee.encode(t))})}const st="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ne=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<st.length;n++)ne[st.charCodeAt(n)]=n;const ps=n=>{let e=n.length*.75,t=n.length,s,i=0,a,u,d,p;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const x=new ArrayBuffer(e),C=new Uint8Array(x);for(s=0;s<t;s+=4)a=ne[n.charCodeAt(s)],u=ne[n.charCodeAt(s+1)],d=ne[n.charCodeAt(s+2)],p=ne[n.charCodeAt(s+3)],C[i++]=a<<2|u>>4,C[i++]=(u&15)<<4|d>>2,C[i++]=(d&3)<<6|p&63;return x},ms=typeof ArrayBuffer=="function",Ve=(n,e)=>{if(typeof n!="string")return{type:"message",data:ct(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:ys(n.substring(1),e)}:ue[t]?n.length>1?{type:ue[t],data:n.substring(1)}:{type:ue[t]}:Se},ys=(n,e)=>{if(ms){const t=ps(n);return ct(t,e)}else return{base64:!0,data:n}},ct=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},ut="",gs=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((a,u)=>{Ne(a,!1,d=>{s[u]=d,++i===t&&e(s.join(ut))})})},_s=(n,e)=>{const t=n.split(ut),s=[];for(let i=0;i<t.length;i++){const a=Ve(t[i],e);if(s.push(a),a.type==="error")break}return s};function ws(){return new TransformStream({transform(n,e){fs(n,t=>{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,s)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let Ae;function ae(n){return n.reduce((e,t)=>e+t.length,0)}function le(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;i<e;i++)t[i]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function vs(n,e){Ae||(Ae=new TextDecoder);const t=[];let s=0,i=-1,a=!1;return new TransformStream({transform(u,d){for(t.push(u);;){if(s===0){if(ae(t)<1)break;const p=le(t,1);a=(p[0]&128)===128,i=p[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(ae(t)<2)break;const p=le(t,2);i=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),s=3}else if(s===2){if(ae(t)<8)break;const p=le(t,8),x=new DataView(p.buffer,p.byteOffset,p.length),C=x.getUint32(0);if(C>Math.pow(2,21)-1){d.enqueue(Se);break}i=C*Math.pow(2,32)+x.getUint32(4),s=3}else{if(ae(t)<i)break;const p=le(t,i);d.enqueue(Ve(a?p:Ae.decode(p),e)),s=0}if(i===0||i>n){d.enqueue(Se);break}}}})}const ht=4;function v(n){if(n)return bs(n)}function bs(n){for(var e in v.prototype)n[e]=v.prototype[e];return n}v.prototype.on=v.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};v.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};v.prototype.off=v.prototype.removeListener=v.prototype.removeAllListeners=v.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+n],this};v.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};v.prototype.emitReserved=v.prototype.emit;v.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};v.prototype.hasListeners=function(n){return!!this.listeners(n).length};const pe=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),N=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ks="arraybuffer";function dt(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const Es=N.setTimeout,As=N.clearTimeout;function me(n,e){e.useNativeTimers?(n.setTimeoutFn=Es.bind(N),n.clearTimeoutFn=As.bind(N)):(n.setTimeoutFn=N.setTimeout.bind(N),n.clearTimeoutFn=N.clearTimeout.bind(N))}const Ts=1.33;function Ss(n){return typeof n=="string"?xs(n):Math.ceil((n.byteLength||n.size)*Ts)}function xs(n){let e=0,t=0;for(let s=0,i=n.length;s<i;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function ft(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Cs(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Bs(n){let e={},t=n.split("&");for(let s=0,i=t.length;s<i;s++){let a=t[s].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}class Rs extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class Le extends v{constructor(e){super(),this.writable=!1,me(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new Rs(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Ve(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Cs(e);return t.length?"?"+t:""}}class Os extends Le{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};_s(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,gs(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=ft()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let pt=!1;try{pt=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ns=pt;function Vs(){}class Ls extends Os{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class I extends v{constructor(e,t,s){super(),this.createRequest=e,me(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=dt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=I.requestsCount++,I.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Vs,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete I.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}I.requestsCount=0;I.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",nt);else if(typeof addEventListener=="function"){const n="onpagehide"in N?"pagehide":"unload";addEventListener(n,nt,!1)}}function nt(){for(let n in I.requests)I.requests.hasOwnProperty(n)&&I.requests[n].abort()}const Ps=(function(){const n=mt({xdomain:!1});return n&&n.responseType!==null})();class qs extends Ls{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Ps&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new I(mt,this.uri(),e)}}function mt(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Ns))return new XMLHttpRequest}catch{}if(!e)try{return new N[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const yt=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Is extends Le{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=yt?{}:dt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;Ne(s,this.supportsBinary,a=>{try{this.doWrite(s,a)}catch{}i&&pe(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=ft()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Te=N.WebSocket||N.MozWebSocket;class Us extends Is{createSocket(e,t,s){return yt?new Te(e,t,s):t?new Te(e,t):new Te(e)}doWrite(e,t){this.ws.send(t)}}class Ds extends Le{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=vs(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=ws();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const a=()=>{s.read().then(({done:d,value:p})=>{d||(this.onPacket(p),a())}).catch(d=>{})};a();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&pe(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Fs={websocket:Us,webtransport:Ds,polling:qs},Ms=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$s=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xe(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=Ms.exec(n||""),a={},u=14;for(;u--;)a[$s[u]]=i[u]||"";return t!=-1&&s!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=zs(a,a.path),a.queryKey=Ks(a,a.query),a}function zs(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function Ks(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,a){i&&(t[i]=a)}),t}const Ce=typeof addEventListener=="function"&&typeof removeEventListener=="function",he=[];Ce&&addEventListener("offline",()=>{he.forEach(n=>n())},!1);class F extends v{constructor(e,t){if(super(),this.binaryType=ks,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=xe(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=xe(t.host).host);me(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Bs(this.opts.query)),Ce&&(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"})},he.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=ht,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&F.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",F.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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 e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(t+=Ss(i)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,pe(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const a={type:e,data:t,options:s};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(F.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){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(),Ce&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=he.indexOf(this._offlineEventListener);s!==-1&&he.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}F.protocol=ht;class Hs extends F{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;F.priorWebsocketSuccess=!1;const i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",S=>{if(!s)if(S.type==="pong"&&S.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;F.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(C(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const V=new Error("probe error");V.transport=t.name,this.emitReserved("upgradeError",V)}}))};function a(){s||(s=!0,C(),t.close(),t=null)}const u=S=>{const V=new Error("probe error: "+S);V.transport=t.name,a(),this.emitReserved("upgradeError",V)};function d(){u("transport closed")}function p(){u("socket closed")}function x(S){t&&S.name!==t.name&&a()}const C=()=>{t.removeListener("open",i),t.removeListener("error",u),t.removeListener("close",d),this.off("close",p),this.off("upgrading",x)};t.once("open",i),t.once("error",u),t.once("close",d),this.once("close",p),this.once("upgrading",x),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let Ws=class extends Hs{constructor(e,t={}){const s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>Fs[i]).filter(i=>!!i)),super(e,s)}};function Ys(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=xe(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const a=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+a+":"+s.port+e,s.href=s.protocol+"://"+a+(t&&t.port===s.port?"":":"+s.port),s}const Js=typeof ArrayBuffer=="function",Xs=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,gt=Object.prototype.toString,Qs=typeof Blob=="function"||typeof Blob<"u"&&gt.call(Blob)==="[object BlobConstructor]",Gs=typeof File=="function"||typeof File<"u"&&gt.call(File)==="[object FileConstructor]";function Pe(n){return Js&&(n instanceof ArrayBuffer||Xs(n))||Qs&&n instanceof Blob||Gs&&n instanceof File}function de(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(de(n[t]))return!0;return!1}if(Pe(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return de(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&de(n[t]))return!0;return!1}function js(n){const e=[],t=n.data,s=n;return s.data=Be(t,e),s.attachments=e.length,{packet:s,buffers:e}}function Be(n,e){if(!n)return n;if(Pe(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let s=0;s<n.length;s++)t[s]=Be(n[s],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=Be(n[s],e));return t}return n}function Zs(n,e){return n.data=Re(n.data,e),delete n.attachments,n}function Re(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=Re(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=Re(n[t],e));return n}const en=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],tn=5;var m;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(m||(m={}));class sn{constructor(e){this.replacer=e}encode(e){return(e.type===m.EVENT||e.type===m.ACK)&&de(e)?this.encodeAsBinary({type:e.type===m.EVENT?m.BINARY_EVENT:m.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===m.BINARY_EVENT||e.type===m.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=js(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}}function rt(n){return Object.prototype.toString.call(n)==="[object Object]"}class qe extends v{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===m.BINARY_EVENT;s||t.type===m.BINARY_ACK?(t.type=s?m.EVENT:m.ACK,this.reconstructor=new nn(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(Pe(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(m[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===m.BINARY_EVENT||s.type===m.BINARY_ACK){const a=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const u=e.substring(a,t);if(u!=Number(u)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(u)}if(e.charAt(t+1)==="/"){const a=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(a,t)}else s.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const a=t+1;for(;++t;){const u=e.charAt(t);if(u==null||Number(u)!=u){--t;break}if(t===e.length)break}s.id=Number(e.substring(a,t+1))}if(e.charAt(++t)){const a=this.tryParse(e.substr(t));if(qe.isPayloadValid(s.type,a))s.data=a;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case m.CONNECT:return rt(t);case m.DISCONNECT:return t===void 0;case m.CONNECT_ERROR:return typeof t=="string"||rt(t);case m.EVENT:case m.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&en.indexOf(t[0])===-1);case m.ACK:case m.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class nn{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Zs(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const rn=Object.freeze(Object.defineProperty({__proto__:null,Decoder:qe,Encoder:sn,get PacketType(){return m},protocol:tn},Symbol.toStringTag,{value:"Module"}));function q(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const on=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class _t extends v{constructor(e,t,s){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=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[q(e,"open",this.onopen.bind(this)),q(e,"packet",this.onpacket.bind(this)),q(e,"error",this.onerror.bind(this)),q(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,a;if(on.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const u={type:m.EVENT,data:t};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const C=this.ids++,S=t.pop();this._registerAckCallback(C,S),u.id=C}const d=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,p=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!d||(p?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(e,t){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===e&&this.sendBuffer.splice(d,1);t.call(this,new Error("operation has timed out"))},i),u=(...d)=>{this.io.clearTimeoutFn(a),t.apply(this,d)};u.withError=!0,this.acks[e]=u}emitWithAck(e,...t){return new Promise((s,i)=>{const a=(u,d)=>u?i(u):s(d);a.withError=!0,t.push(a),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...a)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...a)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:m.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case m.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 m.EVENT:case m.BINARY_EVENT:this.onevent(e);break;case m.ACK:case m.BINARY_ACK:this.onack(e);break;case m.DISCONNECT:this.ondisconnect();break;case m.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:m.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:m.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}function J(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}J.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};J.prototype.reset=function(){this.attempts=0};J.prototype.setMin=function(n){this.ms=n};J.prototype.setMax=function(n){this.max=n};J.prototype.setJitter=function(n){this.jitter=n};class Oe extends v{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,me(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new J({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||rn;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ws(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=q(t,"open",function(){s.onopen(),e&&e()}),a=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),e?e(d):this.maybeReconnectOnOpen()},u=q(t,"error",a);if(this._timeout!==!1){const d=this._timeout,p=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),t.close()},d);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(i),this.subs.push(u),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(q(e,"ping",this.onping.bind(this)),q(e,"data",this.ondata.bind(this)),q(e,"error",this.onerror.bind(this)),q(e,"close",this.onclose.bind(this)),q(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){pe(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new _t(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const se={};function fe(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=Ys(n,e.path||"/socket.io"),s=t.source,i=t.id,a=t.path,u=se[i]&&a in se[i].nsps,d=e.forceNew||e["force new connection"]||e.multiplex===!1||u;let p;return d?p=new Oe(s,e):(se[i]||(se[i]=new Oe(s,e)),p=se[i]),t.query&&!e.query&&(e.query=t.queryKey),p.socket(t.path,e)}Object.assign(fe,{Manager:Oe,Socket:_t,io:fe,connect:fe});let ce=null;function an(){return ce||(ce=fe({transports:["websocket","polling"],withCredentials:!0}),ce)}const ln={class:"page"},cn={class:"stat-value"},un={class:"stat-value"},hn={class:"stat-value"},dn={class:"stat-value"},fn={class:"stat-value"},pn={class:"stat-value"},mn={class:"stat-suffix app-muted"},yn={class:"upgrade-actions"},gn={class:"panel-head"},_n={class:"panel-actions"},wn={class:"toolbar"},vn={class:"toolbar-left"},bn={class:"app-muted"},kn={class:"toolbar-middle"},En={class:"toolbar-right"},An={key:1,class:"grid"},Tn={class:"card-top"},Sn={class:"card-main"},xn={class:"card-title"},Cn={class:"card-name"},Bn={class:"card-sub app-muted"},Rn={key:0},On={key:1},Nn={key:2},Vn={key:3},Ln={key:0,class:"progress"},Pn={class:"progress-meta app-muted"},qn={class:"card-controls"},In={class:"card-buttons"},it="zsglpt:accounts:enable_screenshot",Un={__name:"AccountsPage",setup(n){const e=is(),t=an(),s=L(!1),i=L(!1),a=W({today_completed:0,today_failed:0,current_running:0,today_items:0,today_attachments:0}),u=W({}),d=L([]),p=W({}),x=L("应读");function C(){try{const o=window.localStorage.getItem(it);if(o==="0"||o==="false")return!1;if(o==="1"||o==="true")return!0}catch{}return!0}const S=L(C());be(S,o=>{try{window.localStorage.setItem(it,o?"1":"0")}catch{}});const V=L(!1),X=L(!1),D=W({enabled:!1,online:!1,message:""}),Ie=L(!1),Q=L(!1),$=L(!1),G=L(!1),B=W({username:"",password:"",remark:""}),b=W({id:"",username:"",password:"",remark:"",originalRemark:""}),Ue=[{label:"应读",value:"应读"},{label:"注册前未读",value:"注册前未读"}],R=M(()=>Object.values(u).sort((o,r)=>String(o.username||"").localeCompare(String(r.username||""),"zh-CN"))),ye=M(()=>R.value.length),wt=M(()=>e.isVip?999:3),De=M(()=>d.value.length),vt=M(()=>ye.value>0&&De.value===ye.value),bt=M(()=>!e.isVip);function j(o){const r=u[o.id]||{};u[o.id]={...r,...o}}function ge(o){const r=Array.isArray(o)?o:[],f=new Set(r.map(_=>String(_?.id||"")));for(const _ of Object.keys(u))f.has(_)||delete u[_];for(const _ of r)j(_)}function kt(){for(const o of R.value)p[o.id]||(p[o.id]="应读")}be(R,kt,{immediate:!0});function Et(o){o?d.value=R.value.map(r=>r.id):d.value=[]}function re(o){return e.isVip?!0:(g.warning(`${o}是VIP专属功能`),G.value=!0,!1)}function At(o){const r=Number(o.total_items||0),f=Number(o.progress_items||0);return r?Math.max(0,Math.min(100,Math.round(f/r*100))):0}function Tt(o=""){const r=String(o);return r.includes("已完成")||r.includes("完成")?"success":r.includes("失败")||r.includes("错误")||r.includes("异常")||r.includes("登录失败")?"danger":r.includes("排队")||r.includes("运行")||r.includes("截图")?"warning":"info"}function ie(o){if(!o?.is_running)return!1;const r=String(o.status||""),f=String(o.detail_status||"");return!(!r||r==="未开始"||!r.includes("运行")||r.includes("截图")||r.includes("等待截图")||f.includes("截图")||f.includes("等待截图")||f.includes("浏览完成")||f.includes("任务完成")||r.includes("已完成"))}async function z(o={}){const r=!!o?.silent;r||(i.value=!0);try{const f=await ds();a.today_completed=Number(f?.today_completed||0),a.today_failed=Number(f?.today_failed||0),a.current_running=Number(f?.current_running||0),a.today_items=Number(f?.today_items||0),a.today_attachments=Number(f?.today_attachments||0)}catch(f){f?.response?.status===401&&(window.location.href="/login")}finally{r||(i.value=!1)}}async function Fe(){s.value=!0;try{const o=await Jt({refresh:!0});ge(o)}catch(o){o?.response?.status===401&&(window.location.href="/login")}finally{s.value=!1}}async function St(){X.value=!0;try{const o=await ls();V.value=Number(o?.kdocs_auto_upload||0)===1}catch{V.value=!1}finally{X.value=!1}}async function Me(){Ie.value=!0;try{const o=await cs();D.enabled=!!o?.enabled,D.online=!!o?.online,D.message=o?.message||""}catch{D.enabled=!1,D.online=!1,D.message=""}finally{Ie.value=!1}}async function xt(o){X.value=!0;try{await hs({kdocs_auto_upload:o?1:0}),g.success(o?"已开启自动上传(测试)":"已关闭自动上传")}catch{V.value=!o}finally{X.value=!1}}async function Ct(o){try{await Qt(o.id,{browse_type:p[o.id]||"应读",enable_screenshot:S.value})}catch(r){const f=r?.response?.data;g.error(f?.error||"启动失败")}}async function Bt(o){try{await Gt(o.id)}catch(r){const f=r?.response?.data;g.error(f?.error||"停止失败")}}async function Rt(o){try{await jt(o.id,{browse_type:p[o.id]||"应读"}),g.success("已提交截图")}catch(r){const f=r?.response?.data;g.error(f?.error||"截图失败")}}async function Ot(o){try{await te.confirm(`确定要删除账号「${o.username}」吗?`,"删除账号",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"})}catch{return}try{const r=await Zt(o.id);r?.success?(delete u[o.id],d.value=d.value.filter(f=>f!==o.id),g.success("已删除"),await z()):g.error(r?.error||"删除失败")}catch(r){const f=r?.response?.data;g.error(f?.error||"删除失败")}}function Nt(){B.username="",B.password="",B.remark="",Q.value=!0}async function Vt(){const o=B.username.trim();if(!o||!B.password.trim()){g.error("用户名和密码不能为空");return}try{await es({username:o,password:B.password,remember:!0,remark:B.remark.trim()}),g.success("添加成功"),Q.value=!1,await z()}catch(r){const f=r?.response?.data;g.error(f?.error||"添加失败")}}function Lt(o){b.id=o.id,b.username=o.username,b.password="",b.remark=String(o.remark||""),b.originalRemark=String(o.remark||""),$.value=!0}async function Pt(){if(!b.id)return;const o=b.password.trim(),r=b.remark.trim();if(!o&&r===b.originalRemark){g.info("没有修改"),$.value=!1;return}try{if(o){const f=await ts(b.id,{password:o,remember:!0});f?.account&&j(f.account)}r!==b.originalRemark&&(await ss(b.id,{remark:r}),j({id:b.id,remark:r})),g.success("已更新"),$.value=!1}catch(f){const _=f?.response?.data;g.error(_?.error||"更新失败")}}async function qt(){if(re("批量操作")){if(d.value.length===0){g.warning("请先选择账号");return}try{const o=await je({account_ids:d.value,browse_type:x.value,enable_screenshot:S.value});g.success(`已启动 ${o?.started_count||0} 个账号`)}catch(o){const r=o?.response?.data;g.error(r?.error||"操作失败")}}}async function It(){if(re("批量操作")){if(d.value.length===0){g.warning("请先选择账号");return}try{const o=await Ze({account_ids:d.value});g.success(`已停止 ${o?.stopped_count||0} 个账号`)}catch(o){const r=o?.response?.data;g.error(r?.error||"操作失败")}}}async function Ut(){if(re("全部启动")){if(R.value.length===0){g.warning("没有账号");return}try{await te.confirm("确定要启动全部账号吗?","全部启动",{confirmButtonText:"启动",cancelButtonText:"取消",type:"warning"})}catch{return}try{const o=await je({account_ids:R.value.map(r=>r.id),browse_type:x.value,enable_screenshot:S.value});g.success(`已启动 ${o?.started_count||0} 个账号`)}catch(o){const r=o?.response?.data;g.error(r?.error||"操作失败")}}}async function Dt(){if(re("全部停止")){if(R.value.length===0){g.warning("没有账号");return}try{await te.confirm("确定要停止全部账号吗?","全部停止",{confirmButtonText:"停止",cancelButtonText:"取消",type:"warning"})}catch{return}try{const o=await Ze({account_ids:R.value.map(r=>r.id)});g.success(`已停止 ${o?.stopped_count||0} 个账号`)}catch(o){const r=o?.response?.data;g.error(r?.error||"操作失败")}}}async function Ft(){if(R.value.length===0){g.warning("没有账号");return}try{await te.confirm("确定要清空所有账号吗?此操作不可恢复!","清空账号",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}),await te.confirm("再次确认:真的要删除所有账号吗?","二次确认",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"})}catch{return}try{const o=await Xt();if(o?.success){ge([]),d.value=[],g.success("已清空所有账号"),await z();return}g.error(o?.error||"操作失败")}catch(o){const r=o?.response?.data;g.error(r?.error||"操作失败")}}function Mt(){const o=_=>{ge(_)},r=_=>{j(_)},f=_=>{_?.account_id&&j({id:_.account_id,detail_status:_.stage||"",total_items:_.total_items,progress_items:_.browsed_items,total_attachments:_.total_attachments,progress_attachments:_.viewed_attachments,elapsed_seconds:_.elapsed_seconds,elapsed_display:_.elapsed_display})};return t.on("accounts_list",o),t.on("account_update",r),t.on("task_progress",f),t.connected||t.connect(),()=>{t.off("accounts_list",o),t.off("account_update",r),t.off("task_progress",f)}}let _e=null,Z=null;const $e=M(()=>R.value.some(o=>!(!o?.is_running||String(o.status||"").includes("排队"))));function ze(){Z&&(window.clearInterval(Z),Z=null)}function $t(){Z||(Z=window.setInterval(()=>z({silent:!0}),1e4))}function Ke(o=null){const r=$e.value;o===!0&&r===!1&&z({silent:!0}).catch(()=>{}),r?$t():ze()}be($e,(o,r)=>{Ke(r)});let we=null;return os(async()=>{e.vipInfo||e.refreshVipInfo().catch(()=>{window.location.href="/login"}),_e=Mt(),await Fe(),await St(),await Me(),await z(),Ke(),we=window.setInterval(()=>Me(),6e4)}),as(()=>{_e&&_e(),ze(),we&&window.clearInterval(we)}),(o,r)=>{const f=A("el-card"),_=A("el-col"),zt=A("el-row"),E=A("el-button"),He=A("el-alert"),We=A("el-checkbox"),Ye=A("el-option"),Je=A("el-select"),Xe=A("el-switch"),Qe=A("el-tag"),Kt=A("el-skeleton"),Ht=A("el-empty"),Wt=A("el-checkbox-group"),Yt=A("el-progress"),K=A("el-input"),H=A("el-form-item"),Ge=A("el-form"),ve=A("el-dialog");return T(),P("div",ln,[c(zt,{gutter:12,class:"stats-row"},{default:h(()=>[c(_,{xs:12,sm:8,md:4},{default:h(()=>[c(f,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[17]||(r[17]=y("div",{class:"stat-label app-muted"},"今日完成",-1)),y("div",cn,k(a.today_completed),1)]),_:1})]),_:1}),c(_,{xs:12,sm:8,md:4},{default:h(()=>[c(f,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[18]||(r[18]=y("div",{class:"stat-label app-muted"},"今日失败",-1)),y("div",un,k(a.today_failed),1)]),_:1})]),_:1}),c(_,{xs:12,sm:8,md:4},{default:h(()=>[c(f,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[19]||(r[19]=y("div",{class:"stat-label app-muted"},"运行中",-1)),y("div",hn,k(a.current_running),1)]),_:1})]),_:1}),c(_,{xs:12,sm:8,md:4},{default:h(()=>[c(f,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[20]||(r[20]=y("div",{class:"stat-label app-muted"},"浏览内容",-1)),y("div",dn,k(a.today_items),1)]),_:1})]),_:1}),c(_,{xs:12,sm:8,md:4},{default:h(()=>[c(f,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[21]||(r[21]=y("div",{class:"stat-label app-muted"},"查看附件",-1)),y("div",fn,k(a.today_attachments),1)]),_:1})]),_:1}),c(_,{xs:12,sm:8,md:4},{default:h(()=>[c(f,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[22]||(r[22]=y("div",{class:"stat-label app-muted"},"账号数",-1)),y("div",pn,[w(k(ye.value),1),y("span",mn,"/ "+k(us(e).isVip?"∞":wt.value),1)])]),_:1})]),_:1})]),_:1}),bt.value?(T(),ee(He,{key:0,type:"info","show-icon":"",closable:!1,class:"upgrade-banner",title:"升级 VIP解锁更多功能无限账号 · 优先排队 · 定时任务 · 批量操作"},{default:h(()=>[y("div",yn,[c(E,{type:"primary",plain:"",onClick:r[0]||(r[0]=l=>G.value=!0)},{default:h(()=>[...r[23]||(r[23]=[w("了解VIP特权",-1)])]),_:1})])]),_:1})):Y("",!0),c(f,{shadow:"never",class:"panel","body-style":{padding:"14px"}},{default:h(()=>[y("div",gn,[r[26]||(r[26]=y("div",{class:"panel-title"},"账号管理",-1)),y("div",_n,[c(E,{loading:s.value,onClick:Fe},{default:h(()=>[...r[24]||(r[24]=[w("刷新",-1)])]),_:1},8,["loading"]),c(E,{type:"primary",onClick:Nt},{default:h(()=>[...r[25]||(r[25]=[w("添加账号",-1)])]),_:1})])]),y("div",wn,[y("div",vn,[c(We,{"model-value":vt.value,onChange:Et},{default:h(()=>[...r[27]||(r[27]=[w("全选",-1)])]),_:1},8,["model-value"]),y("span",bn,"已选 "+k(De.value)+" 个",1)]),y("div",kn,[c(Je,{modelValue:x.value,"onUpdate:modelValue":r[1]||(r[1]=l=>x.value=l),size:"small",style:{width:"120px"}},{default:h(()=>[(T(),P(oe,null,ke(Ue,l=>c(Ye,{key:l.value,label:l.label,value:l.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),c(Xe,{modelValue:S.value,"onUpdate:modelValue":r[2]||(r[2]=l=>S.value=l),"inline-prompt":"","active-text":"截图","inactive-text":"不截图"},null,8,["modelValue"]),c(Xe,{modelValue:V.value,"onUpdate:modelValue":r[3]||(r[3]=l=>V.value=l),disabled:X.value,"inline-prompt":"","active-text":"上传","inactive-text":"不传",onChange:xt},null,8,["modelValue","disabled"]),r[28]||(r[28]=y("span",{class:"app-muted"},"表格(测试)",-1)),D.enabled?(T(),ee(Qe,{key:0,type:D.online?"success":"warning",size:"small",effect:"plain"},{default:h(()=>[w(k(D.online?"✅ 就绪":"⚠️ 离线"),1)]),_:1},8,["type"])):Y("",!0)]),y("div",En,[c(E,{type:"primary",onClick:qt},{default:h(()=>[...r[29]||(r[29]=[w("批量启动",-1)])]),_:1}),c(E,{onClick:It},{default:h(()=>[...r[30]||(r[30]=[w("批量停止",-1)])]),_:1}),c(E,{type:"success",plain:"",onClick:Ut},{default:h(()=>[...r[31]||(r[31]=[w("全部启动",-1)])]),_:1}),c(E,{type:"danger",plain:"",onClick:Dt},{default:h(()=>[...r[32]||(r[32]=[w("全部停止",-1)])]),_:1}),c(E,{type:"danger",text:"",onClick:Ft},{default:h(()=>[...r[33]||(r[33]=[w("清空",-1)])]),_:1})])]),s.value?(T(),ee(Kt,{key:0,rows:5,animated:""})):(T(),P(oe,{key:1},[R.value.length===0?(T(),ee(Ht,{key:0,description:"暂无账号,点击右上角添加"})):(T(),P("div",An,[(T(!0),P(oe,null,ke(R.value,l=>(T(),ee(f,{key:l.id,shadow:"never",class:"account-card","body-style":{padding:"14px"}},{default:h(()=>[y("div",Tn,[c(Wt,{modelValue:d.value,"onUpdate:modelValue":r[4]||(r[4]=O=>d.value=O),class:"card-check"},{default:h(()=>[c(We,{value:l.id},null,8,["value"])]),_:2},1032,["modelValue"]),y("div",Sn,[y("div",xn,[y("span",Cn,k(l.username),1),c(Qe,{size:"small",type:Tt(l.status),effect:"light"},{default:h(()=>[w(k(l.status),1)]),_:2},1032,["type"])]),y("div",Bn,[w(k(l.remark||"—")+" ",1),ie(l)&&l.detail_status?(T(),P("span",Rn," · "+k(l.detail_status),1)):Y("",!0),ie(l)&&l.elapsed_display?(T(),P("span",On," · "+k(l.elapsed_display),1)):Y("",!0),String(l.status||"").includes("排队")&&l.queue_ahead!=null?(T(),P("span",Nn," · 前面 "+k(l.queue_ahead)+" 个 · 运行中 "+k(l.queue_running_total??0)+" 个 ",1)):ie(l)&&(l.queue_pending_total!=null||l.queue_running_total!=null)?(T(),P("span",Vn," · 排队 "+k(l.queue_pending_total??0)+" 个 · 运行中 "+k(l.queue_running_total??0)+" 个 ",1)):Y("",!0)])])]),ie(l)?(T(),P("div",Ln,[c(Yt,{percentage:At(l),"stroke-width":10,"show-text":!1},null,8,["percentage"]),y("div",Pn,[y("span",null,"内容 "+k(l.progress_items||0),1)])])):Y("",!0),y("div",qn,[c(Je,{modelValue:p[l.id],"onUpdate:modelValue":O=>p[l.id]=O,size:"small",style:{width:"130px"}},{default:h(()=>[(T(),P(oe,null,ke(Ue,O=>c(Ye,{key:O.value,label:O.label,value:O.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"]),y("div",In,[c(E,{size:"small",type:"primary",disabled:l.is_running,onClick:O=>Ct(l)},{default:h(()=>[...r[34]||(r[34]=[w("启动",-1)])]),_:1},8,["disabled","onClick"]),c(E,{size:"small",disabled:!l.is_running,onClick:O=>Bt(l)},{default:h(()=>[...r[35]||(r[35]=[w("停止",-1)])]),_:1},8,["disabled","onClick"]),c(E,{size:"small",disabled:l.is_running,onClick:O=>Rt(l)},{default:h(()=>[...r[36]||(r[36]=[w("截图",-1)])]),_:1},8,["disabled","onClick"]),c(E,{size:"small",disabled:l.is_running,onClick:O=>Lt(l)},{default:h(()=>[...r[37]||(r[37]=[w("编辑",-1)])]),_:1},8,["disabled","onClick"]),c(E,{size:"small",type:"danger",text:"",onClick:O=>Ot(l)},{default:h(()=>[...r[38]||(r[38]=[w("删除",-1)])]),_:1},8,["onClick"])])])]),_:2},1024))),128))]))],64))]),_:1}),c(ve,{modelValue:Q.value,"onUpdate:modelValue":r[9]||(r[9]=l=>Q.value=l),title:"添加账号",width:"min(560px, 92vw)"},{footer:h(()=>[c(E,{onClick:r[8]||(r[8]=l=>Q.value=!1)},{default:h(()=>[...r[39]||(r[39]=[w("取消",-1)])]),_:1}),c(E,{type:"primary",onClick:Vt},{default:h(()=>[...r[40]||(r[40]=[w("添加",-1)])]),_:1})]),default:h(()=>[c(Ge,{"label-position":"top"},{default:h(()=>[c(H,{label:"账号"},{default:h(()=>[c(K,{modelValue:B.username,"onUpdate:modelValue":r[5]||(r[5]=l=>B.username=l),placeholder:"请输入账号",autocomplete:"off"},null,8,["modelValue"])]),_:1}),c(H,{label:"密码"},{default:h(()=>[c(K,{modelValue:B.password,"onUpdate:modelValue":r[6]||(r[6]=l=>B.password=l),type:"password","show-password":"",placeholder:"请输入密码",autocomplete:"off"},null,8,["modelValue"])]),_:1}),c(H,{label:"备注可选最多200字"},{default:h(()=>[c(K,{modelValue:B.remark,"onUpdate:modelValue":r[7]||(r[7]=l=>B.remark=l),type:"textarea",rows:3,maxlength:"200","show-word-limit":"",placeholder:"例如:部门/用途"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),c(ve,{modelValue:$.value,"onUpdate:modelValue":r[14]||(r[14]=l=>$.value=l),title:"编辑账号",width:"min(560px, 92vw)"},{footer:h(()=>[c(E,{onClick:r[13]||(r[13]=l=>$.value=!1)},{default:h(()=>[...r[41]||(r[41]=[w("取消",-1)])]),_:1}),c(E,{type:"primary",onClick:Pt},{default:h(()=>[...r[42]||(r[42]=[w("保存",-1)])]),_:1})]),default:h(()=>[c(Ge,{"label-position":"top"},{default:h(()=>[c(H,{label:"账号"},{default:h(()=>[c(K,{modelValue:b.username,"onUpdate:modelValue":r[10]||(r[10]=l=>b.username=l),disabled:""},null,8,["modelValue"])]),_:1}),c(H,{label:"新密码(可选)"},{default:h(()=>[c(K,{modelValue:b.password,"onUpdate:modelValue":r[11]||(r[11]=l=>b.password=l),type:"password","show-password":"",placeholder:"留空表示不修改密码",autocomplete:"off"},null,8,["modelValue"])]),_:1}),c(H,{label:"备注可选最多200字"},{default:h(()=>[c(K,{modelValue:b.remark,"onUpdate:modelValue":r[12]||(r[12]=l=>b.remark=l),type:"textarea",rows:3,maxlength:"200","show-word-limit":"",placeholder:"例如:部门/用途"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),c(ve,{modelValue:G.value,"onUpdate:modelValue":r[16]||(r[16]=l=>G.value=l),title:"VIP 特权",width:"min(560px, 92vw)"},{footer:h(()=>[c(E,{type:"primary",onClick:r[15]||(r[15]=l=>G.value=!1)},{default:h(()=>[...r[43]||(r[43]=[w("我知道了",-1)])]),_:1})]),default:h(()=>[c(He,{type:"info",closable:!1,title:"升级 VIP 后可解锁:无限账号、优先排队、定时任务、批量操作。","show-icon":""}),r[44]||(r[44]=y("div",{class:"vip-body"},[y("div",{class:"vip-tip app-muted"},"升级方式:请通过“反馈”联系管理员开通(与后台一致)。")],-1))]),_:1},8,["modelValue"])])}}},$n=rs(Un,[["__scopeId","data-v-f1b86f5d"]]);export{$n as default};