mulmoclaude 1.13.1 → 1.13.2

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.
Files changed (34) hide show
  1. package/Dockerfile.sandbox +7 -1
  2. package/client/assets/{PluginScopedRoot-CTz9ORJ2.js → PluginScopedRoot-BAcowr3C.js} +1 -1
  3. package/client/assets/index-CikuUgRu.css +2 -0
  4. package/client/assets/{index-CwW71EyQ.js → index-DqCPJNcf.js} +217 -217
  5. package/client/index.html +3 -3
  6. package/package.json +11 -11
  7. package/server/agent/activeTools.ts +5 -2
  8. package/server/agent/backend/claude-code.ts +75 -28
  9. package/server/agent/brokerReadiness.ts +93 -0
  10. package/server/agent/config.ts +82 -9
  11. package/server/agent/index.ts +40 -6
  12. package/server/agent/mcp-server.ts +30 -0
  13. package/server/agent/skillEvents.ts +22 -0
  14. package/server/agent/webPush.ts +94 -18
  15. package/server/api/routes/agent.ts +47 -7
  16. package/server/api/routes/mcpBrokerReady.ts +100 -0
  17. package/server/build/mcp-server.mjs +485 -484
  18. package/server/events/collection-change.ts +18 -8
  19. package/server/index.ts +15 -0
  20. package/server/remoteHost/session.ts +22 -0
  21. package/server/system/docker.ts +91 -15
  22. package/server/system/env.ts +4 -0
  23. package/server/system/logger/config.ts +39 -0
  24. package/server/system/logger/formatters.ts +11 -2
  25. package/server/system/logger/index.ts +1 -0
  26. package/server/system/logger/types.ts +5 -0
  27. package/server/system/sandboxImageInfo.ts +147 -0
  28. package/server/workspace/chat-index/indexer.ts +25 -13
  29. package/server/workspace/memory/migrate.ts +4 -1
  30. package/src/composables/collections/uiHost.ts +69 -3
  31. package/src/config/apiRoutes.ts +9 -0
  32. package/src/config/pubsubChannels.ts +33 -2
  33. package/src/utils/id.ts +2 -2
  34. package/client/assets/index-DV7yd0iv.css +0 -2
@@ -89,7 +89,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
89
89
  less \
