@dao42/d42paas-front 0.9.32 → 0.9.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/DaoPaaS.cjs CHANGED
@@ -45,7 +45,7 @@ Error generating stack: `+o.message+`
45
45
  *
46
46
  * This source code is licensed under the MIT license found in the
47
47
  * LICENSE file in the root directory of this source tree.
48
- */var og=D.exports,KA=FX.exports;function JA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var e8=typeof Object.is=="function"?Object.is:JA,t8=KA.useSyncExternalStore,i8=og.useRef,n8=og.useEffect,r8=og.useMemo,o8=og.useDebugValue;GX.useSyncExternalStoreWithSelector=function(t,e,i,n,r){var o=i8(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=r8(function(){function l(f){if(!c){if(c=!0,u=f,f=n(f),r!==void 0&&s.hasValue){var m=s.value;if(r(m,f))return O=m}return O=f}if(m=O,e8(u,f))return m;var Q=n(f);return r!==void 0&&r(m,Q)?m:(u=f,O=Q)}var c=!1,u,O,h=i===void 0?null:i;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,i,n,r]);var a=t8(t,o[0],o[1]);return n8(function(){s.hasValue=!0,s.value=a},[a]),o8(a),a};BX.exports=GX;function s8(t,e=t.getState,i){const n=BX.exports.useSyncExternalStoreWithSelector(t.subscribe,t.getState,t.getServerState||t.getState,e,i);return D.exports.useDebugValue(n),n}const ZP=t=>{const e=typeof t=="function"?NX(t):t,i=(n,r)=>s8(e,n,r);return Object.assign(i,e),i},a8=t=>t?ZP(t):ZP;var l8=a8,jP=Object.getOwnPropertySymbols,c8=Object.prototype.hasOwnProperty,u8=Object.prototype.propertyIsEnumerable,O8=(t,e)=>{var i={};for(var n in t)c8.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&jP)for(var n of jP(t))e.indexOf(n)<0&&u8.call(t,n)&&(i[n]=t[n]);return i};const f8=(t,e={})=>(i,n,r)=>{const o=e,{enabled:s,anonymousActionType:a}=o,l=O8(o,["enabled","anonymousActionType"]);let c;try{c=(s!=null?s:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&s&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(i,n,r);const u=c.connect(l);let O=!0;r.setState=(m,Q,v)=>{const p=i(m,Q);return O&&u.send(v===void 0?{type:a||"anonymous"}:typeof v=="string"?{type:v}:v,n()),p};const h=(...m)=>{const Q=O;O=!1,i(...m),O=Q},f=t(r.setState,n,r);if(u.init(f),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let m=!1;const Q=r.dispatch;r.dispatch=(...v)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&v[0].type==="__setState"&&!m&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),m=!0),Q(...v)}}return u.subscribe(m=>{var Q;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return iv(m.payload,v=>{if(v.type==="__setState"){h(v.state);return}!r.dispatchFromDevtools||typeof r.dispatch=="function"&&r.dispatch(v)});case"DISPATCH":switch(m.payload.type){case"RESET":return h(f),u.init(r.getState());case"COMMIT":return u.init(r.getState());case"ROLLBACK":return iv(m.state,v=>{h(v),u.init(r.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return iv(m.state,v=>{h(v)});case"IMPORT_STATE":{const{nextLiftedState:v}=m.payload,p=(Q=v.computedStates.slice(-1)[0])==null?void 0:Q.state;if(!p)return;h(p),u.send(null,v);return}case"PAUSE_RECORDING":return O=!O}return}}),f},d8=f8,iv=(t,e)=>{let i;try{i=JSON.parse(t)}catch(n){console.error("[zustand devtools middleware] Could not parse the received json",n)}i!==void 0&&e(i)};var h8=Object.defineProperty,DP=Object.getOwnPropertySymbols,p8=Object.prototype.hasOwnProperty,m8=Object.prototype.propertyIsEnumerable,MP=(t,e,i)=>e in t?h8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,rc=(t,e)=>{for(var i in e||(e={}))p8.call(e,i)&&MP(t,i,e[i]);if(DP)for(var i of DP(e))m8.call(e,i)&&MP(t,i,e[i]);return t};const Cp=t=>e=>{try{const i=t(e);return i instanceof Promise?i:{then(n){return Cp(n)(i)},catch(n){return this}}}catch(i){return{then(n){return this},catch(n){return Cp(n)(i)}}}},g8=(t,e)=>(i,n,r)=>{let o=rc({getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,p)=>rc(rc({},p),v)},e),s=!1;const a=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),i(...v)},n,r);const u=Cp(o.serialize),O=()=>{const v=o.partialize(rc({},n()));let p;const d=u({state:v,version:o.version}).then(g=>c.setItem(o.name,g)).catch(g=>{p=g});if(p)throw p;return d},h=r.setState;r.setState=(v,p)=>{h(v,p),O()};const f=t((...v)=>{i(...v),O()},n,r);let m;const Q=()=>{var v;if(!c)return;s=!1,a.forEach(d=>d(n()));const p=((v=o.onRehydrateStorage)==null?void 0:v.call(o,n()))||void 0;return Cp(c.getItem.bind(c))(o.name).then(d=>{if(d)return o.deserialize(d)}).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==o.version){if(o.migrate)return o.migrate(d.state,d.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return d.state}).then(d=>{var g;return m=o.merge(d,(g=n())!=null?g:f),i(m,!0),O()}).then(()=>{p==null||p(m,void 0),s=!0,l.forEach(d=>d(m))}).catch(d=>{p==null||p(void 0,d)})};return r.persist={setOptions:v=>{o=rc(rc({},o),v),v.getStorage&&(c=v.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},rehydrate:()=>Q(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},Q(),m||f},y8=g8,v8=(t,e)=>{const i={};return Object.keys(t.getState()).forEach(n=>{i[n]=r=>{if(t.getState()[n]===r)return;const s=n.replace(/^\S/,a=>a.toUpperCase());t.setState(a=>{a[n]=r},`@@${e}/set${s}`)}}),i},b8=(t,e)=>{const i=t(e.set,e.get,e);return{...e,set:{...e.set,...i}}},Q8=(t,e)=>{const i={...e.use},n={...e.useTracked},r={...e.get};return Object.keys(t(e.store.getState(),e.get,e)).forEach(o=>{i[o]=(...s)=>e.useStore(a=>{const c=t(a,e.get,e)[o];return c(...s)}),n[o]=(...s)=>{const a=e.useTrackedStore(),c=t(a,e.get,e)[o];return c(...s)},r[o]=(...s)=>{const l=t(e.store.getState(),e.get,e)[o];return l(...s)}}),{...e,get:r,use:i,useTracked:n}},Pb=t=>({...t,extendSelectors:e=>Pb(Q8(e,t)),extendActions:e=>Pb(b8(e,t))}),$8=t=>{const e={};return Object.keys(t.getState()).forEach(i=>{e[i]=()=>t.getState()[i]}),e},S8=t=>{const e={};return Object.keys(t.getState()).forEach(i=>{e[i]=n=>t(r=>r[i],n)}),e},w8=(t,e)=>{const i={};return Object.keys(t.getState()).forEach(n=>{i[n]=()=>e()[n]}),i},x8=t=>(e,i,n)=>{const r=(o,s)=>e(qA(o),!0,s);return n.setState=r,t(r,i,n)};function P8(t,...e){return e.reduce((i,n)=>n(i),t)}const bS=t=>(e,i={})=>{var n;const{middlewares:r=[],devtools:o,persist:s,immer:a}=i;UA((n=a==null?void 0:a.enabledAutoFreeze)!==null&&n!==void 0?n:!1),a!=null&&a.enableMapSet&&RA();const l=[x8,...r];s!=null&&s.enabled&&l.push(b=>y8(b,{...s,name:t})),o!=null&&o.enabled&&l.push(b=>d8(b,{...o,name:t})),l.push(NX);const u=(b=>P8(b,...l))(()=>e),O=l8(u),h=v8(O,t),f=(b,$)=>{u.setState(x=>{Object.assign(x,b)},$||`@@${t}/mergeState`)},m=(b,$)=>{u.setState(b,$||`@@${t}/setState`)},Q=S8(O),v=$8(O),p=ZA(O),d=w8(O,p),g={get:{state:u.getState,...v},name:t,set:{state:m,mergeState:f,...h},store:u,use:Q,useTracked:d,useStore:O,useTrackedStore:p,extendSelectors:()=>g,extendActions:()=>g};return Pb(g)};var qd=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function KX(t,e){return e={exports:{}},t(e,e.exports),e.exports}var k8=typeof qd=="object"&&qd&&qd.Object===Object&&qd,JX=k8,T8=typeof self=="object"&&self&&self.Object===Object&&self,_8=JX||T8||Function("return this")(),Fs=_8,R8=Fs.Symbol,qa=R8,eW=Object.prototype,C8=eW.hasOwnProperty,X8=eW.toString,Ku=qa?qa.toStringTag:void 0;function W8(t){var e=C8.call(t,Ku),i=t[Ku];try{t[Ku]=void 0;var n=!0}catch{}var r=X8.call(t);return n&&(e?t[Ku]=i:delete t[Ku]),r}var z8=W8,E8=Object.prototype,q8=E8.toString;function U8(t){return q8.call(t)}var I8=U8,A8="[object Null]",L8="[object Undefined]",VP=qa?qa.toStringTag:void 0;function Y8(t){return t==null?t===void 0?L8:A8:VP&&VP in Object(t)?z8(t):I8(t)}var ku=Y8;function Z8(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var QS=Z8,j8="[object AsyncFunction]",D8="[object Function]",M8="[object GeneratorFunction]",V8="[object Proxy]";function N8(t){if(!QS(t))return!1;var e=ku(t);return e==D8||e==M8||e==j8||e==V8}var tW=N8,B8=Fs["__core-js_shared__"],nv=B8,NP=function(){var t=/[^.]+$/.exec(nv&&nv.keys&&nv.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function G8(t){return!!NP&&NP in t}var F8=G8,H8=Function.prototype,K8=H8.toString;function J8(t){if(t!=null){try{return K8.call(t)}catch{}try{return t+""}catch{}}return""}var Nl=J8,e7=/[\\^$.*+?()[\]{}|]/g,t7=/^\[object .+?Constructor\]$/,i7=Function.prototype,n7=Object.prototype,r7=i7.toString,o7=n7.hasOwnProperty,s7=RegExp("^"+r7.call(o7).replace(e7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function a7(t){if(!QS(t)||F8(t))return!1;var e=tW(t)?s7:t7;return e.test(Nl(t))}var l7=a7;function c7(t,e){return t==null?void 0:t[e]}var u7=c7;function O7(t,e){var i=u7(t,e);return l7(i)?i:void 0}var Bl=O7,f7=function(){try{var t=Bl(Object,"defineProperty");return t({},"",{}),t}catch{}}(),BP=f7;function d7(t,e,i){e=="__proto__"&&BP?BP(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}var h7=d7;function p7(t){return function(e,i,n){for(var r=-1,o=Object(e),s=n(e),a=s.length;a--;){var l=s[t?a:++r];if(i(o[l],l,o)===!1)break}return e}}var m7=p7,g7=m7(),y7=g7;function v7(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}var b7=v7;function Q7(t){return t!=null&&typeof t=="object"}var nu=Q7,$7="[object Arguments]";function S7(t){return nu(t)&&ku(t)==$7}var GP=S7,iW=Object.prototype,w7=iW.hasOwnProperty,x7=iW.propertyIsEnumerable,P7=GP(function(){return arguments}())?GP:function(t){return nu(t)&&w7.call(t,"callee")&&!x7.call(t,"callee")},nW=P7,k7=Array.isArray,Ms=k7;function T7(){return!1}var _7=T7,kb=KX(function(t,e){var i=e&&!e.nodeType&&e,n=i&&!0&&t&&!t.nodeType&&t,r=n&&n.exports===i,o=r?Fs.Buffer:void 0,s=o?o.isBuffer:void 0,a=s||_7;t.exports=a}),R7=9007199254740991,C7=/^(?:0|[1-9]\d*)$/;function X7(t,e){var i=typeof t;return e=e==null?R7:e,!!e&&(i=="number"||i!="symbol"&&C7.test(t))&&t>-1&&t%1==0&&t<e}var rW=X7,W7=9007199254740991;function z7(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=W7}var $S=z7,E7="[object Arguments]",q7="[object Array]",U7="[object Boolean]",I7="[object Date]",A7="[object Error]",L7="[object Function]",Y7="[object Map]",Z7="[object Number]",j7="[object Object]",D7="[object RegExp]",M7="[object Set]",V7="[object String]",N7="[object WeakMap]",B7="[object ArrayBuffer]",G7="[object DataView]",F7="[object Float32Array]",H7="[object Float64Array]",K7="[object Int8Array]",J7="[object Int16Array]",eL="[object Int32Array]",tL="[object Uint8Array]",iL="[object Uint8ClampedArray]",nL="[object Uint16Array]",rL="[object Uint32Array]",ri={};ri[F7]=ri[H7]=ri[K7]=ri[J7]=ri[eL]=ri[tL]=ri[iL]=ri[nL]=ri[rL]=!0;ri[E7]=ri[q7]=ri[B7]=ri[U7]=ri[G7]=ri[I7]=ri[A7]=ri[L7]=ri[Y7]=ri[Z7]=ri[j7]=ri[D7]=ri[M7]=ri[V7]=ri[N7]=!1;function oL(t){return nu(t)&&$S(t.length)&&!!ri[ku(t)]}var sL=oL;function aL(t){return function(e){return t(e)}}var lL=aL,FP=KX(function(t,e){var i=e&&!e.nodeType&&e,n=i&&!0&&t&&!t.nodeType&&t,r=n&&n.exports===i,o=r&&JX.process,s=function(){try{var a=n&&n.require&&n.require("util").types;return a||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}),HP=FP&&FP.isTypedArray,cL=HP?lL(HP):sL,oW=cL,uL=Object.prototype,OL=uL.hasOwnProperty;function fL(t,e){var i=Ms(t),n=!i&&nW(t),r=!i&&!n&&kb(t),o=!i&&!n&&!r&&oW(t),s=i||n||r||o,a=s?b7(t.length,String):[],l=a.length;for(var c in t)(e||OL.call(t,c))&&!(s&&(c=="length"||r&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||rW(c,l)))&&a.push(c);return a}var dL=fL,hL=Object.prototype;function pL(t){var e=t&&t.constructor,i=typeof e=="function"&&e.prototype||hL;return t===i}var mL=pL;function gL(t,e){return function(i){return t(e(i))}}var yL=gL,vL=yL(Object.keys,Object),bL=vL,QL=Object.prototype,$L=QL.hasOwnProperty;function SL(t){if(!mL(t))return bL(t);var e=[];for(var i in Object(t))$L.call(t,i)&&i!="constructor"&&e.push(i);return e}var wL=SL;function xL(t){return t!=null&&$S(t.length)&&!tW(t)}var PL=xL;function kL(t){return PL(t)?dL(t):wL(t)}var SS=kL;function TL(t,e){return t&&y7(t,e,SS)}var _L=TL;function RL(){this.__data__=[],this.size=0}var CL=RL;function XL(t,e){return t===e||t!==t&&e!==e}var sW=XL;function WL(t,e){for(var i=t.length;i--;)if(sW(t[i][0],e))return i;return-1}var sg=WL,zL=Array.prototype,EL=zL.splice;function qL(t){var e=this.__data__,i=sg(e,t);if(i<0)return!1;var n=e.length-1;return i==n?e.pop():EL.call(e,i,1),--this.size,!0}var UL=qL;function IL(t){var e=this.__data__,i=sg(e,t);return i<0?void 0:e[i][1]}var AL=IL;function LL(t){return sg(this.__data__,t)>-1}var YL=LL;function ZL(t,e){var i=this.__data__,n=sg(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}var jL=ZL;function Tu(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Tu.prototype.clear=CL;Tu.prototype.delete=UL;Tu.prototype.get=AL;Tu.prototype.has=YL;Tu.prototype.set=jL;var ag=Tu;function DL(){this.__data__=new ag,this.size=0}var ML=DL;function VL(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}var NL=VL;function BL(t){return this.__data__.get(t)}var GL=BL;function FL(t){return this.__data__.has(t)}var HL=FL,KL=Bl(Fs,"Map"),$f=KL,JL=Bl(Object,"create"),Sf=JL;function eY(){this.__data__=Sf?Sf(null):{},this.size=0}var tY=eY;function iY(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nY=iY,rY="__lodash_hash_undefined__",oY=Object.prototype,sY=oY.hasOwnProperty;function aY(t){var e=this.__data__;if(Sf){var i=e[t];return i===rY?void 0:i}return sY.call(e,t)?e[t]:void 0}var lY=aY,cY=Object.prototype,uY=cY.hasOwnProperty;function OY(t){var e=this.__data__;return Sf?e[t]!==void 0:uY.call(e,t)}var fY=OY,dY="__lodash_hash_undefined__";function hY(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Sf&&e===void 0?dY:e,this}var pY=hY;function _u(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}_u.prototype.clear=tY;_u.prototype.delete=nY;_u.prototype.get=lY;_u.prototype.has=fY;_u.prototype.set=pY;var KP=_u;function mY(){this.size=0,this.__data__={hash:new KP,map:new($f||ag),string:new KP}}var gY=mY;function yY(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var vY=yY;function bY(t,e){var i=t.__data__;return vY(e)?i[typeof e=="string"?"string":"hash"]:i.map}var lg=bY;function QY(t){var e=lg(this,t).delete(t);return this.size-=e?1:0,e}var $Y=QY;function SY(t){return lg(this,t).get(t)}var wY=SY;function xY(t){return lg(this,t).has(t)}var PY=xY;function kY(t,e){var i=lg(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this}var TY=kY;function Ru(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Ru.prototype.clear=gY;Ru.prototype.delete=$Y;Ru.prototype.get=wY;Ru.prototype.has=PY;Ru.prototype.set=TY;var cg=Ru,_Y=200;function RY(t,e){var i=this.__data__;if(i instanceof ag){var n=i.__data__;if(!$f||n.length<_Y-1)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new cg(n)}return i.set(t,e),this.size=i.size,this}var CY=RY;function Cu(t){var e=this.__data__=new ag(t);this.size=e.size}Cu.prototype.clear=ML;Cu.prototype.delete=NL;Cu.prototype.get=GL;Cu.prototype.has=HL;Cu.prototype.set=CY;var Wh=Cu,XY="__lodash_hash_undefined__";function WY(t){return this.__data__.set(t,XY),this}var zY=WY;function EY(t){return this.__data__.has(t)}var qY=EY;function Xp(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new cg;++e<i;)this.add(t[e])}Xp.prototype.add=Xp.prototype.push=zY;Xp.prototype.has=qY;var UY=Xp;function IY(t,e){for(var i=-1,n=t==null?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var AY=IY;function LY(t,e){return t.has(e)}var YY=LY,ZY=1,jY=2;function DY(t,e,i,n,r,o){var s=i&ZY,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var O=-1,h=!0,f=i&jY?new UY:void 0;for(o.set(t,e),o.set(e,t);++O<a;){var m=t[O],Q=e[O];if(n)var v=s?n(Q,m,O,e,t,o):n(m,Q,O,t,e,o);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!AY(e,function(p,d){if(!YY(f,d)&&(m===p||r(m,p,i,n,o)))return f.push(d)})){h=!1;break}}else if(!(m===Q||r(m,Q,i,n,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var aW=DY,MY=Fs.Uint8Array,JP=MY;function VY(t){var e=-1,i=Array(t.size);return t.forEach(function(n,r){i[++e]=[r,n]}),i}var NY=VY;function BY(t){var e=-1,i=Array(t.size);return t.forEach(function(n){i[++e]=n}),i}var GY=BY,FY=1,HY=2,KY="[object Boolean]",JY="[object Date]",eZ="[object Error]",tZ="[object Map]",iZ="[object Number]",nZ="[object RegExp]",rZ="[object Set]",oZ="[object String]",sZ="[object Symbol]",aZ="[object ArrayBuffer]",lZ="[object DataView]",ek=qa?qa.prototype:void 0,rv=ek?ek.valueOf:void 0;function cZ(t,e,i,n,r,o,s){switch(i){case lZ:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case aZ:return!(t.byteLength!=e.byteLength||!o(new JP(t),new JP(e)));case KY:case JY:case iZ:return sW(+t,+e);case eZ:return t.name==e.name&&t.message==e.message;case nZ:case oZ:return t==e+"";case tZ:var a=NY;case rZ:var l=n&FY;if(a||(a=GY),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;n|=HY,s.set(t,e);var u=aW(a(t),a(e),n,r,o,s);return s.delete(t),u;case sZ:if(rv)return rv.call(t)==rv.call(e)}return!1}var uZ=cZ;function OZ(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}var fZ=OZ;function dZ(t,e,i){var n=e(t);return Ms(t)?n:fZ(n,i(t))}var hZ=dZ;function pZ(t,e){for(var i=-1,n=t==null?0:t.length,r=0,o=[];++i<n;){var s=t[i];e(s,i,t)&&(o[r++]=s)}return o}var mZ=pZ;function gZ(){return[]}var yZ=gZ,vZ=Object.prototype,bZ=vZ.propertyIsEnumerable,tk=Object.getOwnPropertySymbols,QZ=tk?function(t){return t==null?[]:(t=Object(t),mZ(tk(t),function(e){return bZ.call(t,e)}))}:yZ,$Z=QZ;function SZ(t){return hZ(t,SS,$Z)}var ik=SZ,wZ=1,xZ=Object.prototype,PZ=xZ.hasOwnProperty;function kZ(t,e,i,n,r,o){var s=i&wZ,a=ik(t),l=a.length,c=ik(e),u=c.length;if(l!=u&&!s)return!1;for(var O=l;O--;){var h=a[O];if(!(s?h in e:PZ.call(e,h)))return!1}var f=o.get(t),m=o.get(e);if(f&&m)return f==e&&m==t;var Q=!0;o.set(t,e),o.set(e,t);for(var v=s;++O<l;){h=a[O];var p=t[h],d=e[h];if(n)var g=s?n(d,p,h,e,t,o):n(p,d,h,t,e,o);if(!(g===void 0?p===d||r(p,d,i,n,o):g)){Q=!1;break}v||(v=h=="constructor")}if(Q&&!v){var b=t.constructor,$=e.constructor;b!=$&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof $=="function"&&$ instanceof $)&&(Q=!1)}return o.delete(t),o.delete(e),Q}var TZ=kZ,_Z=Bl(Fs,"DataView"),Tb=_Z,RZ=Bl(Fs,"Promise"),_b=RZ,CZ=Bl(Fs,"Set"),Rb=CZ,XZ=Bl(Fs,"WeakMap"),Cb=XZ,nk="[object Map]",WZ="[object Object]",rk="[object Promise]",ok="[object Set]",sk="[object WeakMap]",ak="[object DataView]",zZ=Nl(Tb),EZ=Nl($f),qZ=Nl(_b),UZ=Nl(Rb),IZ=Nl(Cb),ul=ku;(Tb&&ul(new Tb(new ArrayBuffer(1)))!=ak||$f&&ul(new $f)!=nk||_b&&ul(_b.resolve())!=rk||Rb&&ul(new Rb)!=ok||Cb&&ul(new Cb)!=sk)&&(ul=function(t){var e=ku(t),i=e==WZ?t.constructor:void 0,n=i?Nl(i):"";if(n)switch(n){case zZ:return ak;case EZ:return nk;case qZ:return rk;case UZ:return ok;case IZ:return sk}return e});var lk=ul,AZ=1,ck="[object Arguments]",uk="[object Array]",Ud="[object Object]",LZ=Object.prototype,Ok=LZ.hasOwnProperty;function YZ(t,e,i,n,r,o){var s=Ms(t),a=Ms(e),l=s?uk:lk(t),c=a?uk:lk(e);l=l==ck?Ud:l,c=c==ck?Ud:c;var u=l==Ud,O=c==Ud,h=l==c;if(h&&kb(t)){if(!kb(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Wh),s||oW(t)?aW(t,e,i,n,r,o):uZ(t,e,l,i,n,r,o);if(!(i&AZ)){var f=u&&Ok.call(t,"__wrapped__"),m=O&&Ok.call(e,"__wrapped__");if(f||m){var Q=f?t.value():t,v=m?e.value():e;return o||(o=new Wh),r(Q,v,i,n,o)}}return h?(o||(o=new Wh),TZ(t,e,i,n,r,o)):!1}var ZZ=YZ;function lW(t,e,i,n,r){return t===e?!0:t==null||e==null||!nu(t)&&!nu(e)?t!==t&&e!==e:ZZ(t,e,i,n,lW,r)}var cW=lW,jZ=1,DZ=2;function MZ(t,e,i,n){var r=i.length,o=r,s=!n;if(t==null)return!o;for(t=Object(t);r--;){var a=i[r];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++r<o;){a=i[r];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in t))return!1}else{var O=new Wh;if(n)var h=n(c,u,l,t,e,O);if(!(h===void 0?cW(u,c,jZ|DZ,n,O):h))return!1}}return!0}var VZ=MZ;function NZ(t){return t===t&&!QS(t)}var uW=NZ;function BZ(t){for(var e=SS(t),i=e.length;i--;){var n=e[i],r=t[n];e[i]=[n,r,uW(r)]}return e}var GZ=BZ;function FZ(t,e){return function(i){return i==null?!1:i[t]===e&&(e!==void 0||t in Object(i))}}var OW=FZ;function HZ(t){var e=GZ(t);return e.length==1&&e[0][2]?OW(e[0][0],e[0][1]):function(i){return i===t||VZ(i,t,e)}}var KZ=HZ,JZ="[object Symbol]";function ej(t){return typeof t=="symbol"||nu(t)&&ku(t)==JZ}var wS=ej,tj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ij=/^\w*$/;function nj(t,e){if(Ms(t))return!1;var i=typeof t;return i=="number"||i=="symbol"||i=="boolean"||t==null||wS(t)?!0:ij.test(t)||!tj.test(t)||e!=null&&t in Object(e)}var xS=nj,rj="Expected a function";function PS(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(rj);var i=function(){var n=arguments,r=e?e.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var s=t.apply(this,n);return i.cache=o.set(r,s)||o,s};return i.cache=new(PS.Cache||cg),i}PS.Cache=cg;var oj=PS,sj=500;function aj(t){var e=oj(t,function(n){return i.size===sj&&i.clear(),n}),i=e.cache;return e}var lj=aj,cj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uj=/\\(\\)?/g,Oj=lj(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(cj,function(i,n,r,o){e.push(r?o.replace(uj,"$1"):n||i)}),e}),fj=Oj;function dj(t,e){for(var i=-1,n=t==null?0:t.length,r=Array(n);++i<n;)r[i]=e(t[i],i,t);return r}var hj=dj,pj=1/0,fk=qa?qa.prototype:void 0,dk=fk?fk.toString:void 0;function fW(t){if(typeof t=="string")return t;if(Ms(t))return hj(t,fW)+"";if(wS(t))return dk?dk.call(t):"";var e=t+"";return e=="0"&&1/t==-pj?"-0":e}var mj=fW;function gj(t){return t==null?"":mj(t)}var yj=gj;function vj(t,e){return Ms(t)?t:xS(t,e)?[t]:fj(yj(t))}var dW=vj,bj=1/0;function Qj(t){if(typeof t=="string"||wS(t))return t;var e=t+"";return e=="0"&&1/t==-bj?"-0":e}var ug=Qj;function $j(t,e){e=dW(e,t);for(var i=0,n=e.length;t!=null&&i<n;)t=t[ug(e[i++])];return i&&i==n?t:void 0}var hW=$j;function Sj(t,e,i){var n=t==null?void 0:hW(t,e);return n===void 0?i:n}var wj=Sj;function xj(t,e){return t!=null&&e in Object(t)}var Pj=xj;function kj(t,e,i){e=dW(e,t);for(var n=-1,r=e.length,o=!1;++n<r;){var s=ug(e[n]);if(!(o=t!=null&&i(t,s)))break;t=t[s]}return o||++n!=r?o:(r=t==null?0:t.length,!!r&&$S(r)&&rW(s,r)&&(Ms(t)||nW(t)))}var Tj=kj;function _j(t,e){return t!=null&&Tj(t,e,Pj)}var Rj=_j,Cj=1,Xj=2;function Wj(t,e){return xS(t)&&uW(e)?OW(ug(t),e):function(i){var n=wj(i,t);return n===void 0&&n===e?Rj(i,t):cW(e,n,Cj|Xj)}}var zj=Wj;function Ej(t){return t}var qj=Ej;function Uj(t){return function(e){return e==null?void 0:e[t]}}var Ij=Uj;function Aj(t){return function(e){return hW(e,t)}}var Lj=Aj;function Yj(t){return xS(t)?Ij(ug(t)):Lj(t)}var Zj=Yj;function jj(t){return typeof t=="function"?t:t==null?qj:typeof t=="object"?Ms(t)?zj(t[0],t[1]):KZ(t):Zj(t)}var Dj=jj;function Mj(t,e){var i={};return e=Dj(e),_L(t,function(n,r,o){h7(i,r,e(n,r,o))}),i}var Vj=Mj;const kS=(t,e)=>Vj(e,i=>i[t]),fs=Object.create(null);fs.open="0";fs.close="1";fs.ping="2";fs.pong="3";fs.message="4";fs.upgrade="5";fs.noop="6";const zh=Object.create(null);Object.keys(fs).forEach(t=>{zh[fs[t]]=t});const Nj={type:"error",data:"parser error"},Bj=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Gj=typeof ArrayBuffer=="function",Fj=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,pW=({type:t,data:e},i,n)=>Bj&&e instanceof Blob?i?n(e):hk(e,n):Gj&&(e instanceof ArrayBuffer||Fj(e))?i?n(e):hk(new Blob([e]),n):n(fs[t]+(e||"")),hk=(t,e)=>{const i=new FileReader;return i.onload=function(){const n=i.result.split(",")[1];e("b"+n)},i.readAsDataURL(t)},pk="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",SO=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let t=0;t<pk.length;t++)SO[pk.charCodeAt(t)]=t;const Hj=t=>{let e=t.length*.75,i=t.length,n,r=0,o,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),u=new Uint8Array(c);for(n=0;n<i;n+=4)o=SO[t.charCodeAt(n)],s=SO[t.charCodeAt(n+1)],a=SO[t.charCodeAt(n+2)],l=SO[t.charCodeAt(n+3)],u[r++]=o<<2|s>>4,u[r++]=(s&15)<<4|a>>2,u[r++]=(a&3)<<6|l&63;return c},Kj=typeof ArrayBuffer=="function",mW=(t,e)=>{if(typeof t!="string")return{type:"message",data:gW(t,e)};const i=t.charAt(0);return i==="b"?{type:"message",data:Jj(t.substring(1),e)}:zh[i]?t.length>1?{type:zh[i],data:t.substring(1)}:{type:zh[i]}:Nj},Jj=(t,e)=>{if(Kj){const i=Hj(t);return gW(i,e)}else return{base64:!0,data:t}},gW=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},yW=String.fromCharCode(30),eD=(t,e)=>{const i=t.length,n=new Array(i);let r=0;t.forEach((o,s)=>{pW(o,!1,a=>{n[s]=a,++r===i&&e(n.join(yW))})})},tD=(t,e)=>{const i=t.split(yW),n=[];for(let r=0;r<i.length;r++){const o=mW(i[r],e);if(n.push(o),o.type==="error")break}return n},vW=4;function Ni(t){if(t)return iD(t)}function iD(t){for(var e in Ni.prototype)t[e]=Ni.prototype[e];return t}Ni.prototype.on=Ni.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Ni.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this};Ni.prototype.off=Ni.prototype.removeListener=Ni.prototype.removeAllListeners=Ni.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,r=0;r<i.length;r++)if(n=i[r],n===e||n.fn===e){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+t],this};Ni.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){i=i.slice(0);for(var n=0,r=i.length;n<r;++n)i[n].apply(this,e)}return this};Ni.prototype.emitReserved=Ni.prototype.emit;Ni.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Ni.prototype.hasListeners=function(t){return!!this.listeners(t).length};const ya=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())();function bW(t,...e){return e.reduce((i,n)=>(t.hasOwnProperty(n)&&(i[n]=t[n]),i),{})}const nD=setTimeout,rD=clearTimeout;function Og(t,e){e.useNativeTimers?(t.setTimeoutFn=nD.bind(ya),t.clearTimeoutFn=rD.bind(ya)):(t.setTimeoutFn=setTimeout.bind(ya),t.clearTimeoutFn=clearTimeout.bind(ya))}const oD=1.33;function sD(t){return typeof t=="string"?aD(t):Math.ceil((t.byteLength||t.size)*oD)}function aD(t){let e=0,i=0;for(let n=0,r=t.length;n<r;n++)e=t.charCodeAt(n),e<128?i+=1:e<2048?i+=2:e<55296||e>=57344?i+=3:(n++,i+=4);return i}class lD extends Error{constructor(e,i,n){super(e),this.description=i,this.context=n,this.type="TransportError"}}class QW extends Ni{constructor(e){super(),this.writable=!1,Og(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,i,n){return super.emitReserved("error",new lD(e,i,n)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const i=mW(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const $W="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Xb=64,cD={};let mk=0,Id=0,gk;function yk(t){let e="";do e=$W[t%Xb]+e,t=Math.floor(t/Xb);while(t>0);return e}function SW(){const t=yk(+new Date);return t!==gk?(mk=0,gk=t):t+"."+yk(mk++)}for(;Id<Xb;Id++)cD[$W[Id]]=Id;function wW(t){let e="";for(let i in t)t.hasOwnProperty(i)&&(e.length&&(e+="&"),e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return e}function uD(t){let e={},i=t.split("&");for(let n=0,r=i.length;n<r;n++){let o=i[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}let xW=!1;try{xW=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch{}const OD=xW;function PW(t){const e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||OD))return new XMLHttpRequest}catch{}if(!e)try{return new ya[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function fD(){}const dD=function(){return new PW({xdomain:!1}).responseType!=null}();class hD extends QW{constructor(e){if(super(e),this.polling=!1,typeof location!="undefined"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==n}const i=e&&e.forceBase64;this.supportsBinary=dD&&!i}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const i=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let n=0;this.polling&&(n++,this.once("pollComplete",function(){--n||i()})),this.writable||(n++,this.once("drain",function(){--n||i()}))}else i()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const i=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};tD(e,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,eD(e,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const i=this.opts.secure?"https":"http";let n="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=SW()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(i==="https"&&Number(this.opts.port)!==443||i==="http"&&Number(this.opts.port)!==80)&&(n=":"+this.opts.port);const r=wW(e),o=this.opts.hostname.indexOf(":")!==-1;return i+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new as(this.uri(),e)}doWrite(e,i){const n=this.request({method:"POST",data:e});n.on("success",i),n.on("error",(r,o)=>{this.onError("xhr post error",r,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(i,n)=>{this.onError("xhr poll error",i,n)}),this.pollXhr=e}}class as extends Ni{constructor(e,i){super(),Og(this,i),this.opts=i,this.method=i.method||"GET",this.uri=e,this.async=i.async!==!1,this.data=i.data!==void 0?i.data:null,this.create()}create(){const e=bW(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const i=this.xhr=new PW(e);try{i.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this.opts.extraHeaders[n])}}catch{}if(this.method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in i&&(i.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(i.timeout=this.opts.requestTimeout),i.onreadystatechange=()=>{i.readyState===4&&(i.status===200||i.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof i.status=="number"?i.status:0)},0))},i.send(this.data)}catch(n){this.setTimeoutFn(()=>{this.onError(n)},0);return}typeof document!="undefined"&&(this.index=as.requestsCount++,as.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr=="undefined"||this.xhr===null)){if(this.xhr.onreadystatechange=fD,e)try{this.xhr.abort()}catch{}typeof document!="undefined"&&delete as.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}as.requestsCount=0;as.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",vk);else if(typeof addEventListener=="function"){const t="onpagehide"in ya?"pagehide":"unload";addEventListener(t,vk,!1)}}function vk(){for(let t in as.requests)as.requests.hasOwnProperty(t)&&as.requests[t].abort()}const pD=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,i)=>i(e,0))(),Ad=ya.WebSocket||ya.MozWebSocket,bk=!0,mD="arraybuffer",Qk=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class gD extends QW{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),i=this.opts.protocols,n=Qk?{}:bW(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=bk&&!Qk?i?new Ad(e,i):new Ad(e):new Ad(e,i,n)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType||mD,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 i=0;i<e.length;i++){const n=e[i],r=i===e.length-1;pW(n,this.supportsBinary,o=>{const s={};try{bk&&this.ws.send(o)}catch{}r&&pD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const i=this.opts.secure?"wss":"ws";let n="";this.opts.port&&(i==="wss"&&Number(this.opts.port)!==443||i==="ws"&&Number(this.opts.port)!==80)&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=SW()),this.supportsBinary||(e.b64=1);const r=wW(e),o=this.opts.hostname.indexOf(":")!==-1;return i+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!Ad}}const yD={websocket:gD,polling:hD},vD=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,bD=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Wb(t){const e=t,i=t.indexOf("["),n=t.indexOf("]");i!=-1&&n!=-1&&(t=t.substring(0,i)+t.substring(i,n).replace(/:/g,";")+t.substring(n,t.length));let r=vD.exec(t||""),o={},s=14;for(;s--;)o[bD[s]]=r[s]||"";return i!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=QD(o,o.path),o.queryKey=$D(o,o.query),o}function QD(t,e){const i=/\/{2,9}/g,n=e.replace(i,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&n.splice(0,1),e.substr(e.length-1,1)=="/"&&n.splice(n.length-1,1),n}function $D(t,e){const i={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,r,o){r&&(i[r]=o)}),i}class da extends Ni{constructor(e,i={}){super(),e&&typeof e=="object"&&(i=e,e=null),e?(e=Wb(e),i.hostname=e.host,i.secure=e.protocol==="https"||e.protocol==="wss",i.port=e.port,e.query&&(i.query=e.query)):i.host&&(i.hostname=Wb(i.host).host),Og(this,i),this.secure=i.secure!=null?i.secure:typeof location!="undefined"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=i.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=i.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},i),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=uD(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const i=Object.assign({},this.opts.query);i.EIO=vW,i.transport=e,this.id&&(i.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new yD[e](n)}open(){let e;if(this.opts.rememberUpgrade&&da.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}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",i=>this.onClose("transport close",i))}probe(e){let i=this.createTransport(e),n=!1;da.priorWebsocketSuccess=!1;const r=()=>{n||(i.send([{type:"ping",data:"probe"}]),i.once("packet",O=>{if(!n)if(O.type==="pong"&&O.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;da.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(u(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=i.name,this.emitReserved("upgradeError",h)}}))};function o(){n||(n=!0,u(),i.close(),i=null)}const s=O=>{const h=new Error("probe error: "+O);h.transport=i.name,o(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(O){i&&O.name!==i.name&&o()}const u=()=>{i.removeListener("open",r),i.removeListener("error",s),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",r),i.once("error",s),i.once("close",a),this.once("close",l),this.once("upgrading",c),i.open()}onOpen(){if(this.readyState="open",da.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const i=this.upgrades.length;for(;e<i;e++)this.probe(this.upgrades[e])}}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.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const i=new Error("server error");i.code=e.data,this.onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(i+=sD(r)),n>0&&i>this.maxPayload)return this.writeBuffer.slice(0,n);i+=2}return this.writeBuffer}write(e,i,n){return this.sendPacket("message",e,i,n),this}send(e,i,n){return this.sendPacket("message",e,i,n),this}sendPacket(e,i,n,r){if(typeof i=="function"&&(r=i,i=void 0),typeof n=="function"&&(r=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:i,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},n=()=>{this.once("upgrade",i),this.once("upgradeError",i)};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(e){da.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,i){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const i=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&i.push(e[n]);return i}}da.protocol=vW;function SD(t,e="",i){let n=t;i=i||typeof location!="undefined"&&location,t==null&&(t=i.protocol+"//"+i.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=i.protocol+t:t=i.host+t),/^(https?|wss?):\/\//.test(t)||(typeof i!="undefined"?t=i.protocol+"//"+t:t="https://"+t),n=Wb(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(i&&i.port===n.port?"":":"+n.port),n}const wD=typeof ArrayBuffer=="function",xD=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,kW=Object.prototype.toString,PD=typeof Blob=="function"||typeof Blob!="undefined"&&kW.call(Blob)==="[object BlobConstructor]",kD=typeof File=="function"||typeof File!="undefined"&&kW.call(File)==="[object FileConstructor]";function TS(t){return wD&&(t instanceof ArrayBuffer||xD(t))||PD&&t instanceof Blob||kD&&t instanceof File}function Eh(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let i=0,n=t.length;i<n;i++)if(Eh(t[i]))return!0;return!1}if(TS(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Eh(t.toJSON(),!0);for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&Eh(t[i]))return!0;return!1}function TD(t){const e=[],i=t.data,n=t;return n.data=zb(i,e),n.attachments=e.length,{packet:n,buffers:e}}function zb(t,e){if(!t)return t;if(TS(t)){const i={_placeholder:!0,num:e.length};return e.push(t),i}else if(Array.isArray(t)){const i=new Array(t.length);for(let n=0;n<t.length;n++)i[n]=zb(t[n],e);return i}else if(typeof t=="object"&&!(t instanceof Date)){const i={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=zb(t[n],e));return i}return t}function _D(t,e){return t.data=Eb(t.data,e),t.attachments=void 0,t}function Eb(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=Eb(t[i],e);else if(typeof t=="object")for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(t[i]=Eb(t[i],e));return t}const RD=5;var gt;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(gt||(gt={}));class CD{constructor(e){this.replacer=e}encode(e){return(e.type===gt.EVENT||e.type===gt.ACK)&&Eh(e)?(e.type=e.type===gt.EVENT?gt.BINARY_EVENT:gt.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===gt.BINARY_EVENT||e.type===gt.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(i+=e.nsp+","),e.id!=null&&(i+=e.id),e.data!=null&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){const i=TD(e),n=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(n),r}}class _S extends Ni{constructor(e){super(),this.reviver=e}add(e){let i;if(typeof e=="string")i=this.decodeString(e),i.type===gt.BINARY_EVENT||i.type===gt.BINARY_ACK?(this.reconstructor=new XD(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i);else if(TS(e)||e.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(e),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let i=0;const n={type:Number(e.charAt(0))};if(gt[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===gt.BINARY_EVENT||n.type===gt.BINARY_ACK){const o=i+1;for(;e.charAt(++i)!=="-"&&i!=e.length;);const s=e.substring(o,i);if(s!=Number(s)||e.charAt(i)!=="-")throw new Error("Illegal attachments");n.attachments=Number(s)}if(e.charAt(i+1)==="/"){const o=i+1;for(;++i&&!(e.charAt(i)===","||i===e.length););n.nsp=e.substring(o,i)}else n.nsp="/";const r=e.charAt(i+1);if(r!==""&&Number(r)==r){const o=i+1;for(;++i;){const s=e.charAt(i);if(s==null||Number(s)!=s){--i;break}if(i===e.length)break}n.id=Number(e.substring(o,i+1))}if(e.charAt(++i)){const o=this.tryParse(e.substr(i));if(_S.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,i){switch(e){case gt.CONNECT:return typeof i=="object";case gt.DISCONNECT:return i===void 0;case gt.CONNECT_ERROR:return typeof i=="string"||typeof i=="object";case gt.EVENT:case gt.BINARY_EVENT:return Array.isArray(i)&&i.length>0;case gt.ACK:case gt.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class XD{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const i=_D(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var WD=Object.freeze(Object.defineProperty({__proto__:null,protocol:RD,get PacketType(){return gt},Encoder:CD,Decoder:_S},Symbol.toStringTag,{value:"Module"}));function zo(t,e,i){return t.on(e,i),function(){t.off(e,i)}}const zD=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class TW extends Ni{constructor(e,i,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[zo(e,"open",this.onopen.bind(this)),zo(e,"packet",this.onpacket.bind(this)),zo(e,"error",this.onerror.bind(this)),zo(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,...i){if(zD.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');i.unshift(e);const n={type:gt.EVENT,data:i};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const s=this.ids++,a=i.pop();this._registerAckCallback(s,a),n.id=s}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,i){const n=this.flags.timeout;if(n===void 0){this.acks[e]=i;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);i.call(this,new Error("operation has timed out"))},n);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(r),i.apply(this,[null,...o])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:gt.CONNECT,data:e})}):this.packet({type:gt.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case gt.CONNECT:if(e.data&&e.data.sid){const r=e.data.sid;this.onconnect(r)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case gt.EVENT:case gt.BINARY_EVENT:this.onevent(e);break;case gt.ACK:case gt.BINARY_ACK:this.onack(e);break;case gt.DISCONNECT:this.ondisconnect();break;case gt.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const i=e.data||[];e.id!=null&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const n of i)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const i=this;let n=!1;return function(...r){n||(n=!0,i.packet({type:gt.ACK,id:e,data:r}))}}onack(e){const i=this.acks[e.id];typeof i=="function"&&(i.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),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()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:gt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const i=this._anyListeners;for(let n=0;n<i.length;n++)if(e===i[n])return i.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){const i=this._anyOutgoingListeners;for(let n=0;n<i.length;n++)if(e===i[n])return i.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const n of i)n.apply(this,e.data)}}}function Xu(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Xu.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),i=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-i:t+i}return Math.min(t,this.max)|0};Xu.prototype.reset=function(){this.attempts=0};Xu.prototype.setMin=function(t){this.ms=t};Xu.prototype.setMax=function(t){this.max=t};Xu.prototype.setJitter=function(t){this.jitter=t};class qb extends Ni{constructor(e,i){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(i=e,e=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Og(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((n=i.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Xu({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=e;const r=i.parser||WD;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(i=this.backoff)===null||i===void 0||i.setMin(e),this)}randomizationFactor(e){var i;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(i=this.backoff)===null||i===void 0||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(i=this.backoff)===null||i===void 0||i.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 da(this.uri,this.opts);const i=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=zo(i,"open",function(){n.onopen(),e&&e()}),o=zo(i,"error",s=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",s),e?e(s):n.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&r();const a=this.setTimeoutFn(()=>{r(),i.close(),i.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(zo(e,"ping",this.onping.bind(this)),zo(e,"data",this.ondata.bind(this)),zo(e,"error",this.onerror.bind(this)),zo(e,"close",this.onclose.bind(this)),zo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,i){let n=this.nsps[e];return n||(n=new TW(this,e,i),this.nsps[e]=n),n}_destroy(e){const i=Object.keys(this.nsps);for(const n of i)if(this.nsps[n].active)return;this._close()}_packet(e){const i=this.encoder.encode(e);for(let n=0;n<i.length;n++)this.engine.write(i[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"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,i){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},i);this.opts.autoUnref&&n.unref(),this.subs.push(function(){clearTimeout(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ju={};function qh(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const i=SD(t,e.path||"/socket.io"),n=i.source,r=i.id,o=i.path,s=Ju[r]&&o in Ju[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new qb(n,e):(Ju[r]||(Ju[r]=new qb(n,e)),l=Ju[r]),i.query&&!e.query&&(e.query=i.queryKey),l.socket(i.path,e)}Object.assign(qh,{Manager:qb,Socket:TW,io:qh,connect:qh});var Ut=(t=>(t.Loading="loading",t.Ready="ready",t.Offline="offline",t.Online="online",t.StatusChanged="statusChanged",t.LspStatusChanged="lspStatusChanged",t.PlaygroundChanged="playgroundChanged",t.Following="following",t.UnFollowing="unFollowing",t.RunStatusChanged="runStatusChanged",t.FileStructureChanged="fileStructureChanged",t.FileContentChanged="fileContentChanged",t.AppendToConsole="appendToConsole",t.AppendToTerminal="appendToTerminal",t.ApplicationAvailable="ApplicationAvailable",t.PlaybackInfo="playbackInfo",t.ReplayStart="ReplayStart",t.ReplayEnd="ReplayEnd",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.ConnectionBroken="connectionBroken",t.ConnectionFailed="connectionFailed",t.AuthorizationFailed="authorizationFailed",t.FileStructureDamaged="fileStructureDamaged",t.ErrorFromServer="errorFromServer",t))(Ut||{}),ro=(t=>(t.Authorize="auth",t.Active="active",t.Run="run",t.Stop="stop",t.Heartbeat="heartbeat",t.SetFileLockStatus="",t.SetFileVisiable="",t.AddFileToUnitTest="",t.RemoveFileFromUnitTest="",t.KeyEvent="keyEvent",t.File="file",t.EditFile="editFile",t.FileTree="fileTree",t.Terminal="terminal",t.Cursor="cursor",t.GetPlaybackInfo="getPlaybackInfo",t.LoadPlaybackData="loadPlaybackData",t.FollowingAgentUser="followingAgentUser",t.UnFollowingAgentUser="unFollowingAgentUser",t.FollowingFocusComponent="followingFocusComponent",t.FollowingEditorScroll="followingEditorScroll",t))(ro||{}),pt=(t=>(t.Connect="connect",t.Disconnect="disconnect",t.AuthAck="authAck",t.Active="active",t.SyncPlaygroundInfo="syncPlaygroundInfo",t.ChangePlaygroundInfo="changePlaygroundInfo",t.RunStatus="runStatus",t.LspStatus="lspStatus",t.Following="following",t.UnFollowing="unFollowing",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.Simulator="simulator",t.PlaybackInfo="playbackInfo",t.PlaybackData="playbackData",t.File="file",t.FileTree="fileTree",t.Run="run",t.Console="console",t.Terminal="terminal",t.KeyEvent="keyEvent",t.CloseFile="closeFile",t.FocusComponent="FocusComponent",t.InvisibleComponentActive="InvisibleComponentActive",t))(pt||{});class ED{constructor(e,i=2e3){et(this,"name");et(this,"channel");et(this,"_timeout");et(this,"_messageId");et(this,"_messages");et(this,"_filter");this.name=e,this._messageId=0,this.channel=new BroadcastChannel(e),this.channel.onmessage=n=>this.receive(n),this._messages=[],this._timeout=i}setFilter(e){this._filter=e}send(e,i){const n=new qD(i||this._timeout),r=new Promise((o,s)=>{n._reject=s,n._resolve=o});return this._messages.push(n),this.channel.postMessage({id:this._messageId++,type:"request",payload:e}),r}answer(e,i){this.channel.postMessage({id:e,type:"response",payload:i})}receive(e){const i=e.data;i.type==="request"?(!this._filter||this._filter(i.payload))&&this.answer(i.id,{active:!0}):i.type==="response"&&this._messages[i.id].reject(i.payload)}}class qD{constructor(e){et(this,"_resolve");et(this,"_reject");et(this,"_interval");this._interval=setTimeout(()=>this.resolve({active:!1,reason:"timeout, no one uses it"}),e)}resolve(e){clearTimeout(this._interval),this._resolve(e)}reject(e){this._reject(e)}}let _W,Ld;async function UD(){Ld||(Ld=new ED("dao-paas",500));let t="";Ld.setFilter(n=>n.id===t);const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],i=[];for(const n of e){const r=Ld.send(n).then(()=>{if(t==="")return n.time=new Date().getTime(),t=n.id,localStorage.setItem("agentUsers",JSON.stringify(e)),Promise.resolve(t)});i.push(r)}return Promise.any(i)}function ID(t){const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],i=e.find(n=>n.id==t);i?i.time=new Date().getTime():e.push({id:t,time:new Date().getTime()}),localStorage.setItem("agentUsers",JSON.stringify(e)),_W=t}function AD(t){return t===_W}const RW="daoLogger",LD=typeof module=="object"&&typeof module.exports=="object",ov=LD?global:window,CW=ov&&ov.localStorage?ov.localStorage:{store:{},getItem(t){return this.store[t]},setItem(t,e){this.store[t]=e}},_t=new Proxy(console,{get(t,e){return CW.getItem(RW)?t[e]:()=>{}}}),YD=()=>{CW.setItem(RW,"*")},ZD=[1,2,3,5,8,16];class jD{constructor(e,i,n,r,o,s){et(this,"start");et(this,"end");et(this,"totalTime");et(this,"rate");et(this,"preFrameTime",0);et(this,"resumeTime",0);et(this,"dataBuffer",[]);et(this,"playing",!1);et(this,"isReplay",!1);et(this,"index",0);et(this,"firstFrameTime",0);et(this,"isMovePosition",!1);et(this,"eventDispatcher");et(this,"getPlaybackSnapshot");et(this,"progressDispatcher");this.start=e,this.end=i,this.rate=1,this.totalTime=i-e,this.eventDispatcher=r,this.progressDispatcher=o,this.getPlaybackSnapshot=s,this.step=this.step.bind(this)}convertToAbsoluteTime(e){return this.start+e}setRate(e){e&&!ZD.includes(e)&&this.progressDispatcher&&this.progressDispatcher("error",`Invalid parameter: rate=${e}`),this.rate=e||this.rate}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(!this.playing){_t.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.index=0,this.resumeTime=0,this.playing=!0,window.requestAnimationFrame(this.step)}movePosition(e){this.resumeTime=e,this.playing=!0,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,i=this.dataBuffer,n=i.length,r=(a,l)=>{var c,u,O,h;if(a<=l){const f=Math.floor((l-a)/2+a),m=i[f].timestamp;return m===e?f:e===((c=i[f-1])==null?void 0:c.timestamp)?f-1:e===((u=i[f+1])==null?void 0:u.timestamp)||e>((O=i[f-1])==null?void 0:O.timestamp)&&e<((h=i[f+1])==null?void 0:h.timestamp)?f+1:(e<m?l=f-1:e>m&&(a=f+1),r(a,l))}else return _t.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=n-1;return r(o,s)}step(){var i,n;if(!this.playing)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.resumeTime>=this.totalTime&&this.index>this.dataBuffer.length-1){(i=this.progressDispatcher)==null||i.call(this,"complete",this.resumeTime);return}this.progressDispatcher&&this.progressDispatcher("progress",this.resumeTime);let e=this.dataBuffer[this.index];this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.isMovePosition?(this.dataBuffer.filter(r=>{r.eventName===e.eventName&&r.timestamp<e.timestamp,r.snapshot}).sort((r,o)=>r.timestamp-o.timestamp).forEach(r=>{var o;r=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,r.eventName,r))||r}),this.isMovePosition=!1):e=((n=this.getPlaybackSnapshot)==null?void 0:n.call(this,e.eventName,e))||e,this.trigger(e.eventName,e),this.index++),this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step)}trigger(e,i){this.eventDispatcher(e,i)}}const DD="@dao42/d42paas-front",MD="0.9.30",VD="d42paas front",ND="dao42 paas team",BD="https://github.com/dao42/d42paas_frontend#readme",GD="UNLICENSED",FD="./dist/DaoPaaS.cjs",HD="./dist/DaoPaaS.cjs",KD="./dist/DaoPaaS.d.ts",JD={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test:"jest --coverage",prepublish:"pnpm build",publish:"npm publish --access public"},eM={"@codemirror/autocomplete":"^6.0.2","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-cpp":"^6.0.0","@codemirror/lang-css":"^6.0.0","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.0.0","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"^6.0.0","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.0.0","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/legacy-modes":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.0.0","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.4.1","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.isequal":"^4.5.6","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15",prettier:"^2.3.2","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-markdown":"^8.0.0","react-transition-group":"^4.4.2","reconnecting-websocket":"^4.4.0","rehype-katex":"^6.0.2","remark-math":"^5.1.1",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.7.2","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1"},tM=["dist"],iM={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},nM={url:"https://github.com/dao42/d42paas_frontend/issues"},rM={workerDirectory:"src"},oM={"lodash.clonedeep":"^4.5.0","lodash.isequal":"^4.5.0"};var sM={name:DD,version:MD,description:VD,author:ND,homepage:BD,license:GD,main:FD,module:HD,types:KD,scripts:JD,devDependencies:eM,files:tM,repository:iM,bugs:nM,msw:rM,dependencies:oM};const aM=()=>sM.version,lM=async(t,e,i)=>{const r=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:i})})).json();if(r.status==="failure")throw _t.error(r),new Error(r.errors[0].erromsg);return r.data},$i=(t,e=1)=>{let i=t.replace("#","");i.length===3&&(i=`${i[0]}${i[0]}${i[1]}${i[1]}${i[2]}${i[2]}`);const n=parseInt(i.substring(0,2),16),r=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${n},${r},${o},${e})`},cM=()=>{const t=`
48
+ */var og=D.exports,KA=FX.exports;function JA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var e8=typeof Object.is=="function"?Object.is:JA,t8=KA.useSyncExternalStore,i8=og.useRef,n8=og.useEffect,r8=og.useMemo,o8=og.useDebugValue;GX.useSyncExternalStoreWithSelector=function(t,e,i,n,r){var o=i8(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=r8(function(){function l(f){if(!c){if(c=!0,u=f,f=n(f),r!==void 0&&s.hasValue){var m=s.value;if(r(m,f))return O=m}return O=f}if(m=O,e8(u,f))return m;var Q=n(f);return r!==void 0&&r(m,Q)?m:(u=f,O=Q)}var c=!1,u,O,h=i===void 0?null:i;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,i,n,r]);var a=t8(t,o[0],o[1]);return n8(function(){s.hasValue=!0,s.value=a},[a]),o8(a),a};BX.exports=GX;function s8(t,e=t.getState,i){const n=BX.exports.useSyncExternalStoreWithSelector(t.subscribe,t.getState,t.getServerState||t.getState,e,i);return D.exports.useDebugValue(n),n}const ZP=t=>{const e=typeof t=="function"?NX(t):t,i=(n,r)=>s8(e,n,r);return Object.assign(i,e),i},a8=t=>t?ZP(t):ZP;var l8=a8,jP=Object.getOwnPropertySymbols,c8=Object.prototype.hasOwnProperty,u8=Object.prototype.propertyIsEnumerable,O8=(t,e)=>{var i={};for(var n in t)c8.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&jP)for(var n of jP(t))e.indexOf(n)<0&&u8.call(t,n)&&(i[n]=t[n]);return i};const f8=(t,e={})=>(i,n,r)=>{const o=e,{enabled:s,anonymousActionType:a}=o,l=O8(o,["enabled","anonymousActionType"]);let c;try{c=(s!=null?s:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&s&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(i,n,r);const u=c.connect(l);let O=!0;r.setState=(m,Q,v)=>{const p=i(m,Q);return O&&u.send(v===void 0?{type:a||"anonymous"}:typeof v=="string"?{type:v}:v,n()),p};const h=(...m)=>{const Q=O;O=!1,i(...m),O=Q},f=t(r.setState,n,r);if(u.init(f),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let m=!1;const Q=r.dispatch;r.dispatch=(...v)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&v[0].type==="__setState"&&!m&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),m=!0),Q(...v)}}return u.subscribe(m=>{var Q;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return iv(m.payload,v=>{if(v.type==="__setState"){h(v.state);return}!r.dispatchFromDevtools||typeof r.dispatch=="function"&&r.dispatch(v)});case"DISPATCH":switch(m.payload.type){case"RESET":return h(f),u.init(r.getState());case"COMMIT":return u.init(r.getState());case"ROLLBACK":return iv(m.state,v=>{h(v),u.init(r.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return iv(m.state,v=>{h(v)});case"IMPORT_STATE":{const{nextLiftedState:v}=m.payload,p=(Q=v.computedStates.slice(-1)[0])==null?void 0:Q.state;if(!p)return;h(p),u.send(null,v);return}case"PAUSE_RECORDING":return O=!O}return}}),f},d8=f8,iv=(t,e)=>{let i;try{i=JSON.parse(t)}catch(n){console.error("[zustand devtools middleware] Could not parse the received json",n)}i!==void 0&&e(i)};var h8=Object.defineProperty,DP=Object.getOwnPropertySymbols,p8=Object.prototype.hasOwnProperty,m8=Object.prototype.propertyIsEnumerable,MP=(t,e,i)=>e in t?h8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,rc=(t,e)=>{for(var i in e||(e={}))p8.call(e,i)&&MP(t,i,e[i]);if(DP)for(var i of DP(e))m8.call(e,i)&&MP(t,i,e[i]);return t};const Cp=t=>e=>{try{const i=t(e);return i instanceof Promise?i:{then(n){return Cp(n)(i)},catch(n){return this}}}catch(i){return{then(n){return this},catch(n){return Cp(n)(i)}}}},g8=(t,e)=>(i,n,r)=>{let o=rc({getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,p)=>rc(rc({},p),v)},e),s=!1;const a=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),i(...v)},n,r);const u=Cp(o.serialize),O=()=>{const v=o.partialize(rc({},n()));let p;const d=u({state:v,version:o.version}).then(g=>c.setItem(o.name,g)).catch(g=>{p=g});if(p)throw p;return d},h=r.setState;r.setState=(v,p)=>{h(v,p),O()};const f=t((...v)=>{i(...v),O()},n,r);let m;const Q=()=>{var v;if(!c)return;s=!1,a.forEach(d=>d(n()));const p=((v=o.onRehydrateStorage)==null?void 0:v.call(o,n()))||void 0;return Cp(c.getItem.bind(c))(o.name).then(d=>{if(d)return o.deserialize(d)}).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==o.version){if(o.migrate)return o.migrate(d.state,d.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return d.state}).then(d=>{var g;return m=o.merge(d,(g=n())!=null?g:f),i(m,!0),O()}).then(()=>{p==null||p(m,void 0),s=!0,l.forEach(d=>d(m))}).catch(d=>{p==null||p(void 0,d)})};return r.persist={setOptions:v=>{o=rc(rc({},o),v),v.getStorage&&(c=v.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},rehydrate:()=>Q(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},Q(),m||f},y8=g8,v8=(t,e)=>{const i={};return Object.keys(t.getState()).forEach(n=>{i[n]=r=>{if(t.getState()[n]===r)return;const s=n.replace(/^\S/,a=>a.toUpperCase());t.setState(a=>{a[n]=r},`@@${e}/set${s}`)}}),i},b8=(t,e)=>{const i=t(e.set,e.get,e);return{...e,set:{...e.set,...i}}},Q8=(t,e)=>{const i={...e.use},n={...e.useTracked},r={...e.get};return Object.keys(t(e.store.getState(),e.get,e)).forEach(o=>{i[o]=(...s)=>e.useStore(a=>{const c=t(a,e.get,e)[o];return c(...s)}),n[o]=(...s)=>{const a=e.useTrackedStore(),c=t(a,e.get,e)[o];return c(...s)},r[o]=(...s)=>{const l=t(e.store.getState(),e.get,e)[o];return l(...s)}}),{...e,get:r,use:i,useTracked:n}},Pb=t=>({...t,extendSelectors:e=>Pb(Q8(e,t)),extendActions:e=>Pb(b8(e,t))}),$8=t=>{const e={};return Object.keys(t.getState()).forEach(i=>{e[i]=()=>t.getState()[i]}),e},S8=t=>{const e={};return Object.keys(t.getState()).forEach(i=>{e[i]=n=>t(r=>r[i],n)}),e},w8=(t,e)=>{const i={};return Object.keys(t.getState()).forEach(n=>{i[n]=()=>e()[n]}),i},x8=t=>(e,i,n)=>{const r=(o,s)=>e(qA(o),!0,s);return n.setState=r,t(r,i,n)};function P8(t,...e){return e.reduce((i,n)=>n(i),t)}const bS=t=>(e,i={})=>{var n;const{middlewares:r=[],devtools:o,persist:s,immer:a}=i;UA((n=a==null?void 0:a.enabledAutoFreeze)!==null&&n!==void 0?n:!1),a!=null&&a.enableMapSet&&RA();const l=[x8,...r];s!=null&&s.enabled&&l.push(b=>y8(b,{...s,name:t})),o!=null&&o.enabled&&l.push(b=>d8(b,{...o,name:t})),l.push(NX);const u=(b=>P8(b,...l))(()=>e),O=l8(u),h=v8(O,t),f=(b,$)=>{u.setState(x=>{Object.assign(x,b)},$||`@@${t}/mergeState`)},m=(b,$)=>{u.setState(b,$||`@@${t}/setState`)},Q=S8(O),v=$8(O),p=ZA(O),d=w8(O,p),g={get:{state:u.getState,...v},name:t,set:{state:m,mergeState:f,...h},store:u,use:Q,useTracked:d,useStore:O,useTrackedStore:p,extendSelectors:()=>g,extendActions:()=>g};return Pb(g)};var qd=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function KX(t,e){return e={exports:{}},t(e,e.exports),e.exports}var k8=typeof qd=="object"&&qd&&qd.Object===Object&&qd,JX=k8,T8=typeof self=="object"&&self&&self.Object===Object&&self,_8=JX||T8||Function("return this")(),Fs=_8,R8=Fs.Symbol,qa=R8,eW=Object.prototype,C8=eW.hasOwnProperty,X8=eW.toString,Ku=qa?qa.toStringTag:void 0;function W8(t){var e=C8.call(t,Ku),i=t[Ku];try{t[Ku]=void 0;var n=!0}catch{}var r=X8.call(t);return n&&(e?t[Ku]=i:delete t[Ku]),r}var z8=W8,E8=Object.prototype,q8=E8.toString;function U8(t){return q8.call(t)}var I8=U8,A8="[object Null]",L8="[object Undefined]",VP=qa?qa.toStringTag:void 0;function Y8(t){return t==null?t===void 0?L8:A8:VP&&VP in Object(t)?z8(t):I8(t)}var ku=Y8;function Z8(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var QS=Z8,j8="[object AsyncFunction]",D8="[object Function]",M8="[object GeneratorFunction]",V8="[object Proxy]";function N8(t){if(!QS(t))return!1;var e=ku(t);return e==D8||e==M8||e==j8||e==V8}var tW=N8,B8=Fs["__core-js_shared__"],nv=B8,NP=function(){var t=/[^.]+$/.exec(nv&&nv.keys&&nv.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function G8(t){return!!NP&&NP in t}var F8=G8,H8=Function.prototype,K8=H8.toString;function J8(t){if(t!=null){try{return K8.call(t)}catch{}try{return t+""}catch{}}return""}var Nl=J8,e7=/[\\^$.*+?()[\]{}|]/g,t7=/^\[object .+?Constructor\]$/,i7=Function.prototype,n7=Object.prototype,r7=i7.toString,o7=n7.hasOwnProperty,s7=RegExp("^"+r7.call(o7).replace(e7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function a7(t){if(!QS(t)||F8(t))return!1;var e=tW(t)?s7:t7;return e.test(Nl(t))}var l7=a7;function c7(t,e){return t==null?void 0:t[e]}var u7=c7;function O7(t,e){var i=u7(t,e);return l7(i)?i:void 0}var Bl=O7,f7=function(){try{var t=Bl(Object,"defineProperty");return t({},"",{}),t}catch{}}(),BP=f7;function d7(t,e,i){e=="__proto__"&&BP?BP(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}var h7=d7;function p7(t){return function(e,i,n){for(var r=-1,o=Object(e),s=n(e),a=s.length;a--;){var l=s[t?a:++r];if(i(o[l],l,o)===!1)break}return e}}var m7=p7,g7=m7(),y7=g7;function v7(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}var b7=v7;function Q7(t){return t!=null&&typeof t=="object"}var nu=Q7,$7="[object Arguments]";function S7(t){return nu(t)&&ku(t)==$7}var GP=S7,iW=Object.prototype,w7=iW.hasOwnProperty,x7=iW.propertyIsEnumerable,P7=GP(function(){return arguments}())?GP:function(t){return nu(t)&&w7.call(t,"callee")&&!x7.call(t,"callee")},nW=P7,k7=Array.isArray,Ms=k7;function T7(){return!1}var _7=T7,kb=KX(function(t,e){var i=e&&!e.nodeType&&e,n=i&&!0&&t&&!t.nodeType&&t,r=n&&n.exports===i,o=r?Fs.Buffer:void 0,s=o?o.isBuffer:void 0,a=s||_7;t.exports=a}),R7=9007199254740991,C7=/^(?:0|[1-9]\d*)$/;function X7(t,e){var i=typeof t;return e=e==null?R7:e,!!e&&(i=="number"||i!="symbol"&&C7.test(t))&&t>-1&&t%1==0&&t<e}var rW=X7,W7=9007199254740991;function z7(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=W7}var $S=z7,E7="[object Arguments]",q7="[object Array]",U7="[object Boolean]",I7="[object Date]",A7="[object Error]",L7="[object Function]",Y7="[object Map]",Z7="[object Number]",j7="[object Object]",D7="[object RegExp]",M7="[object Set]",V7="[object String]",N7="[object WeakMap]",B7="[object ArrayBuffer]",G7="[object DataView]",F7="[object Float32Array]",H7="[object Float64Array]",K7="[object Int8Array]",J7="[object Int16Array]",eL="[object Int32Array]",tL="[object Uint8Array]",iL="[object Uint8ClampedArray]",nL="[object Uint16Array]",rL="[object Uint32Array]",ri={};ri[F7]=ri[H7]=ri[K7]=ri[J7]=ri[eL]=ri[tL]=ri[iL]=ri[nL]=ri[rL]=!0;ri[E7]=ri[q7]=ri[B7]=ri[U7]=ri[G7]=ri[I7]=ri[A7]=ri[L7]=ri[Y7]=ri[Z7]=ri[j7]=ri[D7]=ri[M7]=ri[V7]=ri[N7]=!1;function oL(t){return nu(t)&&$S(t.length)&&!!ri[ku(t)]}var sL=oL;function aL(t){return function(e){return t(e)}}var lL=aL,FP=KX(function(t,e){var i=e&&!e.nodeType&&e,n=i&&!0&&t&&!t.nodeType&&t,r=n&&n.exports===i,o=r&&JX.process,s=function(){try{var a=n&&n.require&&n.require("util").types;return a||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}),HP=FP&&FP.isTypedArray,cL=HP?lL(HP):sL,oW=cL,uL=Object.prototype,OL=uL.hasOwnProperty;function fL(t,e){var i=Ms(t),n=!i&&nW(t),r=!i&&!n&&kb(t),o=!i&&!n&&!r&&oW(t),s=i||n||r||o,a=s?b7(t.length,String):[],l=a.length;for(var c in t)(e||OL.call(t,c))&&!(s&&(c=="length"||r&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||rW(c,l)))&&a.push(c);return a}var dL=fL,hL=Object.prototype;function pL(t){var e=t&&t.constructor,i=typeof e=="function"&&e.prototype||hL;return t===i}var mL=pL;function gL(t,e){return function(i){return t(e(i))}}var yL=gL,vL=yL(Object.keys,Object),bL=vL,QL=Object.prototype,$L=QL.hasOwnProperty;function SL(t){if(!mL(t))return bL(t);var e=[];for(var i in Object(t))$L.call(t,i)&&i!="constructor"&&e.push(i);return e}var wL=SL;function xL(t){return t!=null&&$S(t.length)&&!tW(t)}var PL=xL;function kL(t){return PL(t)?dL(t):wL(t)}var SS=kL;function TL(t,e){return t&&y7(t,e,SS)}var _L=TL;function RL(){this.__data__=[],this.size=0}var CL=RL;function XL(t,e){return t===e||t!==t&&e!==e}var sW=XL;function WL(t,e){for(var i=t.length;i--;)if(sW(t[i][0],e))return i;return-1}var sg=WL,zL=Array.prototype,EL=zL.splice;function qL(t){var e=this.__data__,i=sg(e,t);if(i<0)return!1;var n=e.length-1;return i==n?e.pop():EL.call(e,i,1),--this.size,!0}var UL=qL;function IL(t){var e=this.__data__,i=sg(e,t);return i<0?void 0:e[i][1]}var AL=IL;function LL(t){return sg(this.__data__,t)>-1}var YL=LL;function ZL(t,e){var i=this.__data__,n=sg(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}var jL=ZL;function Tu(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Tu.prototype.clear=CL;Tu.prototype.delete=UL;Tu.prototype.get=AL;Tu.prototype.has=YL;Tu.prototype.set=jL;var ag=Tu;function DL(){this.__data__=new ag,this.size=0}var ML=DL;function VL(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}var NL=VL;function BL(t){return this.__data__.get(t)}var GL=BL;function FL(t){return this.__data__.has(t)}var HL=FL,KL=Bl(Fs,"Map"),$f=KL,JL=Bl(Object,"create"),Sf=JL;function eY(){this.__data__=Sf?Sf(null):{},this.size=0}var tY=eY;function iY(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nY=iY,rY="__lodash_hash_undefined__",oY=Object.prototype,sY=oY.hasOwnProperty;function aY(t){var e=this.__data__;if(Sf){var i=e[t];return i===rY?void 0:i}return sY.call(e,t)?e[t]:void 0}var lY=aY,cY=Object.prototype,uY=cY.hasOwnProperty;function OY(t){var e=this.__data__;return Sf?e[t]!==void 0:uY.call(e,t)}var fY=OY,dY="__lodash_hash_undefined__";function hY(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Sf&&e===void 0?dY:e,this}var pY=hY;function _u(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}_u.prototype.clear=tY;_u.prototype.delete=nY;_u.prototype.get=lY;_u.prototype.has=fY;_u.prototype.set=pY;var KP=_u;function mY(){this.size=0,this.__data__={hash:new KP,map:new($f||ag),string:new KP}}var gY=mY;function yY(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var vY=yY;function bY(t,e){var i=t.__data__;return vY(e)?i[typeof e=="string"?"string":"hash"]:i.map}var lg=bY;function QY(t){var e=lg(this,t).delete(t);return this.size-=e?1:0,e}var $Y=QY;function SY(t){return lg(this,t).get(t)}var wY=SY;function xY(t){return lg(this,t).has(t)}var PY=xY;function kY(t,e){var i=lg(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this}var TY=kY;function Ru(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Ru.prototype.clear=gY;Ru.prototype.delete=$Y;Ru.prototype.get=wY;Ru.prototype.has=PY;Ru.prototype.set=TY;var cg=Ru,_Y=200;function RY(t,e){var i=this.__data__;if(i instanceof ag){var n=i.__data__;if(!$f||n.length<_Y-1)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new cg(n)}return i.set(t,e),this.size=i.size,this}var CY=RY;function Cu(t){var e=this.__data__=new ag(t);this.size=e.size}Cu.prototype.clear=ML;Cu.prototype.delete=NL;Cu.prototype.get=GL;Cu.prototype.has=HL;Cu.prototype.set=CY;var Wh=Cu,XY="__lodash_hash_undefined__";function WY(t){return this.__data__.set(t,XY),this}var zY=WY;function EY(t){return this.__data__.has(t)}var qY=EY;function Xp(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new cg;++e<i;)this.add(t[e])}Xp.prototype.add=Xp.prototype.push=zY;Xp.prototype.has=qY;var UY=Xp;function IY(t,e){for(var i=-1,n=t==null?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var AY=IY;function LY(t,e){return t.has(e)}var YY=LY,ZY=1,jY=2;function DY(t,e,i,n,r,o){var s=i&ZY,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var O=-1,h=!0,f=i&jY?new UY:void 0;for(o.set(t,e),o.set(e,t);++O<a;){var m=t[O],Q=e[O];if(n)var v=s?n(Q,m,O,e,t,o):n(m,Q,O,t,e,o);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!AY(e,function(p,d){if(!YY(f,d)&&(m===p||r(m,p,i,n,o)))return f.push(d)})){h=!1;break}}else if(!(m===Q||r(m,Q,i,n,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var aW=DY,MY=Fs.Uint8Array,JP=MY;function VY(t){var e=-1,i=Array(t.size);return t.forEach(function(n,r){i[++e]=[r,n]}),i}var NY=VY;function BY(t){var e=-1,i=Array(t.size);return t.forEach(function(n){i[++e]=n}),i}var GY=BY,FY=1,HY=2,KY="[object Boolean]",JY="[object Date]",eZ="[object Error]",tZ="[object Map]",iZ="[object Number]",nZ="[object RegExp]",rZ="[object Set]",oZ="[object String]",sZ="[object Symbol]",aZ="[object ArrayBuffer]",lZ="[object DataView]",ek=qa?qa.prototype:void 0,rv=ek?ek.valueOf:void 0;function cZ(t,e,i,n,r,o,s){switch(i){case lZ:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case aZ:return!(t.byteLength!=e.byteLength||!o(new JP(t),new JP(e)));case KY:case JY:case iZ:return sW(+t,+e);case eZ:return t.name==e.name&&t.message==e.message;case nZ:case oZ:return t==e+"";case tZ:var a=NY;case rZ:var l=n&FY;if(a||(a=GY),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;n|=HY,s.set(t,e);var u=aW(a(t),a(e),n,r,o,s);return s.delete(t),u;case sZ:if(rv)return rv.call(t)==rv.call(e)}return!1}var uZ=cZ;function OZ(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}var fZ=OZ;function dZ(t,e,i){var n=e(t);return Ms(t)?n:fZ(n,i(t))}var hZ=dZ;function pZ(t,e){for(var i=-1,n=t==null?0:t.length,r=0,o=[];++i<n;){var s=t[i];e(s,i,t)&&(o[r++]=s)}return o}var mZ=pZ;function gZ(){return[]}var yZ=gZ,vZ=Object.prototype,bZ=vZ.propertyIsEnumerable,tk=Object.getOwnPropertySymbols,QZ=tk?function(t){return t==null?[]:(t=Object(t),mZ(tk(t),function(e){return bZ.call(t,e)}))}:yZ,$Z=QZ;function SZ(t){return hZ(t,SS,$Z)}var ik=SZ,wZ=1,xZ=Object.prototype,PZ=xZ.hasOwnProperty;function kZ(t,e,i,n,r,o){var s=i&wZ,a=ik(t),l=a.length,c=ik(e),u=c.length;if(l!=u&&!s)return!1;for(var O=l;O--;){var h=a[O];if(!(s?h in e:PZ.call(e,h)))return!1}var f=o.get(t),m=o.get(e);if(f&&m)return f==e&&m==t;var Q=!0;o.set(t,e),o.set(e,t);for(var v=s;++O<l;){h=a[O];var p=t[h],d=e[h];if(n)var g=s?n(d,p,h,e,t,o):n(p,d,h,t,e,o);if(!(g===void 0?p===d||r(p,d,i,n,o):g)){Q=!1;break}v||(v=h=="constructor")}if(Q&&!v){var b=t.constructor,$=e.constructor;b!=$&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof $=="function"&&$ instanceof $)&&(Q=!1)}return o.delete(t),o.delete(e),Q}var TZ=kZ,_Z=Bl(Fs,"DataView"),Tb=_Z,RZ=Bl(Fs,"Promise"),_b=RZ,CZ=Bl(Fs,"Set"),Rb=CZ,XZ=Bl(Fs,"WeakMap"),Cb=XZ,nk="[object Map]",WZ="[object Object]",rk="[object Promise]",ok="[object Set]",sk="[object WeakMap]",ak="[object DataView]",zZ=Nl(Tb),EZ=Nl($f),qZ=Nl(_b),UZ=Nl(Rb),IZ=Nl(Cb),ul=ku;(Tb&&ul(new Tb(new ArrayBuffer(1)))!=ak||$f&&ul(new $f)!=nk||_b&&ul(_b.resolve())!=rk||Rb&&ul(new Rb)!=ok||Cb&&ul(new Cb)!=sk)&&(ul=function(t){var e=ku(t),i=e==WZ?t.constructor:void 0,n=i?Nl(i):"";if(n)switch(n){case zZ:return ak;case EZ:return nk;case qZ:return rk;case UZ:return ok;case IZ:return sk}return e});var lk=ul,AZ=1,ck="[object Arguments]",uk="[object Array]",Ud="[object Object]",LZ=Object.prototype,Ok=LZ.hasOwnProperty;function YZ(t,e,i,n,r,o){var s=Ms(t),a=Ms(e),l=s?uk:lk(t),c=a?uk:lk(e);l=l==ck?Ud:l,c=c==ck?Ud:c;var u=l==Ud,O=c==Ud,h=l==c;if(h&&kb(t)){if(!kb(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Wh),s||oW(t)?aW(t,e,i,n,r,o):uZ(t,e,l,i,n,r,o);if(!(i&AZ)){var f=u&&Ok.call(t,"__wrapped__"),m=O&&Ok.call(e,"__wrapped__");if(f||m){var Q=f?t.value():t,v=m?e.value():e;return o||(o=new Wh),r(Q,v,i,n,o)}}return h?(o||(o=new Wh),TZ(t,e,i,n,r,o)):!1}var ZZ=YZ;function lW(t,e,i,n,r){return t===e?!0:t==null||e==null||!nu(t)&&!nu(e)?t!==t&&e!==e:ZZ(t,e,i,n,lW,r)}var cW=lW,jZ=1,DZ=2;function MZ(t,e,i,n){var r=i.length,o=r,s=!n;if(t==null)return!o;for(t=Object(t);r--;){var a=i[r];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++r<o;){a=i[r];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in t))return!1}else{var O=new Wh;if(n)var h=n(c,u,l,t,e,O);if(!(h===void 0?cW(u,c,jZ|DZ,n,O):h))return!1}}return!0}var VZ=MZ;function NZ(t){return t===t&&!QS(t)}var uW=NZ;function BZ(t){for(var e=SS(t),i=e.length;i--;){var n=e[i],r=t[n];e[i]=[n,r,uW(r)]}return e}var GZ=BZ;function FZ(t,e){return function(i){return i==null?!1:i[t]===e&&(e!==void 0||t in Object(i))}}var OW=FZ;function HZ(t){var e=GZ(t);return e.length==1&&e[0][2]?OW(e[0][0],e[0][1]):function(i){return i===t||VZ(i,t,e)}}var KZ=HZ,JZ="[object Symbol]";function ej(t){return typeof t=="symbol"||nu(t)&&ku(t)==JZ}var wS=ej,tj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ij=/^\w*$/;function nj(t,e){if(Ms(t))return!1;var i=typeof t;return i=="number"||i=="symbol"||i=="boolean"||t==null||wS(t)?!0:ij.test(t)||!tj.test(t)||e!=null&&t in Object(e)}var xS=nj,rj="Expected a function";function PS(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(rj);var i=function(){var n=arguments,r=e?e.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var s=t.apply(this,n);return i.cache=o.set(r,s)||o,s};return i.cache=new(PS.Cache||cg),i}PS.Cache=cg;var oj=PS,sj=500;function aj(t){var e=oj(t,function(n){return i.size===sj&&i.clear(),n}),i=e.cache;return e}var lj=aj,cj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uj=/\\(\\)?/g,Oj=lj(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(cj,function(i,n,r,o){e.push(r?o.replace(uj,"$1"):n||i)}),e}),fj=Oj;function dj(t,e){for(var i=-1,n=t==null?0:t.length,r=Array(n);++i<n;)r[i]=e(t[i],i,t);return r}var hj=dj,pj=1/0,fk=qa?qa.prototype:void 0,dk=fk?fk.toString:void 0;function fW(t){if(typeof t=="string")return t;if(Ms(t))return hj(t,fW)+"";if(wS(t))return dk?dk.call(t):"";var e=t+"";return e=="0"&&1/t==-pj?"-0":e}var mj=fW;function gj(t){return t==null?"":mj(t)}var yj=gj;function vj(t,e){return Ms(t)?t:xS(t,e)?[t]:fj(yj(t))}var dW=vj,bj=1/0;function Qj(t){if(typeof t=="string"||wS(t))return t;var e=t+"";return e=="0"&&1/t==-bj?"-0":e}var ug=Qj;function $j(t,e){e=dW(e,t);for(var i=0,n=e.length;t!=null&&i<n;)t=t[ug(e[i++])];return i&&i==n?t:void 0}var hW=$j;function Sj(t,e,i){var n=t==null?void 0:hW(t,e);return n===void 0?i:n}var wj=Sj;function xj(t,e){return t!=null&&e in Object(t)}var Pj=xj;function kj(t,e,i){e=dW(e,t);for(var n=-1,r=e.length,o=!1;++n<r;){var s=ug(e[n]);if(!(o=t!=null&&i(t,s)))break;t=t[s]}return o||++n!=r?o:(r=t==null?0:t.length,!!r&&$S(r)&&rW(s,r)&&(Ms(t)||nW(t)))}var Tj=kj;function _j(t,e){return t!=null&&Tj(t,e,Pj)}var Rj=_j,Cj=1,Xj=2;function Wj(t,e){return xS(t)&&uW(e)?OW(ug(t),e):function(i){var n=wj(i,t);return n===void 0&&n===e?Rj(i,t):cW(e,n,Cj|Xj)}}var zj=Wj;function Ej(t){return t}var qj=Ej;function Uj(t){return function(e){return e==null?void 0:e[t]}}var Ij=Uj;function Aj(t){return function(e){return hW(e,t)}}var Lj=Aj;function Yj(t){return xS(t)?Ij(ug(t)):Lj(t)}var Zj=Yj;function jj(t){return typeof t=="function"?t:t==null?qj:typeof t=="object"?Ms(t)?zj(t[0],t[1]):KZ(t):Zj(t)}var Dj=jj;function Mj(t,e){var i={};return e=Dj(e),_L(t,function(n,r,o){h7(i,r,e(n,r,o))}),i}var Vj=Mj;const kS=(t,e)=>Vj(e,i=>i[t]),fs=Object.create(null);fs.open="0";fs.close="1";fs.ping="2";fs.pong="3";fs.message="4";fs.upgrade="5";fs.noop="6";const zh=Object.create(null);Object.keys(fs).forEach(t=>{zh[fs[t]]=t});const Nj={type:"error",data:"parser error"},Bj=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Gj=typeof ArrayBuffer=="function",Fj=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,pW=({type:t,data:e},i,n)=>Bj&&e instanceof Blob?i?n(e):hk(e,n):Gj&&(e instanceof ArrayBuffer||Fj(e))?i?n(e):hk(new Blob([e]),n):n(fs[t]+(e||"")),hk=(t,e)=>{const i=new FileReader;return i.onload=function(){const n=i.result.split(",")[1];e("b"+n)},i.readAsDataURL(t)},pk="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",SO=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let t=0;t<pk.length;t++)SO[pk.charCodeAt(t)]=t;const Hj=t=>{let e=t.length*.75,i=t.length,n,r=0,o,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),u=new Uint8Array(c);for(n=0;n<i;n+=4)o=SO[t.charCodeAt(n)],s=SO[t.charCodeAt(n+1)],a=SO[t.charCodeAt(n+2)],l=SO[t.charCodeAt(n+3)],u[r++]=o<<2|s>>4,u[r++]=(s&15)<<4|a>>2,u[r++]=(a&3)<<6|l&63;return c},Kj=typeof ArrayBuffer=="function",mW=(t,e)=>{if(typeof t!="string")return{type:"message",data:gW(t,e)};const i=t.charAt(0);return i==="b"?{type:"message",data:Jj(t.substring(1),e)}:zh[i]?t.length>1?{type:zh[i],data:t.substring(1)}:{type:zh[i]}:Nj},Jj=(t,e)=>{if(Kj){const i=Hj(t);return gW(i,e)}else return{base64:!0,data:t}},gW=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},yW=String.fromCharCode(30),eD=(t,e)=>{const i=t.length,n=new Array(i);let r=0;t.forEach((o,s)=>{pW(o,!1,a=>{n[s]=a,++r===i&&e(n.join(yW))})})},tD=(t,e)=>{const i=t.split(yW),n=[];for(let r=0;r<i.length;r++){const o=mW(i[r],e);if(n.push(o),o.type==="error")break}return n},vW=4;function Ni(t){if(t)return iD(t)}function iD(t){for(var e in Ni.prototype)t[e]=Ni.prototype[e];return t}Ni.prototype.on=Ni.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Ni.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this};Ni.prototype.off=Ni.prototype.removeListener=Ni.prototype.removeAllListeners=Ni.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,r=0;r<i.length;r++)if(n=i[r],n===e||n.fn===e){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+t],this};Ni.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){i=i.slice(0);for(var n=0,r=i.length;n<r;++n)i[n].apply(this,e)}return this};Ni.prototype.emitReserved=Ni.prototype.emit;Ni.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Ni.prototype.hasListeners=function(t){return!!this.listeners(t).length};const ya=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())();function bW(t,...e){return e.reduce((i,n)=>(t.hasOwnProperty(n)&&(i[n]=t[n]),i),{})}const nD=setTimeout,rD=clearTimeout;function Og(t,e){e.useNativeTimers?(t.setTimeoutFn=nD.bind(ya),t.clearTimeoutFn=rD.bind(ya)):(t.setTimeoutFn=setTimeout.bind(ya),t.clearTimeoutFn=clearTimeout.bind(ya))}const oD=1.33;function sD(t){return typeof t=="string"?aD(t):Math.ceil((t.byteLength||t.size)*oD)}function aD(t){let e=0,i=0;for(let n=0,r=t.length;n<r;n++)e=t.charCodeAt(n),e<128?i+=1:e<2048?i+=2:e<55296||e>=57344?i+=3:(n++,i+=4);return i}class lD extends Error{constructor(e,i,n){super(e),this.description=i,this.context=n,this.type="TransportError"}}class QW extends Ni{constructor(e){super(),this.writable=!1,Og(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,i,n){return super.emitReserved("error",new lD(e,i,n)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const i=mW(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const $W="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Xb=64,cD={};let mk=0,Id=0,gk;function yk(t){let e="";do e=$W[t%Xb]+e,t=Math.floor(t/Xb);while(t>0);return e}function SW(){const t=yk(+new Date);return t!==gk?(mk=0,gk=t):t+"."+yk(mk++)}for(;Id<Xb;Id++)cD[$W[Id]]=Id;function wW(t){let e="";for(let i in t)t.hasOwnProperty(i)&&(e.length&&(e+="&"),e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return e}function uD(t){let e={},i=t.split("&");for(let n=0,r=i.length;n<r;n++){let o=i[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}let xW=!1;try{xW=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch{}const OD=xW;function PW(t){const e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||OD))return new XMLHttpRequest}catch{}if(!e)try{return new ya[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function fD(){}const dD=function(){return new PW({xdomain:!1}).responseType!=null}();class hD extends QW{constructor(e){if(super(e),this.polling=!1,typeof location!="undefined"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==n}const i=e&&e.forceBase64;this.supportsBinary=dD&&!i}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const i=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let n=0;this.polling&&(n++,this.once("pollComplete",function(){--n||i()})),this.writable||(n++,this.once("drain",function(){--n||i()}))}else i()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const i=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};tD(e,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,eD(e,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const i=this.opts.secure?"https":"http";let n="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=SW()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(i==="https"&&Number(this.opts.port)!==443||i==="http"&&Number(this.opts.port)!==80)&&(n=":"+this.opts.port);const r=wW(e),o=this.opts.hostname.indexOf(":")!==-1;return i+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new as(this.uri(),e)}doWrite(e,i){const n=this.request({method:"POST",data:e});n.on("success",i),n.on("error",(r,o)=>{this.onError("xhr post error",r,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(i,n)=>{this.onError("xhr poll error",i,n)}),this.pollXhr=e}}class as extends Ni{constructor(e,i){super(),Og(this,i),this.opts=i,this.method=i.method||"GET",this.uri=e,this.async=i.async!==!1,this.data=i.data!==void 0?i.data:null,this.create()}create(){const e=bW(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const i=this.xhr=new PW(e);try{i.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this.opts.extraHeaders[n])}}catch{}if(this.method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in i&&(i.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(i.timeout=this.opts.requestTimeout),i.onreadystatechange=()=>{i.readyState===4&&(i.status===200||i.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof i.status=="number"?i.status:0)},0))},i.send(this.data)}catch(n){this.setTimeoutFn(()=>{this.onError(n)},0);return}typeof document!="undefined"&&(this.index=as.requestsCount++,as.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr=="undefined"||this.xhr===null)){if(this.xhr.onreadystatechange=fD,e)try{this.xhr.abort()}catch{}typeof document!="undefined"&&delete as.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}as.requestsCount=0;as.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",vk);else if(typeof addEventListener=="function"){const t="onpagehide"in ya?"pagehide":"unload";addEventListener(t,vk,!1)}}function vk(){for(let t in as.requests)as.requests.hasOwnProperty(t)&&as.requests[t].abort()}const pD=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,i)=>i(e,0))(),Ad=ya.WebSocket||ya.MozWebSocket,bk=!0,mD="arraybuffer",Qk=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class gD extends QW{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),i=this.opts.protocols,n=Qk?{}:bW(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=bk&&!Qk?i?new Ad(e,i):new Ad(e):new Ad(e,i,n)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType||mD,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 i=0;i<e.length;i++){const n=e[i],r=i===e.length-1;pW(n,this.supportsBinary,o=>{const s={};try{bk&&this.ws.send(o)}catch{}r&&pD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const i=this.opts.secure?"wss":"ws";let n="";this.opts.port&&(i==="wss"&&Number(this.opts.port)!==443||i==="ws"&&Number(this.opts.port)!==80)&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=SW()),this.supportsBinary||(e.b64=1);const r=wW(e),o=this.opts.hostname.indexOf(":")!==-1;return i+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!Ad}}const yD={websocket:gD,polling:hD},vD=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,bD=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Wb(t){const e=t,i=t.indexOf("["),n=t.indexOf("]");i!=-1&&n!=-1&&(t=t.substring(0,i)+t.substring(i,n).replace(/:/g,";")+t.substring(n,t.length));let r=vD.exec(t||""),o={},s=14;for(;s--;)o[bD[s]]=r[s]||"";return i!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=QD(o,o.path),o.queryKey=$D(o,o.query),o}function QD(t,e){const i=/\/{2,9}/g,n=e.replace(i,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&n.splice(0,1),e.substr(e.length-1,1)=="/"&&n.splice(n.length-1,1),n}function $D(t,e){const i={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,r,o){r&&(i[r]=o)}),i}class da extends Ni{constructor(e,i={}){super(),e&&typeof e=="object"&&(i=e,e=null),e?(e=Wb(e),i.hostname=e.host,i.secure=e.protocol==="https"||e.protocol==="wss",i.port=e.port,e.query&&(i.query=e.query)):i.host&&(i.hostname=Wb(i.host).host),Og(this,i),this.secure=i.secure!=null?i.secure:typeof location!="undefined"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=i.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=i.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},i),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=uD(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const i=Object.assign({},this.opts.query);i.EIO=vW,i.transport=e,this.id&&(i.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new yD[e](n)}open(){let e;if(this.opts.rememberUpgrade&&da.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}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",i=>this.onClose("transport close",i))}probe(e){let i=this.createTransport(e),n=!1;da.priorWebsocketSuccess=!1;const r=()=>{n||(i.send([{type:"ping",data:"probe"}]),i.once("packet",O=>{if(!n)if(O.type==="pong"&&O.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;da.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(u(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=i.name,this.emitReserved("upgradeError",h)}}))};function o(){n||(n=!0,u(),i.close(),i=null)}const s=O=>{const h=new Error("probe error: "+O);h.transport=i.name,o(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(O){i&&O.name!==i.name&&o()}const u=()=>{i.removeListener("open",r),i.removeListener("error",s),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",r),i.once("error",s),i.once("close",a),this.once("close",l),this.once("upgrading",c),i.open()}onOpen(){if(this.readyState="open",da.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const i=this.upgrades.length;for(;e<i;e++)this.probe(this.upgrades[e])}}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.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const i=new Error("server error");i.code=e.data,this.onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(i+=sD(r)),n>0&&i>this.maxPayload)return this.writeBuffer.slice(0,n);i+=2}return this.writeBuffer}write(e,i,n){return this.sendPacket("message",e,i,n),this}send(e,i,n){return this.sendPacket("message",e,i,n),this}sendPacket(e,i,n,r){if(typeof i=="function"&&(r=i,i=void 0),typeof n=="function"&&(r=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:i,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},n=()=>{this.once("upgrade",i),this.once("upgradeError",i)};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(e){da.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,i){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const i=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&i.push(e[n]);return i}}da.protocol=vW;function SD(t,e="",i){let n=t;i=i||typeof location!="undefined"&&location,t==null&&(t=i.protocol+"//"+i.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=i.protocol+t:t=i.host+t),/^(https?|wss?):\/\//.test(t)||(typeof i!="undefined"?t=i.protocol+"//"+t:t="https://"+t),n=Wb(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(i&&i.port===n.port?"":":"+n.port),n}const wD=typeof ArrayBuffer=="function",xD=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,kW=Object.prototype.toString,PD=typeof Blob=="function"||typeof Blob!="undefined"&&kW.call(Blob)==="[object BlobConstructor]",kD=typeof File=="function"||typeof File!="undefined"&&kW.call(File)==="[object FileConstructor]";function TS(t){return wD&&(t instanceof ArrayBuffer||xD(t))||PD&&t instanceof Blob||kD&&t instanceof File}function Eh(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let i=0,n=t.length;i<n;i++)if(Eh(t[i]))return!0;return!1}if(TS(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Eh(t.toJSON(),!0);for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&Eh(t[i]))return!0;return!1}function TD(t){const e=[],i=t.data,n=t;return n.data=zb(i,e),n.attachments=e.length,{packet:n,buffers:e}}function zb(t,e){if(!t)return t;if(TS(t)){const i={_placeholder:!0,num:e.length};return e.push(t),i}else if(Array.isArray(t)){const i=new Array(t.length);for(let n=0;n<t.length;n++)i[n]=zb(t[n],e);return i}else if(typeof t=="object"&&!(t instanceof Date)){const i={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=zb(t[n],e));return i}return t}function _D(t,e){return t.data=Eb(t.data,e),t.attachments=void 0,t}function Eb(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=Eb(t[i],e);else if(typeof t=="object")for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(t[i]=Eb(t[i],e));return t}const RD=5;var gt;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(gt||(gt={}));class CD{constructor(e){this.replacer=e}encode(e){return(e.type===gt.EVENT||e.type===gt.ACK)&&Eh(e)?(e.type=e.type===gt.EVENT?gt.BINARY_EVENT:gt.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===gt.BINARY_EVENT||e.type===gt.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(i+=e.nsp+","),e.id!=null&&(i+=e.id),e.data!=null&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){const i=TD(e),n=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(n),r}}class _S extends Ni{constructor(e){super(),this.reviver=e}add(e){let i;if(typeof e=="string")i=this.decodeString(e),i.type===gt.BINARY_EVENT||i.type===gt.BINARY_ACK?(this.reconstructor=new XD(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i);else if(TS(e)||e.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(e),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let i=0;const n={type:Number(e.charAt(0))};if(gt[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===gt.BINARY_EVENT||n.type===gt.BINARY_ACK){const o=i+1;for(;e.charAt(++i)!=="-"&&i!=e.length;);const s=e.substring(o,i);if(s!=Number(s)||e.charAt(i)!=="-")throw new Error("Illegal attachments");n.attachments=Number(s)}if(e.charAt(i+1)==="/"){const o=i+1;for(;++i&&!(e.charAt(i)===","||i===e.length););n.nsp=e.substring(o,i)}else n.nsp="/";const r=e.charAt(i+1);if(r!==""&&Number(r)==r){const o=i+1;for(;++i;){const s=e.charAt(i);if(s==null||Number(s)!=s){--i;break}if(i===e.length)break}n.id=Number(e.substring(o,i+1))}if(e.charAt(++i)){const o=this.tryParse(e.substr(i));if(_S.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,i){switch(e){case gt.CONNECT:return typeof i=="object";case gt.DISCONNECT:return i===void 0;case gt.CONNECT_ERROR:return typeof i=="string"||typeof i=="object";case gt.EVENT:case gt.BINARY_EVENT:return Array.isArray(i)&&i.length>0;case gt.ACK:case gt.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class XD{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const i=_D(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var WD=Object.freeze(Object.defineProperty({__proto__:null,protocol:RD,get PacketType(){return gt},Encoder:CD,Decoder:_S},Symbol.toStringTag,{value:"Module"}));function zo(t,e,i){return t.on(e,i),function(){t.off(e,i)}}const zD=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class TW extends Ni{constructor(e,i,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[zo(e,"open",this.onopen.bind(this)),zo(e,"packet",this.onpacket.bind(this)),zo(e,"error",this.onerror.bind(this)),zo(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,...i){if(zD.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');i.unshift(e);const n={type:gt.EVENT,data:i};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const s=this.ids++,a=i.pop();this._registerAckCallback(s,a),n.id=s}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,i){const n=this.flags.timeout;if(n===void 0){this.acks[e]=i;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);i.call(this,new Error("operation has timed out"))},n);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(r),i.apply(this,[null,...o])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:gt.CONNECT,data:e})}):this.packet({type:gt.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case gt.CONNECT:if(e.data&&e.data.sid){const r=e.data.sid;this.onconnect(r)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case gt.EVENT:case gt.BINARY_EVENT:this.onevent(e);break;case gt.ACK:case gt.BINARY_ACK:this.onack(e);break;case gt.DISCONNECT:this.ondisconnect();break;case gt.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const i=e.data||[];e.id!=null&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const n of i)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const i=this;let n=!1;return function(...r){n||(n=!0,i.packet({type:gt.ACK,id:e,data:r}))}}onack(e){const i=this.acks[e.id];typeof i=="function"&&(i.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),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()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:gt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const i=this._anyListeners;for(let n=0;n<i.length;n++)if(e===i[n])return i.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){const i=this._anyOutgoingListeners;for(let n=0;n<i.length;n++)if(e===i[n])return i.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const n of i)n.apply(this,e.data)}}}function Xu(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Xu.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),i=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-i:t+i}return Math.min(t,this.max)|0};Xu.prototype.reset=function(){this.attempts=0};Xu.prototype.setMin=function(t){this.ms=t};Xu.prototype.setMax=function(t){this.max=t};Xu.prototype.setJitter=function(t){this.jitter=t};class qb extends Ni{constructor(e,i){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(i=e,e=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Og(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((n=i.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Xu({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=e;const r=i.parser||WD;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(i=this.backoff)===null||i===void 0||i.setMin(e),this)}randomizationFactor(e){var i;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(i=this.backoff)===null||i===void 0||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(i=this.backoff)===null||i===void 0||i.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 da(this.uri,this.opts);const i=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=zo(i,"open",function(){n.onopen(),e&&e()}),o=zo(i,"error",s=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",s),e?e(s):n.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&r();const a=this.setTimeoutFn(()=>{r(),i.close(),i.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(zo(e,"ping",this.onping.bind(this)),zo(e,"data",this.ondata.bind(this)),zo(e,"error",this.onerror.bind(this)),zo(e,"close",this.onclose.bind(this)),zo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,i){let n=this.nsps[e];return n||(n=new TW(this,e,i),this.nsps[e]=n),n}_destroy(e){const i=Object.keys(this.nsps);for(const n of i)if(this.nsps[n].active)return;this._close()}_packet(e){const i=this.encoder.encode(e);for(let n=0;n<i.length;n++)this.engine.write(i[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"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,i){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},i);this.opts.autoUnref&&n.unref(),this.subs.push(function(){clearTimeout(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ju={};function qh(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const i=SD(t,e.path||"/socket.io"),n=i.source,r=i.id,o=i.path,s=Ju[r]&&o in Ju[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new qb(n,e):(Ju[r]||(Ju[r]=new qb(n,e)),l=Ju[r]),i.query&&!e.query&&(e.query=i.queryKey),l.socket(i.path,e)}Object.assign(qh,{Manager:qb,Socket:TW,io:qh,connect:qh});var Ut=(t=>(t.Loading="loading",t.Ready="ready",t.Offline="offline",t.Online="online",t.StatusChanged="statusChanged",t.LspStatusChanged="lspStatusChanged",t.PlaygroundChanged="playgroundChanged",t.Following="following",t.UnFollowing="unFollowing",t.RunStatusChanged="runStatusChanged",t.FileStructureChanged="fileStructureChanged",t.FileContentChanged="fileContentChanged",t.AppendToConsole="appendToConsole",t.AppendToTerminal="appendToTerminal",t.ApplicationAvailable="ApplicationAvailable",t.PlaybackInfo="playbackInfo",t.ReplayStart="ReplayStart",t.ReplayEnd="ReplayEnd",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.ConnectionBroken="connectionBroken",t.ConnectionFailed="connectionFailed",t.AuthorizationFailed="authorizationFailed",t.FileStructureDamaged="fileStructureDamaged",t.ErrorFromServer="errorFromServer",t))(Ut||{}),ro=(t=>(t.Authorize="auth",t.Active="active",t.Run="run",t.Stop="stop",t.Heartbeat="heartbeat",t.SetFileLockStatus="",t.SetFileVisiable="",t.AddFileToUnitTest="",t.RemoveFileFromUnitTest="",t.KeyEvent="keyEvent",t.File="file",t.EditFile="editFile",t.FileTree="fileTree",t.Terminal="terminal",t.Cursor="cursor",t.GetPlaybackInfo="getPlaybackInfo",t.LoadPlaybackData="loadPlaybackData",t.FollowingAgentUser="followingAgentUser",t.UnFollowingAgentUser="unFollowingAgentUser",t.FollowingFocusComponent="followingFocusComponent",t.FollowingEditorScroll="followingEditorScroll",t))(ro||{}),pt=(t=>(t.Connect="connect",t.Disconnect="disconnect",t.AuthAck="authAck",t.Active="active",t.SyncPlaygroundInfo="syncPlaygroundInfo",t.ChangePlaygroundInfo="changePlaygroundInfo",t.RunStatus="runStatus",t.LspStatus="lspStatus",t.Following="following",t.UnFollowing="unFollowing",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.Simulator="simulator",t.PlaybackInfo="playbackInfo",t.PlaybackData="playbackData",t.File="file",t.FileTree="fileTree",t.Run="run",t.Console="console",t.Terminal="terminal",t.KeyEvent="keyEvent",t.CloseFile="closeFile",t.FocusComponent="FocusComponent",t.InvisibleComponentActive="InvisibleComponentActive",t))(pt||{});class ED{constructor(e,i=2e3){et(this,"name");et(this,"channel");et(this,"_timeout");et(this,"_messageId");et(this,"_messages");et(this,"_filter");this.name=e,this._messageId=0,this.channel=new BroadcastChannel(e),this.channel.onmessage=n=>this.receive(n),this._messages=[],this._timeout=i}setFilter(e){this._filter=e}send(e,i){const n=new qD(i||this._timeout),r=new Promise((o,s)=>{n._reject=s,n._resolve=o});return this._messages.push(n),this.channel.postMessage({id:this._messageId++,type:"request",payload:e}),r}answer(e,i){this.channel.postMessage({id:e,type:"response",payload:i})}receive(e){const i=e.data;i.type==="request"?(!this._filter||this._filter(i.payload))&&this.answer(i.id,{active:!0}):i.type==="response"&&this._messages[i.id].reject(i.payload)}}class qD{constructor(e){et(this,"_resolve");et(this,"_reject");et(this,"_interval");this._interval=setTimeout(()=>this.resolve({active:!1,reason:"timeout, no one uses it"}),e)}resolve(e){clearTimeout(this._interval),this._resolve(e)}reject(e){this._reject(e)}}let _W,Ld;async function UD(){Ld||(Ld=new ED("dao-paas",500));let t="";Ld.setFilter(n=>n.id===t);const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],i=[];for(const n of e){const r=Ld.send(n).then(()=>{if(t==="")return n.time=new Date().getTime(),t=n.id,localStorage.setItem("agentUsers",JSON.stringify(e)),Promise.resolve(t)});i.push(r)}return Promise.any(i)}function ID(t){const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],i=e.find(n=>n.id==t);i?i.time=new Date().getTime():e.push({id:t,time:new Date().getTime()}),localStorage.setItem("agentUsers",JSON.stringify(e)),_W=t}function AD(t){return t===_W}const RW="daoLogger",LD=typeof module=="object"&&typeof module.exports=="object",ov=LD?global:window,CW=ov&&ov.localStorage?ov.localStorage:{store:{},getItem(t){return this.store[t]},setItem(t,e){this.store[t]=e}},_t=new Proxy(console,{get(t,e){return CW.getItem(RW)?t[e]:()=>{}}}),YD=()=>{CW.setItem(RW,"*")},ZD=[1,2,3,5,8,16];class jD{constructor(e,i,n,r,o,s){et(this,"start");et(this,"end");et(this,"totalTime");et(this,"rate");et(this,"preFrameTime",0);et(this,"resumeTime",0);et(this,"dataBuffer",[]);et(this,"playing",!1);et(this,"isReplay",!1);et(this,"index",0);et(this,"firstFrameTime",0);et(this,"isMovePosition",!1);et(this,"eventDispatcher");et(this,"getPlaybackSnapshot");et(this,"progressDispatcher");this.start=e,this.end=i,this.rate=1,this.totalTime=i-e,this.eventDispatcher=r,this.progressDispatcher=o,this.getPlaybackSnapshot=s,this.step=this.step.bind(this)}convertToAbsoluteTime(e){return this.start+e}setRate(e){e&&!ZD.includes(e)&&this.progressDispatcher&&this.progressDispatcher("error",`Invalid parameter: rate=${e}`),this.rate=e||this.rate}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(!this.playing){_t.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.index=0,this.resumeTime=0,this.playing=!0,window.requestAnimationFrame(this.step)}movePosition(e){this.resumeTime=e,this.playing=!0,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,i=this.dataBuffer,n=i.length,r=(a,l)=>{var c,u,O,h;if(a<=l){const f=Math.floor((l-a)/2+a),m=i[f].timestamp;return m===e?f:e===((c=i[f-1])==null?void 0:c.timestamp)?f-1:e===((u=i[f+1])==null?void 0:u.timestamp)||e>((O=i[f-1])==null?void 0:O.timestamp)&&e<((h=i[f+1])==null?void 0:h.timestamp)?f+1:(e<m?l=f-1:e>m&&(a=f+1),r(a,l))}else return _t.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=n-1;return r(o,s)}step(){var i,n;if(!this.playing)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.resumeTime>=this.totalTime&&this.index>this.dataBuffer.length-1){(i=this.progressDispatcher)==null||i.call(this,"complete",this.resumeTime);return}this.progressDispatcher&&this.progressDispatcher("progress",this.resumeTime);let e=this.dataBuffer[this.index];this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.isMovePosition?(this.dataBuffer.filter(r=>{r.eventName===e.eventName&&r.timestamp<e.timestamp,r.snapshot}).sort((r,o)=>r.timestamp-o.timestamp).forEach(r=>{var o;r=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,r.eventName,r))||r}),this.isMovePosition=!1):e=((n=this.getPlaybackSnapshot)==null?void 0:n.call(this,e.eventName,e))||e,this.trigger(e.eventName,e),this.index++),this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step)}trigger(e,i){this.eventDispatcher(e,i)}}const DD="@dao42/d42paas-front",MD="0.9.32",VD="d42paas front",ND="dao42 paas team",BD="https://github.com/dao42/d42paas_frontend#readme",GD="UNLICENSED",FD="./dist/DaoPaaS.cjs",HD="./dist/DaoPaaS.cjs",KD="./dist/DaoPaaS.d.ts",JD={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test:"jest --coverage",prepublish:"pnpm build",publish:"npm publish --access public"},eM={"@codemirror/autocomplete":"^6.0.2","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-cpp":"^6.0.0","@codemirror/lang-css":"^6.0.0","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.0.0","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"^6.0.0","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.0.0","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/legacy-modes":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.0.0","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.4.1","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.isequal":"^4.5.6","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15",prettier:"^2.3.2","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-markdown":"^8.0.0","react-transition-group":"^4.4.2","reconnecting-websocket":"^4.4.0","rehype-katex":"^6.0.2","remark-math":"^5.1.1",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.7.2","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1"},tM=["dist"],iM={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},nM={url:"https://github.com/dao42/d42paas_frontend/issues"},rM={workerDirectory:"src"},oM={"lodash.clonedeep":"^4.5.0","lodash.isequal":"^4.5.0"};var sM={name:DD,version:MD,description:VD,author:ND,homepage:BD,license:GD,main:FD,module:HD,types:KD,scripts:JD,devDependencies:eM,files:tM,repository:iM,bugs:nM,msw:rM,dependencies:oM};const aM=()=>sM.version,lM=async(t,e,i)=>{const r=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:i})})).json();if(r.status==="failure")throw _t.error(r),new Error(r.errors[0].erromsg);return r.data},$i=(t,e=1)=>{let i=t.replace("#","");i.length===3&&(i=`${i[0]}${i[0]}${i[1]}${i[1]}${i[2]}${i[2]}`);const n=parseInt(i.substring(0,2),16),r=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${n},${r},${o},${e})`},cM=()=>{const t=`
49
49
  @keyframes fadeOut {
50
50
  0% {opacity: 1;}
51
51
  100% {opacity: 0;}