90
90
  && rm -rf /var/lib/apt/lists/*
91
91
 
92
- RUN npm install -g @anthropic-ai/claude-code tsx
92
+ # Resolved on the host at build time and recorded as an image label, so "which
93
+ # CLI is in this image" is answerable without running it (#2842). Naming the
94
+ # exact version also invalidates this layer when the CLI moves, which a bare
95
+ # `latest` does not — a rebuild would otherwise reuse a cached CLI. The default
96
+ # keeps a plain `docker build -f Dockerfile.sandbox .` working.
97
+ ARG CLAUDE_CODE_VERSION=latest
98
+ RUN npm install -g @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION} tsx
93
99
 
94
100
  COPY sandbox-entrypoint.sh /sandbox-entrypoint.sh
95
101
  RUN chmod +x /sandbox-entrypoint.sh
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-B0Z9INg1.js";import{Gt as t,K as n,Nr as r,Qt as i,Rt as a,X as o,Y as s,Zn as c,at as l,hr as u,q as d,qt as ee,sr as f,wt as p,zn as m}from"./vue.runtime.esm-bundler-8fuH1yLE.js";import{n as te}from"./vue-i18n-CxV2CLCV.js";import{t as ne}from"./vue-C1LQkVQq.js";function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function re(e){return typeof e==`object`&&!!e}function ie(e){return Array.isArray(e)}function ae(e,t){return h(e)&&typeof e[t]==`string`}function g(e,t){return e instanceof Error?e.message:ae(e,`details`)&&e.details?e.details:ae(e,`message`)&&e.message?e.message:t===void 0?String(e):t}var oe=new Map([[`&`,`&amp;`],[`<`,`&lt;`],[`>`,`&gt;`],[`"`,`&quot;`],[`'`,`&#39;`]]);function se(e){return e.replace(/[&<>"']/g,e=>oe.get(e)??e)}function ce(e,t){return e instanceof Error?e:Error(t??g(e))}function le(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ue(e){return typeof e==`object`&&!!e}function de(e){return typeof e==`string`&&e.trim().length>0}function fe(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function pe(e){return Array.isArray(e)}function me(e,t){return le(e)&&typeof e[t]==`string`}var he=new Map([[`&`,`&amp;`],[`<`,`&lt;`],[`>`,`&gt;`],[`"`,`&quot;`],[`'`,`&#39;`]]);function ge(e){return e.replace(/[&<>"']/g,e=>he.get(e)??e)}m();var _=c(!0),v=c(null);function _e(e){return typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`||me(e,`name`)&&e.name===`AbortError`}var y=null;function ve(e){y=e}function ye(e){if(!e)return``;let t=[];for(let[n,r]of Object.entries(e))r!==void 0&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`);return t.length===0?``:`?${t.join(`&`)}`}function be(e,t){let n={...e.headers??{}};return t&&n[`Content-Type`]===void 0&&(n[`Content-Type`]=`application/json`),y&&n.Authorization===void 0&&(n.Authorization=`Bearer ${y}`),n}async function xe(e){let{status:t}=e;try{let n=await e.clone().json();if(me(n,`error`))return{error:n.error,status:t}}catch{}return{error:e.statusText||`Request failed (${t})`,status:t}}async function b(e,t={}){let n=t.method??`GET`,r=t.body!==void 0,i=`${e}${ye(t.query)}`,a={method:n,headers:be(t,r),...t.signal===void 0?{}:{signal:t.signal}};r&&(a.body=JSON.stringify(t.body));let o;try{o=await fetch(i,a)}catch(e){let t=g(e);return _e(e)||(_.value=!1,v.value=t),{ok:!1,error:t,status:0}}if(_.value||(_.value=!0,v.value=null),!o.ok){let{error:e,status:t}=await xe(o);return{ok:!1,error:e,status:t}}try{return{ok:!0,data:await o.json()}}catch(e){return{ok:!1,error:`Invalid JSON response: ${g(e)}`,status:o.status}}}function Se(e,t,n={}){return b(e,{...n,method:`GET`,query:t})}function Ce(e,t,n={}){return b(e,{...n,method:`POST`,body:t})}function we(e,t,n={}){return b(e,{...n,method:`PUT`,body:t})}function Te(e,t,n={}){return b(e,{...n,method:`DELETE`,body:t})}async function Ee(e,t={}){let n=`${e}${ye(t.query)}`,r={method:t.method??`GET`,headers:be(t,!1),...t.body===void 0?{}:{body:t.body},...t.signal===void 0?{}:{signal:t.signal}};return fetch(n,r)}var x=Object.create(null);x.open=`0`,x.close=`1`,x.ping=`2`,x.pong=`3`,x.message=`4`,x.upgrade=`5`,x.noop=`6`;var S=Object.create(null);Object.keys(x).forEach(e=>{S[x[e]]=e});var C={type:`error`,data:`parser error`},De=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,Oe=typeof ArrayBuffer==`function`,ke=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ae=({type:e,data:t},n,r)=>De&&t instanceof Blob?n?r(t):je(t,r):Oe&&(t instanceof ArrayBuffer||ke(t))?n?r(t):je(new Blob([t]),r):r(x[e]+(t||``)),je=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function Me(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var Ne;function Pe(e,t){if(De&&e.data instanceof Blob)return e.data.arrayBuffer().then(Me).then(t);if(Oe&&(e.data instanceof ArrayBuffer||ke(e.data)))return t(Me(e.data));Ae(e,!1,e=>{Ne||=new TextEncoder,t(Ne.encode(e))})}var Fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,w=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)w[Fe.charCodeAt(e)]=e;var Ie=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=w[e.charCodeAt(r)],o=w[e.charCodeAt(r+1)],s=w[e.charCodeAt(r+2)],c=w[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},Le=typeof ArrayBuffer==`function`,Re=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:Be(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:ze(e.substring(1),t)}:S[n]?e.length>1?{type:S[n],data:e.substring(1)}:{type:S[n]}:C},ze=(e,t)=>Le?Be(Ie(e),t):{base64:!0,data:e},Be=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},Ve=``,He=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{Ae(e,!1,e=>{r[a]=e,++i===n&&t(r.join(Ve))})})},Ue=(e,t)=>{let n=e.split(Ve),r=[];for(let e=0;e<n.length;e++){let i=Re(n[e],t);if(r.push(i),i.type===`error`)break}return r};function We(){return new TransformStream({transform(e,t){Pe(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var Ge;function T(e){return e.reduce((e,t)=>e+t.length,0)}function E(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Ke(e,t){Ge||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(T(n)<1)break;let e=E(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(T(n)<2)break;let e=E(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(T(n)<8)break;let e=E(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(C);break}i=a*2**32+t.getUint32(4),r=3}else{if(T(n)<i)break;let e=E(n,i);s.enqueue(Re(a?e:Ge.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(C);break}}}})}function D(e){if(e)return qe(e)}function qe(e){for(var t in D.prototype)e[t]=D.prototype[t];return e}D.prototype.on=D.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},D.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},D.prototype.off=D.prototype.removeListener=D.prototype.removeAllListeners=D.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},D.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},D.prototype.emitReserved=D.prototype.emit,D.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},D.prototype.hasListeners=function(e){return!!this.listeners(e).length};var O=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),k=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),Je=`arraybuffer`;function Ye(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var Xe=k.setTimeout,Ze=k.clearTimeout;function A(e,t){t.useNativeTimers?(e.setTimeoutFn=Xe.bind(k),e.clearTimeoutFn=Ze.bind(k)):(e.setTimeoutFn=k.setTimeout.bind(k),e.clearTimeoutFn=k.clearTimeout.bind(k))}var Qe=1.33;function $e(e){return typeof e==`string`?et(e):Math.ceil((e.byteLength||e.size)*Qe)}function et(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function tt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function nt(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function rt(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var it=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},j=class extends D{constructor(e){super(),this.writable=!1,A(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new it(e,t,n)),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){let t=Re(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(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_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(e){let t=nt(e);return t.length?`?`+t:``}},at=class extends j{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){Ue(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,He(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=tt()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},ot=!1;try{ot=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var st=ot;function ct(){}var lt=class extends at{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},M=class e extends D{constructor(e,t,n){super(),this.createRequest=e,A(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=Ye(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(this._xhr!==void 0&&this._xhr!==null){if(this._xhr.onreadystatechange=ct,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(M.requestsCount=0,M.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,ut);else if(typeof addEventListener==`function`){let e=`onpagehide`in k?`pagehide`:`unload`;addEventListener(e,ut,!1)}}function ut(){for(let e in M.requests)M.requests.hasOwnProperty(e)&&M.requests[e].abort()}var dt=(function(){let e=pt({xdomain:!1});return e&&e.responseType!==null})(),ft=class extends lt{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=dt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new M(pt,this.uri(),e)}};function pt(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||st))return new XMLHttpRequest}catch{}if(!t)try{return new k[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var mt=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,ht=class extends j{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=mt?{}:Ye(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(e,t,n)}catch(e){return this.emitReserved(`error`,e)}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++){let n=e[t],r=t===e.length-1;Ae(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&O(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=tt()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},N=k.WebSocket||k.MozWebSocket,gt={websocket:class extends ht{createSocket(e,t,n){return mt?new N(e,t,n):t?new N(e,t):new N(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends j{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=>{let t=Ke(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=We();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&O(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:ft},_t=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vt=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function P(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=_t.exec(e||``),a={},o=14;for(;o--;)a[vt[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,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=yt(a,a.path),a.queryKey=bt(a,a.query),a}function yt(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function bt(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var F=typeof addEventListener==`function`&&typeof removeEventListener==`function`,I=[];F&&addEventListener(`offline`,()=>{I.forEach(e=>e())},!1);var L=class e extends D{constructor(e,t){if(super(),this.binaryType=Je,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){let n=P(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=P(t.host).host);A(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,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(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),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=rt(this.opts.query)),F&&(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`})},I.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=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](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}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`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.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`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data)}}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);let 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){let 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 e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=$e(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,O(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{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?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.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(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(),F&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=I.indexOf(this._offlineEventListener);e!==-1&&I.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};L.protocol=4;var xt=class extends L{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),n=!1;L.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;L.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},St=class extends xt{constructor(e,t={}){let n=typeof e==`object`,r=n?{...e}:{...t};(!r.transports||r.transports&&typeof r.transports[0]==`string`)&&(r.transports=(r.transports||[`polling`,`websocket`,`webtransport`]).map(e=>gt[e]).filter(e=>!!e)),super(n?r:e,r)}};St.protocol;function Ct(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=P(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var wt=typeof ArrayBuffer==`function`,Tt=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Et=Object.prototype.toString,Dt=typeof Blob==`function`||typeof Blob<`u`&&Et.call(Blob)===`[object BlobConstructor]`,Ot=typeof File==`function`||typeof File<`u`&&Et.call(File)===`[object FileConstructor]`;function R(e){return wt&&(e instanceof ArrayBuffer||Tt(e))||Dt&&e instanceof Blob||Ot&&e instanceof File}function z(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(z(e[t]))return!0;return!1}if(R(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return z(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&z(e[t]))return!0;return!1}function kt(e){let t=[],n=e.data,r=e;return r.data=B(n,t),r.attachments=t.length,{packet:r,buffers:t}}function B(e,t,n){if(!e)return e;if(R(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=B(e[r],t);return n}if(typeof e==`object`&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON==`function`&&!n)return B(e.toJSON(),t,!0);let r={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=B(e[n],t));return r}return e}function At(e,t){return e.data=V(e.data,t),delete e.attachments,e}function V(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 Error(`illegal attachments`)}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=V(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=V(e[n],t));return e}var jt=e({Decoder:()=>Pt,Encoder:()=>Nt,PacketType:()=>H,isPacketValid:()=>Bt,protocol:()=>5}),Mt=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],H;(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`})(H||={});var Nt=class{constructor(e){this.replacer=e}encode(e){return(e.type===H.EVENT||e.type===H.ACK)&&z(e)?this.encodeAsBinary({type:e.type===H.EVENT?H.BINARY_EVENT:H.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===H.BINARY_EVENT||e.type===H.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){let t=kt(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Pt=class e extends D{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===H.BINARY_EVENT;n||t.type===H.BINARY_ACK?(t.type=n?H.EVENT:H.ACK,this.reconstructor=new Ft(t)):super.emitReserved(`decoded`,t)}else if(R(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(H[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===H.BINARY_EVENT||r.type===H.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!Lt(a)||a<1)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&t.charAt(n)!==`,`&&n!==t.length;);r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case H.CONNECT:return U(t);case H.DISCONNECT:return t===void 0;case H.CONNECT_ERROR:return typeof t==`string`||U(t);case H.EVENT:case H.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&Mt.indexOf(t[0])===-1);case H.ACK:case H.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},Ft=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=At(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function It(e){return typeof e==`string`}var Lt=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function Rt(e){return e===void 0||Lt(e)}function U(e){return Object.prototype.toString.call(e)===`[object Object]`}function zt(e,t){switch(e){case H.CONNECT:return t===void 0||U(t);case H.DISCONNECT:return t===void 0;case H.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&Mt.indexOf(t[0])===-1);case H.ACK:return Array.isArray(t);case H.CONNECT_ERROR:return typeof t==`string`||U(t);default:return!1}}function Bt(e){return It(e.nsp)&&Rt(e.id)&&zt(e.type,e.data)}function W(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var Vt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Ht=class extends D{constructor(e,t,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=e,this.nsp=t,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;let e=this.io;this.subs=[W(e,`open`,this.onopen.bind(this)),W(e,`packet`,this.onpacket.bind(this)),W(e,`error`,this.onerror.bind(this)),W(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){if(Vt.hasOwnProperty(e))throw 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;let n={type:H.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let 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:H.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(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case H.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,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 H.EVENT:case H.BINARY_EVENT:this.onevent(e);break;case H.ACK:case H.BINARY_ACK:this.onack(e);break;case H.DISCONNECT:this.ondisconnect();break;case H.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t)}}onevent(e){let 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){let t=this._anyListeners.slice();for(let n of t)n.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){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:H.ACK,id:e,data:r}))}}onack(e){let 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._drainQueue(!0),this.emitReserved(`connect`)}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()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:H.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){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,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){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function G(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}G.prototype.duration=function(){var e=this.ms*this.factor**+this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},G.prototype.reset=function(){this.attempts=0},G.prototype.setMin=function(e){this.ms=e},G.prototype.setMax=function(e){this.max=e},G.prototype.setJitter=function(e){this.jitter=e};var K=class extends D{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,A(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(t.randomizationFactor??.5),this.backoff=new G({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||jt;this.encoder=new n.Encoder,this.decoder=new n.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.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||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 St(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=W(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=W(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(W(e,`ping`,this.onping.bind(this)),W(e,`data`,this.ondata.bind(this)),W(e,`error`,this.onerror.bind(this)),W(e,`close`,this.onclose.bind(this)),W(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){O(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ht(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],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 n;this.cleanup(),(n=this.engine)==null||n.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;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},q={};function J(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=Ct(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=q[i]&&a in q[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new K(r,t):(q[i]||(q[i]=new K(r,t)),c=q[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(J,{Manager:K,Socket:Ht,io:J,connect:J});var Y=null,X=new Map,Ut=new Set,Wt=!1;function Gt(e){for(let t of X.keys())e.emit(`subscribe`,t)}function Kt(){for(let e of Ut)try{e()}catch(e){console.error(`[usePubSub] reconnect handler threw:`,e)}}function qt(){if(Y)return Y;let e=J({path:`/ws/pubsub`,transports:[`websocket`]});return e.on(`connect`,()=>{Gt(e),Wt?Kt():Wt=!0}),e.on(`data`,e=>{let t=X.get(e.channel);if(t)for(let n of t)n(e.data)}),Y=e,e}function Jt(){X.size>0||Y&&(Y.disconnect(),Y=null,Wt=!1)}function Yt(){function e(e,t){let n=X.get(e);n||(n=new Set,X.set(e,n)),n.add(t);let r=qt();return r.connected&&r.emit(`subscribe`,e),()=>{let n=X.get(e);n&&(n.delete(t),n.size===0&&(X.delete(e),Y?.connected&&Y.emit(`unsubscribe`,e)),Jt())}}function t(e){return Ut.add(e),()=>{Ut.delete(e)}}return{subscribe:e,onReconnect:t}}function Z(e){return e}function Xt(e,t){return t?e.url.replace(/:(\w+)/g,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?encodeURIComponent(String(t[n])):e):e.url}var Zt={openBook:`openBook`,getBooks:`getBooks`,createBook:`createBook`,updateBook:`updateBook`,deleteBook:`deleteBook`,getAccounts:`getAccounts`,upsertAccount:`upsertAccount`,addEntries:`addEntries`,voidEntry:`voidEntry`,getJournalEntries:`getJournalEntries`,getOpeningBalances:`getOpeningBalances`,setOpeningBalances:`setOpeningBalances`,getReport:`getReport`,getTimeSeries:`getTimeSeries`,rebuildSnapshots:`rebuildSnapshots`},Qt={dispatch:{path:`/api/accounting`,method:`POST`}},$t=`project`,en=[`asset`,`liability`,`equity`,`income`,`expense`];function tn(e,t){return t?`accounting:${t}:${e}`:`accounting:${e}`}var nn=`accounting:books`;function rn(e){return e?`accounting:${e}:#books`:nn}var an={journal:`journal`,opening:`opening`,accounts:`accounts`,snapshotsRebuilding:`snapshots-rebuilding`,snapshotsReady:`snapshots-ready`};function on(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function sn(e){return Array.isArray(e)}function cn(e,t){return on(e)&&typeof e[t]==`string`}function ln(e,t){return e instanceof Error?e.message:cn(e,`details`)&&e.details?e.details:cn(e,`message`)&&e.message?e.message:t===void 0?String(e):t}var un={accounting:`data/accounting`,accountingBooks:`data/accounting/books`},dn=[1,2,3,4,5,6,7,8,9,10,11,12],fn=new Map([[`Q1`,3],[`Q2`,6],[`Q3`,9],[`Q4`,12]]);function pn(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1&&e<=12}function mn(e){return pn(e)?e:(typeof e==`string`?fn.get(e):void 0)??12}function hn(e){return mn(e)}function gn(e,t){let n=new Date(Date.UTC(2001,e,0));try{return new Intl.DateTimeFormat(t,{month:`long`,day:`numeric`,timeZone:`UTC`}).format(n)}catch{return String(e)}}function _n(e){return String(e).padStart(2,`0`)}function vn(e,t){return new Date(e,t+1,0).getDate()}function yn(e,t,n){return`${e}-${_n(t)}-${_n(n)}`}function bn(e,t){let n=hn(e),r=(t.getMonth()+1-n-1+12)%12;return Math.floor(r/3)}function xn(e,t,n){let r=hn(e),i=t.getMonth()+1,a=t.getFullYear(),o=r%12+1,s=i>=o?a:a-1,c=o+n*3;return{year:s+Math.floor((c-1)/12),month:(c-1)%12+1}}function Q(e,t,n){let r=xn(e,t,n),i=r.month-1+2,a=r.year+Math.floor(i/12),o=i%12+1,s=vn(a,o-1);return{from:yn(r.year,r.month,1),to:yn(a,o,s)}}function Sn(e,t=new Date){return Q(e,t,bn(e,t))}function Cn(e,t=new Date){let n=bn(e,t);return n>0?Q(e,t,n-1):Q(e,new Date(t.getFullYear(),t.getMonth()-3,1),3)}function wn(e,t=new Date){let n=Q(e,t,0),r=Q(e,t,3);return{from:n.from,to:r.to}}function Tn(e,t=new Date){return wn(e,new Date(t.getFullYear()-1,t.getMonth(),t.getDate()))}var En=`US.JP.GB.CA.AU.NZ.DE.FR.IT.ES.NL.BE.AT.IE.PT.FI.SE.DK.PL.CH.NO.CN.KR.TW.HK.SG.IN.BR.MX`.split(`.`);function Dn(e,t){try{return new Intl.DisplayNames([t],{type:`region`}).of(e)??e}catch{return e}}function On(e){return En.some(t=>t===e)}var kn={warnMissingTaxRegistrationId:new Set([`JP`,`GB`,`DE`,`FR`,`IT`,`ES`,`NL`,`BE`,`AT`,`IE`,`PT`,`FI`,`SE`,`DK`,`PL`,`IN`,`AU`,`NZ`,`CA`])};function An(e,t){return t?kn[e].has(t):!1}var jn=[`USD`,`EUR`,`JPY`,`GBP`,`CNY`,`KRW`,`TWD`,`HKD`,`SGD`,`AUD`,`CAD`,`CHF`,`INR`,`BRL`,`MXN`],Mn=2;function Nn(e,t){try{return new Intl.DisplayNames([t],{type:`currency`}).of(e)??e}catch{return e}}function Pn(e){try{return new Intl.NumberFormat(`en`,{style:`currency`,currency:e}).resolvedOptions().maximumFractionDigits??Mn}catch{return Mn}}function Fn(e){let t=Pn(e);return t===0?`1`:(1/10**t).toFixed(t)}function In(e,t,n){try{return new Intl.NumberFormat(n,{style:`currency`,currency:t}).format(e)}catch{return e.toFixed(Pn(t))}}function Ln(e,t=2,n){return e.toLocaleString(n,{minimumFractionDigits:t,maximumFractionDigits:t})}function $(e){return String(e).padStart(2,`0`)}function Rn(e=new Date){return`${e.getFullYear()}-${$(e.getMonth()+1)}-${$(e.getDate())}`}function zn(e=new Date){return`${e.getFullYear()}-${$(e.getMonth()+1)}`}function Bn(e=new Date){let t=new Date(e.getFullYear(),e.getMonth()-1,1);return`${t.getFullYear()}-${$(t.getMonth()+1)}`}function Vn(e=new Date){let t=Math.floor(e.getMonth()/3)*3,n=new Date(e.getFullYear(),t-1,1);return`${n.getFullYear()}-${$(n.getMonth()+1)}`}function Hn(e=new Date){return`${e.getFullYear()-1}-12`}var Un=[`revenue`,`expense`,`netIncome`,`accountBalance`],Wn=[`month`,`quarter`,`year`],Gn=Z({toolName:`manageAccounting`,apiNamespace:`accounting`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,workspaceDirs:{accounting:un.accounting,accountingBooks:un.accountingBooks},staticChannels:{accountingBooks:`accounting:books`}}),Kn=Z({toolName:`openCanvas`,apiNamespace:`canvas`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),qn=Z({toolName:`presentChart`,apiNamespace:`chart`,apiRoutes:{create:{method:`POST`,path:``}},mcpDispatch:`create`}),Jn=Z({toolName:`editImages`}),Yn=Z({toolName:`generateImage`}),Xn=Z({toolName:`manageSkills`,apiNamespace:`skills`,apiRoutes:{list:{method:`GET`,path:``},detail:{method:`GET`,path:`/:name`},create:{method:`POST`,path:``},update:{method:`PUT`,path:`/:name`},remove:{method:`DELETE`,path:`/:name`},catalogList:{method:`GET`,path:`/catalog`},catalogStar:{method:`POST`,path:`/catalog/star`},catalogPreview:{method:`GET`,path:`/catalog/preview`},externalSuggestions:{method:`GET`,path:`/external/suggestions`},externalReposList:{method:`GET`,path:`/external/repos`},externalReposInstall:{method:`POST`,path:`/external/repos`},externalReposRemove:{method:`DELETE`,path:`/external/repos/:repoId`}},mcpDispatch:`create`}),Zn=Z({toolName:`presentDocument`,apiNamespace:`markdown`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),Qn=Z({toolName:`managePhotoLocations`,apiNamespace:`photoLocations`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,staticChannels:{locationsChanged:`photoLocations:locations-changed`}}),$n=Z({toolName:`presentCollection`,apiNamespace:`presentCollection`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),er=Z({toolName:`presentForm`,apiNamespace:`form`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),tr=Z({toolName:`presentHtml`,apiNamespace:`html`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),nr=Z({toolName:`presentMulmoScript`,apiNamespace:`mulmoScript`,apiRoutes:{save:{method:`POST`,path:`/save`},updateBeat:{method:`POST`,path:`/update-beat`},updateScript:{method:`POST`,path:`/update-script`},beatImage:{method:`GET`,path:`/beat-image`},beatAudio:{method:`GET`,path:`/beat-audio`},beatMovie:{method:`GET`,path:`/beat-movie`},generateBeatAudio:{method:`POST`,path:`/generate-beat-audio`},renderBeat:{method:`POST`,path:`/render-beat`},uploadBeatImage:{method:`POST`,path:`/upload-beat-image`},characterImage:{method:`GET`,path:`/character-image`},renderCharacter:{method:`POST`,path:`/render-character`},uploadCharacterImage:{method:`POST`,path:`/upload-character-image`},movieStatus:{method:`GET`,path:`/movie-status`},generateMovie:{method:`POST`,path:`/generate-movie`},downloadMovie:{method:`GET`,path:`/download-movie`},pdfStatus:{method:`GET`,path:`/pdf-status`},generatePdf:{method:`POST`,path:`/generate-pdf`},downloadPdf:{method:`GET`,path:`/download-pdf`}},mcpDispatch:`save`,requires:[`ffmpeg`]}),rr=Z({toolName:`presentSVG`,apiNamespace:`svg`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),ir=Z({toolName:`manageAutomations`,apiNamespace:`scheduler`,apiRoutes:{list:{method:`GET`,path:``},dispatch:{method:`POST`,path:``},tasksList:{method:`GET`,path:`/tasks`},tasksCreate:{method:`POST`,path:`/tasks`},taskUpdate:{method:`PUT`,path:`/tasks/:id`},taskDelete:{method:`DELETE`,path:`/tasks/:id`},taskRun:{method:`POST`,path:`/tasks/:id/run`},logs:{method:`GET`,path:`/logs`}},mcpDispatch:`dispatch`}),ar=Z({toolName:`presentSpreadsheet`,apiNamespace:`spreadsheet`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),or=[Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,Z({toolName:`manageWiki`})],sr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function cr(e,t){return sr(e,t)?e[t]??``:``}function lr(e,t,n){let r=Object.create(null),i=Object.create(null),a=[];for(let o of e){let e=t(o);if(e)for(let[t,s]of Object.entries(e)){if(sr(i,t)){let e=i[t]??``;a.push({dimension:n,key:t,plugins:[e,o.toolName]});continue}r[t]=s,i[t]=o.toolName}}return{aggregate:{...r},owner:{...i},collisions:a}}function ur(e,t,n,r){let i=Object.create(null),a=[];for(let[o,s]of Object.entries(n)){if(t.has(o)){a.push({label:e,key:o,plugin:cr(r,o)});continue}i[o]=s}return{cleaned:{...i},dropped:a}}function dr(e,t){let{aggregate:n,owner:r,collisions:i}=lr(e,t.extract,t.dimension),a=new Set(Object.keys(t.hostRecord));if(t.additionalReservedKeys)for(let e of t.additionalReservedKeys)a.add(e);let{cleaned:o,dropped:s}=ur(t.label,a,n,r),c=o;return{merged:{...t.hostRecord,...c},hostCollisions:s,intraCollisions:i}}var fr={message:`/api/transports/:transportId/chats/:externalChatId`,connect:`/api/transports/:transportId/chats/:externalChatId/connect`};function pr(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]={method:i.method,url:`/api/${e}${i.path}`};return n}var mr=dr(or,{label:`API_ROUTES`,hostRecord:{health:`/api/health`,sandbox:`/api/sandbox`,diagnosticsReport:`/api/diagnostics/report`,shortcuts:`/api/shortcuts`,dashboard:`/api/dashboard`,agent:{run:`/api/agent`,cancel:`/api/agent/cancel`,internal:{toolResult:`/api/internal/tool-result`}},chatIndex:{rebuild:`/api/chat-index/rebuild`},chatService:fr,shutdown:`/api/shutdown`,config:{base:`/api/config`,settings:`/api/config/settings`,mcp:`/api/config/mcp`,workspaceDirs:`/api/config/workspace-dirs`,referenceDirs:`/api/config/reference-dirs`,schedulerOverrides:`/api/config/scheduler-overrides`,refresh:`/api/config/refresh`,connectors:`/api/config/connectors`},files:{tree:`/api/files/tree`,dir:`/api/files/dir`,content:`/api/files/content`,create:`/api/files/create`,upload:`/api/files/upload`,raw:`/api/files/raw`,refRoots:`/api/files/ref-roots`,open:`/api/files/open`,reveal:`/api/files/reveal`},image:{generate:`/api/generate-image`,edit:`/api/edit-image`,upload:`/api/images`,update:`/api/images/update`},attachments:{upload:`/api/attachments`},share:{pack:`/api/share/pack`,packMarkdown:`/api/share/pack-markdown`},remoteHost:{connect:`/api/remote-host/connect`,reconnect:`/api/remote-host/reconnect`,disconnect:`/api/remote-host/disconnect`,status:`/api/remote-host/status`},google:{status:`/api/google/status`,authorize:`/api/google/authorize`,unlink:`/api/google/unlink`},mcpTools:{list:`/api/mcp-tools`,invoke:`/api/mcp-tools/:tool`},notifier:{dispatch:`/api/notifier`},journal:{latestDaily:`/api/journal/latest-daily`},pdf:{markdown:`/api/pdf/markdown`},translation:{translate:`/api/translation`},transcribe:{run:`/api/transcribe`,model:`/api/transcribe/model`,modelDownload:`/api/transcribe/model/download`},plugins:{mindmap:`/api/mindmap`,quiz:`/api/quiz`,present3d:`/api/present3d`,googleMap:`/api/google-map`,runtimeList:`/api/plugins/runtime/list`,runtimeDispatch:`/api/plugins/runtime/:pkg/dispatch`,runtimeOauthCallback:`/api/plugins/runtime/oauth-callback/:alias`,diagnostics:`/api/plugins/diagnostics`,runtimeAsset:`/api/plugins/runtime/:pkg/:version/{*splat}`},roles:{list:`/api/roles`,manage:`/api/roles/manage`},marpThemes:{list:`/api/marp-themes`},collections:{list:`/api/collections`,ontology:`/api/collections/ontology`,detail:`/api/collections/:slug`,items:`/api/collections/:slug/items`,item:`/api/collections/:slug/items/:itemId`,itemAction:`/api/collections/:slug/items/:itemId/actions/:actionId`,collectionAction:`/api/collections/:slug/actions/:actionId`,refresh:`/api/collections/:slug/refresh`,calendarPush:`/api/collections/:slug/calendar-push`,viewFile:`/api/collections/:slug/view-file`,remoteView:`/api/collections/:slug/remote-view`,remoteViewMutate:`/api/collections/:slug/remote-view/:viewId/mutate`,remoteViewItems:`/api/collections/:slug/remote-view/:viewId/items`,viewI18n:`/api/collections/:slug/view-i18n`,viewToken:`/api/collections/:slug/view-token`,viewData:`/api/collections/:slug/view-data`,viewDataAction:`/api/collections/:slug/view-data/actions/:actionId`,viewDataQuery:`/api/collections/:slug/view-data/query`,viewDataImage:`/api/collections/:slug/view-data/image`,viewDelete:`/api/collections/:slug/views/:viewId`},collectionsRegistry:{list:`/api/collections-registry`,preview:`/api/collections-registry/preview`,import:`/api/collections-registry/import`,export:`/api/collections-registry/export`},sessions:{list:`/api/sessions`,detail:`/api/sessions/:id`,markRead:`/api/sessions/:id/mark-read`,bookmark:`/api/sessions/:id/bookmark`},feeds:{list:`/api/feeds`,detail:`/api/feeds/:slug`},hooks:{log:`/api/hooks/log`},wiki:{base:`/api/wiki`,pageHistory:`/api/wiki/pages/:slug/history`,pageHistorySnapshot:`/api/wiki/pages/:slug/history/:stamp`,pageHistoryRestore:`/api/wiki/pages/:slug/history/:stamp/restore`,internalSnapshot:`/api/wiki/internal/snapshot`}},extract:e=>{if(e.apiRoutes===void 0)return;let t=e.apiNamespace??e.toolName;return{[t]:pr(t,e.apiRoutes)}},dimension:`apiNamespace`});mr.hostCollisions,mr.intraCollisions;var hr=mr.merged,gr={common:{downloadZip:`ZIP`,downloadFailed:`Download failed`,save:`Save`,cancel:`Cancel`,loading:`Loading...`,close:`Close`,dismiss:`Dismiss`,add:`Add`,remove:`Remove`,yes:`Yes`,no:`No`,saving:`Saving...`,saved:`Saved`,noResultsYet:`No results yet`,noImageYet:`No image yet`,sendChat:`Start a new chat`},sessionTabBar:{newSession:`New session`,activeSessions:`{count} active session (agent running) | {count} active sessions (agent running)`,unreadReplies:`{count} unread reply | {count} unread replies`,unreadDot:`New reply`,origin:{scheduler:`Started by scheduler`,skill:`Started by skill`,bridge:`Started by bridge`}},chatInput:{placeholder:`Message Claude…`,send:`Send`,stop:`Stop`,runningPlaceholder:`Running… press Enter to queue for later`,removeBuffered:`Remove queued message`,attachFile:`Attach file`,fileTooLarge:`File too large ({sizeMB} MB). Maximum is 30 MB.`,unsupportedFileType:`File type not supported. Accepted: images, PDF, DOCX, XLSX, PPTX, text files.`,attachImageFailed:`Failed to attach image: {error}`,stopFailed:`Failed to stop the run: {error}`,dropHint:`Drop file to attach`,tooManyFiles:`You can attach up to {max} files at once.`,removeAttachment:`Remove {name}`,attachmentFallbackName:`attachment`,voice:{start:`Start voice input`,stop:`Stop voice input`}},cspViolation:{notice:`⚠ A view tried to load {host}, but the content security policy blocked it ({directive}). To allow it, add the host to config/csp.json — only if you trust it.`,dismiss:`Dismiss`},sessionHistoryPanel:{filters:{all:`All`,unread:`Unread`,bookmarked:`Bookmarked`,longRunning:`Long-running (24h+)`,human:`Human`,scheduler:`Scheduler`,skill:`Skill`,bridge:`Bridge`},failedToRefresh:`⚠ Failed to refresh: {error}`,showingLastKnown:` — showing last known list.`,noSessions:`No sessions yet.`,noMatching:`No matching sessions.`,running:`Running`,noMessages:`(no messages)`,openRowAria:`Open session: {preview}`,rowMenuAria:`Session actions`,bookmark:`Bookmark`,unbookmark:`Remove bookmark`,delete:`Delete`,deleteConfirm:`Delete this session?
1
+ import{r as e}from"./rolldown-runtime-B0Z9INg1.js";import{Gt as t,K as n,Nr as r,Qt as i,Rt as a,X as o,Y as s,Zn as c,at as l,hr as u,q as d,qt as ee,sr as f,wt as p,zn as m}from"./vue.runtime.esm-bundler-8fuH1yLE.js";import{n as te}from"./vue-i18n-CxV2CLCV.js";import{t as ne}from"./vue-C1LQkVQq.js";function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function re(e){return typeof e==`object`&&!!e}function ie(e){return Array.isArray(e)}function ae(e,t){return h(e)&&typeof e[t]==`string`}function g(e,t){return e instanceof Error?e.message:ae(e,`details`)&&e.details?e.details:ae(e,`message`)&&e.message?e.message:t===void 0?String(e):t}var oe=new Map([[`&`,`&amp;`],[`<`,`&lt;`],[`>`,`&gt;`],[`"`,`&quot;`],[`'`,`&#39;`]]);function se(e){return e.replace(/[&<>"']/g,e=>oe.get(e)??e)}function ce(e,t){return e instanceof Error?e:Error(t??g(e))}function le(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ue(e){return typeof e==`object`&&!!e}function de(e){return typeof e==`string`&&e.trim().length>0}function fe(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function pe(e){return Array.isArray(e)}function me(e,t){return le(e)&&typeof e[t]==`string`}var he=new Map([[`&`,`&amp;`],[`<`,`&lt;`],[`>`,`&gt;`],[`"`,`&quot;`],[`'`,`&#39;`]]);function ge(e){return e.replace(/[&<>"']/g,e=>he.get(e)??e)}m();var _=c(!0),v=c(null);function _e(e){return typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`||me(e,`name`)&&e.name===`AbortError`}var y=null;function ve(e){y=e}function ye(e){if(!e)return``;let t=[];for(let[n,r]of Object.entries(e))r!==void 0&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`);return t.length===0?``:`?${t.join(`&`)}`}function be(e,t){let n={...e.headers??{}};return t&&n[`Content-Type`]===void 0&&(n[`Content-Type`]=`application/json`),y&&n.Authorization===void 0&&(n.Authorization=`Bearer ${y}`),n}async function xe(e){let{status:t}=e;try{let n=await e.clone().json();if(me(n,`error`))return{error:n.error,status:t}}catch{}return{error:e.statusText||`Request failed (${t})`,status:t}}async function b(e,t={}){let n=t.method??`GET`,r=t.body!==void 0,i=`${e}${ye(t.query)}`,a={method:n,headers:be(t,r),...t.signal===void 0?{}:{signal:t.signal}};r&&(a.body=JSON.stringify(t.body));let o;try{o=await fetch(i,a)}catch(e){let t=g(e);return _e(e)||(_.value=!1,v.value=t),{ok:!1,error:t,status:0}}if(_.value||(_.value=!0,v.value=null),!o.ok){let{error:e,status:t}=await xe(o);return{ok:!1,error:e,status:t}}try{return{ok:!0,data:await o.json()}}catch(e){return{ok:!1,error:`Invalid JSON response: ${g(e)}`,status:o.status}}}function Se(e,t,n={}){return b(e,{...n,method:`GET`,query:t})}function Ce(e,t,n={}){return b(e,{...n,method:`POST`,body:t})}function we(e,t,n={}){return b(e,{...n,method:`PUT`,body:t})}function Te(e,t,n={}){return b(e,{...n,method:`DELETE`,body:t})}async function Ee(e,t={}){let n=`${e}${ye(t.query)}`,r={method:t.method??`GET`,headers:be(t,!1),...t.body===void 0?{}:{body:t.body},...t.signal===void 0?{}:{signal:t.signal}};return fetch(n,r)}var x=Object.create(null);x.open=`0`,x.close=`1`,x.ping=`2`,x.pong=`3`,x.message=`4`,x.upgrade=`5`,x.noop=`6`;var S=Object.create(null);Object.keys(x).forEach(e=>{S[x[e]]=e});var C={type:`error`,data:`parser error`},De=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,Oe=typeof ArrayBuffer==`function`,ke=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ae=({type:e,data:t},n,r)=>De&&t instanceof Blob?n?r(t):je(t,r):Oe&&(t instanceof ArrayBuffer||ke(t))?n?r(t):je(new Blob([t]),r):r(x[e]+(t||``)),je=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function Me(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var Ne;function Pe(e,t){if(De&&e.data instanceof Blob)return e.data.arrayBuffer().then(Me).then(t);if(Oe&&(e.data instanceof ArrayBuffer||ke(e.data)))return t(Me(e.data));Ae(e,!1,e=>{Ne||=new TextEncoder,t(Ne.encode(e))})}var Fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,w=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)w[Fe.charCodeAt(e)]=e;var Ie=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=w[e.charCodeAt(r)],o=w[e.charCodeAt(r+1)],s=w[e.charCodeAt(r+2)],c=w[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},Le=typeof ArrayBuffer==`function`,Re=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:Be(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:ze(e.substring(1),t)}:S[n]?e.length>1?{type:S[n],data:e.substring(1)}:{type:S[n]}:C},ze=(e,t)=>Le?Be(Ie(e),t):{base64:!0,data:e},Be=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},Ve=``,He=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{Ae(e,!1,e=>{r[a]=e,++i===n&&t(r.join(Ve))})})},Ue=(e,t)=>{let n=e.split(Ve),r=[];for(let e=0;e<n.length;e++){let i=Re(n[e],t);if(r.push(i),i.type===`error`)break}return r};function We(){return new TransformStream({transform(e,t){Pe(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var Ge;function T(e){return e.reduce((e,t)=>e+t.length,0)}function E(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Ke(e,t){Ge||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(T(n)<1)break;let e=E(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(T(n)<2)break;let e=E(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(T(n)<8)break;let e=E(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(C);break}i=a*2**32+t.getUint32(4),r=3}else{if(T(n)<i)break;let e=E(n,i);s.enqueue(Re(a?e:Ge.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(C);break}}}})}function D(e){if(e)return qe(e)}function qe(e){for(var t in D.prototype)e[t]=D.prototype[t];return e}D.prototype.on=D.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},D.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},D.prototype.off=D.prototype.removeListener=D.prototype.removeAllListeners=D.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},D.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},D.prototype.emitReserved=D.prototype.emit,D.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},D.prototype.hasListeners=function(e){return!!this.listeners(e).length};var O=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),k=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),Je=`arraybuffer`;function Ye(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var Xe=k.setTimeout,Ze=k.clearTimeout;function A(e,t){t.useNativeTimers?(e.setTimeoutFn=Xe.bind(k),e.clearTimeoutFn=Ze.bind(k)):(e.setTimeoutFn=k.setTimeout.bind(k),e.clearTimeoutFn=k.clearTimeout.bind(k))}var Qe=1.33;function $e(e){return typeof e==`string`?et(e):Math.ceil((e.byteLength||e.size)*Qe)}function et(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function tt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function nt(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function rt(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var it=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},j=class extends D{constructor(e){super(),this.writable=!1,A(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new it(e,t,n)),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){let t=Re(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(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_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(e){let t=nt(e);return t.length?`?`+t:``}},at=class extends j{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){Ue(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,He(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=tt()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},ot=!1;try{ot=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var st=ot;function ct(){}var lt=class extends at{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},M=class e extends D{constructor(e,t,n){super(),this.createRequest=e,A(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=Ye(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(this._xhr!==void 0&&this._xhr!==null){if(this._xhr.onreadystatechange=ct,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(M.requestsCount=0,M.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,ut);else if(typeof addEventListener==`function`){let e=`onpagehide`in k?`pagehide`:`unload`;addEventListener(e,ut,!1)}}function ut(){for(let e in M.requests)M.requests.hasOwnProperty(e)&&M.requests[e].abort()}var dt=(function(){let e=pt({xdomain:!1});return e&&e.responseType!==null})(),ft=class extends lt{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=dt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new M(pt,this.uri(),e)}};function pt(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||st))return new XMLHttpRequest}catch{}if(!t)try{return new k[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var mt=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,ht=class extends j{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=mt?{}:Ye(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(e,t,n)}catch(e){return this.emitReserved(`error`,e)}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++){let n=e[t],r=t===e.length-1;Ae(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&O(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=tt()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},N=k.WebSocket||k.MozWebSocket,gt={websocket:class extends ht{createSocket(e,t,n){return mt?new N(e,t,n):t?new N(e,t):new N(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends j{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=>{let t=Ke(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=We();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&O(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:ft},_t=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vt=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function P(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=_t.exec(e||``),a={},o=14;for(;o--;)a[vt[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,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=yt(a,a.path),a.queryKey=bt(a,a.query),a}function yt(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function bt(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var F=typeof addEventListener==`function`&&typeof removeEventListener==`function`,I=[];F&&addEventListener(`offline`,()=>{I.forEach(e=>e())},!1);var L=class e extends D{constructor(e,t){if(super(),this.binaryType=Je,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){let n=P(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=P(t.host).host);A(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,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(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),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=rt(this.opts.query)),F&&(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`})},I.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=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](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}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`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.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`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data)}}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);let 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){let 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 e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=$e(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,O(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{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?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.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(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(),F&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=I.indexOf(this._offlineEventListener);e!==-1&&I.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};L.protocol=4;var xt=class extends L{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),n=!1;L.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;L.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},St=class extends xt{constructor(e,t={}){let n=typeof e==`object`,r=n?{...e}:{...t};(!r.transports||r.transports&&typeof r.transports[0]==`string`)&&(r.transports=(r.transports||[`polling`,`websocket`,`webtransport`]).map(e=>gt[e]).filter(e=>!!e)),super(n?r:e,r)}};St.protocol;function Ct(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=P(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var wt=typeof ArrayBuffer==`function`,Tt=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Et=Object.prototype.toString,Dt=typeof Blob==`function`||typeof Blob<`u`&&Et.call(Blob)===`[object BlobConstructor]`,Ot=typeof File==`function`||typeof File<`u`&&Et.call(File)===`[object FileConstructor]`;function R(e){return wt&&(e instanceof ArrayBuffer||Tt(e))||Dt&&e instanceof Blob||Ot&&e instanceof File}function z(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(z(e[t]))return!0;return!1}if(R(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return z(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&z(e[t]))return!0;return!1}function kt(e){let t=[],n=e.data,r=e;return r.data=B(n,t),r.attachments=t.length,{packet:r,buffers:t}}function B(e,t,n){if(!e)return e;if(R(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=B(e[r],t);return n}if(typeof e==`object`&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON==`function`&&!n)return B(e.toJSON(),t,!0);let r={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=B(e[n],t));return r}return e}function At(e,t){return e.data=V(e.data,t),delete e.attachments,e}function V(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 Error(`illegal attachments`)}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=V(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=V(e[n],t));return e}var jt=e({Decoder:()=>Pt,Encoder:()=>Nt,PacketType:()=>H,isPacketValid:()=>Bt,protocol:()=>5}),Mt=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],H;(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`})(H||={});var Nt=class{constructor(e){this.replacer=e}encode(e){return(e.type===H.EVENT||e.type===H.ACK)&&z(e)?this.encodeAsBinary({type:e.type===H.EVENT?H.BINARY_EVENT:H.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===H.BINARY_EVENT||e.type===H.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){let t=kt(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Pt=class e extends D{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===H.BINARY_EVENT;n||t.type===H.BINARY_ACK?(t.type=n?H.EVENT:H.ACK,this.reconstructor=new Ft(t)):super.emitReserved(`decoded`,t)}else if(R(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(H[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===H.BINARY_EVENT||r.type===H.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!Lt(a)||a<1)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&t.charAt(n)!==`,`&&n!==t.length;);r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case H.CONNECT:return U(t);case H.DISCONNECT:return t===void 0;case H.CONNECT_ERROR:return typeof t==`string`||U(t);case H.EVENT:case H.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&Mt.indexOf(t[0])===-1);case H.ACK:case H.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},Ft=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=At(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function It(e){return typeof e==`string`}var Lt=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function Rt(e){return e===void 0||Lt(e)}function U(e){return Object.prototype.toString.call(e)===`[object Object]`}function zt(e,t){switch(e){case H.CONNECT:return t===void 0||U(t);case H.DISCONNECT:return t===void 0;case H.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&Mt.indexOf(t[0])===-1);case H.ACK:return Array.isArray(t);case H.CONNECT_ERROR:return typeof t==`string`||U(t);default:return!1}}function Bt(e){return It(e.nsp)&&Rt(e.id)&&zt(e.type,e.data)}function W(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var Vt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Ht=class extends D{constructor(e,t,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=e,this.nsp=t,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;let e=this.io;this.subs=[W(e,`open`,this.onopen.bind(this)),W(e,`packet`,this.onpacket.bind(this)),W(e,`error`,this.onerror.bind(this)),W(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){if(Vt.hasOwnProperty(e))throw 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;let n={type:H.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let 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:H.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(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case H.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,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 H.EVENT:case H.BINARY_EVENT:this.onevent(e);break;case H.ACK:case H.BINARY_ACK:this.onack(e);break;case H.DISCONNECT:this.ondisconnect();break;case H.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t)}}onevent(e){let 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){let t=this._anyListeners.slice();for(let n of t)n.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){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:H.ACK,id:e,data:r}))}}onack(e){let 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._drainQueue(!0),this.emitReserved(`connect`)}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()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:H.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){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,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){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function G(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}G.prototype.duration=function(){var e=this.ms*this.factor**+this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},G.prototype.reset=function(){this.attempts=0},G.prototype.setMin=function(e){this.ms=e},G.prototype.setMax=function(e){this.max=e},G.prototype.setJitter=function(e){this.jitter=e};var K=class extends D{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,A(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(t.randomizationFactor??.5),this.backoff=new G({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||jt;this.encoder=new n.Encoder,this.decoder=new n.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.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||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 St(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=W(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=W(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(W(e,`ping`,this.onping.bind(this)),W(e,`data`,this.ondata.bind(this)),W(e,`error`,this.onerror.bind(this)),W(e,`close`,this.onclose.bind(this)),W(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){O(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ht(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],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 n;this.cleanup(),(n=this.engine)==null||n.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;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},q={};function J(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=Ct(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=q[i]&&a in q[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new K(r,t):(q[i]||(q[i]=new K(r,t)),c=q[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(J,{Manager:K,Socket:Ht,io:J,connect:J});var Y=null,X=new Map,Ut=new Set,Wt=!1;function Gt(e){for(let t of X.keys())e.emit(`subscribe`,t)}function Kt(){for(let e of Ut)try{e()}catch(e){console.error(`[usePubSub] reconnect handler threw:`,e)}}function qt(){if(Y)return Y;let e=J({path:`/ws/pubsub`,transports:[`websocket`]});return e.on(`connect`,()=>{Gt(e),Wt?Kt():Wt=!0}),e.on(`data`,e=>{let t=X.get(e.channel);if(t)for(let n of t)n(e.data)}),Y=e,e}function Jt(){X.size>0||Y&&(Y.disconnect(),Y=null,Wt=!1)}function Yt(){function e(e,t){let n=X.get(e);n||(n=new Set,X.set(e,n)),n.add(t);let r=qt();return r.connected&&r.emit(`subscribe`,e),()=>{let n=X.get(e);n&&(n.delete(t),n.size===0&&(X.delete(e),Y?.connected&&Y.emit(`unsubscribe`,e)),Jt())}}function t(e){return Ut.add(e),()=>{Ut.delete(e)}}return{subscribe:e,onReconnect:t}}function Z(e){return e}function Xt(e,t){return t?e.url.replace(/:(\w+)/g,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?encodeURIComponent(String(t[n])):e):e.url}var Zt={openBook:`openBook`,getBooks:`getBooks`,createBook:`createBook`,updateBook:`updateBook`,deleteBook:`deleteBook`,getAccounts:`getAccounts`,upsertAccount:`upsertAccount`,addEntries:`addEntries`,voidEntry:`voidEntry`,getJournalEntries:`getJournalEntries`,getOpeningBalances:`getOpeningBalances`,setOpeningBalances:`setOpeningBalances`,getReport:`getReport`,getTimeSeries:`getTimeSeries`,rebuildSnapshots:`rebuildSnapshots`},Qt={dispatch:{path:`/api/accounting`,method:`POST`}},$t=`project`,en=[`asset`,`liability`,`equity`,`income`,`expense`];function tn(e,t){return t?`accounting:${t}:${e}`:`accounting:${e}`}var nn=`accounting:books`;function rn(e){return e?`accounting:${e}:#books`:nn}var an={journal:`journal`,opening:`opening`,accounts:`accounts`,snapshotsRebuilding:`snapshots-rebuilding`,snapshotsReady:`snapshots-ready`};function on(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function sn(e){return Array.isArray(e)}function cn(e,t){return on(e)&&typeof e[t]==`string`}function ln(e,t){return e instanceof Error?e.message:cn(e,`details`)&&e.details?e.details:cn(e,`message`)&&e.message?e.message:t===void 0?String(e):t}var un={accounting:`data/accounting`,accountingBooks:`data/accounting/books`},dn=[1,2,3,4,5,6,7,8,9,10,11,12],fn=new Map([[`Q1`,3],[`Q2`,6],[`Q3`,9],[`Q4`,12]]);function pn(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1&&e<=12}function mn(e){return pn(e)?e:(typeof e==`string`?fn.get(e):void 0)??12}function hn(e){return mn(e)}function gn(e,t){let n=new Date(Date.UTC(2001,e,0));try{return new Intl.DateTimeFormat(t,{month:`long`,day:`numeric`,timeZone:`UTC`}).format(n)}catch{return String(e)}}function _n(e){return String(e).padStart(2,`0`)}function vn(e,t){return new Date(e,t+1,0).getDate()}function yn(e,t,n){return`${e}-${_n(t)}-${_n(n)}`}function bn(e,t){let n=hn(e),r=(t.getMonth()+1-n-1+12)%12;return Math.floor(r/3)}function xn(e,t,n){let r=hn(e),i=t.getMonth()+1,a=t.getFullYear(),o=r%12+1,s=i>=o?a:a-1,c=o+n*3;return{year:s+Math.floor((c-1)/12),month:(c-1)%12+1}}function Q(e,t,n){let r=xn(e,t,n),i=r.month-1+2,a=r.year+Math.floor(i/12),o=i%12+1,s=vn(a,o-1);return{from:yn(r.year,r.month,1),to:yn(a,o,s)}}function Sn(e,t=new Date){return Q(e,t,bn(e,t))}function Cn(e,t=new Date){let n=bn(e,t);return n>0?Q(e,t,n-1):Q(e,new Date(t.getFullYear(),t.getMonth()-3,1),3)}function wn(e,t=new Date){let n=Q(e,t,0),r=Q(e,t,3);return{from:n.from,to:r.to}}function Tn(e,t=new Date){return wn(e,new Date(t.getFullYear()-1,t.getMonth(),t.getDate()))}var En=`US.JP.GB.CA.AU.NZ.DE.FR.IT.ES.NL.BE.AT.IE.PT.FI.SE.DK.PL.CH.NO.CN.KR.TW.HK.SG.IN.BR.MX`.split(`.`);function Dn(e,t){try{return new Intl.DisplayNames([t],{type:`region`}).of(e)??e}catch{return e}}function On(e){return En.some(t=>t===e)}var kn={warnMissingTaxRegistrationId:new Set([`JP`,`GB`,`DE`,`FR`,`IT`,`ES`,`NL`,`BE`,`AT`,`IE`,`PT`,`FI`,`SE`,`DK`,`PL`,`IN`,`AU`,`NZ`,`CA`])};function An(e,t){return t?kn[e].has(t):!1}var jn=[`USD`,`EUR`,`JPY`,`GBP`,`CNY`,`KRW`,`TWD`,`HKD`,`SGD`,`AUD`,`CAD`,`CHF`,`INR`,`BRL`,`MXN`],Mn=2;function Nn(e,t){try{return new Intl.DisplayNames([t],{type:`currency`}).of(e)??e}catch{return e}}function Pn(e){try{return new Intl.NumberFormat(`en`,{style:`currency`,currency:e}).resolvedOptions().maximumFractionDigits??Mn}catch{return Mn}}function Fn(e){let t=Pn(e);return t===0?`1`:(1/10**t).toFixed(t)}function In(e,t,n){try{return new Intl.NumberFormat(n,{style:`currency`,currency:t}).format(e)}catch{return e.toFixed(Pn(t))}}function Ln(e,t=2,n){return e.toLocaleString(n,{minimumFractionDigits:t,maximumFractionDigits:t})}function $(e){return String(e).padStart(2,`0`)}function Rn(e=new Date){return`${e.getFullYear()}-${$(e.getMonth()+1)}-${$(e.getDate())}`}function zn(e=new Date){return`${e.getFullYear()}-${$(e.getMonth()+1)}`}function Bn(e=new Date){let t=new Date(e.getFullYear(),e.getMonth()-1,1);return`${t.getFullYear()}-${$(t.getMonth()+1)}`}function Vn(e=new Date){let t=Math.floor(e.getMonth()/3)*3,n=new Date(e.getFullYear(),t-1,1);return`${n.getFullYear()}-${$(n.getMonth()+1)}`}function Hn(e=new Date){return`${e.getFullYear()-1}-12`}var Un=[`revenue`,`expense`,`netIncome`,`accountBalance`],Wn=[`month`,`quarter`,`year`],Gn=Z({toolName:`manageAccounting`,apiNamespace:`accounting`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,workspaceDirs:{accounting:un.accounting,accountingBooks:un.accountingBooks},staticChannels:{accountingBooks:`accounting:books`}}),Kn=Z({toolName:`openCanvas`,apiNamespace:`canvas`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),qn=Z({toolName:`presentChart`,apiNamespace:`chart`,apiRoutes:{create:{method:`POST`,path:``}},mcpDispatch:`create`}),Jn=Z({toolName:`editImages`}),Yn=Z({toolName:`generateImage`}),Xn=Z({toolName:`manageSkills`,apiNamespace:`skills`,apiRoutes:{list:{method:`GET`,path:``},detail:{method:`GET`,path:`/:name`},create:{method:`POST`,path:``},update:{method:`PUT`,path:`/:name`},remove:{method:`DELETE`,path:`/:name`},catalogList:{method:`GET`,path:`/catalog`},catalogStar:{method:`POST`,path:`/catalog/star`},catalogPreview:{method:`GET`,path:`/catalog/preview`},externalSuggestions:{method:`GET`,path:`/external/suggestions`},externalReposList:{method:`GET`,path:`/external/repos`},externalReposInstall:{method:`POST`,path:`/external/repos`},externalReposRemove:{method:`DELETE`,path:`/external/repos/:repoId`}},mcpDispatch:`create`}),Zn=Z({toolName:`presentDocument`,apiNamespace:`markdown`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),Qn=Z({toolName:`managePhotoLocations`,apiNamespace:`photoLocations`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,staticChannels:{locationsChanged:`photoLocations:locations-changed`}}),$n=Z({toolName:`presentCollection`,apiNamespace:`presentCollection`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),er=Z({toolName:`presentForm`,apiNamespace:`form`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),tr=Z({toolName:`presentHtml`,apiNamespace:`html`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),nr=Z({toolName:`presentMulmoScript`,apiNamespace:`mulmoScript`,apiRoutes:{save:{method:`POST`,path:`/save`},updateBeat:{method:`POST`,path:`/update-beat`},updateScript:{method:`POST`,path:`/update-script`},beatImage:{method:`GET`,path:`/beat-image`},beatAudio:{method:`GET`,path:`/beat-audio`},beatMovie:{method:`GET`,path:`/beat-movie`},generateBeatAudio:{method:`POST`,path:`/generate-beat-audio`},renderBeat:{method:`POST`,path:`/render-beat`},uploadBeatImage:{method:`POST`,path:`/upload-beat-image`},characterImage:{method:`GET`,path:`/character-image`},renderCharacter:{method:`POST`,path:`/render-character`},uploadCharacterImage:{method:`POST`,path:`/upload-character-image`},movieStatus:{method:`GET`,path:`/movie-status`},generateMovie:{method:`POST`,path:`/generate-movie`},downloadMovie:{method:`GET`,path:`/download-movie`},pdfStatus:{method:`GET`,path:`/pdf-status`},generatePdf:{method:`POST`,path:`/generate-pdf`},downloadPdf:{method:`GET`,path:`/download-pdf`}},mcpDispatch:`save`,requires:[`ffmpeg`]}),rr=Z({toolName:`presentSVG`,apiNamespace:`svg`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),ir=Z({toolName:`manageAutomations`,apiNamespace:`scheduler`,apiRoutes:{list:{method:`GET`,path:``},dispatch:{method:`POST`,path:``},tasksList:{method:`GET`,path:`/tasks`},tasksCreate:{method:`POST`,path:`/tasks`},taskUpdate:{method:`PUT`,path:`/tasks/:id`},taskDelete:{method:`DELETE`,path:`/tasks/:id`},taskRun:{method:`POST`,path:`/tasks/:id/run`},logs:{method:`GET`,path:`/logs`}},mcpDispatch:`dispatch`}),ar=Z({toolName:`presentSpreadsheet`,apiNamespace:`spreadsheet`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),or=[Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,Z({toolName:`manageWiki`})],sr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function cr(e,t){return sr(e,t)?e[t]??``:``}function lr(e,t,n){let r=Object.create(null),i=Object.create(null),a=[];for(let o of e){let e=t(o);if(e)for(let[t,s]of Object.entries(e)){if(sr(i,t)){let e=i[t]??``;a.push({dimension:n,key:t,plugins:[e,o.toolName]});continue}r[t]=s,i[t]=o.toolName}}return{aggregate:{...r},owner:{...i},collisions:a}}function ur(e,t,n,r){let i=Object.create(null),a=[];for(let[o,s]of Object.entries(n)){if(t.has(o)){a.push({label:e,key:o,plugin:cr(r,o)});continue}i[o]=s}return{cleaned:{...i},dropped:a}}function dr(e,t){let{aggregate:n,owner:r,collisions:i}=lr(e,t.extract,t.dimension),a=new Set(Object.keys(t.hostRecord));if(t.additionalReservedKeys)for(let e of t.additionalReservedKeys)a.add(e);let{cleaned:o,dropped:s}=ur(t.label,a,n,r),c=o;return{merged:{...t.hostRecord,...c},hostCollisions:s,intraCollisions:i}}var fr={message:`/api/transports/:transportId/chats/:externalChatId`,connect:`/api/transports/:transportId/chats/:externalChatId/connect`};function pr(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]={method:i.method,url:`/api/${e}${i.path}`};return n}var mr=dr(or,{label:`API_ROUTES`,hostRecord:{health:`/api/health`,sandbox:`/api/sandbox`,diagnosticsReport:`/api/diagnostics/report`,shortcuts:`/api/shortcuts`,dashboard:`/api/dashboard`,agent:{run:`/api/agent`,cancel:`/api/agent/cancel`,internal:{toolResult:`/api/internal/tool-result`}},chatIndex:{rebuild:`/api/chat-index/rebuild`},chatService:fr,shutdown:`/api/shutdown`,config:{base:`/api/config`,settings:`/api/config/settings`,mcp:`/api/config/mcp`,workspaceDirs:`/api/config/workspace-dirs`,referenceDirs:`/api/config/reference-dirs`,schedulerOverrides:`/api/config/scheduler-overrides`,refresh:`/api/config/refresh`,connectors:`/api/config/connectors`},files:{tree:`/api/files/tree`,dir:`/api/files/dir`,content:`/api/files/content`,create:`/api/files/create`,upload:`/api/files/upload`,raw:`/api/files/raw`,refRoots:`/api/files/ref-roots`,open:`/api/files/open`,reveal:`/api/files/reveal`},image:{generate:`/api/generate-image`,edit:`/api/edit-image`,upload:`/api/images`,update:`/api/images/update`},attachments:{upload:`/api/attachments`},share:{pack:`/api/share/pack`,packMarkdown:`/api/share/pack-markdown`},remoteHost:{connect:`/api/remote-host/connect`,reconnect:`/api/remote-host/reconnect`,disconnect:`/api/remote-host/disconnect`,status:`/api/remote-host/status`},google:{status:`/api/google/status`,authorize:`/api/google/authorize`,unlink:`/api/google/unlink`},mcp:{brokerReady:`/api/mcp/broker-ready`},mcpTools:{list:`/api/mcp-tools`,invoke:`/api/mcp-tools/:tool`},notifier:{dispatch:`/api/notifier`},journal:{latestDaily:`/api/journal/latest-daily`},pdf:{markdown:`/api/pdf/markdown`},translation:{translate:`/api/translation`},transcribe:{run:`/api/transcribe`,model:`/api/transcribe/model`,modelDownload:`/api/transcribe/model/download`},plugins:{mindmap:`/api/mindmap`,quiz:`/api/quiz`,present3d:`/api/present3d`,googleMap:`/api/google-map`,runtimeList:`/api/plugins/runtime/list`,runtimeDispatch:`/api/plugins/runtime/:pkg/dispatch`,runtimeOauthCallback:`/api/plugins/runtime/oauth-callback/:alias`,diagnostics:`/api/plugins/diagnostics`,runtimeAsset:`/api/plugins/runtime/:pkg/:version/{*splat}`},roles:{list:`/api/roles`,manage:`/api/roles/manage`},marpThemes:{list:`/api/marp-themes`},collections:{list:`/api/collections`,ontology:`/api/collections/ontology`,detail:`/api/collections/:slug`,items:`/api/collections/:slug/items`,item:`/api/collections/:slug/items/:itemId`,itemAction:`/api/collections/:slug/items/:itemId/actions/:actionId`,collectionAction:`/api/collections/:slug/actions/:actionId`,refresh:`/api/collections/:slug/refresh`,calendarPush:`/api/collections/:slug/calendar-push`,viewFile:`/api/collections/:slug/view-file`,remoteView:`/api/collections/:slug/remote-view`,remoteViewMutate:`/api/collections/:slug/remote-view/:viewId/mutate`,remoteViewItems:`/api/collections/:slug/remote-view/:viewId/items`,viewI18n:`/api/collections/:slug/view-i18n`,viewToken:`/api/collections/:slug/view-token`,viewData:`/api/collections/:slug/view-data`,viewDataAction:`/api/collections/:slug/view-data/actions/:actionId`,viewDataQuery:`/api/collections/:slug/view-data/query`,viewDataImage:`/api/collections/:slug/view-data/image`,viewDelete:`/api/collections/:slug/views/:viewId`},collectionsRegistry:{list:`/api/collections-registry`,preview:`/api/collections-registry/preview`,import:`/api/collections-registry/import`,export:`/api/collections-registry/export`},sessions:{list:`/api/sessions`,detail:`/api/sessions/:id`,markRead:`/api/sessions/:id/mark-read`,bookmark:`/api/sessions/:id/bookmark`},feeds:{list:`/api/feeds`,detail:`/api/feeds/:slug`},hooks:{log:`/api/hooks/log`},wiki:{base:`/api/wiki`,pageHistory:`/api/wiki/pages/:slug/history`,pageHistorySnapshot:`/api/wiki/pages/:slug/history/:stamp`,pageHistoryRestore:`/api/wiki/pages/:slug/history/:stamp/restore`,internalSnapshot:`/api/wiki/internal/snapshot`}},extract:e=>{if(e.apiRoutes===void 0)return;let t=e.apiNamespace??e.toolName;return{[t]:pr(t,e.apiRoutes)}},dimension:`apiNamespace`});mr.hostCollisions,mr.intraCollisions;var hr=mr.merged,gr={common:{downloadZip:`ZIP`,downloadFailed:`Download failed`,save:`Save`,cancel:`Cancel`,loading:`Loading...`,close:`Close`,dismiss:`Dismiss`,add:`Add`,remove:`Remove`,yes:`Yes`,no:`No`,saving:`Saving...`,saved:`Saved`,noResultsYet:`No results yet`,noImageYet:`No image yet`,sendChat:`Start a new chat`},sessionTabBar:{newSession:`New session`,activeSessions:`{count} active session (agent running) | {count} active sessions (agent running)`,unreadReplies:`{count} unread reply | {count} unread replies`,unreadDot:`New reply`,origin:{scheduler:`Started by scheduler`,skill:`Started by skill`,bridge:`Started by bridge`}},chatInput:{placeholder:`Message Claude…`,send:`Send`,stop:`Stop`,runningPlaceholder:`Running… press Enter to queue for later`,removeBuffered:`Remove queued message`,attachFile:`Attach file`,fileTooLarge:`File too large ({sizeMB} MB). Maximum is 30 MB.`,unsupportedFileType:`File type not supported. Accepted: images, PDF, DOCX, XLSX, PPTX, text files.`,attachImageFailed:`Failed to attach image: {error}`,stopFailed:`Failed to stop the run: {error}`,dropHint:`Drop file to attach`,tooManyFiles:`You can attach up to {max} files at once.`,removeAttachment:`Remove {name}`,attachmentFallbackName:`attachment`,voice:{start:`Start voice input`,stop:`Stop voice input`}},cspViolation:{notice:`⚠ A view tried to load {host}, but the content security policy blocked it ({directive}). To allow it, add the host to config/csp.json — only if you trust it.`,dismiss:`Dismiss`},sessionHistoryPanel:{filters:{all:`All`,unread:`Unread`,bookmarked:`Bookmarked`,longRunning:`Long-running (24h+)`,human:`Human`,scheduler:`Scheduler`,skill:`Skill`,bridge:`Bridge`},failedToRefresh:`⚠ Failed to refresh: {error}`,showingLastKnown:` — showing last known list.`,noSessions:`No sessions yet.`,noMatching:`No matching sessions.`,running:`Running`,noMessages:`(no messages)`,openRowAria:`Open session: {preview}`,rowMenuAria:`Session actions`,bookmark:`Bookmark`,unbookmark:`Remove bookmark`,delete:`Delete`,deleteConfirm:`Delete this session?
2
2
 
3
3
  {preview}
4
4