coze-bridge 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +46 -42
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,25 +5,25 @@ import { dirname as __coze_dirname } from 'node:path';
5
5
  const require = __coze_createRequire(import.meta.url);
6
6
  const __filename = __coze_fileURLToPath(import.meta.url);
7
7
  const __dirname = __coze_dirname(__filename);
8
- var I0=Object.create;var rr=Object.defineProperty;var N0=Object.getOwnPropertyDescriptor;var R0=Object.getOwnPropertyNames;var M0=Object.getPrototypeOf,O0=Object.prototype.hasOwnProperty;var X=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var ke=(r,e)=>()=>(r&&(e=r(r=0)),e);var ae=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ms=(r,e)=>{for(var o in e)rr(r,o,{get:e[o],enumerable:!0})},B0=(r,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of R0(e))!O0.call(r,c)&&c!==o&&rr(r,c,{get:()=>e[c],enumerable:!(a=N0(e,c))||a.enumerable});return r};var Te=(r,e,o)=>(o=r!=null?I0(M0(r)):{},B0(e||!r||!r.__esModule?rr(o,"default",{value:r,enumerable:!0}):o,r));function bs(r){return Ht[_s]<=Ht[r]}function sr(r){ws={...r}}function Kt(r,e,o,a){if(Ht[r]<Ht[_s])return;let c=JSON.stringify({ts:new Date().toISOString(),level:r,module:e,msg:o,...ws,...a});r==="error"||r==="warn"?q0.write(`${c}
9
- `):z0.write(`${c}
10
- `)}function M(r){return{debug:(e,o)=>Kt("debug",r,e,o),info:(e,o)=>Kt("info",r,e,o),warn:(e,o)=>Kt("warn",r,e,o),error:(e,o)=>Kt("error",r,e,o),child:e=>M(`${r}.${e}`)}}var Ht,_s,z0,q0,ws,F=ke(()=>{"use strict";Ht={debug:10,info:20,warn:30,error:40},_s=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),z0=process.stdout,q0=process.stderr,ws={}});import{chmod as U0,mkdir as F0,readFile as K0,writeFile as H0}from"node:fs/promises";import{dirname as W0}from"node:path";async function Wt(r){try{let e=await K0(r,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function jt(r,e,o){await F0(W0(r),{recursive:!0}),await H0(r,`${JSON.stringify(e,null,2)}
11
- `,"utf8"),o?.mode!==void 0&&await U0(r,o.mode)}var ir=ke(()=>{"use strict"});import{homedir as j0}from"node:os";import{join as se}from"node:path";function W(r){let e=r??j0(),o=se(e,".coze"),a=se(o,"bridge"),c=se(a,"lib");return{cozeRoot:o,bridgeRoot:a,libDir:c,libEntry:se(c,"index.js"),pidFile:se(a,"bridge.pid"),portFile:se(a,"bridge.port"),tokenFile:se(a,"bridge.token"),logFile:se(a,"bridge.log"),installLock:se(a,"install.lock"),configFile:se(a,"config.json"),agentsRoot:se(o,"agents")}}function Ie(r,e=W()){let o=se(e.agentsRoot,r);return{root:o,config:se(o,"config.json"),workspace:se(o,"workspace"),logs:se(o,"logs")}}var ue=ke(()=>{"use strict"});var vs={};ms(vs,{AGENT_CONFIG_FILE_MODE:()=>Gt,enforceAgentConfigMode:()=>X0,loadAgentConfig:()=>xe,persistAgentSessions:()=>or,persistAgentSkills:()=>Jt,saveAgentConfig:()=>he});import{chmod as G0,stat as J0}from"node:fs/promises";function xe(r,e){return Wt(Ie(r,e).config)}function he(r,e){return jt(Ie(r.agentId,e).config,r,{mode:Gt})}async function X0(r,e){if(process.platform==="win32")return;let o=Ie(r,e).config;try{let a=await J0(o);if(!a.isFile())return;let c=a.mode&511;c!==Gt&&(await G0(o,Gt),ys.warn("agent config mode auto-corrected to 0600",{path:o,from:c.toString(8)}))}catch(a){if(a.code==="ENOENT")return;ys.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:o,err:String(a)})}}async function or(r,e,o){let a=await xe(r,o);a&&(a.sessions=Object.fromEntries(e),await he(a,o))}async function Jt(r,e,o){let a=await xe(r,o);a&&(a.skills=e,await he(a,o))}var ys,Gt,at=ke(()=>{"use strict";F();ir();ue();ys=M("agent-config"),Gt=384});var oi=ae(Y=>{"use strict";var S=D;(function(r,e){let o=D,a=r();for(;;)try{if(-parseInt(o(423))/1+-parseInt(o(1267))/2+parseInt(o(1189))/3+-parseInt(o(1124))/4+-parseInt(o(1806))/5+-parseInt(o(1240))/6*(parseInt(o(1489))/7)+parseInt(o(1632))/8*(parseInt(o(835))/9)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(mn,626405);function D(r,e){r=r-223;let o=mn(),a=o[r];if(D.ubpPQZ===void 0){var c=function(m){let b="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",w="",y="";for(let E=0,T,k,N=0;k=m.charAt(N++);~k&&(T=E%4?T*64+k:k,E++%4)?w+=String.fromCharCode(255&T>>(-2*E&6)):0)k=b.indexOf(k);for(let E=0,T=w.length;E<T;E++)y+="%"+("00"+w.charCodeAt(E).toString(16)).slice(-2);return decodeURIComponent(y)};D.aAURqA=c,D.dlFLeU={},D.ubpPQZ=!0}let u=o[0],l=r+u,p=D.dlFLeU[l];return p?a=p:(a=D.aAURqA(a),D.dlFLeU[l]=a),a}var Qa=Object[S(1831)+S(1111)],ex=Object[S(1720)+S(1308)+"mes"],ti=(r,e)=>function(){return r&&(e=(0,r[{LTEcp:function(u,l){return u(l)}}[S(295)](ex,r)[0]])(r=0)),e},tx=(r,e)=>{for(var o in e)Qa(r,o,{get:e[o],enumerable:!0})};function nx(){return Ys||(Ys=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function rx(){let r=S;return Zs||(Zs=[IDBCursor[r(1460)+"e"][r(375)],IDBCursor[r(1460)+"e"][r(1217)],IDBCursor[r(1460)+"e"].continuePrimaryKey])}function sx(r){let e=S,o={qhecq:e(1202),xfpFp:e(330),MfTvH:function(c,u){return c(u)},UumrZ:function(c){return c()},DQqwf:"ping_onc"+e(1467)+"s",WvXkk:function(c,u,l){return c(u,l)},yFcoY:e(1398)+"e_timeout",jedaD:function(c,u){return c===u},QVUiI:e(1507),XuvPU:function(c,u){return c instanceof u},JcgLE:function(c,u){return c!==u},GswdS:e(541)},a=new Promise((c,u)=>{let l=e,p=()=>{let w=D;r["removeEventListe"+w(991)](o.qhecq,m),r["removeEventListe"+w(991)](o[w(1372)],b)},m=()=>{let w=D;o[w(1830)](c,o[w(1830)](Ce,r[w(1701)])),p()},b=()=>{let w=D;u(r[w(330)]),o[w(1842)](p)};r[l(1627)+l(662)](o.qhecq,m),r[l(1627)+l(662)](l(330),b)});return a[e(604)](c=>{let u=e,l={VMyJv:o[u(597)],Dssuh:function(p,m,b){return o[u(1391)](p,m,b)},gaqhF:o.yFcoY,ySgng:function(p,m){return o[u(1830)](p,m)},btTxK:u(1202)};if(o[u(1755)]("pxxNR",o.QVUiI))return null;if(o[u(518)](c,IDBCursor))if(o[u(341)](o[u(1280)],o[u(1280)])){let p={gsFSh:function(m,b){return l[u(486)](m,b)},XNGKC:l[u(379)],jzxTG:l.VMyJv,kkXQx:l[u(1546)]};return new _0x55ede8((m,b)=>{let w=u,y={rgFen:function(k,N){return k(N)},OFjNS:l.VMyJv};this["_clearPi"+w(538)](),this[w(904)+"gTimeoutId"]=l[w(1456)](_0x1c59b7,this._ping.bind(this),this[w(1594)]["pingInte"+w(1506)]);let E=()=>{let k=w;p[k(896)](m,p.XNGKC),this[k(319)](p[k(1643)],E),this[k(319)](p[k(618)],T)},T=()=>{let k=w;y[k(736)](b,k(1649)),this[k(319)](y.OFjNS,E),this[k(319)](k(1398)+k(694)+"t",T)};this.on(l[w(669)],E),this.on(l[w(1546)],T),this[w(1249)]()})}else fr[u(1739)](c,r)})[e(291)](()=>{}),wn[e(1739)](a,r),a}function ix(r){let e=S,o={RUUmG:"complete",ttmVZ:e(330),iDWyE:"abort",nlQuu:function(c){return c()},EpszX:function(c,u){return c(u)},pYChy:e(990)+"or"};if(_n.has(r))return;let a=new Promise((c,u)=>{let l=e,p={JAZbz:function(y,E){return o[D(388)](y,E)},WoSoY:o[l(284)]},m=()=>{let y=l;r[y(1838)+y(1091)+y(991)](o[y(505)],b),r["removeEv"+y(1091)+y(991)](o[y(668)],w),r[y(1838)+y(1091)+y(991)](o[y(1389)],w)},b=()=>{let y=l;o.nlQuu(c),o[y(1731)](m)},w=()=>{let y=l;p.JAZbz(u,r[y(330)]||new DOMException(p.WoSoY,p[y(1370)])),m()};r[l(1627)+l(662)](o[l(505)],b),r[l(1627)+"Listener"](o[l(668)],w),r[l(1627)+l(662)](o[l(1389)],w)});_n.set(r,a)}function ox(r){bn={wbwNw:function(o,a){return o(a)}}.wbwNw(r,bn)}function ax(r){let e=S,o={WShcI:function(a,c){return a(c)},oeiDZ:function(a,c){return a(c)},VlMoA:function(a,c){return a===c},mqsSD:function(a,c){return a in c},iUTFr:e(534)+e(1609),NGxip:function(a){return a()}};return o.VlMoA(r,IDBDatabase[e(1460)+"e"]["transact"+e(685)])&&!o[e(571)](o[e(888)],IDBTransaction.prototype)?function(a,...c){let u=e,l=r[u(1482)](o.WShcI(Pt,this),a,...c);return ur[u(1739)](l,a.sort?a.sort():[a]),o.oeiDZ(Ce,l)}:o[e(596)](rx)[e(380)](r)?function(...a){let c=e;return r[c(1812)](Pt(this),a),o[c(1423)](Ce,fr[c(1792)](this))}:function(...a){let c=e;return o[c(525)](Ce,r[c(1812)](o[c(525)](Pt,this),a))}}function mn(){let r=["zuTNEem","rMPKswy","ugDAuMO","u2vYDMLJzvC","y2fSBa","y29UBMvJDca","x2HHBMrSzvi","yvHYywq","BLDhrMS","BMDLza","vuHkCxy","mtaYmNDsDwrNtq","B25SAw5L","CfvdzuC","vujHD1K","CvzMCxa","BLPcC3K","lcbxzwjtB2m","s05zBuS","ANv0q2G","BwvKAwf0zwW","twvZC2fNzuu","vxrYz3C","B0DJtuC","AxnrB1nby2S","s2j3u1C","Ag1gq04","z29PBMCGyxC","CNzHBa","yLnwqKS","uLLVsu0","sw9frfC","t251tMi","x29UtwvZC2e","z1r6qMS","veznwg0","zejwzvi","ignVzgu6ia","DKffvKS","AeLivNi","DgfYz2v0","reDyBfq","AgvHzgvY","zgPrBK8","rNb3B0S","m3WWFdj8mxW","AefJA01LC3m","DMvkt1a","y29SBM8","AwXSihvZzsa","AMTXu3K","r05HCge","B2LUDfjLywm","u1PUAMq","rLHsCKS","Bg9Nsurhzw4","A0v1B04","s0X6wwe","BKXPBMu","tNHyzLu","rKLmrv9ot1q","tgnWuuG","B3bLBKrc","z2v0s2v5","Agzbq0e","ChfTBvu","uMTrvNa","mhW2Fdf8ohW","z2fXAey","EKvXvg8","yw5ZzM9YBvq","wwfiDeO","Dgv4DfbHEwW","y2HnyxHuCMK","r0LJChu","zxjFBxnNAwq","v1rZq2i","B2nRzxrgywK","D1jfq1u","uwfLrhy","yM9L","y2XVC2uSihC","BuHyD0y","D24GCMvHC28","tgzJtwi","r0HVsuu","Aw9UvgLTzw8","Dw5wrgu","zwjksKO","A3blse0","v3LnBuy","y3jLyxrLrxi","CMzRwLe","r1j2qMm","EMTXtKK","BunmBfu","ywrKq291BNq","BgLTAxq","D2LWtxm","BMz6rNG","tMTYr2m","Dg9VigXHCMC","AvvmqxK","rgPttge","vgTMDMO","rNjVBNrPzxi","yMrFzgLK","BfvSuuW","yM5LEey","uLLxAhi","DhbizwfKzxi","C2vYDMLJzq","zMLN","mNWXmxWXFdy","q0Tbqvu","ugrYv08","x29WDgLVBNm","mdaWma","EwnUtxa","mhWZFdj8nhW","zxjHDg9Y","twTyCNi","D2LxwLO","zhvQrMK","DerZvgS","qwHLtvC","z1rPBwvVDxq","vu56C3e","rMnLzNO","CMLLC0nVDw4","sgPKywS","B3jLtMfTzxm","uMz2sKO","C3rYAw5N","Dg9cExrLC0W","y09Wzw4","AwXLtMfTzq","veToAfC","BxnNsuq","Ae9Wzw5fDMu","CM92AwrLihy","D2fZq2XLyw4","EMXUuLu","x3bYB3rVy28","DxjS","u2vXsuq","ENP0vKK","yM9tzu8","q0n2BKi","ywrKrxzLBNq","BwvZC2fNzv8","rwXHEey","CffYvwG","Bu9ewgC","ndCWmZjiEMPQuxq","AenSB3nLrxy","y01ut3O","Ee92DLG","ywnRx2LK","wMXAyNi","zLvPu0W","ventuM0","rwfzEfO","B25ozxr3B3i","C2v0q3vYC28","ANP4veC","sK51sLm","AgLNAa","qxbQuMK","y0L1vu0","r2vTtLm","DgLTzw91Da","wMDgruy","Bvbbr3q","ywjyAgi","swDXCuO","vLj1vKi","z2vY","rKfAu3i","uejlwvC","BK12q0K","zg9Uzq","CvfgENi","D3jPDgvvAw4","zw5KCg9PBNq","x25HDMLNyxq","y29Uy2f0","Bhz6wMK","wwjbALO","zu5hwee","mNWZFdv8n3W","ENzos3O","x2HHBMrSzva","wgvJAK0","uvnUCMC","BwH2Dfi","AuHeseK","qMzxq2O","swvSD24","tg9NsurozxC","x1fVu01HBMe","BxHgshi","y2HHCKnVzgu","twHjzum","rKPZu1G","vxbKyxrLq28","wNDTyMW","uffzu0S","C2v0sxrLBq","CMvZB2X2zq","x2nSzwfYvgK","CejpyvC","EuT4CKS","ChrVCG","EePitLi","tKrntwi","vKLYBLy","ywzVu1K","zxjFCw9Zx2e","vgjxvfG","DgLUzYbZzxi","tuLPEvq","AuHSDNu","CMvZDwX0","CMfNzvn5BMm","z2v0sxrLBq","AevzEfO","y2n0thy","A0vmAvO","Affxuxq","C29YDa","D0vJtKe","tKjhAvy","uMz0Bfu","Dg9cExrLC0i","x29Ut3bLBG","A05vEva","CMzIrKi","C3rHCNq","r2rADhK","CvbLteS","q0f6z3i","z2v0t3DUuhi","CgfNzwHPzgu","yvDnvLG","Egv5CLK","B1LQww8","nhWX","DMPerKy","x2zVCM1HDeu","DMftwhy","DxnLCKLW","t2DOuKq","BMXrDxu","zhLsDwC","zxH0zw5ZAw8","EfjIBgq","s3LPue4","A1n0yxr1C0m","BwPZsMC","y3jLyxrLt3a","C2v0","r2jnqMO","CwHRDNy","DhHLufa","qNn0shK","ywnRtxnNswq","uKfysKe","D3jPDgu","AwXLx25HBwu","CgvYC2LZDgu","C2XPy2u","qwrNqLK","zuTssMi","Dw5KzwzPBMu","CNnICgO","txrUquO","AMvKyuq","teTlBu4","sKDXBgO","AxnFywnR","B25pCgvU","x2DLBMvYyxq","ywrKt25L","zw50zwqGDhK","zNjVBuHHC2G","DeLUDgvYy2u","r1HWue0","BNrLCG","AuTPExi","wwTjAfm","jMPZy2fSBgi","Dgv4Dc9Qyxy","yuvhzKO","y29UBMvJDeu","Cgu6ia","AenAEue","AhDAAve","DgHHBIbSB2m","A21nvhG","AKLtBKi","tuvvCfO","uvfeDxu","yuHnENy","ugf0vMG","Bwf4uMv0CMK","x21PBMLoyxy","zKfZzhO","vxzktvq","yNL0zu9MzNm","DxbIuMe","q29Kzq","rufVvwG","DNDqrMm","z2v0","BKzJwey","teLLs0W","zurbzve","DhjWB1u","zMDAAgK","B3v0sw50zxi","zxrxB3jRq2G","wg1gC0W","ENzUz2S","CwnVuMO","BePKwMe","q29UzMLN","q291BNq","mZyYmdi3nxHstMHUtG","rLbUv0O","sLrmA2W","qufHz1G","x2fKzfDZtgK","z0P4sha","yxbWBhK","yvjnwhi","tLPfrK8","zxf1ywXZ","verJzgm","CLzyugq","wuzRCvq","EhP1Bhu","uMreA28","zMX5r0G","tK5eB2O","C0XAv2C","qwvUwgS","A2v5CW","y29UC3rYDwm","CMvJzwL2zwq","CMvKDwnL","ywXSq3vYC28","twzuDKG","zgvMAw5Luhi","r2Hsu2q","wu9qv3i","yxnJCMLWDa","rvv2y0q","Aw47y2HHCNm","zxfktei","CMvTB3zLrxy","yw5Nzq","zw5JB2rPBMC","q3fgCwW","vxvTCLO","BMrWB2LUDfq","wu1ksgy","q2Tizgm","q3jqv3m","EgnRs0W","yxnquhq","zw5HyMXLuw8","q3DiDxm","rLbYCum","rNjmChi","DKnVAKO","uLjpuG","A2nHueW","rLrfs3i","CuTqu2C","Dg9cExrLCW","vLjzBhG","uuzzyLG","Aw5Lza","x3DZsw5ZDge","zg1nD2C","x3vYBa","tvjiBfq","uLnmDM4","C1bgqw0","EeDhDgW","yxjYyxLIDwy","DxrVuMvJB24","Ahr0Ca","y1Powfi","zhL4qwe","sM9HvMO","EfHewvG","zMLSzw5HBwu","ExDMwwe","qNjKs3K","B3jRig9MzMW","AxDTsu0","yMLUza","qw55Egu","AM5Xvui","CwvtCKe","vvH0vLa","BfH6zKe","yMLUyxj5vhK","zu9SzLO","CKDczK4","x3bPBMDmB3m","C3rLBMvYCW","r3PLz2i","vvfit28","B25szwnLAxy","Ahfby1q","zMzmAw5L","tw9KDwXL","x3nVy2TLDa","x2vUzhbVAw4","yNvMzMvYzwq","u1Ltzxm","ywDLsgLKzq","yu1VDum","s1LHuu0","AMvJDfn0B3i","qw1VDw50","ywX3yxLZ","D3f6wMq","ufzmy0y","CvjxtLK","BgLUzq","veTuww0","CfLdAhK","yxbWzw5Kq2G","quXSyKG","EsbJBg9Zzwq","vgvsExO","ufnPueu","B3nfrgq","y2f0y2G","DKncA00","svrKq1O","sxDXzhi","tfrfy3a","DgjPD3O","reiGzMfPBgu","CMvHzfvjBNq","zgvSzxrL","yLfwtKG","Ce1zs2S","Dw50","s2fAwwO","ywjuyM8","AhbNBw8","r0Pes2e","B2fK","A0vfzxa","t0Xqt1G","ru1mAwK","DeXhtgm","AxnAzxjV","sMHczMO","q3vZDg9Trxi","Cg9PBNrdB24","sKjhtKK","x2LUDgvYDMe","y3ruAw1LB3u","B2zM","B2nRzxq","r2vhwMK","Aw5KzxHpzG","wejIyvO","qMTYzfC","z2vtEw5J","x2rItMfTzq","ALvPwhe","txHxA3m","ihn1y2nLC3m","zxjYB3i","CMv0CNLdB3u","x0vysvnu","zMXVB3i","D2rICue","sxfusvy","t29Zz1q","CgXLyxnLiha","BvbHuvm","twHWteW","ze1qr04","sMnNteu","BevLDhy","ELjyq1G","rvzlzLC","swLVtMm","zerOD1q","x21LC3nHz2u","EeP2qwO","x0rctMfTzq","zvvYBa","AwHxrwO","q2jRzNC","zMvY","tvvYC0i","z0nODg0","DKrWqKe","BwvY","yMv4DLC","ELvMsha","BKfosKi","svjUAM8","veT1zhm","y2XVC2veqG","Dg9mB3DLCKm","uuTOBfa","tvr4svu","qxPIwgO","zufJAW","zg1Use8","ueziEeC","Cw9Z","s09fs2e","DhDVCMTdAge","zfDVCMTLCKC","ywr2yw5Jzq","Bwf4twvZC2e","AwrI","y1zHr2G","yNruEeS","Aw5JBhvKzxm","sxbYAgC","igzHAwWSig0","D1nhBeK","te1cBwK","Efrtz3a","yxPXvgq","y29Kzq","rxbZELG","ugP1CuS","zNvUy3rPB24","A0PZwKm","qun6u0G","DLzQCMK","BM93","CMfzC2W","y2ncCfC","tMvMtwy","BgzuyLu","y3vYC29Yx2y","yxjWsum","BMCGB3iGyw4","Ec1TC2CTy3u","zMzMzG","z2n4EMK","AfLKq0q","swfbv3u","id4G","yxnL","qKfJCgq","x2jPBMfYEvq","C0XPC3rLBMu","vwDMyvq","AuXNA3u","CfLeuKy","Dw5RBM93BIa","Cu5LAwu","AgfZ","q3vZDg9Tq2W","zgLZCgf0y2G","u1jICvm","yu5Nteq","CM92AwrLigi","odiYmtiXv3jhD1ny","v2vIu29JA2u","B25OrvO","BKT6rw0","refVweW","rNfwEfm","wezYqwe","BgLUzw5V","txftBLi","qvHXDhq","x2n1CNnVCK4","D2fZzMC","ChfrBKS","Bu9ID1G","x3bHDgHlzxK","v2veyMy","zcWG","C2vUza","tMvmBha","shjQvKm","BezSDxnO","r3rQvgu","y3jLyxrLuMu","x2XPC3rLBMu","uuD0rhq","swf2tLm","v0XNzNG","vKzZEwy","x2n1CNnVCKy","y3jLyxrLtwu","zxjizLe","BuTKquK","zwrPyxrLBhK","AMHesvy","uuPttvG","BwvYwgm","zNDZxZeUmc4","q0Xpu0ve","C2fNzq","zu9VzLi","y2XVC2u","BMv4DcGPigm","ihrPBwvZ","r1rxq3C","tuHlDe4","BwfUDwfSihi","tezyqwu","vu1Yv1u","zMLUza","r0XLAvG","whDoBvK","BMPyzgS","BIWGAg9ZDg4","u2vszw8","quDNquW","s2j5v3u","u29NtMm","zNHAsvy","zwTzBxu","qwzlAfu","yxrHlcbKyxq","Dgz0q0i","CMvUDevUzha","EvnNBMC","AxjLza","rwfKCLC","BwvZC2fNztO","AwDHDg9Yt24","rgXnzNm","zxj2AwnL","A0vzqve","C2HPzNq","yw1xq2e","y2HLy2Tszwe","CM92AwrLige","ywnRpwzYB24","DvHzDhy","yMfJA3vWigu","zeH3Be4","CvDvB0W","zM9YrwfJAa","A01WruC","uLvvBuC","BMTXy2W","B3bLBG","wMP0sey","zNjVBNrPzxi","wNHfrg8","DhjPBq","wvnUwKC","quTYy08","sLLut0G","yNL0zuXLBMC","teTQrxu","wwrjBvy","whv2ufu","s25tuNK","quXm","ANfHr24","Aej1DeG","z1buqMm","whjYrK4","v1nOy0K","z1nqzK4","Bhm6ia","zw5fDMvUDa","nhW1","sLnYB0G","B3jpBMXPBMu","BNvTyMvY","rNHSANu","B2jQzwn0u3q","BMvJDa","igfYCMf5yNu","ve5mvM4","BMDuAw1LCG","x2nYzwf0zvm","D1jJwKy","CLrvAgO","sKvoDNe","uwrpzLu","tfbLz2O","rgXJv1a","ywT5tfG","o2nOyxjZzxq","C3jNr1O","y2uGBM90igK","zgf0yq","qw5Yvg4","DMvY","Dg9tDhjPBMC","ywj3uK4","ywLtD0C","u3DZshO","ysbTDxn0igi","CMfUzg9T","CgnHExe","ChvZAa","D0rswg4","C2nzvhu","suvtx0vsuK8","yK5itNi","wez3whG","D3nZoI8V","ihrYEsbYzwm","CMvZzxruCMK","zNDSwNa","CwTvvLy","BxfZu0q","x3nLCuLK","BwjbrMu","BMjNtfG","tNzhEvy","t1jPBMq","EhrgBem","yxz3BMG","C3vIC3rYAw4","B3jRzxjhBg8","C3zxELy","Dgv4Dc9WBge","seLvCxu","B3vUDa","C2DVzwq","A0z6r1O","zNjVBuj5Dgu","BufYzLq","BMnywxO","De1HBMfNzxi","uLzpzNa","v09sDM0","AgfiBLO","tKDFrvjst1i","wu9qwu8","tKD4Axa","rffXD2y","zw5XDwv1zq","CffcCKS","A1PyC0i","B3bLBIa","uMvJB25Uzwm","uNfdCge","DgHLBG","Axnby2TdBgu","ihrVihjLDhi","yM1TuwW","CYbPBNn0yw4","ENfOy3G","DKnvt2K","sNLiz2C","Bwf4tg9ZC0m","Bg9N","BNjjD1C","CMvJzxzPzwq","yxbWBgLJyxq","y2HnyxHdB3u","A2TyuxG","zufYzwm","zMvhC0K","seTTDwC","yxv0BW","r0ndvNq","zezPwLu","pxv0zI04","BeHHBMrSzxi","CgfNzxnOB3C","sgXoueG","q09otKvdveK","lcbTyxGGCMu","x3DHAxq","x29Uq2XVC2u","yw1L","Bwv0Ag9K","wK1usw8","vNnmB1K","DxzAteG","AxDdDK4","lcbOB3n0BMe","wNvRz2W","s0zzqxm","nhW3Fdn8oxW","sePMwwm","BwLZzq","Aw5PDcbrB1m","we9tq3C","ufnzzNa","DeLK","EwPcBum","s2LuueO","Cgf5Bg9Hzfq","B25LCNjVCG","zM9Yy2u","Bwu6ia","mxW0Fdb8mNW","sNHTy2O","yLDwDLG","zxjYtM8","DhLWzq","ANbpEMG","BgLpzKy","tgLZDgvUzxi","zxq9DxrMltG","DhDAt3q","DMvUDa","BgPnExq","tMzlwLK","DhrTvLO","vK15sNy","DgnWyMe","ExbL","D3rNqK8","vKH2yvO","AgjTzuW","BMvpy24","yM9KEq","Ae9hEfm","r1vIvwu","z0zJBeC","AuPVtK4","u3blsgy","zwznq0m","DujTv1q","rhDAuM0","Aw9U","Cgf5Bg9Hza","r05uzMW","x3nLBMrby2S","DKr0t1a","zhLkqLm","s3bAq1i","yNLL","qK9lz04","zv90Aw1LB3u","AxbuuvC","zKT0CKu","zMLSDgvY","teznuui","B3nLza","BMnVzgLUzW","B1PTu2u","DNffy2m","DcbSAw1PDa","ELjQuxq","rxjYB3jdB2q","DgLTzw91DcW","BMrLEa","vxjxCKu","zNruv1G","x2rYB3bhBg8","re1VAhy","ywDLrxzLBNq","BgfHCva","A3LMqwK","svnbEfG","rezJtg0","B2XKvMvYC2K","qwPHCNq","EfDSzM8","m3WXFdi","C2v0u3rVCMe","BNrfBMrWB2K","D1DdBgy","A1PXzgO","vurUrxi","wvzkqxu","CgLPyLi","BKDLreG","rgrOsgO","x2rPC3bHDgm","BKDNCw0","zgfJBe0","sKnSrLO","sKXSBNK","zwvTruK","CMDgzw4","y29UBMvJDfm","ywHZsLO","r3vzCLi","BNruCMLLC0m","yxnZAwDU","x2LZv29YA2u","AgDWsvO","wgfPrxG","CNjVCK1LC3m","C3rVCcbPBw0","tKLXCNa","Cuvuwey","swjAzeu","r3LprNe","zLvmvMy","u1L5Cge","CNnVCL92ywW","Bfj0sNy","zMX1C2HfEha","B2nRzxrtDwm","wLnYyMi","Dg9iyxnO","y3vYCMvUDeu","C29mC2S","twLYq0e","rgvKAwnHDgu","rK9XyvG","CKH4s0i","AKHxDe0","zwnVBM5Ly3q","s0f0zw4","Cw9Zx18","y21YAKS","BM5Ly3q","CKjVEKm","zMvoAfa","CMvXDwLYzwq","Dg9hzw5LCMe","EezSEK0","ign1CNnVCIa","DxDHshi","qLjRru4","vw5Oyw5KBgu","tKHlAxu","Ae1LC3nHz2u","suToAeW","AejPDeO","uwLcsgu","rKrMCgS","vw5PBxbSzw0","s0PxuhG","Aw5KzxGGB3u","AMXxv2q","zxHWB3j0CW","A2v0ignVBNm","whDpqwq","suP4BLO","CMvTB3zLq2G","ihzHBgLKigq","sKDPANy","Bw1PEem","mxWYFdb8nhW","ueTTAg4","mdaWmdaWmda","sK9Auee","AMrytNy","Bvn1Evm","uuPksue","zhzfyxy","wgT6tLC","uLfxv3e","tgjQzeC","rg9hD0i","C2v0zgi","rvrnzfq","yw1Lu3bHy2u","C3rVCMu","yw51Ce1LC3m","x2n1CNnVCK0","BwvZC2fNzq","sLfHtxG","CgfYC2u","z2v0qwXSs2u","wenzrK4","AvPdAw0","r3jbwKK","rMXftxC","D0fOqMK","C0jf","veLIy1q","D0ThAg0","qvHUBey","thjTEhy","q3bZsvi","C0nVDw50zxi","AwrvEuW","s0P0ELm","C3bSAwnL","ndm3neHrC01JAG","wufLuxq","EunuAK0","y3vYC29Y","CeHethO","zNztuhK","uwnuzgu","CxHAugO","twLZC2LUzYa","zxjYtxnN","v3zcvxy","Dev2zw50","vfbMrM0","uNj2wMW","sNv6zw8","Aw5KzxG","vuH1weC","BMfTzq","CNHMzNa","icSG","whPmDxy","D2Povwi","D0HOAM4","yMvpANi","wez2wNG","Cg16Cu8","CIb0DhDjra","u2Dzu1C","zNjVBunOyxi","uefzu3m","rerjy1C","y3vYCMvUDeK","q1nmywe","su5tvefova","DLflDKW","y2PuBhK","z2vrDwv1zuW","DNn2CMu","BM9Uzv9UB24","BML0AwfSAxO","x2LZtwLUAvq","wKzjC1u","shLUBvy","vMX4B1a","AxbtuKW","y3r4","qLvJz0u","zxjFAxnFywm","CwjREhK","AgfUz2u","zvj5AgW","qKPHt3C","CNvst2m","AvvurNi","Efrurw52","vxLbqNy","AgvKtwf4uMu","tgLtseW","CuHvvLO","t3jYzLy","D2zSDhG","z3ngu2G","zcWGDw5RBM8","BMv3vMvYC2K","swfjsNa","AxrIDfO","r2jyDhG","ywrK","CMTLCKDSB2i","x3bPBMDqB24","r0L3Bhe","sfjgyNi","rMHbsNK","uKXhBge","BKTQB04","CxvWrNe","wgrevLm","CfHHv3q","BvzrCvK","te11Avq","v2LUzg93","Exvgwuq","A0XNt3q","rvnqwe0","D1jXA2i","z1bIv3G","zw50","CNr3y3a","x3jLywr5q2W","y0vNte8","zw1TrMy","zwrztNe","AxnmB25N","CM9YrxzLBNq","tvH0uLy","BMvLzf9Hy2S","CMvZzxrfBMq","zgPwD0u","t2jQzwn0","rgTvELy","Aw9Ul2PZB24","sw54t1K","yKTbA2W","ywXPzcb1CMW","yw5Hz2vY","s0jtr1a","zNjVBujPDhm","yMfSu2nVCgu","qwjwAeW","B25JBg9Zzq","zvb2vxG","ANjQBeO","r0XeC28","sMzdqwK","sKrIDfG","zwPSC2C","A0jJt0S","ywDL","s2vuDKK","thvWqLu","y2vZC0HHBMq","yvLWrhC","AxnszwfKEq","A0PZBvO","r0TIveG","B3nnt08","t3bLBKv2zw4","zuTMAw4","Cg9oD3K","vgfsveu","C2nYAxb0","AvLjzhm","ywXS","wgLxreC","BeXkshq","z1b4s2C","rvDprM4","CYbWyxjHBxm","vMvVquO","twL5ru8","BMrWB2LUDca","rfPfCuK","x3fVC0rc","mNWXFdD8mhW","twTAwfi","wwTVyvC","CvHTufK","DxrMofDYAxq","C2vYs3C","zLzUDKu","rKfXwLi","Dg9Y","ihbYB3rVy28","y2rnD24","tMfTzq","qwjVCNrfCNi","BMvY","y2XLyxjtDg8","BwrmCei","zMDzs1q","uw5rvNG","whvsuNq","B2zMBgLUzq","EvjLy29UBMu","uvbXAxu","C29Tzq","vgTutKC","mNWWFdf8m3W","y3jLyxrLq2W","qxbSrxe","zgvS","EeXjzLq","rwfnvNq","rgvwzKC","B25tDgfYDfi","BvDAz1e","q0Tssee","ufPnqxO","BwDxthu","CeXgyu8","wuXMq1G","v3bdv2q","l3DZl3yY","sLnWANy","igzPzwXKoIa","rvPwBuK","Dxrtzge","BeHsDuq","qNbAEhe","ChjVy2vZCW","vg5hvum","AwXK","x29UugfNzu4","C2DPza","whrRrgq","y1jJCfm","tMX0wvG","tKzWuhe","u2fJsKu","D1jxANi","zvnnvxu","BgvY","weHpvNK","C3nHz2vfDMu","C2Lvz1u","BwfW","rLDt","CMvWBgfJzui","y3vYC29Yx24","y0zlreW","rNLxDe8","A212CMm","DMfSDwu","r3zqtgO","Ahbnr2W","AvLcquG","BuXQuKy","AhjYwKK","tfvUEu4","zgLZywjSzue","mNWZFdb8mxW","BfrPBwvVDxq","x2rPC2nVBM4","nhWXFdj8m3W","qMzhwvm","Cg93","vKjrvuO","AgfZt3DUuhi","ChjVDg9JB2W","AxnbCNjHEq","u1PfzLe","BNrbBMrvCgq","B3nLrxzLBNq","sNLgrLe","uMvHzcbWyxm","BwLUzW","v1D6uLO","rvjst1i","zgrjrcWGzgu","A2v5","DePoDgy","ELrmBKO","qwfmrgy","x2LUAxq","s3jADe0","yuTXrei","ywjVCNq","DvPfwLG","z0P3zfO","yw1LoIa","q3j3y0W","z2TVsfO","ALHQsui","sLvQv0W","x29UrxjYB3i","thbPrNC","zw50tgLZDgu","ueLRt3q","zxLIyuC","B25mAw5L","suLjDwi","vK5RCeO","tMfeAfe","DefPu1C","BxHxy2W","AMLyBgG","CMfTzq","CKv5svq","t1bftG","n3W5Fdr8nxW","tuvtu0fhrv8","CfzJsuy","uM1KsLC","Cw5dDgq","Aw5L","reHZCwq","B3bLCNr5","A1b6wxe","CgLUz0XVC3m","sefZy3K","C3vIyxjYyxK","DMfS","x2rLC3rYB3K","tg9Nsuq","zvzZq08","C3bSAxq","vMzuq1O","BfnHthu","CNzHBfzHBhu","mZK4ntuYDNjmy05s","AufRAvO","t1bftL9fuLi","sw5lBLy","EuL5CuG","ANbTwg0","zvvpAwe","x2rLyNvN","zwTIuLC","ve5RC2y","yMfSrxzLBNq","mNWZFdb8nhW","AgXJzfq","y3vZDg9Tshq","sxbNueq","AgvHzgvYCW","zNL6s0y","zgvJB2rLzey","A0zKqMq","t2zyqNi","sLnptLa","B25TzxnZywC","BMPOy3q","y0nWs2e","uxvLDwu","vw50zvm","vfbOzfa","z0r2Cuu","x3DZ","x2LZtwLUAvC","sgHWvwq","r21WCvO","suHdAwK","igXHCMDLCIa","renAs3G","r0vOshi","zhvgyMu","wuDcCuG","BvL2tum","Bg93","AunADLK","wffdt04","y0XwEeS","CMvWBgfJzq","y29UBMvJDa","C2vUDa","zw5HyMXLqxu","CMfVDu0","zfPvzLa","zw5NDgG","C0nvBg4","CKjvAg0","C2vYDMLJzs0","rvHKzxC","y2XLyxi","EgL4v2K","Dvj3DLa","t2DOvfa","Chv0","tg9JAW","x29UvgLTzw8","yxrLq291BNq","B1rYz2K","y3vYC29YlNm","sgr3re0","mJi1nJK3ogDWwMrVrG","uufSsgK","tw9rAMi","yNPZAw8","C2v0y3vYC28","AuXLuKG","B2zMC2v0","qLrQzeK","r015rNu","z2v0qwXS","q2PXALe","vxznqvy","D2LSBfjLy28","C3vJy2vZCW","vKHezhO","x2LZsw5PDa","DuD3y2y","vfzgyve","Ag5xrfm","v0TxtNe","EfPmwxu","BvvtEu0","DMLJzuLeig8","wuLNCfG","ywjUvfe","suXsuw0","C2vUzf9Hy2S","DhjPzxmGCMu","y29UDgLUDwu","CgLUz1rPBwu","AxnrB1nnzxm","CgLUz0LUDgu","D3HiEum","y29TCgXLDgu","shnYEhG","v0DTCLy","ELznDNy","B0fsue0","Auf2v1e","D1zgwey","z2v0u3rVCMe","ruzduNu","yvLgEMK","u25mBhO","svnyt2W","A1rhC1m","CMvHC29U","Afb4DM4","wuf2wwy","t1DQCMW","BgvUz3rO","mJe3mZHqruTICKm","seXvBxm","rxzLBNq","vgH6rwW","zNjHBwvuExa","BhntwMu","D2D6zgK","AM9PBG","Ec1TC2CTCw8","x3bPBMC","vKv1tvK","r1jQEei","Bg9IywXty28","C0DvywC","x3bYzwzPEa","yMXVy2TLza","Dhr3Awq","CLPeqK0","rM5Ysuu","CuLHDve","BgLZDgvUtMu","Duj3sfC","zwn0","r3rAC0e","q09oveLovuu","vgfN","rw5bsMm","mtyXnJy4nMz2s3fura","yNL0zxm","vu1IwwW","yxGGCMv0CMK","Dw5ZAwDUzwq","Dhj1y3rVCIa","ENzeEuS","z2v0q3vYCMu","zfzStuC","B25tDg9Wsw0","yLHoq2G","quDNtwS","zsbHihn0CMK","r3n3zfm","EuPwCgi","BMnLq2XVC2u","zwzUuxe","zuPlsgW","vNPJqvC","C1Her04","zxmGCMvHy2G","vNfcyKe","C1jwuKK","B3jQyLO","BgTjs1y","x2nSzwfYugK","v2n3wxO","t1nprvC","z2u6ia","Aw9ot1a","ihzHBgLKihm","yxv0B21HDgK","rMvMzMW","u2LduLm","rLriA0q","Cgf5Bg9Hzeu","yxbuy28","zw1PDa","DKrXEKm","zgvIDwC","CKDYww0","B3bLCNr5tMe","BuzMEMq","CMvHzhDYAxq","rfH0D0u","B1Hrsfa","nxW2Fdb8nhW","DxbKyxrLq3u","CKTfA1m","y29UBMvJDgK","zNLfqLi","teP5y2G","vuHrBwO","B0zZu24","rwXxEhG","EKzAzxe","uMfbu2e","zMr5reG","qK5pt1u","u1rns1e","rNH3yxy","CMvJB25Uzwm","vKXvAfO","uMXgsKW","ExjMDLu","z2vjBMzVu3K","CNnVCL9Uyw0","Ef9MCM9UDgK","BwLUAvbYB2C","x3jLy29UBMu","rvvJALO","t0PzEeq","ywnRDxbfBMq","BennA2O","x2LZqNjVD3m","EK1MDLa","ExfmBfO","Dxrjza","wwDcCu4","FdH8mhWXmhW","vvLTCfy","AwL4qLe","rLvpBMq","u3LnELa","vwnsCMW","s01puwO","ANDPB20","wKDXugy","Cg9W","v0Trs0O","u2HHCMvKv28","u3rYyxrLz3K","yu1wsNG","q0Xpu0LorW","DgvZDa","vezsExq","vML1ze8","ihjLy29UBMu","AMvOs00","u0Xzs1O","CMvHzhLtDge","y291BNq","x2DLDeLUDgu","v29tB1K","AxjPsLC","EgzWrNa","Dervuw0","D3r5ELe","sKfOrNO","Dg9oDw1Izxi","vhnfsNq","yNvMzMvY","C0n3qu4","AKHtwu8","EMD0Be4","uhv4zMK","ywnR","weDpt1C","Bg9NsurozxC","zeXNyLe","A3DkuLK","x2LUAxrqCM8","AurxEuu","zxjFCw9Z","v3zyA2S","DMfSDwvZ","BMCGzMfPBgu","x3jLBw92zvC","ChbL","u2TPCcbWyxm","zLPpEg8","CgLUz19VBMm","zw5JB2rLrNi","u0Pfu3O","vKjRDg4","AuvwveO","AxmGDw5Kzwy","EvzuDNe","zKXgwKy","y2HLy2TdDxi","sxHcu28","Cwj4z1K","txzYC3m","Derzy1a","swjXzvy","zNjVBu51Bwi","x2HHBMrSzu8","yMjsDKW","ywDLu2HVDW","ywnOzwq","CMvZzxrdB3u","ig1LC3nHz2u","BLL1reO","txrpDxG","BwLPuMW","vuriEfy","B2vPrfO","ALHxr2m","AevYCM9Yrxy","BLP6z0e","BKLJruO","rLjptLrjrvi","q1DvAK8","yMveBvy","uev0CfO","BLLuEuu","mtb8mxWXmxW","u3LYrwO","AuTrqNG","vMnztK4","C3rYAw5NAwy","B25Uzwn0Aw4","sNvNz0m","Ee1iteK","x2nVBM5Ly3q","DenozuG","vLHJBxq","ihrPBwvVDxq","C0Xf","C01uzK0","DfzvD2i","zxryy2K","wvHOuwG","tufyx1jfvfi","CMvHzg9UBhK","z3zZsNa","q29ltM4","vw92yw4","A0PNsui","rhnZDwG","Aw50zwDLCIa","tfrKwNm","nxWZFdr8nG","ChjVDg90Exa","tMXzDLm","q3nnyLa","AwDnC2e","zefWweC","txDQv0i","zfPUDvq","zv9ZDwnJzxm","DcbVzIbYyw4","Dvvmvey","D09czve","Ag1Pvfm","A0nJuKe","tKfusvzfx0u","DhjHBNnHy3q","tvnoBKW","uNvxwLi","Dg9jsM8"];return mn=function(){return r},mn()}function xx(r){let e=S,o={ApjRi:function(a,c){return a===c},CwHus:e(390),aMVJx:function(a,c){return a(c)},wtgBO:function(a,c){return a instanceof c},XGOOW:function(a,c,u){return a(c,u)},LiSHL:function(a){return a()}};return o[e(1646)](typeof r,o[e(1850)])?o[e(1359)](ax,r):(o[e(672)](r,IDBTransaction)&&o.aMVJx(ix,r),o[e(1384)](ni,r,o[e(892)](nx))?new Proxy(r,bn):r)}function Ce(r){let e=S,o={dVlMG:function(c,u){return c!==u}};if(r instanceof IDBRequest)return sx(r);if(gn[e(417)](r))return gn.get(r);let a=xx(r);return o[e(1275)](a,r)&&(gn[e(1739)](r,a),wn[e(1739)](a,r)),a}var ni,Ys,Zs,fr,_n,ur,gn,wn,bn,Pt,$s=ti({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={YUhPR:function(o,a){return o>=a},fwlZp:function(o,a){return o instanceof a},KBSGP:function(o,a){return o!==a},SyrEj:r(949),mLjRF:function(o,a){return o===a},RdDko:r(1659),AXqtt:r(534)+r(1609),uMOkb:r(813),DeVfG:function(o,a){return o(a)}};ni=(o,a)=>a[r(1e3)](c=>o instanceof c),fr=new WeakMap,_n=new WeakMap,ur=new WeakMap,gn=new WeakMap,wn=new WeakMap,bn={get(o,a,c){let u=r,l={ihWEj:function(p,m){return e.YUhPR(p,m)}};if(e[u(569)](o,IDBTransaction)){if(e[u(940)](e[u(1434)],e[u(1434)]))return l[u(351)](this[u(1368)],this["maxLossC"+u(584)]);if(e[u(1051)](a,e.RdDko))return _n[u(1792)](o);if(e.mLjRF(a,e[u(432)]))return o[u(534)+u(1609)]||ur[u(1792)](o);if(e[u(1051)](a,e.uMOkb))return c.objectStoreNames[1]?void 0:c[u(534)+"ore"](c[u(534)+u(1609)][0])}return e[u(1008)](Ce,o[a])},set(o,a,c){return o[a]=c,!0},has(o,a){let c=r;return o instanceof IDBTransaction&&(a===e[c(1820)]||a===e.uMOkb)?!0:a in o}},Pt=o=>wn[r(1792)](o)}}),ri={};tx(ri,{deleteDB:()=>ux,openDB:()=>cx,unwrap:()=>Pt,wrap:()=>Ce});function cx(r,e,{blocked:o,upgrade:a,blocking:c,terminated:u}={}){let l=S,p={lCMkj:function(w,y,E,T,k){return w(y,E,T,k)},gapED:function(w,y){return w(y)},efMCC:function(w,y){return w(y)},CjqjQ:function(w,y){return w(y)}},m=indexedDB[l(507)](r,e),b=p[l(1199)](Ce,m);return a&&m["addEvent"+l(662)]("upgradeneeded",w=>{let y=l;p[y(1340)](a,p.gapED(Ce,m[y(1701)]),w[y(717)+"on"],w[y(898)+"on"],p[y(682)](Ce,m.transaction))}),o&&m.addEventListener(l(1255),()=>o()),b[l(604)](w=>{let y=l;u&&w[y(1627)+y(662)](y(463),()=>u()),c&&w[y(1627)+y(662)]("versionc"+y(884),()=>c())}).catch(()=>{}),b}function ux(r,{blocked:e}={}){let o=S,a={tAiSW:"blocked",XFrAa:function(u,l){return u(l)}},c=indexedDB.deleteDatabase(r);return e&&c[o(1627)+"Listener"](a[o(1098)],()=>e()),a[o(429)](Ce,c)[o(604)](()=>{})}function Qs(r,e){let o=S,a={trpoU:o(1310)+"e",rfkZQ:o(1451),OfXBr:function(m,b){return m in b},eclaJ:o(1611),NfKZY:function(m,b){return m!==b}};if(!(r instanceof IDBDatabase&&!a[o(1143)](e,r)&&typeof e===a.eclaJ))return;if(pn[o(1792)](e))return pn[o(1792)](e);let c=e[o(1167)](/FromIndex$/,""),u=a[o(667)](e,c),l=ii.includes(c);if(!(c in(u?IDBIndex:IDBObjectStore).prototype)||!(l||si.includes(c)))return;let p=async function(m,...b){let w=o,y=this["transact"+w(685)](m,l?a[w(1796)]:a[w(1570)]),E=y[w(813)];return u&&(E=E[w(850)](b.shift())),(await Promise[w(967)]([E[c](...b),l&&y[w(1659)]]))[0]};return pn[o(1739)](e,p),p}var si,ii,pn,fx=ti({"node_modules/idb/build/index.js"(){let r=S,e={JejcI:r(1002)+r(529),ykFxL:r(1792),kJsmZ:r(1541),tWqWT:"getAll",qeSrA:r(1368),nZBsy:r(1182),sfegX:r(299),wRqkb:r(1178),fnWtE:function(c,u){return c(u)}},o=e.JejcI.split("|"),a=0;for(;;){switch(o[a++]){case"0":$s();continue;case"1":si=[e.ykFxL,e[r(958)],e.tWqWT,"getAllKeys",e[r(255)]];continue;case"2":$s();continue;case"3":ii=[e[r(1494)],"add",e.sfegX,e[r(919)]];continue;case"4":pn=new Map;continue;case"5":e.fnWtE(ox,c=>({...c,get:(u,l,p)=>Qs(u,l)||c[r(1792)](u,l,p),has:(u,l)=>!!Qs(u,l)||c.has(u,l)}));continue}break}}}),dx={idb:function(r){let e=S,o={pUCeG:function(a,c){return a===c},hQWQt:"tGAgW"};r[e(790)]=Promise[e(1687)]()[e(604)](()=>(fx(),ri))[e(604)](function(a){let c=e;return o[c(1491)](o[c(1707)],o[c(1707)])?a:_0x5f2d00[c(534)+c(1609)]||_0x4d280d[c(1792)](_0x33888a)})}},ei={};function Se(r){let e=S,o={peWzP:function(u,l){return u!==l}};var a=ei[r];if(o.peWzP(void 0,a))return a[e(790)];var c=ei[r]={exports:{}};return dx[r](c,c[e(790)],Se),c.exports}Se.d=(r,e)=>{let o=D;for(var a in e)Se.o(e,a)&&!Se.o(r,a)&&Object[o(1831)+o(1111)](r,a,{enumerable:!0,get:e[a]})},(()=>{let r=S;Se.o=(e,o)=>Object[r(1460)+"e"][r(1062)+"operty"][r(1482)](e,o)})(),(()=>{let r=S,e={EUvcD:r(268),srgGZ:"__esModule",ftTWX:function(o,a){return o===a},nlzcP:r(392),NkrGc:r(1714),feNhP:function(o,a){return o!=a},xzulu:r(1752)+"d"};Se.r=o=>{let a=r;e[a(709)](e.nlzcP,e[a(1578)])?(typeof _0x5bee73<"u"&&_0x374d67[a(553)+a(1265)]&&_0xd25791[a(1831)+"operty"](_0xd07adf,_0x17e611.toStringTag,{value:e[a(1835)]}),_0x3b65be[a(1831)+"operty"](_0x1bb555,e[a(548)],{value:!0})):(e[a(772)](e[a(1819)],typeof Symbol)&&Symbol[a(553)+a(1265)]&&Object.defineProperty(o,Symbol[a(553)+a(1265)],{value:e[a(1835)]}),Object[a(1831)+a(1111)](o,e.srgGZ,{value:!0}))}})();var V={};(()=>{let r=S,e={PSYfp:function(s,t){return s(t)},qcoRj:function(s,t){return s+t},Hsrxx:function(s,t){return s+t},jpmXm:function(s,t){return s*t},hmiTS:function(s,t){return s+t},jUiXq:function(s,t){return s(t)},AdgBY:function(s,t,n){return s(t,n)},hwZiQ:function(s,t){return s+t},piibR:function(s,t){return s!==t},zVMvv:r(1362),QPqiu:function(s,t){return s+t},DkUzV:"0000",xWlfo:r(403),KpZCR:function(s,t){return s(t)},FlEMw:r(800)+r(800)+r(800)+r(800),uwaHr:function(s,t){return s>t},UrWrE:function(s,t){return s<t},RSLvn:function(s,t){return s!==t},dvEav:function(s,t){return s-t},CrPWs:function(s,t){return s<t},EaYxZ:function(s,t){return s===t},WYROp:"Lpkbe",YUvsr:r(1560),UDHxV:function(s,t){return s!==t},PAYSs:function(s,t){return s!==t},DZEqI:function(s,t,n){return s(t,n)},vAEVK:"KiTPJ",UXtVP:function(s,t,n){return s(t,n)},eNGXA:function(s,t,n){return s(t,n)},UvMAV:function(s,t){return s(t)},SJESz:function(s,t){return s(t)},ZlZbr:function(s,t){return s(t)},uGwcf:function(s,t){return s&t},DjKem:r(843)+r(773)+r(1019)+r(1074),aEGfJ:"Missing "+r(773)+r(1019)+r(1047),AnrTn:function(s){return s()},MhpLL:function(s,t,n){return s(t,n)},bbRvL:function(s,t,n){return s(t,n)},YAeQt:"error",BstHy:function(s,t){return s!==t},UMbYl:function(s,t){return s!==t},asPPt:function(s,t){return s!==t},qWUoL:function(s,t,n){return s(t,n)},HLUms:function(s,t){return s!==t},XQCON:"FtQzD",uRwvP:function(s,t,n){return s(t,n)},SogNc:function(s,t,n){return s(t,n)},FjdIf:function(s,t){return s(t)},qupFq:function(s,t){return s!==t},mYCkr:function(s,t,n){return s(t,n)},eOofR:function(s,t,n){return s(t,n)},wRECU:function(s,t){return s!==t},fgYKT:function(s,t,n){return s(t,n)},KbwSW:function(s,t,n){return s(t,n)},ALlbH:function(s,t,n){return s(t,n)},NltYX:function(s,t){return s!==t},UcRrl:function(s,t,n){return s(t,n)},gChtm:function(s,t){return s(t)},UyABv:r(1135)+"1",QdOfU:function(s,t,n,i){return s(t,n,i)},uBwHW:function(s,t){return s+t},veWTg:function(s,t){return s===t},CCvnB:r(1380),InxOY:function(s,t){return s>>>t},CSLaa:function(s,t){return s(t)},WKWNq:function(s,t){return s===t},idUyL:r(253),etXci:function(s,t){return s(t)},Feffl:function(s,t){return s(t)},HJfYc:function(s,t,n){return s(t,n)},ccBpW:function(s,t){return s(t)},hfACA:function(s,t){return s(t)},mhvtR:function(s,t,n){return s(t,n)},AzbXj:function(s,t){return s(t)},jkqSy:function(s,t){return s(t)},Iprhg:function(s,t,n){return s(t,n)},mPaQS:function(s,t){return s&t},CoKNn:r(843)+r(773)+r(1019)+r(1623),HdwDM:r(843)+"required"+r(1019)+"LogID",PluqQ:"Missing "+r(773)+" field: service",zEqTo:function(s,t){return s===t},pmzqO:function(s,t){return s+t},bQVNH:function(s,t){return s&t},aHMzv:function(s,t){return s(t)},GIwlq:function(s,t,n){return s(t,n)},dmMwg:function(s,t,n){return s(t,n)},kZqdj:function(s,t){return s+t},Zukgl:r(786)+r(1762)+r(1773),jIIRG:function(s,t){return s>>t},tLGLc:function(s,t){return s>=t},eUOia:function(s,t){return s===t},ZjtHF:function(s,t){return s>t},dBVeR:function(s,t){return s+t},NDMMb:r(1396)+r(703),njhct:function(s,t){return s>=t},ZGqPf:function(s,t){return s>t},ePENo:r(1069)+r(703),MTxIU:function(s,t){return s+t},Fcefz:function(s,t){return s>t},XuRRt:function(s,t){return s<t},kPzYq:function(s,t){return s<t},yjBmC:function(s,t){return s===t},uZEZX:function(s,t){return s&t},tDsTk:function(s,t){return s+t},PKmhn:"WEWei",drNxn:function(s,t){return s&t},QFYbX:function(s,t){return s(t)},eqJLB:function(s,t){return s+t},IbZdE:function(s,t){return s!==t},XrrFN:function(s,t){return s|t},dyJBS:function(s,t){return s<<t},vDtOP:function(s,t){return s&t},hlcdT:function(s,t){return s&t},JhBfj:function(s,t){return s==t},SgYSW:function(s,t){return s&t},kFzGZ:function(s,t){return s>=t},hOGxS:function(s,t){return s+t},GJDKa:function(s,t){return s===t},arpIC:function(s,t){return s+t},bEZym:function(s,t){return s+t},JoaVj:function(s,t){return s|t},amWCa:function(s,t){return s|t},GRjxB:function(s,t){return s|t},abwRN:function(s,t){return s<<t},EXdew:function(s,t){return s&t},zkqNI:function(s,t){return s&t},UNzsq:function(s,t){return s<=t},XVynq:function(s,t){return s===t},pxipZ:"GeGZi",XecjM:function(s,t){return s(t)},CKRHA:function(s,t){return s&t},rBUhm:function(s,t){return s+t},xMtOm:function(s,t){return s+t},zFZeq:function(s,t){return s+t},RkQVp:function(s,t){return s+t},TZKdP:function(s,t){return s!==t},IavNS:function(s,t){return s|t},sPFAm:function(s,t){return s<<t},djVwE:function(s,t){return s<<t},wqzZd:function(s,t){return s|t},Uovan:function(s,t){return s<<t},kFdBd:function(s,t){return s&t},FBWlp:function(s,t){return s>t},afoSY:function(s,t){return s+t},mdLpB:function(s,t){return s&t},Fxlju:"0|4|9|6|"+r(1668)+r(1433)+"8",cEgLO:function(s,t){return s>>>t},TIbcT:function(s,t){return s<<t},jXWGc:function(s,t){return s&t},VXcmt:function(s,t){return s&t},WWzRZ:function(s,t){return s&t},dujFi:function(s,t){return s>t},njXdk:function(s,t){return s<t},ElWxx:function(s,t){return s<=t},MEUpZ:function(s,t){return s+t},merXc:function(s,t){return s+t},tDYcP:function(s,t){return s<t},uBmWT:function(s,t){return s<t},HgftX:function(s,t){return s<t},ISAxX:function(s,t,n){return s(t,n)},OWjrl:function(s,t){return s<t},eKRJb:function(s,t){return s<=t},MIiyT:function(s,t){return s<t},fyEBR:function(s,t){return s-t},RVOfp:function(s,t){return s<t},WKQKJ:function(s,t){return s>>t},rAdYg:function(s,t){return s&t},JUjWL:function(s,t){return s>>t},YMJHf:r(973),gPTBc:r(1432),InKnV:function(s,t){return s|t},PjuqK:function(s,t){return s>>t},HRFbr:function(s,t){return s&t},MqSnR:function(s,t){return s&t},bKAkl:function(s,t){return s<<t},jdXNv:function(s,t){return s!==t},kFfLi:function(s,t,n){return s(t,n)},dMPGN:function(s,t){return s|t},RftlU:function(s,t,n){return s(t,n)},xFlzM:function(s,t){return s(t)},xXDYX:function(s,t){return s&t},aiSwG:function(s,t){return s&t},IbqeV:function(s,t){return s!==t},orjbZ:r(660),poNwy:function(s,t){return s(t)},HXWkb:function(s,t){return s(t)},UnCqe:function(s,t){return s&t},twZOt:function(s,t){return s(t)},kwJRY:function(s,t){return s(t)},oGcMG:function(s,t){return s<<t},iCZvY:function(s,t){return s(t)},IRnjo:function(s,t){return s&t},PAbnV:function(s,t){return s(t)},kCcRA:function(s,t){return s<<t},mmixC:function(s,t){return s&t},toIJo:function(s,t){return s|t},lUlQL:function(s,t){return s<<t},qbzYn:function(s,t){return s===t},CKAAU:function(s,t){return s===t},LTdZs:function(s,t){return s<t},zWBYd:function(s,t){return s<t},UGanu:function(s,t,n){return s(t,n)},feGsI:function(s,t){return s>>>t},wRcZF:function(s,t){return s!==t},gTzBk:function(s,t){return s&t},zvDyK:function(s,t){return s+t},qIauQ:function(s,t){return s|t},LupBU:function(s,t){return s+t},XzLuv:function(s,t){return s!==t},nGeDH:function(s,t){return s>>>t},MkXrr:function(s,t){return s>>>t},MHKtN:function(s,t){return s+t},qnCtd:function(s,t){return s|t},XmFsL:function(s,t){return s>>>t},vDpBA:function(s,t){return s+t},WORvm:function(s,t){return s&t},lLJHt:function(s,t){return s(t)},pqmmU:r(763),iYBAH:function(s,t){return s===t},OSOEW:function(s,t){return s|t},oFsSn:function(s,t){return s|t},SLYKZ:function(s,t){return s<<t},raouM:function(s,t){return s<<t},OnuNb:function(s,t){return s<<t},eiNpr:function(s,t){return s<<t},mKdAI:function(s,t){return s|t},BfWCj:function(s,t){return s<<t},abTbo:function(s,t){return s<<t},MtOux:function(s,t){return s===t},eybaG:function(s,t){return s|t},rKzeE:function(s,t){return s<<t},RQWWq:function(s,t){return s&t},LfcMb:function(s,t){return s>>>t},zqhcx:function(s,t){return s&t},FAqZR:function(s,t){return s&t},bXNCh:function(s,t){return s>>>t},liOfF:function(s,t){return s>>>t},iHlvu:function(s,t){return s>>>t},KJWPx:function(s,t){return s>=t},wiWZZ:function(s,t){return s+t},hYdCD:function(s,t){return s|t},Fxwav:function(s,t){return s%t},NSPXh:function(s,t){return s|t},NlYvS:function(s,t){return s/t},dFiZU:function(s,t){return s>>>t},MxWks:r(1331),eemEI:function(s,t){return s===t},cmrjK:function(s,t){return s&t},PIkOt:function(s,t){return s>>>t},lXsHL:function(s,t){return s>>>t},wxHyC:function(s,t){return s+t},UHQmj:function(s,t){return s+t},RaASa:function(s,t){return s<<t},VNIsB:function(s,t){return s|t},mxWcl:function(s,t){return s<<t},sgoed:function(s,t){return s>>>t},Puxfi:function(s,t){return s>>>t},iULAy:function(s,t){return s===t},qXmPY:function(s,t){return s+t},twgYS:function(s,t){return s&t},SgWhF:function(s,t){return s>>>t},FpwoK:function(s,t){return s&t},yqLlZ:function(s,t){return s>>>t},gJxHp:function(s,t,n){return s(t,n)},SZEfQ:r(1039),XtkDd:function(s,t){return s>>>t},OLPOX:function(s,t){return s&t},cZNXR:function(s,t){return s>>>t},ipSRL:function(s,t){return s>>>t},eJKHl:function(s,t){return s>>>t},TnGUC:function(s,t){return s&t},mVQqY:function(s,t){return s>>>t},GIcpu:r(1473)+r(225),iriJW:r(1450)+r(563)+"R",TbWTX:r(1105)+r(1072),ywfYa:r(1126)+"OR",eKgcZ:function(s,t){return s!==t},zbUGX:r(308),QGtDt:r(335),UMrWU:function(s,t){return s instanceof t},SYSes:r(582)+r(1836)+r(663),sXDGN:r(616)+r(935),gvsJp:r(1611),nWGFk:"binary",DwYMe:"gcfgW",jEagr:r(1313)+r(720),lQUsk:r(655)+"3",SeReo:function(s,t){return s!==t},FTEKr:"fMCyg",HynmV:function(s,t){return s<<t},aYFzi:function(s,t){return s<<t},beDmV:function(s,t){return s&t},GXpPM:function(s,t){return s|t},wEcNA:function(s,t){return s+t},iEVTJ:function(s,t){return s<<t},Gzegb:function(s,t){return s|t},hqAcT:function(s,t){return s&t},yCTjM:function(s,t){return s!==t},eKgxC:function(s,t){return s===t},EadrW:function(s,t){return s===t},fdyDH:function(s,t){return s>t},PQYSK:r(1243),fxZIV:function(s,t){return s===t},JClFZ:r(1046),xtFlC:r(641),mYvMC:r(1169),HUAJM:r(784),vWkKC:"LtnKD",mFfzd:function(s,t){return s+t},ejkri:r(779)+"d error.",pBOaW:function(s,t){return s<t},lJdux:function(s,t){return s===t},aXrad:function(s,t){return s<t},nbgLX:function(s,t){return s===t},akyLX:function(s,t){return s&t},rSegC:function(s,t){return s!==t},vwPFc:r(1704),GyOFq:r(1447),QKhlP:r(1635),GtZsA:r(507),JYTOH:r(463),uXYtv:r(816),ZFIsU:function(s,t,n){return s(t,n)},UYmpV:function(s,t){return s!==t},eRyhl:r(1732),GEhHr:function(s,t){return s(t)},wasfg:function(s,t){return s===t},wOBeQ:"DlMfs",YbAjZ:function(s,t,n){return s(t,n)},NFpPq:function(s,t){return s instanceof t},xJHNR:r(1222),AheMW:r(1081),AAagX:function(s){return s()},GVmBT:"AbortError",jZxde:function(s,t){return s===t},TPhdP:"FFcAV",dmnHO:r(564),YSnZG:function(s,t,n){return s(t,n)},VHDdz:r(687),CqFql:function(s,t){return s||t},apTco:function(s,t){return s<t},DYkel:function(s,t){return s-t},ImuMN:r(1475),eOlfZ:function(s,t){return s!=t},haHnZ:function(s,t){return s<=t},TDcdc:r(464)+"alled multiple times in "+r(1024),OghTP:function(s,t){return s+t},mObwX:function(s,t){return s(t)},aMouC:function(s,t){return s>>>t},nFcXF:r(1206),JuggC:r(1529),UHJqv:function(s,t){return s!==t},KOEKa:r(1630),GbMBj:function(s,t){return s-t},rGrYm:function(s,t){return s|t},HhpUd:function(s,t){return s<<t},qbkxy:function(s,t){return s&t},cuCrX:function(s,t){return s|t},oTrgi:function(s,t){return s<<t},nIcEJ:function(s,t){return s&t},gkoHZ:function(s,t){return s!==t},YVJAu:r(1161),XdDVS:function(s,t){return s|t},ILRQm:function(s,t){return s|t},vVjri:function(s,t){return s<<t},ViudO:function(s,t){return s&t},uvZLH:function(s,t){return s<<t},YkoaW:function(s,t){return s&t},lfTbU:function(s,t){return s>>t},ePvUx:function(s,t){return s<t},pLFaO:function(s,t){return s===t},DGXlT:function(s,t){return s===t},sRVRI:function(s,t){return s+t},laaqP:r(881),AaLDf:function(s,t){return s+t},hnWDS:function(s,t){return s&t},vaSXv:function(s,t){return s|t},IIIub:function(s,t){return s&t},svWzV:function(s,t){return s>>t},jXjIB:function(s,t){return s|t},uULTF:function(s,t){return s>>t},BTjdI:function(s,t){return s|t},AfmMm:r(1665),tJNtf:function(s,t){return s|t},osEDd:function(s,t){return s-t},Mvrss:function(s,t,n,i){return s(t,n,i)},VkGFN:function(s,t){return s instanceof t},daclM:function(s,t){return s!=t},qNeie:function(s,t){return s instanceof t},NeLlp:function(s,t){return s==t},rBozC:function(s,t){return s&t},wWClf:function(s,t){return s>=t},xRbld:function(s,t){return s|t},cIuUM:function(s,t){return s<<t},fAsdz:function(s,t){return s&t},kEYAQ:function(s,t){return s-t},DFcLm:function(s,t){return s<<t},DHsqd:function(s,t){return s+t},zgtlN:function(s,t){return s===t},nimaj:r(1076),UHgaS:r(1395),rxffp:function(s,t,n){return s(t,n)},vIYXP:r(316),serKw:r(950),KLzYa:r(412),TvUAn:r(1174),iJoNN:function(s,t){return s(t)},bHXqZ:function(s,t){return s===t},qKPSg:r(478),LcpQH:r(1769)+r(498)+"tierJSONP",PSiPE:r(856),pXaWt:r(324),qETXF:r(377),DXtwE:r(598),nfzFx:r(1679),bmmQl:function(s,t,n,i){return s(t,n,i)},qRWNY:function(s,t){return s!==t},kJgIB:"PRECi",beOjr:r(1780),Lrmxv:r(1202),EGsJY:function(s,t){return s(t)},gDvqE:function(s,t){return s||t},hIHVr:r(1752)+"d",YkIhS:function(s){return s()},RYWhr:r(849),GUbUe:r(1016),yIyqH:function(s,t){return s!==t},GLeiX:r(1329),WvBUv:function(s,t){return s===t},oxVZh:r(714),BJaOw:r(638),kMpEG:function(s,t){return s(t)},BOKgN:r(1398)+r(1467)+"s",erHfQ:r(1398)+"e_timeout",lXzfA:function(s,t){return s===t},EWOFn:"grpog",iZCim:function(s,t){return s===t},TKTYm:function(s,t){return s>>>t},igMsa:function(s,t){return s|t},FhNuv:function(s,t){return s<<t},SZnjd:function(s,t){return s|t},rGBfN:function(s,t){return s|t},HlNPH:function(s,t){return s<<t},RlFJL:function(s,t){return s<<t},Jxmcj:function(s,t){return s!==t},azqTd:"xRQUG",kHyyT:r(438),KnSRy:r(1827),IoEDW:function(s,t){return s|t},kZXsB:function(s,t){return s<<t},qVfqp:function(s,t){return s&t},VEuMY:function(s,t){return s>>t},wipMs:"HSHTr",gZUtX:"xbsFX",DAoXL:function(s,t){return s===t},FUOnd:r(1753),NRaqF:function(s,t){return s<t},KeTvI:function(s,t){return s>>t},abXhb:function(s,t){return s===t},lJdZa:function(s,t){return s&t},gSPfN:"2|3|0|5|"+r(1725),YoYpB:function(s,t){return s>>t},ZehyV:function(s,t){return s|t},DoGwB:function(s,t){return s&t},oZmSe:function(s,t){return s+t},iwmIM:function(s,t){return s>>t},BRkEN:function(s,t){return s>>t},Ljcjg:function(s,t){return s|t},ZMTIo:function(s,t){return s|t},UBawY:r(1833),GMyFu:function(s,t){return s||t},VBQUJ:function(s,t){return s||t},VBktn:function(s,t,n){return s(t,n)},YNnfL:r(530),ncXYz:function(s,t){return s||t},xTSgp:function(s,t){return s||t},wAhBi:function(s,t){return s||t},ryzrl:function(s,t){return s||t},IUxId:function(s,t){return s||t},RuWZR:r(561),DwZRm:r(1055)+"4",BMNhk:"RLGla",SwsHz:function(s,t){return s||t},rKEkS:function(s,t,n){return s(t,n)},hrsbx:r(371),CpsIR:r(1628)+"id",bexvW:function(s,t){return s+t},rfbFB:r(1147),ElaxF:function(s,t){return s&t},FqVxS:function(s,t){return s>>>t},IpgPD:function(s,t){return s===t},fLFZF:"YshTx",WcwYz:function(s,t){return s===t},avwnh:r(872),qbxgY:"oKACW",iHDHI:function(s,t){return s!==t},KNYmK:r(292),GTWCw:r(810),iLgku:r(1682),TPfFm:r(1334)+r(1696)+"ck",MwjWB:function(s,t,n,i){return s(t,n,i)},qHUVZ:"x_fronti"+r(882)+"k",Utrgw:function(s,t,n){return s(t,n)},VcYNN:r(1334)+"er_ack_m"+r(1028),iKiyr:r(930),scYTu:r(1758),RqAXm:r(1636),UDnEr:function(s,t){return s||t},MckUH:function(s,t){return s(t)},eDvdW:function(s,t){return s(t)},JGqlj:r(946),oARPM:"CJcwe",UdnUH:function(s,t){return s instanceof t},UGYDG:function(s,t){return s instanceof t},UvJMT:r(616)+"ion/json"+r(547)+r(625),vQKvL:r(873)+"e",tcpba:function(s){return s()},NvGyV:function(s,t){return s<t},JLlny:function(s,t){return s>t},tCNeH:function(s,t){return s+t},JyHgg:function(s,t){return s||t},SpKHf:function(s,t){return s(t)},xZLYu:function(s,t){return s+t},veJOP:function(s,t){return s+t},LUnyN:function(s,t){return s+t},FnrIE:function(s,t){return s+t},OosgT:function(s,t){return s+t},mjsJg:r(788)+r(1468)+r(1295),HILLQ:r(854),BNOOU:function(s,t){return s||t},ITdCZ:r(407),abnTQ:r(1457)+r(1579)+"e",xixWi:r(426),FTHkD:"bHzpn",iAkiZ:function(s,t,n,i){return s(t,n,i)},NefMf:function(s,t){return s+t},tftCB:function(s,t){return s<t},XaiEx:function(s,t,n){return s(t,n)},iOUQL:function(s,t){return s>>>t},sCwAN:function(s,t){return s<<t},pHDLz:"4|2|1|3|0",EMLii:function(s,t){return s+t},dpBjU:function(s,t){return s+t},GhRSd:function(s,t){return s|t},CAzgr:function(s,t){return s|t},YFkqT:function(s,t){return s<<t},unVDe:function(s,t){return s+t},mPjIE:function(s,t){return s+t},BfYHm:function(s,t){return s<<t},kLgOt:function(s,t){return s+t},jlWWd:function(s,t){return s+t},WGmrV:function(s,t){return s<<t},fZOxo:function(s,t){return s+t},ETMdT:function(s,t){return s<<t},PEtpZ:function(s,t){return s<t},FTIzV:function(s,t){return s>>>t},wtyzQ:function(s,t){return s+t},VHvaZ:function(s,t){return s&t},MirCA:function(s,t){return s&t},vjDFF:function(s,t){return s&t},ORind:function(s,t){return s+t},NZgTP:function(s,t){return s+t},zUfHp:function(s,t){return s&t},sJtvP:function(s,t){return s+t},iixBQ:r(636),XFvZx:r(995),nZzgA:function(s,t){return s===t},LpiFw:r(1778),sMTfM:r(1591)+r(1346)+r(1104)+"3",PatVh:function(s,t){return s|t},tbiwz:function(s,t){return s<t},YXhQh:function(s,t){return s|t},PVLcF:function(s,t){return s<t},vCUOi:function(s,t){return s|t},ESPXM:function(s,t){return s|t},flyGH:function(s,t){return s<<t},zvngk:function(s,t){return s|t},edekh:function(s,t){return s(t)},MRHlT:function(s,t){return s+t},xMHLI:r(1520),hBitJ:function(s,t,n,i){return s(t,n,i)},onhEZ:function(s,t){return s instanceof t},ekYmu:function(s,t){return s instanceof t},zlnRU:r(895),XFwXx:function(s,t){return s(t)},Cbkfw:function(s,t){return s(t)},zRXCX:r(399)+"ile_name",MUrsB:r(706)+r(567)+r(1438)+"g",GHoIE:"DlcWP",boSeO:function(s,t){return s<t},VRuVB:function(s,t,n){return s(t,n)},TMwHd:function(s,t,n){return s(t,n)},AfKhU:function(s,t,n){return s(t,n)},FeXYm:r(1377),fblxR:r(1694),jwiom:r(1538)+r(332),MXtRV:function(s,t){return s<<t},XHOVy:function(s,t){return s&t},vDqzC:function(s,t){return s(t)},duFbe:function(s,t){return s&t},edYNq:r(1557),HAscy:r(1043)+"ame",oYjYo:r(1829)+"rValues",aRMXr:r(520),YnLWH:r(868),LPegj:function(s,t,n,i){return s(t,n,i)},HIUqu:function(s){return s()},gPbWx:r(506),JyFFQ:r(1193)+"r",RAXJA:r(1521),XwNmY:function(s,t,n,i){return s(t,n,i)},aYpDw:r(387),mSuyS:function(s,t,n){return s(t,n)},CSeqF:r(1334)+r(1553),BrdKy:"x_frontier_ttl",TeRyz:function(s,t,n,i){return s(t,n,i)},wdbqA:r(1248)+"s",RfvJJ:r(402)+r(753)+"ue",wgzdi:function(s,t){return s+t},pcayq:function(s){return s()},dHdoq:function(s){return s()},eVsCO:function(s){return s()},FxFQb:function(s,t){return s===t},GKbTH:function(s){return s()},oVbau:function(s,t){return s(t)},jzJNJ:function(s){return s()},MoQjb:function(s,t){return s<t},RrvZl:function(s,t){return s===t},ebJJJ:function(s,t){return s!==t},lsSZe:function(s,t,n){return s(t,n)},sGUag:function(s,t){return s===t},TkTNG:function(s,t,n){return s(t,n)},NIqrp:r(278),ioNOP:function(s,t){return s===t},IbZtg:function(s,t,n,i){return s(t,n,i)},eArec:function(s,t,n){return s(t,n)},nYuDJ:function(s,t,n){return s(t,n)},jnqUB:function(s,t,n){return s(t,n)},RmdJW:function(s,t){return s(t)},Iwqdr:r(240)+r(353),UCWuG:"CONTINUE",SyMzP:function(s,t){return s(t)},EGqDL:r(337)+"rovide w"+r(972)+r(1495)+r(791)+r(1272)+r(1403)+r(232),vAawf:"rTEFs",MuXqU:r(780),TaRTE:function(s,t,n){return s(t,n)},gaTVI:"online",RYoIM:r(997),PFHxG:function(s,t){return s!==t},utSda:"rtkYZ",BMKwF:r(1283),fVnvE:r(1721),WLgfx:r(627),VzcAW:function(s,t){return s||t},TFMXm:function(s,t){return s||t},CWUjO:function(s,t){return s!=t},JSpjv:function(s,t){return s||t},lHRuD:function(s,t){return s!=t},LFMQB:r(645)+r(297)+"d",BAcpd:function(s,t){return s!==t},AbVhL:r(817),wHhjn:r(1097),CsMbP:function(s,t){return s!==t},PZMAz:function(s,t){return s!==t},YdImV:"https:",weWxK:"ws://",DMohv:function(s,t){return s!==t},ZWphh:r(566),Ajart:r(1584),FtmPf:r(1256),kWWKl:"device_id",VRYlx:function(s,t){return s||t},cRcpS:r(337)+r(422)+r(1073)+r(1211)+r(861),TKuds:r(390),fAnEJ:"web",EVKfW:function(s){return s()},iLeRH:function(s,t,n){return s(t,n)},lEetv:function(s,t){return s(t)},TNLVn:function(s,t){return s(t)},EZVmI:function(s,t){return s>=t},HKmug:function(s,t){return s+t},aWMVX:function(s,t){return s|t},qkUVV:function(s,t){return s|t},TKNhW:r(456),UnteS:r(1052),hCZyA:function(s,t,n){return s(t,n)},KYaQM:r(1212),gJwdZ:r(1568),EUcjZ:function(s,t,n){return s(t,n)},cVaGh:function(s,t,n){return s(t,n)},fgPpB:r(1328)+"t",emmFf:function(s,t){return s>t},QAlHi:function(s,t,n){return s(t,n)},hpgmo:r(962),pMYKk:r(1684),rVXPd:function(s,t){return s|t},WPYyo:function(s,t){return s>>>t},mbAFe:function(s,t){return s<t},GuYrR:function(s,t){return s+t},kcaPL:function(s,t){return s>>>t},gPxKg:function(s,t){return s&t},cctLv:function(s,t){return s!==t},ljMyt:function(s,t){return s>>>t},yKxrK:function(s,t){return s>>>t},NxXfU:function(s,t){return s+t},jiXlh:function(s,t){return s!==t},VFsyf:function(s,t){return s|t},cLVxK:function(s,t){return s&t},adoTy:function(s,t){return s>>>t},nPMGH:function(s,t){return s!==t},QcTde:function(s,t){return s+t},lSaLu:function(s,t){return s&t},yfRcr:function(s,t){return s!==t},LbjdG:function(s,t){return s|t},zRjQt:function(s,t){return s&t},xukVS:r(751),VfTCZ:r(1596),lkIKV:r(1428)+">",gQkYN:function(s,t){return s*t},FPnWJ:r(1132),TNksf:r(1505)+"ay, try reconnec"+r(1698)+r(552),pImsJ:function(s,t,n){return s(t,n)},GbXtx:function(s,t,n,i,x){return s(t,n,i,x)},kTGsS:r(1706),iKQBx:r(1215),XwOAd:r(1058)+"0",WTsCb:"hxsKO",IzjpS:r(1004),YLfCX:r(960),wSGlI:r(406),mCIbd:function(s,t,n){return s(t,n)},LKjEu:r(692),LIeKL:function(s,t,n){return s(t,n)},YAvYf:r(1505)+"ay, netw"+r(250)+r(1109),FWGWT:r(1383),FPrqC:r(1735),PBKYW:r(978)+r(1459),SnLlz:"close, w"+r(608)+r(549)+r(874)+"ed",vCojJ:r(1559)+"s alread"+r(287),GRvBc:function(s,t){return s&t},PdrWO:function(s,t){return s>>>t},BpZxq:function(s,t){return s<t},LMuiT:function(s,t){return s<t},FhAJy:function(s,t){return s|t},JAhFz:function(s,t){return s<t},nrIwW:function(s,t){return s==t},GvPLj:r(337)+"rovide a"+r(795)+r(483)+r(557)+r(1279)+r(401)+r(536)+"ffer",xGGtl:r(532),zztVI:function(s,t){return s instanceof t},dHwlN:function(s,t){return s instanceof t},UHuXG:function(s,t){return s(t)},ahsJZ:function(s,t){return s(t)},MPqrN:function(s,t){return s(t)},LOVKH:function(s,t){return s||t},eSMUu:r(337)+r(497)+r(1297)+r(492),FXRrK:function(s,t){return s instanceof t},mUSyM:r(1651),aKqDB:r(1059),EaMVt:r(468)+"econnecting",oXQHP:function(s,t){return s(t)},dZnuT:function(s,t){return s(t)},SfEJS:function(s,t,n){return s(t,n)},dLgbQ:"\0\0\0\0\0\0\0\0",qxZPj:function(s,t){return s===t},fgZhi:function(s,t){return s!=t},IKNhL:r(915),DCZKx:function(s,t){return s===t},AGgMk:r(933),zvNKz:function(s,t){return s===t},uknQZ:r(762)+r(374)+r(1252)+"pe",bzsio:function(s,t){return s!=t},hgpIZ:function(s,t){return s===t},KPPeI:function(s,t){return s!=t},EAoUh:function(s,t){return s===t},YRwat:r(1357)+r(903)+"alScope",tDUQm:r(1481)+r(580)+r(942),xJvAj:function(s,t){return s===t},QSnrg:"__x_msg_"+r(768)};Se.r(V),Se.d(V,{FWS:()=>k0,CustomErrorEvent:()=>es,createCloseEvent:()=>_e,ReconnectEvent:()=>Qr,createErrorEvent:()=>le,decodedFrame:()=>Xr,createOpenEvent:()=>os,CustomCloseEvent:()=>ts,createReconnectEvent:()=>Xn,FrontierMessageEvent:()=>rs,encodeFrame:()=>Jn,createMessageEvent:()=>is,OpenEvent:()=>ss,ErrorCode:()=>Ue,Event:()=>st,MessageEvent:()=>ns});let o="";function a(s=""){let t=r,n="02",i=""+Date.now(),x=o||(o=e.PSYfp(m,s)),d=Math[t(558)]()[t(553)](16)[t(1749)](-6);return e.qcoRj(e[t(1802)](e[t(1802)](n,i),x),d)}function c(){let s=r;return e[s(1223)](e[s(1129)](1e4,Date.now()),Math[s(333)](e[s(1129)](1e4,Math[s(558)]())))}function u(s){let t=r;return e[t(1471)](e[t(327)](Array,8)[t(1247)]("0"),e.AdgBY(parseInt,s,10)[t(553)](2))[t(1749)](-8)}function l(s){let t=r;return e[t(1775)](Array(4).join("0"),parseInt(s,2).toString(16))[t(1749)](-4)}function p(s){let t=r,n={IgqqJ:function(i,x){return i(x)}};if(e.piibR(e[t(1225)],e.zVMvv))_0x13cc53=MrNZzZ[t(1653)](_0x364356,_0x414c22);else{let i=s[t(1120)](/\./)[t(1040)](h=>u(h)),x=[];return x[0]=e[t(327)](l,e.QPqiu(i[0],i[1])),x[1]=e[t(327)](l,i[2]+i[3]),[e[t(934)],e.DkUzV,"0000",t(1595),e[t(934)],e[t(719)],x[0],x[1]][t(1247)]("")}}function m(s){let t=r,n=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/.test(s),i=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/[t(1361)](s);return n?e[t(647)](p,s):i?e[t(691)](b,s):e[t(823)]}function b(s){let t=r,n="",i=[],x=0,d=0,h=!0,g=e[t(934)];if(e[t(777)](s[t(322)]("::"),-1)){let f=s[t(1120)]("::");for(let v=0;e[t(708)](v,f.length);v++){let C=f[v];if(e[t(777)](C.indexOf(":"),0)){let L=C[t(1120)](":");h&&(x=L[t(1239)]),d+=L.length;for(let B=0;B<L[t(1239)];B++)if(e[t(727)](4,L[B][t(1239)])){let P=g[t(579)+"g"](0,4-L[B][t(1239)]),U=P[t(1664)](L[B]);i.push(U)}else i[t(560)](L[B]);h=!1}else{if(e.RSLvn(4,C[t(1239)])){let L=g[t(579)+"g"](0,e[t(805)](4,C.length)),B=L.concat(C);i[t(560)](B)}else i[t(560)](C);h&&(x+=1),d+=1,h=!1}}let _="";for(let v=0;e[t(1846)](v,e[t(805)](8,d));v++)_=_[t(1664)](g);for(let v=0;e[t(1846)](v,i[t(1239)]);v++)if(e[t(1640)](v,x))if(e[t(237)](e.WYROp,e.YUvsr))n=n[t(1664)](_),n=n.concat(i[v]);else return _0x59d909[t(534)+t(1609)][1]?void 0:_0x21ee72[t(534)+"ore"](_0x175b58["objectSt"+t(1609)][0]);else n=n[t(1664)](i[v]);return n}{let f=s[t(1120)](":");for(let _=0;_<f[t(1239)];_++){let v=f[_];if(e.UDHxV(4,f[_].length)){let C=g[t(579)+"g"](0,4-f[_][t(1239)]),L=C[t(1664)](v);n=n.concat(L)}else n=n[t(1664)](v)}return n}}function w(s,t){let n=r,i=s.key;e.PAYSs(void 0,i)&&(ee(t,10),e[n(976)](Le,t,i));let x=s.value;if(e[n(1422)](void 0,x))if(n(650)===e[n(1516)])e[n(256)](ee,t,18),e[n(1667)](Le,t,x);else{let d=new _0x457883(e.jpmXm(2,_0x460f37));d[n(1739)](_0x4e0c1a),_0x59d019.bytes=d}}function y(s){let t=r,n={};e:for(;!e[t(1200)](ye,s);){let i=e.PSYfp(re,s);switch(i>>>3){case 0:break e;case 1:n[t(1074)]=e.AdgBY(De,s,e[t(1400)](re,s));break;case 2:n[t(1047)]=e[t(1750)](De,s,e.ZlZbr(re,s));break;default:e[t(256)](oe,s,e[t(1205)](7,i))}}if(e.EaYxZ(void 0,n[t(1074)]))throw new Error(e.DjKem);if(n[t(1047)]===void 0)throw new Error(e[t(1771)]);return n}function E(s){let t=r,n=e[t(551)](H);return e[t(339)](T,s,n),e[t(1400)](ze,n)}function T(s,t){let n=r,i={LFXAe:function(O,R,Z){return e[D(1414)](O,R,Z)},VNkpJ:e[n(836)]},x=s.SeqID;e[n(1743)](void 0,x)&&(ee(t,8),e[n(976)](bt,t,x));let d=s[n(1118)];e[n(1269)](void 0,d)&&(e[n(256)](ee,t,16),bt(t,d));let h=s[n(1589)];e[n(1848)](void 0,h)&&(ee(t,24),e[n(502)](bt,t,e[n(1637)](ce,h)));let g=s.method;if(e[n(1241)](void 0,g))if(e[n(1743)]("FtQzD",e[n(1165)])){let O=this["_endpoin"+n(590)]?.[n(496)+n(1551)+"es"](),R=this[n(270)+n(590)]?.[n(1274)+n(722)+"nt"]();if(O&&!_0x30dcf5[n(816)]){let Z=n(1483)+R+(" fail, m"+n(1270)+n(1287)+"ed");this[n(730)+n(1425)+"ent"](i[n(469)](_0x2e8aa1,i[n(1096)],{message:Z,code:_0xb27a31[n(1450)+n(563)+"R"],error:_0x2fc51e}));return}this[n(1152)]&&this[n(1152)].readyState===this[n(1103)]&&this._disconnect(),this["_dispatc"+n(1425)+n(921)](i[n(469)](_0x512c47,"error",{message:_0x3fa3d4.message,code:_0x4ddc85[n(1473)+n(225)],error:_0x1b7fca}))}else ee(t,32),e[n(256)](bt,t,e[n(691)](ce,g));let f=s[n(1139)];if(e[n(1269)](void 0,f))for(let O of f){e.uRwvP(ee,t,42);let R=e[n(551)](H);e.UXtVP(w,O,R),e.SogNc(ee,t,R.limit),Pe(t,R),e[n(1479)](J,R)}let _=s[n(1302)+n(700)];e[n(910)](void 0,_)&&(e.mYCkr(ee,t,50),e[n(462)](Le,t,_));let v=s[n(651)+n(671)];e[n(727)](void 0,v)&&(ee(t,58),e[n(1414)](Le,t,v));let C=s[n(686)];e[n(1556)](void 0,C)&&(e[n(1180)](ee,t,66),e[n(502)](ee,t,C[n(1239)]),e[n(994)](Ut,t,C));let L=s.LogIDNew;L!==void 0&&(e[n(994)](ee,t,74),Le(t,L));let B=s["serverTi"+n(1070)];B!==void 0&&(e[n(479)](ee,t,82),e.KbwSW(Le,t,B));let P=s.msgID;e[n(864)](void 0,P)&&(e[n(286)](ee,t,90),e.bbRvL(Le,t,P));let U=s[n(1244)+"e"];e[n(1031)](void 0,U)&&(ee(t,96),e[n(1351)](bt,t,e[n(355)](ce,U)))}function k(s){let t=r;return e[t(1479)](N,e[t(1200)](Ae,s))}function N(s){let t=r,n={};e:for(;!e[t(1400)](ye,s);)if(e.veWTg(e[t(1626)],e[t(1626)])){let i=e[t(355)](re,s);switch(e[t(936)](i,3)){case 0:break e;case 1:n[t(1623)]=Jr(s,!0);break;case 2:n[t(1118)]=e[t(1750)](Jr,s,!0);break;case 3:n[t(1589)]=e[t(867)](re,s);break;case 4:n[t(634)]=re(s);break;case 5:if(e.WKWNq(e[t(832)],e[t(832)])){let x=e.CSLaa(G,s);(n.headers||(n[t(1139)]=[])).push(e[t(1448)](y,s)),s[t(1575)]=x;break}else _0x5ec31f[t(1838)+"entListener"](t(1202),_0x35353f),_0x1459d6[t(1838)+"entListener"](fIcaXf[t(836)],_0x38d769);case 6:n[t(1302)+t(700)]=De(s,e[t(1299)](re,s));break;case 7:n[t(651)+t(671)]=e[t(643)](De,s,e[t(396)](re,s));break;case 8:n[t(686)]=qt(s,e[t(1542)](re,s));break;case 9:n[t(1677)]=e[t(1673)](De,s,e[t(367)](re,s));break;case 10:n.serverTiming=e[t(1503)](De,s,e[t(1528)](re,s));break;case 11:n[t(1616)]=e[t(381)](De,s,e[t(1400)](re,s));break;case 12:n[t(1244)+"e"]=re(s);break;default:oe(s,e[t(338)](7,i))}}else{let i=e[t(890)][t(1120)]("|"),x=0;for(;;){switch(i[x++]){case"0":if(_0xf8f08[t(982)+"e"])return e[t(1775)](_0xaee7b8[t(982)+"e"](_0x377042,_0x2b352b),_0x44e694);continue;case"1":return _0x3c3e8e(_0x3c6186,_0x328454,_0x3ba10f)+_0x1e6989;case"2":if(!_0xe98352)return _0x323fa4;continue;case"3":if(_0x25bdd3[t(1239)]<40)return e[t(543)](_0x586a07,_0x34cafd,_0x56f8aa,_0x1ff4c2)+_0x4a5209;continue;case"4":if(_0x44ed25.write)return e.uBwHW(_0x562980[t(1746)](_0x40ec2f,_0x29b63f),_0x4fcb85);continue}break}}if(n.SeqID===void 0)throw new Error(e[t(1453)]);if(n.LogID===void 0)throw new Error(e[t(1188)]);if(n.service===void 0)throw new Error(e.PluqQ);if(e[t(1547)](void 0,n[t(634)]))throw new Error(t(843)+t(773)+t(1019)+t(634));return n}function G(s){let t=r,n=e[t(647)](re,s),i=s[t(1575)];return s[t(1575)]=e[t(860)](s[t(1195)],n),i}function oe(s,t){let n=r;switch(t){case 0:for(;e[n(300)](128,e[n(1781)](de,s)););break;case 2:e[n(905)](be,s,e[n(1781)](re,s));break;case 5:e[n(234)](be,s,4);break;case 1:e[n(1667)](be,s,8);break;default:throw new Error(e[n(724)](e[n(640)],t))}}function ce(s){let t=r;return s|=0,{low:s,high:e.jIIRG(s,31),unsigned:e[t(311)](s,0)}}let I=[];function H(){let s=r,t=I[s(1355)]();return t?(t[s(1195)]=t[s(1575)]=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function J(s){I[r(560)](s)}function Ae(s){return{bytes:s,offset:0,limit:s[r(1239)]}}function ze(s){let t=r,n=s[t(1268)],i=s[t(1575)];return e[t(1130)](n.length,i)?n:n[t(1115)](0,i)}function be(s,t){let n=r;if(e.ZjtHF(e.dBVeR(s[n(1195)],t),s[n(1575)]))throw new Error(e[n(1693)]);s[n(1195)]+=t}function ye(s){let t=r;return e[t(1146)](s[t(1195)],s[t(1575)])}function me(s,t){let n=r,i=s[n(1268)],x=s[n(1195)],d=s[n(1575)],h=e[n(999)](x,t);if(e[n(777)](h,i.length)){let g=new Uint8Array(e[n(1129)](2,h));g[n(1739)](i),s[n(1268)]=g}return s[n(1195)]=h,e[n(508)](h,d)&&(s[n(1575)]=h),x}function nt(s,t){let n=r,i=s[n(1195)];if(e[n(1354)](e[n(724)](i,t),s[n(1575)]))throw new Error(e.ePENo);return s.offset+=t,i}function qt(s,t){let n=r,i=e[n(502)](nt,s,t);return s.bytes[n(1115)](i,e[n(366)](i,t))}function Ut(s,t){let n=r,i=me(s,t[n(1239)]);s[n(1268)].set(t,i)}function De(s,t){let n=r,i={cdMwn:function(x,d){return e.Fcefz(x,d)},VqBbA:function(x,d){return e[D(996)](x,d)},hPxvn:function(x,d){return e[D(1112)](x,d)},YgBqN:function(x,d){return e[D(1130)](x,d)},rEyIT:function(x,d){return e[D(649)](x,d)},dGjuc:function(x,d){return e[D(1082)](x,d)},JOZPA:function(x,d){return e[D(1602)](x,d)}};if(e[n(910)](e.PKmhn,e[n(799)]))return this[n(866)+n(707)]==this[n(1662)+"s"][n(1239)]?!0:i[n(988)](this[n(759)+n(1843)+n(1607)+"t"],this[n(1783)+"es"]);{let x=e[n(1750)](nt,s,t),d=String[n(863)+n(1789)],h=s[n(1268)],g="\uFFFD",f="";for(let _=0;e[n(708)](_,t);_++){let v=h[e[n(1223)](_,x)],C,L,B,P;if(e[n(1130)](e.drNxn(128,v),0))f+=e[n(231)](d,v);else if(e.EaYxZ(e[n(1082)](224,v),192))e[n(1602)](_,1)>=t?f+=g:(C=h[e[n(1602)](e[n(1837)](_,x),1)],e[n(749)](192&C,128)?f+=g:(P=e[n(524)](e[n(690)](e[n(689)](31,v),6),e.hlcdT(63,C)),P<128?f+=g:(f+=d(P),_++)));else if(e[n(313)](e[n(862)](240,v),224))if(e[n(586)](e.hOGxS(_,2),t))f+=g;else if(e[n(306)](n(909),"nKjoN"))if(C=h[e[n(400)](_,x)+1],L=h[e[n(400)](e.bEZym(_,x),2)],(e[n(245)](C,L<<8)&49344)!==32896)f+=g;else if(P=e[n(495)](e[n(1251)](e[n(554)](e[n(1177)](15,v),12),e[n(1572)](63,C)<<6),e.zkqNI(63,L)),P<2048||e.kFzGZ(P,55296)&&e[n(1605)](P,57343))f+=g;else if(e.XVynq(e.pxipZ,n(321)))f+=e[n(1671)](d,P),_+=2;else return;else{let U=0,O=0;for(let R=0;i.VqBbA(R,_0x30f070[n(1239)]);++R)O=_0x3be149[n(1680)+"At"](R),i[n(1236)](O,128)?U+=1:i[n(1288)](O,2048)?U+=2:i[n(1345)](64512&O,55296)&&i[n(1102)](i.dGjuc(64512,_0x4b3655.charCodeAt(i[n(801)](R,1))),56320)?(++R,U+=4):U+=3;return U}else e[n(1011)](248,v)==240?e[n(586)](e[n(1175)](_,3),t)?f+=g:(C=h[e[n(1471)](_+x,1)],L=h[e.xMtOm(_,x)+2],B=h[e[n(1322)](e[n(1544)](_,x),3)],e.TZKdP(e[n(689)](e[n(448)](C|e[n(238)](L,8),e[n(932)](B,16)),12632256),8421504)?f+=g:(P=e.wqzZd(e.JoaVj(e[n(1251)]((7&v)<<18,(63&C)<<12),e[n(1454)](e.EXdew(63,L),6)),e[n(1142)](63,B)),e[n(1112)](P,65536)||e.FBWlp(P,1114111)?f+=g:(P-=65536,f+=d(e[n(999)](P>>10,55296),e[n(1695)](e.mdLpB(1023,P),56320)),_+=3))):f+=g}return f}}function Le(s,t){let n=r,i={Ielwn:e[n(533)],MiyEO:function(f,_){return e[n(936)](f,_)},yuFYD:function(f,_){return e[n(924)](f,_)},GrAZI:function(f,_){return f|_},sLZWg:function(f,_){return e[n(826)](f,_)},DDIcW:function(f,_){return e[n(1424)](f,_)},nANJB:function(f,_){return e[n(1846)](f,_)},wVFXF:function(f,_){return e[n(1443)](f,_)},qnOFN:function(f,_){return e[n(1251)](f,_)},cqBhK:function(f,_){return f|_},vqEcc:function(f,_){return e.WWzRZ(f,_)},FDfpk:function(f,_){return e[n(1601)](f,_)},xckKL:function(f,_,v,C){return f(_,v,C)}},x=t[n(1239)],d=0;for(let f=0;e[n(474)](f,x);f++){let _=t[n(1680)+"At"](f);e[n(311)](_,55296)&&e[n(1321)](_,56319)&&e[n(708)](e[n(1779)](f,1),x)&&(_=e[n(458)](_<<10,t.charCodeAt(++f))-56613888),d+=e.tDYcP(_,128)?1:e.uBmWT(_,2048)?2:e.HgftX(_,65536)?3:4}e[n(905)](ee,s,d);let h=e[n(715)](me,s,d),g=s[n(1268)];for(let f=0;e[n(1238)](f,x);f++){let _=t[n(1680)+"At"](f);if(_>=55296&&e[n(1751)](_,56319)&&e[n(1699)](e.xMtOm(f,1),x)&&(_=e.fyEBR(e[n(1454)](_,10)+t[n(1680)+"At"](++f),56613888)),e[n(591)](_,128))g[h++]=_;else{if(e[n(1112)](_,2048))g[h++]=e.WKQKJ(_,6)&31|192;else{if(e[n(708)](_,65536))g[h++]=e[n(279)](e.rAdYg(e[n(1088)](_,12),15),224);else if(e[n(1208)](e[n(1844)],e[n(523)])){let v=4294967295;return function(C,L,B=!0){let P=n,U=i[P(1676)][P(1120)]("|"),O=0;for(;;){switch(U[O++]){case"0":v=i[P(974)](127&C[L],0);continue;case"1":if(C[L++]<128)return{value:B?v:0|v,offset:L};continue;case"2":v=i.yuFYD(i.GrAZI(v,i[P(1823)](i[P(865)](127,C[L]),14)),0);continue;case"3":if(i[P(360)](C[L++],128))return{value:B?v:0|v,offset:L};continue;case"4":if(i[P(360)](C[L++],128))return{value:B?v:i[P(822)](0,v),offset:L};continue;case"5":v=i[P(822)](v,i[P(1228)](127,C[L])<<21)>>>0;continue;case"6":if(i[P(360)](C[L++],128))return{value:B?v:i.GrAZI(0,v),offset:L};continue;case"7":if(i[P(360)](C[L++],128))return{value:B?v:0|v,offset:L};continue;case"8":return{value:B?v:i[P(822)](0,v),offset:L};case"9":v=i[P(916)](i.qnOFN(v,i[P(1823)](i[P(865)](127,C[L]),7)),0);continue;case"10":v=i.MiyEO(i.cqBhK(v,i[P(702)](15,C[L])<<28),0);continue;case"11":if(i[P(785)](L+=5,C[P(1239)]))throw L=C.length,i[P(1847)](_0x3117da,L,10,C[P(1239)]);continue}break}}}else g[h++]=e[n(1127)](e[n(1011)](e.PjuqK(_,18),7),240),g[h++]=e[n(906)](e[n(1088)](_,12),63)|128;g[h++]=e.MqSnR(_>>6,63)|128}g[h++]=e[n(1127)](e[n(300)](63,_),128)}}}function Pe(s,t){let n=r,i=e[n(905)](me,s,t[n(1575)]),x=s[n(1268)],d=t[n(1268)];for(let h=0,g=t[n(1575)];h<g;h++)x[e[n(366)](h,i)]=d[h]}function de(s){let t=r;return s[t(1268)][e[t(994)](nt,s,1)]}function Gr(s,t){let n=r,i=e[n(286)](me,s,1);s[n(1268)][i]=t}function re(s){let t=r,n=0,i=0,x;do x=de(s),n<32&&(i|=e[t(937)](e[t(1443)](127,x),n)),n+=7;while(128&x);return i}function ee(s,t){let n=r;if(e.jdXNv(n(1464),n(1464)))try{this[n(1152)]&&this[n(1152)][n(463)](_0x3d95fc,_0x5a08db)}catch{}else{for(t>>>=0;t>=128;)e.kFfLi(Gr,s,e[n(340)](e.drNxn(127,t),128)),t>>>=7;e[n(1711)](Gr,s,t)}}function Jr(s,t){let n=r,i=0,x=0,d=0,h;if(h=e.xFlzM(de,s),i=e[n(246)](127,h),128&h&&(h=e[n(327)](de,s),i|=e[n(1454)](e[n(555)](127,h),7),e[n(1136)](128,h))){if(e[n(1411)](e.orjbZ,e[n(1290)]))return n(509)+"_"+this[n(349)];h=e[n(963)](de,s),i|=e.abwRN(e[n(689)](127,h),14),e.jXWGc(128,h)&&(h=e.HXWkb(de,s),i|=e[n(826)](e[n(431)](127,h),21),128&h&&(h=e[n(1299)](de,s),x=e.UnCqe(127,h),e[n(1443)](128,h)&&(h=e[n(664)](de,s),x|=e[n(1454)](127&h,7),e[n(1082)](128,h)&&(h=de(s),x|=(127&h)<<14,128&h&&(h=e[n(1387)](de,s),x|=e[n(1501)](127&h,21),e.UnCqe(128,h)&&(h=e[n(1164)](de,s),d=127&h,e[n(361)](128,h)&&(h=e.PAbnV(de,s),d|=e.kCcRA(e[n(797)](127,h),7))))))))}return{low:e[n(1477)](i,e[n(690)](x,28)),high:e[n(279)](e[n(936)](x,4),e[n(1472)](d,24)),unsigned:t}}function bt(s,t){let n=r,i=e[n(936)](t[n(1163)],0),x=e[n(936)](e.dMPGN(e[n(936)](t[n(1163)],28),e[n(1585)](t[n(1645)],4)),0),d=e[n(936)](t[n(1645)],24),h=e.qbzYn(0,d)?e[n(1592)](0,x)?i<16384?e[n(1458)](i,128)?1:2:e[n(1410)](i,2097152)?3:4:e[n(1458)](x,16384)?e.zWBYd(x,128)?5:6:x<2097152?7:8:e[n(1458)](d,128)?9:10,g=e.UGanu(me,s,h),f=s.bytes;switch(h){case 10:f[e[n(366)](g,9)]=e[n(797)](e.feGsI(d,7),1);case 9:f[g+8]=e[n(540)](9,h)?128|d:e[n(1512)](127,d);case 8:f[e[n(1273)](g,7)]=e[n(1269)](8,h)?e[n(1259)](x>>>21,128):x>>>21&127;case 7:f[e.LupBU(g,6)]=e[n(540)](7,h)?e[n(245)](x>>>14,128):e[n(1424)](e[n(924)](x,14),127);case 6:f[g+5]=e[n(855)](6,h)?e[n(728)](x,7)|128:e[n(1443)](e[n(1599)](x,7),127);case 5:f[e[n(999)](g,4)]=e[n(1269)](5,h)?128|x:127&x;case 4:f[e[n(467)](g,3)]=h!==4?e[n(1108)](e.XmFsL(i,21),128):e[n(936)](i,21)&127;case 3:f[e[n(356)](g,2)]=e[n(1411)](3,h)?e[n(495)](i>>>14,128):e[n(1136)](e[n(924)](i,14),127);case 2:f[g+1]=h!==2?i>>>7|128:e[n(555)](i>>>7,127);case 1:f[g]=h!==1?e[n(495)](128,i):e[n(592)](127,i)}}function Xr(s){return e[r(969)](k,s)}function Jn(s){return E(s)}let Vr=65536,Fo=e[r(1386)],rt=e[r(1129)](Vr,Vr),Yr=e.jpmXm(rt,rt),Zr=Yr/2,qe=String.prototype[r(1680)+"At"];class z{constructor(t,n,i){let x=r;if(e[x(1543)]!==e[x(1543)])return new _0x57b756(_0x4cc130,{data:_0x1da06b});this.isLong=!0,this[x(1163)]=0|t,this[x(1645)]=e[x(1108)](0,n),this[x(1271)]=!!i}static[r(927)](t){return t&&e[r(1050)](!0,t.isLong)}static[r(941)](t,n,i){return new z(t,n,i)}static fromBytes(t,n,i){let x=r;return i?z[x(587)+"sLE"](t,n):z[x(587)+"sBE"](t,n)}static[r(587)+r(1445)](t,n){let i=r;return new z(e[i(524)](e[i(1294)](t[0],e[i(932)](t[1],8))|e[i(238)](t[2],16),t[3]<<24),e[i(1477)](e[i(1320)](t[4],e[i(1366)](t[5],8))|e[i(1171)](t[6],16),e[i(1510)](t[7],24)),n)}static[r(587)+r(825)](t,n){let i=r;if(i(542)===i(542))return new z(e[i(524)](e.eiNpr(t[4],24)|e[i(1472)](t[5],16)|e.sPFAm(t[6],8),t[7]),e.JoaVj(e.mKdAI(e[i(1675)](t[0],24),e[i(304)](t[1],16)),e[i(1585)](t[2],8))|t[3],n);this[i(1388)+i(644)]=null}static[r(1763)](t){let n=r;return e.MtOux(t,Fo)?$r:new z(e[n(936)](e[n(1108)](e[n(1093)](e[n(1320)](qe[n(1482)](t,0),e.SLYKZ(qe.call(t,1),8)),e[n(932)](qe[n(1482)](t,2),16)),e[n(1472)](qe[n(1482)](t,3),24)),0),e[n(936)](e[n(1251)](qe.call(t,4)|e.rKzeE(qe[n(1482)](t,5),8)|e[n(690)](qe[n(1482)](t,6),16),e.oGcMG(qe.call(t,7),24)),0),!0)}[r(758)](){let t=r;return String["fromChar"+t(1789)](255&this[t(1163)],e.feGsI(this[t(1163)],8)&255,e[t(807)](e.XmFsL(this[t(1163)],16),255),e[t(1562)](this[t(1163)],24),e[t(609)](255,this[t(1645)]),e.FAqZR(e[t(1277)](this[t(1645)],8),255),e[t(661)](this[t(1645)],16)&255,e[t(1700)](this[t(1645)],24))}static[r(1412)+"er"](t,n=!0){let i=r;if(e[i(664)](isNaN,t))return n?Ko:$r;if(n){if(t>=Yr)return Wo}else{if(e.ElWxx(t,-Zr))return jo;if(e.KJWPx(e[i(1600)](t,1),Zr))return Ho}return z.fromBits(e[i(405)](e[i(1327)](t,rt),0),e.NSPXh(e[i(1461)](t,rt),0),n)}[r(1376)](){let t=r;return this.unsigned?e[t(1261)](e[t(1800)](this.high,0)*rt,e[t(624)](this[t(1163)],0)):e[t(1837)](e.jpmXm(this[t(1645)],rt),this.low>>>0)}[r(312)](){let t=r,n={Hjdak:function(i){return e.AnrTn(i)}};if(e.qbzYn(e[t(328)],e[t(328)]))return e[t(735)](0,this[t(1645)])&&this[t(1163)]===0;{let i=this[t(270)+"tManager"]?.[t(1274)+t(722)+"nt"]();this[t(1131)](t(601)+i),n[t(1608)](_0x327e34)}}[r(902)](t){let n=r;z.isLong(t)||(t=z[n(1412)+"er"](t));let i=this.high>>>16,x=e.cmrjK(65535,this[n(1645)]),d=this[n(1163)]>>>16,h=e.RQWWq(65535,this[n(1163)]),g=e[n(1092)](t[n(1645)],16),f=65535&t[n(1645)],_=e[n(936)](t[n(1163)],16),v=e[n(985)](65535,t.low),C=0,L=0,B=0,P=0;return P+=e[n(1775)](h,v),B+=P>>>16,P&=65535,B+=e[n(954)](d,_),L+=e.lXsHL(B,16),B&=65535,L+=e.wxHyC(x,f),C+=L>>>16,L&=65535,C+=e[n(1319)](i,g),C&=65535,z[n(941)](e[n(1323)](B,16)|P,e.VNIsB(e[n(1099)](C,16),L),this.unsigned)}[r(1815)](t){let n=r;return z[n(927)](t)||(t=z.fromNumber(t)),e[n(540)](this[n(1271)],t.unsigned)&&e[n(585)](this[n(1645)],31)===1&&e[n(1382)](t[n(1645)],31)===1?!1:e[n(1580)](this[n(1645)],t[n(1645)])&&e[n(1208)](this.low,t.low)}[r(1761)](){let t=r;return e[t(306)](-1,this[t(1163)])&&e[t(1130)](-1,this[t(1645)])?z[t(941)](0,0,this[t(1271)]):e[t(1420)](-1,this[t(1163)])?z[t(941)](0,e[t(981)](this[t(1645)],1),this[t(1271)]):z[t(941)](this[t(1163)]+1,this[t(1645)],this[t(1271)])}[r(229)](t){let n=r;return t?this[n(1612)+"E"]():this[n(1712)+"E"]()}toBytesLE(){let t=r,n=this[t(1645)],i=this[t(1163)];return[e.twgYS(255,i),e.SgWhF(i,8)&255,e[t(1522)](i>>>16,255),e[t(1277)](i,24),255&n,e[t(620)](n,8)&255,e[t(1343)](n,16)&255,n>>>24]}[r(1712)+"E"](){let t=r;if(e.CKAAU(t(1039),e[t(1065)])){let n=this.high,i=this[t(1163)];return[e[t(1029)](n,24),e.OLPOX(e[t(243)](n,16),255),e[t(300)](e[t(879)](n,8),255),255&n,e[t(1284)](i,24),e[t(1025)](i>>>16,255),e.IRnjo(e[t(913)](i,8),255),e.aiSwG(255,i)]}else{let n=t(1483)+_0x585ea1+(t(382)+"ax retri"+t(1287)+"ed");this[t(730)+"hErrorEv"+t(921)](e[t(1811)](_0xd5002d,e[t(836)],{message:n,code:_0x503b3a[t(1450)+t(563)+"R"],error:_0x4b80db}));return}}}let $r=new z(0,0,!1),Ko=new z(0,0,!0),Ho=z[r(941)](-1,2147483647,!1),Wo=z.fromBits(-1,-1,!0),jo=z.fromBits(0,-2147483648,!1);var Ue=(function(s){let t=r;return s[s[e[t(1552)]]=5001]=e[t(1552)],s[s[t(629)+t(594)]=5002]=t(629)+"NG_ERROR",s[s[e[t(1371)]]=5003]=t(1450)+t(563)+"R",s[s[e[t(1697)]]=5004]=e[t(1697)],s[s[e[t(248)]]=5005]=e[t(248)],s})({});class st{constructor(t){let n=r;if(e.eKgcZ(e.zbUGX,e[n(447)]))this.type=t,this[n(1518)]=null;else return this[n(759)+n(1843)+n(1607)+"t"]++,this[n(1274)+"ntEndpoint"]()}}class Qr extends st{constructor(t,n){let i=r;if(e.qupFq(e.DwYMe,e.DwYMe)){let x=e[i(470)](this[i(1594)][i(1302)+i(700)],_0x482228)?{force:!!this[i(1594)][i(1302)+i(700)][i(653)],encoding:this[i(1594)]["payloadE"+i(700)][i(1840)]?this[i(1594)][i(1302)+"ncoding"][i(1840)][i(1167)](/\s/g,"")[i(364)+i(408)]():""}:{force:!1,encoding:this[i(1594)][i(1302)+"ncoding"]?this[i(1594)][i(1302)+i(700)][i(1167)](/\s/g,"")[i(364)+"ase"]():""},d=_0x5f4fe3[i(1302)+i(700)]?_0x53f9d6[i(1302)+"ncoding"][i(1167)](/\s/g,"")["toLowerC"+i(408)]():"",h=this[i(1594)][i(651)+"ype"]instanceof _0x105de7?{force:!!this[i(1594)][i(651)+i(671)].force,type:this[i(1594)][i(651)+i(671)][i(659)]?this._options[i(651)+"ype"][i(659)][i(1167)](/\s/g,"")[i(364)+i(408)]():""}:{force:!1,type:this._options["payloadT"+i(671)]?this[i(1594)][i(651)+i(671)][i(1167)](/\s/g,"")[i(364)+i(408)]():""},g=_0x334019[i(651)+"ype"]?_0x555ef6[i(651)+i(671)][i(1167)](/\s/g,"")[i(364)+i(408)]():"",f=h[i(653)]?h.type:g||h[i(659)],_=x[i(653)]?x[i(1840)]:d||x[i(1840)],v=[e[i(272)],e[i(1286)],i(616)+i(935)+i(547)+i(625),e.gvsJp],C=[i(873)+"e",e[i(1486)]];this[i(1594)]["enableTr"+i(1548)+"extPayload"]&&v[i(380)](f)&&(!_||C[i(380)](_))?_0x26bebc[i(1550)+i(307)]=e.QdOfU(_0x44fb82,_0x7402c7[i(686)],0,_0xf68484[i(686)][i(515)+"th"]):_0x116e17[i(1550)+"oad"]=""}else super(t),this.message=n&&n[i(816)]||null}}class es extends st{constructor(t,n){let i=r,x=e.jEagr[i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":this[i(1526)]=n&&n[i(1526)]||0;continue;case"1":this[i(816)]=n&&n[i(816)]||"";continue;case"2":this[i(387)]=n&&n[i(387)]||5001;continue;case"3":this.lineno=n&&n[i(430)]||0;continue;case"4":this[i(247)]=n&&n[i(247)]||"";continue;case"5":super(t);continue;case"6":this[i(330)]=n&&n.error||null;continue}break}}}class ts extends st{constructor(t,n){let i=r,x=e.lQUsk[i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":this[i(1235)]=n&&n[i(1235)]||"";continue;case"1":super(t);continue;case"2":this.wasClean=n&&n[i(1619)]||!1;continue;case"3":this[i(1201)+"nnect"]=n&&n[i(1201)+i(770)]||!1;continue;case"4":this[i(387)]=n&&n[i(387)]||0;continue}break}}}class ns extends st{constructor(t,n){let i=r;super(t),this[i(550)]=n&&n[i(550)]||null}}class rs extends ns{constructor(t,n){let i=r;e[i(476)](e[i(227)],i(323))?(super(t),this.data=n&&n[i(550)]||null,this.message=n&&n.message||null):this[i(1152)]&&this._ws[i(463)](_0xdd8ffe,_0x146f0e)}}class ss extends st{constructor(t,n){let i=r;super(t),this[i(550)]=n&&n[i(550)]||null}}function le(s,{message:t,code:n,error:i}){let x=r;if(x(764)===x(764))return new es(s,{message:t,code:n,error:i});_0x5770fc=e.dMPGN(e[x(877)](15&_0x25e1b3,12),e[x(1231)](63&_0x1c0a76,6))|e[x(1430)](63,_0x4f9aa7),e[x(1846)](_0x3d8791,2048)||_0x1918e4>=55296&&_0x46d5d6<=57343?_0x39358a+=_0x13ab6b:(_0x1adede+=e[x(647)](_0xb9cd15,_0xcf70cc),_0x268e17+=2)}function _e(s,{code:t,reason:n,wasClean:i,willReconnect:x}){let d=r;if(e[d(837)](d(1822),d(1822))){let h=(d(798)+"3|5")[d(1120)]("|"),g=0;for(;;){switch(h[g++]){case"0":_0x28631d[_0x1f891e++]=e[d(1765)](_0xf3e8e0>>18,240);continue;case"1":_0x5a1c0e=e[d(677)](e[d(1709)](65536,e[d(1402)](1023&_0x240fc1,10)),e[d(807)](1023,_0x5aeb7c));continue;case"2":++_0x535767;continue;case"3":_0x853c11[_0x28f7f8++]=e[d(1251)](e.vDtOP(_0x2082b5>>6,63),128);continue;case"4":_0x2bcc90[_0x11598f++]=e[d(263)](e[d(1356)](_0x248997,12)&63,128);continue;case"5":_0x4da453[_0x1f744d++]=e[d(266)](63,_0x28fc91)|128;continue}break}}else return new ts(s,{code:t,reason:n,wasClean:i,willReconnect:x})}function is(s,{data:t,message:n}){return new rs(s,{data:t,message:n})}function os(s,{data:t}){let n=r;return e.HLUms(n(1808),n(1648))?new ss(s,{data:t}):{bytes:_0x42a958,offset:0,limit:_0x226ff3.length}}function Xn(s,{message:t}){return new Qr(s,{message:t})}class as{constructor(t,n){let i=r;this.endpoints=t,this.maxRetries=n,this[i(866)+i(707)]=0,this[i(759)+"ndpointTriesCount"]=0}[r(931)+r(315)+r(1590)](){let t=r;this[t(866)+t(707)]=0,this[t(759)+t(1843)+t(1607)+"t"]=0}[r(568)+"es"](){let t=r;this[t(759)+t(1843)+t(1607)+"t"]=0}["getCurre"+r(722)+"nt"](){let t=r;return this[t(1662)+"s"][this["currentI"+t(707)]]}[r(1274)+r(722)+r(740)+r(584)](){return this.currentEndpointTriesCount}[r(496)+r(1551)+"es"](){let t=r;return!!(this[t(866)+"ndex"]>=this[t(1662)+"s"][t(1239)]||e.eKgxC(this[t(866)+t(707)],e[t(805)](this.endpoints[t(1239)],1))&&e[t(488)](this[t(759)+t(1843)+"riesCount"],this[t(1783)+"es"]))}[r(1406)+r(485)+r(1530)+"hedMaxRetries"](){let t=r;return this[t(866)+"ndex"]==this.endpoints[t(1239)]?!0:e[t(1324)](this[t(759)+"ndpointT"+t(1607)+"t"],this.maxRetries)}[r(1042)+r(1339)+"pointAnd"+r(1683)+r(302)](){let t=r;return t(1243)===e[t(1685)]?(this[t(759)+"ndpointT"+t(1607)+"t"]=1,this[t(866)+t(707)]++,this[t(1662)+"s"][this.currentIndex]):!!this._qosDB}[r(1274)+r(722)+r(1066)+"ateCount"](){let t=r;if(e[t(480)](e[t(733)],e[t(577)]))_0x2e4350=t(566),_0x682e01=_0x4a8c6f[t(1167)](/(^http)((?:[s]*:\/\/))/,""),_0x364ac6=/(^ws)((?:[s]*:\/\/))/[t(1361)](_0x1f355b)?_0x352bd7:""+_0x1f3daf+_0x44928f;else return this[t(759)+t(1843)+t(1607)+"t"]++,this[t(1274)+"ntEndpoint"]()}}let it=(e[r(1429)](r(1752)+"d",typeof globalThis)&&e[r(842)](r(915),globalThis[r(1826)+r(986)].name)||e[r(1797)](r(1752)+"d",typeof window)&&e[r(782)]===window["construc"+r(986)][r(852)])&&e.eOlfZ(e.hIHVr,typeof document),Ge=e[r(1429)](e[r(1517)],typeof globalThis)&&(e[r(1158)](e[r(1278)],globalThis[r(1826)+r(986)][r(852)])||e[r(1669)](e.uknQZ,globalThis[r(1826)+r(986)][r(852)]))&&e[r(1192)](r(1752)+"d",typeof tt),yt=(e.lHRuD(e.hIHVr,typeof globalThis)&&e[r(743)](r(933),globalThis[r(1826)+r(986)][r(852)])||e[r(1517)]==typeof globalThis||e.lHRuD(e[r(1517)],typeof globalThis)&&!!globalThis.WeixinJSBridge)&&e.KPPeI(e[r(1517)],typeof wx),vt=e[r(1517)]!=typeof globalThis&&(e[r(1293)](r(762)+r(374)+r(1252)+"pe",globalThis["construc"+r(986)][r(852)])||e[r(1790)](e.YRwat,globalThis[r(1826)+r(986)][r(852)])||e[r(1373)]===globalThis.constructor[r(852)])&&e[r(1192)](e[r(1517)],typeof self),Go=e[r(1517)]!=typeof globalThis&&e.wasfg(e.AGgMk,globalThis[r(1826)+r(986)][r(852)])&&e[r(1517)]!=typeof global&&e[r(348)](e[r(1278)],global[r(1826)+r(986)].name)&&e[r(1797)](r(1752)+"d",typeof process)&&!!process.version;class Vn{constructor(){let t=r;if(e[t(802)](t(1549),t(513)))this[t(446)+"rs"]={};else return this._qosDB[t(992)+t(1702)]()}emit(t,...n){let i=r;if(e.zEqTo(e.HUAJM,e.vWkKC))this[i(1152)]&&this[i(1152)][i(440)](_0x4f5080),this._debug(e[i(1162)],_0x508b66);else{let x=this[i(446)+"rs"][t];if(x)x.slice()[i(503)](d=>d.fn[i(1812)](d[i(880)],n));else if(e[i(836)]===t&&!this[i(652)])if(i(804)==="fJEPg"){let d=this[i(977)][i(1229)+"geInfoSync"](this._prefix),h=_0x23db94[i(818)](d||"{}");return _0x3e4f1e.values(h)}else{let d=n[i(1239)]&&n[0];if(d instanceof Error)throw d;let h=new Error(e[i(1309)](e.ejkri,d?" ("+d[i(816)]+")":""));throw h.context=d,d}return this}}[r(319)](t,n){let i=r;if(t===void 0)this._listeners={};else if(e[i(1478)](void 0,n))this[i(446)+"rs"][t]=null;else{let x=this[i(446)+"rs"][t];if(x)for(let d=0;e[i(1689)](d,x[i(1239)]);)e.lJdux(x[d].fn,n)?x[i(834)](d,1):++d}return this}on(t,n,i){let x=r;return(this[x(446)+"rs"][t]||(this[x(446)+"rs"][t]=[]))[x(560)]({fn:n,ctx:i||this}),this}}class Jo extends Vn{["_formatE"+r(745)+r(952)](t){let n=r;if(e.rSegC(e[n(1791)],e[n(1791)]))_0x36d4dd=_0x337417[n(1680)+"At"](_0x150c40),_0x519661<128?_0x1a1d85+=1:e[n(1485)](_0x585946,2048)?_0x5e9091+=2:e[n(574)](64512&_0x3613c5,55296)&&e[n(546)](64512,_0x27e7b6[n(1680)+"At"](_0x429f81+1))===56320?(++_0x43740c,_0x49dd6a+=4):_0x127584+=3;else return t[n(844)]||t[n(658)]?(n(489)+" "+(t[n(844)]||"")+n(1515)+(t[n(658)]||""))[n(511)]():JSON[n(1437)+"y"](t)}constructor(t,n,i){let x=r;super(),this[x(269)]=null,yt&&wx[x(737)+x(320)]&&(this[x(269)]=wx[x(737)+"ocket"]({url:t,protocols:n,header:i,fail:this[x(539)+x(1555)+x(626)].bind(this),success:this[x(539)+x(756)+"cessHand"+x(1036)][x(252)](this)})),Ge&&tt["connectS"+x(320)]&&(this[x(269)]=tt["connectS"+x(320)]({url:t,protocols:n,header:i,fail:this[x(539)+x(1555)+x(626)][x(252)](this),success:this[x(539)+x(756)+"cessHand"+x(1036)][x(252)](this)}))}["_createS"+r(756)+r(955)+r(1036)](){let t=r;if(e.GyOFq===e[t(750)])Promise.resolve()[t(604)](()=>{this["_addWsLi"+t(262)]()});else return _0xf665c4}["_createS"+r(1555)+"lHandler"](t){let n=r,i={KaZYj:e[n(365)],GCCVt:function(x,d,h){return e[n(339)](x,d,h)},LMBmi:e[n(836)]};Promise[n(1687)]().then(()=>{let x=n;if(i[x(303)]==="msKuD")_0xc7066f[x(1550)+x(307)]="",_0x38976e.log(_0x5a9f16);else{let d=i[x(623)](le,i[x(384)],{message:this[x(1727)+"rrorMess"+x(952)](t)});this.emit(i[x(384)],d);let h=i.GCCVt(_e,"close",{reason:this[x(1727)+x(745)+x(952)](t)});this[x(1304)](x(463),h)}})}[r(1810)+r(262)](){let t=r,n={LduVi:function(i,x){return i(x)}};if(e[t(434)](t(491),e[t(1470)]))this[t(269)][t(1759)](i=>{let x=t;this[x(1304)](e[x(1263)],e[x(1351)](os,e[x(1263)],{...i,data:i[x(844)]||""}))}),this[t(269)].onClose(i=>{let x=t;this[x(1304)](x(463),_e(e[x(514)],{...i}))}),this[t(269)].onMessage(i=>{this[t(1304)](e.uXYtv,e.ZFIsU(is,e.uXYtv,{...i}))}),this[t(269)].onError(i=>{let x=t;e[x(1347)](x(1732),e[x(885)])?(_0x185436["frontier"+x(1144)]=void 0,n.LduVi(_0x47db91,x(415)+"reason")):this[x(1304)](e[x(836)],e[x(643)](le,e[x(836)],{...i,message:i[x(844)]||""}))});else{let i=_0x17da5e[t(1482)](fIcaXf[t(1159)](_0x2fd2d2,this),_0x1203e1,..._0x3cbb20);return _0x33630c[t(1739)](i,_0x6574be[t(1708)]?_0x42e55b[t(1708)]():[_0x663093]),_0x1736e0(i)}}[r(440)](t){let n=r;if(e[n(1032)](t,Uint8Array)){let i=t[n(1378)][n(1749)](t[n(1787)+"et"],e[n(1175)](t.byteLength,t[n(1787)+"et"]));this[n(269)]&&this[n(269)][n(440)]({data:i,fail:x=>{let d=n;this[d(1304)](e[d(836)],e[d(1666)](le,e[d(836)],{message:this[d(1727)+"rrorMess"+d(952)](x)}))}})}else this[n(269)]&&this[n(269)].send({data:t,fail:i=>{let x=n;this[x(1304)](e.YAeQt,e[x(1666)](le,e[x(836)],{message:this[x(1727)+x(745)+x(952)](i)}))}})}close(t,n){let i=r,x={sZoDm:function(d,h){return e[D(1299)](d,h)},pQBrK:e.GVmBT,pHTth:function(d){return e[D(551)](d)}};if(e.jZxde(e[i(1150)],e[i(369)])){let d={MkZXR:fIcaXf[i(1692)],GdZty:i(330),rtwcp:fIcaXf[i(1603)],Virfy:function(_){return _()},OJYxD:function(_){return fIcaXf.AAagX(_)}},h=()=>{let _=i;_0x195221["removeEv"+_(1091)+_(991)](d[_(979)],g),_0x4b589a["removeEv"+_(1091)+_(991)](d[_(1717)],f),_0x2d829a["removeEv"+_(1091)+_(991)](d[_(922)],f)},g=()=>{let _=i;d.Virfy(_0x19d68b),d[_(1338)](h)},f=()=>{let _=i;yYVytT.sZoDm(_0x3414c8,_0x18b559[_(330)]||new _0x1c2c48("AbortError",yYVytT[_(599)])),yYVytT.pHTth(h)};_0x6b4b39[i(1627)+"Listener"](i(1222),g),_0x3d86f5[i(1627)+"Listener"](fIcaXf[i(836)],f),_0x371401[i(1627)+i(662)](fIcaXf[i(1603)],f)}else this[i(269)]&&this[i(269)][i(463)]({code:t,reason:n})}[r(1627)+r(662)](t,n){let i=r;e[i(1203)]!==e[i(1203)]?(e.dmMwg(_0x18fd68,_0x45da3e,74),e[i(512)](_0x3daa9f,_0x538b10,_0x516cfa)):this.on(t,n)}[r(1838)+r(1091)+r(991)](t,n){this[r(319)](t,n)}get[r(1367)+"te"](){let t=r;return this[t(269)][t(1367)+"te"]}get[r(258)+"pe"](){let t=r;return this[t(269)][t(258)+"pe"]}set[r(258)+"pe"](t){}get[r(1622)](){let t=r;return this[t(269)][t(1622)]}get protocol(){let t=r;return this._socket[t(1063)]}get extensions(){let t=r;return this._socket[t(1733)+"ns"]}get[r(271)+r(277)](){return 0}}function Xo(s,t){let n=r;if(t)return new t(s[n(1622)],s.protocol);if(e[n(1841)](yt,Ge))return new Jo(s[n(1622)],s.protocol,s[n(1139)]);if(e[n(1841)](it,vt)&&n(1752)+"d"!=typeof WebSocket&&WebSocket)return new WebSocket(s[n(1622)],s[n(1063)+"s"])}function Vo(s){let t=r,n={dZUfP:function(i,x){return e[D(1303)](i,x)},fvSPy:function(i,x){return e.DYkel(i,x)}};if(e[t(749)](e.ImuMN,t(1754))){let i="1|2|3|4|0"[t(1120)]("|"),x=0;for(;;){switch(i[x++]){case"0":return!1;case"1":if(s)return!0;continue;case"2":if(yt&&wx[t(737)+"ocket"])return!0;continue;case"3":if(Ge&&tt[t(737)+t(320)])return!0;continue;case"4":if(e[t(1841)](it,vt)&&e.eOlfZ("undefined",typeof WebSocket)&&WebSocket)return!0;continue}break}}else{let i=_0x5ce4b3.split(":");for(let x=0;VxjbnL[t(1172)](x,i.length);x++){let d=i[x];if(i[x][t(1239)]!==4){let h=_0x4b6fb0.substring(0,VxjbnL[t(840)](4,i[x].length)),g=h[t(1664)](d);_0x7b8ad6=_0x27e217[t(1664)](g)}else _0x4f3189=_0x31cb19.concat(d)}return _0x4d0e49}}function xs(s,t,n){let i=r,x={iAvWQ:function(g,f){return e.haHnZ(g,f)},NBGiV:e[i(1816)],RlaND:function(g,f){return g===f},vVKpK:function(g,f){return e[i(1181)](g,f)}},d=-1;async function h(g){let f=i;return x[f(1227)](g,d)?Promise.reject(new Error(x[f(1710)])):(d=g,x.RlaND(g,n[f(1239)])?Promise[f(1687)]():n[g].bind(s)(t,h.bind(null,x.vVKpK(g,1))))}e[i(436)](h,0)}function cs(s){let t=r,n={LJych:function(d,h){return e[D(274)](d,h)},DjSLa:function(d,h){return d&h},HrjVC:function(d,h){return d&h},pYDRF:function(d,h){return e[D(913)](d,h)},kEuoN:function(d,h){return d&h}},i=0,x=0;for(let d=0;d<s.length;++d)if(e[t(1793)]===e[t(1439)]){let h=this[t(1645)],g=this.low;return[WLUsCX.LJych(h,24),WLUsCX[t(1581)](h>>>16,255),WLUsCX.DjSLa(WLUsCX[t(1318)](h,8),255),WLUsCX[t(1581)](255,h),g>>>24,g>>>16&255,WLUsCX[t(442)](WLUsCX[t(414)](g,8),255),WLUsCX[t(1534)](255,g)]}else x=s[t(1680)+"At"](d),x<128?i+=1:x<2048?i+=2:e[t(338)](64512,x)===55296&&e[t(1478)](e[t(1071)](64512,s[t(1680)+"At"](e.mFfzd(d,1))),56320)?(++d,i+=4):i+=3;return i}function us(s,t,n){let i=r;if(e.UHJqv(e[i(372)],"pQrUh")){let x={qQFzr:function(d,h,g){return d(h,g)}};return new _0xe7213d(d=>{let h=i;x[h(1660)](_0x5ce0d4,d,this["_getInte"+h(1123)+"e"](_0x597818))})}else{if(e[i(708)](e.GbMBj(n,t),1))return"";let x="";for(let d=t;e[i(1112)](d,n);){let h=s[d++];if(h<=127)x+=String[i(863)+i(1789)](h);else if(h>=192&&h<224)x+=String[i(863)+"Code"](e[i(1307)](e[i(1154)](e[i(883)](31,h),6),e[i(1177)](63,s[d++])));else if(h>=224&&h<240)x+=String[i(863)+"Code"](e.cuCrX(e[i(1251)](e[i(1136)](15,h)<<12,e[i(1186)](e[i(1427)](63,s[d++]),6)),e[i(1011)](63,s[d++])));else if(e[i(586)](h,240)){if(e[i(1086)](i(1161),e[i(726)]))return new _0x1a4d67(_0x318769,{data:_0x44dff0,message:_0x415e0e});{let g=e[i(1740)](e[i(911)](e.ILRQm(e[i(393)](e[i(1427)](7,h),18),e[i(932)](e[i(1363)](63,s[d++]),12)),e[i(637)](e[i(980)](63,s[d++]),6))|63&s[d++],65536);x+=String[i(863)+i(1789)](e[i(677)](55296,e[i(398)](g,10))),x+=String[i(863)+i(1789)](e.tDsTk(56320,1023&g))}}}return x}}function Yn(s,t,n){let i=r,x=n,d,h;for(let g=0;g<s[i(1239)];++g)if(d=s[i(1680)+"At"](g),d<128)t[n++]=d;else if(e[i(945)](d,2048))t[n++]=d>>6|192,t[n++]=e[i(1127)](63&d,128);else if(e[i(1014)](e[i(1363)](64512,d),55296)&&e[i(1519)](e[i(1363)](64512,h=s[i(1680)+"At"](e[i(1289)](g,1))),56320))if(e.fxZIV(e[i(713)],e[i(713)]))d=e.AaLDf(e[i(1837)](65536,e[i(1472)](e[i(1207)](1023,d),10)),e[i(769)](1023,h)),++g,t[n++]=e[i(1088)](d,18)|240,t[n++]=e[i(1728)](e.IIIub(e[i(581)](d,12),63),128),t[n++]=e[i(1087)](e[i(1469)](d,6)&63,128),t[n++]=e[i(1196)](63&d,128);else return _0x29e8da||(_0x2a04c5=[_0x8f05d6,_0x5d29ba,_0x2ff79c,_0x22c4b2,_0x4232fa]);else{if(e.PAYSs("lvzZi",e.AfmMm))return e.SJESz(_0xd534dd,_0x271081);t[n++]=e[i(1469)](d,12)|224,t[n++]=e[i(1075)](e[i(993)](d>>6,63),128),t[n++]=e[i(279)](e[i(1572)](63,d),128)}return e[i(290)](n,x)}async function fs(s){let t=r;if(e[t(1452)]==typeof s){let n=new Uint8Array(e[t(1528)](cs,s));return e[t(1409)](Yn,s,n,0),n}return e.VkGFN(s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s[t(1378)],s.byteOffset,s.byteLength)}function Yo(s){let t=r;try{return e[t(732)](e[t(1452)],typeof s)&&(s instanceof ArrayBuffer||s.buffer&&e[t(416)](s[t(1378)],ArrayBuffer))||t(1611)!=typeof s?"":(JSON[t(818)](s),e[t(1286)])}catch{return e[t(441)](e[t(1452)],typeof s)?e[t(272)]:""}}let Zo=(s,t)=>{let n=r,i={SRbqS:function(x,d){return e[D(593)](x,d)},hpMGl:function(x,d){return x<d},DdhHj:function(x,d){return e.vaSXv(x,d)},RqCpa:function(x,d){return e.rBozC(x,d)},mWZgQ:function(x,d){return e[D(723)](x,d)},qYmnE:function(x,d){return e[D(1734)](x,d)},kBcOK:function(x,d){return e[D(1647)](x,d)},XiWDG:function(x,d){return e[D(1785)](x,d)},txePP:function(x,d){return e[D(493)](x,d)},hmFCN:function(x,d){return e[D(405)](x,d)},kpKHM:function(x,d){return x<<d},XOSCw:function(x,d){return e[D(716)](x,d)},CkHdc:function(x,d){return e[D(1110)](x,d)},LvNPX:function(x,d){return x>>d},YTNdN:function(x,d){return e[D(1205)](x,d)}};if(e[n(1381)](n(1756),e.nimaj)){let x=_0xaf9adb[_0x103a4a++];if(lQsEgU[n(420)](x,127))_0x4932e7+=_0x208ea8["fromChar"+n(1789)](x);else if(x>=192&&lQsEgU[n(1049)](x,224))_0xaa08b3+=_0x2bc6f3[n(863)+n(1789)](lQsEgU[n(729)](lQsEgU[n(603)](31,x)<<6,63&_0x15718a[_0x1404aa++]));else if(lQsEgU[n(1010)](x,224)&&x<240)_0x1d9b47+=_0x1ceb0d[n(863)+"Code"](lQsEgU.qYmnE(lQsEgU[n(729)](lQsEgU[n(951)](lQsEgU[n(603)](15,x),12),lQsEgU.RqCpa(63,_0x3f2701[_0x335412++])<<6),lQsEgU[n(968)](63,_0x4ee9bd[_0x1f5955++])));else if(x>=240){let d=lQsEgU[n(1742)](lQsEgU[n(1504)](lQsEgU.hmFCN(lQsEgU[n(951)](7&x,18),lQsEgU[n(1567)](lQsEgU[n(603)](63,_0x22173c[_0xf6e19a++]),12)),lQsEgU[n(646)](63&_0x468bbf[_0x4d55f7++],6))|63&_0x1281f1[_0xba0f08++],65536);_0x39e411+=_0x2c5abd[n(863)+n(1789)](lQsEgU[n(1845)](55296,lQsEgU.LvNPX(d,10))),_0x17abbc+=_0x874a67[n(863)+n(1789)](lQsEgU.CkHdc(56320,lQsEgU.YTNdN(1023,d)))}}else switch(s){case n(1558):case e.UHgaS:return{["x-use-"+s]:1,"x-tt-env":t};default:return{}}};class $o{constructor(t){let n=r;e[n(1640)](e.vIYXP,e[n(983)])?(e[n(479)](_0xf6763d,_0x108af3,58),e[n(853)](_0x41dc3f,_0x47d492,_0x24e90e)):(this[n(612)+n(584)]=t,this[n(1368)]=0)}[r(1574)](){this.count++}[r(496)+r(617)+"nt"](){let t=r;if(e[t(1535)]===e[t(1535)])return e[t(311)](this[t(1368)],this[t(612)+"ount"]);this[t(977)]?.[t(463)](),this[t(977)]=void 0}[r(1417)+r(1766)](t=0){let n=r;this[n(612)+n(584)]=t,this.count=0}}async function Qo(s){let t=r,n={lRtJv:t(415)+t(1235),wKGhm:function(i,x){return e[t(1743)](i,x)},QzbcL:e.TvUAn,qbWfQ:function(i,x){return e[t(680)](i,x)},LsEwa:function(i,x){return e.bHXqZ(i,x)},mArfT:e[t(228)],IioNc:t(965),VVeMd:t(1770)+t(1834),qPeLK:e[t(1539)],KJtzS:e[t(289)]};return new Promise(i=>{let x=t,d={zMfvP:function(g,f){return g(f)},ZxEDo:n[x(754)]};if(n[x(827)](x(1174),n.QzbcL)){let g=_0x3cae46[x(1268)],f=_0x353c7f[x(1575)];return g[x(1239)]===f?g:g[x(1115)](0,f)}else{if(!it)return n.qbWfQ(i,n.lRtJv);try{if(n.LsEwa(x(796),n[x(588)]))for(var h in _0x4126f8)_0x3876b3.o(_0x53a134,h)&&!_0x175358.o(_0x591ca5,h)&&_0x4a6d36[x(1831)+x(1111)](_0x500c5c,h,{enumerable:!0,get:_0xe8b27[h]});else{let g=document.createElement(n[x(345)]);window[x(509)+"JSONP"]=f=>{let _=x;document.body[_(794)+_(1026)](g),window[_(509)+"JSONP"]=void 0,d[_(1342)](i,f&&f.msg||d[_(510)])},g[x(659)]=n.VVeMd,g.src=s[x(1167)](/^ws/,x(242))+n[x(1718)];try{document[x(676)][x(285)+x(1026)](g)}catch{x(894)===n[x(833)]?this["_addWsLi"+x(262)]():document[x(676)][x(794)+x(1026)](g)}}}catch{window["frontier"+x(1144)]=void 0,i(x(415)+x(1235))}}})}function Fe(s,t,n){let i=r;if(e[i(1488)](e[i(912)],"BkrdW")){let x=_0x424873[i(1120)](/\./)[i(1040)](g=>_0x591d4f(g)),d=[];return d[0]=_0x44725b(x[0]+x[1]),d[1]=e.xFlzM(_0x2f09f1,e.MHKtN(x[2],x[3])),[i(1595),e[i(934)],e.DkUzV,e.DkUzV,e[i(934)],e[i(719)],d[0],d[1]].join("")}else return!!s?.[i(471)](x=>x[i(1074)]===t&&x.value===n)}function ot(s,t){let n=r;return s?.[n(471)](i=>i.key===t)?.[n(1047)]}let Zn=null;async function e0(){let s=r;return Zn||(Zn=Promise[s(1687)]()[s(604)](Se[s(252)](Se,e[s(748)]))),Zn}class t0 extends Vn{constructor(t,n){let i=r;super(),this[i(326)]=t,this._keyPath=n,this[i(977)]=void 0,this[i(1388)+i(644)]=null}async[r(1540)](){let t=r,n={bnexF:e[t(1311)]};e[t(749)](e[t(1577)],e[t(1577)])?(this[t(347)+t(1148)].push(_0x15edff),this[t(1131)](n[t(1586)],_0x3c06f5)):await this._init()}async _init(){let t=r,n={phRCE:function(i){return e[D(551)](i)},soLsk:function(i,x,d,h){return e[D(607)](i,x,d,h)}};if(!this[t(977)]){if(this[t(1388)+"mise"])return this[t(1388)+t(644)];try{if(e[t(281)](e[t(1455)],e[t(858)])){let i=this[t(326)],x=this._keyPath;this["_initPro"+t(644)]=(async()=>{let d=t,{openDB:h}=await n.phRCE(e0);this[d(977)]=await n[d(760)](h,d(509)+"_"+i,1,{upgrade(g){g["createOb"+d(276)+"e"](i,{keyPath:x})}})})(),await this[t(1388)+t(644)]}else _0x228f95.d=(i,x)=>{for(var d in x)_0x5536d1.o(x,d)&&!_0xd6b1f7.o(i,d)&&_0x59a722.defineProperty(i,d,{enumerable:!0,get:x[d]})}}catch(i){console[t(613)](i)}finally{this[t(1388)+"mise"]=null}}}async[r(1792)](t){let n=r,i={bOaSb:function(x,d){return e.CSLaa(x,d)},cFKDL:function(x){return e[D(1768)](x)}};if(e[n(1587)]===e[n(678)]){let x={cMTOz:fIcaXf.Lrmxv,jqaGn:function(f,_){return fIcaXf.EGsJY(f,_)},AGgAL:function(f,_){return f(_)}},d=()=>{let f=n;_0x10283f[f(1838)+f(1091)+"ner"](x[f(1634)],h),_0x4dd5f9[f(1838)+f(1091)+"ner"](f(330),g)},h=()=>{let f=n;x[f(521)](_0x313fbc,x[f(477)](_0x283d8f,_0x49945f.result)),d()},g=()=>{let f=n;WOScLb.bOaSb(_0x3d7137,_0x584eb1.error),WOScLb[f(1044)](d)};_0x205740[n(1627)+n(662)](n(1202),h),_0x3a7d6d[n(1627)+n(662)](fIcaXf.YAeQt,g)}else try{return await this[n(1078)](),this[n(977)]?.[n(1792)](this[n(326)],t)}catch(x){if(e[n(1128)](e[n(472)],n(1730)))console[n(613)](x);else{let d="4|1|0|2|3".split("|"),h=0;for(;;){switch(d[h++]){case"0":if(_0x3ffaf7&&_0x421182[n(737)+n(320)])return!0;continue;case"1":if(_0xe81713&&_0x30e483["connectS"+n(320)])return!0;continue;case"2":if(e[n(1151)](_0x5381bc,_0x219200)&&e[n(1517)]!=typeof _0x353d7b&&_0x984158)return!0;continue;case"3":return!1;case"4":if(_0x584521)return!0;continue}break}}}}async[r(1739)](t,n){let i=r;return await this[i(1078)](),this[i(977)]?.[i(1182)](this[i(326)],t)}async del(t){let n=r;try{return await this[n(1078)](),this[n(977)]?.[n(299)](this[n(326)],t)}catch(i){console[n(613)](i)}}async[r(1178)](){let t=r;try{return await this[t(1078)](),this[t(977)]?.[t(1178)](this[t(326)])}catch(n){console.log(n)}}async[r(1825)](){let t=r;return e[t(845)](e.oxVZh,e[t(886)])?this[t(977)]?.[t(1005)](_0x355c83):(await this[t(1078)](),this._qosDB?.[t(819)+"ys"](this[t(326)]))}async getAll(){let t=r;if(e[t(257)](e[t(971)],e.EWOFn))return await this[t(1078)](),this._qosDB?.getAll(this[t(326)]);e[t(504)](_0x57b437,e.Lrmxv),this[t(319)](e.BOKgN,_0x2a9e61),this[t(319)](e[t(453)],_0x2ef1f0)}async[r(363)](){let t=r;try{this[t(977)]?.close(),this[t(977)]=void 0}catch(n){if(e[t(656)](e[t(386)],e.kHyyT))console.log(n);else return e[t(821)](_0x307b9b,_0x21b162)?_0x261608:new _0x58d66a(e.TKTYm(e[t(1108)](e[t(1463)](_0x431b4c[t(1482)](_0x5378d7,0),_0x515114[t(1482)](_0x51f2a7,1)<<8),e[t(1099)](_0xebc051.call(_0x13b394,2),16))|e.FhNuv(_0x47e6fa[t(1482)](_0x29d585,3),24),0),e.MkXrr(e.SZnjd(e[t(260)](e[t(279)](_0x2626e7[t(1482)](_0xe67dbd,4),e[t(628)](_0x2c40de.call(_0xfccc15,5),8)),e[t(1330)](_0x25fd11[t(1482)](_0x5668e1,6),16)),_0xdbb049[t(1482)](_0x1e5c73,7)<<24),0),!0)}}get[r(957)](){let t=r,n={itbtZ:function(i,x){return e[D(1509)](i,x)},mODXg:function(i,x){return e[D(1127)](i,x)},EbcpQ:function(i,x){return e[D(600)](i,x)},neOcn:function(i,x){return e.ViudO(i,x)},jRmjm:function(i,x){return i<<x},JNuJS:function(i,x){return e[D(1501)](i,x)},SYypa:function(i,x){return e[D(1493)](i,x)},XCYFN:function(i,x){return i<x},qhkvv:function(i,x){return e[D(1606)](i,x)},aNgLD:function(i,x,d){return e.rxffp(i,x,d)},Wwmpu:function(i,x){return e[D(1250)](i,x)}};if(e[t(1576)]===e.gZUtX)this[t(1131)](e[t(519)],_0x5a32ad[t(816)]),e.YkIhS(_0x4560bc);else try{if(e[t(427)](e[t(1349)],e[t(1349)]))return!!this[t(977)];_0x938778=VKCnTS[t(900)](VKCnTS[t(1631)](VKCnTS.mODXg(VKCnTS.EbcpQ(VKCnTS[t(675)](7,_0xbaf123),18),VKCnTS.jRmjm(VKCnTS.neOcn(63,_0x2fee32),12)),VKCnTS[t(1644)](VKCnTS[t(752)](63,_0x593a4e),6)),VKCnTS[t(675)](63,_0x2f074c)),VKCnTS[t(820)](_0x3283c6,65536)||VKCnTS[t(1741)](_0x2e6911,1114111)?_0x87c198+=_0x49b2fe:(_0x21c679-=65536,_0xa79dfb+=VKCnTS[t(421)](_0x513bb3,VKCnTS.Wwmpu(_0x4ea996,10)+55296,(1023&_0x234d42)+56320),_0x37f2ca+=3)}catch(i){return console.log(i),!1}}}class n0{constructor(t,n){let i=r;if(e.UHJqv(e[i(1492)],i(1833)))if(_0x48dc08=_0x36f2ac[i(1680)+"At"](_0x3b102b),e.NRaqF(_0x2822ce,128))_0x6e0e9a[_0x4c5b19++]=_0x401f9e;else if(e.XuRRt(_0x23d6ee,2048))_0x5b7e8b[_0x30c0ca++]=e[i(1531)](e[i(953)](_0x188ea8,6),192),_0x3fc0e9[_0x2f955c++]=e[i(1214)](63&_0x3fb9da,128);else if((64512&_0x2287de)===55296&&e[i(1652)](e[i(1803)](64512,_0x16af61=_0x51e32a[i(1680)+"At"](_0x208b22+1)),56320)){let x=e[i(526)][i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":_0x29a567[_0x5f386a++]=e[i(279)](e.YoYpB(_0x24f568,18),240);continue;case"1":_0x140977[_0x26f2a3++]=e.ZehyV(e[i(809)](63,_0x2547da),128);continue;case"2":_0x8c14c3=e.oZmSe(65536+e[i(1366)](1023&_0x365bd8,10),1023&_0x23d88a);continue;case"3":++_0x994449;continue;case"4":_0xf64bd4[_0x2a0c8f++]=e[i(1087)](e[i(1177)](e[i(251)](_0x2d1e0e,6),63),128);continue;case"5":_0xbc536d[_0x2a802e++]=e[i(1803)](e[i(1250)](_0x1cd56b,12),63)|128;continue}break}}else _0x480492[_0x1b7f93++]=e[i(1075)](e[i(778)](_0x1fa8df,12),224),_0x2b0087[_0x16e8aa++]=e.Ljcjg(e.iwmIM(_0x48ca47,6)&63,128),_0x65615d[_0x311198++]=e[i(635)](e[i(1803)](63,_0x4289b0),128);else this[i(349)]=t,this._pathKey=n,this._qosDB=localStorage}async[r(1540)](){}get[r(1254)](){let t=r;return t(509)+"_"+this[t(349)]}async[r(1792)](t){let n=r,i=this[n(977)].getItem(this[n(1254)]);return JSON[n(818)](e[n(1197)](i,"{}"))[t]}async[r(1739)](t,n){let i=r,x=this[i(977)].getItem(this[i(1254)]),d=JSON.parse(e[i(1061)](x,"{}"));return d[n||t[this._pathKey]]=t,this[i(977)][i(1686)](this[i(1254)],JSON[i(1437)+"y"](d)),n||t[this[i(437)]]}async del(t){let n=r,i={EFCRu:function(x,d,h){return e[D(1401)](x,d,h)}};if(e.YNnfL!=="SmbDg"){let x=this._qosDB[n(1703)](this[n(1254)]),d=JSON[n(818)](e[n(589)](x,"{}"));return d[t]=void 0,this[n(977)][n(1686)](this[n(1254)],JSON.stringify(d))}else{let{value:x,offset:d}=i[n(1230)](_0x2fb52e,_0x347b44,_0x201460);_0x162514=d,_0x1e162f=_0x10eb6f<<8>>>0,_0x3f1b03+=x}}async clear(){let t=r;return this[t(977)][t(1178)]()}async[r(1825)](){let t=r,n=this[t(977)][t(1703)](this[t(1254)]),i=JSON[t(818)](e[t(385)](n,"{}"));return Object[t(1825)](i)}async[r(1198)](){let t=r,n=this[t(977)][t(1703)](this._prefix),i=JSON[t(818)](e[t(824)](n,"{}"));return Object[t(1392)](i)}[r(363)](){return Promise[r(1687)]()}get[r(957)](){return!!this[r(977)]}}class r0{constructor(t,n){let i=r;this[i(349)]=t,this._pathKey=n,this[i(977)]=Ge?tt:yt?wx:null}async[r(1540)](){}get[r(1254)](){return r(509)+"_"+this._DBName}async[r(1792)](t){let n=r,i=this[n(977)][n(1229)+n(325)](this[n(1254)]);return JSON[n(818)](e[n(589)](i,"{}"))[t]}async[r(1739)](t,n){let i=r,x=this._qosDB[i(1229)+i(325)](this[i(1254)]),d=JSON[i(818)](e[i(1841)](x,"{}"));return d[n||t[this._pathKey]]=t,this[i(977)][i(721)+"geSync"](this._prefix,JSON[i(1437)+"y"](d)),n||t[this[i(437)]]}async[r(1005)](t){let n=r,i=this[n(977)][n(1229)+n(325)](this[n(1254)]),x=JSON[n(818)](e[n(589)](i,"{}"));return x[t]=void 0,this[n(977)][n(721)+n(325)](this[n(1254)],JSON.stringify(x))}async[r(1178)](){let t=r;return this[t(977)][t(992)+t(1702)]()}async[r(1825)](){let t=r,n=this[t(977)].getStorageInfoSync(this[t(1254)]),i=JSON[t(818)](e.ryzrl(n,"{}"));return Object[t(1825)](i)}async[r(1198)](){let t=r,n=this._qosDB[t(1229)+t(1332)+"nc"](this[t(1254)]),i=JSON.parse(e.IUxId(n,"{}"));return Object[t(1392)](i)}[r(363)](){let t=r,n={Tkfvj:function(i,x,d){return i(x,d)}};if(e[t(1476)]==="shTcX"){let i=this[t(270)+t(590)]?.getCurrentEndpoint();this[t(730)+"hCloseEvent"](n[t(1582)](_0x5361ce,t(463),{code:_0x251ade[t(387)],reason:"connecting faile"+t(897)+t(1561)+t(475)+t(1084)+i})),this["_endpoin"+t(590)]?.[t(931)+t(315)+"fig"](),this[t(261)+"sCounter"]?.[t(1417)+"nter"]();return}else return Promise[t(1687)]()}get[r(957)](){return!!this[r(977)]}}function ds(s,t){let n=r;if(n(908)!==e.BMNhk){let i=e[n(684)][n(1120)]("|"),x=0;for(;;){switch(i[x++]){case"0":this["_readyCl"+n(699)]=!1;continue;case"1":this[n(1204)]=!0;continue;case"2":this["_endpoin"+n(590)]?.[n(931)+n(315)+"fig"]();continue;case"3":this[n(261)+n(831)]?.[n(1417)+"nter"]();continue;case"4":this[n(1441)]();continue}break}}else{if(e[n(556)](Ge,Ge))return new r0(s,t);if(e[n(385)](it,vt)&&e[n(259)](e[n(1517)],typeof indexedDB))return new t0(s,t);if((it||vt)&&e[n(732)](e[n(1517)],typeof localStorage))return new n0(s,t);throw new Error(n(645)+"DB failed")}}class s0{constructor(){let t=r;this[t(317)+t(1056)+"Id"]=null,this[t(317)+"l"]=36e5,this[t(977)]=e[t(1315)](ds,e.hrsbx,e[t(830)])}async[r(317)+r(443)](){let t=r,n={GLDso:function(i,x){return e[D(358)](i,x)},NZEFO:function(i,x){return i(x)},mCLlU:function(i,x,d){return e[D(286)](i,x,d)}};if(e[t(1014)](e[t(1715)],"cCpKa"))clearInterval(this[t(317)+t(1056)+"Id"]),this[t(317)+"lTimeoutId"]=setInterval(()=>{this[t(755)+"ired"]()},this[t(317)+"l"]);else return sJJuiD[t(947)](sJJuiD[t(1814)](_0x3ec8c1,8)[t(1247)]("0"),sJJuiD[t(1573)](_0x566c37,_0x365270,10)[t(553)](2))[t(1749)](-8)}async[r(1540)](){let t=r,n={XkzNW:function(i,x){return e[D(1138)](i,x)},KAten:"GFWtk",TCSRm:e[t(1405)]};if(e[t(1293)](e[t(578)],e[t(1408)])){let i=this[t(1645)],x=this.low;return[e[t(361)](255,x),x>>>8&255,e[t(1207)](e[t(1284)](x,16),255),x>>>24,e[t(1629)](255,i),e[t(266)](e[t(428)](i,8),255),i>>>16&255,e[t(1599)](i,24)]}else await this._qosDB[t(1540)]()[t(604)](()=>{let i=t;if(n[i(806)](n[i(767)],n[i(1639)]))return this[i(1152)]?this._ws.extensions:"";this[i(317)+i(443)]()})}async[r(755)+r(487)](){let t=r;(await this._qosDB?.[t(1198)]()||[])[t(697)](({timestamp:x})=>x<Date[t(394)]())[t(503)](x=>{let d=t;this[d(977)]?.[d(1005)](x.message_id)})}async[r(1005)](t){let n=r;return this[n(977)]?.[n(1005)](t)}async set(t,n){let i=r;return this[i(977)]?.[i(1739)]({message_id:t,timestamp:n})}async[r(1792)](t){let n=r;if(e[n(1674)](e[n(1496)],e[n(1496)])){if(this[n(1594)][n(1054)+n(241)+n(535)]||this[n(923)+n(699)])return;this[n(1484)+"econnect"]()}else return this[n(977)]?.[n(1792)](t)}async[r(363)](){let t=r;e[t(1387)](clearInterval,this[t(317)+t(1056)+"Id"]),await this._qosDB?.[t(363)]()}get isReady(){return this[r(977)]?.isReady}}function $n(s){let t=r,n={hbmeL:e[t(466)]};if(e[t(413)]===e[t(413)]){let i=!!this[t(1594)][t(1849)+"S"];if(!i)return{enabled:i,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let x=e.Mvrss(Fe,s[t(816)].headers,"x_fronti"+t(1390),"2"),d=x&&e.Mvrss(Fe,s.message.headers,e[t(847)],"1"),h=x&&e[t(1465)](Fe,s[t(816)][t(1139)],e[t(893)],"1"),g=h?e[t(1500)](ot,s[t(816)][t(1139)],e[t(1436)])?.split(",")[t(697)](Boolean)||[]:[];return{enabled:i,isQoSMessage:x,isQoSAck:d,isAckCleanupMessage:h,ackMsgIds:g}}else return _0x45c5db.log(n[t(674)],_0x37424b,_0x3bd75a,_0x3fe9d0),this[t(977)][t(1739)]({cursor_name:_0x4470d7,cursor:_0x6f5342,service:_0xe085f3})}async function ls(){let s=r;return this[s(1678)+"ger"]||(this[s(1678)+s(1655)]=new s0),this[s(1678)+s(1655)][s(957)]||await this[s(1678)+s(1655)][s(1540)](),this["_QoSMana"+s(1655)]}async function i0(s,t){let n=r,{enableAutoAck:i}=this[n(1594)],x=Fe(s[n(816)][n(1139)],e[n(1767)],"1"),d=e[n(1465)](Fe,s[n(816)][n(1139)],e[n(562)],"1"),h=$n.call(this,s);if(i&&x){let{SeqID:g,LogID:f,service:_,LogIDNew:v,method:C}=s.message;this[n(688)]({SeqID:g,LogID:f,LogIDNew:v,service:_,method:C,headers:[{key:e[n(562)],value:"1"},{key:e.RqAXm,value:e.UDnEr(v,"")},{key:"ack_code",value:"0"}]})}d&&!h[n(1502)]&&this[n(730)+n(1524)+"ageEvent"](s),e[n(1768)](t)}async function o0(s,t){let n=r;this[n(1131)](n(1827),s.message),t()}async function a0(s,t){let n=r,i=e.MckUH(Xr,await e.eDvdW(fs,s[n(550)]));try{if(i[n(686)]instanceof Uint8Array)if(e[n(1757)]!==e[n(1226)]){let x=e.UdnUH(this[n(1594)][n(1302)+n(700)],Object)?{force:!!this[n(1594)][n(1302)+n(700)][n(653)],encoding:this[n(1594)][n(1302)+n(700)][n(1840)]?this[n(1594)][n(1302)+n(700)][n(1840)].replace(/\s/g,"")[n(364)+n(408)]():""}:{force:!1,encoding:this._options["payloadE"+n(700)]?this[n(1594)][n(1302)+n(700)][n(1167)](/\s/g,"")[n(364)+n(408)]():""},d=i[n(1302)+"ncoding"]?i[n(1302)+n(700)].replace(/\s/g,"")[n(364)+n(408)]():"",h=e.UGYDG(this[n(1594)][n(651)+n(671)],Object)?{force:!!this[n(1594)][n(651)+n(671)][n(653)],type:this[n(1594)][n(651)+n(671)][n(659)]?this[n(1594)][n(651)+"ype"][n(659)].replace(/\s/g,"")[n(364)+n(408)]():""}:{force:!1,type:this[n(1594)][n(651)+"ype"]?this._options[n(651)+n(671)][n(1167)](/\s/g,"")[n(364)+n(408)]():""},g=i[n(651)+n(671)]?i[n(651)+n(671)][n(1167)](/\s/g,"")[n(364)+n(408)]():"",f=h.force?h[n(659)]:g||h[n(659)],_=x[n(653)]?x[n(1840)]:d||x[n(1840)],v=[e[n(272)],e.sXDGN,e[n(1786)],e[n(1452)]],C=[e[n(869)],e[n(1486)]];this[n(1594)]["enableTr"+n(1548)+"extPayload"]&&v.includes(f)&&(!_||C.includes(_))?i["textPayl"+n(307)]=e[n(543)](us,i[n(686)],0,i[n(686)].byteLength):i[n(1550)+n(307)]=""}else{let x=_0x253282.message[n(686)];x&&_0x19c073.setCursors(x)}else i[n(1550)+"oad"]=""}catch(x){i[n(1550)+n(307)]="",console[n(613)](x)}s[n(816)]=i,e[n(670)](t)}function x0(s,t,n){let i=r,x=e[i(611)](n,8192),d=x>>>1,h=null,g=x;return function(f){let _=i;if(e[_(575)](f,1)||f>d)return e[_(231)](s,f);e[_(734)](e[_(1442)](g,f),x)&&(h=s(x),g=0);let v=t[_(1482)](h,g,g+=f);return e[_(993)](7,g)&&(g=e[_(1077)](e.dMPGN(7,g),1)),v}}let c0=4294967295;function u0(s,t,n){let i=r;return e[i(681)](RangeError,e[i(1209)](e[i(1525)](e[i(1053)](e[i(1258)](e[i(336)](e[i(1737)],s),e.HILLQ),e[i(1325)](t,1)),e[i(293)]),n))}function f0(s,t,n){let i=r;if(n>c0)throw new Error(e[i(1213)]);let x=3;for(;e[i(787)](x,0);)if(e[i(574)](e[i(1179)],e[i(1301)]))this["_miniNavigatorOn"+i(282)]=_0x555309,_0x53b850?this[i(1413)+i(1536)]():this["_handleO"+i(267)]();else{let d=255&n;e[i(1125)](er,d,s,t+x),n>>>=8,x--}return t+4}function d0(s,t){let n=r,i=0,x=t,d=e[n(397)](t,4);for(;e[n(484)](x,d);){let{value:h,offset:g}=e[n(744)](Qn,s,x);x=g,i=e.iOUQL(e[n(1379)](i,8),0),i+=h}return{value:i,offset:d}}function l0(s,t,n){let i=r,x=e[i(839)][i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":return e[i(310)](e.QdOfU(Yn,s,t,n),n);case"1":if(t[i(982)+"e"])return e[i(701)](t[i(982)+"e"](s,n),n);continue;case"2":if(s[i(1239)]<40)return e.kZqdj(Yn(s,t,n),n);continue;case"3":if(t[i(1746)])return e.dpBjU(t[i(1746)](s,n),n);continue;case"4":if(!s)return n;continue}break}}function h0(s,t){let n=r,i=new z(e.ZMTIo(e[n(1832)](e[n(1719)](e[n(1818)](s[e[n(1565)](t,4)],24),e[n(877)](s[e.mPjIE(t,5)],16)),e.BfYHm(s[e[n(917)](t,6)],8)),s[e[n(789)](t,7)]),e[n(1075)](e.igMsa(e[n(1224)](s[e[n(1397)](t,0)],24)|e[n(811)](s[t+1],16),s[t+2]<<8),s[e.xZLYu(t,3)]),!0);return t+=8,{value:i,offset:e[n(1077)](t,8)}}function g0(s,t,n){let i=r;if(e[i(1488)](i(1365),i(346))){let x=s[i(1163)],d=s[i(1645)];return t[n]=d>>>24,t[n+1]=e.FTIzV(d,16)&255,t[e[i(1374)](n,2)]=e.VHvaZ(e[i(1343)](d,8),255),t[n+3]=e[i(761)](255,d),t[n+4]=e[i(936)](x,24),t[n+5]=e[i(1726)](e.lXsHL(x,16),255),t[e[i(576)](n,6)]=x>>>8&255,t[e.NZgTP(n,7)]=e[i(359)](255,x),n+=8,n}else{let x=_0x4ecfa1[i(1120)](":");_0x4c44eb&&(_0x41bd68=x[i(1239)]),_0x16d596+=x[i(1239)];for(let d=0;e[i(1431)](d,x.length);d++)if(x[d][i(1239)]!==4){let h=_0x4a8aa0.substring(0,e[i(805)](4,x[d][i(1239)])),g=h.concat(x[d]);_0x2cc774[i(560)](g)}else _0x711888.push(x[d]);_0x163983=!1}}function Qn(s,t){let n=r;return s[n(298)+"8"]?{value:s[n(298)+"8"](t),offset:t+1}:{value:e[n(1142)](255,s[t]),offset:e.sJtvP(t,1)}}function er(s,t,n){let i=r,x={ZiKoY:function(d,h,g){return e.UcRrl(d,h,g)}};if(e[i(1348)]===e[i(859)])lmsSzb.ZiKoY(_0x10caee,_0x5f4461,8),_0x3099b5(_0x22a60e,_0x43d448);else return t[i(1661)+"t8"]?t[i(1661)+"t8"](s,n):t[n]=255&s,e[i(358)](n,1)}let p0=function(s){let t=r;if(e[t(1426)](e[t(1090)],e[t(1090)]))return new Uint8Array(s);this.flushExpired()},m0=e[r(732)](e[r(1517)],typeof Buffer)?Buffer.allocUnsafe:e[r(1667)](x0,p0,Uint8Array.prototype[r(1115)]),_0=16,tr=32;function w0(s){let t=r,n=0,i={};for(let x=0;e.OWjrl(x,s[t(1239)]);x++)i[s[x][t(1043)+t(633)]]=e.edekh(cs,s[x][t(1043)+t(633)]),n+=e[t(236)](14,i[s[x][t(1043)+"ame"]]);return[n,i]}function hs(s,t,n){let i=r,x={Ifxew:"service",YOPYO:function(d,h,g,f){return d(h,g,f)},BWRdg:e[i(1440)],qcHFp:"name",khnzA:function(d,h,g,f){return e[i(783)](d,h,g,f)},raYsl:function(d,h,g,f){return e[i(1409)](d,h,g,f)},SacJE:function(d,h,g,f){return d(h,g,f)},xeyrY:function(d,h){return e[i(259)](d,h)},QGyYX:function(d,h){return e[i(425)](d,h)},VNFce:function(d,h){return e[i(481)](d,h)},kJsZC:e.gvsJp,CPioT:"application/json",ZSrbb:function(d,h){return d==h},VlxoP:e[i(272)]};if(e[i(1620)]===e.zlnRU){let[d,h]=e[i(565)](w0,s),g=e[i(352)](m0,d),f=0;return s.forEach(_=>{let v=i,C=(v(642)+v(1545)+"5|2|10")[v(1120)]("|"),L=0;for(;;){switch(C[L++]){case"0":console.log(x.Ifxew,f);continue;case"1":console.log(v(1176)+v(852),f);continue;case"2":f=x[v(595)](g0,z[v(1412)+"er"](_[v(838)]||t),g,f);continue;case"3":console[v(613)](x.BWRdg,f);continue;case"4":console[v(613)](v(1187)+"ervice",_,_.service);continue;case"5":console[v(613)](x.qcHFp,f);continue;case"6":f=er(h[_[v(1043)+v(633)]],g,f);continue;case"7":f=x.khnzA(er,0,g,f);continue;case"8":f=x[v(395)](l0,_["cursor_n"+v(633)],g,f);continue;case"9":f=x[v(1033)](f0,g,f,_.service||0);continue;case"10":console[v(613)]("curvalue",f);continue}break}}),{frameType:tr,headers:[{key:e[i(343)],value:n}],payload:g}}else try{return GbJSSr[i(1723)](i(1611),typeof _0x515d0e)&&(GbJSSr.QGyYX(_0x19be12,_0x310a04)||_0x2cf395[i(1378)]&&GbJSSr.VNFce(_0x5255e9[i(1378)],_0x3db665))||GbJSSr[i(391)]!=typeof _0x6c161b?"":(_0x45a91b.parse(_0x3666e0),GbJSSr.CPioT)}catch{return GbJSSr[i(757)](GbJSSr[i(391)],typeof _0x55e096)?GbJSSr[i(878)]:""}}function b0(s){let t=r,n={wxpkK:e[t(354)]};if(e.qupFq(t(545),e[t(1563)])){let i=this[t(270)+t(590)]?.[t(1274)+t(722)+"nt"]();this[t(1131)](t(1483)+i+t(1444)),this["_disconn"+t(1262)](1001,n.wxpkK,!0)}else{let i=0,x=[];for(;e[t(1625)](i,s.byteLength);){let{offset:d}=e[t(1654)](Qn,s,i);i=d;let h={cursor_name:"",cursor:0,service:0},{value:g,offset:f}=d0(s,i);h[t(1589)]=g,i=f;let{value:_,offset:v}=e.TMwHd(Qn,s,i);i=v,h["cursor_n"+t(633)]=e[t(1125)](us,s,i,e[t(917)](i,_)),i+=_;let{value:C,offset:L}=e[t(482)](h0,s,i);h[t(838)]=C[t(1376)](),i=L,x[t(560)](h)}return x}}function y0(){let s=r;return e[s(1031)](e.FeXYm,e.fblxR)?{frameType:tr,headers:[{key:e[s(343)],value:e[s(1353)]}],payload:void 0}:_0x31b76d.resolve()}class v0{constructor(t,n,i){let x=r,d={pVcIF:function(h,g){return h(g)},pqQnK:function(h,g){return e[D(929)](h,g)},QJSMX:function(h,g){return e[D(1037)](h,g)},hButH:function(h,g){return h&g},miezD:function(h,g){return e[D(1305)](h,g)},GmpqZ:function(h,g){return h&g},IaIJp:function(h,g){return h&g},KrZtM:function(h,g){return h<<g},exBah:function(h,g){return e[D(1160)](h,g)}};e[x(1848)](e[x(926)],e[x(926)])?(_0x50aa3e=cydqdX[x(1106)](_0x2cfded,_0x278082),_0x1327b8|=cydqdX.pqQnK(cydqdX[x(457)](127,_0x5e3901),14),cydqdX[x(522)](128,_0x1a0604)&&(_0x4e719a=cydqdX[x(1106)](_0x145d88,_0x20798c),_0x3e78be|=cydqdX[x(435)](127&_0x518429,21),cydqdX.hButH(128,_0x2f23f8)&&(_0x3e272f=cydqdX.miezD(_0x2f291f,_0x18f51e),_0x4951ed=cydqdX[x(1155)](127,_0x3146cd),cydqdX[x(899)](128,_0x4eaf60)&&(_0x38a432=_0x35a480(_0x565bdb),_0x24dcc0|=cydqdX[x(1079)](cydqdX.exBah(127,_0x12c733),7))))):(this["_cursorN"+x(812)]=t,this[x(451)+"ileName"]=n,this["_message"+x(1358)]=i,this[x(977)]=e[x(994)](ds,this[x(433)+x(812)],e[x(1114)]))}async[r(1540)](){let t=r;await this[t(977)][t(1540)]()}async getCursors(){let t=r;if(!this._qosDB[t(957)])return;let n=this["_message"+t(1358)],i=await this._qosDB[t(1198)]();switch(console[t(613)](e[t(1724)],i),n){case e[t(1813)]:return i&&i[t(1239)]?e[t(607)](hs,i,0,this[t(451)+t(1614)]):void 0;case e.YnLWH:return;case t(1264):return i&&i[t(1239)]?e[t(544)](hs,i,0,this["_cursorF"+t(1614)]):e[t(583)](y0)}}async set(t,n,i){let x=r,d={wRWjr:function(h,g){return h||g}};if(e.eUOia(e.gPbWx,e[x(920)]))return console.log(x(810),t,n,i),this[x(977)][x(1739)]({cursor_name:t,cursor:n,service:i});{let h=this[x(977)][x(1703)](this._prefix),g=_0x388f56[x(818)](aSCfua[x(1034)](h,"{}"));return g[_0x2fef07]=void 0,this[x(977)].setItem(this[x(1254)],_0x57a2d6[x(1437)+"y"](g))}}async[r(1642)+"rs"](t){let n=r,i=e[n(775)](b0,t);for(let x of i)console[n(613)](e[n(1068)],i),await this[n(977)][n(1739)](x)}async[r(1792)](t){let n=r;return(await this[n(977)].get(t))?.[n(838)]}async[r(363)](){let t=r;await this[t(977)][t(363)]()}[r(1314)+"rsorFile"+r(989)](t){let n=r;this[n(451)+"ileName"]=t}get[r(957)](){let t=r;return this._qosDB[t(957)]}}let S0=e[r(1672)];async function gs(s){let t=r;if(!this[t(1594)].enableQoS)return null;let{aID:n,fpID:i,messageStrategy:x}=this[t(1594)],d=e[t(589)](s,S0);try{return this[t(815)+t(939)]?s&&this[t(815)+t(939)][t(1314)+"rsorFile"+t(989)](s):this[t(815)+"anager"]=new v0(i+"_"+n+"_"+d,d,x),this._cursorManager.isReady||await this._cursorManager[t(1540)](),this["_cursorM"+t(939)]}catch{return null}}async function C0(s,t){let n=r,i={EnAJc:function(x,d){return e[D(725)](x,d)}};if(e[n(476)](e[n(1745)],e.RAXJA)){let x=this._qosDB[n(1229)+n(325)](this._prefix),d=_0x757c0a[n(818)](uztfGY[n(1266)](x,"{}"));return d[_0x541408]=void 0,this[n(977)][n(721)+n(325)](this[n(1254)],_0x455e3f[n(1437)+"y"](d))}else{let x=e[n(473)](Fe,s[n(816)][n(1139)],e[n(956)],"-1"),d=Fe(s.message[n(1139)],n(1758),"1"),h=e[n(803)](ot,s[n(816)][n(1139)],e.CSeqF),g=Number(e[n(1401)](ot,s[n(816)][n(1139)],e[n(249)]))||0,f=$n.call(this,s),_=e[n(288)](Fe,s[n(816)][n(1139)],e[n(334)],"2"),v=ot(s[n(816)][n(1139)],n(402)+n(1333)+"e"),C=Number(e.ISAxX(ot,s[n(816)][n(1139)],e[n(1610)]));if(f[n(1502)])return e[n(1809)](t);let L=f["isQoSMes"+n(461)]?await ls[n(1482)](this):null;if(e[n(1601)](s.message[n(1589)],0)&&d&&!x||s[n(816)][n(1589)]>0){if(h&&f[n(1219)+n(461)]&&L)return!!!await L.get(h)&&(this[n(730)+n(781)+"Event"](s),await L.set(h,e[n(1246)](Date.now(),g))),e.AAagX(t);if(_){let B=await gs[n(1482)](this);if(!B)return this["_dispatc"+n(781)+n(1242)](s),t();let P=await B[n(1792)](v)??-1;if(P<C)this[n(730)+n(781)+"Event"](s),B.set(v,C,s[n(816)][n(1589)]);else throw new Error(n(615)+n(1418)+n(776)+C+(n(1157)+n(1776)+"al cursor ")+P);return e[n(559)](t)}return this[n(730)+n(781)+n(1242)](s),e.dHdoq(t)}}}async function E0(s,t){let n=r,i=$n.call(this,s);if(!i["isQoSMes"+n(461)])return e[n(670)](t);let x=await ls.call(this);if(i[n(605)+n(814)+n(952)]&&i[n(1744)+"s"][n(1239)])for(let d of i[n(1744)+"s"])await x[n(1005)](d);e[n(1119)](t)}async function A0(s,t){let n=r,i=e.FxFQb(s[n(816)][n(1244)+"e"],_0),x=e.eUOia(s[n(816)][n(1244)+"e"],tr);if(!i&&!x)return e[n(959)](t);let d=e[n(1750)](ot,s[n(816)][n(1139)],"cursor_f"+n(1747));if(!d)return t();let h=await gs.call(this,d);if(!h)return t();if(i){let g=await h.getCursors(),f={frameType:g?.[n(1244)+"e"],SeqID:z.fromNumber(this[n(572)]++),LogID:z[n(1412)+"er"](this[n(1594)][n(1533)+n(1598)]()),service:9e3,method:5,headers:g?.[n(1139)],payload:g?.[n(686)]},_=E(f);this._ws&&this[n(1152)][n(1367)+"te"]&&this[n(1152)][n(440)](_)}if(x){let g=s.message[n(686)];g&&h[n(1642)+"rs"](g)}}let D0=async function(s,t){let n=r;this[n(1204)]=!1,e.oVbau(clearTimeout,this[n(1441)+"ionTimeo"+n(1344)]),e.pcayq(t)},L0=async function(s,t){let n=r;if(!this._ws||e[n(802)](this[n(1152)][n(1367)+"te"],this.OPEN))return e.jzJNJ(t);let{pingInterval:i}=this[n(1594)];this[n(270)+"tManager"]?.[n(931)+n(315)+n(1590)]();for(let d=0;e[n(1191)](d,this[n(347)+"Queue"][n(1239)]);d++){let h=this[n(347)+n(1148)][d];if(e[n(848)](this[n(1152)][n(1367)+"te"],this[n(1103)])&&e[n(1566)](null,h))this._ws&&this[n(1152)][n(440)](h),this[n(347)+n(1148)][d]=null;else break}this[n(347)+"Queue"]=this[n(347)+n(1148)].filter(d=>!!d),this[n(904)+n(1604)+"Id"]=e.gJxHp(setTimeout,()=>this._ping(),i),this[n(730)+n(1617)+"nt"](s),this[n(1341)+"er"]&&this[n(1152)]&&(this[n(1152)][n(258)+"pe"]=this[n(410)+n(671)]);let x=this["_endpoin"+n(590)]?.[n(1274)+n(722)+"nt"]();this[n(1131)]("open "+x+n(329)),e[n(1768)](t)},P0=async function(s,t){let n=r,i=this[n(270)+n(590)]?.[n(1274)+n(722)+"nt"]();this[n(1131)](n(601)+i),e[n(670)](t)};class k0 extends Vn{constructor(t){let n=r,i={GNGDx:function(g,f,_){return g(f,_)},rZDBM:function(g,f,_){return e[D(1245)](g,f,_)},MhIeC:function(g,f){return e[D(1253)](g,f)},GtjTe:function(g,f,_){return e.TkTNG(g,f,_)},ZgFEF:function(g,f){return g!==f},Xygwr:"qUBNf",UQHOo:n(765),hRHhU:function(g,f){return g===f},JfCAi:e[n(747)],KMOQj:function(g,f){return e[n(1296)](g,f)},ipTQW:n(622),JlJDd:e[n(693)],cjTly:n(1202),gFclG:function(g,f,_){return e[n(905)](g,f,_)},dyxAa:function(g,f,_,v){return e.IbZtg(g,f,_,v)},AXnlF:function(g,f,_){return e[n(619)](g,f,_)},fKtrE:e.YAeQt,ISXOl:function(g,f,_){return g(f,_)},IHCii:function(g,f){return e.nbgLX(g,f)},xLIfT:function(g,f,_){return e[n(1419)](g,f,_)},jutCh:e[n(514)],udKGE:function(g,f,_){return e[n(254)](g,f,_)},PzUIs:function(g,f){return e[n(1107)](g,f)},LqsEY:function(g,f,_){return e[n(876)](g,f,_)},SiCRS:function(g,f,_){return e[n(905)](g,f,_)}};super(),this[n(1784)+"igatorOn"+n(282)]=!0,this[n(1341)+"er"]=it,this._isNode=Go,this._isMiniTT=Ge,this[n(1153)+"X"]=yt,this[n(742)+"r"]=vt,this[n(347)+n(1148)]=[],this[n(270)+n(590)]=null,this[n(923)+"osed"]=!1,this[n(410)+n(671)]=e[n(294)],this["_connect"+n(1183)]=!1,this[n(1441)+"ionTimeoutId"]=null,this[n(1336)+n(318)+n(648)]=null,this[n(904)+"gTimeoutId"]=null,this[n(572)]=0,this._isInit=!1,this[n(235)]="",this[n(1678)+n(1655)]=null,this[n(815)+n(939)]=null,this[n(261)+"sCounter"]=null,this[n(1621)+"ls"]="pbbp2",this[n(460)]=3,this[n(629)+"NG"]=0,this.OPEN=1,this[n(1360)]=2,this._onOpen=g=>{let f=n;if(i[f(1681)]("lhKBf",f(1013)))KdRBYC.GNGDx(_0x2e3868,_0x1dcefe,82),KdRBYC[f(1257)](_0x4ae73d,_0x48cc61,_0x398ca6);else try{xs(this,g,[D0,L0,P0])}catch(_){let v=i[f(444)](le,f(330),{message:_[f(816)],code:Ue[f(1126)+"OR"],error:_});this._dispatchErrorEvent(v)}},this[n(1511)+"ge"]=async g=>{let f=n;if(i.ZgFEF(i.Xygwr,i[f(264)])){let{pingInterval:_,pingFrequency:v}=this[f(1594)];if((i.hRHhU("hi",g[f(550)])&&i[f(1681)](i[f(948)],v)||i[f(1352)](i[f(695)],v))&&(this["_clearPi"+f(538)](),this[f(1304)](i.JlJDd,i[f(870)]),this["_pingPon"+f(1604)+"Id"]=i[f(679)](setTimeout,this._ping[f(252)](this),_)),g.data==="hi")return;try{i[f(244)](xs,this,g,[a0,i0,E0,A0,C0,o0])}catch(C){let L=i[f(828)](le,i[f(696)],{message:C[f(816)],code:Ue[f(1105)+f(1072)],error:C});this[f(730)+"hErrorEvent"](L)}}else this[f(317)+f(443)]()},this[n(1089)]=g=>{let f=n,_=this[f(270)+f(590)]?.[f(496)+f(1551)+"es"](),v=this["_endpoin"+f(590)]?.[f(1274)+f(722)+"nt"]();if(_&&!g.message){let C="connect "+v+(f(382)+f(1270)+f(1287)+"ed");this._dispatchErrorEvent(i[f(1233)](le,i[f(696)],{message:C,code:Ue[f(1450)+f(563)+"R"],error:g}));return}this[f(1152)]&&i[f(1156)](this[f(1152)].readyState,this[f(1103)])&&this[f(1057)+f(1262)](),this[f(730)+f(1425)+f(921)](le(i[f(696)],{message:g[f(816)],code:Ue["NATIVE_E"+f(225)],error:g}))},this[n(632)]=async g=>{let f=n;this[f(1688)+"mer"](),this[f(1292)+f(538)](),this[f(1394)+f(411)+"rs"](),this._ws=null,this[f(1441)+f(1183)]=!1;let _=this[f(270)+f(590)]?.[f(496)+f(1551)+"es"]();if(!_&&this[f(1663)+f(531)]()&&!this[f(923)+f(699)]){let v=this[f(270)+f(590)]?.["getCurre"+f(722)+"nt"](),C=this[f(1594)][f(1328)+f(1764)+f(1691)](g[f(387)],g[f(1235)]);this[f(730)+"hCloseEv"+f(921)](i[f(1006)](_e,i[f(1497)],{code:1006,reason:g.reason||"connecting faile"+f(897)+f(1561)+f(475)+f(1084)+v,willReconnect:C})),C&&this[f(1441)]();return}if(i[f(1650)](1e3,g[f(387)])&&this[f(923)+f(699)]){this[f(730)+f(1633)+"ent"](i.udKGE(_e,i[f(1497)],{code:1e3,reason:f(692)})),this[f(270)+f(590)]?.[f(931)+f(315)+"fig"](),this[f(261)+f(831)]?.[f(1417)+f(1766)]();return}if(i.ZgFEF(1e3,g[f(387)])&&_){let v=this["_endpoin"+f(590)]?.[f(1274)+"ntEndpoint"](),C=g[f(1235)];C||(C=await i.PzUIs(Qo,this[f(235)])),C=f(1316)+f(1393)+f(439)+C+(f(639)+f(654))+v+(f(630)+f(1216)+"ached"),this[f(730)+f(1633)+f(921)](i.LqsEY(_e,f(463),{code:g[f(387)],reason:C}));let L=f(1483)+v+(" fail, m"+f(1270)+"es reached");this[f(730)+f(1425)+f(921)](le("error",{message:L,code:Ue["MAX_RETR"+f(563)+"R"]})),this[f(270)+f(590)]?.["resetEnd"+f(315)+"fig"](),this[f(261)+"sCounter"]?.["resetCou"+f(1766)]();return}if(i[f(1650)](1e3,g.code)&&!g[f(1235)]){let v=this[f(270)+f(590)]?.[f(1274)+f(722)+"nt"]();this[f(730)+f(1633)+f(921)](i[f(1300)](_e,f(463),{code:g[f(387)],reason:f(1316)+f(1393)+f(897)+f(1561)+f(475)+f(1084)+v})),this[f(270)+f(590)]?.[f(931)+f(315)+f(1590)](),this[f(261)+f(831)]?.[f(1417)+f(1766)]();return}this[f(730)+f(1633)+"ent"](g),this[f(270)+f(590)]?.[f(931)+"pointCon"+f(1590)](),this[f(261)+"sCounter"]?.resetCounter()},this.onclose=null,this[n(652)]=null,this.onmessage=null,this.onopen=null,this[n(1009)+n(766)]=null,this[n(265)+n(368)]=null,this[n(1276)+n(1498)+n(998)+"ct"]=null,this[n(1413)+n(1536)]=this[n(1413)+n(1536)][n(252)](this),this[n(1413)+n(267)]=this["_handleO"+n(267)][n(252)](this),this[n(1670)+n(273)]=this._handlePageHide[n(252)](this),this[n(1670)+"ageShow"]=this[n(1670)+n(1415)][n(252)](this),this[n(1594)]={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:1/0,service:0,logIDGenerator:c,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:n(622),pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:e.UCWuG,env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:x,ws:d}=t,h=Array[n(1064)](x)?x:e.NeLlp(e[n(1452)],typeof x)?[x]:[];if(!h||e.abXhb(0,h[n(1239)]))throw new Error(n(337)+n(1618)+n(938));if(!e.SyMzP(Vo,d))throw new Error(e.EGqDL);if(Object[n(741)](this._options,t),this[n(270)+n(590)]=new as(h,this._options.maxRetries),this[n(261)+n(831)]=new $o(this._options["pingLoss"+n(1805)]),this[n(1594)][n(1298)+"cOpen"]){if(e[n(1253)](e.vAawf,e.MuXqU))return _0xeedd21||(_0x126e59=[_0x383eef.prototype[n(375)],_0x4b0cd8[n(1460)+"e"][n(1217)],_0x194c2f[n(1460)+"e"].continuePrimaryKey]);this[n(1204)]=!0,this._connect()}this[n(1594)][n(1260)+n(373)+n(1487)]&&(this[n(875)+"T"]||this._isMiniWX?this[n(1027)+"etWorkCh"+n(1839)]():this[n(1341)+"er"]&&this["_initGlobalEvent"+n(662)]())}["_handleO"+r(1536)](){let t=r;this[t(1594)]["disableAutoRecon"+t(535)]||this._readyClosed||this._handleReconnect()}["_handleO"+r(267)](){let t=r;this._destroyWebSocket();let n=e[t(964)](Xn,t(1328)+"t",{message:t(746)+t(455)+t(1364)+"ct"});this[t(1276)+t(1498)+"yReconnect"]&&this[t(1276)+t(1498)+"yReconnect"](n)}["_initGlo"+r(1134)+r(662)](){let t=r;this[t(1341)+"er"]&&window[t(1627)+"Listener"](e.gaTVI,this[t(1413)+"nLine"]),this[t(1341)+"er"]&&window["addEvent"+t(662)](e[t(1508)],this[t(1413)+"ffLine"]),this[t(1341)+"er"]&&window[t(1627)+t(662)](t(1721),this[t(1670)+t(273)]),this[t(1341)+"er"]&&window["addEvent"+t(662)]("pageshow",this[t(1670)+t(1415)])}["_dropGlo"+r(1134)+"Listener"](){let t=r;e[t(370)](e[t(1021)],e.BMKwF)?(this[t(1341)+"er"]&&window["removeEv"+t(1091)+t(991)](t(1490),this[t(1413)+t(1536)]),this[t(1341)+"er"]&&window["removeEv"+t(1091)+t(991)](e[t(1508)],this[t(1413)+t(267)]),this[t(1341)+"er"]&&window[t(1838)+t(1091)+t(991)](e[t(984)],this[t(1670)+t(273)]),this[t(1341)+"er"]&&window[t(1838)+t(1091)+t(991)](e.WLgfx,this[t(1670)+"ageShow"])):this[t(1304)](t(507),_0x30e0dc(e[t(1263)],{..._0x5a94f8,data:_0xde0c82[t(844)]||""}))}["_handleP"+r(273)](t){let n=r;if(!t[n(1748)+"d"])if(e[n(409)](e[n(943)],e[n(857)]))this._isBrowser&&window[n(1838)+n(1091)+n(991)](e[n(984)],this[n(1670)+n(273)]),this._isBrowser&&window["removeEventListe"+n(991)](e[n(449)],this[n(1670)+n(1415)]),this.close();else{if(e[n(1285)](_0x324e08,_0x332078))return new _0x371fe1(_0x537ced,_0x325c81);if(e[n(1513)](_0x5ecb1e,_0x27588e)&&e.CWUjO("undefined",typeof _0x31255b))return new _0x5c6fd8(_0x155291,_0x290c04);if(e[n(1018)](_0xbb71df,_0x42c204)&&e[n(1022)](e[n(1517)],typeof _0x1705d7))return new _0x2676d0(_0x4da7e3,_0x343f03);throw new _0x54d378(e[n(698)])}this[n(1341)+"er"]&&window[n(1838)+n(1091)+n(991)](n(1490),this[n(1413)+"nLine"]),this[n(1341)+"er"]&&window[n(1838)+n(1091)+n(991)](e[n(1508)],this["_handleO"+n(267)])}[r(1670)+r(1415)](t){let n=r;t[n(1748)+"d"]&&(this["_navigat"+n(531)]()&&(!this[n(1152)]||e[n(1462)](this[n(1152)][n(1367)+"te"],this[n(1103)])||e[n(1012)](this._ws.readyState,this[n(629)+"NG"]))&&this._handleOnLine(),this[n(1341)+"er"]&&window[n(1627)+n(662)](n(1490),this[n(1413)+n(1536)]),this[n(1341)+"er"]&&window[n(1627)+n(662)](e[n(1508)],this[n(1413)+n(267)]))}async[r(1760)+r(350)](t){let n=r,{fpID:i,deviceID:x,bddID:d,ttwID:h,accessKey:g,aID:f,customParams:_={},enableAutoAck:v,enableQoS:C,QoSLevel:L,env:B}=this[n(1594)],P,U,O;if(this._isBrowser||this[n(1153)+"X"]||this[n(875)+"T"])P=location&&e[n(517)]==location[n(1063)]?n(566):e.weWxK,U=t.replace(/((^ws)|(^http))((?:[s]*:\/\/))/,""),O=/^wss(.*:\/\/)/[n(1361)](t)?t:""+P+U;else if(e[n(711)](n(966),n(1656)))P=e.ZWphh,U=t[n(1167)](/(^http)((?:[s]*:\/\/))/,""),O=/(^ws)((?:[s]*:\/\/))/[n(1361)](U)?U:""+P+U;else{let St=_0x55e7c7[n(579)+"g"](0,4-_0x3edd91[_0xb623c3].length),Ct=St[n(1664)](_0x12a706[_0x131302]);_0x134807[n(560)](Ct)}let R=d?e[n(718)]:h?e.FtmPf:e.kWWKl,Z=d||h||x;if(e[n(230)](!Z,!R))throw new Error(e[n(1030)]);let Ft=e[n(313)](e[n(362)],typeof _)?await _():_,ps=B?e[n(619)](Zo,B.xUseEnv,B[n(889)]):{},nr=Object[n(741)]({device_platform:e.fAnEJ,version_code:n(459)+"0",access_key:g,fpid:i,aid:f,[R]:Z,xsack:v?1:0,xaack:v?1:0,xsqos:C?1:0,qos_level:C?L:void 0,qos_sdk_version:2,...ps},Ft),T0=Object.keys(nr)[n(1828)]((St,Ct)=>nr[Ct]!==void 0?""+St+(St?"&":"?")+Ct+"="+nr[Ct]:St,"");return O+n(1017)+T0}async _connect(){let t=r;if(!(this._connectLock||this[t(923)+t(699)])){this[t(1441)+t(1183)]=!0;try{let n=this[t(270)+"tManager"]?.[t(1406)+"rentEndp"+t(1530)+t(891)+"tries"](),{timeoutInterval:i}=this[t(1594)];if(n)if(e[t(1130)](e[t(1615)],e[t(1149)])){let d=e[t(344)](_0x15bece);return e[t(1194)](_0x1d0253,_0x2623f7,d),e[t(342)](_0x2bda2d,d)}else{let d=this["_endpoin"+t(590)]?.[t(1274)+t(722)+"nt"](),h=this[t(270)+t(590)]?.[t(1042)+t(1339)+"pointAnd"+t(1683)+"unt"](),g=this["_endpoin"+t(590)]?.[t(1274)+"ntEndpoi"+t(740)+"ount"]();if(h){let f=t(1483)+d+(t(1444)+", max re"+t(1216)+"ached, w"+t(1527)+t(500)+t(975))+h+(t(606)+"y"),_=e[t(1774)](le,t(330),{message:f,code:Ue[t(1450)+t(563)+"R"]});this[t(1131)](f),this[t(730)+t(1425)+t(921)](_),this._url=await this["_generat"+t(350)](h),this._debug("connect "+h+" "+g+t(465)),this["_removeW"+t(411)+"rs"]()}else if(e[t(275)]===e[t(1083)]){if(e[t(537)](_0xfd5624,_0x1af3a8))return _0x575c0d?_0x58e090:_0x4a79b3;if(_0x5abe9d){if(e[t(723)](_0x1b3336,_0x1ec979))return _0x3861e3}else{if(e.haHnZ(_0x2a78f9,-_0x15f744))return _0x32f282;if(e[t(1020)](e[t(621)](_0x3904eb,1),_0x439367))return _0x4e0f7f}return _0x46671d[t(941)](e[t(1722)](e[t(1327)](_0x2ba861,_0x25831e),0),e[t(245)](e[t(1461)](_0x42bc3d,_0x128684),0),_0x25bb7e)}else{let f=t(1483)+d+(" timeout"+t(630)+t(1216)+t(1416));this._debug(f),this[t(730)+t(1425)+t(921)](e[t(1337)](le,e[t(836)],{message:f,code:Ue[t(1450)+"IES_ERROR"]}));return}}else{let d=this[t(270)+"tManager"]?.[t(1274)+t(722)+t(1066)+t(1185)](),h=this[t(270)+t(590)]?.["getCurre"+t(722)+t(740)+"ount"]();this[t(235)]=await this[t(1760)+t(350)](e.VzcAW(d,"")),this[t(1131)](t(1483)+d+" "+h+" times"),this["_removeW"+t(411)+"rs"]()}if(this._isInit)this[t(1204)]=!1;else{let d=e.cVaGh(Xn,e.fgPpB,{message:t(1716)});this[t(1009)+t(766)]&&this[t(1009)+t(766)](d)}let x=this._endpointManager?.[t(1274)+"ntEndpointTriesC"+t(584)]()||0;e[t(925)](x,1)&&await this._wait(e[t(805)](x,1)),this._debug("connecting url: "+this._url+(t(987)+t(527))+this[t(1621)+"ls"]),this._ws=e[t(1190)](Xo,{url:this[t(235)],protocols:[this[t(1621)+"ls"]],headers:this[t(1594)][t(1335)+"ramParams"][t(1137)+t(1588)]},this[t(1594)].ws),(this[t(1341)+"er"]||this[t(742)+"r"])&&this[t(1152)]&&(this._ws[t(258)+"pe"]=this["_binaryT"+t(671)]),this["_addWsLi"+t(262)](),this[t(1441)+t(1564)+t(1344)]=e[t(1001)](setTimeout,this._onTimeout[t(252)](this),i)}catch(n){if(e[t(305)]!==e[t(301)])throw this[t(1441)+"Lock"]=!1,n;_0x2fdf32[_0xbed1dd++]=e[t(1095)](e[t(389)](_0x2932e8,18),7)|240,_0x1e5da1[_0x5e53d5++]=e[t(570)](_0x2f97ef>>12&63,128)}}}[r(1688)+r(357)](){let t=r;e[t(1350)](clearTimeout,this[t(1441)+"ionTimeo"+t(1344)]),this[t(1441)+"ionTimeo"+t(1344)]=null}[r(1292)+"ngTimer"](){let t=r;clearTimeout(this[t(904)+"gTimeoutId"]),e.poNwy(clearTimeout,this[t(1336)+"ctTimeou"+t(648)]),this[t(904)+"gTimeoutId"]=null,this[t(1336)+t(318)+t(648)]=null}[r(1131)](...t){let n=r;if(e.xukVS===e[n(1121)]){let i=e[n(585)](_0x958e83[n(1163)],0),x=e[n(1343)](e[n(1817)](e.WPYyo(_0x2683e3[n(1163)],28),e[n(929)](_0x191b96[n(1645)],4)),0),d=_0x5a1d1b[n(1645)]>>>24,h=e[n(306)](0,d)?e[n(649)](0,x)?e[n(573)](i,16384)?i<128?1:2:i<2097152?3:4:e.PEtpZ(x,16384)?x<128?5:6:e[n(280)](x,2097152)?7:8:e[n(1846)](d,128)?9:10,g=e.qWUoL(_0x59cbc7,_0x2acd84,h),f=_0x2a9bd0[n(1268)];switch(h){case 10:f[e[n(739)](g,9)]=e[n(906)](e[n(226)](d,7),1);case 9:f[g+8]=h!==9?128|d:e[n(970)](127,d);case 8:f[e[n(1514)](g,7)]=e[n(1705)](8,h)?e[n(635)](e[n(666)](x,21),128):e[n(1142)](e[n(1690)](x,21),127);case 7:f[e[n(1537)](g,6)]=e.rSegC(7,h)?x>>>14|128:e[n(673)](x>>>14,127);case 6:f[e[n(724)](g,5)]=e[n(1100)](6,h)?e[n(450)](x>>>7,128):e[n(1166)](e.adoTy(x,7),127);case 5:f[e[n(1221)](g,4)]=e.nPMGH(5,h)?e[n(524)](128,x):127&x;case 4:f[e[n(841)](g,3)]=e.cctLv(4,h)?e[n(1509)](i>>>21,128):e[n(1122)](i>>>21,127);case 3:f[e[n(1246)](g,2)]=e[n(1488)](3,h)?e[n(1700)](i,14)|128:i>>>14&127;case 2:f[e[n(621)](g,1)]=e.yfRcr(2,h)?e[n(808)](e[n(661)](i,7),128):e[n(704)](e[n(624)](i,7),127);case 1:f[g]=e[n(1269)](1,h)?e[n(454)](128,i):e[n(1803)](127,i)}}else this[n(1594)][n(1306)]&&console.log[n(1812)](console,[e[n(1291)],...t])}[r(1369)+r(1123)+"e"](t){let n=r,{initReconnectInterval:i,maxReconnectInterval:x,reconnectIntervalGrowFactor:d}=this[n(1594)],h=e.gQkYN(i,Math[n(1060)](d,e[n(1317)](t,1)));return h>x?x:h}_ping(){let t=r;if(this[t(1152)]&&this._ws.readyState===this.CONNECTING){this["_clearPi"+t(538)](),this[t(904)+t(1604)+"Id"]=e.bbRvL(setTimeout,this[t(1249)][t(252)](this),this._options[t(1220)+t(1506)]);return}if(!this[t(1152)]||e[t(656)](this[t(1152)][t(1367)+"te"],this[t(1103)]))return void this[t(1484)+"econnect"]();this[t(1152)]&&this[t(1152)].send("hi"),this[t(1336)+"ctTimeou"+t(648)]=e[t(479)](setTimeout,this[t(1484)+t(766)+"Timeout"][t(252)](this),this[t(1594)][t(1218)+t(1798)+t(1116)])}["_handleR"+r(766)+"Timeout"](){let t=r;if(e[t(1014)](t(657),t(1638)))try{return!!this[t(977)]}catch(n){return _0x399174[t(613)](n),!1}else this[t(261)+t(831)]?.[t(1574)](),this[t(1304)](e[t(453)],t(1649)),this[t(261)+t(831)]?.[t(496)+t(617)+"nt"]()?this[t(1484)+"econnect"]():this[t(1249)]()}[r(1663)+"orOnline"](){let t=r;return this[t(875)+"T"]||this[t(1153)+"X"]?this["_miniNavigatorOn"+t(282)]:(this[t(1341)+"er"]||this[t(742)+"r"])&&this[t(1594)][t(1260)+t(373)+t(1487)]?navigator[t(1094)]:!0}[r(1484)+r(766)](){let t=r;if(e[t(1807)]!=="PRAeo"){if(!this[t(1663)+t(531)]()||this[t(923)+t(699)])return;this[t(270)+t(590)]?.["resetEndpointCon"+t(1590)](),this[t(261)+"sCounter"]?.[t(1417)+t(1766)](),this._ws?this[t(1057)+t(1262)](1001,e[t(1133)],!0):this[t(1441)]()}else _0x1f07f8.body[t(285)+t(1026)](_0x3c7dbc)}["_onPageN"+r(1799)+"ange"](){let t=r;this[t(875)+"T"]?tt[t(1641)+t(1736)+"hange"](({isConnected:n})=>{let i=t;this[i(1784)+"igatorOnline"]=n,n?this[i(1413)+i(1536)]():this["_handleO"+i(267)]()}):this[t(1153)+"X"]&&wx[t(1641)+t(1736)+t(884)](({isConnected:n})=>{let i=t;this[i(1784)+"igatorOnline"]=n,n?this[i(1413)+i(1536)]():this[i(1413)+i(267)]()})}[r(631)](t){let n={CrwcL:function(i,x,d){return e.pImsJ(i,x,d)}};return new Promise(i=>{let x=D;n[x(1085)](setTimeout,i,this[x(1369)+x(1123)+"e"](t))})}["_disconn"+r(1262)](t=1e3,n="",i=!1){let x=r;this[x(1152)]&&this[x(1117)+x(424)+"t"](t,n,i)}[r(1184)+"ut"](){let t=r,n=this[t(270)+"tManager"]?.[t(1274)+t(722)+"nt"]();this[t(1131)]("connect "+n+t(1444)),this[t(1057)+t(1262)](1001,e[t(354)],!0)}[r(688)](t){let n=r,i={QOylR:function(x,d,h,g,f){return e[D(901)](x,d,h,g,f)},BtdbF:function(x,d){return e[D(355)](x,d)}};if(e[n(480)](n(1706),e[n(1234)])){let x=Jn(t);this[n(1152)]&&e[n(306)](this[n(1152)].readyState,this[n(1103)])&&(this[n(1152)]&&this._ws[n(440)](x),this[n(1131)](e[n(1435)],t))}else fbBPaX.QOylR(_0x371883,fbBPaX.BtdbF(_0x5a79d9,_0x2e9063[n(1701)]),_0x3238a3[n(717)+"on"],_0x66ac22.newVersion,fbBPaX.BtdbF(_0x2ed516,_0x4b49b2[n(1474)+n(685)]))}[r(1394)+r(411)+"rs"](){let t=r,n=e[t(792)][t(1120)]("|"),i=0;for(;;){switch(n[i++]){case"0":this[t(1152)][t(1838)+t(1091)+t(991)]("error",this._onError);continue;case"1":this[t(1152)][t(1838)+t(1091)+"ner"](e[t(1263)],this[t(1713)]);continue;case"2":this[t(1152)]["removeEv"+t(1091)+"ner"](e[t(514)],this[t(632)]);continue;case"3":this[t(1152)].removeEventListener(e[t(499)],this[t(1511)+"ge"]);continue;case"4":if(!this._ws)return;continue}break}}[r(1810)+"steners"](){let t=r,n=(t(1597)+"1")[t(1120)]("|"),i=0;for(;;){switch(n[i++]){case"0":if(!this[t(1152)])return;continue;case"1":this[t(1152)][t(1627)+t(662)](e[t(836)],this._onError);continue;case"2":this[t(1152)]["addEvent"+t(662)](e[t(514)],this._onClose);continue;case"3":this[t(1152)][t(1627)+t(662)](e[t(1263)],this[t(1713)]);continue;case"4":this[t(1152)][t(1627)+"Listener"](e[t(499)],this[t(1511)+"ge"]);continue}break}}[r(233)+"nceClose"](t=1e3,n=""){let i=r;try{e[i(1241)](e[i(1554)],e.IzjpS)?this[i(1152)]&&this[i(1152)][i(463)](t,n):(this[i(1784)+i(490)+i(282)]=_0x4b573b,_0x13a153?this["_handleO"+i(1536)]():this[i(1413)+i(267)]())}catch{}}_destroyWebSocket(t=1e3,n="",i=!1){let x=r;if(this["_clearPi"+x(538)](),this["_clearTi"+x(357)](),this["_removeW"+x(411)+"rs"](),this[x(233)+x(1282)](1e3,n),this[x(1441)+x(1183)]=!1,i&&this._navigatorOnline()&&!this[x(923)+x(699)])if(e[x(802)](e[x(1015)],e[x(383)])){if(this._endpointManager?.[x(496)+x(1551)+"es"]()){let h=this[x(270)+x(590)]?.[x(1274)+x(722)+"nt"]();this[x(730)+x(1633)+x(921)](e[x(234)](_e,e[x(514)],{code:1006,reason:"connect "+h+(" timeout, max re"+x(1216)+x(1416)),wasClean:!0}))}else{let h=this[x(1594)][x(1328)+x(1764)+x(1691)](t,n);this[x(730)+x(1633)+x(921)](e.mCIbd(_e,e.JYTOH,{code:t,reason:n,wasClean:!0,willReconnect:h})),h&&this[x(1441)]()}return}else return this["currentE"+x(1843)+x(1607)+"t"]=1,this[x(866)+x(707)]++,this[x(1662)+"s"][this[x(866)+"ndex"]];this[x(1663)+x(531)]()||this["_readyCl"+x(699)]?this[x(730)+"hCloseEv"+x(921)](e[x(378)](_e,x(463),{code:t,reason:e[x(516)]})):this[x(730)+x(1633)+x(921)](e[x(1794)](_e,x(463),{code:1006,reason:e[x(1237)]})),this[x(1152)]=null,this[x(270)+x(590)]?.[x(931)+x(315)+x(1590)](),this._pingLossCounter?.["resetCou"+x(1766)]()}["_dispatc"+r(1617)+"nt"](t){this[r(1304)]("open",t),this.onopen&&this.onopen(t)}[r(730)+r(781)+"Event"](t){let n=r;this[n(1304)](e[n(499)],t),this.onmessage&&this[n(1145)+"e"](t)}[r(730)+"hAckMess"+r(712)](t){let n=r;this[n(1304)](e.FWGWT,t),this[n(265)+n(368)]&&this[n(265)+n(368)](t)}[r(730)+r(1425)+r(921)](t){let n=r;this[n(1304)](e[n(836)],t),this.onerror&&this[n(652)](t)}["_dispatchCloseEv"+r(921)](t){let n=r;this[n(1304)](e.JYTOH,t),this.onclose&&this[n(944)](t)}get binaryType(){let t=r;return e[t(1851)]!==e[t(1851)]?_0x5ef651&&_0x1a340d[t(927)]===!0:this[t(1152)]?this[t(1152)][t(258)+"pe"]:this._binaryType}set[r(258)+"pe"](t){let n=r;this[n(410)+n(671)]=t,this[n(1152)]&&(this[n(1152)][n(258)+"pe"]=t)}get[r(331)+"nt"](){let t=r;return this[t(270)+t(590)]?.[t(1274)+t(722)+t(740)+t(584)]()||0}get[r(271)+r(277)](){let t=r,n=this[t(347)+t(1148)][t(1828)]((i,x)=>(i+=x&&x[t(515)+"th"]||0,i),0);return e[t(1273)](n,this._ws?this[t(1152)][t(271)+"Amount"]:0)}get[r(1733)+"ns"](){let t=r;return this[t(1152)]?this._ws[t(1733)+"ns"]:""}get protocol(){let t=r;return this[t(1152)]?this[t(1152)][t(1063)]:""}get readyState(){let t=r;return this._ws?this[t(1152)][t(1367)+"te"]:this[t(1594)]["automati"+t(1613)]?this[t(629)+"NG"]:this[t(460)]}get[r(1622)](){let t=r;return this._ws?this[t(1152)][t(1622)]:this[t(235)]}close(t=1e3,n){let i=r,x=e[i(1657)][i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":this[i(710)+i(1134)+"Listener"]();continue;case"1":this[i(1688)+"mer"]();continue;case"2":this[i(923)+"osed"]=!0;continue;case"3":if(!this._ws)return void this[i(1131)](e[i(1232)]);continue;case"4":if(e.iZCim(this[i(1152)][i(1367)+"te"],this[i(460)])||e[i(1050)](this[i(1152)].readyState,this[i(1360)]))return void this[i(1131)](e[i(224)]);continue;case"5":this["_QoSMana"+i(1655)]?.[i(363)]();continue;case"6":this[i(1117)+i(424)+"t"](t,n);continue;case"7":this[i(1292)+i(538)]();continue}break}}async[r(440)](t,n){let i=r,x={nMvCI:function(O,R){return e[D(1571)](O,R)},ruROc:function(O,R){return O<R},eDAeQ:function(O,R){return e[D(263)](O,R)},PgZRj:function(O,R){return e[D(1593)](O,R)},miiRl:function(O,R){return e[D(1818)](O,R)},yJVpb:function(O,R){return e[D(918)](O,R)},KJgfL:function(O,R){return e[D(1023)](O,R)},STMKQ:function(O,R){return e.amWCa(O,R)},kmMTx:function(O,R){return e[D(771)](O,R)},nGgqm:function(O,R){return e[D(914)](O,R)},AenXk:function(O,R){return e[D(907)](O,R)},IxBSo:function(O,R){return e[D(1375)](O,R)},gcxzi:function(O,R){return O>R},TbOjW:function(O,R,Z,Ft){return e[D(543)](O,R,Z,Ft)}};if(e[i(614)](null,t))throw new Error(e[i(1048)]);e[i(239)]==typeof t&&(t=JSON[i(1437)+"y"](t)),e[i(1452)]!=typeof t&&!e[i(1624)](t,ArrayBuffer)&&!(t[i(1378)]&&e[i(501)](t.buffer,ArrayBuffer))&&(t=JSON[i(1437)+"y"](t));let d=await e[i(851)](fs,t),h=e[i(738)](Yo,t),{method:g=0,service:f=this[i(1594)][i(1589)],logID:_=this[i(1594)][i(1533)+i(1598)](),headers:v=this[i(1594)].headers,payloadEncoding:C=this[i(1594)][i(1302)+i(700)],payloadType:L=this[i(1594)][i(651)+"ype"],logIDNew:B=this[i(1594)][i(1385)+i(1804)][i(1170)+i(774)+"teLogIDNew"]?e.MPqrN(a,this._options["logIDNew"+i(1804)][i(1729)]):""}=e.LOVKH(n,{});if(!f)throw new Error(e[i(1035)]);let P={SeqID:z[i(1412)+"er"](this._seqId++),LogID:z.fromNumber(_),service:f,method:g,headers:v,payloadEncoding:C instanceof Object?C[i(1840)]?C[i(1840)]:"":C,payloadType:e[i(1532)](L,Object)?L[i(659)]?L[i(659)]:h:L||h,payload:d,LogIDNew:B},U=e.SJESz(Jn,P);if(this[i(1152)]&&this[i(1152)][i(1367)+"te"]===this[i(1103)])this[i(1152)]&&this[i(1152)][i(440)](U),this._debug(e[i(1162)],P);else if(e[i(914)](this._messageQueue.length,this[i(1594)][i(376)+i(871)+i(1173)]))if(e.eUOia(e[i(1210)],e[i(1080)])){if(_0x5aed90=hCpibJ[i(1658)](127,_0x286e16[_0x5ea9e5])>>>0,hCpibJ[i(887)](_0x20e849[_0x269726++],128))return{value:_0x11b052?_0x3c3c6a:hCpibJ[i(1795)](0,_0x3bfc5f),offset:_0x1e882d};if(_0xd73695=hCpibJ[i(1480)](_0xe638a|hCpibJ[i(1421)](hCpibJ[i(1658)](127,_0xb15461[_0x29bb7f]),7),0),_0x1c1fb6[_0x431d16++]<128)return{value:_0x164e80?_0x1b8527:hCpibJ[i(1281)](0,_0x71b7b1),offset:_0x1d3dc8};if(_0x1a4b86=(_0x57a785|hCpibJ.miiRl(hCpibJ[i(1658)](127,_0x18bb16[_0x4598da]),14))>>>0,hCpibJ.KJgfL(_0x3c79e8[_0x45a220++],128))return{value:_0x200dbc?_0x1f59a6:hCpibJ.eDAeQ(0,_0x162b3a),offset:_0x1ac2bc};if(_0x6ec858=hCpibJ[i(1326)](_0x2ea577,hCpibJ[i(1777)](127,_0x1e0b73[_0x1fec7e])<<21)>>>0,hCpibJ[i(731)](_0x1d5695[_0x1bcd61++],128))return{value:_0xeb0c78?_0x12c4c5:hCpibJ[i(1824)](0,_0x27112d),offset:_0x3a5561};if(_0x55c087=hCpibJ[i(1480)](hCpibJ[i(1795)](_0x438591,hCpibJ[i(1421)](hCpibJ[i(1777)](15,_0x73a0f4[_0x2405bc]),28)),0),hCpibJ[i(1407)](_0x5dce06[_0x2cf2a7++],128))return{value:_0x394530?_0x135f2a:0|_0x15e3a3,offset:_0x4ccbdd};if(hCpibJ[i(404)](_0x539a83+=5,_0x276bd9[i(1239)]))throw _0x57cef4=_0x2001b7[i(1239)],hCpibJ.TbOjW(_0x35206e,_0x3fe373,10,_0x374562[i(1239)]);return{value:_0xdee56a?_0x15d179:0|_0x1475d5,offset:_0x58b6d6}}else this[i(347)+"Queue"][i(560)](U),this[i(1131)](e.DXtwE,P);else this["_message"+i(1148)][i(494)](),this[i(347)+i(1148)][i(560)](U);return{seqID:this._seqId,logID:_,logIDNew:B}}async reconnect(t){let n=r,{url:i}=e.gDvqE(t,{}),x=Array[n(1064)](i)?i:e[n(614)](e[n(1452)],typeof i)?[i]:[];t&&Object.assign(this[n(1594)],t),x&&x[n(1239)]?this["_endpoin"+n(590)]=new as(x,this[n(1594)][n(1783)+"es"]):this[n(270)+n(590)]?.[n(931)+n(315)+n(1590)](),this[n(261)+n(831)]?.["resetCou"+n(1766)](this[n(1594)][n(1113)+n(1805)]),this[n(923)+n(699)]=!1,this[n(1152)]&&this[n(1152)][n(1367)+"te"]!==this[n(460)]?this[n(1057)+n(1262)](1e3,e[n(1007)],!0):(this[n(1204)]=!0,this._connect())}async[r(1168)](){let t=r;if(!this[t(1441)+t(1183)]){let n=(t(1523)+"4")[t(1120)]("|"),i=0;for(;;){switch(n[i++]){case"0":this["_pingLos"+t(831)]?.["resetCou"+t(1766)]();continue;case"1":this[t(1204)]=!0;continue;case"2":this["_readyCl"+t(699)]=!1;continue;case"3":this[t(270)+"tManager"]?.["resetEndpointCon"+t(1590)]();continue;case"4":this[t(1441)]();continue}break}}}["addEvent"+r(662)](t,n){this.on(t,n)}[r(419)+r(1242)](t){let n=r,{type:i}=t;this[n(1304)](i,t)}[r(1838)+"entListe"+r(991)](t,n){this.off(t,n)}pingOnce(){return new Promise((t,n)=>{let i=D,x={fyzKF:function(g,f){return e[D(1312)](g,f)},IJxnZ:e[i(829)],yVTvq:e[i(453)],FyWtO:function(g,f){return e[i(1466)](g,f)},upbRa:i(1649),FrLpr:e.BOKgN};this[i(1292)+i(538)](),this[i(904)+i(1604)+"Id"]=e.SfEJS(setTimeout,this[i(1249)][i(252)](this),this[i(1594)][i(1220)+"rval"]);let d=()=>{let g=i;x[g(1140)](t,x[g(793)]),this[g(319)](g(1398)+"e_success",d),this.off(x[g(1404)],h)},h=()=>{let g=i;x[g(1045)](n,x[g(1788)]),this[g(319)](x[g(223)],d),this[g(319)](x.yVTvq,h)};this.on(e[i(693)],d),this.on(e[i(453)],h),this[i(1249)]()})}}})(),Y[S(418)+S(1067)]=V[S(418)+S(1067)],Y["CustomEr"+S(928)]=V[S(314)+S(928)],Y[S(705)+"e"]=V.ErrorCode,Y.Event=V[S(1242)],Y[S(1041)]=V[S(1041)],Y[S(1583)+S(1499)+S(665)]=V[S(1583)+"MessageEvent"],Y["MessageE"+S(665)]=V["MessageE"+S(665)],Y[S(961)+"t"]=V[S(961)+"t"],Y["Reconnec"+S(846)]=V["Reconnec"+S(846)],Y[S(1003)+S(1067)]=V[S(1003)+S(1067)],Y[S(1569)+S(928)]=V[S(1569)+S(928)],Y[S(452)+"ssageEvent"]=V["createMe"+S(1038)+"nt"],Y[S(1738)+S(528)]=V[S(1738)+"enEvent"],Y[S(445)+S(1772)+S(665)]=V[S(445)+S(1772)+S(665)],Y[S(1141)+S(1101)]=V[S(1141)+S(1101)],Y[S(1399)+"ame"]=V[S(1399)+"ame"];for(hn in V)["CustomCl"+S(1067),S(314)+S(928),S(705)+"e",S(1242),S(1041),S(1583)+S(1499)+S(665),S(1499)+S(665),S(961)+"t",S(602)+"tEvent",S(1003)+S(1067),S(1569)+S(928),"createMessageEvent","createOp"+S(528),S(445)+S(1772)+S(665),S(1141)+S(1101),"encodeFrame"][S(322)](hn)===-1&&(Y[hn]=V[hn]);var hn;Object[S(1831)+"operty"](Y,"__esModule",{value:!0})});var Re=ae((Gd,ci)=>{"use strict";var ai=["nodebuffer","arraybuffer","fragments"],xi=typeof Blob<"u";xi&&ai.push("blob");ci.exports={BINARY_TYPES:ai,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:xi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var kt=ae((Jd,yn)=>{"use strict";var{EMPTY_BUFFER:lx}=Re(),dr=Buffer[Symbol.species];function hx(r,e){if(r.length===0)return lx;if(r.length===1)return r[0];let o=Buffer.allocUnsafe(e),a=0;for(let c=0;c<r.length;c++){let u=r[c];o.set(u,a),a+=u.length}return a<e?new dr(o.buffer,o.byteOffset,a):o}function ui(r,e,o,a,c){for(let u=0;u<c;u++)o[a+u]=r[u]^e[u&3]}function fi(r,e){for(let o=0;o<r.length;o++)r[o]^=e[o&3]}function gx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function lr(r){if(lr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new dr(r):ArrayBuffer.isView(r)?e=new dr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),lr.readOnly=!1),e}yn.exports={concat:hx,mask:ui,toArrayBuffer:gx,toBuffer:lr,unmask:fi};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=X("bufferutil");yn.exports.mask=function(e,o,a,c,u){u<48?ui(e,o,a,c,u):r.mask(e,o,a,c,u)},yn.exports.unmask=function(e,o){e.length<32?fi(e,o):r.unmask(e,o)}}catch{}});var hi=ae((Xd,li)=>{"use strict";var di=Symbol("kDone"),hr=Symbol("kRun"),gr=class{constructor(e){this[di]=()=>{this.pending--,this[hr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[hr]()}[hr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[di])}}};li.exports=gr});var ht=ae((Vd,_i)=>{"use strict";var Tt=X("zlib"),gi=kt(),px=hi(),{kStatusCode:pi}=Re(),mx=Buffer[Symbol.species],_x=Buffer.from([0,0,255,255]),Sn=Symbol("permessage-deflate"),Me=Symbol("total-length"),dt=Symbol("callback"),He=Symbol("buffers"),lt=Symbol("error"),vn,pr=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!vn){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;vn=new px(o)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[dt];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let o=this._options,a=e.find(c=>!(o.serverNoContextTakeover===!1&&c.server_no_context_takeover||c.server_max_window_bits&&(o.serverMaxWindowBits===!1||typeof o.serverMaxWindowBits=="number"&&o.serverMaxWindowBits>c.server_max_window_bits)||typeof o.clientMaxWindowBits=="number"&&!c.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return o.serverNoContextTakeover&&(a.server_no_context_takeover=!0),o.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof o.serverMaxWindowBits=="number"&&(a.server_max_window_bits=o.serverMaxWindowBits),typeof o.clientMaxWindowBits=="number"?a.client_max_window_bits=o.clientMaxWindowBits:(a.client_max_window_bits===!0||o.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(e){let o=e[0];if(this._options.clientNoContextTakeover===!1&&o.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!o.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(o.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&o.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return o}normalizeParams(e){return e.forEach(o=>{Object.keys(o).forEach(a=>{let c=o[a];if(c.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(c=c[0],a==="client_max_window_bits"){if(c!==!0){let u=+c;if(!Number.isInteger(u)||u<8||u>15)throw new TypeError(`Invalid value for parameter "${a}": ${c}`);c=u}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${c}`)}else if(a==="server_max_window_bits"){let u=+c;if(!Number.isInteger(u)||u<8||u>15)throw new TypeError(`Invalid value for parameter "${a}": ${c}`);c=u}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(c!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${c}`)}else throw new Error(`Unknown parameter "${a}"`);o[a]=c})}),e}decompress(e,o,a){vn.add(c=>{this._decompress(e,o,(u,l)=>{c(),a(u,l)})})}compress(e,o,a){vn.add(c=>{this._compress(e,o,(u,l)=>{c(),a(u,l)})})}_decompress(e,o,a){let c=this._isServer?"client":"server";if(!this._inflate){let u=`${c}_max_window_bits`,l=typeof this.params[u]!="number"?Tt.Z_DEFAULT_WINDOWBITS:this.params[u];this._inflate=Tt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:l}),this._inflate[Sn]=this,this._inflate[Me]=0,this._inflate[He]=[],this._inflate.on("error",yx),this._inflate.on("data",mi)}this._inflate[dt]=a,this._inflate.write(e),o&&this._inflate.write(_x),this._inflate.flush(()=>{let u=this._inflate[lt];if(u){this._inflate.close(),this._inflate=null,a(u);return}let l=gi.concat(this._inflate[He],this._inflate[Me]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Me]=0,this._inflate[He]=[],o&&this.params[`${c}_no_context_takeover`]&&this._inflate.reset()),a(null,l)})}_compress(e,o,a){let c=this._isServer?"server":"client";if(!this._deflate){let u=`${c}_max_window_bits`,l=typeof this.params[u]!="number"?Tt.Z_DEFAULT_WINDOWBITS:this.params[u];this._deflate=Tt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:l}),this._deflate[Me]=0,this._deflate[He]=[],this._deflate.on("data",bx)}this._deflate[dt]=a,this._deflate.write(e),this._deflate.flush(Tt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let u=gi.concat(this._deflate[He],this._deflate[Me]);o&&(u=new mx(u.buffer,u.byteOffset,u.length-4)),this._deflate[dt]=null,this._deflate[Me]=0,this._deflate[He]=[],o&&this.params[`${c}_no_context_takeover`]&&this._deflate.reset(),a(null,u)})}};_i.exports=pr;function bx(r){this[He].push(r),this[Me]+=r.length}function mi(r){if(this[Me]+=r.length,this[Sn]._maxPayload<1||this[Me]<=this[Sn]._maxPayload){this[He].push(r);return}this[lt]=new RangeError("Max payload size exceeded"),this[lt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[lt][pi]=1009,this.removeListener("data",mi),this.reset()}function yx(r){if(this[Sn]._inflate=null,this[lt]){this[dt](this[lt]);return}r[pi]=1007,this[dt](r)}});var gt=ae((Yd,Cn)=>{"use strict";var{isUtf8:wi}=X("buffer"),{hasBlob:vx}=Re(),Sx=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Cx(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function mr(r){let e=r.length,o=0;for(;o<e;)if((r[o]&128)===0)o++;else if((r[o]&224)===192){if(o+1===e||(r[o+1]&192)!==128||(r[o]&254)===192)return!1;o+=2}else if((r[o]&240)===224){if(o+2>=e||(r[o+1]&192)!==128||(r[o+2]&192)!==128||r[o]===224&&(r[o+1]&224)===128||r[o]===237&&(r[o+1]&224)===160)return!1;o+=3}else if((r[o]&248)===240){if(o+3>=e||(r[o+1]&192)!==128||(r[o+2]&192)!==128||(r[o+3]&192)!==128||r[o]===240&&(r[o+1]&240)===128||r[o]===244&&r[o+1]>143||r[o]>244)return!1;o+=4}else return!1;return!0}function Ex(r){return vx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Cn.exports={isBlob:Ex,isValidStatusCode:Cx,isValidUTF8:mr,tokenChars:Sx};if(wi)Cn.exports.isValidUTF8=function(r){return r.length<24?mr(r):wi(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=X("utf-8-validate");Cn.exports.isValidUTF8=function(e){return e.length<32?mr(e):r(e)}}catch{}});var vr=ae((Zd,Ai)=>{"use strict";var{Writable:Ax}=X("stream"),bi=ht(),{BINARY_TYPES:Dx,EMPTY_BUFFER:yi,kStatusCode:Lx,kWebSocket:Px}=Re(),{concat:_r,toArrayBuffer:kx,unmask:Tx}=kt(),{isValidStatusCode:Ix,isValidUTF8:vi}=gt(),En=Buffer[Symbol.species],ge=0,Si=1,Ci=2,Ei=3,wr=4,br=5,An=6,yr=class extends Ax{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Dx[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Px]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=ge}_write(e,o,a){if(this._opcode===8&&this._state==ge)return a();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(a)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let a=this._buffers[0];return this._buffers[0]=new En(a.buffer,a.byteOffset+e,a.length-e),new En(a.buffer,a.byteOffset,e)}let o=Buffer.allocUnsafe(e);do{let a=this._buffers[0],c=o.length-e;e>=a.length?o.set(this._buffers.shift(),c):(o.set(new Uint8Array(a.buffer,a.byteOffset,e),c),this._buffers[0]=new En(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return o}startLoop(e){this._loop=!0;do switch(this._state){case ge:this.getInfo(e);break;case Si:this.getPayloadLength16(e);break;case Ci:this.getPayloadLength64(e);break;case Ei:this.getMask();break;case wr:this.getData(e);break;case br:case An:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let o=this.consume(2);if((o[0]&48)!==0){let c=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(c);return}let a=(o[0]&64)===64;if(a&&!this._extensions[bi.extensionName]){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(this._fin=(o[0]&128)===128,this._opcode=o[0]&15,this._payloadLength=o[1]&127,this._opcode===0){if(a){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(!this._fragmented){let c=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(c);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let c=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(c);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let c=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(c);return}if(a){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let c=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(c);return}}else{let c=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(c);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(o[1]&128)===128,this._isServer){if(!this._masked){let c=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(c);return}}else if(this._masked){let c=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(c);return}this._payloadLength===126?this._state=Si:this._payloadLength===127?this._state=Ci:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let o=this.consume(8),a=o.readUInt32BE(0);if(a>Math.pow(2,21)-1){let c=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(c);return}this._payloadLength=a*Math.pow(2,32)+o.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(o);return}this._masked?this._state=Ei:this._state=wr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=wr}getData(e){let o=yi;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}o=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Tx(o,this._mask)}if(this._opcode>7){this.controlMessage(o,e);return}if(this._compressed){this._state=br,this.decompress(o,e);return}o.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(o)),this.dataMessage(e)}decompress(e,o){this._extensions[bi.extensionName].decompress(e,this._fin,(c,u)=>{if(c)return o(c);if(u.length){if(this._messageLength+=u.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let l=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");o(l);return}this._fragments.push(u)}this.dataMessage(o),this._state===ge&&this.startLoop(o)})}dataMessage(e){if(!this._fin){this._state=ge;return}let o=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let c;this._binaryType==="nodebuffer"?c=_r(a,o):this._binaryType==="arraybuffer"?c=kx(_r(a,o)):this._binaryType==="blob"?c=new Blob(a):c=a,this._allowSynchronousEvents?(this.emit("message",c,!0),this._state=ge):(this._state=An,setImmediate(()=>{this.emit("message",c,!0),this._state=ge,this.startLoop(e)}))}else{let c=_r(a,o);if(!this._skipUTF8Validation&&!vi(c)){let u=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(u);return}this._state===br||this._allowSynchronousEvents?(this.emit("message",c,!1),this._state=ge):(this._state=An,setImmediate(()=>{this.emit("message",c,!1),this._state=ge,this.startLoop(e)}))}}controlMessage(e,o){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,yi),this.end();else{let a=e.readUInt16BE(0);if(!Ix(a)){let u=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");o(u);return}let c=new En(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!vi(c)){let u=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");o(u);return}this._loop=!1,this.emit("conclude",a,c),this.end()}this._state=ge;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ge):(this._state=An,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ge,this.startLoop(o)}))}createError(e,o,a,c,u){this._loop=!1,this._errored=!0;let l=new e(a?`Invalid WebSocket frame: ${o}`:o);return Error.captureStackTrace(l,this.createError),l.code=u,l[Lx]=c,l}};Ai.exports=yr});var Er=ae((Qd,Pi)=>{"use strict";var{Duplex:$d}=X("stream"),{randomFillSync:Nx}=X("crypto"),Di=ht(),{EMPTY_BUFFER:Rx,kWebSocket:Mx,NOOP:Ox}=Re(),{isBlob:pt,isValidStatusCode:Bx}=gt(),{mask:Li,toBuffer:Ye}=kt(),pe=Symbol("kByteLength"),zx=Buffer.alloc(4),Dn=8*1024,Ze,mt=Dn,we=0,qx=1,Ux=2,Sr=class r{constructor(e,o,a){this._extensions=o||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=we,this.onerror=Ox,this[Mx]=void 0}static frame(e,o){let a,c=!1,u=2,l=!1;o.mask&&(a=o.maskBuffer||zx,o.generateMask?o.generateMask(a):(mt===Dn&&(Ze===void 0&&(Ze=Buffer.alloc(Dn)),Nx(Ze,0,Dn),mt=0),a[0]=Ze[mt++],a[1]=Ze[mt++],a[2]=Ze[mt++],a[3]=Ze[mt++]),l=(a[0]|a[1]|a[2]|a[3])===0,u=6);let p;typeof e=="string"?(!o.mask||l)&&o[pe]!==void 0?p=o[pe]:(e=Buffer.from(e),p=e.length):(p=e.length,c=o.mask&&o.readOnly&&!l);let m=p;p>=65536?(u+=8,m=127):p>125&&(u+=2,m=126);let b=Buffer.allocUnsafe(c?p+u:u);return b[0]=o.fin?o.opcode|128:o.opcode,o.rsv1&&(b[0]|=64),b[1]=m,m===126?b.writeUInt16BE(p,2):m===127&&(b[2]=b[3]=0,b.writeUIntBE(p,4,6)),o.mask?(b[1]|=128,b[u-4]=a[0],b[u-3]=a[1],b[u-2]=a[2],b[u-1]=a[3],l?[b,e]:c?(Li(e,a,b,u,p),[b]):(Li(e,a,e,0,p),[b,e])):[b,e]}close(e,o,a,c){let u;if(e===void 0)u=Rx;else{if(typeof e!="number"||!Bx(e))throw new TypeError("First argument must be a valid error code number");if(o===void 0||!o.length)u=Buffer.allocUnsafe(2),u.writeUInt16BE(e,0);else{let p=Buffer.byteLength(o);if(p>123)throw new RangeError("The message must not be greater than 123 bytes");u=Buffer.allocUnsafe(2+p),u.writeUInt16BE(e,0),typeof o=="string"?u.write(o,2):u.set(o,2)}}let l={[pe]:u.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==we?this.enqueue([this.dispatch,u,!1,l,c]):this.sendFrame(r.frame(u,l),c)}ping(e,o,a){let c,u;if(typeof e=="string"?(c=Buffer.byteLength(e),u=!1):pt(e)?(c=e.size,u=!1):(e=Ye(e),c=e.length,u=Ye.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[pe]:c,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:9,readOnly:u,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,l,a]):this.getBlobData(e,!1,l,a):this._state!==we?this.enqueue([this.dispatch,e,!1,l,a]):this.sendFrame(r.frame(e,l),a)}pong(e,o,a){let c,u;if(typeof e=="string"?(c=Buffer.byteLength(e),u=!1):pt(e)?(c=e.size,u=!1):(e=Ye(e),c=e.length,u=Ye.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[pe]:c,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:10,readOnly:u,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,l,a]):this.getBlobData(e,!1,l,a):this._state!==we?this.enqueue([this.dispatch,e,!1,l,a]):this.sendFrame(r.frame(e,l),a)}send(e,o,a){let c=this._extensions[Di.extensionName],u=o.binary?2:1,l=o.compress,p,m;typeof e=="string"?(p=Buffer.byteLength(e),m=!1):pt(e)?(p=e.size,m=!1):(e=Ye(e),p=e.length,m=Ye.readOnly),this._firstFragment?(this._firstFragment=!1,l&&c&&c.params[c._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(l=p>=c._threshold),this._compress=l):(l=!1,u=0),o.fin&&(this._firstFragment=!0);let b={[pe]:p,fin:o.fin,generateMask:this._generateMask,mask:o.mask,maskBuffer:this._maskBuffer,opcode:u,readOnly:m,rsv1:l};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,this._compress,b,a]):this.getBlobData(e,this._compress,b,a):this._state!==we?this.enqueue([this.dispatch,e,this._compress,b,a]):this.dispatch(e,this._compress,b,a)}getBlobData(e,o,a,c){this._bufferedBytes+=a[pe],this._state=Ux,e.arrayBuffer().then(u=>{if(this._socket.destroyed){let p=new Error("The socket was closed while the blob was being read");process.nextTick(Cr,this,p,c);return}this._bufferedBytes-=a[pe];let l=Ye(u);o?this.dispatch(l,o,a,c):(this._state=we,this.sendFrame(r.frame(l,a),c),this.dequeue())}).catch(u=>{process.nextTick(Fx,this,u,c)})}dispatch(e,o,a,c){if(!o){this.sendFrame(r.frame(e,a),c);return}let u=this._extensions[Di.extensionName];this._bufferedBytes+=a[pe],this._state=qx,u.compress(e,a.fin,(l,p)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Cr(this,m,c);return}this._bufferedBytes-=a[pe],this._state=we,a.readOnly=!1,this.sendFrame(r.frame(p,a),c),this.dequeue()})}dequeue(){for(;this._state===we&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][pe],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][pe],this._queue.push(e)}sendFrame(e,o){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],o),this._socket.uncork()):this._socket.write(e[0],o)}};Pi.exports=Sr;function Cr(r,e,o){typeof o=="function"&&o(e);for(let a=0;a<r._queue.length;a++){let c=r._queue[a],u=c[c.length-1];typeof u=="function"&&u(e)}}function Fx(r,e,o){Cr(r,e,o),r.onerror(e)}});var zi=ae((el,Bi)=>{"use strict";var{kForOnEventAttribute:It,kListener:Ar}=Re(),ki=Symbol("kCode"),Ti=Symbol("kData"),Ii=Symbol("kError"),Ni=Symbol("kMessage"),Ri=Symbol("kReason"),_t=Symbol("kTarget"),Mi=Symbol("kType"),Oi=Symbol("kWasClean"),Oe=class{constructor(e){this[_t]=null,this[Mi]=e}get target(){return this[_t]}get type(){return this[Mi]}};Object.defineProperty(Oe.prototype,"target",{enumerable:!0});Object.defineProperty(Oe.prototype,"type",{enumerable:!0});var $e=class extends Oe{constructor(e,o={}){super(e),this[ki]=o.code===void 0?0:o.code,this[Ri]=o.reason===void 0?"":o.reason,this[Oi]=o.wasClean===void 0?!1:o.wasClean}get code(){return this[ki]}get reason(){return this[Ri]}get wasClean(){return this[Oi]}};Object.defineProperty($e.prototype,"code",{enumerable:!0});Object.defineProperty($e.prototype,"reason",{enumerable:!0});Object.defineProperty($e.prototype,"wasClean",{enumerable:!0});var wt=class extends Oe{constructor(e,o={}){super(e),this[Ii]=o.error===void 0?null:o.error,this[Ni]=o.message===void 0?"":o.message}get error(){return this[Ii]}get message(){return this[Ni]}};Object.defineProperty(wt.prototype,"error",{enumerable:!0});Object.defineProperty(wt.prototype,"message",{enumerable:!0});var Nt=class extends Oe{constructor(e,o={}){super(e),this[Ti]=o.data===void 0?null:o.data}get data(){return this[Ti]}};Object.defineProperty(Nt.prototype,"data",{enumerable:!0});var Kx={addEventListener(r,e,o={}){for(let c of this.listeners(r))if(!o[It]&&c[Ar]===e&&!c[It])return;let a;if(r==="message")a=function(u,l){let p=new Nt("message",{data:l?u:u.toString()});p[_t]=this,Ln(e,this,p)};else if(r==="close")a=function(u,l){let p=new $e("close",{code:u,reason:l.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});p[_t]=this,Ln(e,this,p)};else if(r==="error")a=function(u){let l=new wt("error",{error:u,message:u.message});l[_t]=this,Ln(e,this,l)};else if(r==="open")a=function(){let u=new Oe("open");u[_t]=this,Ln(e,this,u)};else return;a[It]=!!o[It],a[Ar]=e,o.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let o of this.listeners(r))if(o[Ar]===e&&!o[It]){this.removeListener(r,o);break}}};Bi.exports={CloseEvent:$e,ErrorEvent:wt,Event:Oe,EventTarget:Kx,MessageEvent:Nt};function Ln(r,e,o){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,o):r.call(e,o)}});var Pn=ae((tl,qi)=>{"use strict";var{tokenChars:Rt}=gt();function Ee(r,e,o){r[e]===void 0?r[e]=[o]:r[e].push(o)}function Hx(r){let e=Object.create(null),o=Object.create(null),a=!1,c=!1,u=!1,l,p,m=-1,b=-1,w=-1,y=0;for(;y<r.length;y++)if(b=r.charCodeAt(y),l===void 0)if(w===-1&&Rt[b]===1)m===-1&&(m=y);else if(y!==0&&(b===32||b===9))w===-1&&m!==-1&&(w=y);else if(b===59||b===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y);let T=r.slice(m,w);b===44?(Ee(e,T,o),o=Object.create(null)):l=T,m=w=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(p===void 0)if(w===-1&&Rt[b]===1)m===-1&&(m=y);else if(b===32||b===9)w===-1&&m!==-1&&(w=y);else if(b===59||b===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y),Ee(o,r.slice(m,w),!0),b===44&&(Ee(e,l,o),o=Object.create(null),l=void 0),m=w=-1}else if(b===61&&m!==-1&&w===-1)p=r.slice(m,y),m=w=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(c){if(Rt[b]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);m===-1?m=y:a||(a=!0),c=!1}else if(u)if(Rt[b]===1)m===-1&&(m=y);else if(b===34&&m!==-1)u=!1,w=y;else if(b===92)c=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(b===34&&r.charCodeAt(y-1)===61)u=!0;else if(w===-1&&Rt[b]===1)m===-1&&(m=y);else if(m!==-1&&(b===32||b===9))w===-1&&(w=y);else if(b===59||b===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y);let T=r.slice(m,w);a&&(T=T.replace(/\\/g,""),a=!1),Ee(o,p,T),b===44&&(Ee(e,l,o),o=Object.create(null),l=void 0),p=void 0,m=w=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(m===-1||u||b===32||b===9)throw new SyntaxError("Unexpected end of input");w===-1&&(w=y);let E=r.slice(m,w);return l===void 0?Ee(e,E,o):(p===void 0?Ee(o,E,!0):a?Ee(o,p,E.replace(/\\/g,"")):Ee(o,p,E),Ee(e,l,o)),e}function Wx(r){return Object.keys(r).map(e=>{let o=r[e];return Array.isArray(o)||(o=[o]),o.map(a=>[e].concat(Object.keys(a).map(c=>{let u=a[c];return Array.isArray(u)||(u=[u]),u.map(l=>l===!0?c:`${c}=${l}`).join("; ")})).join("; ")).join(", ")}).join(", ")}qi.exports={format:Wx,parse:Hx}});var Nn=ae((sl,Zi)=>{"use strict";var jx=X("events"),Gx=X("https"),Jx=X("http"),Ki=X("net"),Xx=X("tls"),{randomBytes:Vx,createHash:Yx}=X("crypto"),{Duplex:nl,Readable:rl}=X("stream"),{URL:Dr}=X("url"),We=ht(),Zx=vr(),$x=Er(),{isBlob:Qx}=gt(),{BINARY_TYPES:Ui,CLOSE_TIMEOUT:ec,EMPTY_BUFFER:kn,GUID:tc,kForOnEventAttribute:Lr,kListener:nc,kStatusCode:rc,kWebSocket:Q,NOOP:Hi}=Re(),{EventTarget:{addEventListener:sc,removeEventListener:ic}}=zi(),{format:oc,parse:ac}=Pn(),{toBuffer:xc}=kt(),Wi=Symbol("kAborted"),Pr=[8,13],Be=["CONNECTING","OPEN","CLOSING","CLOSED"],cc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,q=class r extends jx{constructor(e,o,a){super(),this._binaryType=Ui[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=kn,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,o===void 0?o=[]:Array.isArray(o)||(typeof o=="object"&&o!==null?(a=o,o=[]):o=[o]),ji(this,e,o,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ui.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,o,a){let c=new Zx({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),u=new $x(e,this._extensions,a.generateMask);this._receiver=c,this._sender=u,this._socket=e,c[Q]=this,u[Q]=this,e[Q]=this,c.on("conclude",dc),c.on("drain",lc),c.on("error",hc),c.on("message",gc),c.on("ping",pc),c.on("pong",mc),u.onerror=_c,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),o.length>0&&e.unshift(o),e.on("close",Xi),e.on("data",In),e.on("end",Vi),e.on("error",Yi),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[We.extensionName]&&this._extensions[We.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,o){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,o,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Ji(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){kr(this,e,a);return}o===void 0&&(o=!this._isServer),this._sender.ping(e||kn,o,a)}pong(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){kr(this,e,a);return}o===void 0&&(o=!this._isServer),this._sender.pong(e||kn,o,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof o=="function"&&(a=o,o={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){kr(this,e,a);return}let c={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...o};this._extensions[We.extensionName]||(c.compress=!1),this._sender.send(e||kn,c,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(q,"CONNECTING",{enumerable:!0,value:Be.indexOf("CONNECTING")});Object.defineProperty(q.prototype,"CONNECTING",{enumerable:!0,value:Be.indexOf("CONNECTING")});Object.defineProperty(q,"OPEN",{enumerable:!0,value:Be.indexOf("OPEN")});Object.defineProperty(q.prototype,"OPEN",{enumerable:!0,value:Be.indexOf("OPEN")});Object.defineProperty(q,"CLOSING",{enumerable:!0,value:Be.indexOf("CLOSING")});Object.defineProperty(q.prototype,"CLOSING",{enumerable:!0,value:Be.indexOf("CLOSING")});Object.defineProperty(q,"CLOSED",{enumerable:!0,value:Be.indexOf("CLOSED")});Object.defineProperty(q.prototype,"CLOSED",{enumerable:!0,value:Be.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(q.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(q.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Lr])return e[nc];return null},set(e){for(let o of this.listeners(r))if(o[Lr]){this.removeListener(r,o);break}typeof e=="function"&&this.addEventListener(r,e,{[Lr]:!0})}})});q.prototype.addEventListener=sc;q.prototype.removeEventListener=ic;Zi.exports=q;function ji(r,e,o,a){let c={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ec,protocolVersion:Pr[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=c.autoPong,r._closeTimeout=c.closeTimeout,!Pr.includes(c.protocolVersion))throw new RangeError(`Unsupported protocol version: ${c.protocolVersion} (supported versions: ${Pr.join(", ")})`);let u;if(e instanceof Dr)u=e;else try{u=new Dr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}u.protocol==="http:"?u.protocol="ws:":u.protocol==="https:"&&(u.protocol="wss:"),r._url=u.href;let l=u.protocol==="wss:",p=u.protocol==="ws+unix:",m;if(u.protocol!=="ws:"&&!l&&!p?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:p&&!u.pathname?m="The URL's pathname is empty":u.hash&&(m="The URL contains a fragment identifier"),m){let N=new SyntaxError(m);if(r._redirects===0)throw N;Tn(r,N);return}let b=l?443:80,w=Vx(16).toString("base64"),y=l?Gx.request:Jx.request,E=new Set,T;if(c.createConnection=c.createConnection||(l?fc:uc),c.defaultPort=c.defaultPort||b,c.port=u.port||b,c.host=u.hostname.startsWith("[")?u.hostname.slice(1,-1):u.hostname,c.headers={...c.headers,"Sec-WebSocket-Version":c.protocolVersion,"Sec-WebSocket-Key":w,Connection:"Upgrade",Upgrade:"websocket"},c.path=u.pathname+u.search,c.timeout=c.handshakeTimeout,c.perMessageDeflate&&(T=new We({...c.perMessageDeflate,isServer:!1,maxPayload:c.maxPayload}),c.headers["Sec-WebSocket-Extensions"]=oc({[We.extensionName]:T.offer()})),o.length){for(let N of o){if(typeof N!="string"||!cc.test(N)||E.has(N))throw new SyntaxError("An invalid or duplicated subprotocol was specified");E.add(N)}c.headers["Sec-WebSocket-Protocol"]=o.join(",")}if(c.origin&&(c.protocolVersion<13?c.headers["Sec-WebSocket-Origin"]=c.origin:c.headers.Origin=c.origin),(u.username||u.password)&&(c.auth=`${u.username}:${u.password}`),p){let N=c.path.split(":");c.socketPath=N[0],c.path=N[1]}let k;if(c.followRedirects){if(r._redirects===0){r._originalIpc=p,r._originalSecure=l,r._originalHostOrSocketPath=p?c.socketPath:u.host;let N=a&&a.headers;if(a={...a,headers:{}},N)for(let[G,oe]of Object.entries(N))a.headers[G.toLowerCase()]=oe}else if(r.listenerCount("redirect")===0){let N=p?r._originalIpc?c.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:u.host===r._originalHostOrSocketPath;(!N||r._originalSecure&&!l)&&(delete c.headers.authorization,delete c.headers.cookie,N||delete c.headers.host,c.auth=void 0)}c.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(c.auth).toString("base64")),k=r._req=y(c),r._redirects&&r.emit("redirect",r.url,k)}else k=r._req=y(c);c.timeout&&k.on("timeout",()=>{fe(r,k,"Opening handshake has timed out")}),k.on("error",N=>{k===null||k[Wi]||(k=r._req=null,Tn(r,N))}),k.on("response",N=>{let G=N.headers.location,oe=N.statusCode;if(G&&c.followRedirects&&oe>=300&&oe<400){if(++r._redirects>c.maxRedirects){fe(r,k,"Maximum redirects exceeded");return}k.abort();let ce;try{ce=new Dr(G,e)}catch{let H=new SyntaxError(`Invalid URL: ${G}`);Tn(r,H);return}ji(r,ce,o,a)}else r.emit("unexpected-response",k,N)||fe(r,k,`Unexpected server response: ${N.statusCode}`)}),k.on("upgrade",(N,G,oe)=>{if(r.emit("upgrade",N),r.readyState!==q.CONNECTING)return;k=r._req=null;let ce=N.headers.upgrade;if(ce===void 0||ce.toLowerCase()!=="websocket"){fe(r,G,"Invalid Upgrade header");return}let I=Yx("sha1").update(w+tc).digest("base64");if(N.headers["sec-websocket-accept"]!==I){fe(r,G,"Invalid Sec-WebSocket-Accept header");return}let H=N.headers["sec-websocket-protocol"],J;if(H!==void 0?E.size?E.has(H)||(J="Server sent an invalid subprotocol"):J="Server sent a subprotocol but none was requested":E.size&&(J="Server sent no subprotocol"),J){fe(r,G,J);return}H&&(r._protocol=H);let Ae=N.headers["sec-websocket-extensions"];if(Ae!==void 0){if(!T){fe(r,G,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ze;try{ze=ac(Ae)}catch{fe(r,G,"Invalid Sec-WebSocket-Extensions header");return}let be=Object.keys(ze);if(be.length!==1||be[0]!==We.extensionName){fe(r,G,"Server indicated an extension that was not requested");return}try{T.accept(ze[We.extensionName])}catch{fe(r,G,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[We.extensionName]=T}r.setSocket(G,oe,{allowSynchronousEvents:c.allowSynchronousEvents,generateMask:c.generateMask,maxPayload:c.maxPayload,skipUTF8Validation:c.skipUTF8Validation})}),c.finishRequest?c.finishRequest(k,r):k.end()}function Tn(r,e){r._readyState=q.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function uc(r){return r.path=r.socketPath,Ki.connect(r)}function fc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Ki.isIP(r.host)?"":r.host),Xx.connect(r)}function fe(r,e,o){r._readyState=q.CLOSING;let a=new Error(o);Error.captureStackTrace(a,fe),e.setHeader?(e[Wi]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Tn,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function kr(r,e,o){if(e){let a=Qx(e)?e.size:xc(e).length;r._socket?r._sender._bufferedBytes+=a:r._bufferedAmount+=a}if(o){let a=new Error(`WebSocket is not open: readyState ${r.readyState} (${Be[r.readyState]})`);process.nextTick(o,a)}}function dc(r,e){let o=this[Q];o._closeFrameReceived=!0,o._closeMessage=e,o._closeCode=r,o._socket[Q]!==void 0&&(o._socket.removeListener("data",In),process.nextTick(Gi,o._socket),r===1005?o.close():o.close(r,e))}function lc(){let r=this[Q];r.isPaused||r._socket.resume()}function hc(r){let e=this[Q];e._socket[Q]!==void 0&&(e._socket.removeListener("data",In),process.nextTick(Gi,e._socket),e.close(r[rc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Fi(){this[Q].emitClose()}function gc(r,e){this[Q].emit("message",r,e)}function pc(r){let e=this[Q];e._autoPong&&e.pong(r,!this._isServer,Hi),e.emit("ping",r)}function mc(r){this[Q].emit("pong",r)}function Gi(r){r.resume()}function _c(r){let e=this[Q];e.readyState!==q.CLOSED&&(e.readyState===q.OPEN&&(e._readyState=q.CLOSING,Ji(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Ji(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function Xi(){let r=this[Q];if(this.removeListener("close",Xi),this.removeListener("data",In),this.removeListener("end",Vi),r._readyState=q.CLOSING,!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);r._receiver.write(e)}r._receiver.end(),this[Q]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Fi),r._receiver.on("finish",Fi))}function In(r){this[Q]._receiver.write(r)||this.pause()}function Vi(){let r=this[Q];r._readyState=q.CLOSING,r._receiver.end(),this.end()}function Yi(){let r=this[Q];this.removeListener("error",Yi),this.on("error",Hi),r&&(r._readyState=q.CLOSING,this.destroy())}});var to=ae((ol,eo)=>{"use strict";var il=Nn(),{Duplex:wc}=X("stream");function $i(r){r.emit("close")}function bc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Qi(r){this.removeListener("error",Qi),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function yc(r,e){let o=!0,a=new wc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(u,l){let p=!l&&a._readableState.objectMode?u.toString():u;a.push(p)||r.pause()}),r.once("error",function(u){a.destroyed||(o=!1,a.destroy(u))}),r.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(c,u){if(r.readyState===r.CLOSED){u(c),process.nextTick($i,a);return}let l=!1;r.once("error",function(m){l=!0,u(m)}),r.once("close",function(){l||u(c),process.nextTick($i,a)}),o&&r.terminate()},a._final=function(c){if(r.readyState===r.CONNECTING){r.once("open",function(){a._final(c)});return}r._socket!==null&&(r._socket._writableState.finished?(c(),a._readableState.endEmitted&&a.destroy()):(r._socket.once("finish",function(){c()}),r.close()))},a._read=function(){r.isPaused&&r.resume()},a._write=function(c,u,l){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(c,u,l)});return}r.send(c,l)},a.on("end",bc),a.on("error",Qi),a}eo.exports=yc});var Tr=ae((al,no)=>{"use strict";var{tokenChars:vc}=gt();function Sc(r){let e=new Set,o=-1,a=-1,c=0;for(c;c<r.length;c++){let l=r.charCodeAt(c);if(a===-1&&vc[l]===1)o===-1&&(o=c);else if(c!==0&&(l===32||l===9))a===-1&&o!==-1&&(a=c);else if(l===44){if(o===-1)throw new SyntaxError(`Unexpected character at index ${c}`);a===-1&&(a=c);let p=r.slice(o,a);if(e.has(p))throw new SyntaxError(`The "${p}" subprotocol is duplicated`);e.add(p),o=a=-1}else throw new SyntaxError(`Unexpected character at index ${c}`)}if(o===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let u=r.slice(o,c);if(e.has(u))throw new SyntaxError(`The "${u}" subprotocol is duplicated`);return e.add(u),e}no.exports={parse:Sc}});var co=ae((cl,xo)=>{"use strict";var Cc=X("events"),Rn=X("http"),{Duplex:xl}=X("stream"),{createHash:Ec}=X("crypto"),ro=Pn(),Qe=ht(),Ac=Tr(),Dc=Nn(),{CLOSE_TIMEOUT:Lc,GUID:Pc,kWebSocket:kc}=Re(),Tc=/^[+/0-9A-Za-z]{22}==$/,so=0,io=1,ao=2,Ir=class extends Cc{constructor(e,o){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Lc,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Dc,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Rn.createServer((a,c)=>{let u=Rn.STATUS_CODES[426];c.writeHead(426,{"Content-Length":u.length,"Content-Type":"text/plain"}),c.end(u)}),this._server.listen(e.port,e.host,e.backlog,o)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Ic(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(c,u,l)=>{this.handleUpgrade(c,u,l,a)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=so}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===ao){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Mt,this);return}if(e&&this.once("close",e),this._state!==io)if(this._state=io,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Mt,this):process.nextTick(Mt,this);else{let o=this._server;this._removeListeners(),this._removeListeners=this._server=null,o.close(()=>{Mt(this)})}}shouldHandle(e){if(this.options.path){let o=e.url.indexOf("?");if((o!==-1?e.url.slice(0,o):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,o,a,c){o.on("error",oo);let u=e.headers["sec-websocket-key"],l=e.headers.upgrade,p=+e.headers["sec-websocket-version"];if(e.method!=="GET"){et(this,e,o,405,"Invalid HTTP method");return}if(l===void 0||l.toLowerCase()!=="websocket"){et(this,e,o,400,"Invalid Upgrade header");return}if(u===void 0||!Tc.test(u)){et(this,e,o,400,"Missing or invalid Sec-WebSocket-Key header");return}if(p!==13&&p!==8){et(this,e,o,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Ot(o,400);return}let m=e.headers["sec-websocket-protocol"],b=new Set;if(m!==void 0)try{b=Ac.parse(m)}catch{et(this,e,o,400,"Invalid Sec-WebSocket-Protocol header");return}let w=e.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&w!==void 0){let E=new Qe({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let T=ro.parse(w);T[Qe.extensionName]&&(E.accept(T[Qe.extensionName]),y[Qe.extensionName]=E)}catch{et(this,e,o,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let E={origin:e.headers[`${p===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(E,(T,k,N,G)=>{if(!T)return Ot(o,k||401,N,G);this.completeUpgrade(y,u,b,e,o,a,c)});return}if(!this.options.verifyClient(E))return Ot(o,401)}this.completeUpgrade(y,u,b,e,o,a,c)}completeUpgrade(e,o,a,c,u,l,p){if(!u.readable||!u.writable)return u.destroy();if(u[kc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>so)return Ot(u,503);let b=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ec("sha1").update(o+Pc).digest("base64")}`],w=new this.options.WebSocket(null,void 0,this.options);if(a.size){let y=this.options.handleProtocols?this.options.handleProtocols(a,c):a.values().next().value;y&&(b.push(`Sec-WebSocket-Protocol: ${y}`),w._protocol=y)}if(e[Qe.extensionName]){let y=e[Qe.extensionName].params,E=ro.format({[Qe.extensionName]:[y]});b.push(`Sec-WebSocket-Extensions: ${E}`),w._extensions=e}this.emit("headers",b,c),u.write(b.concat(`\r
8
+ var L0=Object.create;var or=Object.defineProperty;var N0=Object.getOwnPropertyDescriptor;var O0=Object.getOwnPropertyNames;var B0=Object.getPrototypeOf,R0=Object.prototype.hasOwnProperty;var J=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Pe=(r,e)=>()=>(r&&(e=r(r=0)),e);var oe=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ws=(r,e)=>{for(var i in e)or(r,i,{get:e[i],enumerable:!0})},M0=(r,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let x of O0(e))!R0.call(r,x)&&x!==i&&or(r,x,{get:()=>e[x],enumerable:!(a=N0(e,x))||a.enumerable});return r};var Ie=(r,e,i)=>(i=r!=null?L0(B0(r)):{},M0(e||!r||!r.__esModule?or(i,"default",{value:r,enumerable:!0}):i,r));import{chmod as z0,mkdir as q0,readFile as F0,writeFile as U0}from"node:fs/promises";import{dirname as K0}from"node:path";async function Ft(r){try{let e=await F0(r,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function Ut(r,e,i){await q0(K0(r),{recursive:!0}),await U0(r,`${JSON.stringify(e,null,2)}
9
+ `,"utf8"),i?.mode!==void 0&&await z0(r,i.mode)}var ar=Pe(()=>{"use strict"});function bs(r){return Ht[_s]<=Ht[r]}function xr(r){ys={...r}}function Kt(r,e,i,a){if(Ht[r]<Ht[_s])return;let x=JSON.stringify({ts:new Date().toISOString(),level:r,module:e,msg:i,...ys,...a});r==="error"||r==="warn"?W0.write(`${x}
10
+ `):H0.write(`${x}
11
+ `)}function T(r){return{debug:(e,i)=>Kt("debug",r,e,i),info:(e,i)=>Kt("info",r,e,i),warn:(e,i)=>Kt("warn",r,e,i),error:(e,i)=>Kt("error",r,e,i),child:e=>T(`${r}.${e}`)}}var Ht,_s,H0,W0,ys,U=Pe(()=>{"use strict";Ht={debug:10,info:20,warn:30,error:40},_s=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),H0=process.stdout,W0=process.stderr,ys={}});import{homedir as j0}from"node:os";import{join as re}from"node:path";function H(r){let e=r??j0(),i=re(e,".coze"),a=re(i,"bridge"),x=re(a,"lib");return{cozeRoot:i,bridgeRoot:a,libDir:x,libEntry:re(x,"index.js"),pidFile:re(a,"bridge.pid"),portFile:re(a,"bridge.port"),tokenFile:re(a,"bridge.token"),logFile:re(a,"bridge.log"),installLock:re(a,"install.lock"),configFile:re(a,"config.json"),agentsRoot:re(i,"agents")}}function Te(r,e=H()){let i=re(e.agentsRoot,r);return{root:i,config:re(i,"config.json"),workspace:re(i,"workspace"),logs:re(i,"logs")}}var ce=Pe(()=>{"use strict"});var Gt={};ws(Gt,{AGENT_CONFIG_FILE_MODE:()=>Wt,enforceAgentConfigMode:()=>V0,loadAgentConfig:()=>ae,persistAgentSessions:()=>cr,persistAgentSkills:()=>jt,saveAgentConfig:()=>de});import{chmod as G0,stat as J0}from"node:fs/promises";function ae(r,e){return Ft(Te(r,e).config)}function de(r,e){return Ut(Te(r.agentId,e).config,r,{mode:Wt})}async function V0(r,e){if(process.platform==="win32")return;let i=Te(r,e).config;try{let a=await J0(i);if(!a.isFile())return;let x=a.mode&511;x!==Wt&&(await G0(i,Wt),vs.warn("agent config mode auto-corrected to 0600",{path:i,from:x.toString(8)}))}catch(a){if(a.code==="ENOENT")return;vs.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:i,err:String(a)})}}async function cr(r,e,i){let a=await ae(r,i);a&&(a.sessions=Object.fromEntries(e),await de(a,i))}async function jt(r,e,i){let a=await ae(r,i);a&&(a.skills=e,await de(a,i))}var vs,Wt,Ue=Pe(()=>{"use strict";ar();U();ce();vs=T("agent-config"),Wt=384});var oi=oe(N=>{"use strict";var S=O;function pn(){let r=["z29VC0i","zMXVB3i","tw9KDwXL","zw5JB2rLrNi","sNrZCfm","yMLUyxj5vhK","B25TzxnZywC","CM92AwrLige","rhnMCfG","BuLpuuq","qK1nuMS","Dfnmt3q","DgHLBG","BMrhBu4","Dg9cExrLCW","CuvrCLC","Eej5uMO","vw5PBxbSzw0","uxL0sLO","t3bLBKv2zw4","ANzbuLy","zwn0","yxrHlcbKyxq","y2XVC2uSihC","D2vhDKW","zg9Uzq","s1L4u2W","uMLuwvm","uLbdBha","y3jLyxrLt2i","B3nLza","vKTgyMu","yMfJA3vWigu","CMfTugfYyw0","BKPzs3y","BK1ZDvK","C3rLBMvYCW","CNzHBa","rxvpr0O","Bwf4uMv0CMK","Dhr6twW","C3jJ","CLvTyKm","B3bLBG","CMvZDwX0","zgvMAw5Luhi","zwjjDhu","BMvJDa","mxW1Fdr8mhW","AMLHCei","uKncqxm","y2j3qLO","BeHHBMrSzxi","BgvUz3rO","D0zNveW","rxzLBNq","BuPuEhi","swrABLm","m3WXFdr8mhW","AgfZt3DUuhi","zgf0yq","CMvZB2X2zq","wePwteC","q3D3EvK","yvjXCe4","AevYCM9Yrxy","uhrJswi","x3bPBMDqB24","DMfzv1e","DxrVuMvJB24","C3vIyxjYyxK","z2v0","x29UugfNzu4","x2nYzwf0zvm","tMjIEfO","yMfSrxzLBNq","zNjVBNrPzxi","y1vbz2K","qwrrsei","zhDWwNm","x2zVCM1HDeu","vKHyrKK","zw1PDa","s0rrv1a","yunVDxK","uvL0zeO","vxfrD08","x2XPC3rLBMu","CK5nDxK","q21jD2e","x3DZ","CNjVCK1LC3m","zLrYtMK","zMvY","x2LZtwLUAvC","s2fjzMG","AenbC1O","r2TTuu0","ChrVCG","Dgv4Dc9WBge","BhPqv1a","Axnby2TdBgu","ign1CNnVCIa","q3vZDg9Trxi","x2n1CNnVCK0","zxHWB3j0CW","vLnAC1a","zhLUteG","nZK1mdaXofjjwgfsCG","EuLvyuW","tev0tee","AefJA01LC3m","DgvZDa","CYbPBNn0yw4","AgvKtwf4uMu","z1rPBwvVDxq","C3bSAxq","ww9evxu","u29pEKm","CgrHAgu","y3vYC29Yx2y","s21cs1O","DKPHrMO","qvnzD0G","C3rYAw5NAwy","nxWZFdr8mhW","tuvtu0fhrv8","zKjvBNC","AwXSihvZzsa","yxbWBhK","vMPIC1y","BML0AwfSAxO","DhbizwfKzxi","DMnzthK","BMCGzMfPBgu","mti4vhn3tM1V","x2n1CNnVCKy","zM9Yy2u","ysbTDxn0igi","pxv0zI04","BMDLza","y2HLy2Tszwe","zfDXA3u","x3bHDgHlzxK","wuL1C00","DNbWqLa","zNDXs0i","z290r20","y3r4","v0TTCuC","t0Lzrxq","wgXevxm","D3jPDgvvAw4","wenUuK4","rwj6txy","Ew9tsxC","rfjHu1C","x3fVC0rc","r0XZuve","C2vUza","uvDKufi","z2vY","B25fCNjVCG","x21PBMLoyxy","tufyx1jfvfi","rvzcEMW","uNzqvNC","zgPKBKi","ANHTwgy","CMjcufK","yw1LoIa","sKXdAu4","x0vysvnu","y3vYC29YlNm","u21sAM0","rhPvB0W","BNvTyMvY","AeTTz0K","tKXiqM4","zLrsqLa","mhW4Fdv8nhW","DM5JEMm","EgHNruq","zw5JB2rPBMC","Bwv0Ag9K","EgLQuK4","CMfNzvn5BMm","A0HhAeq","v2vIu29JA2u","yLr4Euu","tKfusvzfx0u","BMP5sei","Ec1TC2CTy3u","ANnVA04","CgXLyxnLiha","uMPbsLy","DMzrtKK","yxnZAwDU","x1fVu01HBMe","ChvhENK","CKDjEei","ywDL","uu1Mu0y","zxj2AwnL","nhWYFdf8m3W","rgj4D0K","ww1dyNa","twfovKm","A2v5CW","uxvLDwu","DgLTzw91DcW","BwvZC2fNzq","Axb5q00","t2Dzsxu","u1z1uMO","DvzHswO","x2rPC3bHDgm","q3vZDg9Tq2W","rvjis2q","B3vUDa","BK51Cgi","DxbbDKO","vwjwq28","vvfovuS","AhnPEem","z0PtDKS","zw1hyvO","rgzrEgW","zKTYD2C","rxHUufi","s3DJu24","qvDtt0G","CwHktvC","q1DLz1e","zNjVBunOyxi","yNL0zu9MzNm","t1bftG","rgLUBMW","v2Hbv1a","x2HHBMrSzvi","qxzPzgS","uMDTs20","zMvWqwO","EMfuyNe","De1HBMfNzxi","zvHmtgu","zMfVufO","tMjnCM8","DeLK","rhjcwfa","q1vcD1u","CxHmsKC","sgzQru8","shf6ww4","DhzrzMW","C2vwvLa","vLbLzgS","ywnRpwzYB24","nhWYFdv8ma","sefcuei","AMvJDfn0B3i","AMfcCMq","Dxrjza","vgfiqvi","D0PHs3i","x3jLywr5q2W","wNvABxi","Dg9cExrLC0W","CvPMAfK","DxbKyxrLq3u","x3bPBMC","uMrVthm","ufrHEKK","DfHsweq","B2LUDfjLywm","vePKDeC","CMvHzhLtDge","nZqYodmXmhPXrMPTzG","mdaWmdaWmda","jMPZy2fSBgi","uwfgsuS","EKnwtLG","C2nYAxb0","wePqu2O","Cgf5Bg9Hzfq","CMvZzxrdB3u","A3vHDeC","EvjLy29UBMu","BNf2y0e","quXm","CgzkD20","vxP6rfK","yMXVy2TLza","swzMvwW","wLzhs3G","zvn2v2u","vujNA0y","zufJAW","lcbTyxGGCMu","zKjsvfa","yunAu2S","A05ZqNC","AvjVy0S","DNLyDgu","B3jL","CMvZzxruCMK","zNfbAwO","y2HnyxHuCMK","ywXty29Wzq","zw5HyMXLuw8","zsbHihn0CMK","Bhf1B3q","zKXiuu4","zxjFBxnNAwq","Dg9iyxnO","DKXwrNe","v3biwfi","B3jLtMfTzxm","suTMshm","x2LZv29YA2u","ExfSB3C","Bg93","n3WZFdr8nG","zgrjrcWGzgu","CNP3ueO","s0rOEvC","r0vLswC","BwLUzW","qLnkze4","DwneC1G","rvDuqwG","B25nzxnZywC","DgvmB2Djre4","r0joEg0","AgvHzgvYCW","tvHpC1y","zKTVAK8","wxbsueW","yxGGCMv0CMK","vMTgC1O","ChzcEfG","rMTNt2S","suvtx0vsuK8","s25duKi","wNvIrK4","zw5KCg9PBNq","zLzJzxK","EvfWCNu","C3vIC3rYAw4","q09otKvdveK","CgzHCNu","qxbhwMS","rKvkDwO","tMDuB24","sLzevvO","z2v0sxrLBq","zw50zwqGDhK","rg1zANC","CvjwuNG","Efrurw52","zxjFDhrS","ywr2yw5Jzq","CLLTuKW","DgLTzw91Da","su1oww0","rhvrwLm","B25tDgfYDfi","BwfUDwfSihi","zezptuO","BgjUBvu","C2v0sxrLBq","C2v0","uLjpuG","EgX3CMq","z2v0qwXSs2u","shDSDg0","zvfduxG","BM5Ly3q","Ec11C2uT","zwDgr0K","wvrVCMS","ywnOzwqSihC","mNWX","zwLhqKi","z2vjBMzVu3K","zvLkufO","vxLqvu0","Aw9U","x3nLCuLK","x2DLBMvYyxq","x2LUAxq","z2v0t3DUuhi","x29Ut3bLBG","rfL1ufu","qwnbsNi","CMfTzq","tgLZDgvUzxi","zxzACvG","surMBwy","zNLMt1u","yw5Nzq","ywrKq291BNq","AM9PBG","B2nRzxq","B25ozxr3B3i","zvvysNC","D3n1AvG","rNjVBNrPzxi","zKztAhO","uenZsfG","x3bPBMDmB3m","AM5yqwm","zMX1C2HfEha","zMLSzw5HBwu","zejwDxu","C0XeC2W","ug9bzeS","qxjyrgy","x2LUDgvYDMe","zw50","y2f0y2G","x29Uq2XVC2u","zxmGCMvHy2G","zNDZxZeUmc4","CgfNzxnOB3C","BwLZzq","zxq9DxrMltG","x3nLBMrby2S","y29UDgLUDwu","D0fxCK8","x3nVy2TLDa","zufYse4","C3rUDMm","Dg5sAe0","CgLUz19VBMm","C2vUzf9Hy2S","Aw47y2HHCNm","yNvMzMvYzwq","CM9YrxzLBNq","C1Hduxu","C2vYDMLJzq","shrPBgS","mxWZFdz8n3W","DMvUDa","B3DAtxe","B2PACwW","B1bpExq","BwvY","DxbNCMfKzw4","q1DpzKO","r3Dur2y","wvnLv3a","BMCGDxjSoIa","zxf1ywXZ","tgHsA1y","u0D1CKy","whrhz1i","AMvzv2W","CNnVCKzPBgu","ywnOzwq","vLrUA08","y3fxEgG","y01Hvhy","wvr0y2y","EsbJBg9Zzwq","uhn5De8","ywnRtxnNswq","Bg9NsurozxC","CxLfzw8","wg5ns2y","t3fwt1e","CMvHzg9UBhK","vvDIsu0","Dezcww4","veLXuvK","ig1LC3nHz2u","CffTtuW","ihrPBwvZ","zcWGDw5RBM8","ruX6seC","AuTAyuS","wg5brKK","o2nOyxjZzxq","ru90A1i","CfnJDMq","DhHzzM8","vhLPzKC","uKjvA0W","vujqEuW","D3jnuMO","DwL3EvG","zurPzMK","ALPLD2K","shj2whu","C2vUDa","B3jTwxm","uxLNyKi","txHLA1K","Afv5EuG","ExffCKG","BgTSzgm","yMTcz1i","sNrAq1q","x2n1CNnVCK4","zxH0ugf5Bg8","z2v0u3rVCMe","sMf2B1a","zhbyCgm","ug9xzKC","vKDXAuC","CMTsreS","CNH3wgW","q09oveLovuu","tKDFrvjst1i","CKT1q04","twfrCLm","BwvZC2fNzv8","t0fJqMm","mdaWma","Ee9HyLK","x2HHBMrSzu8","B2zMC2v0","ywDLrxzLBNq","EwviDu8","EevlAeq","wvnbv0y","B2nRzxrtDwm","C3rVCMu","B3zeAvG","zNv5vMO","y3vYCMvUDeu","u2LqBLe","y29UBMvJDgK","B3zIwK8","B0Xytxy","CvPcANm","ChvZAa","EMHyyKS","tfbnswW","s0XbDe0","uMf4tLm","ug9wCey","z3bgt2i","tg9Nsuq","ChDOrK4","EhH0ywm","r25owMW","DMvYC2LVBMm","y3vYC29Y","zcbLCNjVCI4","CMvJzwL2zwq","t1PlswS","v2LUzg93","Dhn6B3u","DuvZDw8","AgHbEwi","y01xtvm","C3nju1q","EMzbDK0","y09Wzw4","wfnMAMy","AuDrEK0","AeTdzgS","y3jLyxrLuMu","zNjVBujPDhm","BMrWB2LUDfq","rNrzt24","CM92AwrLihC","uNvYr2y","Dhr3Awq","C2v0u3rVCMe","yM5Hu0q","AKXOthC","y3jLyxrLtwu","BNrLCG","Cg9PBNrdB24","y3jLyxrLt3a","v2Lmz08","ChjVy2vZCW","t3viBLO","txfIr2q","CM92AwrLigi","yu11thO","zNz5D2G","Be9UyKy","t3fWCxu","A2Tcvui","Eu1nC2S","ywzL","rxjYB3jdB2q","CMvWBgfJzq","Cw9Z","Bur2rwm","CgH3ANa","DxjS","vhDgDfK","Aw5L","zxjYtM8","y29UBMvJDa","CMvHzfvjBNq","DgLUzYbZzxi","y2XLyxi","twvZC2fNzuu","vw5Oyw5KBgu","CMvJB25Uzwm","A2v5","sNbuCwe","zMLN","tKLzwva","zufwAhK","C1PzEwC","qLDAqxe","qu1PuNm","AvzXv1e","wLHyv1i","z0Xvrgq","t0TnEMu","Dw5RBM93BIa","DhjPBq","yvzJq08","D3nZoI8V","surIC1i","AwDHDg9Yt24","AhL3C04","qKvpENe","zvfuBMS","zwrPyxrLBhK","sxP4DfK","Bff0yMG","zwvKzwq","yxrLq291BNq","mxWY","uNrQyve","DwvIvxK","y2vQBgW","AxnmB25N","ChjVDg90Exa","vvfcD3a","ChHhzKK","Bhj3zuO","q29Kzq","C2v0q3vYC28","ENPdEeO","su5Msfu","y2HHCKnVzgu","tKXLz08","rMvtz1i","CgvYC2LZDgu","Dev2zw50","ywrK","BunOrMK","AwrI","r0fVt1K","rKzmv1e","x2LZsw5PDa","ihzHBgLKihm","rM9fA3K","CgLUz1rPBwu","yM9KEq","y29TCgXLDgu","ihrYEsbYzwm","y2fLzhu","C2DPza","r0Hst0G","zfDVCMTLCKC","yxbWzw5Kq2G","DM9KrhG","sfbIwLu","AMDSze4","qNzAzu8","qMXwCKK","DM1TvhK","Befjr2K","BMDuAw1LCG","CYbHBhjLywq","sLPAqMq","uuf5Cxi","C2PAvgi","sg1AuNa","BNruCMLLC0m","sKHYsK4","ywnRDxbfBMq","uKzwvfu","Ae9Wzw5fDMu","x2LZtwLUAvq","AufvD1a","zv90Aw1LB3u","EgLnz2y","sLniquq","B3nLrxzLBNq","BNnwrxu","uxL0DMS","EevKu1e","zgvSzxrLrge","su5XyMK","tgDuBui","q0Xpu0ve","Ce5pDxi","DeLUDgvYy2u","ChLizfG","zxjYB3i","Bw5Jtxi","BM9cwfq","thHuzNG","CMfUzg9T","BwPgvMG","vuDLtvi","zxjYtxnN","y1rkr0m","ywDLsgLKzq","yNLL","CefbB2W","BgDrCu0","CLzHBhvLCW","EvDJuLi","u2vXsuq","suTOsfO","zvvYBa","t1bftL9fuLi","CgDSruS","zxrVD2O","BgLTAxq","ihbYB3rVy28","tKvRAe4","zxbkCha","AKrbtfm","Ef9MCM9UDgK","CvrMDMW","zMLUza","sw5KC1O","vxPNv1u","BIWGAg9ZDg4","A0rpAfm","r3LwrMW","tgT4qLu","suzxCvy","x3bYB3rVy28","Dg9cExrLC0i","q291BNq","Cuvbwhu","mZaWodG4owDPr1HVzG","DhDVCMTdAge","tMrPtKe","DgzVzvq","A3rWzey","yxv0BW","t2TdBfK","Eerlt0i","C2XPy2u","DMfSDwvZ","uhjxquO","B3jpBMXPBMu","tLLfD24","DwDjvKm","BeH6y3C","u0v6zvy","ywvPDKW","BezSDxnO","B25Uzwn0Aw4","ufHuwMG","B0fNt2K","vfD5A3K","qKLrvfC","uwrzrMy","q3vTB1i","y2vZC0HHBMq","ww9nqMS","zxrxB3jRq2G","C2HPzNq","zgvIDwC","C2vYDMvYvgK","tLDADuK","whbUzKG","C2v0zgi","Dg9mB3DLCKm","zwvTEw4","wufRywS","A3v3uM0","rwHuANK","DhjHBNnHy3q","BhnwyM4","vg1Utw4","z0XjwMm","CgLgBKu","B1bsAfm","zNnfrNO","BwvKAwf0zwW","qMfNt08","q0XTCMu","BgLUzq","y3jrsw8","thHjwva","tePYBfa","Aw9Ul2PZB24","DcbSAw1PDa","zurjvvG","u3DoAw4","B3bLCNr5","twzJu0C","zMrkExC","C2fNzq","tgHzEgW","uMPrB0y","wxDKEuy","sMDjzMK","sLnptLa","qNfotMO","zuLOuhC","z2vrDwv1zuW","x29UrxjYB3i","Cg9PBNrbBMq","t2jVCeS","yMLUza","Dhj1y3rVCIa","ihzHBgLKigq","Bwf4tg9ZC0m","vMHAqxG","BhDkrLe","wu5urMe","rhzkywO","ignVzgu6ia","su5tvefova","x29UvgLTzw8","vKr6C2W","DMHJtfu","Bgfpq2e","DMfS","qu5KAMu","zw5fDMvUDa","DMfSDwu","yxj0u3i","zKr2txe","nJCWnZmYoeLhzgzSta","y291BNq","r0fjr3y","x2TLEvbHDgG","zM9YrwfJAa","vwPKufe","DLfqzeC","Du9mtMq","mNWXFdv8mhW","zevpA2G","zMLSDgvY","x2rLC3rYB3K","ANbnEfm","l3DZl3yY","vKrHvLC","ywXSB2nvBNm","sM5Tue8","x2fKzfDZtgK","x3vYBa","qKjws0q","BgLUzw5V","zv9ZDwnJzxm","y3vZDg9Tshq","y2XVC2u","ExbL","tgTcq2e","DxrMofDYAxq","y2fSBa","rgfMCum","zMzmAw5L","uNfkzKO","wLPRqMK","x3DZsw5ZDge","qwXkC0K","v0fIqNC","rwLeC0W","CuHNrKK","Aw9UvgLTzw8","EhD4vwy","BffYCwi","ywXPzcb1CMW","s0veCKm","D2rhq0u","sNbHB1e","BeT5q1a","x2LUAxrhBg8","B3bLBKrc","ChrkBKu","z2TWshC","x2HHBMrSzva","AvPzyM8","DKnYzNm","A0HjuM8","CwzQqM4","tgnct1m","s2nbAxu","CgLUz0XVC3m","v0HUD3y","t0DnBe0","u1Dyq0K","CLrIv24","AxnAzxjV","B29bBLq","C3vJy2vZCW","yw1L","DNPOuLa","rKPiDKm","q0rYtLm","zM5pu0O","vu1Iv0q","DhLWzq","t0for2i","ENHJzfy","qvzLuui","DeP0ufG","y3vYC29Yx24","qufeDLO","sw14AgO","x2LZqNjVD3m","DuDJBMW","CMvXDwLYzwq","BMnVzgLUzW","zevUCuW","v3jdD1e","AhnmsNG","AujABum","C3DIq0q","B2XKvMvYC2K","vhPmEeC","y29UBMvJDca","ANHNEw4","De91wKO","C2f4ww0","tLfrvxe","Dg9tDhjPBMC","z25Qy0m","AwXLtMfTzq","y2HnyxHdB3u","zuLwrwy","qM9JDxe","zfHnqNi","s0LyywO","BhDPExC","wKDMtee","B25mAw5L","Dg9oDw1Izxi","CK1ftu4","qLvVCuO","D05XBfa","sgPUC3y","CNrRBxa","ruXtuvO","CNnVCL9Uyw0","zhD2shC","ywXSzwqGBxu","x3DHAxq","AxmGDw5Kzwy","qwjVCNrfCNi","A2vqzwu","BMCGB3iGyw4","tKndv28","tNLgqwO","r0PqzLG","rwPYsfG","BMvLzf9Hy2S","y3jLyxrLrxi","Duz2B3G","EMjJC2q","y3vYCMvUDeK","y29UBMvJDeu","sKPXsfO","B25SAw5L","DKXzr0K","vhjWB1a","v0rirw8","ufzft2i","vgLTzw91Da","zgLZywjSzue","B01isxK","ywnRx2nVzgu","swXisfK","sKrOtM4","AhfIDue","yu9Xwvy","zw50tgLZDgu","rhrZAK0","C0Xf","BfjgC20","z2Drse4","q2LsqMG","y29Kzq","BM93","qw1VDw50","ndm4mJiZofnrv2jWsq","B25VCgvU","C29YDa","zfLPwLa","BxHxtKG","uhbmrhK","zhrRt1K","wxHqtfu","reTjsfG","DNnnzuC","CuPxu2i","BMnLq2XVC2u","y29UDgv4Da","C1P6rMq","Aw50zwDLCIa","x19LC01Vzhu","yM9L","AxnbCNjHEq","shD3swm","sNjQEKy","BM1hweO","yw51Ce1LC3m","ALb5ueW","Dw5KzwzPBMu","vvvdzKi","EMrLCK8","yxvpD1u","CMvKDwnL","y3vYDMfSDwu","twPovfu","q0Xpu0LorW","senlBvy","y05Msue","BgvY","CgfNzwHPzgu","uevVyw8","x2vUzhbVAw4","vxbKyxrLq28","ENHAvNm","C0DbEhe","uuP0rfi","BMrLEa","r25jq2G","zuLSww8","tKTvsKe","t2vOt2G","vMPMu3a","CNfsr2C","wwzKswW","qxvTuLG","A0nzr1O","DeThAe8","ywDLu2HVDW","qNjPzgDL","Dw50","tuzUEe0","vu5nrM4","DeDKEwq","yxKSihrYEsa","Bwu6ia","BM9Uzv9UB24","EuXdruS","C3rYAw5N","zhDdBem","BfDxEg4","wgzusMq","tNPID3G","ufH4ywu","yKvYBum","x3jLy29UBMu","C0jf","CgfYC2u","ChbL","D2nPtxG","ihrPBwvVDxq","AKL6C0S","D2n6r0C","B25szwnLAxy","EeDvs3K","CgLUz0LUDgu","B3bLBIa","AxnrB1nby2S","y3ruAw1LB3u","B2nRzxrgywK","qufMzvm","ref3thu","yKLNsK8","rfDZrNm","CMv0CNLdB3u","quDlz1O","B3vxwNu","CMvQzwn0","BwfW","x2LUAxrqCM8","z2u6ia","vKX3yNi","D3m6lY8","C2vYDMLJzs0","teL3tg8","tKXJEgG","z1jnANu","qunct0S","rNDssgW","wML2sfK","DhjPzxm","AfPOCeu","AxnFywnR","sNfrseW","BgjQC3e","x2nSzwfYugK","te9zBve","yxjYyxLIDwy","v3PSCvu","Bg9N","Cgf5Bg9Hza","AwXLx25HBwu","Bvzmr2S","D2DHvhO","CxzcBKe","sxDNv1m","y1L6v08","ywrKrxzLBNq","z2vtEw5J","sMvAz3O","q1fRsKu","Cg93","yw5ZzM9YBvq","DgLLCKPtt04","yK5RuLm","Aw5JBhvKzxm","s2vLzem","yNP5sNi","BeXjseO","rw1uvMu","CIb0DhDjra","tMr4Bu0","yNL0zuXLBMC","ve13CLm","rxDdA0O","CKD5AuO","DMvYC2LVBG","DNbUBwK","Bw5HrNa","x2nSzwfYvgK","ywXS","x29UtwvZC2e","Certrfq","A01ms20","zxjFAxnFywm","Cen4qwi","uw9qANa","BfztEw8","Evr4q3i","q2jPA2i","CwvPv0C","r1P6q0y","zMnpqwm","uMvHzcbWyxm","B2fK","ww1XB0W","zNvUy3rPB24","CKPhtgu","C25OAMq","D3P0A1K","zK9hvNG","Bvb3s2S","y3jLyxrLrwW","yuD6yLq","zxH0zw5ZAw8","BNrbBMrvCgq","zxDdDhG","x2rLyNvN","CML2qKK","EhPQAKG","z2v0q3vYC28","CgLUz09Uy2u","zgvSzxrL","C0nVDw50zxi","q2rTr00","BK5Tsg8","CMvHC29U","CMvWBgfJzui","zw51t0q","BNfjqLO","B2DwDfe","y2HLy2TdDxi","vgfN","AxjLza","A1n0yxr1C0m","lcbOB3n0BMe","u3rYyxrLz3K","x2rItMfTzq","thHVsfO","DhjPzxmGCMu","tg9NsurozxC","vNrrvg0","B25LCNjVCG","BwvZ","DMvY","BxnN","venPwvC","t01VDvm","BuDQuxe","rKfhwMi","tMfTzq","BuzgB2K","x21LC3nHz2u","q29UzMLN","ywTiEue","se9iyMe","tKXgCum","B1zpAMO","mxWZFdj8nhW","re9erwS","CuXqyLC","BgTqswC","zNjHBwvuExa","AgfUz2u","yw1Owxm","ze1Atxi","B2zMBgLUzq","D3jPDgu","wvLTuKG","y29UBMvJDfm","rLDt","DgHHBIbSB2m","C29Tzq","r0P1ru8","t2jQzwn0","B0HKsve","qKDrEvO","A3PiCLe","uuTZz0i","CMvUDevUzha","y2XLyxjtDg8","DMLJzuLeig8","Dgv4DfbHEwW","EfvZzuvUDG","B25tDg9Wsw0","BNbXtgK","zw5XDwv1zq","zNjVBuj5Dgu","Chv0","CwrmExm","Cg1Mu1e","yxbWBgLJyxq","zcWG","yw5Hz2vY","x3bYzwzPEa","DwP3t0e","A0rorfG","yxnL","C0fIq0m","u3Lzugy","uhjPBwfYEuS","AgfZ","uwPmCxu","A2zlwwC","AwTMD1G","v2rlufe","x25HDMLNyxq","ywrKt25L","yu9Wz3a","q0PLqKy","txH2wKS","yLLTy04","BwXRzK4","CLLTCMq","Dg9Y","oduXmti2uwD2DKPv","z1n5Buq","s01dvhK","B2jQzwn0u3q","tvvcrwy","v2vPEgLUsLm","seTNtwm","BeHbs1O","vMjQCNK","B25JBg9Zzq","thncwKG","q0T2tvK","sevWrei","ExnvDKm","nhWYFdb8mxW","q1bbwLe","AxnrB1nnzxm","DMT6zhu","A2v0ignVBNm","r3vJCKK","zwnVBM5Ly3q","C2v0y3vYC28","Bg5Ssw0","twLZC2LUzYa","AenSB3nLrxy","ENDLreO","x2rYB3bhBg8","yxKSig5LDhC","BhrPCgXLihq","zgLZCgf0y2G","svb0AK0","u01wtNe","tK9As1a","ChztENC","nhWZFdv8mhW","y3rSALq","Aw5Lza","Dgv4Dc9Qyxy","A29hvw8","CLbUEKq","s3nnqNu","igzPzwXKoIa","u1DyDLG","qKf4tfi","zNjVBu51Bwi","x2nVBM5Ly3q","twPKDhC","D24GCMvHC28","AwXK","ihjLy29UBMu","m3HIBwH5sW","C2XIAha","z2v0s2v5","AgTjrgG","z2v0qwXS","m3WXFdj8nhW","B3bLCNr5tMe","zxjHDg9Y","ywjVCNq","rgjYB20","se1kEue","y29Uy2f0","DgfYz2v0","z2fPtwO","x3jLBw92zvC","teD6wKy","vwv0Ehu","BMrWB2LUDca","Cgf5Bg9Hzeu","BfrPBwvVDxq","DKL5B3G","zwnUvvq","zxjFCw9Zx2e","C052v2e","u1nqCNy","r2DfteK","z2jUwg8","x29WDgLVBNm","x0rctMfTzq","A0DcCei","rvjst1i","rgLYC00","Dg9hzw5LCMe","ywWGy3vYC28","suXOzfC","vfPutfu","t2Ppwxq","uKvcwha","DMzerg8","zMvcuMq","qMrfvNq","z29PBMCGyxC","vLD6B2y","id4G","tMrRBMi","vK1vwgu","y2XVC2veqG","EvzSA1K","wxHfr0K","r0PlwMm","AhvVvNi","qujMCfq","CMvTB3zLrxy","yKn2vgq","u29otKG","CgjICdi","qLLky20","y3jLyxrLq2W","BMv3vMvYC2K","zgvS","B2zM","ChjVDg9JB2W","yNL0zxm","rxnhD2y","BxnNsuq","CfDSzge","rxvgEuK","x194x21Zz18","y29SBM8","qLvJwK8","rMLAtLu","C3bSAwnL","sKnjyuK","B3v0sw50zxi","rwL5Ewq","q3zKweO","AxnszwfKEq","uwPdueO","rMvxrfi","CwT6z08","rg1mCuy","mxWWFdv8m3W","DwXuAfG","D2fZq2XLyw4","qKLVr0u","C3nHz2vfDMu","ywX3yxLZ","terSCvu","y29UC3rYDwm","tLPcwhG","wLHfqKy","x2jPBMfYEvq","BMvY","sKDty3u","zNrJC0O","x2rPC2nVBM4","t2ryEK4","BM1qtLG","AgLNAa","vKn2ufi","DgLtv28","Cg9W","D0nTzLO","wffzDxG","y2PzyxO","BKfTBfi","Ae1LC3nHz2u","t1znt1y","Bezru1i","vgfXBNu","CNnVCL92ywW","t3fvDM8","D1Pdv0e","zK5Mr3O","Dvf3Ewq","Be1isKW","AgTRsLa","CMvZzxrfBMq","ChPMsge","mNWZFdf8nhW","Ag1ssNq","Aw5KzxGGB3u","EvbOtMu","BwvZC2fNztO","CNzHBfzHBhu","BKXPBMu","vevps08","s0PQt3m","te1Py3C","AuzKywm","zMzTt1K","twzxBvy","A3rhs28","BuzqDeG","BNrfBMrWB2K","yNvMzMvY","BeP1zeC","Dw5ZAwDUzwq","CLrnDhy","AKv4r2K","AgnTA0q","svv1BMO","zMzLCG","Aw5KzxHpzG","qMLlz1i","Dwzjz0K","igXHCMDLCIa","s21qzxq","tg9JAW","D2nmAgS","zgvJB2rLzey","qKLvzwi","D2LSBfjLy28","BLHnuuy","B3jRig9MzMW","CMLLC0nVDw4","D3zTuwC","mtyWmte5m1HpwwftzG","D0TdDvO","rMLWq3O","yKnMzhu","qKHqyvG","rNLSDe8","t0TfCLm","yw1Lu3bHy2u","v0DAvu8","D3PuCfK","wNnxBuy","vwPVvge","BfvSCwO","wLfZu2S","r2XzuhO","DKjur0C","DKHdvwO","AfHjuhO","z2v0q3vYCMu","BMfTzq","C0XPC3rLBMu"];return pn=function(){return r},pn()}(function(r,e){let i=O,a=r();for(;;)try{if(parseInt(i(925))/1*(parseInt(i(875))/2)+-parseInt(i(1082))/3+-parseInt(i(453))/4+-parseInt(i(1380))/5+-parseInt(i(1211))/6+-parseInt(i(606))/7+-parseInt(i(1238))/8*(-parseInt(i(361))/9)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(pn,978563);var Qa=Object.defineProperty,ex=Object[S(1494)+S(931)+S(803)],ti=(r,e)=>function(){return r&&(e=(0,r[{GAoOY:function(f,u){return f(u)}}[S(273)](ex,r)[0]])(r=0)),e},tx=(r,e)=>{let i={EroCp:function(x,f,u,h){return x(f,u,h)}};for(var a in e)i.EroCp(Qa,r,a,{get:e[a],enumerable:!0})};function nx(){return Xs||(Xs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function rx(){let r=S;return $s||($s=[IDBCursor[r(257)+"e"][r(1464)],IDBCursor[r(257)+"e"].continue,IDBCursor[r(257)+"e"][r(1531)+r(860)+"ey"]])}function sx(r){let e=S,i={ptJnE:"success",LkBCa:e(321),eQTnk:e(668),Hwltm:e(1202)+"in;chars"+e(1529),DdNxu:e(873),TmnMn:function(x){return x()},dwpZs:function(x,f){return x instanceof f}},a=new Promise((x,f)=>{let u=e,h={usgBJ:function(y,E){return y==E},Tzkjq:i[u(246)],TyifG:i[u(1478)],vnczc:i.DdNxu,mFvyO:function(y){return i[u(402)](y)}},p=()=>{let y=u;r[y(977)+y(597)+"ner"](i[y(500)],w),r[y(977)+y(597)+"ner"](i[y(478)],b)},w=()=>{x(Se(r[u(1147)])),p()},b=()=>{let y=u;if(h[y(1284)]!==y(308))f(r[y(321)]),h.mFvyO(p);else return h.usgBJ(h.Tzkjq,typeof _0x20aa1a)?h[y(1589)]:""};r[u(727)+u(1499)](u(516),w),r[u(727)+u(1499)](i[u(478)],b)});return a[e(1115)](x=>{let f=e;i[f(1182)](x,IDBCursor)&&hr[f(1474)](x,r)})[e(1523)](()=>{}),wn.set(a,r),a}function ix(r){let e=S,i={gnjcC:e(933),jxgyn:function(x){return x()},FyltO:function(x,f){return x(f)},xRolQ:e(570)+"or",dwvHw:e(280)};if(mn.has(r))return;let a=new Promise((x,f)=>{let u=e,h={jgldN:u(1331),jLhLw:function(y,E){return i[u(1087)](y,E)},YSeWp:i.xRolQ,WDHEo:function(y){return i[u(543)](y)}},p=()=>{let y=u;r["removeEv"+y(597)+y(1017)](y(280),w),r[y(977)+"entListener"]("error",b),r[y(977)+"entListener"](i[y(548)],b)},w=()=>{let y=u;i[y(543)](x),i[y(543)](p)},b=()=>{let y=u;if(h[y(289)]===h[y(289)])h[y(193)](f,r[y(321)]||new DOMException(h[y(1554)],y(570)+"or")),h[y(587)](p);else return this[y(1260)].clear()};r[u(727)+u(1499)](i[u(566)],w),r[u(727)+"Listener"](u(321),b),r[u(727)+u(1499)](u(933),b)});mn[e(1474)](r,a)}function ox(r){_n={RurGf:function(a,x){return a(x)}}[S(189)](r,_n)}function ax(r){let e=S,i={QoPjp:function(a,x){return a(x)},viWAI:function(a,x){return a===x},ugIVC:e(878)+"oreNames",AcAJr:function(a){return a()},yqErH:function(a,x){return a!==x},HfjEO:e(1429)};return i.viWAI(r,IDBDatabase.prototype["transact"+e(1490)])&&!(i[e(374)]in IDBTransaction.prototype)?function(a,...x){let f=e,u=r[f(480)](kt(this),a,...x);return lr[f(1474)](u,a.sort?a[f(608)]():[a]),Se(u)}:i[e(1497)](rx)[e(735)](r)?i[e(120)](i[e(1355)],i[e(1355)])?null:function(...a){let x=e;return r[x(1232)](i[x(756)](kt,this),a),Se(hr.get(this))}:function(...a){return i[e(756)](Se,r.apply(kt(this),a))}}function xx(r){let e=S,i={YoMBk:function(a,x){return a===x},lkPIg:e(766),wbNQd:function(a,x){return a(x)},JDhNn:function(a,x){return a instanceof x},ACBOK:function(a,x,f){return a(x,f)},emGaZ:function(a){return a()}};return i[e(387)](typeof r,i[e(821)])?i.wbNQd(ax,r):(i[e(594)](r,IDBTransaction)&&i.wbNQd(ix,r),i[e(707)](ni,r,i[e(1329)](nx))?new Proxy(r,_n):r)}function Se(r){let e=S;if(r instanceof IDBRequest)return sx(r);if(hn[e(861)](r))return hn.get(r);let i=xx(r);return i!==r&&(hn[e(1474)](r,i),wn[e(1474)](i,r)),i}var ni,Xs,$s,hr,mn,lr,hn,wn,_n,kt,Zs=ti({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={LxIYP:function(i,a,x){return i(a,x)},UApej:function(i,a){return i+a},lAIGi:r(321),ecnUT:function(i,a){return i===a},IMNYm:"sICJL",GwTGf:r(1128),hsixC:r(878)+"oreNames",sZYyg:r(148),wrMRj:r(650),wJaKr:function(i,a){return i(a)},mJTxr:function(i,a){return i===a},egFGI:r(596),xOabY:function(i,a){return i===a}};ni=(i,a)=>a[r(832)](x=>i instanceof x),hr=new WeakMap,mn=new WeakMap,lr=new WeakMap,hn=new WeakMap,wn=new WeakMap,_n={get(i,a,x){let f=r,u={lUlqj:function(h,p,w){return e[O(412)](h,p,w)},njyHB:function(h,p){return e.UApej(h,p)},dpXpc:e[f(293)]};if(e.ecnUT(e[f(1467)],e[f(1467)])){if(i instanceof IDBTransaction){if(e.ecnUT(a,e[f(1553)]))return mn[f(1174)](i);if(e.ecnUT(a,e[f(1327)]))return i[f(878)+"oreNames"]||lr[f(1174)](i);if(e.ecnUT(a,e[f(231)])){if(e[f(946)](e[f(1592)],e[f(1592)]))return x[f(878)+"oreNames"][1]?void 0:x[f(878)+f(1407)](x[f(878)+f(1420)][0]);{let h=u[f(1094)](_0x1fa2b5,_0x5eb83a,_0x462c77);return _0x48b306.bytes.subarray(h,u[f(1294)](h,_0x4cea87))}}}return e[f(1367)](Se,i[a])}else this[f(1185)](u[f(128)],u.lUlqj(_0x2f19c8,f(321),{message:this["_formatE"+f(1194)+"age"](_0x1d6330)}))},set(i,a,x){return i[a]=x,!0},has(i,a){let x=r;return e[x(1159)](e.egFGI,e[x(1482)])?i instanceof IDBTransaction&&(a===e[x(1553)]||e[x(140)](a,e[x(231)]))?!0:a in i:_0x2259ba.resolve()}},kt=i=>wn[r(1174)](i)}}),ri={};tx(ri,{deleteDB:()=>fx,openDB:()=>cx,unwrap:()=>kt,wrap:()=>Se});function cx(r,e,{blocked:i,upgrade:a,blocking:x,terminated:f}={}){let u=S,h={ZGfLA:function(b,y){return b(y)},gJSvK:"close",nRqQq:u(1551)+u(250),CRlyA:u(1395)},p=indexedDB.open(r,e),w=Se(p);return a&&p[u(727)+u(1499)](h.nRqQq,b=>{let y=u;a(h[y(556)](Se,p[y(1147)]),b[y(540)+"on"],b[y(983)+"on"],Se(p[y(400)+y(1490)]))}),i&&p["addEvent"+u(1499)](h.CRlyA,()=>i()),w.then(b=>{let y=u;f&&b[y(727)+y(1499)](h[y(1328)],()=>f()),x&&b[y(727)+"Listener"]("versionc"+y(823),()=>x())})[u(1523)](()=>{}),w}function O(r,e){r=r-114;let i=pn(),a=i[r];if(O.PHAiEX===void 0){var x=function(p){let w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",b="",y="";for(let E=0,P,I,L=0;I=p.charAt(L++);~I&&(P=E%4?P*64+I:I,E++%4)?b+=String.fromCharCode(255&P>>(-2*E&6)):0)I=w.indexOf(I);for(let E=0,P=b.length;E<P;E++)y+="%"+("00"+b.charCodeAt(E).toString(16)).slice(-2);return decodeURIComponent(y)};O.OvahYP=x,O.SwsrFY={},O.PHAiEX=!0}let f=i[0],u=r+f,h=O.SwsrFY[u];return h?a=h:(a=O.OvahYP(a),O.SwsrFY[u]=a),a}function fx(r,{blocked:e}={}){let i=S,a={BIoGE:"blocked",KsMBu:function(f,u){return f(u)}},x=indexedDB[i(314)+"tabase"](r);return e&&x[i(727)+i(1499)](a[i(1009)],()=>e()),a[i(915)](Se,x)[i(1115)](()=>{})}function Qs(r,e){let i=S,a={OdXzN:"readwrite",XnAFI:function(p,w){return p instanceof w},odkFm:function(p,w){return p===w},thCnz:i(668),jaBrd:function(p,w){return p!==w}};if(!(a[i(1584)](r,IDBDatabase)&&!(e in r)&&a.odkFm(typeof e,a.thCnz)))return;if(gn[i(1174)](e))return gn[i(1174)](e);let x=e[i(211)](/FromIndex$/,""),f=a[i(1364)](e,x),u=ii[i(735)](x);if(!(x in(f?IDBIndex:IDBObjectStore)[i(257)+"e"])||!(u||si.includes(x)))return;let h=async function(p,...w){let b=i,y=this[b(400)+"ion"](p,u?a[b(1021)]:b(1574)),E=y[b(148)];return f&&(E=E.index(w[b(389)]())),(await Promise[b(750)]([E[x](...w),u&&y[b(1128)]]))[0]};return gn[i(1474)](e,h),h}var si,ii,gn,ux=ti({"node_modules/idb/build/index.js"(){let r=S,e={kJtvp:r(909)+r(1485),fLHQN:r(848),rdgNu:r(270),eIlYo:r(782),vzhRP:r(222),Uetxu:function(x,f){return x(f)},FoEky:function(x){return x()},CKvMY:r(927),VHXFI:r(929),EuFyI:r(1477)+"ys",NIYYP:r(454)},i=e.kJtvp.split("|"),a=0;for(;;){switch(i[a++]){case"0":ii=[e[r(1415)],e.rdgNu,e[r(649)],e[r(518)]];continue;case"1":e[r(941)](ox,x=>({...x,get:(f,u,h)=>Qs(f,u)||x.get(f,u,h),has:(f,u)=>!!Qs(f,u)||x[r(861)](f,u)}));continue;case"2":gn=new Map;continue;case"3":e[r(277)](Zs);continue;case"4":Zs();continue;case"5":si=[r(1174),e[r(886)],e[r(1184)],e[r(991)],e[r(229)]];continue}break}}}),dx={idb:function(r){let e=S,i={PVEOb:function(a,x,f){return a(x,f)},WNheT:e(321),nmPNX:function(a,x){return a===x},qZfhY:"SoAoA",Cbikb:e(472)};r[e(1208)]=Promise[e(1164)]()[e(1115)](()=>(ux(),ri)).then(function(a){let x=e;if(i[x(1022)](i[x(1371)],i[x(759)])){let f=i[x(588)](_0x36fa86,i.WNheT,{message:_0x3dbb4a[x(1314)],code:_0xa6bcff.OPEN_ERROR,error:_0x5b8f10});this[x(1319)+"hErrorEvent"](f)}else return a})}},ei={};function ve(r){let e=S,i={brHoB:e(1161)+"2",GJPfX:function(h,p){return h!==p}},a=i.brHoB[e(1219)]("|"),x=0;for(;;){switch(a[x++]){case"0":dx[r](u,u[e(1208)],ve);continue;case"1":if(i[e(575)](void 0,f))return f.exports;continue;case"2":return u.exports;case"3":var f=ei[r];continue;case"4":var u=ei[r]={exports:{}};continue}break}}(()=>{let r=S,e={CelYR:function(i,a){return i!==a},dFOMJ:"bDEHH",sAbCC:r(1113)};ve.d=(i,a)=>{let x=r;if(e.CelYR(e[x(1471)],e[x(858)]))for(var f in a)ve.o(a,f)&&!ve.o(i,f)&&Object[x(1148)+x(418)](i,f,{enumerable:!0,get:a[f]});else _0x32b29a=_0x2e86a8[x(936)](_0x4ceb40),_0x2d0dd1=_0x1b801a[x(936)](_0x5503a6[_0x49f822])}})(),(()=>{let r=S;ve.o=(e,i)=>Object.prototype[r(1162)+r(418)][r(480)](e,i)})(),(()=>{let r=S,e={SiPnQ:function(i,a){return i instanceof a},bIgJO:r(851)+r(414),IlHHY:r(851)+"ion/json;charset"+r(1242),lJudG:"none_none",zbcsd:"binary",SmRjm:function(i,a){return i===a},amhYs:r(507),JavoP:function(i,a){return i!=a},GBNxm:r(629)+"d",LGLFu:r(1105)};ve.r=i=>{let a=r;if(e[a(1277)](e[a(824)],e[a(824)]))e[a(127)](e[a(1436)],typeof Symbol)&&Symbol[a(547)+"Tag"]&&Object[a(1148)+"operty"](i,Symbol[a(547)+a(792)],{value:e.LGLFu}),Object[a(1148)+"operty"](i,a(621)+"le",{value:!0});else{let x=e[a(152)](N[a(952)][a(943)+a(534)],_0x26f3b5)?{force:!!N._options[a(943)+a(534)].force,encoding:N._options[a(943)+"ncoding"].encoding?N[a(952)]["payloadE"+a(534)][a(1286)][a(211)](/\s/g,"")[a(395)+a(857)]():""}:{force:!1,encoding:N._options[a(943)+a(534)]?N[a(952)][a(943)+"ncoding"][a(211)](/\s/g,"")["toLowerC"+a(857)]():""},f=_0x499e78[a(943)+"ncoding"]?_0x23addf[a(943)+a(534)].replace(/\s/g,"")[a(395)+"ase"]():"",u=N[a(952)][a(1387)+a(477)]instanceof _0x5a9470?{force:!!N[a(952)][a(1387)+a(477)][a(1240)],type:N._options[a(1387)+a(477)][a(523)]?N[a(952)][a(1387)+a(477)][a(523)].replace(/\s/g,"").toLowerCase():""}:{force:!1,type:N._options[a(1387)+a(477)]?N[a(952)][a(1387)+"ype"][a(211)](/\s/g,"")[a(395)+a(857)]():""},h=_0x56d301[a(1387)+a(477)]?_0x5ec254[a(1387)+"ype"][a(211)](/\s/g,"")[a(395)+a(857)]():"",p=u.force?u[a(523)]:h||u[a(523)],w=x.force?x[a(1286)]:f||x[a(1286)],b=[a(1202)+a(1539)+a(1529),e[a(692)],e[a(593)],"string"],y=[e[a(1061)],e[a(580)]];N[a(952)]["enableTr"+a(732)+a(125)+"ad"]&&b[a(735)](p)&&(!w||y[a(735)](w))?_0x437999[a(842)+a(764)]=_0x1841fb(_0x3a8880.payload,0,_0x361bea.payload[a(742)+"th"]):_0x4a0b25.textPayload=""}}})();var V={};(()=>{let r=S,e={BIUeb:"rWMjK",DRaSW:"yoLSH",yQpru:function(s,t){return s(t)},VPedk:function(s,t){return s+t},RBUkL:function(s,t){return s+t},OkClY:function(s,t){return s*t},DbxwI:function(s,t){return s*t},qkzgO:function(s,t){return s+t},DYuPU:function(s,t){return s(t)},xGUKy:function(s,t,n){return s(t,n)},ouWZu:function(s,t){return s+t},IUunj:function(s,t){return s(t)},GucrI:function(s,t){return s+t},zderO:r(139),ZXXWR:"ffff",zzCxJ:function(s,t){return s===t},dwClC:r(876),xEdSQ:function(s,t){return s(t)},OAcBc:"00000000"+r(1381)+r(1381)+"00000000",eUXJw:function(s,t){return s>t},uiwyX:function(s,t){return s<t},YIusM:function(s,t){return s>t},fwqKB:function(s,t){return s!==t},VjfSp:function(s,t){return s-t},RaxNS:function(s,t){return s!==t},yeHuO:function(s,t){return s<t},ESbun:function(s,t){return s!==t},GyVFl:function(s,t){return s!==t},OGMlM:function(s,t){return s>>>t},mxWNH:function(s,t,n){return s(t,n)},ssIST:function(s,t){return s(t)},OqUvo:function(s,t,n){return s(t,n)},mIOQD:function(s,t){return s&t},bzyJr:r(898)+r(533)+r(916)+r(450),VjbsV:r(629)+"d",INqbi:r(274),noBXT:r(1285),oVOjj:function(s){return s()},ipyCM:function(s,t){return s&t},BUcZO:r(476),iKZaK:r(1537)+r(474)+"s",nNupb:r(1537)+"e_timeout",UqQwO:function(s,t){return s+t},ErFEF:r(930)+"0",qLPbW:r(1146),VWzof:r(1314),BlVrI:function(s,t){return s===t},VtQTm:r(1047),qvBnA:r(166),KMCTy:function(s,t,n){return s(t,n)},ysDrb:function(s,t){return s!==t},gLUDd:function(s,t){return s!==t},OZKIk:function(s,t){return s!==t},LDlqU:function(s,t,n){return s(t,n)},kDNDX:function(s,t,n){return s(t,n)},zhXbK:function(s,t){return s(t)},saxYm:"TChIZ",yLCEK:r(1002),pWlda:function(s,t,n){return s(t,n)},OMouS:function(s){return s()},owZMq:function(s,t,n){return s(t,n)},ZQsSk:function(s,t){return s!==t},PEoao:function(s,t,n){return s(t,n)},dEOkh:function(s,t,n){return s(t,n)},YxEGI:function(s,t,n){return s(t,n)},pglEK:function(s,t,n){return s(t,n)},eSvWe:function(s,t){return s!==t},TIqQY:function(s,t,n){return s(t,n)},fdJyw:function(s,t){return s!==t},tcGkB:r(437),LEtLA:function(s,t,n){return s(t,n)},ABfpT:function(s,t){return s(t)},IndsZ:function(s,t){return s(t)},qdLys:function(s,t){return s<<t},yCHse:r(1335),cMWMS:function(s,t){return s(t)},Dbrom:function(s,t,n){return s(t,n)},JrjzF:function(s,t){return s(t)},SWXCI:function(s,t,n){return s(t,n)},RgmKm:function(s,t){return s(t)},aPgyL:function(s,t,n){return s(t,n)},GLsQQ:function(s,t){return s(t)},QMfSF:function(s,t,n){return s(t,n)},kMBFC:function(s,t){return s(t)},BSJdN:function(s,t,n){return s(t,n)},gpFOb:"Missing "+r(533)+r(916)+"SeqID",bTxyE:r(898)+r(533)+r(916)+r(1543),yUTSx:"Missing "+r(533)+" field: "+r(1287),EhTjy:function(s,t){return s(t)},kuatG:function(s,t,n){return s(t,n)},VkFsZ:function(s,t,n){return s(t,n)},TMwrS:function(s,t){return s+t},DvJaj:function(s,t){return s>>t},BIQTW:function(s,t){return s>t},HmZRp:"Skip pas"+r(415),AMiRs:function(s,t){return s>t},cMaTv:function(s,t){return s*t},Nzbwx:function(s,t){return s>t},dluyS:function(s,t){return s+t},lMHJL:r(763)+"t limit",XfTJd:function(s,t,n){return s(t,n)},lHAKZ:function(s,t,n){return s(t,n)},GlYPz:function(s,t){return s||t},hUyyH:function(s,t,n){return s(t,n)},caedu:function(s,t){return s===t},zcbLN:r(1472),hywsN:function(s,t){return s+t},YoDUu:function(s,t){return s(t)},FZMva:function(s,t){return s+t},UWbIM:function(s,t){return s+t},Fxguv:function(s,t){return s+t},seVVP:function(s,t){return s&t},RtjaQ:function(s,t){return s<t},wsuiX:function(s,t){return s&t},EwCkJ:function(s,t){return s>=t},jPyPL:"BvLKH",aMuLz:function(s,t){return s+t},fnOSJ:function(s,t){return s+t},LsBZH:function(s,t){return s+t},CumoR:function(s,t){return s&t},XpnfH:function(s,t){return s|t},ndGmN:function(s,t){return s<<t},OKMze:function(s,t){return s|t},gbnXo:function(s,t){return s<<t},JHrJN:function(s,t){return s&t},sHHbM:function(s,t){return s(t)},crQIo:function(s,t){return s==t},NWZuI:function(s,t){return s+t},YpRPL:function(s,t){return s+t},RiTYS:function(s,t){return s+t},IqOXF:function(s,t){return s<<t},FEJuj:function(s,t){return s<<t},OjOYt:function(s,t){return s===t},HjIWC:r(1272),XJPSj:r(1070),DsfpX:function(s,t){return s|t},ArXDf:function(s,t){return s|t},FJHvC:function(s,t){return s<<t},lLIHJ:function(s,t){return s&t},yoSIw:function(s,t,n){return s(t,n)},zxcdV:function(s,t){return s>>t},PtcIb:function(s,t){return s&t},uGcnl:function(s,t,n){return s(t,n)},eDIUX:"jHNgW",ZuZmr:"NYqVN",VLwbr:function(s,t){return s<=t},zfAvM:function(s,t){return s+t},rPnzD:function(s,t){return s<<t},KJjOs:function(s,t,n){return s(t,n)},VhBNF:function(s,t){return s<t},HABPB:function(s,t){return s<t},oMHIy:function(s,t){return s+t},ebItu:function(s,t){return s-t},ffmOY:function(s,t){return s+t},cjYaz:function(s,t){return s<<t},kePee:r(1394),kHIRo:function(s,t){return s&t},uOLNd:function(s,t){return s>>t},xijRN:function(s,t){return s<t},hkkJP:function(s,t){return s&t},DHXtF:function(s,t){return s>>t},rMEMN:function(s,t){return s&t},vCrfs:function(s,t){return s>>t},XJVLG:function(s,t){return s|t},UQNUK:function(s,t){return s>>t},IPtjM:function(s,t){return s|t},MmTiq:function(s,t){return s<t},AGKgZ:function(s,t){return s+t},GAIGv:function(s,t){return s(t)},wztkY:function(s,t){return s<t},tvQfl:function(s,t){return s<<t},XtGgR:function(s,t){return s|t},LGzZF:function(s,t){return s&t},scLnE:"timeout,"+r(281)+r(379)+"g",ktpdF:r(321),aeivL:r(241),QygbB:function(s,t){return s&t},mPwKk:function(s,t){return s&t},QPATj:r(1316),ggQHN:r(1449),NdxmM:function(s,t){return s&t},tVeaE:function(s,t){return s&t},xlwrd:function(s,t){return s<<t},JgIfi:function(s,t){return s&t},oPRhS:function(s,t){return s&t},QjLqu:function(s,t){return s(t)},NLFqC:function(s,t){return s&t},MxekY:function(s,t){return s===t},NmOPM:r(162),DTowV:function(s,t){return s&t},uGknd:function(s,t){return s&t},Hjnsv:function(s,t){return s!==t},DAwLu:r(1299),tFBYn:function(s,t){return s<<t},snhjd:function(s,t){return s&t},YTork:function(s,t){return s|t},rUmbC:function(s,t){return s>>>t},KYxSl:function(s,t){return s<<t},kHGhD:function(s,t){return s>>>t},VDzsl:function(s,t){return s<<t},WhAWP:function(s,t){return s===t},Avidk:function(s,t){return s<t},XSfjf:function(s,t){return s<t},BYJcm:function(s,t){return s&t},tiSWo:function(s,t){return s>>>t},UbVCo:function(s,t){return s+t},qEQrW:function(s,t){return s&t},CwwyY:function(s,t){return s!==t},mFFoi:function(s,t){return s+t},goosB:function(s,t){return s|t},BDoNX:function(s,t){return s>>>t},vIyox:function(s,t){return s|t},lHzcw:function(s,t){return s&t},qHgFI:function(s,t){return s!==t},rkRDK:function(s,t){return s>>>t},YxPLU:function(s,t){return s+t},evZqX:function(s,t){return s|t},wzTpY:function(s,t){return s>>>t},aVcCO:function(s,t){return s>>>t},puGzy:function(s,t){return s(t)},JqQHL:r(216),eIhPw:r(341),JtZCT:r(722),pvBxX:function(s,t){return s|t},aRqpN:function(s,t){return s|t},YAkak:function(s,t){return s|t},VVyoU:function(s,t){return s<<t},vfDDo:function(s,t){return s<<t},gotGm:function(s,t){return s|t},CPAZQ:function(s,t){return s<<t},bwanJ:function(s,t){return s<<t},vBTGG:function(s,t){return s|t},VDaVW:function(s,t){return s<<t},jIzsK:function(s,t){return s<<t},XYmut:"KXOVS",hXIPz:r(819),dMZMr:function(s,t){return s===t},oZMTU:function(s,t){return s|t},DtsjM:function(s,t){return s<<t},PWtKx:function(s,t){return s|t},tsscV:function(s,t){return s<<t},HsZtL:function(s,t){return s<<t},rzwPJ:function(s,t){return s<<t},hKCdk:function(s,t){return s&t},lQrqb:function(s,t){return s&t},cqWxh:function(s,t){return s>>>t},SFVIn:function(s,t){return s>>>t},nAmlR:function(s,t){return s>>>t},iBZmC:function(s,t){return s&t},lWWxn:function(s,t){return s>>>t},UBgkF:function(s,t){return s>>>t},fyfOU:function(s,t){return s(t)},pDSDT:r(214),pAnVw:"kCyjp",EsGwf:function(s,t){return s<=t},CDrNS:function(s,t){return s>=t},Qytvk:function(s,t){return s|t},yVlkY:function(s,t){return s%t},cYzWO:function(s,t){return s|t},OVMOV:function(s,t){return s/t},KwcSn:function(s,t){return s+t},YNTFa:function(s,t){return s>>>t},KeedC:function(s,t){return s*t},OqVOQ:function(s,t){return s===t},sGAxq:"BRdgA",MUBEf:r(1406),lwiyw:function(s,t){return s>>>t},JnmPO:function(s,t){return s|t},vhcLU:"auGCr",kuwRm:"BgMGs",fTRBP:function(s,t){return s===t},nsVEu:function(s,t){return s>>>t},WKmqG:function(s,t){return s===t},gYDpZ:function(s,t){return s===t},fsEFz:function(s,t){return s===t},DirsM:function(s,t,n,o){return s(t,n,o)},NHbli:"dsIry",ZsWmF:function(s,t){return s*t},MjNTU:r(656),cNfIA:function(s,t){return s&t},vQPdG:function(s,t){return s>>>t},VSZsP:function(s,t){return s>>>t},Imxhj:function(s,t){return s&t},mncMr:function(s,t){return s>>>t},ulThX:function(s,t){return s&t},HqzYn:function(s,t){return s>>>t},vmmTy:function(s,t){return s>>>t},EOtkR:function(s,t){return s&t},CLmre:function(s,t){return s>>>t},KDQWP:function(s,t){return s&t},NQQUq:function(s,t){return s>>>t},bNkRS:function(s,t){return s&t},nNmHo:function(s,t){return s>>>t},pScvd:function(s,t){return s&t},kDoHB:r(1006)+"2|4",faoPZ:"CONNECTING_ERROR",rtkmp:r(339)+"OR",bnaSD:r(1229)+r(955),UGeMR:r(1267)+r(1445)+"R",voWYe:r(1151)+"2|3|6",WFyJj:"TjwOk",FAGZb:r(999),vHCUj:function(s,t){return s>=t},QKsgB:function(s,t){return s==t},liaGy:"UZzSz",PXxae:function(s,t){return s===t},OANGb:r(404),CUBwU:function(s,t){return s instanceof t},jgrJq:function(s,t){return s+t},iiXfR:function(s,t){return s+t},rTbWn:function(s,t){return s===t},CdmGM:function(s,t){return s+t},TWyky:function(s,t){return s+t},JGScu:function(s,t){return s+t},OKErS:function(s,t){return s!==t},UMbWD:function(s,t){return s<<t},qJWSb:function(s,t){return s&t},tJtPX:function(s,t){return s<t},bCfdu:r(1447),JtspS:r(403),FwRHl:"sent",YmZLC:function(s,t){return s!==t},dXwpj:r(267),WpHXR:r(168)+r(823),jvARV:function(s,t,n){return s(t,n)},pnKfr:function(s,t){return s===t},BWZAq:r(1384),YTtcf:function(s,t){return s!==t},LOYmQ:r(1225),UIVME:function(s,t){return s+t},tKGhO:function(s,t){return s===t},iVqWQ:function(s,t){return s!=t},BHPaX:r(1307)+"0",qZBjs:function(s,t){return s+t},BiKgR:function(s,t){return s(t)},iRocK:function(s,t){return s!==t},uebUy:r(1470)+r(895)+"ing",djdnB:function(s,t){return s===t},JVDUZ:"CvdXJ",IWraN:function(s,t){return s<=t},dHZqr:"next() c"+r(567)+r(903)+"imes in "+r(199),OIYEt:function(s,t){return s===t},txYfo:function(s,t){return s+t},wczGG:r(1479),wciMx:function(s,t){return s(t)},CmIwa:function(s,t){return s===t},SSPrv:r(373),DWsFs:function(s,t){return s<t},tXRXD:function(s,t){return s<t},fKojO:function(s,t){return s===t},uWDJz:function(s,t){return s===t},lKyCP:function(s,t){return s&t},kzHrQ:function(s,t){return s<t},vaYWQ:function(s,t){return s|t},Mjdtw:function(s,t){return s<<t},GnICh:function(s,t){return s|t},pmfSQ:function(s,t){return s&t},zpOLd:function(s,t){return s<<t},RjAJV:function(s,t){return s&t},bvtMm:function(s,t){return s<<t},SAAiO:function(s,t){return s&t},cyKoK:function(s,t){return s+t},VKFbe:function(s,t){return s>t},iZYbo:function(s,t){return s<t},fqAij:r(376),koGUo:function(s,t){return s|t},lgQqM:function(s,t){return s===t},ASYwH:function(s,t){return s+t},hmRJt:r(1228)+r(252),QaFIK:function(s,t){return s|t},jZewi:function(s,t){return s&t},eDifi:function(s,t){return s|t},wdGCE:function(s,t){return s&t},SGurF:function(s,t){return s&t},cTJGC:function(s,t){return s|t},MXOsV:function(s,t){return s-t},LPMIl:r(668),ctljT:function(s,t,n,o){return s(t,n,o)},rYmRL:r(259),DafqC:function(s,t){return s!=t},TaHAR:r(851)+"ion/json",qeiWG:function(s,t){return s==t},HeVjv:r(1202)+r(1539)+"et=utf-8",hsLJx:r(584),XGHfV:r(122),qxLJG:r(346),pdahe:r(622),eXLLe:r(678),KnCRB:function(s,t){return s(t)},epJpp:r(238)+r(786),zweDJ:r(1385),EiDsL:function(s,t){return s+t},IDbsR:r(272),mFPtH:function(s,t){return s+t},ZVGKx:function(s,t){return s!==t},lFQSR:function(s,t){return s|t},pfJwm:function(s,t){return s<<t},zvWPX:function(s,t){return s|t},fcOAc:function(s,t){return s<<t},aGzbT:function(s,t){return s&t},QgTbW:function(s,t){return s&t},JSHAD:function(s,t){return s&t},NbMro:function(s,t){return s<t},Wyqcw:function(s,t){return s!==t},GctGC:r(1352),tSLOt:function(s,t){return s!==t},pzfHa:"uBpzz",mbdSa:r(644),lwJFQ:r(776),KEDrC:r(871),gRMju:function(s,t){return s(t)},qTfvl:function(s,t){return s!==t},KNlwn:r(297),CJeBF:function(s,t){return s||t},weGvL:function(s,t){return s||t},FiZNU:function(s,t){return s||t},ZZkBi:function(s,t){return s===t},NOZKP:r(595),VTnkO:function(s,t){return s||t},ogVtQ:function(s,t){return s===t},YbbER:"TxXeE",MFnxM:function(s,t){return s!==t},qfjBn:"zxVqZ",SVuRj:function(s,t){return s!==t},IKfHs:"nIEEb",AADvZ:r(552),YSAWF:function(s,t){return s||t},uVaIj:function(s,t){return s||t},LnTCZ:function(s,t){return s||t},HwwIc:function(s,t){return s!=t},cUAgi:"init QoSDB failed",AVeQB:r(212),DKIHX:function(s,t){return s!==t},ttzMl:r(1501),KaIfh:function(s,t,n){return s(t,n)},BagOO:r(1527),BEOzq:function(s,t){return s===t},jExGi:r(306),JpaoQ:r(248),EGppy:function(s,t){return s instanceof t},PTazI:r(224)+r(170),YmCbp:function(s,t){return s+t},sNvWa:r(1063),OehOh:"cXRbe",rGIxB:function(s,t){return s(t)},vwskh:function(s,t,n,o){return s(t,n,o)},pwhFN:r(347)+"er_qos",dEnqL:function(s,t,n,o){return s(t,n,o)},kNsBw:function(s,t,n,o){return s(t,n,o)},LgTmB:r(347)+r(754)+"k",kfKYg:function(s,t,n){return s(t,n)},dtUQb:r(347)+"er_ack_m"+r(283),uQwyd:function(s,t){return s!==t},dUptJ:r(145),eiGBB:r(205),JeZgz:r(712),xwxUf:function(s,t){return s&&t},BvZeO:"ack_id",WrCwQ:r(592),Ndknb:function(s){return s()},upAvJ:r(171),MaNVC:function(s){return s()},YmqoL:r(960),mnaFp:function(s,t){return s(t)},YfdIl:function(s,t){return s instanceof t},CWOfJ:r(666)+"e",tszou:function(s,t,n,o){return s(t,n,o)},yvpdP:function(s,t){return s!==t},gaiMj:r(544),AlJsI:function(s){return s()},GnNZl:function(s,t){return s+t},GluWf:" + ",EuOGJ:r(968),mhuyD:function(s,t){return s>t},mscLe:r(620)+"too large",jpMxS:function(s,t){return s+t},FkgOk:function(s,t){return s<t},fNfGz:function(s,t){return s>>>t},xjUtl:function(s,t){return s+t},lVSyo:function(s,t){return s|t},xIdKk:function(s,t){return s<<t},ucDsX:function(s,t){return s+t},oQjpc:function(s,t){return s|t},PoWfG:function(s,t){return s|t},dWqku:function(s,t){return s|t},UyPUM:function(s,t){return s<<t},vodDx:function(s,t){return s<<t},UxzoR:function(s,t){return s+t},tVLKw:function(s,t){return s+t},NZBXx:function(s,t){return s>>>t},SWXvX:function(s,t){return s&t},jiapB:function(s,t){return s>>>t},tGdyd:function(s,t){return s>>>t},ftcsJ:function(s,t){return s+t},Dinnl:function(s,t){return s>>>t},AdQHB:function(s,t){return s+t},sXCQu:function(s,t){return s&t},dynLH:function(s,t){return s+t},PGIcp:function(s,t){return s+t},kDOhS:r(1283)+"9|7|2|3|11|10|1|6",rPytJ:function(s,t){return s&t},qEAXu:function(s,t){return s>t},SoOzC:function(s,t,n,o){return s(t,n,o)},imXmw:function(s,t){return s>>>t},WzlqU:function(s,t){return s|t},aOpgp:function(s,t){return s<<t},fDvMq:function(s,t){return s<t},uiDnK:function(s,t){return s|t},feBRd:function(s,t){return s<t},GANuV:function(s,t){return s|t},rNMuy:function(s,t){return s<<t},fTrNi:function(s,t){return s|t},aTTrb:function(s,t){return s<<t},ILhdW:function(s,t){return s&t},QWIdG:function(s,t){return s<t},oLXMv:function(s,t){return s|t},rJGLe:function(s,t){return s(t)},ktGKo:r(1276)+r(1306),TdqQN:"header",jnXAc:r(1543),cNLmM:function(s,t,n,o){return s(t,n,o)},wgaTz:r(703)+r(1101),KcAiu:function(s,t){return s<t},rGyiJ:function(s,t,n){return s(t,n)},Xkpka:function(s,t,n,o){return s(t,n,o)},TJdtG:r(1223)+r(721),dtkOY:r(528)+"ame",rKuCN:r(1392),MfWmV:r(442),lrweJ:r(133),HrvXu:r(394),dfeWh:r(896)+"r",qRVRx:r(381),lkldc:r(881),EVBzl:r(1126)+r(1216)+"ce not i"+r(1234)+"ed",iFdac:r(1126)+r(295)+r(1567),UQBwp:function(s,t){return s<t},eYJPZ:function(s,t){return s+t},hZhpE:function(s,t){return s===t},RdoLs:r(355),VCvPR:function(s,t,n){return s(t,n)},IFWqV:function(s,t,n){return s(t,n)},bCvTd:function(s,t,n,o){return s(t,n,o)},yKKss:r(603),JyxzF:function(s,t,n){return s(t,n)},yWcRR:"x_fronti"+r(1416),laOCa:function(s,t){return s(t)},bTRhM:r(347)+r(1463),PCsHX:function(s,t,n,o){return s(t,n,o)},AuKWD:"x-msg-qos",RCBAs:function(s,t,n){return s(t,n)},QytJZ:"x-msg-cu"+r(565)+"e",fOGVx:r(1295)+r(1035)+"ue",FeWDR:r(1005),yqlow:r(337),EWTAh:function(s){return s()},AVvRS:function(s,t){return s===t},WcUyd:function(s,t){return s===t},UjdPQ:function(s,t,n){return s(t,n)},uEsuo:function(s,t){return s(t)},XCnRN:function(s){return s()},GgELI:function(s,t){return s<t},wFgTL:function(s,t){return s!==t},ovbZO:function(s){return s()},fFShz:function(s,t,n,o){return s(t,n,o)},eIVEf:r(933),sjZTb:"gJHZK",snvod:r(483),bErmC:function(s,t,n){return s(t,n)},WMWJE:function(s,t){return s!==t},hkIDh:r(331),pyHdX:function(s,t){return s===t},artSr:function(s,t){return s===t},SwNin:r(516),isLlA:function(s,t,n){return s(t,n)},wcLhk:function(s,t,n,o){return s(t,n,o)},UjoTa:r(717)+r(1196),xByRj:r(980),yIUaL:"auto",dYiZP:"please provide v"+r(493),YwdyF:function(s,t){return s(t)},NEkhN:r(1230),ormYs:"stop imm"+r(247)+r(924)+"ct",QYtdJ:r(826),akHyA:r(640),tfoeT:function(s,t){return s||t},hwtBB:r(303),ZBWiE:"urliU",eAVhy:r(264),hCAsZ:function(s,t){return s!==t},MxvZK:r(564),eArHN:"bd_did",DmYjw:r(190),NdiNA:"device_id",mKLww:r(1297)+r(202)+r(1426)+r(841)+r(740),IwgWS:r(766),ApGZk:function(s,t,n){return s(t,n)},npqLi:r(1526)+"0",fBRTP:function(s,t){return s<t},JpTqa:function(s,t){return s&t},QdYFf:function(s,t,n){return s(t,n)},VQhGy:function(s,t){return s||t},oBXox:function(s,t,n){return s(t,n)},QJDCy:r(225)+"t",NLcxh:"start",pAAol:r(288),BdEVt:function(s,t){return s(t)},DbyXO:"FRONTIER>",rqRGg:function(s,t){return s*t},vLVFq:function(s,t){return s-t},DzUoL:function(s,t){return s===t},OuHnZ:function(s,t){return s!==t},nqIBZ:r(966)+r(664)+"reconnecting ser"+r(804),PJtRQ:function(s,t,n){return s(t,n)},SMVNq:function(s,t){return s(t)},sLDsl:r(889)+"3",GcewK:r(818)+"0",TCiYW:function(s,t){return s!==t},UBPyL:function(s,t){return s===t},lnlIm:function(s,t){return s===t},VaYat:function(s,t){return s!==t},WHnwv:r(326),AWSOH:"ack",GZzCF:function(s,t){return s===t},FtYOn:r(1396),ZivHY:"xZHsT",oPAen:function(s,t,n,o,c){return s(t,n,o,c)},JJqHZ:function(s,t){return s(t)},AAfeS:r(1274),auOwU:r(1545)+r(1361),wvmQg:function(s,t){return s===t},XlDUs:function(s,t){return s===t},nJYKv:r(1297)+r(1110)+r(435)+r(1125)+r(1241)+r(1413)+r(572)+" arraybu"+r(1067),TEOKO:r(1279),FCUmJ:function(s,t){return s(t)},MwLqq:function(s,t){return s||t},ikfwX:r(1297)+r(1110)+r(276)+r(1306),QWdPR:function(s,t){return s(t)},ooAnT:function(s,t){return s===t},LxoHZ:r(1028),GHROH:r(1200),jynSk:r(846),qyEeo:function(s,t){return s!==t},cCpqm:r(979),vkzdu:"MfcSG",wydLk:function(s,t){return s||t},BUoqJ:"4|1|3|0|2",EmTVe:function(s,t){return s(t)},WiLgO:"\0\0\0\0\0\0\0\0",REBXp:function(s,t){return s*t},jABKv:function(s,t){return s===t},PXTZh:r(173),DfQxl:function(s,t){return s!=t},KmBKZ:function(s,t){return s!=t},ujwOA:r(834),NyFAj:function(s,t){return s===t},LxTfx:"Dedicate"+r(285)+"lobalScope",sPRCm:function(s,t){return s===t},kGBpB:function(s,t){return s==t},TCDcr:function(s,t){return s!=t},mFyKq:function(s,t){return s!=t},PscMK:function(s,t){return s!=t},nLota:function(s,t){return s===t},nXMQF:function(s,t){return s===t},yMMsk:"ServiceWorkerGlobalScope",ObopK:function(s,t){return s===t},wAWrO:function(s,t){return s!=t},BAxLR:function(s,t){return s===t},ahwxq:r(992)+"qos__"};ve.r(V),ve.d(V,{FWS:()=>I0,CustomErrorEvent:()=>ns,createCloseEvent:()=>pe,ReconnectEvent:()=>ts,createErrorEvent:()=>ue,decodedFrame:()=>Xr,createOpenEvent:()=>xs,CustomCloseEvent:()=>rs,createReconnectEvent:()=>Jn,FrontierMessageEvent:()=>is,encodeFrame:()=>Gn,createMessageEvent:()=>as,OpenEvent:()=>os,ErrorCode:()=>qe,Event:()=>it,MessageEvent:()=>ss});let i="";function a(s=""){let t=r;if(e[t(1076)]!==e[t(1259)]){let o=""+Date[t(604)](),c=i||(i=e[t(1450)](p,s)),l=Math[t(325)]()[t(547)](16)[t(369)](-6);return e[t(1359)](e[t(1590)](e.RBUkL("02",o),c),l)}else return this[t(1260)]?.[t(1001)]}function x(){let s=r;return e[s(1590)](e[s(367)](1e4,Date[s(604)]()),Math[s(1104)](e[s(1308)](1e4,Math[s(325)]())))}function f(s){let t=r;return e[t(1004)](e[t(1496)](Array,8)[t(1505)]("0"),e.xGUKy(parseInt,s,10)[t(547)](2))[t(369)](-8)}function u(s){let t=r;return e[t(696)](e[t(1066)](Array,4)[t(1505)]("0"),e[t(684)](parseInt,s,2)[t(547)](16))[t(369)](-4)}function h(s){let t=r,n=s[t(1219)](/\./)[t(698)](l=>f(l)),o=[];return o[0]=e[t(1496)](u,e[t(894)](n[0],n[1])),o[1]=e[t(1066)](u,e[t(1590)](n[2],n[3])),[t(139),e.zderO,e[t(631)],t(139),e.zderO,e[t(235)],o[0],o[1]][t(1505)]("")}function p(s){let t=r;if(e[t(263)](e[t(669)],e[t(669)])){let n=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/[t(1215)](s),o=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/[t(1215)](s);return n?e[t(313)](h,s):o?e[t(1066)](w,s):e[t(138)]}else this[t(523)]=_0x3a4c25,this[t(937)]=null}function w(s){let t=r,n="",o=[],c=0,l=0,m=!0,g=e.zderO;if(e[t(1508)](s[t(1068)]("::"),-1)){let d=s.split("::");for(let v=0;e[t(1593)](v,d[t(1156)]);v++){let C=d[v];if(e[t(1247)](C[t(1068)](":"),0)){let k=C[t(1219)](":");m&&(c=k[t(1156)]),l+=k[t(1156)];for(let R=0;e[t(1593)](R,k.length);R++)if(e[t(1249)](4,k[R].length)){let B=g[t(1451)+"g"](0,e[t(652)](4,k[R][t(1156)])),Y=B[t(936)](k[R]);o[t(157)](Y)}else o.push(k[R]);m=!1}else{if(e[t(161)](4,C[t(1156)])){let k=g[t(1451)+"g"](0,e.VjfSp(4,C.length)),R=k[t(936)](C);o[t(157)](R)}else o[t(157)](C);m&&(c+=1),l+=1,m=!1}}let _="";for(let v=0;e[t(1593)](v,e[t(652)](8,l));v++)_=_[t(936)](g);for(let v=0;e[t(144)](v,o[t(1156)]);v++)e.zzCxJ(v,c)?(n=n[t(936)](_),n=n.concat(o[v])):n=n[t(936)](o[v]);return n}{let d=s[t(1219)](":");for(let _=0;e.yeHuO(_,d.length);_++){let v=d[_];if(e.ESbun(4,d[_][t(1156)])){let C=g[t(1451)+"g"](0,e[t(652)](4,d[_][t(1156)])),k=C[t(936)](v);n=n.concat(k)}else n=n[t(936)](v)}return n}}function b(s,t){let n=r,o=s.key;e.RaxNS(void 0,o)&&(Q(t,10),e[n(684)](De,t,o));let c=s[n(450)];e[n(354)](void 0,c)&&(e[n(684)](Q,t,18),De(t,c))}function y(s){let t=r,n={};e:for(;!e[t(313)](ye,s);){let o=e[t(1496)](ne,s);switch(e[t(511)](o,3)){case 0:break e;case 1:n.key=e[t(610)](Ae,s,e.IUunj(ne,s));break;case 2:n.value=e[t(610)](Ae,s,e[t(178)](ne,s));break;default:e.OqUvo(ie,s,e[t(1112)](7,o))}}if(e[t(263)](void 0,n[t(226)]))throw new Error(t(898)+t(533)+t(916)+t(226));if(n[t(450)]===void 0)throw new Error(e[t(737)]);return n}function E(s){let t=r,n={fuyVj:e[t(1233)]};if(e[t(315)]!==e[t(323)]){let o=e.oVOjj(z);return P(s,o),e.yQpru(Me,o)}else{let o={pfaru:function(c,l){return c!=l},Vbjry:vkRXmW[t(150)]};_0x57501d.r=c=>{let l=t;o[l(1453)](o[l(883)],typeof _0x3905c9)&&_0x322aa6[l(547)+l(792)]&&_0x83a640["definePr"+l(418)](c,_0x5bae0c[l(547)+l(792)],{value:l(1105)}),_0x14f335["definePr"+l(418)](c,"__esModule",{value:!0})}}}function P(s,t){let n=r,o={TzLxG:function(c,l){return e.ipyCM(c,l)},NLHBn:function(c,l){return e[O(511)](c,l)},pvSzw:function(c,l){return e[O(1315)](c,l)},jsokN:function(c,l){return e[O(511)](c,l)},GcJJw:function(c,l){return c>>>l},xzjjH:function(c,l){return e[O(511)](c,l)},fFojl:e.BUcZO,BqNNj:function(c,l){return e[O(178)](c,l)},lzPWP:n(516),SyYPf:e[n(1583)],MqbGd:e[n(1323)],gePFT:function(c,l){return e[n(1247)](c,l)},ovDiX:function(c,l){return e[n(1189)](c,l)},cbwBZ:n(763)+n(415),lRFsm:function(c,l,m){return c(l,m)},AUGXW:function(c,l,m){return e[n(1036)](c,l,m)},vpnmi:e.ErFEF,KbQRZ:e[n(820)],lquot:e.VWzof};if(e.BlVrI(e[n(801)],e[n(724)]))return _0x5c8c04[n(1337)+"Code"](o.TzLxG(255,this.low),o[n(541)](o[n(1281)](this[n(1424)],8),255),o[n(908)](o.NLHBn(this[n(1424)],16),255),o[n(1296)](this.low,24),255&this[n(1023)],o[n(908)](o.GcJJw(this[n(1023)],8),255),o[n(908)](o[n(779)](this.high,16),255),this[n(1023)]>>>24);{let c=s[n(336)];e[n(1249)](void 0,c)&&(Q(t,8),e[n(877)](bt,t,c));let l=s[n(164)];if(e.RaxNS(void 0,l))if(e.ysDrb(n(1428),n(1428))){let me=this[n(642)+n(1347)]?.[n(1100)+n(1059)+"nt"](),X=this[n(952)][n(225)+n(319)+n(1201)](_0x535f02[n(603)],_0x4f607f.reason);this[n(1319)+n(899)+"ent"](_0x145390(o.fFojl,{code:1006,reason:_0x122081.reason||n(153)+n(1237)+n(1581)+n(922)+n(352)+n(1273)+me,willReconnect:X})),X&&this[n(920)]();return}else Q(t,16),e.OqUvo(bt,t,l);let m=s[n(1543)];e[n(236)](void 0,m)&&(n(1549)!==n(655)?(e[n(610)](Q,t,24),bt(t,e[n(178)](xe,m))):(o[n(427)](_0x4d5c82,o[n(1203)]),this.off(o[n(859)],_0x4a47e5),this.off(o[n(201)],_0x2505d3)));let g=s.method;e[n(172)](void 0,g)&&(e[n(1012)](Q,t,32),e[n(856)](bt,t,e.zhXbK(xe,g)));let d=s[n(1437)];if(d!==void 0)for(let me of d)if(e[n(263)](e[n(545)],e[n(667)])){let X=_0x432675[n(142)];if(o.gePFT(o[n(149)](X,_0x10cbce),_0x55dc90.limit))throw new _0x13c08a(o[n(1154)]);return _0x28df3a[n(142)]+=_0x29aa8d,X}else{e[n(990)](Q,t,42);let X=e[n(807)](z);e[n(1547)](b,me,X),Q(t,X[n(342)]),e[n(1547)](ke,t,X),e.DYuPU(G,X)}let _=s[n(943)+n(534)];e[n(1095)](void 0,_)&&(e[n(641)](Q,t,50),e[n(462)](De,t,_));let v=s[n(1387)+n(477)];e.OZKIk(void 0,v)&&(e.YxEGI(Q,t,58),e[n(990)](De,t,v));let C=s[n(720)];e[n(1249)](void 0,C)&&(e[n(877)](Q,t,66),e[n(973)](Q,t,C[n(1156)]),e[n(340)](zt,t,C));let k=s[n(800)];e[n(1398)](void 0,k)&&(Q(t,74),e[n(1577)](De,t,k));let R=s[n(391)+n(1430)];e[n(161)](void 0,R)&&(e.fdJyw(e.tcGkB,n(997))?(Q(t,82),e[n(684)](De,t,R)):(o[n(600)](_0x4630fc,_0x184c7a,16),o.AUGXW(_0x109670,_0x18fe99,_0xe08710)));let B=s[n(989)];B!==void 0&&(e[n(684)](Q,t,90),e[n(1547)](De,t,B));let Y=s[n(822)+"e"];if(e.GyVFl(void 0,Y))if(e[n(291)](n(271),"mChFi"))e[n(610)](Q,t,96),e.LEtLA(bt,t,e.DYuPU(xe,Y));else{let me=o[n(747)][n(1219)]("|"),X=0;for(;;){switch(me[X++]){case"0":this._ws[n(727)+n(1499)]("error",this[n(430)]);continue;case"1":this._ws[n(727)+n(1499)](o.KbQRZ,this[n(1495)]);continue;case"2":this[n(1193)][n(727)+n(1499)](n(476),this[n(1524)]);continue;case"3":if(!this._ws)return;continue;case"4":this[n(1193)]["addEvent"+n(1499)](o[n(1414)],this[n(751)+"ge"]);continue}break}}}}function I(s){let t=r;return e[t(976)](L,e[t(1450)](Ee,s))}function L(s){let t=r;if(e[t(236)](t(1335),e.yCHse))_0x49f1ff=e.IndsZ(_0x40b746,_0x1ecb03),_0x454609|=e[t(849)](127&_0x260b0e,7);else{let n={};e:for(;!e[t(1066)](ye,s);){let o=e[t(177)](ne,s);switch(o>>>3){case 0:break e;case 1:n[t(336)]=e[t(934)](Yr,s,!0);break;case 2:n[t(164)]=e.PEoao(Yr,s,!0);break;case 3:n[t(1543)]=e[t(1450)](ne,s);break;case 4:n.method=ne(s);break;case 5:{let c=e[t(625)](j,s);(n[t(1437)]||(n.headers=[])).push(e[t(1450)](y,s)),s[t(342)]=c;break}case 6:n[t(943)+t(534)]=e[t(512)](Ae,s,e[t(1344)](ne,s));break;case 7:n[t(1387)+"ype"]=Ae(s,e[t(625)](ne,s));break;case 8:n[t(720)]=e.aPgyL(Mt,s,e.IUunj(ne,s));break;case 9:n[t(800)]=e[t(1012)](Ae,s,e.GLsQQ(ne,s));break;case 10:n.serverTiming=e.QMfSF(Ae,s,e.kMBFC(ne,s));break;case 11:n[t(989)]=e[t(1431)](Ae,s,e[t(313)](ne,s));break;case 12:n[t(822)+"e"]=ne(s);break;default:e[t(973)](ie,s,e.mIOQD(7,o))}}if(n[t(336)]===void 0)throw new Error(e[t(163)]);if(n.LogID===void 0)throw new Error("Missing required"+t(916)+t(164));if(e[t(263)](void 0,n[t(1543)]))throw new Error(e[t(1292)]);if(e[t(291)](void 0,n[t(1287)]))throw new Error(e.yUTSx);return n}}function j(s){let t=r,n=e[t(1261)](ne,s),o=s.limit;return s[t(342)]=e[t(1590)](s[t(142)],n),o}function ie(s,t){let n=r;switch(t){case 0:for(;e[n(1112)](128,e[n(399)](te,s)););break;case 2:e.xGUKy(_e,s,e.RgmKm(ne,s));break;case 5:e[n(1389)](_e,s,4);break;case 1:e[n(1442)](_e,s,8);break;default:throw new Error(e.TMwrS(n(1120)+n(1459)+"pe: ",t))}}function xe(s){let t=r;return s|=0,{low:s,high:e[t(440)](s,31),unsigned:s>=0}}let D=[];function z(){let s=r,t=D[s(1026)]();return t?(t[s(142)]=t[s(342)]=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function G(s){D.push(s)}function Ee(s){return{bytes:s,offset:0,limit:s[r(1156)]}}function Me(s){let t=r,n=s[t(987)],o=s[t(342)];return e[t(263)](n[t(1156)],o)?n:n.subarray(0,o)}function _e(s,t){let n=r;if(e[n(383)](s[n(142)]+t,s[n(342)]))throw new Error(e[n(299)]);s[n(142)]+=t}function ye(s){let t=r;return s[t(142)]>=s[t(342)]}function ge(s,t){let n=r,o=s[n(987)],c=s[n(142)],l=s.limit,m=e[n(1189)](c,t);if(e[n(233)](m,o.length)){let g=new Uint8Array(e.cMaTv(2,m));g[n(1474)](o),s[n(987)]=g}return s[n(142)]=m,m>l&&(s[n(342)]=m),c}function rt(s,t){let n=r,o=s[n(142)];if(e[n(672)](e.dluyS(o,t),s[n(342)]))throw new Error(e[n(1040)]);return s[n(142)]+=t,o}function Mt(s,t){let n=r,o=e[n(671)](rt,s,t);return s.bytes.subarray(o,o+t)}function zt(s,t){let n=r,o=e[n(882)](ge,s,t[n(1156)]);s[n(987)].set(t,o)}function Ae(s,t){let n=r,o={WdKPQ:function(_,v){return e[O(1096)](_,v)},NgTon:function(_,v,C){return e.SWXCI(_,v,C)},sdrcT:function(_){return e.oVOjj(_)},LhRkV:function(_,v,C){return _(v,C)},rxwXl:function(_,v,C){return e[O(119)](_,v,C)},wNqlP:function(_,v){return e.EhTjy(_,v)}},c=rt(s,t),l=String[n(1337)+n(261)],m=s[n(987)],g="\uFFFD",d="";for(let _=0;_<t;_++)if(e[n(282)](n(1271),e.zcbLN)){let v=this[n(1260)][n(1458)](this[n(854)]),C=_0x168992[n(677)](o[n(865)](v,"{}"));return _0x3db1d1[n(1311)](C)}else{let v=m[e.hywsN(_,c)],C,k,R,B;if(e.caedu(128&v,0))d+=e[n(1220)](l,v);else if(e[n(291)](e[n(1315)](224,v),192))e.FZMva(_,1)>=t?d+=g:(C=m[e[n(1575)](e.Fxguv(_,c),1)],e[n(1358)](192,C)!==128?d+=g:(B=e.qdLys(31&v,6)|e.seVVP(63,C),e.RtjaQ(B,128)?d+=g:(d+=e[n(177)](l,B),_++)));else if(e[n(1509)](240,v)==224)if(e.EwCkJ(e[n(1359)](_,2),t))d+=g;else if(e[n(263)](e.jPyPL,e[n(628)]))C=m[e.TMwrS(e[n(203)](_,c),1)],k=m[e[n(521)](e[n(885)](_,c),2)],e[n(385)](e[n(393)](C,e[n(1116)](k,8)),49344)!==32896?d+=g:(B=e[n(237)](e[n(237)](e[n(849)](e[n(385)](15,v),12),e[n(951)](63&C,6)),e.JHrJN(63,k)),e.uiwyX(B,2048)||B>=55296&&B<=57343?d+=g:(d+=e.sHHbM(l,B),_+=2));else{HbPduY[n(1456)](_0x20109d,_0x37f883,42);let Y=HbPduY.sdrcT(_0x41a512);HbPduY.NgTon(_0x39c7ba,_0x18bac4,Y),HbPduY[n(1557)](_0x322796,_0x169549,Y.limit),HbPduY[n(132)](_0x34edd1,_0x409e3b,Y),HbPduY[n(561)](_0x1502a1,Y)}else e[n(411)](248&v,240)?e[n(744)](_+3,t)?d+=g:(C=m[e[n(392)](e.UqQwO(_,c),1)],k=m[e[n(1440)](e[n(1130)](_,c),2)],R=m[e.aMuLz(_,c)+3],e[n(1358)](C|e.IqOXF(k,8)|e[n(1455)](R,16),12632256)!==8421504?d+=g:e[n(961)](e.HjIWC,e[n(1386)])?this[n(985)](_0x1a78b3,_0x4403a7):(B=e.XpnfH(e[n(1111)](e[n(1520)](e.qdLys(e[n(1358)](7,v),18),e[n(519)](63&C,12)),e.FEJuj(63&k,6)),e[n(738)](63,R)),e[n(144)](B,65536)||B>1114111?d+=g:(B-=65536,d+=e.yoSIw(l,e[n(1189)](e[n(525)](B,10),55296),e[n(1169)](1023,B)+56320),_+=3))):d+=g}return d}function De(s,t){let n=r,o={YYmRH:function(d){return e[O(807)](d)}},c=t[n(1156)],l=0;for(let d=0;d<c;d++)if(e.caedu(e[n(416)],e[n(1369)])){let _=this[n(642)+n(1347)]?.[n(1100)+n(1059)+"nt"]();this[n(777)](n(686)+_),o[n(828)](_0x482951)}else{let _=t[n(265)+"At"](d);_>=55296&&e.VLwbr(_,56319)&&e[n(253)](e[n(179)](d,1),c)&&(_=e[n(392)](e.rPnzD(_,10),t.charCodeAt(++d))-56613888),l+=_<128?1:e[n(144)](_,2048)?2:e[n(253)](_,65536)?3:4}Q(s,l);let m=e[n(1052)](ge,s,l),g=s[n(987)];for(let d=0;e.VhBNF(d,c);d++){let _=t[n(265)+"At"](d);if(_>=55296&&e[n(701)](_,56319)&&e[n(1362)](e[n(591)](d,1),c)&&(_=e[n(1149)](e[n(1055)](e[n(1029)](_,10),t[n(265)+"At"](++d)),56613888)),_<128)g[m++]=_;else{if(e[n(236)](e[n(571)],e[n(571)]))return(_0xda141c(8)[n(1505)]("0")+e[n(532)](_0x20d435,_0x164197,10)[n(547)](2))[n(369)](-8);e[n(1362)](_,2048)?g[m++]=e[n(1111)](e[n(505)](e[n(460)](_,6),31),192):(e[n(1288)](_,65536)?g[m++]=e[n(1041)](e.DHXtF(_,12),15)|224:(g[m++]=e[n(559)](e[n(504)](_,18),7)|240,g[m++]=e[n(1165)](e.seVVP(e.UQNUK(_,12),63),128)),g[m++]=e[n(559)](_>>6,63)|128),g[m++]=e[n(905)](e[n(1169)](63,_),128)}}}function ke(s,t){let n=r;if(e[n(420)](n(207),n(576))){let o=e[n(856)](ge,s,t[n(342)]),c=s.bytes,l=t[n(987)];for(let m=0,g=t[n(342)];e.MmTiq(m,g);m++)c[e[n(695)](m,o)]=l[m]}else return this[n(1533)][n(774)+"ns"]}function te(s){let t=r;return s[t(987)][e[t(1389)](rt,s,1)]}function Ge(s,t){let n=ge(s,1);s.bytes[n]=t}function ne(s){let t=r,n=0,o=0,c;do c=e[t(455)](te,s),e[t(769)](n,32)&&(o|=e[t(1357)](127&c,n)),n+=7;while(e[t(1112)](128,c));return o}function Q(s,t){let n=r;for(t>>>=0;t>=128;)e[n(877)](Ge,s,e[n(1559)](e[n(940)](127,t),128)),t>>>=7;e[n(1305)](Ge,s,t)}function Yr(s,t){let n=r,o={UUCfB:e.scLnE,aCouy:e[n(365)],NLegO:function(d,_){return e[n(411)](d,_)},lbjsq:e.aeivL,mGjQq:"ws://"},c=0,l=0,m=0,g;if(g=e[n(350)](te,s),c=e.QygbB(127,g),e[n(771)](128,g)){if(e.QPATj===e[n(601)]){let d=this[n(642)+"tManager"]?.[n(1100)+n(1059)+"nt"]();this[n(777)](n(542)+d+n(680)),this[n(1020)+"ect"](1001,o[n(630)],!0)}else if(g=te(s),c|=e.cjYaz(e[n(741)](127,g),7),e.tVeaE(128,g)&&(g=te(s),c|=e[n(1476)](127&g,14),e.JgIfi(128,g)&&(g=te(s),c|=e[n(914)](e[n(405)](127,g),21),e.mPwKk(128,g)&&(g=e[n(862)](te,s),l=e[n(816)](127,g),128&g))))if(e[n(118)]("rPNmg",e.NmOPM)){let d=_0x59417c(o[n(1187)],{message:_0x5d4ab8[n(1314)],code:_0x132587[n(1229)+n(955)],error:_0x4cdbb3});this["_dispatc"+n(1168)+n(1522)](d)}else g=e[n(158)](te,s),l|=e.rPnzD(e[n(425)](127,g),7),e[n(816)](128,g)&&(g=e[n(455)](te,s),l|=e[n(1169)](127,g)<<14,e.DTowV(128,g)&&(g=te(s),l|=e.uGknd(127,g)<<21,128&g&&(g=te(s),m=e[n(1315)](127,g),e[n(385)](128,g)&&(e[n(562)](e[n(691)],n(1090))?(g=e[n(350)](te,s),m|=e[n(1576)](e[n(768)](127,g),7)):(_0x36b693=_0x16789a&&o[n(266)]("https:",_0x2f6837.protocol)?o[n(714)]:o[n(808)],_0xd2f221=_0x15386a[n(211)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),_0x525eb7=/^wss(.*:\/\/)/[n(1215)](_0x45c77f)?_0xbe2c07:""+_0x229ca5+_0x5f0818)))))}return{low:c|l<<28,high:e[n(1483)](e[n(1145)](l,4),e.KYxSl(m,24)),unsigned:t}}function bt(s,t){let n=r,o=e[n(1290)](t[n(1424)],0),c=(e[n(511)](t[n(1424)],28)|e[n(444)](t[n(1023)],4))>>>0,l=e[n(1290)](t[n(1023)],24),m=e[n(291)](0,l)?e[n(1341)](0,c)?o<16384?e.yeHuO(o,128)?1:2:e[n(1343)](o,2097152)?3:4:e[n(181)](c,16384)?e[n(1288)](c,128)?5:6:c<2097152?7:8:e[n(1362)](l,128)?9:10,g=ge(s,m),d=s[n(987)];switch(m){case 10:d[e.YpRPL(g,9)]=e[n(981)](e[n(1025)](l,7),1);case 9:d[e[n(1325)](g,8)]=e[n(1095)](9,m)?e[n(1483)](128,l):e[n(1118)](127,l);case 8:d[g+7]=e[n(1166)](8,m)?e[n(1559)](e.tiSWo(c,21),128):c>>>21&127;case 7:d[e[n(811)](g,6)]=m!==7?e[n(1103)](e.BDoNX(c,14),128):e[n(771)](e.kHGhD(c,14),127);case 6:d[g+5]=m!==6?e[n(945)](c>>>7,128):e[n(375)](c>>>7,127);case 5:d[e[n(811)](g,4)]=e[n(1095)](5,m)?128|c:e[n(301)](127,c);case 4:d[e[n(696)](g,3)]=e[n(489)](4,m)?e.ArXDf(e[n(131)](o,21),128):e[n(1145)](o,21)&127;case 3:d[e[n(613)](g,2)]=e.ZQsSk(3,m)?e[n(1500)](e[n(131)](o,14),128):e[n(1315)](e[n(1091)](o,14),127);case 2:d[e.mFFoi(g,1)]=e[n(172)](2,m)?e.XJVLG(o>>>7,128):e[n(240)](o,7)&127;case 1:d[g]=e[n(1398)](1,m)?128|o:127&o}}function Xr(s){return e.cMWMS(I,s)}function Gn(s){return e[r(1302)](E,s)}let $r=65536,Uo=e[r(198)],st=e[r(962)]($r,$r),Zr=e[r(736)](st,st),Qr=e[r(1032)](Zr,2),ze=String[r(257)+"e"].charCodeAt;class M{constructor(t,n,o){let c=r;this[c(256)]=!0,this.low=e[c(1520)](0,t),this[c(1023)]=e[c(1165)](0,n),this[c(1062)]=!!o}static[r(256)](t){let n=r;return t&&e[n(291)](!0,t[n(256)])}static fromBits(t,n,o){let c=r;if(e[c(263)]("sqALo",e[c(713)]))for(var l in _0x5e2f16)_0x22e57b.o(_0x3187ca,l)&&!_0x553707.o(_0x3db2c3,l)&&_0x53bfd7[c(1148)+c(418)](_0x4d0147,l,{enumerable:!0,get:_0x44b0e7[l]});else return new M(t,n,o)}static[r(847)+"s"](t,n,o){let c=r;return o?M[c(847)+c(599)](t,n):M[c(847)+c(676)](t,n)}static[r(847)+r(599)](t,n){let o=r;if(e[o(428)]===e[o(123)])_0x570283[o(719)](_0x2ac035);else return new M(e[o(1443)](e[o(1167)](e[o(1111)](t[0],e[o(1576)](t[1],8)),e[o(1129)](t[2],16)),e[o(519)](t[3],24)),e[o(1167)](e[o(1520)](e[o(397)](t[4],e.VVyoU(t[5],8)),e.vfDDo(t[6],16)),e[o(963)](t[7],24)),n)}static[r(847)+r(676)](t,n){let o=r;return new M(e[o(945)](e[o(1250)](e[o(890)](t[4],24),e.vfDDo(t[5],16))|e.bwanJ(t[6],8),t[7]),e[o(1111)](e[o(1097)](e[o(467)](t[0],24)|t[1]<<16,e[o(681)](t[2],8)),t[3]),n)}static fromHash(t){let n=r,o={pQmML:function(c,l){return c-l}};if(e.XYmut!==e[n(1099)])return e.dMZMr(t,Uo)?es:new M(e[n(131)](e.oZMTU(ze[n(480)](t,0)|e.gbnXo(ze[n(480)](t,1),8),e[n(519)](ze[n(480)](t,2),16))|e[n(598)](ze[n(480)](t,3),24),0),(e.PWtKx(e.IPtjM(ze.call(t,4),e.tsscV(ze[n(480)](t,5),8)),e.HsZtL(ze.call(t,6),16))|e.rzwPJ(ze[n(480)](t,7),24))>>>0,!0);if(_0x5017fd[n(1156)]!==4){let c=_0x50ad75.substring(0,XmPHYa[n(1579)](4,_0x3ce0cf[n(1156)])),l=c[n(936)](_0x58de9c);_0xf7d68a.push(l)}else _0x263ec2[n(157)](_0xbb110a);_0x1cefba&&(_0x4e7097+=1),_0x2e2d2c+=1,_0x31678f=!1}[r(1417)](){let t=r;return String[t(1337)+t(261)](e[t(183)](255,this[t(1424)]),e[t(492)](e.cqWxh(this[t(1424)],8),255),e.SFVIn(this[t(1424)],16)&255,e[t(1030)](this[t(1424)],24),255&this[t(1023)],e[t(538)](e[t(670)](this.high,8),255),e.UBgkF(this[t(1023)],16)&255,this[t(1023)]>>>24)}static[r(919)+"er"](t,n=!0){let o=r;if(e[o(1502)](isNaN,t))return n?Ko:es;if(n){if(t>=Zr)return Wo}else{if(e.MxekY(e[o(752)],e.pAnVw))return _0x529d6b?this.toBytesLE():this[o(358)+"E"]();if(e[o(988)](t,-Qr))return jo;if(e[o(520)](e[o(811)](t,1),Qr))return Ho}return M[o(185)](e[o(312)](e[o(972)](t,st),0),e[o(726)](e[o(1032)](t,st),0),n)}toNumber(){let t=r;return this[t(1062)]?e[t(1333)](e[t(1565)](e.YNTFa(this[t(1023)],0),st),e[t(439)](this[t(1424)],0)):e[t(203)](e[t(736)](this.high,st),this[t(1424)]>>>0)}[r(514)](){let t=r;return e[t(118)](0,this[t(1023)])&&this[t(1424)]===0}[r(270)](t){let n=r;if(e[n(1573)](e[n(645)],e[n(879)]))this[n(1185)](n(476),_0x6f1597),this.onclose&&this.onclose(_0x1c65a5);else{M[n(256)](t)||(t=M[n(919)+"er"](t));let o=e[n(670)](this[n(1023)],16),c=65535&this[n(1023)],l=e[n(1399)](this.low,16),m=e.tVeaE(65535,this[n(1424)]),g=t[n(1023)]>>>16,d=e.oPRhS(65535,t[n(1023)]),_=e[n(1030)](t.low,16),v=e[n(117)](65535,t.low),C=0,k=0,R=0,B=0;return B+=m+v,R+=e[n(555)](B,16),B&=65535,R+=e[n(244)](l,_),k+=e[n(1145)](R,16),R&=65535,k+=c+d,C+=k>>>16,k&=65535,C+=e[n(743)](o,g),C&=65535,M.fromBits(e.cYzWO(R<<16,B),e[n(469)](e[n(951)](C,16),k),this.unsigned)}}[r(1556)](t){let n=r;if(e[n(825)](e[n(445)],e[n(398)]))this[n(1193)]&&this._ws[n(1262)](_0x21aa5d),this[n(812)+n(1312)][_0x29b6de]=null;else return M[n(256)](t)||(t=M[n(919)+"er"](t)),e[n(1398)](this[n(1062)],t[n(1062)])&&e[n(1282)](e[n(311)](this.high,31),1)&&e[n(291)](t[n(1023)]>>>31,1)?!1:e[n(1252)](this[n(1023)],t[n(1023)])&&e.gYDpZ(this[n(1424)],t.low)}[r(867)](){let t=r;return e[t(406)](-1,this[t(1424)])&&e[t(1573)](-1,this[t(1023)])?M[t(185)](0,0,this.unsigned):e[t(291)](-1,this[t(1424)])?M[t(185)](0,this.high+1,this[t(1062)]):M[t(185)](this[t(1424)]+1,this[t(1023)],this.unsigned)}[r(1117)](t){let n=r;if(e[n(961)](e.NHbli,e.NHbli))return t?this[n(1370)+"E"]():this.toBytesBE();if(e[n(411)](n(668),typeof _0x375bfc)){let o=new _0x3cb986(e[n(1450)](_0x28e735,_0x5377ae));return e[n(956)](_0x4dcd2a,_0x96caa,o,0),o}return _0x1cd45f instanceof _0x4e77f0?new _0x1aae40(_0x4e2e4d):new _0xd9e01a(_0x589280[n(1060)],_0x213d6b[n(1338)+"et"],_0x17f828[n(742)+"th"])}[r(1370)+"E"](){let t=r;if(e.MjNTU!==e[t(635)])return this.unsigned?e[t(695)](e[t(1092)](this.high>>>0,_0x2a3139),this[t(1424)]>>>0):e[t(244)](e[t(736)](this[t(1023)],_0x2ba58),this.low>>>0);{let n=this[t(1023)],o=this[t(1424)];return[255&o,e[t(638)](e[t(459)](o,8),255),e[t(240)](o,16)&255,e[t(1209)](o,24),e[t(530)](255,n),e.lHzcw(e[t(322)](n,8),255),e[t(1007)](e[t(1564)](n,16),255),e[t(1356)](n,24)]}}toBytesBE(){let t=r,n=this[t(1023)],o=this[t(1424)];return[e.vmmTy(n,24),e[t(1586)](n>>>16,255),e[t(981)](e[t(511)](n,8),255),e[t(816)](255,n),e[t(409)](o,24),e[t(1186)](e.NQQUq(o,16),255),e[t(734)](e[t(785)](o,8),255),e[t(1587)](255,o)]}}let es=new M(0,0,!1),Ko=new M(0,0,!0),Ho=M[r(185)](-1,2147483647,!1),Wo=M[r(185)](-1,-1,!0),jo=M[r(185)](0,-2147483648,!1);var qe=(function(s){let t=r,n=e.kDoHB[t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":s[s["CONNECTI"+t(134)]=5002]=e[t(1349)];continue;case"1":s[s["NATIVE_E"+t(1475)]=5001]=t(1293)+t(1475);continue;case"2":s[s[e[t(563)]]=5005]=e.rtkmp;continue;case"3":s[s[e[t(192)]]=5004]=e[t(192)];continue;case"4":return s;case"5":s[s[t(1267)+"IES_ERROR"]=5003]=e[t(327)];continue}break}})({});class it{constructor(t){let n=r;this[n(523)]=t,this[n(937)]=null}}class ts extends it{constructor(t,n){let o=r;super(t),this[o(1314)]=n&&n[o(1314)]||null}}class ns extends it{constructor(t,n){let o=r,c=e.voWYe[o(1219)]("|"),l=0;for(;;){switch(c[l++]){case"0":this[o(1516)]=n&&n.filename||"";continue;case"1":super(t);continue;case"2":this[o(473)]=n&&n[o(473)]||0;continue;case"3":this[o(1314)]=n&&n[o(1314)]||"";continue;case"4":this[o(993)]=n&&n[o(993)]||0;continue;case"5":this[o(321)]=n&&n[o(321)]||null;continue;case"6":this[o(603)]=n&&n[o(603)]||5001;continue}break}}}class rs extends it{constructor(t,n){let o=r;super(t),this.code=n&&n[o(603)]||0,this[o(786)]=n&&n[o(786)]||"",this.wasClean=n&&n[o(1008)]||!1,this[o(1077)+o(1480)]=n&&n[o(1077)+"nnect"]||!1}}class ss extends it{constructor(t,n){let o=r;super(t),this.data=n&&n[o(1163)]||null}}class is extends ss{constructor(t,n){let o=r;super(t),this[o(1163)]=n&&n.data||null,this[o(1314)]=n&&n[o(1314)]||null}}class os extends it{constructor(t,n){let o=r;super(t),this[o(1163)]=n&&n[o(1163)]||null}}function ue(s,{message:t,code:n,error:o}){return new ns(s,{message:t,code:n,error:o})}function pe(s,{code:t,reason:n,wasClean:o,willReconnect:c}){return new rs(s,{code:t,reason:n,wasClean:o,willReconnect:c})}function as(s,{data:t,message:n}){return new is(s,{data:t,message:n})}function xs(s,{data:t}){return new os(s,{data:t})}function Jn(s,{message:t}){return new ts(s,{message:t})}class cs{constructor(t,n){let o=r;this.endpoints=t,this[o(1142)+"es"]=n,this["currentI"+o(647)]=0,this[o(151)+"ndpointT"+o(1080)+"t"]=0}[r(1042)+r(196)+"fig"](){let t=r;if(e[t(118)]("TjwOk",e.WFyJj))this[t(581)+t(647)]=0,this[t(151)+t(186)+t(1080)+"t"]=0;else{let n=_0x26f260[t(1451)+"g"](0,4-_0x3e64ec[_0x5b415b][t(1156)]),o=n.concat(_0x1b089[_0x177523]);_0x15abf5[t(157)](o)}}[r(1408)+"es"](){let t=r;this[t(151)+t(186)+t(1080)+"t"]=0}["getCurre"+r(1059)+"nt"](){let t=r;return this[t(1448)+"s"][this[t(581)+t(647)]]}[r(1100)+r(1059)+"ntTriesC"+r(1322)](){let t=r;if(e[t(1166)](e[t(809)],e.FAGZb))_0x47ba1a[t(1474)](_0x160985,_0x5260e0);else return this[t(151)+t(186)+"riesCount"]}[r(1244)+r(1410)+"es"](){let t=r;return!!(e[t(1098)](this[t(581)+t(647)],this[t(1448)+"s"][t(1156)])||e[t(282)](this[t(581)+"ndex"],this[t(1448)+"s"][t(1156)]-1)&&this[t(151)+t(186)+"riesCount"]===this[t(1142)+"es"])}[r(791)+r(839)+"ointReac"+r(1217)+r(710)](){let t=r;return e[t(838)](this["currentI"+t(647)],this.endpoints[t(1156)])?!0:this[t(151)+t(186)+"riesCount"]>this[t(1142)+"es"]}["replaceB"+r(302)+"pointAnd"+r(643)+r(660)](){let t=r;return this[t(151)+t(186)+t(1080)+"t"]=1,this[t(581)+t(647)]++,this.endpoints[this["currentI"+t(647)]]}["getCurrentEndpoi"+r(775)+r(251)](){let t=r;return this[t(151)+t(186)+"riesCount"]++,this.getCurrentEndpoint()}}let ot=(e[r(624)](e[r(1233)],typeof globalThis)&&e.jABKv(e[r(380)],globalThis[r(1013)+"tor"].name)||e[r(1330)](e[r(1233)],typeof window)&&e[r(380)]===window[r(1013)+"tor"][r(1101)])&&e[r(1224)](e[r(1233)],typeof document),Je=e.VjbsV!=typeof globalThis&&(e[r(855)]===globalThis[r(1013)+r(874)][r(1101)]||e[r(574)](e[r(324)],globalThis[r(1013)+r(874)][r(1101)]))&&e[r(1330)](e[r(1233)],typeof tt),vt=(e[r(1233)]!=typeof globalThis&&e.sPRCm(r(834),globalThis["construc"+r(874)][r(1101)])||e[r(954)](e[r(1233)],typeof globalThis)||e.TCDcr(e[r(1233)],typeof globalThis)&&!!globalThis[r(880)+r(659)])&&e.mFyKq(e[r(1233)],typeof wx),St=e.PscMK(e[r(1233)],typeof globalThis)&&(e.nLota(e[r(324)],globalThis[r(1013)+r(874)][r(1101)])||e[r(1078)]("SharedWorkerGlob"+r(1411),globalThis[r(1013)+"tor"][r(1101)])||e[r(208)]===globalThis[r(1013)+"tor"][r(1101)])&&r(629)+"d"!=typeof self,Go=e[r(624)](e[r(1233)],typeof globalThis)&&e[r(432)]("Object",globalThis["construc"+r(874)].name)&&e[r(1532)](e[r(1233)],typeof global)&&e[r(918)](e[r(855)],global[r(1013)+r(874)].name)&&e[r(1233)]!=typeof process&&!!process[r(746)];class Vn{constructor(){let t=r;e[t(1249)](e.liaGy,"tNaxj")?this[t(1190)+"rs"]={}:_0x300692.resolve()[t(1115)](()=>{let n=t;this[n(470)+n(1139)]()})}emit(t,...n){let o=r,c=this[o(1190)+"rs"][t];if(c)c[o(369)]()[o(457)](l=>l.fn[o(1232)](l[o(1251)],n));else if(e[o(673)](o(321),t)&&!this.onerror)if(o(404)===e[o(524)]){let l=n.length&&n[0];if(e[o(1353)](l,Error))throw l;let m=new Error(e[o(392)](o(224)+o(170),l?e.jgrJq(e.iiXfR(" (",l[o(1314)]),")"):""));throw m.context=l,l}else{if(!this[o(866)+"orOnline"]()||this[o(1368)+o(1133)])return;this[o(642)+o(1347)]?.[o(1042)+o(196)+o(228)](),this["_pingLos"+o(783)]?.["resetCou"+o(195)](),this._ws?this["_disconn"+o(1124)](1001,o(966)+o(664)+"reconnec"+o(221)+o(804),!0):this[o(920)]()}return this}[r(985)](t,n){let o=r;if(e[o(673)](void 0,t))this[o(1190)+"rs"]={};else if(e[o(513)](void 0,n))this._listeners[t]=null;else{let c=this[o(1190)+"rs"][t];if(c)for(let l=0;e[o(253)](l,c[o(1156)]);)c[l].fn===n?c[o(996)](l,1):++l}return this}on(t,n,o){let c=r;return(this[c(1190)+"rs"][t]||(this[c(1190)+"rs"][t]=[])).push({fn:n,ctx:o||this}),this}}class Jo extends Vn{[r(1183)+r(1194)+r(1304)](t){let n=r;return t[n(328)]||t[n(218)]?(n(1048)+" "+(t.errMsg||"")+n(441)+(t.errNo||""))[n(239)]():JSON.stringify(t)}constructor(t,n,o){let c=r;super(),this[c(1533)]=null,vt&&wx["connectS"+c(1506)]&&(this._socket=wx[c(829)+c(1506)]({url:t,protocols:n,header:o,fail:this["_createSocketFai"+c(1155)][c(433)](this),success:this["_createS"+c(147)+"cessHandler"][c(433)](this)})),Je&&tt[c(829)+c(1506)]&&(this[c(1533)]=tt["connectS"+c(1506)]({url:t,protocols:n,header:o,fail:this[c(1176)+c(689)+c(1155)][c(433)](this),success:this[c(1176)+c(147)+c(386)+c(639)][c(433)](this)}))}[r(1176)+r(147)+r(386)+r(639)](){let t=r;Promise[t(1164)]()[t(1115)](()=>{this[t(470)+"steners"]()})}[r(1176)+r(689)+r(1155)](t){let n=r,o={slbhp:function(c,l,m){return e[O(1305)](c,l,m)},ZXEBF:"error",CWegQ:n(476)};e[n(1573)](e[n(1085)],e[n(1107)])?(_0x14c5c2=_0x2ef391[e[n(784)](_0x36130a+_0x345e7c,1)],_0x450e5c=_0x3ad5e6[e[n(382)](e[n(1018)](_0x33dfb1,_0x4e9f75),2)],e[n(1088)](e[n(538)](e[n(1097)](_0x397c26,_0x138b0d<<8),49344),32896)?_0x1477c2+=_0x1f9dd2:(_0x3457f8=e.rMEMN(15,_0x4e72fe)<<12|e.UMbWD(e[n(738)](63,_0x1a1454),6)|e[n(616)](63,_0x27d248),e[n(527)](_0x862e6e,2048)||e[n(744)](_0x1bc481,55296)&&e[n(701)](_0x254f9f,57343)?_0x15982f+=_0x406e1b:(_0x26a512+=_0x20aace(_0x42ca71),_0x4e42c0+=2))):Promise[n(1164)]().then(()=>{let c=n,l=o[c(926)](ue,o[c(1015)],{message:this[c(1183)+c(1194)+c(1304)](t)});this[c(1185)](o[c(1015)],l);let m=o[c(926)](pe,o[c(1336)],{reason:this["_formatE"+c(1194)+c(1304)](t)});this[c(1185)](c(476),m)})}[r(470)+r(1139)](){let t=r,n={sZzFd:e[t(708)],QJtDR:function(o,c){return e.YmZLC(o,c)},LhYxl:e.dXwpj,hhAyb:t(1314),KLAtM:function(o,c,l){return e[t(990)](o,c,l)}};this[t(1533)].onOpen(o=>{let c=t;this[c(1185)](e[c(820)],e[c(462)](xs,e.qLPbW,{...o,data:o.errMsg||""}))}),this._socket.onClose(o=>{let c=t;this[c(1185)](c(476),e.uGcnl(pe,e[c(994)],{...o}))}),this[t(1533)][t(1434)+"e"](o=>{let c=t;n[c(646)](n[c(422)],n[c(422)])?(this[c(1193)]&&this[c(1193)][c(1262)](_0x40eb30),this._debug(n[c(619)],_0x1c8092)):this[c(1185)](n[c(176)],n[c(160)](as,c(1314),{...o}))}),this[t(1533)][t(1265)](o=>{let c=t;this[c(1185)](e[c(365)],e[c(882)](ue,e[c(365)],{...o,message:o[c(328)]||""}))})}[r(1262)](t){let n=r,o={lsVbn:n(321),kMLKm:function(c,l,m){return e[n(1123)](c,l,m)},wZCWA:function(c,l){return e.vCrfs(c,l)},xHWou:function(c,l){return e.NWZuI(c,l)},JZZBd:function(c,l){return e[n(741)](c,l)}};if(e.pnKfr(e[n(232)],e[n(232)]))if(t instanceof Uint8Array)if(e[n(1566)](e[n(716)],n(1225)))_0x5a3cdd&&_0x5c2b45["addEvent"+n(1499)](gbTWjn[n(994)],()=>_0x2ec925()),_0x2b4a5c&&_0x15dbd6[n(727)+n(1499)](gbTWjn[n(1419)],()=>_0x41090d());else{let c=t[n(1060)][n(369)](t.byteOffset,e.UIVME(t[n(742)+"th"],t[n(1338)+"et"]));this[n(1533)]&&this[n(1533)][n(1262)]({data:c,fail:l=>{let m=n;this[m(1185)](o[m(401)],o[m(753)](ue,"error",{message:this._formatErrorMessage(l)}))}})}else this[n(1533)]&&this[n(1533)].send({data:t,fail:c=>{let l=n;this[l(1185)](o[l(401)],o.kMLKm(ue,l(321),{message:this[l(1183)+"rrorMess"+l(1304)](c)}))}});else _0x24d4cf-=65536,_0x34e9f6+=_0x19b08c(NNDjMK[n(1037)](_0x426738,10)+55296,NNDjMK.xHWou(NNDjMK[n(296)](1023,_0x2b33a0),56320)),_0x4139cd+=3}[r(476)](t,n){let o=r;this._socket&&this._socket[o(476)]({code:t,reason:n})}addEventListener(t,n){this.on(t,n)}[r(977)+r(597)+r(1017)](t,n){this[r(985)](t,n)}get[r(1379)+"te"](){let t=r;return this[t(1533)][t(1379)+"te"]}get[r(1108)+"pe"](){return this[r(1533)].binaryType}set[r(1108)+"pe"](t){}get url(){let t=r;return this[t(1533)][t(215)]}get protocol(){let t=r;return this[t(1533)][t(986)]}get[r(774)+"ns"](){return this[r(1533)].extensions}get[r(1540)+r(605)](){let t=r,n={HOHba:t(1044)+"0"};if(e[t(657)](t(1160),t(1160)))return 0;{let o=n[t(815)][t(1219)]("|"),c=0;for(;;){switch(o[c++]){case"0":this._connect();continue;case"1":this[t(1368)+t(1133)]=!1;continue;case"2":this[t(642)+t(1347)]?.resetEndpointConfig();continue;case"3":this["_pingLos"+t(783)]?.[t(1388)+t(195)]();continue;case"4":this._isInit=!0;continue}break}}}}function Vo(s,t){let n=r;if(t)return new t(s.url,s[n(986)]);if(e.GlYPz(vt,Je))return new Jo(s[n(215)],s[n(986)],s.headers);if((ot||St)&&e[n(234)](e[n(1233)],typeof WebSocket)&&WebSocket)return new WebSocket(s[n(215)],s[n(986)+"s"])}function Yo(s){let t=r,n=e[t(1086)][t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":return!1;case"1":if(Je&&tt[t(829)+t(1506)])return!0;continue;case"2":if(vt&&wx[t(829)+"ocket"])return!0;continue;case"3":if((ot||St)&&e[t(1233)]!=typeof WebSocket&&WebSocket)return!0;continue;case"4":if(s)return!0;continue}break}}function fs(s,t,n){let o=r,c={iGQzM:function(l,m){return e[O(1096)](l,m)},LUwGA:function(l,m){return e[O(411)](l,m)},fvywh:"string",PsytO:function(l,m){return e[O(1405)](l,m)},mlkfN:e[o(254)],ddrik:function(l,m){return e[o(1270)](l,m)},MaQrS:e[o(1457)],yTxCr:function(l,m){return e.IWraN(l,m)},wCmfZ:e.dHZqr,pNOur:function(l,m){return e[o(1253)](l,m)},NCnFa:function(l,m){return e[o(1588)](l,m)}};if(e[o(161)](e[o(682)],e[o(682)]))return e[o(156)](e[o(1069)](_0x573d48,4)[o(1505)]("0"),_0x445496(_0x23baae,2).toString(16)).slice(-4);{let l=-1;async function m(g){let d=o;if(c.ddrik(d(1e3),c[d(136)]))return c[d(758)](g,l)?Promise[d(697)](new Error(c[d(1027)])):(l=g,c[d(318)](g,n[d(1156)])?Promise[d(1164)]():n[g].bind(s)(t,m.bind(null,c.NCnFa(g,1))));{let{url:_}=c[d(182)](_0x336dc9,{}),v=_0x20ad06[d(623)](_)?_:c.LUwGA(c[d(204)],typeof _)?[_]:[];_0x19a7d2&&_0x32b88e[d(1300)](this[d(952)],_0x60738e),v&&v[d(1156)]?this[d(642)+d(1347)]=new _0x3d80e2(v,this[d(952)].maxRetries):this[d(642)+d(1347)]?.["resetEnd"+d(196)+d(228)](),this[d(1513)+"sCounter"]?.[d(1388)+d(195)](this[d(952)].pingLossCount),this[d(1368)+"osed"]=!1,this[d(1193)]&&c[d(1568)](this._ws[d(1379)+"te"],this[d(317)])?this[d(1020)+d(1124)](1e3,c[d(872)],!0):(this[d(275)]=!0,this[d(920)]())}}e[o(679)](m,0)}}function us(s){let t=r,n=0,o=0;for(let c=0;e[t(769)](c,s.length);++c)if(e[t(1192)](e[t(949)],e[t(949)]))o=s[t(265)+"At"](c),e[t(693)](o,128)?n+=1:e[t(1376)](o,2048)?n+=2:e[t(1439)](e[t(616)](64512,o),55296)&&e.uWDJz(e[t(497)](64512,s[t(265)+"At"](c+1)),56320)?(++c,n+=4):n+=3;else return _0x321d7f||(_0x46e0e0=[_0x2819d6[t(257)+"e"][t(1464)],_0x5d395e[t(257)+"e"][t(1531)],_0xf1044c[t(257)+"e"][t(1531)+t(860)+"ey"]]);return n}function ds(s,t,n){let o=r;if(e[o(837)](n-t,1))return"";let c="";for(let l=t;e[o(837)](l,n);){let m=s[l++];if(e.IWraN(m,127))c+=String[o(1337)+"Code"](m);else if(e.CDrNS(m,192)&&e[o(1362)](m,224))c+=String["fromChar"+o(261)](e[o(1250)](e.UMbWD(31&m,6),e[o(1118)](63,s[l++])));else if(e.CDrNS(m,224)&&m<240)c+=String[o(1337)+o(261)](e[o(1171)](e[o(741)](15,m)<<12,e[o(921)](63&s[l++],6))|e[o(734)](63,s[l++]));else if(e[o(520)](m,240)){let g=e[o(1149)](e[o(1443)](e[o(648)](e[o(850)](7,m)<<18,e.zpOLd(e[o(1298)](63,s[l++]),12))|e.bvtMm(e.SAAiO(63,s[l++]),6),63&s[l++]),65536);c+=String["fromChar"+o(261)](e.cyKoK(55296,e.DHXtF(g,10))),c+=String[o(1337)+"Code"](56320+(1023&g))}}return c}function Yn(s,t,n){let o=r,c=n,l,m;for(let g=0;e[o(1362)](g,s[o(1156)]);++g)if(l=s.charCodeAt(g),l<128)t[n++]=l;else if(e[o(503)](l,2048))if(e[o(1409)]===o(730)){let d=_0x51aadd.bytes,_=_0x33f451[o(142)],v=_0x3ce1f3[o(342)],C=_+_0x41ffb6;if(e[o(1134)](C,d.length)){let k=new _0x2b080e(2*C);k[o(1474)](d),_0x421a27[o(987)]=k}return _0x195763.offset=C,e[o(233)](C,v)&&(_0x226aeb.limit=C),_}else t[n++]=e[o(726)](e.DHXtF(l,6),192),t[n++]=e[o(913)](e.pmfSQ(63,l),128);else if(e[o(1041)](64512,l)===55296&&e[o(333)](e[o(301)](64512,m=s[o(265)+"At"](e[o(1226)](g,1))),56320)){let d=e[o(1045)][o(1219)]("|"),_=0;for(;;){switch(d[_++]){case"0":t[n++]=e[o(1250)](e[o(440)](l,12)&63,128);continue;case"1":t[n++]=e[o(1383)](e[o(1041)](e[o(504)](l,6),63),128);continue;case"2":t[n++]=e[o(393)](e[o(1595)](63,l),128);continue;case"3":++g;continue;case"4":t[n++]=e[o(1594)](e.vCrfs(l,18),240);continue;case"5":l=e[o(392)](65536+(e[o(1587)](1023,l)<<10),e[o(495)](1023,m));continue}break}}else t[n++]=e.Qytvk(e[o(1326)](l,12),224),t[n++]=e[o(1558)](e.vCrfs(l,6),63)|128,t[n++]=e[o(329)](e[o(1118)](63,l),128);return e[o(1438)](n,c)}async function ls(s){let t=r;if(e[t(159)]==typeof s){let n=new Uint8Array(e[t(1496)](us,s));return e[t(910)](Yn,s,n,0),n}return e[t(1353)](s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s[t(1060)],s[t(1338)+"et"],s[t(742)+"th"])}function Xo(s){let t=r;if(e[t(1465)]===e[t(1465)])try{return e[t(481)](t(668),typeof s)&&(e[t(1353)](s,ArrayBuffer)||s.buffer&&s.buffer instanceof ArrayBuffer)||e[t(481)](e.LPMIl,typeof s)?"":(JSON[t(677)](s),e[t(1366)])}catch{return e[t(760)](e.LPMIl,typeof s)?e.HeVjv:""}else{let n=255&_0x323e07;_0x49dde8(n,_0x3ef257,_0x1832a9+_0x2b724c),_0x45225f>>>=8,_0x13a5e2--}}let $o=(s,t)=>{let n=r;if(e[n(825)](e.XGHfV,e[n(1354)]))_0x14c2ba.persisted&&(N[n(866)+n(372)]()&&(!N[n(1193)]||N[n(1193)][n(1379)+"te"]!==N[n(1339)]||e[n(236)](N[n(1193)][n(1379)+"te"],N[n(1452)+"NG"]))&&N[n(141)+"nLine"](),N[n(531)+"er"]&&_0x1795ca[n(727)+n(1499)](e[n(537)],N[n(141)+"nLine"]),N[n(531)+"er"]&&_0xf7a95b[n(727)+"Listener"]("offline",N[n(141)+n(482)]));else switch(s){case e[n(1222)]:case e[n(1348)]:return{[n(1481)+s]:1,"x-tt-env":t};default:return{}}};class Zo{constructor(t){let n=r;this[n(436)+n(1322)]=t,this[n(454)]=0}addCount(){let t=r;this[t(454)]++}["checkRea"+r(550)+"nt"](){let t=r;return e[t(1098)](this[t(454)],this[t(436)+t(1322)])}["resetCou"+r(195)](t=0){let n=r;this[n(436)+n(1322)]=t,this[n(454)]=0}}async function Qo(s){let t=r,n={TrpoP:function(o,c){return e[O(1446)](o,c)},ExnPR:function(o,c){return o(c)},LMicw:e[t(345)],ANdje:e[t(900)],NCCWo:t(912)+"ascript",CiRBh:function(o,c){return e[t(488)](o,c)},RjQoF:"http",RLQDA:function(o,c){return o(c)}};return new Promise(o=>{let c=t,l={FipCz:function(m,g){return n[O(586)](m,g)},VGqiG:"unknown "+c(786)};if(!ot)return n[c(1332)](o,n[c(1053)]);try{let m=document[c(772)+"ement"](n[c(448)]);window[c(1179)+c(426)]=g=>{let d=c;document[d(279)].removeChild(m),window[d(1179)+d(426)]=void 0,l[d(1084)](o,g&&g[d(805)]||l[d(130)])},m[c(523)]=n[c(573)],m[c(1144)]=n[c(602)](s[c(211)](/^ws/,n[c(423)]),c(1382)+c(1360)+c(733)+"P");try{document[c(279)][c(286)+c(923)](m)}catch{document[c(279)]["removeCh"+c(923)](m)}}catch{window[c(1179)+c(426)]=void 0,n.RLQDA(o,c(238)+"reason")}})}function Fe(s,t,n){let o=r;return!!s?.[o(349)](c=>c.key===t&&c[o(450)]===n)}function at(s,t){let n=r;return s?.[n(349)](o=>o[n(226)]===t)?.[n(450)]}let Xn=null;async function e0(){let s=r;return Xn||(Xn=Promise[s(1164)]()[s(1115)](ve[s(433)](ve,e[s(242)]))),Xn}class t0 extends Vn{constructor(t,n){let o=r;super(),this[o(797)]=t,this[o(456)]=n,this._qosDB=void 0,this[o(699)+o(1528)]=null}async[r(499)](){await this[r(1493)]()}async[r(1493)](){let t=r,n={WAbBw:function(o){return e[O(817)](o)},Oqpqu:function(o,c,l,m){return e.ctljT(o,c,l,m)}};if(!this[t(1260)]){if(this[t(699)+t(1528)])return this[t(699)+t(1528)];try{let o=this[t(797)],c=this[t(456)];this[t(699)+"mise"]=(async()=>{let l=t,{openDB:m}=await n[l(487)](e0);this[l(1260)]=await n[l(206)](m,l(1179)+"_"+o,1,{upgrade(g){let d=l;g[d(1132)+d(1363)+"e"](o,{keyPath:c})}})})(),await this[t(699)+t(1528)]}catch(o){console[t(719)](o)}finally{this[t(699)+"mise"]=null}}}async[r(1174)](t){let n=r;try{return await this[n(1493)](),this[n(1260)]?.[n(1174)](this[n(797)],t)}catch(o){console.log(o)}}async[r(1474)](t,n){let o=r;return await this[o(1493)](),this._qosDB?.[o(848)](this[o(797)],t)}async[r(984)](t){let n=r;try{return await this[n(1493)](),this[n(1260)]?.[n(782)](this[n(797)],t)}catch(o){console[n(719)](o)}}async[r(222)](){let t=r,n={vppBP:function(o,c){return e[O(744)](o,c)}};try{return t(539)!=="ctPam"?(await this[t(1493)](),this[t(1260)]?.[t(222)](this[t(797)])):cqGMWR[t(1248)](_0x264df4.offset,_0xc64fef[t(342)])}catch(o){e.Wyqcw(e.GctGC,t(975))?console[t(719)](o):(_0x4ff520=_0x58d84a[e.mFPtH(_0x2b782f,_0x2424ec)+1],_0x123119=_0x498bb6[e[t(743)](_0x3550d4,_0x3738da)+2],_0x2f33a5=_0x3f3725[e.cyKoK(_0x39196c,_0x45e0a6)+3],e[t(1397)](e[t(1443)](e[t(1033)](_0x5dca41,e[t(1393)](_0x33765d,8)),e[t(522)](_0x12a57b,16))&12632256,8421504)?_0x4800cf+=_0x57e0e5:(_0x32c04f=e.vBTGG(e[t(237)](e.zvWPX(e[t(762)](e[t(773)](7,_0x807880),18),e[t(1427)](e.QgTbW(63,_0x488c23),12)),e[t(921)](63&_0x49a1c8,6)),e[t(309)](63,_0x4f6f8a)),e[t(1350)](_0x51862d,65536)||e.eUXJw(_0x5d7132,1114111)?_0x579bbc+=_0x526022:(_0x30d2c7-=65536,_0x2b1906+=e[t(1305)](_0x20e937,e.TWyky(e[t(460)](_0x305702,10),55296),e[t(1118)](1023,_0x579338)+56320),_0x5df484+=3)))}}async[r(1311)](){let t=r;return e[t(1114)](e[t(1043)],e.mbdSa)?(await this[t(1493)](),this[t(1260)]?.[t(1477)+"ys"](this._dbName)):!!this[t(1260)]}async[r(929)](){let t=r;return await this[t(1493)](),this[t(1260)]?.[t(929)](this[t(797)])}async[r(971)](){let t=r;try{this[t(1260)]?.close(),this[t(1260)]=void 0}catch(n){console.log(n)}}get isReady(){let t=r;try{return!!this[t(1260)]}catch(n){return console[t(719)](n),!1}}}class n0{constructor(t,n){let o=r;if(e[o(354)](e[o(438)],e[o(494)]))this._DBName=t,this._pathKey=n,this[o(1260)]=localStorage;else{if(this._ws&&this._ws[o(1379)+"te"]===this[o(1452)+"NG"]){this[o(715)+o(294)](),this[o(1170)+"gTimeoutId"]=_0x343aaf(this[o(1373)].bind(this),this._options[o(685)+o(1140)]);return}if(!this._ws||this[o(1193)][o(1379)+"te"]!==this[o(1339)])return void this[o(1342)+o(895)]();this[o(1193)]&&this[o(1193)].send("hi"),this["_reconne"+o(688)+"tId"]=_0x5c91f3(this[o(1342)+"econnect"+o(589)].bind(this),this[o(952)][o(278)+o(998)+o(447)])}}async[r(499)](){}get[r(854)](){let t=r,n={jvLch:function(o,c){return e[O(706)](o,c)},enuOD:function(o,c,l){return e.kDNDX(o,c,l)}};if(e[t(348)](e.KNlwn,"QAyqr"))n.jvLch(_0x5e8dad,this[t(1521)+"lTimeoutId"]),this[t(1521)+"lTimeoutId"]=n[t(788)](_0x347844,()=>{let o=t;this[o(1515)+o(793)]()},this[t(1521)+"l"]);else return t(1179)+"_"+this[t(953)]}async get(t){let n=r,o=this[n(1260)][n(1458)](this[n(854)]);return JSON.parse(e[n(869)](o,"{}"))[t]}async[r(1474)](t,n){let o=r,c=this[o(1260)].getItem(this[o(854)]),l=JSON[o(677)](e[o(1127)](c,"{}"));return l[n||t[this[o(1246)]]]=t,this[o(1260)][o(1473)](this[o(854)],JSON[o(1227)+"y"](l)),n||t[this[o(1246)]]}async del(t){let n=r,o=this[n(1260)].getItem(this._prefix),c=JSON[n(677)](e[n(995)](o,"{}"));return c[t]=void 0,this._qosDB.setItem(this[n(854)],JSON[n(1227)+"y"](c))}async[r(222)](){let t=r;return this[t(1260)][t(222)]()}async[r(1311)](){let t=r,n=this._qosDB[t(1458)](this[t(854)]),o=JSON[t(677)](n||"{}");return Object[t(1311)](o)}async[r(929)](){let t=r,n=this[t(1260)].getItem(this._prefix),o=JSON.parse(e.weGvL(n,"{}"));return Object.values(o)}[r(971)](){return Promise[r(1164)]()}get[r(1001)](){let t=r,n={DuQZS:e[t(994)],aCZSk:function(o,c,l){return o(c,l)}};if(e[t(484)](e[t(907)],e.NOZKP))return!!this[t(1260)];this[t(1185)](WchIyh[t(1468)],WchIyh[t(1403)](_0xc71797,WchIyh[t(1468)],{..._0x37ffb4}))}}class r0{constructor(t,n){let o=r;this._DBName=t,this._pathKey=n,this[o(1260)]=Je?tt:vt?wx:null}async[r(499)](){}get[r(854)](){let t=r;return t(1179)+"_"+this[t(953)]}async[r(1174)](t){let n=r,o=this[n(1260)]["getStora"+n(728)](this[n(854)]);return JSON[n(677)](e.VTnkO(o,"{}"))[t]}async[r(1474)](t,n){let o=r,c={rivBI:function(l,m){return l>=m}};if(e[o(790)](e.YbbER,o(1548)))return xHUmKi[o(778)](this[o(454)],this[o(436)+o(1322)]);{let l=this[o(1260)]["getStora"+o(728)](this[o(854)]),m=JSON[o(677)](l||"{}");return m[n||t[this._pathKey]]=t,this[o(1260)]["setStora"+o(728)](this[o(854)],JSON[o(1227)+"y"](m)),n||t[this[o(1246)]]}}async del(t){let n=r;if(e.MFnxM(e[n(506)],e[n(506)])){let o=this[n(1260)][n(126)+n(728)](this._prefix),c=_0x5e3edf.parse(o||"{}");return c[_0x29310c||_0x5d05f2[this._pathKey]]=_0x472f83,this[n(1260)][n(191)+n(728)](this._prefix,_0x260420.stringify(c)),_0x16e94c||_0x3833fc[this._pathKey]}else{let o=this._qosDB[n(126)+n(728)](this._prefix),c=JSON[n(677)](e.FiZNU(o,"{}"));return c[t]=void 0,this[n(1260)][n(191)+n(728)](this[n(854)],JSON[n(1227)+"y"](c))}}async[r(222)](){let t=r;return this[t(1260)][t(840)+t(1289)]()}async[r(1311)](){let t=r,n={KIXaj:function(o,c){return e[O(1096)](o,c)}};if(e[t(1317)](e[t(1421)],e[t(529)])){let o=this[t(1260)][t(126)+t(1487)+"nc"](this[t(854)]),c=JSON[t(677)](e[t(1563)](o,"{}"));return Object[t(1311)](c)}else{let o=this[t(1260)].getItem(this[t(854)]),c=_0x32aecf[t(677)](MqqBOt[t(554)](o,"{}"));return _0x48bd6f[t(370)](c)}}async[r(929)](){let t=r,n=this[t(1260)]["getStora"+t(1487)+"nc"](this._prefix),o=JSON[t(677)](e.GlYPz(n,"{}"));return Object[t(370)](o)}[r(971)](){return Promise.resolve()}get isReady(){return!!this[r(1260)]}}function hs(s,t){let n=r;if(e.YSAWF(Je,Je))return new r0(s,t);if(e[n(1318)](ot,St)&&n(629)+"d"!=typeof indexedDB)return new t0(s,t);if(e.LnTCZ(ot,St)&&e[n(624)](e[n(1233)],typeof localStorage))return new n0(s,t);throw new Error(e[n(1180)])}class s0{constructor(){let t=r;this[t(1521)+"lTimeoutId"]=null,this[t(1521)+"l"]=36e5,this[t(1260)]=hs(e[t(526)],t(137)+"id")}async[r(1521)+r(378)](){let t=r,n={vLYGI:e[t(159)],vsMeG:function(o,c){return e[t(614)](o,c)},vcYLy:e[t(1143)],IEXuG:t(1177)};e[t(1261)](clearInterval,this[t(1521)+t(944)+"Id"]),this[t(1521)+t(944)+"Id"]=e[t(1198)](setInterval,()=>{let o=t,c={jeYWl:function(l,m){return l!=m},LJrlP:n[o(585)],dXMBr:function(l,m){return l instanceof m},LIwLo:o(851)+o(414)};if(n[o(615)](n[o(1236)],n.IEXuG))this[o(1515)+"ired"]();else return ajBWZp.jeYWl(ajBWZp[o(413)],typeof _0x19dd94)&&(ajBWZp[o(553)](_0x4b065d,_0x45cfe7)||_0x42cfd1[o(1060)]&&ajBWZp[o(553)](_0x3e9ecb[o(1060)],_0x2583bd))||ajBWZp[o(1560)](ajBWZp.LJrlP,typeof _0x2b7a5e)?"":(_0x2872f0[o(677)](_0x4bd376),ajBWZp[o(704)])},this[t(1521)+"l"])}async openDB(){let t=r;await this[t(1260)][t(499)]()[t(1115)](()=>{let n=t,o={oHdIQ:e[n(408)]};e[n(245)](e[n(1064)],e[n(496)])?(this._isBrowser&&_0x2124cd[n(977)+n(597)+n(1017)]("pagehide",this[n(502)+"ageHide"]),this._isBrowser&&_0x206ac6[n(977)+n(597)+"ner"](o[n(835)],this[n(502)+n(658)]),this[n(476)]()):this[n(1521)+"lFlush"]()})}async[r(1515)+r(793)](){let t=r;if(e[t(948)]!==e[t(651)])(await this[t(1260)]?.[t(929)]()||[])[t(463)](({timestamp:c})=>c<Date.now()).forEach(c=>{let l=t;this[l(1260)]?.[l(984)](c[l(137)+"id"])});else{let n=_0x5974b9[t(1156)]&&_0x4098a2[0];if(e.EGppy(n,_0x327bc5))throw n;let o=new _0x34a803(e[t(521)](e[t(1375)],n?e[t(1309)](" (",n[t(1314)])+")":""));throw o[t(618)]=n,n}}async[r(984)](t){let n=r;return this[n(1260)]?.[n(984)](t)}async[r(1474)](t,n){let o=r;return this._qosDB?.[o(1474)]({message_id:t,timestamp:n})}async[r(1174)](t){return this._qosDB?.get(t)}async[r(971)](){let t=r;e[t(1303)](clearInterval,this[t(1521)+"lTimeoutId"]),await this[t(1260)]?.closeDB()}get[r(1001)](){let t=r;return this[t(1260)]?.[t(1001)]}}function $n(s){let t=r,n=!!this[t(952)][t(1412)+"S"];if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=e.vwskh(Fe,s[t(1314)][t(1437)],e[t(165)],"2"),c=o&&e[t(535)](Fe,s[t(1314)][t(1437)],t(347)+t(947)+"ck","1"),l=o&&e[t(1404)](Fe,s.message[t(1437)],e[t(316)],"1"),m=l?e[t(863)](at,s[t(1314)][t(1437)],e.dtUQb)?.[t(1219)](",")[t(463)](Boolean)||[]:[];return{enabled:n,isQoSMessage:o,isQoSAck:c,isAckCleanupMessage:l,ackMsgIds:m}}async function gs(){let s=r;return this[s(1301)+"ger"]||(this[s(1301)+"ger"]=new s0),this[s(1301)+"ger"][s(1001)]||await this._QoSManager[s(499)](),this[s(1301)+s(1264)]}async function i0(s,t){let n=r;if(e[n(1039)](e.dUptJ,e[n(1486)])){let{enableAutoAck:o}=this._options,c=e[n(535)](Fe,s[n(1314)][n(1437)],n(577),"1"),l=Fe(s.message[n(1437)],e[n(729)],"1"),m=$n[n(480)](this,s);if(e[n(491)](o,c)){let{SeqID:g,LogID:d,service:_,LogIDNew:v,method:C}=s.message;this[n(1530)]({SeqID:g,LogID:d,LogIDNew:v,service:_,method:C,headers:[{key:e[n(729)],value:"1"},{key:e[n(290)],value:e[n(1563)](v,"")},{key:e[n(536)],value:"0"}]})}l&&!m[n(687)]&&this[n(1319)+n(1214)+n(143)](s),e[n(969)](t)}else{if(this._options["disableA"+n(1172)+n(1150)]||this["_readyCl"+n(1133)])return;this[n(1342)+n(895)]()}}async function o0(s,t){let n=r;this[n(777)](e[n(1324)],s[n(1314)]),e[n(1310)](t)}async function a0(s,t){let n=r,o={stnvc:function(c,l,m){return e[O(877)](c,l,m)}};if(e[n(765)]===n(960)){let c=e[n(1303)](Xr,await e[n(748)](ls,s[n(1163)]));try{if(c[n(720)]instanceof Uint8Array){let l=this[n(952)][n(943)+n(534)]instanceof Object?{force:!!this._options["payloadE"+n(534)][n(1240)],encoding:this[n(952)][n(943)+n(534)].encoding?this._options[n(943)+"ncoding"].encoding[n(211)](/\s/g,"")["toLowerC"+n(857)]():""}:{force:!1,encoding:this[n(952)][n(943)+"ncoding"]?this._options[n(943)+n(534)][n(211)](/\s/g,"")[n(395)+n(857)]():""},m=c["payloadE"+n(534)]?c[n(943)+n(534)][n(211)](/\s/g,"")[n(395)+"ase"]():"",g=e[n(654)](this[n(952)]["payloadT"+n(477)],Object)?{force:!!this[n(952)][n(1387)+n(477)][n(1240)],type:this._options[n(1387)+"ype"][n(523)]?this[n(952)].payloadType[n(523)][n(211)](/\s/g,"")[n(395)+n(857)]():""}:{force:!1,type:this[n(952)][n(1387)+"ype"]?this._options.payloadType.replace(/\s/g,"")["toLowerC"+n(857)]():""},d=c[n(1387)+n(477)]?c[n(1387)+n(477)].replace(/\s/g,"")[n(395)+n(857)]():"",_=g[n(1240)]?g[n(523)]:d||g[n(523)],v=l[n(1240)]?l.encoding:m||l[n(1286)],C=[e.HeVjv,n(851)+"ion/json","applicat"+n(414)+n(1585)+n(1242),n(668)],k=[e[n(1552)],"binary"];this[n(952)]["enableTr"+n(732)+n(125)+"ad"]&&C.includes(_)&&(!v||k[n(735)](v))?c[n(842)+n(764)]=e[n(174)](ds,c[n(720)],0,c[n(720)][n(742)+"th"]):c[n(842)+n(764)]=""}else c["textPayl"+n(764)]=""}catch(l){e.yvpdP(e[n(938)],e[n(938)])?(AanyUh[n(1535)](_0xfb49f4,_0x1a7c01,90),AanyUh[n(1535)](_0x50c617,_0x5a08b7,_0x514f72)):(c[n(842)+n(764)]="",console.log(l))}s[n(1314)]=c,e[n(486)](t)}else{let c=_0x8c444c.bytes,l=_0x36d0bf[n(342)];return c[n(1156)]===l?c:c[n(1173)](0,l)}}function x0(s,t,n){let o=r;if(e.ysDrb(o(579),o(579)))_0x1cb451["frontier"+o(426)]=void 0,_0x3091b4(o(238)+o(786));else{let c=e[o(869)](n,8192),l=e[o(1091)](c,1),m=null,g=c;return function(d){let _=o;if(d<1||e[_(1134)](d,l))return e[_(862)](s,d);e[_(672)](e.TMwrS(g,d),c)&&(m=s(c),g=0);let v=t.call(m,g,g+=d);return e[_(1595)](7,g)&&(g=e[_(1018)](7|g,1)),v}}}let c0=4294967295;function f0(s,t,n){let o=r;return e[o(1302)](RangeError,e.GnNZl(o(1046)+"t of ran"+o(700)+s+e.GluWf+e[o(146)](t,1)+e[o(1141)],n))}function u0(s,t,n){let o=r;if(e.mhuyD(n,c0))throw new Error(e.mscLe);let c=3;for(;c>=0;){let l=255&n;Qn(l,s,e[o(465)](t,c)),n>>>=8,c--}return t+4}function d0(s,t){let n=r,o=0,c=t,l=e[n(1058)](t,4);for(;e[n(1444)](c,l);){let{value:m,offset:g}=e.lHAKZ(Zn,s,c);c=g,o=e[n(1038)](e.FJHvC(o,8),0),o+=m}return{value:o,offset:l}}function l0(s,t,n){let o=r,c="3|2|0|1|4"[o(1219)]("|"),l=0;for(;;){switch(c[l++]){case"0":if(t[o(479)+"e"])return e.xjUtl(t.utf8Write(s,n),n);continue;case"1":if(t[o(827)])return e.qkzgO(t.write(s,n),n);continue;case"2":if(e[o(769)](s[o(1156)],40))return e[o(1309)](Yn(s,t,n),n);continue;case"3":if(!s)return n;continue;case"4":return e.dEnqL(Yn,s,t,n)+n}break}}function h0(s,t){let n=r,o=new M(e[n(1443)](e.vBTGG(e[n(757)](e[n(681)](s[e[n(1333)](t,4)],24),e.xIdKk(s[e[n(1018)](t,5)],16)),s[e[n(1432)](t,6)]<<8),s[e[n(167)](t,7)]),e.oQjpc(e[n(129)](e[n(1245)](e[n(681)](s[e[n(696)](t,0)],24),e[n(1489)](s[t+1],16)),e[n(287)](s[e.UxzoR(t,2)],8)),s[t+3]),!0);return t+=8,{value:o,offset:e.tVLKw(t,8)}}function g0(s,t,n){let o=r,c=s[o(1424)],l=s[o(1023)];return t[n]=e[o(1014)](l,24),t[e[o(1018)](n,1)]=e[o(917)](e[o(1152)](l,16),255),t[e.ffmOY(n,2)]=e[o(981)](e[o(663)](l,8),255),t[n+3]=e[o(1041)](255,l),t[e[o(695)](n,4)]=e[o(546)](c,24),t[e[o(1019)](n,5)]=e[o(1340)](c,16)&255,t[e[o(1181)](n,6)]=e[o(1542)](e[o(292)](c,8),255),t[n+7]=255&c,n+=8,n}function Zn(s,t){let n=r;return s[n(220)+"8"]?{value:s.readUInt8(t),offset:e[n(1210)](t,1)}:{value:e[n(1587)](255,s[t]),offset:e[n(613)](t,1)}}function Qn(s,t,n){let o=r;return t.writeUint8?t[o(1255)+"t8"](s,n):t[n]=e.mPwKk(255,s),e.PGIcp(n,1)}let p0=function(s){return new Uint8Array(s)},m0=e[r(1233)]!=typeof Buffer?Buffer[r(468)+r(209)]:e.RCBAs(x0,p0,Uint8Array[r(257)+"e"][r(1173)]),w0=16,er=32;function _0(s){let t=r,n=0,o={};for(let c=0;e[t(253)](c,s[t(1156)]);c++)o[s[c]["cursor_n"+t(517)]]=e[t(767)](us,s[c][t(528)+"ame"]),n+=14+o[s[c][t(528)+t(517)]];return[n,o]}function ps(s,t,n){let o=r,c={UzgWU:e[o(1057)],eemyn:function(_,v,C,k){return _(v,C,k)},Htilk:e.TdqQN,plCyW:e[o(1514)],BGQyZ:function(_,v,C,k){return e.cNLmM(_,v,C,k)},wKCuZ:e[o(723)],nMsuY:function(_,v,C,k){return e.vwskh(_,v,C,k)},fepAj:o(634)},[l,m]=e[o(455)](_0,s),g=m0(l),d=0;return s[o(457)](_=>{let v=o;console.log(c[v(351)],_,_[v(1543)]),d=c[v(396)](Qn,0,g,d),console[v(719)](c[v(1544)],d),d=c[v(396)](u0,g,d,_[v(1543)]||0),console[v(719)](c.plCyW,d),d=c[v(836)](Qn,m[_[v(528)+v(517)]],g,d),console[v(719)](c[v(1083)],d),d=c[v(396)](l0,_[v(528)+v(517)],g,d),console.log(v(1101),d),d=c[v(1138)](g0,M[v(919)+"er"](_.cursor||t),g,d),console.log(c[v(1345)],d)}),{frameType:er,headers:[{key:o(1223)+o(721),value:n}],payload:g}}function y0(s){let t=r,n=0,o=[];for(;e[t(508)](n,s[t(742)+"th"]);){let{offset:c}=e[t(1036)](Zn,s,n);n=c;let l={cursor_name:"",cursor:0,service:0},{value:m,offset:g}=e[t(745)](d0,s,n);l[t(1543)]=m,n=g;let{value:d,offset:_}=Zn(s,n);n=_,l[t(528)+t(517)]=e.Xkpka(ds,s,n,e[t(1575)](n,d)),n+=d;let{value:v,offset:C}=e[t(1198)](h0,s,n);l.cursor=v.toNumber(),n=C,o[t(157)](l)}return o}function b0(){let s=r;return{frameType:er,headers:[{key:e.TJdtG,value:"FILE_NOT"+s(1275)}],payload:void 0}}class v0{constructor(t,n,o){let c=r;this[c(124)+c(1089)]=t,this._cursorFileName=n,this[c(812)+c(796)]=o,this[c(1260)]=e.lHAKZ(hs,this._cursorNameSpace,e[c(612)])}async openDB(){let t=r;await this[t(1260)][t(499)]()}async[r(780)+"rs"](){let t=r;if(!this[t(1260)].isReady)return;let n=this[t(812)+t(796)],o=await this[t(1260)].getAll();switch(console[t(719)]("allCurso"+t(334),o),n){case e[t(135)]:return o&&o[t(1156)]?e[t(910)](ps,o,0,this["_cursorF"+t(549)]):void 0;case e[t(1056)]:return;case e[t(260)]:return o&&o[t(1156)]?e[t(174)](ps,o,0,this[t(1239)+"ileName"]):e[t(486)](b0)}}async[r(1474)](t,n,o){let c=r;return console[c(719)](e[c(114)],t,n,o),this[c(1260)][c(1474)]({cursor_name:t,cursor:n,service:o})}async setCursors(t){let n=r,o=e[n(455)](y0,t);for(let c of o)console[n(719)](e.dfeWh,o),await this[n(1260)][n(1474)](c)}async[r(1174)](t){let n=r;return(await this[n(1260)][n(1174)](t))?.cursor}async[r(971)](){let t=r;e.qHgFI(e[t(1461)],t(1519))?await this[t(1260)].closeDB():_0x47a4da[t(719)](_0x5f20a4)}[r(1372)+r(1561)+r(810)](t){let n=r;if(n(626)!==e[n(121)])this[n(1239)+n(549)]=t;else return _0x265215[n(719)](e[n(114)],_0x28ca8a,_0x23da39,_0x25a46e),this[n(1260)][n(1474)]({cursor_name:_0x15fb52,cursor:_0x2d8dd5,service:_0x4c4547})}get[r(1001)](){return this._qosDB.isReady}}let S0=e.ahwxq;async function ms(s){let t=r,n={PpLDy:e[t(1268)],ysUvC:function(g,d){return g===d},EbzMv:e[t(1054)],UNMFn:function(g,d){return e[t(258)](g,d)},PrWAJ:function(g,d){return e[t(1488)](g,d)}};if(!this[t(952)][t(1412)+"S"])return null;let{aID:o,fpID:c,messageStrategy:l}=this[t(952)],m=e[t(1318)](s,S0);try{if(e[t(711)](e[t(1374)],e[t(1374)]))return this[t(1207)+t(853)]?s&&this[t(1207)+"anager"][t(1372)+"rsorFile"+t(810)](s):this[t(1207)+t(853)]=new v0(c+"_"+o+"_"+m,m,l),this["_cursorM"+t(853)].isReady||await this[t(1207)+t(853)][t(499)](),this[t(1207)+t(853)];{let g=(t(461)+t(1425))[t(1219)]("|"),d=0;for(;;){switch(g[d++]){case"0":this[t(901)+t(1178)+t(1499)]();continue;case"1":this[t(749)+"mer"]();continue;case"2":this["_readyCl"+t(1133)]=!0;continue;case"3":if(!this[t(1193)])return void this[t(777)](n[t(611)]);continue;case"4":if(n[t(888)](this._ws.readyState,this[t(317)])||n[t(888)](this[t(1193)][t(1379)+"te"],this.CLOSING))return void this[t(777)](n[t(1257)]);continue;case"5":this[t(715)+t(294)]();continue;case"6":this[t(464)+t(1291)+"t"](_0x389122,_0x5283e2);continue;case"7":this["_QoSMana"+t(1264)]?.closeDB();continue}break}}}catch{if(e[t(1114)]("VMUXe",t(970))){let g=_0x3b4a8f(_0x1162b2,_0x3a9211[t(342)]),d=_0x3756d4[t(987)],_=_0x3cad99.bytes;for(let v=0,C=_0x29f625[t(342)];zaFnIq[t(662)](v,C);v++)d[zaFnIq[t(371)](v,g)]=_[v]}else return null}}async function C0(s,t){let n=r,o=e[n(535)](Fe,s.message[n(1437)],e.yKKss,"-1"),c=Fe(s[n(1314)][n(1437)],e[n(729)],"1"),l=e.JyxzF(at,s.message.headers,e[n(335)]),m=e[n(446)](Number,e[n(1198)](at,s[n(1314)].headers,e.bTRhM))||0,g=$n[n(480)](this,s),d=e[n(1512)](Fe,s.message.headers,e.AuKWD,"2"),_=e[n(1153)](at,s[n(1314)].headers,e[n(1121)]),v=e.fyfOU(Number,at(s[n(1314)][n(1437)],e[n(770)]));if(g[n(687)])return t();let C=g[n(891)+"sage"]?await gs[n(480)](this):null;if(e[n(360)](s[n(1314)][n(1543)],0)&&c&&!o||e[n(1508)](s[n(1314)].service,0)){if(l&&g[n(891)+"sage"]&&C){if(!!!await C[n(1174)](l))if(e[n(1003)]!==e[n(1423)])this[n(1319)+n(1031)+"Event"](s),await C.set(l,Date[n(604)]()+m);else{let{offset:R}=e.XfTJd(_0x314410,_0xdaaa87,_0x157521);_0x40beef=R;let B={cursor_name:"",cursor:0,service:0},{value:Y,offset:me}=e[n(1024)](_0x386f6d,_0x59d93f,_0x3d4444);B[n(1543)]=Y,_0x7d244c=me;let{value:X,offset:qt}=e[n(356)](_0x2b877d,_0x516d04,_0x166e82);_0x3e8dbf=qt,B["cursor_n"+n(517)]=e[n(978)](_0x2c9c66,_0x3ab467,_0x5e2542,e[n(1058)](_0x3d65b0,X)),_0x59801a+=X;let{value:tr,offset:nr}=_0x24e40f(_0x57c5cf,_0x195463);B[n(169)]=tr[n(558)](),_0x1d4bb3=nr,_0x1bb890[n(157)](B)}return t()}if(d){let k=await ms[n(480)](this);if(!k)return this["_dispatc"+n(1031)+n(1158)](s),e.EWTAh(t);let R=await k[n(1174)](_)??-1;if(R<v)this[n(1319)+n(1031)+n(1158)](s),k[n(1474)](_,v,s[n(1314)].service);else throw new Error("recevied"+n(1578)+n(1205)+v+(n(1071)+n(831)+n(958)+"r ")+R);return t()}return this[n(1319)+n(1031)+n(1158)](s),e[n(1433)](t)}}async function E0(s,t){let n=r,o=$n[n(480)](this,s);if(!o["isQoSMes"+n(421)])return t();let c=await gs[n(480)](this);if(o[n(1204)+n(627)+n(1304)]&&o[n(1569)+"s"].length)for(let l of o[n(1569)+"s"])await c[n(984)](l);e[n(969)](t)}async function A0(s,t){let n=r,o=e.AVvRS(s[n(1314)][n(822)+"e"],w0),c=e.WcUyd(s[n(1314)][n(822)+"e"],er);if(e[n(491)](!o,!c))return e[n(1433)](t);let l=e[n(458)](at,s.message[n(1437)],e[n(1378)]);if(!l)return e.Ndknb(t);let m=await ms.call(this,l);if(!m)return t();if(o){let g=await m[n(780)+"rs"](),d={frameType:g?.[n(822)+"e"],SeqID:M[n(919)+"er"](this[n(1491)]++),LogID:M[n(919)+"er"](this[n(952)]["logIDGen"+n(932)]()),service:9e3,method:5,headers:g?.[n(1437)],payload:g?.[n(720)]},_=e[n(175)](E,d);this._ws&&this[n(1193)][n(1379)+"te"]&&this[n(1193)][n(1262)](_)}if(c){let g=s[n(1314)][n(720)];g&&m[n(262)+"rs"](g)}}let D0=async function(s,t){let n=r;this[n(275)]=!1,e[n(1303)](clearTimeout,this[n(920)+n(490)+n(1365)]),e[n(1256)](t)},k0=async function(s,t){let n=r;if(!this[n(1193)]||this[n(1193)][n(1379)+"te"]!==this[n(1339)])return e[n(817)](t);let{pingInterval:o}=this[n(952)];this[n(642)+n(1347)]?.["resetEnd"+n(196)+"fig"]();for(let l=0;e[n(950)](l,this[n(812)+"Queue"][n(1156)]);l++){let m=this[n(812)+"Queue"][l];if(this._ws.readyState===this[n(1339)]&&e[n(1157)](null,m))this[n(1193)]&&this._ws[n(1262)](m),this[n(812)+"Queue"][l]=null;else break}this[n(812)+"Queue"]=this._messageQueue.filter(l=>!!l),this[n(1170)+n(1218)+"Id"]=e[n(1153)](setTimeout,()=>this[n(1373)](),o),this[n(1319)+n(304)+"nt"](s),this._isBrowser&&this._ws&&(this[n(1193)][n(1108)+"pe"]=this["_binaryT"+n(477)]);let c=this[n(642)+n(1347)]?.[n(1100)+n(1059)+"nt"]();this[n(777)]("open "+c+" success"),e[n(807)](t)},P0=async function(s,t){let n=r,o=this["_endpoin"+n(1347)]?.[n(1100)+n(1059)+"nt"]();this._debug(n(686)+o),e[n(154)](t)};class I0 extends Vn{constructor(t){let n=r,o={BhoFW:function(g,d){return e[O(320)](g,d)},ELzHG:function(g,d){return e[O(451)](g,d)},zaTbq:function(g,d){return g===d},RvPVw:e[n(1583)],lQtbh:e[n(417)],mDvEc:function(g,d,_){return e.isLlA(g,d,_)},xDKOB:function(g,d,_,v){return e[n(1074)](g,d,_,v)},GJuEO:e[n(365)]};super(),this[n(1266)+n(243)+n(410)]=!0,this[n(531)+"er"]=ot,this._isNode=Go,this[n(305)+"T"]=Je,this._isMiniWX=vt,this[n(1422)+"r"]=St,this[n(812)+n(1312)]=[],this[n(642)+n(1347)]=null,this[n(1368)+"osed"]=!1,this["_binaryT"+n(477)]=e[n(1093)],this["_connect"+n(1073)]=!1,this[n(920)+n(490)+"utId"]=null,this[n(675)+n(688)+"tId"]=null,this._pingPongTimeoutId=null,this[n(1491)]=0,this[n(275)]=!1,this[n(471)]="",this[n(1301)+n(1264)]=null,this[n(1207)+"anager"]=null,this[n(1513)+n(783)]=null,this[n(357)+"ls"]=e[n(1119)],this[n(317)]=3,this[n(1452)+"NG"]=0,this.OPEN=1,this[n(636)]=2,this[n(1495)]=g=>{let d=n;try{e[d(1511)](fs,this,g,[D0,k0,P0])}catch(_){let v=ue(e.ktpdF,{message:_[d(1314)],code:qe[d(339)+"OR"],error:_});this[d(1319)+d(1168)+d(1522)](v)}},this[n(751)+"ge"]=async g=>{let d=n,{pingInterval:_,pingFrequency:v}=this[d(952)];if((o.BhoFW("hi",g.data)&&o[d(1582)](d(1011),v)||o[d(1346)](d(366),v))&&(this[d(715)+d(294)](),this[d(1185)](o[d(1269)],o[d(249)]),this[d(1170)+"gTimeoutId"]=o[d(213)](setTimeout,this[d(1373)].bind(this),_)),g.data!=="hi")try{o[d(368)](fs,this,g,[a0,i0,E0,A0,C0,o0])}catch(C){let k=ue(o[d(833)],{message:C.message,code:qe[d(1229)+d(955)],error:C});this[d(1319)+d(1168)+d(1522)](k)}},this._onError=g=>{let d=n,_={HEpDB:d(321),HMJyA:e[d(551)]};if(e[d(298)]!=="gJHZK"){if(!this[d(1193)])return;this["_destroy"+d(1291)+"t"](_0x131d7f,_0x30325b,_0x5a1000)}else{let v=this[d(642)+d(1347)]?.["checkRea"+d(1410)+"es"](),C=this[d(642)+d(1347)]?.[d(1100)+"ntEndpoint"]();if(v&&!g[d(1314)])if(e[d(1166)](e.snvod,d(483)))_0x2191b5[d(977)+d(597)+d(1017)](d(280),_0x534a7b),_0x3fc1d0["removeEv"+d(597)+d(1017)](OMiKCg[d(887)],_0x4c48e5),_0xfcb753[d(977)+"entListe"+d(1017)](OMiKCg[d(935)],_0x145191);else{let k=d(542)+C+(" fail, m"+d(1441)+"es reached");this[d(1319)+d(1168)+d(1522)](ue(e[d(365)],{message:k,code:qe[d(1267)+d(1445)+"R"],error:g}));return}this._ws&&e[d(1341)](this[d(1193)].readyState,this[d(1339)])&&this[d(1020)+d(1124)](),this["_dispatchErrorEv"+d(1522)](e[d(458)](ue,e.ktpdF,{message:g[d(1314)],code:qe[d(1293)+d(1475)],error:g}))}},this[n(1524)]=async g=>{let d=n;this[d(749)+d(1550)](),this._clearPingTimer(),this[d(939)+d(1102)+"rs"](),this[d(1193)]=null,this[d(920)+d(1073)]=!1;let _=this[d(642)+d(1347)]?.checkReachMaxTries();if(!_&&this[d(866)+d(372)]()&&!this["_readyCl"+d(1133)]){let v=this[d(642)+d(1347)]?.[d(1100)+"ntEndpoint"](),C=this[d(952)][d(225)+d(319)+"ptor"](g[d(603)],g[d(786)]);this[d(1319)+"hCloseEv"+d(1522)](e[d(674)](pe,e[d(994)],{code:1006,reason:g[d(786)]||d(153)+d(1237)+d(1581)+d(922)+d(352)+"ame: "+v,willReconnect:C})),C&&this[d(920)]();return}if(e.WMWJE(1e3,g[d(603)])&&this["_readyCl"+d(1133)]){this[d(1319)+d(899)+d(1522)](pe(e[d(994)],{code:1e3,reason:e.hkIDh})),this["_endpoin"+d(1347)]?.[d(1042)+d(196)+d(228)](),this[d(1513)+d(783)]?.resetCounter();return}if(e.qTfvl(1e3,g[d(603)])&&_){let v=this["_endpoin"+d(1347)]?.["getCurre"+d(1059)+"nt"](),C=g.reason;C||(C=await e.fyfOU(Qo,this._url)),C=d(153)+d(1237)+d(852)+C+(d(795)+d(665))+v+(d(1401)+"tries re"+d(1562)),this[d(1319)+d(899)+d(1522)](e[d(1258)](pe,e[d(994)],{code:g[d(603)],reason:C}));let k=d(542)+v+(" fail, m"+d(1441)+d(1525)+"ed");this[d(1319)+d(1168)+d(1522)](ue("error",{message:k,code:qe[d(1267)+d(1445)+"R"]})),this["_endpoin"+d(1347)]?.[d(1042)+"pointConfig"](),this[d(1513)+d(783)]?.[d(1388)+d(195)]();return}if(e[d(661)](1e3,g[d(603)])&&!g[d(786)]){let v=this["_endpoin"+d(1347)]?.[d(1100)+d(1059)+"nt"]();this["_dispatc"+d(899)+d(1522)](pe(e[d(994)],{code:g.code,reason:"connecti"+d(1237)+d(1581)+d(922)+d(352)+"ame: "+v})),this["_endpoin"+d(1347)]?.resetEndpointConfig(),this[d(1513)+d(783)]?.[d(1388)+d(195)]();return}this["_dispatc"+d(899)+"ent"](g),this[d(642)+d(1347)]?.[d(1042)+"pointCon"+d(228)](),this["_pingLos"+d(783)]?.[d(1388)+d(195)]()},this[n(884)]=null,this[n(802)]=null,this.onmessage=null,this[n(607)]=null,this[n(1469)+"econnect"]=null,this[n(683)+n(1400)]=null,this[n(844)+n(407)+n(1390)+"ct"]=null,this[n(141)+n(1050)]=this[n(141)+n(1050)][n(433)](this),this._handleOffLine=this[n(141)+n(482)].bind(this),this[n(502)+n(330)]=this[n(502)+n(330)][n(433)](this),this._handlePageShow=this[n(502)+n(658)].bind(this),this._options={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:1/0,service:0,logIDGenerator:x,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:e[n(1212)],pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:e[n(260)],env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:c,ws:l}=t,m=Array[n(623)](c)?c:e[n(411)](e[n(159)],typeof c)?[c]:[];if(!m||e[n(1573)](0,m[n(1156)]))throw new Error(e[n(609)]);if(!e[n(424)](Yo,l))throw new Error("please p"+n(188)+"s params, WebSoc"+n(893)+n(434)+n(569)+n(911));Object[n(1300)](this._options,t),this[n(642)+"tManager"]=new cs(m,this._options.maxRetries),this[n(1513)+"sCounter"]=new Zo(this[n(952)][n(509)+n(359)]),this[n(952)]["automati"+n(180)]&&(e[n(489)](e[n(344)],e.NEkhN)?(this[n(256)]=!0,this[n(1424)]=e[n(1250)](0,_0x29587b),this.high=0|_0x4d9676,this[n(1062)]=!!_0x256f7c):(this[n(275)]=!0,this[n(920)]())),this[n(952)]["listenNe"+n(362)+n(1243)]&&(this[n(305)+"T"]||this._isMiniWX?this[n(1175)+n(388)+n(1503)]():this[n(531)+"er"]&&this[n(498)+"balEvent"+n(1499)]())}["_handleO"+r(1050)](){let t=r;this[t(952)][t(590)+t(1172)+t(1150)]||this["_readyCl"+t(1133)]||this["_handleR"+t(895)]()}[r(141)+r(482)](){let t=r;this[t(464)+t(1291)+"t"]();let n=e[t(745)](Jn,t(225)+"t",{message:e[t(116)]});this["onStopIm"+t(407)+t(1390)+"ct"]&&this[t(844)+"mediatelyReconnect"](n)}[r(498)+"balEventListener"](){let t=r;this[t(531)+"er"]&&window["addEvent"+t(1499)](e[t(537)],this[t(141)+t(1050)]),this[t(531)+"er"]&&window["addEvent"+t(1499)](e[t(1188)],this[t(141)+"ffLine"]),this[t(531)+"er"]&&window[t(727)+t(1499)](e[t(814)],this[t(502)+t(330)]),this._isBrowser&&window[t(727)+t(1499)](e.BagOO,this[t(502)+t(658)])}[r(901)+r(1178)+r(1499)](){let t=r;this._isBrowser&&window["removeEv"+t(597)+t(1017)](e[t(537)],this["_handleO"+t(1050)]),this[t(531)+"er"]&&window[t(977)+t(597)+"ner"](e.QYtdJ,this[t(141)+t(482)]),this[t(531)+"er"]&&window["removeEv"+t(597)+"ner"](e[t(814)],this[t(502)+t(330)]),this._isBrowser&&window[t(977)+t(597)+"ner"](e[t(408)],this[t(502)+t(658)])}[r(502)+r(330)](t){let n=r,o={ERHKd:function(c,l){return e[O(364)](c,l)}};if(e.hwtBB===e.ZBWiE){let c=this[n(1260)]["getStora"+n(1487)+"nc"](this._prefix),l=_0x382180[n(677)](YsKhLA[n(1321)](c,"{}"));return _0x319571[n(1311)](l)}else!t.persisted&&(this[n(531)+"er"]&&window[n(977)+"entListe"+n(1017)](e[n(814)],this[n(502)+"ageHide"]),this[n(531)+"er"]&&window[n(977)+n(597)+n(1017)](e[n(408)],this[n(502)+"ageShow"]),this[n(476)]()),this._isBrowser&&window[n(977)+n(597)+n(1017)](e[n(537)],this[n(141)+n(1050)]),this._isBrowser&&window[n(977)+n(597)+"ner"]("offline",this[n(141)+"ffLine"])}_handlePageShow(t){let n=r;n(1131)===e[n(230)]?_0x5852de.o=(o,c)=>_0x5dc92f[n(257)+"e"]["hasOwnPr"+n(418)][n(480)](o,c):t[n(268)+"d"]&&(this[n(866)+n(372)]()&&(!this[n(1193)]||e[n(1095)](this[n(1193)][n(1379)+"te"],this[n(1339)])||e[n(1199)](this[n(1193)][n(1379)+"te"],this[n(1452)+"NG"]))&&this[n(141)+"nLine"](),this[n(531)+"er"]&&window.addEventListener(n(584),this[n(141)+n(1050)]),this[n(531)+"er"]&&window[n(727)+n(1499)](e[n(1188)],this._handleOffLine))}async[r(1492)+r(338)](t){let n=r,{fpID:o,deviceID:c,bddID:l,ttwID:m,accessKey:g,aID:d,customParams:_={},enableAutoAck:v,enableQoS:C,QoSLevel:k,env:R}=this[n(952)],B,Y,me;this[n(531)+"er"]||this[n(1197)+"X"]||this._isMiniTT?(B=location&&e[n(838)]("https:",location[n(986)])?e.aeivL:n(702),Y=t[n(211)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),me=/^wss(.*:\/\/)/[n(1215)](t)?t:""+B+Y):e[n(961)](n(255),e[n(870)])?_0x35bac5=_0x2e8c62(_0x4e82cc):(B=e[n(377)],Y=t[n(211)](/(^http)((?:[s]*:\/\/))/,""),me=/(^ws)((?:[s]*:\/\/))/[n(1215)](Y)?Y:""+B+Y);let X=l?e[n(1534)]:m?e[n(1460)]:e[n(363)],qt=l||m||c;if(e[n(869)](!qt,!X))throw new Error(e.mKLww);let tr=e.crQIo(e[n(725)],typeof _)?await e[n(807)](_):_,nr=R?e[n(1454)]($o,R[n(843)],R[n(1462)]):{},rr=Object.assign({device_platform:"web",version_code:e[n(845)],access_key:g,fpid:o,aid:d,[X]:qt,xsack:v?1:0,xaack:v?1:0,xsqos:C?1:0,qos_level:C?k:void 0,qos_sdk_version:2,...nr},tr),T0=Object[n(1311)](rr)[n(633)]((sr,ir)=>rr[ir]!==void 0?""+sr+(sr?"&":"?")+ir+"="+rr[ir]:sr,"");return me+n(466)+T0}async[r(920)](){let t=r;if(!(this[t(920)+"Lock"]||this[t(1368)+"osed"])){this[t(920)+t(1073)]=!0;try{let n=this["_endpoin"+t(1347)]?.[t(791)+t(839)+t(1377)+t(1217)+t(710)](),{timeoutInterval:o}=this._options;if(n){let l=this[t(642)+"tManager"]?.["getCurre"+t(1059)+"nt"](),m=this[t(642)+t(1347)]?.[t(787)+t(302)+t(431)+"UpdateCo"+t(660)](),g=this[t(642)+t(1347)]?.[t(1100)+t(1059)+t(300)+t(1322)]();if(m){let d=t(542)+l+(t(680)+", max retries re"+t(1484)+t(1231)+t(1135)+t(942))+m+" to retry",_=e[t(384)](ue,e[t(365)],{message:d,code:qe[t(1267)+t(1445)+"R"]});this[t(777)](d),this[t(1319)+t(1168)+t(1522)](_),this[t(471)]=await this[t(1492)+t(338)](m),this[t(777)](t(542)+m+" "+g+t(1580)),this[t(939)+t(1102)+"rs"]()}else{let d=t(542)+l+(" timeout, max retries re"+t(1562));this[t(777)](d),this[t(1319)+t(1168)+t(1522)](e[t(877)](ue,e[t(365)],{message:d,code:qe.MAX_RETRIES_ERROR}));return}}else{let l=this["_endpoin"+t(1347)]?.["getCurre"+t(1059)+t(775)+t(251)](),m=this[t(642)+t(1347)]?.[t(1100)+t(1059)+t(300)+t(1322)]();this[t(471)]=await this[t(1492)+"eUrl"](e.VQhGy(l,"")),this[t(777)](t(542)+l+" "+m+t(1580)),this[t(939)+t(1102)+"rs"]()}if(this[t(275)])this[t(275)]=!1;else{let l=e.oBXox(Jn,e.QJDCy,{message:e[t(705)]});this[t(1469)+"econnect"]&&this[t(1469)+t(895)](l)}let c=this["_endpoin"+t(1347)]?.["getCurre"+t(1059)+t(300)+t(1322)]()||0;e.VKFbe(c,1)&&await this[t(568)](c-1),this[t(777)](t(153)+t(1555)+this[t(471)]+(t(343)+"ls: ")+this._protocols),this._ws=e[t(512)](Vo,{url:this[t(471)],protocols:[this[t(357)+"ls"]],headers:this[t(952)]["miniProg"+t(1136)+"s"][t(475)+t(1235)]},this._options.ws),(this._isBrowser||this[t(1422)+"r"])&&this[t(1193)]&&(this._ws[t(1108)+"pe"]=this._binaryType),this._addWsListeners(),this[t(920)+t(490)+t(1365)]=setTimeout(this[t(443)+"ut"][t(433)](this),o)}catch(n){if(e[t(332)]!=="VUvkE")throw this[t(920)+t(1073)]=!1,n;{let o=0,c=0,l;do l=_0x5296f6(_0x3f4804),e[t(1402)](o,32)&&(c|=e.UyPUM(e[t(227)](127,l),o)),o+=7;while(128&l);return c}}}}[r(749)+"mer"](){let t=r;e[t(1066)](clearTimeout,this[t(920)+"ionTimeoutId"]),this[t(920)+t(490)+"utId"]=null}[r(715)+r(294)](){let t=r;e[t(679)](clearTimeout,this[t(1170)+t(1218)+"Id"]),e[t(965)](clearTimeout,this[t(675)+"ctTimeou"+t(1351)]),this[t(1170)+t(1218)+"Id"]=null,this[t(675)+t(688)+t(1351)]=null}[r(777)](...t){let n=r;this._options[n(390)]&&console[n(719)][n(1232)](console,[e.DbyXO,...t])}_getIntervalValue(t){let n=r,{initReconnectInterval:o,maxReconnectInterval:c,reconnectIntervalGrowFactor:l}=this._options,m=e[n(653)](o,Math[n(731)](l,e[n(1418)](t,1)));return e[n(1134)](m,c)?c:m}[r(1373)](){let t=r;if(this[t(1193)]&&e[t(1278)](this._ws[t(1379)+"te"],this[t(1452)+"NG"])){this[t(715)+"ngTimer"](),this[t(1170)+t(1218)+"Id"]=e[t(745)](setTimeout,this[t(1373)][t(433)](this),this[t(952)][t(685)+t(1140)]);return}if(!this[t(1193)]||e[t(200)](this[t(1193)].readyState,this[t(1339)]))return void this[t(1342)+t(895)]();this[t(1193)]&&this._ws[t(1262)]("hi"),this[t(675)+t(688)+t(1351)]=setTimeout(this[t(1342)+t(895)+t(589)][t(433)](this),this[t(952)][t(278)+t(998)+t(447)])}[r(1342)+r(895)+"Timeout"](){let t=r;this[t(1513)+t(783)]?.[t(1504)](),this[t(1185)](t(1537)+t(307)+"t",t(1466)),this[t(1513)+t(783)]?.[t(1244)+t(550)+"nt"]()?this[t(1342)+t(895)]():this[t(1373)]()}[r(866)+"orOnline"](){let t=r;return this[t(305)+"T"]||this[t(1197)+"X"]?this[t(1266)+t(243)+"line"]:(this[t(531)+"er"]||this[t(1422)+"r"])&&this[t(952)]["listenNetworkCha"+t(1243)]?navigator[t(557)]:!0}[r(1342)+r(895)](){let t=r;!this[t(866)+t(372)]()||this[t(1368)+"osed"]||(this[t(642)+t(1347)]?.[t(1042)+t(196)+t(228)](),this[t(1513)+t(783)]?.[t(1388)+t(195)](),this._ws?this[t(1020)+t(1124)](1001,e[t(789)],!0):this[t(920)]())}[r(1175)+r(388)+r(1503)](){let t=r;this._isMiniTT?tt[t(1507)+t(794)+t(823)](({isConnected:n})=>{let o=t;this[o(1266)+o(243)+o(410)]=n,n?this[o(141)+"nLine"]():this[o(141)+"ffLine"]()}):this[t(1197)+"X"]&&wx["onNetwor"+t(794)+t(823)](({isConnected:n})=>{let o=t;this[o(1266)+o(243)+"line"]=n,n?this[o(141)+o(1050)]():this["_handleO"+o(482)]()})}[r(568)](t){return new Promise(n=>{let o=O;e.PJtRQ(setTimeout,n,this["_getInte"+o(1049)+"e"](t))})}[r(1020)+"ect"](t=1e3,n="",o=!1){let c=r;this._ws&&this[c(464)+c(1291)+"t"](t,n,o)}[r(443)+"ut"](){let t=r,n=this[t(642)+t(1347)]?.[t(1100)+t(1059)+"nt"]();this._debug("connect "+n+t(680)),this[t(1020)+t(1124)](1001,t(1313)+t(281)+t(379)+"g",!0)}[r(1530)](t){let n=r,o=e[n(906)](Gn,t);this[n(1193)]&&e.rTbWn(this[n(1193)].readyState,this[n(1339)])&&(this[n(1193)]&&this[n(1193)][n(1262)](o),this._debug(n(1538),t))}[r(939)+r(1102)+"rs"](){let t=r,n=e[t(1518)][t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(1193)][t(977)+t(597)+t(1017)](e[t(994)],this[t(1524)]);continue;case"1":this[t(1193)][t(977)+t(597)+t(1017)](e[t(967)],this._onMessage);continue;case"2":this[t(1193)]["removeEventListe"+t(1017)](e[t(820)],this[t(1495)]);continue;case"3":this[t(1193)]["removeEv"+t(597)+t(1017)](e[t(365)],this[t(430)]);continue;case"4":if(!this[t(1193)])return;continue}break}}[r(470)+r(1139)](){let t=r,n=e.GcewK[t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(1193)]["addEvent"+t(1499)](t(321),this[t(430)]);continue;case"1":if(!this._ws)return;continue;case"2":this._ws[t(727)+t(1499)](e.BUcZO,this._onClose);continue;case"3":this[t(1193)][t(727)+t(1499)](e[t(820)],this[t(1495)]);continue;case"4":this[t(1193)].addEventListener(t(1314),this[t(751)+"ge"]);continue}break}}[r(485)+r(617)](t=1e3,n=""){let o=r;try{this[o(1193)]&&this[o(1193)][o(476)](t,n)}catch{}}[r(464)+r(1291)+"t"](t=1e3,n="",o=!1){let c=r,l={dBVuu:function(m,g){return e[O(806)](m,g)},lwLWb:function(m,g){return e[O(1145)](m,g)},Taqnu:function(m,g){return e[O(1591)](m,g)},hcmkD:function(m,g){return e.vmmTy(m,g)},GJKZc:function(m,g){return e[O(897)](m,g)}};if(e.VaYat(e[c(510)],e[c(510)]))return _0x2b6922[c(256)](_0x1d58ce)||(_0x11b0dc=_0x15509f[c(919)+"er"](_0x3740ec)),YynwxH[c(1517)](this[c(1062)],_0x10eaa4[c(1062)])&&YynwxH.lwLWb(this.high,31)===1&&YynwxH[c(1034)](YynwxH[c(1065)](_0x5ed381[c(1023)],31),1)?!1:YynwxH[c(974)](this[c(1023)],_0x5c5b77[c(1023)])&&YynwxH[c(974)](this[c(1424)],_0x10f431.low);if(this[c(715)+c(294)](),this[c(749)+"mer"](),this[c(939)+c(1102)+"rs"](),this[c(485)+c(617)](1e3,n),this[c(920)+c(1073)]=!1,o&&this["_navigat"+c(372)]()&&!this._readyClosed){if(this[c(642)+"tManager"]?.[c(1244)+c(1410)+"es"]()){let g=this._endpointManager?.[c(1100)+c(1059)+"nt"]();this[c(1319)+c(899)+"ent"](e[c(1213)](pe,e[c(994)],{code:1006,reason:"connect "+g+(" timeout"+c(1401)+c(799)+c(1562)),wasClean:!0}))}else{let g=this[c(952)]["reconnec"+c(319)+c(1201)](t,n);this[c(1319)+c(899)+c(1522)](pe(c(476),{code:t,reason:n,wasClean:!0,willReconnect:g})),g&&this[c(920)]()}return}this[c(866)+c(372)]()||this[c(1368)+"osed"]?this[c(1319)+c(899)+c(1522)](e.UjdPQ(pe,e[c(994)],{code:t,reason:e[c(928)]})):this["_dispatc"+c(899)+c(1522)](e[c(1213)](pe,e.BUcZO,{code:1006,reason:c(966)+c(902)+c(1079)+c(217)})),this[c(1193)]=null,this[c(642)+c(1347)]?.[c(1042)+c(196)+c(228)](),this[c(1513)+"sCounter"]?.[c(1388)+c(195)]()}[r(1319)+r(304)+"nt"](t){let n=r;this.emit(e.qLPbW,t),this[n(607)]&&this[n(607)](t)}[r(1319)+r(1031)+r(1158)](t){let n=r;this[n(1185)](e[n(967)],t),this[n(1109)+"e"]&&this.onmessage(t)}["_dispatc"+r(1214)+r(143)](t){let n=r;this[n(1185)](e[n(1334)],t),this[n(683)+n(1400)]&&this[n(683)+n(1400)](t)}[r(1319)+r(1168)+r(1522)](t){let n=r;this[n(1185)](e.ktpdF,t),this.onerror&&this[n(802)](t)}[r(1319)+"hCloseEvent"](t){let n=r;this.emit(e[n(994)],t),this[n(884)]&&this[n(884)](t)}get[r(1108)+"pe"](){let t=r;return this[t(1193)]?this[t(1193)][t(1108)+"pe"]:this[t(1016)+"ype"]}set[r(1108)+"pe"](t){let n=r;this._binaryType=t,this[n(1193)]&&(this[n(1193)][n(1108)+"pe"]=t)}get[r(694)+"nt"](){let t=r;return this[t(642)+t(1347)]?.[t(1100)+t(1059)+"ntTriesC"+t(1322)]()||0}get[r(1540)+r(605)](){let t=r;if(e[t(761)](e[t(187)],e[t(709)]))_0x58d74b(this,_0x2a8236,[_0x3ce2f0,_0x3ef5a5,_0x272a33,_0x391372,_0x270af3,_0x5779a3]);else return this[t(812)+t(1312)][t(633)]((o,c)=>(o+=c&&c[t(742)+"th"]||0,o),0)+(this._ws?this._ws["buffered"+t(605)]:0)}get[r(774)+"ns"](){let t=r;return this[t(1193)]?this[t(1193)][t(774)+"ns"]:""}get[r(986)](){let t=r;if(e[t(690)]!=="hQkOi")return this[t(1193)]?this._ws[t(986)]:"";gbTWjn.oPAen(_0x5d0de7,gbTWjn[t(583)](_0x3aefeb,_0x4ae884[t(1147)]),_0x1b08b3[t(540)+"on"],_0x156746.newVersion,gbTWjn[t(1302)](_0x2429cd,_0x1ea85b[t(400)+t(1490)]))}get[r(1379)+"te"](){let t=r;return this[t(1193)]?this[t(1193)][t(1379)+"te"]:this[t(952)].automaticOpen?this.CONNECTING:this.CLOSED}get[r(215)](){let t=r;return this[t(1193)]?this[t(1193)][t(215)]:this._url}[r(476)](t=1e3,n){let o=r,c=e[o(632)][o(1219)]("|"),l=0;for(;;){switch(c[l++]){case"0":this[o(464)+o(1291)+"t"](t,n);continue;case"1":this["_readyCl"+o(1133)]=!0;continue;case"2":if(!this[o(1193)])return void this._debug(e[o(1268)]);continue;case"3":this[o(749)+o(1550)]();continue;case"4":this[o(1301)+o(1264)]?.closeDB();continue;case"5":if(e[o(1081)](this[o(1193)].readyState,this[o(317)])||e[o(1254)](this[o(1193)][o(1379)+"te"],this[o(636)]))return void this[o(777)](e[o(1054)]);continue;case"6":this._clearPingTimer();continue;case"7":this[o(901)+o(1178)+o(1499)]();continue}break}}async send(t,n){let o=r;if(e[o(760)](null,t))throw new Error(e[o(1137)]);e[o(760)](e[o(1051)],typeof t)&&(t=JSON[o(1227)+"y"](t)),e[o(234)](o(668),typeof t)&&!e[o(654)](t,ArrayBuffer)&&!(t[o(1060)]&&t[o(1060)]instanceof ArrayBuffer)&&(t=JSON[o(1227)+"y"](t));let c=await e.FCUmJ(ls,t),l=Xo(t),{method:m=0,service:g=this[o(952)][o(1543)],logID:d=this._options["logIDGen"+o(932)](),headers:_=this[o(952)][o(1437)],payloadEncoding:v=this[o(952)][o(943)+o(534)],payloadType:C=this[o(952)][o(1387)+o(477)],logIDNew:k=this._options[o(1570)+o(813)]["enableAu"+o(957)+o(1435)+"ew"]?e[o(862)](a,this[o(952)][o(1570)+o(813)].userIp):""}=e.MwLqq(n,{});if(!g)throw new Error(e[o(864)]);let R={SeqID:M.fromNumber(this[o(1491)]++),LogID:M.fromNumber(d),service:g,method:m,headers:_,payloadEncoding:v instanceof Object?v[o(1286)]?v[o(1286)]:"":v,payloadType:e[o(654)](C,Object)?C[o(523)]?C.type:l:C||l,payload:c,LogIDNew:k},B=e[o(1263)](Gn,R);return this[o(1193)]&&e[o(515)](this[o(1193)][o(1379)+"te"],this[o(1339)])?(this._ws&&this[o(1193)][o(1262)](B),this[o(777)](o(115),R)):e[o(964)](this[o(812)+o(1312)][o(1156)],this[o(952)]["maxMessa"+o(429)+"ength"])?e.zzCxJ(e[o(798)],e[o(284)])?(_0x4e2ae5[o(977)+o(597)+"ner"](o(516),_0x14e3dc),_0x32e19b[o(977)+o(597)+o(1017)](gbTWjn[o(365)],_0x62062f)):(this._messageQueue.push(B),this[o(777)](e.jynSk,R)):e[o(1571)](o(979),e.cCpqm)?gbTWjn[o(1353)](_0x18515b,_0x3d7e33)&&_0x18eae5[o(1474)](_0x3d09a2,_0x522aba):(this._messageQueue[o(389)](),this[o(812)+o(1312)][o(157)](B)),{seqID:this[o(1491)],logID:d,logIDNew:k}}async[r(225)+"t"](t){let n=r;if(e[n(892)]!==n(419)){let o={hKmgI:function(c,l){return c(l)}};return function(c,...l){let m=n,g=_0x5519c9.call(o[m(1280)](_0x490b5c,this),c,...l);return _0x14b218.set(g,c[m(608)]?c[m(608)]():[c]),o.hKmgI(_0x9586b,g)}}else{let{url:o}=e.wydLk(t,{}),c=Array[n(623)](o)?o:e[n(838)](n(668),typeof o)?[o]:[];t&&Object[n(1300)](this._options,t),c&&c[n(1156)]?this[n(642)+n(1347)]=new cs(c,this[n(952)][n(1142)+"es"]):this["_endpoin"+n(1347)]?.[n(1042)+n(196)+"fig"](),this[n(1513)+n(783)]?.["resetCou"+n(195)](this[n(952)]["pingLoss"+n(359)]),this["_readyCl"+n(1133)]=!1,this[n(1193)]&&this._ws.readyState!==this[n(317)]?this[n(1020)+n(1124)](1e3,e[n(254)],!0):(this._isInit=!0,this[n(920)]())}}async[r(219)](){let t=r;if(!this._connectLock){let n=e[t(560)][t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(275)]=!0;continue;case"1":this["_pingLos"+t(783)]?.resetCounter();continue;case"2":this._connect();continue;case"3":this[t(1368)+t(1133)]=!1;continue;case"4":this[t(642)+t(1347)]?.[t(1042)+t(196)+t(228)]();continue}break}}}[r(727)+r(1499)](t,n){this.on(t,n)}[r(904)+"Event"](t){let n=r,{type:o}=t;this[n(1185)](o,t)}[r(977)+r(597)+r(1017)](t,n){this.off(t,n)}[r(781)](){let t=r,n={nqvcA:function(o,c){return e[O(739)](o,c)},gkpHw:t(1466),tnRhM:t(1537)+t(474)+"s",LEPlD:e.SwNin,XnMKf:function(o,c,l){return o(c,l)},KmPet:e.nNupb};return new Promise((o,c)=>{let l=t,m={ioqtT:function(_,v){return n[O(1391)](_,v)},pCxAb:n.LEPlD,HCKmV:"ping_onc"+l(474)+"s"};this._clearPingTimer(),this[l(1170)+l(1218)+"Id"]=n[l(1572)](setTimeout,this._ping.bind(this),this[l(952)][l(685)+"rval"]);let g=()=>{let _=l;m.ioqtT(o,m[_(755)]),this[_(985)](m[_(637)],g),this[_(985)](_(1537)+_(307)+"t",d)},d=()=>{let _=l;n[_(1391)](c,n[_(501)]),this.off(n[_(1536)],g),this.off(_(1537)+_(307)+"t",d)};this.on(n[l(1536)],g),this.on(n[l(1072)],d),this[l(1373)]()})}}})(),N[S(1320)+S(310)]=V[S(1320)+S(310)],N["CustomEr"+S(1541)]=V[S(1206)+S(1541)],N[S(210)+"e"]=V[S(210)+"e"],N[S(1158)]=V[S(1158)],N.FWS=V[S(830)],N[S(1510)+S(223)+S(1546)]=V[S(1510)+S(223)+S(1546)],N[S(223)+"vent"]=V["MessageE"+S(1546)],N.OpenEvent=V[S(1122)+"t"],N["Reconnec"+S(269)]=V.ReconnectEvent,N[S(982)+S(310)]=V.createCloseEvent,N[S(578)+S(1541)]=V.createErrorEvent,N[S(194)+"ssageEvent"]=V[S(194)+S(1010)+"nt"],N["createOp"+S(449)]=V[S(197)+S(449)],N[S(184)+"connectE"+S(1546)]=V[S(184)+S(582)+S(1546)],N.decodedFrame=V[S(1075)+S(1498)],N[S(1106)+S(517)]=V["encodeFr"+S(517)];for(ln in V)["CustomCl"+S(310),S(1206)+S(1541),S(210)+"e",S(1158),S(830),S(1510)+S(223)+S(1546),S(223)+S(1546),S(1122)+"t","Reconnec"+S(269),S(982)+S(310),S(578)+S(1541),"createMe"+S(1010)+"nt","createOp"+S(449),S(184)+"connectE"+S(1546),"decodedF"+S(1498),S(1106)+S(517)].indexOf(ln)===-1&&(N[ln]=V[ln]);var ln;Object[S(1148)+S(418)](N,S(621)+"le",{value:!0})});var Ne=oe((Vd,ci)=>{"use strict";var ai=["nodebuffer","arraybuffer","fragments"],xi=typeof Blob<"u";xi&&ai.push("blob");ci.exports={BINARY_TYPES:ai,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:xi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Pt=oe((Yd,yn)=>{"use strict";var{EMPTY_BUFFER:lx}=Ne(),gr=Buffer[Symbol.species];function hx(r,e){if(r.length===0)return lx;if(r.length===1)return r[0];let i=Buffer.allocUnsafe(e),a=0;for(let x=0;x<r.length;x++){let f=r[x];i.set(f,a),a+=f.length}return a<e?new gr(i.buffer,i.byteOffset,a):i}function fi(r,e,i,a,x){for(let f=0;f<x;f++)i[a+f]=r[f]^e[f&3]}function ui(r,e){for(let i=0;i<r.length;i++)r[i]^=e[i&3]}function gx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function pr(r){if(pr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new gr(r):ArrayBuffer.isView(r)?e=new gr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),pr.readOnly=!1),e}yn.exports={concat:hx,mask:fi,toArrayBuffer:gx,toBuffer:pr,unmask:ui};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=J("bufferutil");yn.exports.mask=function(e,i,a,x,f){f<48?fi(e,i,a,x,f):r.mask(e,i,a,x,f)},yn.exports.unmask=function(e,i){e.length<32?ui(e,i):r.unmask(e,i)}}catch{}});var hi=oe((Xd,li)=>{"use strict";var di=Symbol("kDone"),mr=Symbol("kRun"),wr=class{constructor(e){this[di]=()=>{this.pending--,this[mr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[mr]()}[mr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[di])}}};li.exports=wr});var ht=oe(($d,wi)=>{"use strict";var It=J("zlib"),gi=Pt(),px=hi(),{kStatusCode:pi}=Ne(),mx=Buffer[Symbol.species],_x=Buffer.from([0,0,255,255]),vn=Symbol("permessage-deflate"),Oe=Symbol("total-length"),dt=Symbol("callback"),He=Symbol("buffers"),lt=Symbol("error"),bn,_r=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!bn){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;bn=new px(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[dt];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let i=this._options,a=e.find(x=>!(i.serverNoContextTakeover===!1&&x.server_no_context_takeover||x.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>x.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!x.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return i.serverNoContextTakeover&&(a.server_no_context_takeover=!0),i.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof i.serverMaxWindowBits=="number"&&(a.server_max_window_bits=i.serverMaxWindowBits),typeof i.clientMaxWindowBits=="number"?a.client_max_window_bits=i.clientMaxWindowBits:(a.client_max_window_bits===!0||i.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(e){let i=e[0];if(this._options.clientNoContextTakeover===!1&&i.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!i.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(i.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&i.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return i}normalizeParams(e){return e.forEach(i=>{Object.keys(i).forEach(a=>{let x=i[a];if(x.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(x=x[0],a==="client_max_window_bits"){if(x!==!0){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else if(a==="server_max_window_bits"){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(x!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else throw new Error(`Unknown parameter "${a}"`);i[a]=x})}),e}decompress(e,i,a){bn.add(x=>{this._decompress(e,i,(f,u)=>{x(),a(f,u)})})}compress(e,i,a){bn.add(x=>{this._compress(e,i,(f,u)=>{x(),a(f,u)})})}_decompress(e,i,a){let x=this._isServer?"client":"server";if(!this._inflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?It.Z_DEFAULT_WINDOWBITS:this.params[f];this._inflate=It.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[vn]=this,this._inflate[Oe]=0,this._inflate[He]=[],this._inflate.on("error",bx),this._inflate.on("data",mi)}this._inflate[dt]=a,this._inflate.write(e),i&&this._inflate.write(_x),this._inflate.flush(()=>{let f=this._inflate[lt];if(f){this._inflate.close(),this._inflate=null,a(f);return}let u=gi.concat(this._inflate[He],this._inflate[Oe]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Oe]=0,this._inflate[He]=[],i&&this.params[`${x}_no_context_takeover`]&&this._inflate.reset()),a(null,u)})}_compress(e,i,a){let x=this._isServer?"server":"client";if(!this._deflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?It.Z_DEFAULT_WINDOWBITS:this.params[f];this._deflate=It.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Oe]=0,this._deflate[He]=[],this._deflate.on("data",yx)}this._deflate[dt]=a,this._deflate.write(e),this._deflate.flush(It.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let f=gi.concat(this._deflate[He],this._deflate[Oe]);i&&(f=new mx(f.buffer,f.byteOffset,f.length-4)),this._deflate[dt]=null,this._deflate[Oe]=0,this._deflate[He]=[],i&&this.params[`${x}_no_context_takeover`]&&this._deflate.reset(),a(null,f)})}};wi.exports=_r;function yx(r){this[He].push(r),this[Oe]+=r.length}function mi(r){if(this[Oe]+=r.length,this[vn]._maxPayload<1||this[Oe]<=this[vn]._maxPayload){this[He].push(r);return}this[lt]=new RangeError("Max payload size exceeded"),this[lt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[lt][pi]=1009,this.removeListener("data",mi),this.reset()}function bx(r){if(this[vn]._inflate=null,this[lt]){this[dt](this[lt]);return}r[pi]=1007,this[dt](r)}});var gt=oe((Zd,Sn)=>{"use strict";var{isUtf8:_i}=J("buffer"),{hasBlob:vx}=Ne(),Sx=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Cx(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function yr(r){let e=r.length,i=0;for(;i<e;)if((r[i]&128)===0)i++;else if((r[i]&224)===192){if(i+1===e||(r[i+1]&192)!==128||(r[i]&254)===192)return!1;i+=2}else if((r[i]&240)===224){if(i+2>=e||(r[i+1]&192)!==128||(r[i+2]&192)!==128||r[i]===224&&(r[i+1]&224)===128||r[i]===237&&(r[i+1]&224)===160)return!1;i+=3}else if((r[i]&248)===240){if(i+3>=e||(r[i+1]&192)!==128||(r[i+2]&192)!==128||(r[i+3]&192)!==128||r[i]===240&&(r[i+1]&240)===128||r[i]===244&&r[i+1]>143||r[i]>244)return!1;i+=4}else return!1;return!0}function Ex(r){return vx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Sn.exports={isBlob:Ex,isValidStatusCode:Cx,isValidUTF8:yr,tokenChars:Sx};if(_i)Sn.exports.isValidUTF8=function(r){return r.length<24?yr(r):_i(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=J("utf-8-validate");Sn.exports.isValidUTF8=function(e){return e.length<32?yr(e):r(e)}}catch{}});var Er=oe((Qd,Ai)=>{"use strict";var{Writable:Ax}=J("stream"),yi=ht(),{BINARY_TYPES:Dx,EMPTY_BUFFER:bi,kStatusCode:kx,kWebSocket:Px}=Ne(),{concat:br,toArrayBuffer:Ix,unmask:Tx}=Pt(),{isValidStatusCode:Lx,isValidUTF8:vi}=gt(),Cn=Buffer[Symbol.species],le=0,Si=1,Ci=2,Ei=3,vr=4,Sr=5,En=6,Cr=class extends Ax{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Dx[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Px]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=le}_write(e,i,a){if(this._opcode===8&&this._state==le)return a();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(a)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let a=this._buffers[0];return this._buffers[0]=new Cn(a.buffer,a.byteOffset+e,a.length-e),new Cn(a.buffer,a.byteOffset,e)}let i=Buffer.allocUnsafe(e);do{let a=this._buffers[0],x=i.length-e;e>=a.length?i.set(this._buffers.shift(),x):(i.set(new Uint8Array(a.buffer,a.byteOffset,e),x),this._buffers[0]=new Cn(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return i}startLoop(e){this._loop=!0;do switch(this._state){case le:this.getInfo(e);break;case Si:this.getPayloadLength16(e);break;case Ci:this.getPayloadLength64(e);break;case Ei:this.getMask();break;case vr:this.getData(e);break;case Sr:case En:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let i=this.consume(2);if((i[0]&48)!==0){let x=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(x);return}let a=(i[0]&64)===64;if(a&&!this._extensions[yi.extensionName]){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[1]&127,this._opcode===0){if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(!this._fragmented){let x=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let x=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(x);return}if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let x=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(x);return}}else{let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(i[1]&128)===128,this._isServer){if(!this._masked){let x=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(x);return}}else if(this._masked){let x=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(x);return}this._payloadLength===126?this._state=Si:this._payloadLength===127?this._state=Ci:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let i=this.consume(8),a=i.readUInt32BE(0);if(a>Math.pow(2,21)-1){let x=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(x);return}this._payloadLength=a*Math.pow(2,32)+i.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(i);return}this._masked?this._state=Ei:this._state=vr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=vr}getData(e){let i=bi;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}i=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Tx(i,this._mask)}if(this._opcode>7){this.controlMessage(i,e);return}if(this._compressed){this._state=Sr,this.decompress(i,e);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(e)}decompress(e,i){this._extensions[yi.extensionName].decompress(e,this._fin,(x,f)=>{if(x)return i(x);if(f.length){if(this._messageLength+=f.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(u);return}this._fragments.push(f)}this.dataMessage(i),this._state===le&&this.startLoop(i)})}dataMessage(e){if(!this._fin){this._state=le;return}let i=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let x;this._binaryType==="nodebuffer"?x=br(a,i):this._binaryType==="arraybuffer"?x=Ix(br(a,i)):this._binaryType==="blob"?x=new Blob(a):x=a,this._allowSynchronousEvents?(this.emit("message",x,!0),this._state=le):(this._state=En,setImmediate(()=>{this.emit("message",x,!0),this._state=le,this.startLoop(e)}))}else{let x=br(a,i);if(!this._skipUTF8Validation&&!vi(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(f);return}this._state===Sr||this._allowSynchronousEvents?(this.emit("message",x,!1),this._state=le):(this._state=En,setImmediate(()=>{this.emit("message",x,!1),this._state=le,this.startLoop(e)}))}}controlMessage(e,i){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,bi),this.end();else{let a=e.readUInt16BE(0);if(!Lx(a)){let f=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(f);return}let x=new Cn(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!vi(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(f);return}this._loop=!1,this.emit("conclude",a,x),this.end()}this._state=le;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=le):(this._state=En,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=le,this.startLoop(i)}))}createError(e,i,a,x,f){this._loop=!1,this._errored=!0;let u=new e(a?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(u,this.createError),u.code=f,u[kx]=x,u}};Ai.exports=Cr});var kr=oe((tl,Pi)=>{"use strict";var{Duplex:el}=J("stream"),{randomFillSync:Nx}=J("crypto"),Di=ht(),{EMPTY_BUFFER:Ox,kWebSocket:Bx,NOOP:Rx}=Ne(),{isBlob:pt,isValidStatusCode:Mx}=gt(),{mask:ki,toBuffer:$e}=Pt(),he=Symbol("kByteLength"),zx=Buffer.alloc(4),An=8*1024,Ze,mt=An,we=0,qx=1,Fx=2,Ar=class r{constructor(e,i,a){this._extensions=i||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=we,this.onerror=Rx,this[Bx]=void 0}static frame(e,i){let a,x=!1,f=2,u=!1;i.mask&&(a=i.maskBuffer||zx,i.generateMask?i.generateMask(a):(mt===An&&(Ze===void 0&&(Ze=Buffer.alloc(An)),Nx(Ze,0,An),mt=0),a[0]=Ze[mt++],a[1]=Ze[mt++],a[2]=Ze[mt++],a[3]=Ze[mt++]),u=(a[0]|a[1]|a[2]|a[3])===0,f=6);let h;typeof e=="string"?(!i.mask||u)&&i[he]!==void 0?h=i[he]:(e=Buffer.from(e),h=e.length):(h=e.length,x=i.mask&&i.readOnly&&!u);let p=h;h>=65536?(f+=8,p=127):h>125&&(f+=2,p=126);let w=Buffer.allocUnsafe(x?h+f:f);return w[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(w[0]|=64),w[1]=p,p===126?w.writeUInt16BE(h,2):p===127&&(w[2]=w[3]=0,w.writeUIntBE(h,4,6)),i.mask?(w[1]|=128,w[f-4]=a[0],w[f-3]=a[1],w[f-2]=a[2],w[f-1]=a[3],u?[w,e]:x?(ki(e,a,w,f,h),[w]):(ki(e,a,e,0,h),[w,e])):[w,e]}close(e,i,a,x){let f;if(e===void 0)f=Ox;else{if(typeof e!="number"||!Mx(e))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)f=Buffer.allocUnsafe(2),f.writeUInt16BE(e,0);else{let h=Buffer.byteLength(i);if(h>123)throw new RangeError("The message must not be greater than 123 bytes");f=Buffer.allocUnsafe(2+h),f.writeUInt16BE(e,0),typeof i=="string"?f.write(i,2):f.set(i,2)}}let u={[he]:f.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==we?this.enqueue([this.dispatch,f,!1,u,x]):this.sendFrame(r.frame(f,u),x)}ping(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):pt(e)?(x=e.size,f=!1):(e=$e(e),x=e.length,f=$e.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[he]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:f,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==we?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}pong(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):pt(e)?(x=e.size,f=!1):(e=$e(e),x=e.length,f=$e.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[he]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:f,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==we?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}send(e,i,a){let x=this._extensions[Di.extensionName],f=i.binary?2:1,u=i.compress,h,p;typeof e=="string"?(h=Buffer.byteLength(e),p=!1):pt(e)?(h=e.size,p=!1):(e=$e(e),h=e.length,p=$e.readOnly),this._firstFragment?(this._firstFragment=!1,u&&x&&x.params[x._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=h>=x._threshold),this._compress=u):(u=!1,f=0),i.fin&&(this._firstFragment=!0);let w={[he]:h,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:f,readOnly:p,rsv1:u};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,this._compress,w,a]):this.getBlobData(e,this._compress,w,a):this._state!==we?this.enqueue([this.dispatch,e,this._compress,w,a]):this.dispatch(e,this._compress,w,a)}getBlobData(e,i,a,x){this._bufferedBytes+=a[he],this._state=Fx,e.arrayBuffer().then(f=>{if(this._socket.destroyed){let h=new Error("The socket was closed while the blob was being read");process.nextTick(Dr,this,h,x);return}this._bufferedBytes-=a[he];let u=$e(f);i?this.dispatch(u,i,a,x):(this._state=we,this.sendFrame(r.frame(u,a),x),this.dequeue())}).catch(f=>{process.nextTick(Ux,this,f,x)})}dispatch(e,i,a,x){if(!i){this.sendFrame(r.frame(e,a),x);return}let f=this._extensions[Di.extensionName];this._bufferedBytes+=a[he],this._state=qx,f.compress(e,a.fin,(u,h)=>{if(this._socket.destroyed){let p=new Error("The socket was closed while data was being compressed");Dr(this,p,x);return}this._bufferedBytes-=a[he],this._state=we,a.readOnly=!1,this.sendFrame(r.frame(h,a),x),this.dequeue()})}dequeue(){for(;this._state===we&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][he],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][he],this._queue.push(e)}sendFrame(e,i){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],i),this._socket.uncork()):this._socket.write(e[0],i)}};Pi.exports=Ar;function Dr(r,e,i){typeof i=="function"&&i(e);for(let a=0;a<r._queue.length;a++){let x=r._queue[a],f=x[x.length-1];typeof f=="function"&&f(e)}}function Ux(r,e,i){Dr(r,e,i),r.onerror(e)}});var zi=oe((nl,Mi)=>{"use strict";var{kForOnEventAttribute:Tt,kListener:Pr}=Ne(),Ii=Symbol("kCode"),Ti=Symbol("kData"),Li=Symbol("kError"),Ni=Symbol("kMessage"),Oi=Symbol("kReason"),wt=Symbol("kTarget"),Bi=Symbol("kType"),Ri=Symbol("kWasClean"),Be=class{constructor(e){this[wt]=null,this[Bi]=e}get target(){return this[wt]}get type(){return this[Bi]}};Object.defineProperty(Be.prototype,"target",{enumerable:!0});Object.defineProperty(Be.prototype,"type",{enumerable:!0});var Qe=class extends Be{constructor(e,i={}){super(e),this[Ii]=i.code===void 0?0:i.code,this[Oi]=i.reason===void 0?"":i.reason,this[Ri]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[Ii]}get reason(){return this[Oi]}get wasClean(){return this[Ri]}};Object.defineProperty(Qe.prototype,"code",{enumerable:!0});Object.defineProperty(Qe.prototype,"reason",{enumerable:!0});Object.defineProperty(Qe.prototype,"wasClean",{enumerable:!0});var _t=class extends Be{constructor(e,i={}){super(e),this[Li]=i.error===void 0?null:i.error,this[Ni]=i.message===void 0?"":i.message}get error(){return this[Li]}get message(){return this[Ni]}};Object.defineProperty(_t.prototype,"error",{enumerable:!0});Object.defineProperty(_t.prototype,"message",{enumerable:!0});var Lt=class extends Be{constructor(e,i={}){super(e),this[Ti]=i.data===void 0?null:i.data}get data(){return this[Ti]}};Object.defineProperty(Lt.prototype,"data",{enumerable:!0});var Kx={addEventListener(r,e,i={}){for(let x of this.listeners(r))if(!i[Tt]&&x[Pr]===e&&!x[Tt])return;let a;if(r==="message")a=function(f,u){let h=new Lt("message",{data:u?f:f.toString()});h[wt]=this,Dn(e,this,h)};else if(r==="close")a=function(f,u){let h=new Qe("close",{code:f,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});h[wt]=this,Dn(e,this,h)};else if(r==="error")a=function(f){let u=new _t("error",{error:f,message:f.message});u[wt]=this,Dn(e,this,u)};else if(r==="open")a=function(){let f=new Be("open");f[wt]=this,Dn(e,this,f)};else return;a[Tt]=!!i[Tt],a[Pr]=e,i.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let i of this.listeners(r))if(i[Pr]===e&&!i[Tt]){this.removeListener(r,i);break}}};Mi.exports={CloseEvent:Qe,ErrorEvent:_t,Event:Be,EventTarget:Kx,MessageEvent:Lt};function Dn(r,e,i){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,i):r.call(e,i)}});var kn=oe((rl,qi)=>{"use strict";var{tokenChars:Nt}=gt();function Ce(r,e,i){r[e]===void 0?r[e]=[i]:r[e].push(i)}function Hx(r){let e=Object.create(null),i=Object.create(null),a=!1,x=!1,f=!1,u,h,p=-1,w=-1,b=-1,y=0;for(;y<r.length;y++)if(w=r.charCodeAt(y),u===void 0)if(b===-1&&Nt[w]===1)p===-1&&(p=y);else if(y!==0&&(w===32||w===9))b===-1&&p!==-1&&(b=y);else if(w===59||w===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let P=r.slice(p,b);w===44?(Ce(e,P,i),i=Object.create(null)):u=P,p=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(h===void 0)if(b===-1&&Nt[w]===1)p===-1&&(p=y);else if(w===32||w===9)b===-1&&p!==-1&&(b=y);else if(w===59||w===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y),Ce(i,r.slice(p,b),!0),w===44&&(Ce(e,u,i),i=Object.create(null),u=void 0),p=b=-1}else if(w===61&&p!==-1&&b===-1)h=r.slice(p,y),p=b=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(x){if(Nt[w]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);p===-1?p=y:a||(a=!0),x=!1}else if(f)if(Nt[w]===1)p===-1&&(p=y);else if(w===34&&p!==-1)f=!1,b=y;else if(w===92)x=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(w===34&&r.charCodeAt(y-1)===61)f=!0;else if(b===-1&&Nt[w]===1)p===-1&&(p=y);else if(p!==-1&&(w===32||w===9))b===-1&&(b=y);else if(w===59||w===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let P=r.slice(p,b);a&&(P=P.replace(/\\/g,""),a=!1),Ce(i,h,P),w===44&&(Ce(e,u,i),i=Object.create(null),u=void 0),h=void 0,p=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(p===-1||f||w===32||w===9)throw new SyntaxError("Unexpected end of input");b===-1&&(b=y);let E=r.slice(p,b);return u===void 0?Ce(e,E,i):(h===void 0?Ce(i,E,!0):a?Ce(i,h,E.replace(/\\/g,"")):Ce(i,h,E),Ce(e,u,i)),e}function Wx(r){return Object.keys(r).map(e=>{let i=r[e];return Array.isArray(i)||(i=[i]),i.map(a=>[e].concat(Object.keys(a).map(x=>{let f=a[x];return Array.isArray(f)||(f=[f]),f.map(u=>u===!0?x:`${x}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}qi.exports={format:Wx,parse:Hx}});var Ln=oe((ol,$i)=>{"use strict";var jx=J("events"),Gx=J("https"),Jx=J("http"),Ki=J("net"),Vx=J("tls"),{randomBytes:Yx,createHash:Xx}=J("crypto"),{Duplex:sl,Readable:il}=J("stream"),{URL:Ir}=J("url"),We=ht(),$x=Er(),Zx=kr(),{isBlob:Qx}=gt(),{BINARY_TYPES:Fi,CLOSE_TIMEOUT:ec,EMPTY_BUFFER:Pn,GUID:tc,kForOnEventAttribute:Tr,kListener:nc,kStatusCode:rc,kWebSocket:Z,NOOP:Hi}=Ne(),{EventTarget:{addEventListener:sc,removeEventListener:ic}}=zi(),{format:oc,parse:ac}=kn(),{toBuffer:xc}=Pt(),Wi=Symbol("kAborted"),Lr=[8,13],Re=["CONNECTING","OPEN","CLOSING","CLOSED"],cc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,F=class r extends jx{constructor(e,i,a){super(),this._binaryType=Fi[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Pn,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,i===void 0?i=[]:Array.isArray(i)||(typeof i=="object"&&i!==null?(a=i,i=[]):i=[i]),ji(this,e,i,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Fi.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,i,a){let x=new $x({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),f=new Zx(e,this._extensions,a.generateMask);this._receiver=x,this._sender=f,this._socket=e,x[Z]=this,f[Z]=this,e[Z]=this,x.on("conclude",dc),x.on("drain",lc),x.on("error",hc),x.on("message",gc),x.on("ping",pc),x.on("pong",mc),f.onerror=wc,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",Vi),e.on("data",Tn),e.on("end",Yi),e.on("error",Xi),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[We.extensionName]&&this._extensions[We.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,i){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,i,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Ji(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Nr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||Pn,i,a)}pong(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Nr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||Pn,i,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof i=="function"&&(a=i,i={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Nr(this,e,a);return}let x={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[We.extensionName]||(x.compress=!1),this._sender.send(e||Pn,x,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(F,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(F.prototype,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(F,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(F.prototype,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(F,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(F.prototype,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(F,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});Object.defineProperty(F.prototype,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(F.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(F.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Tr])return e[nc];return null},set(e){for(let i of this.listeners(r))if(i[Tr]){this.removeListener(r,i);break}typeof e=="function"&&this.addEventListener(r,e,{[Tr]:!0})}})});F.prototype.addEventListener=sc;F.prototype.removeEventListener=ic;$i.exports=F;function ji(r,e,i,a){let x={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ec,protocolVersion:Lr[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=x.autoPong,r._closeTimeout=x.closeTimeout,!Lr.includes(x.protocolVersion))throw new RangeError(`Unsupported protocol version: ${x.protocolVersion} (supported versions: ${Lr.join(", ")})`);let f;if(e instanceof Ir)f=e;else try{f=new Ir(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}f.protocol==="http:"?f.protocol="ws:":f.protocol==="https:"&&(f.protocol="wss:"),r._url=f.href;let u=f.protocol==="wss:",h=f.protocol==="ws+unix:",p;if(f.protocol!=="ws:"&&!u&&!h?p=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:h&&!f.pathname?p="The URL's pathname is empty":f.hash&&(p="The URL contains a fragment identifier"),p){let L=new SyntaxError(p);if(r._redirects===0)throw L;In(r,L);return}let w=u?443:80,b=Yx(16).toString("base64"),y=u?Gx.request:Jx.request,E=new Set,P;if(x.createConnection=x.createConnection||(u?uc:fc),x.defaultPort=x.defaultPort||w,x.port=f.port||w,x.host=f.hostname.startsWith("[")?f.hostname.slice(1,-1):f.hostname,x.headers={...x.headers,"Sec-WebSocket-Version":x.protocolVersion,"Sec-WebSocket-Key":b,Connection:"Upgrade",Upgrade:"websocket"},x.path=f.pathname+f.search,x.timeout=x.handshakeTimeout,x.perMessageDeflate&&(P=new We({...x.perMessageDeflate,isServer:!1,maxPayload:x.maxPayload}),x.headers["Sec-WebSocket-Extensions"]=oc({[We.extensionName]:P.offer()})),i.length){for(let L of i){if(typeof L!="string"||!cc.test(L)||E.has(L))throw new SyntaxError("An invalid or duplicated subprotocol was specified");E.add(L)}x.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(x.origin&&(x.protocolVersion<13?x.headers["Sec-WebSocket-Origin"]=x.origin:x.headers.Origin=x.origin),(f.username||f.password)&&(x.auth=`${f.username}:${f.password}`),h){let L=x.path.split(":");x.socketPath=L[0],x.path=L[1]}let I;if(x.followRedirects){if(r._redirects===0){r._originalIpc=h,r._originalSecure=u,r._originalHostOrSocketPath=h?x.socketPath:f.host;let L=a&&a.headers;if(a={...a,headers:{}},L)for(let[j,ie]of Object.entries(L))a.headers[j.toLowerCase()]=ie}else if(r.listenerCount("redirect")===0){let L=h?r._originalIpc?x.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:f.host===r._originalHostOrSocketPath;(!L||r._originalSecure&&!u)&&(delete x.headers.authorization,delete x.headers.cookie,L||delete x.headers.host,x.auth=void 0)}x.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(x.auth).toString("base64")),I=r._req=y(x),r._redirects&&r.emit("redirect",r.url,I)}else I=r._req=y(x);x.timeout&&I.on("timeout",()=>{fe(r,I,"Opening handshake has timed out")}),I.on("error",L=>{I===null||I[Wi]||(I=r._req=null,In(r,L))}),I.on("response",L=>{let j=L.headers.location,ie=L.statusCode;if(j&&x.followRedirects&&ie>=300&&ie<400){if(++r._redirects>x.maxRedirects){fe(r,I,"Maximum redirects exceeded");return}I.abort();let xe;try{xe=new Ir(j,e)}catch{let z=new SyntaxError(`Invalid URL: ${j}`);In(r,z);return}ji(r,xe,i,a)}else r.emit("unexpected-response",I,L)||fe(r,I,`Unexpected server response: ${L.statusCode}`)}),I.on("upgrade",(L,j,ie)=>{if(r.emit("upgrade",L),r.readyState!==F.CONNECTING)return;I=r._req=null;let xe=L.headers.upgrade;if(xe===void 0||xe.toLowerCase()!=="websocket"){fe(r,j,"Invalid Upgrade header");return}let D=Xx("sha1").update(b+tc).digest("base64");if(L.headers["sec-websocket-accept"]!==D){fe(r,j,"Invalid Sec-WebSocket-Accept header");return}let z=L.headers["sec-websocket-protocol"],G;if(z!==void 0?E.size?E.has(z)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":E.size&&(G="Server sent no subprotocol"),G){fe(r,j,G);return}z&&(r._protocol=z);let Ee=L.headers["sec-websocket-extensions"];if(Ee!==void 0){if(!P){fe(r,j,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Me;try{Me=ac(Ee)}catch{fe(r,j,"Invalid Sec-WebSocket-Extensions header");return}let _e=Object.keys(Me);if(_e.length!==1||_e[0]!==We.extensionName){fe(r,j,"Server indicated an extension that was not requested");return}try{P.accept(Me[We.extensionName])}catch{fe(r,j,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[We.extensionName]=P}r.setSocket(j,ie,{allowSynchronousEvents:x.allowSynchronousEvents,generateMask:x.generateMask,maxPayload:x.maxPayload,skipUTF8Validation:x.skipUTF8Validation})}),x.finishRequest?x.finishRequest(I,r):I.end()}function In(r,e){r._readyState=F.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function fc(r){return r.path=r.socketPath,Ki.connect(r)}function uc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Ki.isIP(r.host)?"":r.host),Vx.connect(r)}function fe(r,e,i){r._readyState=F.CLOSING;let a=new Error(i);Error.captureStackTrace(a,fe),e.setHeader?(e[Wi]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(In,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Nr(r,e,i){if(e){let a=Qx(e)?e.size:xc(e).length;r._socket?r._sender._bufferedBytes+=a:r._bufferedAmount+=a}if(i){let a=new Error(`WebSocket is not open: readyState ${r.readyState} (${Re[r.readyState]})`);process.nextTick(i,a)}}function dc(r,e){let i=this[Z];i._closeFrameReceived=!0,i._closeMessage=e,i._closeCode=r,i._socket[Z]!==void 0&&(i._socket.removeListener("data",Tn),process.nextTick(Gi,i._socket),r===1005?i.close():i.close(r,e))}function lc(){let r=this[Z];r.isPaused||r._socket.resume()}function hc(r){let e=this[Z];e._socket[Z]!==void 0&&(e._socket.removeListener("data",Tn),process.nextTick(Gi,e._socket),e.close(r[rc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Ui(){this[Z].emitClose()}function gc(r,e){this[Z].emit("message",r,e)}function pc(r){let e=this[Z];e._autoPong&&e.pong(r,!this._isServer,Hi),e.emit("ping",r)}function mc(r){this[Z].emit("pong",r)}function Gi(r){r.resume()}function wc(r){let e=this[Z];e.readyState!==F.CLOSED&&(e.readyState===F.OPEN&&(e._readyState=F.CLOSING,Ji(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Ji(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function Vi(){let r=this[Z];if(this.removeListener("close",Vi),this.removeListener("data",Tn),this.removeListener("end",Yi),r._readyState=F.CLOSING,!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);r._receiver.write(e)}r._receiver.end(),this[Z]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Ui),r._receiver.on("finish",Ui))}function Tn(r){this[Z]._receiver.write(r)||this.pause()}function Yi(){let r=this[Z];r._readyState=F.CLOSING,r._receiver.end(),this.end()}function Xi(){let r=this[Z];this.removeListener("error",Xi),this.on("error",Hi),r&&(r._readyState=F.CLOSING,this.destroy())}});var to=oe((xl,eo)=>{"use strict";var al=Ln(),{Duplex:_c}=J("stream");function Zi(r){r.emit("close")}function yc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Qi(r){this.removeListener("error",Qi),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function bc(r,e){let i=!0,a=new _c({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(f,u){let h=!u&&a._readableState.objectMode?f.toString():f;a.push(h)||r.pause()}),r.once("error",function(f){a.destroyed||(i=!1,a.destroy(f))}),r.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(x,f){if(r.readyState===r.CLOSED){f(x),process.nextTick(Zi,a);return}let u=!1;r.once("error",function(p){u=!0,f(p)}),r.once("close",function(){u||f(x),process.nextTick(Zi,a)}),i&&r.terminate()},a._final=function(x){if(r.readyState===r.CONNECTING){r.once("open",function(){a._final(x)});return}r._socket!==null&&(r._socket._writableState.finished?(x(),a._readableState.endEmitted&&a.destroy()):(r._socket.once("finish",function(){x()}),r.close()))},a._read=function(){r.isPaused&&r.resume()},a._write=function(x,f,u){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(x,f,u)});return}r.send(x,u)},a.on("end",yc),a.on("error",Qi),a}eo.exports=bc});var Or=oe((cl,no)=>{"use strict";var{tokenChars:vc}=gt();function Sc(r){let e=new Set,i=-1,a=-1,x=0;for(x;x<r.length;x++){let u=r.charCodeAt(x);if(a===-1&&vc[u]===1)i===-1&&(i=x);else if(x!==0&&(u===32||u===9))a===-1&&i!==-1&&(a=x);else if(u===44){if(i===-1)throw new SyntaxError(`Unexpected character at index ${x}`);a===-1&&(a=x);let h=r.slice(i,a);if(e.has(h))throw new SyntaxError(`The "${h}" subprotocol is duplicated`);e.add(h),i=a=-1}else throw new SyntaxError(`Unexpected character at index ${x}`)}if(i===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let f=r.slice(i,x);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);return e.add(f),e}no.exports={parse:Sc}});var co=oe((ul,xo)=>{"use strict";var Cc=J("events"),Nn=J("http"),{Duplex:fl}=J("stream"),{createHash:Ec}=J("crypto"),ro=kn(),et=ht(),Ac=Or(),Dc=Ln(),{CLOSE_TIMEOUT:kc,GUID:Pc,kWebSocket:Ic}=Ne(),Tc=/^[+/0-9A-Za-z]{22}==$/,so=0,io=1,ao=2,Br=class extends Cc{constructor(e,i){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:kc,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Dc,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Nn.createServer((a,x)=>{let f=Nn.STATUS_CODES[426];x.writeHead(426,{"Content-Length":f.length,"Content-Type":"text/plain"}),x.end(f)}),this._server.listen(e.port,e.host,e.backlog,i)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Lc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(x,f,u)=>{this.handleUpgrade(x,f,u,a)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=so}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===ao){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Ot,this);return}if(e&&this.once("close",e),this._state!==io)if(this._state=io,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Ot,this):process.nextTick(Ot,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Ot(this)})}}shouldHandle(e){if(this.options.path){let i=e.url.indexOf("?");if((i!==-1?e.url.slice(0,i):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,i,a,x){i.on("error",oo);let f=e.headers["sec-websocket-key"],u=e.headers.upgrade,h=+e.headers["sec-websocket-version"];if(e.method!=="GET"){nt(this,e,i,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){nt(this,e,i,400,"Invalid Upgrade header");return}if(f===void 0||!Tc.test(f)){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Key header");return}if(h!==13&&h!==8){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Bt(i,400);return}let p=e.headers["sec-websocket-protocol"],w=new Set;if(p!==void 0)try{w=Ac.parse(p)}catch{nt(this,e,i,400,"Invalid Sec-WebSocket-Protocol header");return}let b=e.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&b!==void 0){let E=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let P=ro.parse(b);P[et.extensionName]&&(E.accept(P[et.extensionName]),y[et.extensionName]=E)}catch{nt(this,e,i,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let E={origin:e.headers[`${h===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(E,(P,I,L,j)=>{if(!P)return Bt(i,I||401,L,j);this.completeUpgrade(y,f,w,e,i,a,x)});return}if(!this.options.verifyClient(E))return Bt(i,401)}this.completeUpgrade(y,f,w,e,i,a,x)}completeUpgrade(e,i,a,x,f,u,h){if(!f.readable||!f.writable)return f.destroy();if(f[Ic])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>so)return Bt(f,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ec("sha1").update(i+Pc).digest("base64")}`],b=new this.options.WebSocket(null,void 0,this.options);if(a.size){let y=this.options.handleProtocols?this.options.handleProtocols(a,x):a.values().next().value;y&&(w.push(`Sec-WebSocket-Protocol: ${y}`),b._protocol=y)}if(e[et.extensionName]){let y=e[et.extensionName].params,E=ro.format({[et.extensionName]:[y]});w.push(`Sec-WebSocket-Extensions: ${E}`),b._extensions=e}this.emit("headers",w,x),f.write(w.concat(`\r
12
12
  `).join(`\r
13
- `)),u.removeListener("error",oo),w.setSocket(u,l,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(w),w.on("close",()=>{this.clients.delete(w),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Mt,this)})),p(w,c)}};xo.exports=Ir;function Ic(r,e){for(let o of Object.keys(e))r.on(o,e[o]);return function(){for(let a of Object.keys(e))r.removeListener(a,e[a])}}function Mt(r){r._state=ao,r.emit("close")}function oo(){this.destroy()}function Ot(r,e,o,a){o=o||Rn.STATUS_CODES[e],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(o),...a},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Rn.STATUS_CODES[e]}\r
14
- `+Object.keys(a).map(c=>`${c}: ${a[c]}`).join(`\r
13
+ `)),f.removeListener("error",oo),b.setSocket(f,u,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(b),b.on("close",()=>{this.clients.delete(b),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ot,this)})),h(b,x)}};xo.exports=Br;function Lc(r,e){for(let i of Object.keys(e))r.on(i,e[i]);return function(){for(let a of Object.keys(e))r.removeListener(a,e[a])}}function Ot(r){r._state=ao,r.emit("close")}function oo(){this.destroy()}function Bt(r,e,i,a){i=i||Nn.STATUS_CODES[e],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...a},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Nn.STATUS_CODES[e]}\r
14
+ `+Object.keys(a).map(x=>`${x}: ${a[x]}`).join(`\r
15
15
  `)+`\r
16
16
  \r
17
- `+o)}function et(r,e,o,a,c,u){if(r.listenerCount("wsClientError")){let l=new Error(c);Error.captureStackTrace(l,et),r.emit("wsClientError",l,o,e)}else Ot(o,a,c,u)}});import{spawn as tu}from"node:child_process";import{existsSync as nu,openSync as ru}from"node:fs";import{mkdir as su}from"node:fs/promises";import{dirname as iu}from"node:path";import{fileURLToPath as ou}from"node:url";function Mr(r=W()){return nu(r.libEntry)?r.libEntry:ou(new URL("../index.ts",import.meta.url))}async function ko(r={}){let e=r.paths??W(),o=r.entryOverride??Mr(e);await su(iu(e.logFile),{recursive:!0});let a=ru(e.logFile,"a"),u=o.endsWith(".ts")?["--import","tsx/esm",o,"--daemon"]:[o,"--daemon"],l=tu(process.execPath,u,{detached:!0,stdio:["ignore",a,a],env:{...process.env,COZE_BRIDGE_DAEMON:"1"}});if(l.unref(),typeof l.pid!="number")throw new Error("failed to spawn daemon (no pid)");return au.info("daemon spawned",{pid:l.pid,entry:o}),{pid:l.pid,entry:o}}var au,Or=ke(()=>{"use strict";F();ue();au=M("spawn-daemon")});import{spawn as gu}from"node:child_process";import{mkdir as pu,unlink as mu,writeFile as _u}from"node:fs/promises";import{dirname as wu,join as bu}from"node:path";function Kn(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Mo(r,e){return new Promise((o,a)=>{let c=gu(r,e,{stdio:["ignore","pipe","pipe"]}),u="";c.stderr?.on("data",l=>{u+=l.toString("utf8")}),c.on("error",a),c.on("close",l=>{l===0?o():a(new Error(`${r} ${e.join(" ")} exited ${l}: ${u.trim()}`))})})}var Fn,qr,Ur,Oo=ke(()=>{"use strict";F();Fn=M("supervisor.launchd"),qr="ai.coze.bridge",Ur={platform:"darwin",renderConfig(r){return`<?xml version="1.0" encoding="UTF-8"?>
17
+ `+i)}function nt(r,e,i,a,x,f){if(r.listenerCount("wsClientError")){let u=new Error(x);Error.captureStackTrace(u,nt),r.emit("wsClientError",u,i,e)}else Bt(i,a,x,f)}});import{spawn as rf}from"node:child_process";import{existsSync as sf,openSync as of}from"node:fs";import{mkdir as af}from"node:fs/promises";import{dirname as xf}from"node:path";import{fileURLToPath as cf}from"node:url";function zr(r=H()){return sf(r.libEntry)?r.libEntry:cf(new URL("../index.ts",import.meta.url))}async function Io(r={}){let e=r.paths??H(),i=r.entryOverride??zr(e);await af(xf(e.logFile),{recursive:!0});let a=of(e.logFile,"a"),f=i.endsWith(".ts")?["--import","tsx/esm",i,"--daemon"]:[i,"--daemon"],u=rf(process.execPath,f,{detached:!0,stdio:["ignore",a,a],env:{...process.env,COZE_BRIDGE_DAEMON:"1"}});if(u.unref(),typeof u.pid!="number")throw new Error("failed to spawn daemon (no pid)");return ff.info("daemon spawned",{pid:u.pid,entry:i}),{pid:u.pid,entry:i}}var ff,qr=Pe(()=>{"use strict";U();ce();ff=T("spawn-daemon")});import{spawn as wf}from"node:child_process";import{mkdir as _f,unlink as yf,writeFile as bf}from"node:fs/promises";import{dirname as vf,join as Sf}from"node:path";function Un(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Bo(r,e){return new Promise((i,a)=>{let x=wf(r,e,{stdio:["ignore","pipe","pipe"]}),f="";x.stderr?.on("data",u=>{f+=u.toString("utf8")}),x.on("error",a),x.on("close",u=>{u===0?i():a(new Error(`${r} ${e.join(" ")} exited ${u}: ${f.trim()}`))})})}var Fn,Kr,Hr,Ro=Pe(()=>{"use strict";U();Fn=T("supervisor.launchd"),Kr="ai.coze.bridge",Hr={platform:"darwin",renderConfig(r){return`<?xml version="1.0" encoding="UTF-8"?>
18
18
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
19
19
  <plist version="1.0">
20
20
  <dict>
21
21
  <key>Label</key>
22
- <string>${qr}</string>
22
+ <string>${Kr}</string>
23
23
  <key>ProgramArguments</key>
24
24
  <array>
25
- <string>${Kn(r.nodeBin)}</string>
26
- <string>${Kn(r.entry)}</string>
25
+ <string>${Un(r.nodeBin)}</string>
26
+ <string>${Un(r.entry)}</string>
27
27
  <string>--daemon</string>
28
28
  </array>
29
29
  <key>RunAtLoad</key>
@@ -33,12 +33,12 @@ var I0=Object.create;var rr=Object.defineProperty;var N0=Object.getOwnPropertyDe
33
33
  <key>ThrottleInterval</key>
34
34
  <integer>10</integer>
35
35
  <key>StandardOutPath</key>
36
- <string>${Kn(r.logFile)}</string>
36
+ <string>${Un(r.logFile)}</string>
37
37
  <key>StandardErrorPath</key>
38
- <string>${Kn(r.logFile)}</string>
38
+ <string>${Un(r.logFile)}</string>
39
39
  </dict>
40
40
  </plist>
41
- `},configPath(r){return bu(r.homeDir,"Library","LaunchAgents",`${qr}.plist`)},async install(r){let e=this.configPath(r);await pu(wu(e),{recursive:!0}),await _u(e,this.renderConfig(r),"utf8"),Fn.info("plist written",{plistPath:e}),await Mo("launchctl",["load","-w",e]),Fn.info("launchd job loaded",{label:qr})},async uninstall(r){let e=this.configPath(r);await Mo("launchctl",["unload","-w",e]).catch(o=>Fn.warn("launchctl unload failed (ignored)",{err:String(o)})),await mu(e).catch(o=>{if(o.code!=="ENOENT")throw o}),Fn.info("launchd job removed",{plistPath:e})}}});import{spawn as yu}from"node:child_process";import{mkdir as vu,unlink as Su,writeFile as Cu}from"node:fs/promises";import{dirname as Eu,join as Au}from"node:path";function jn(r,e){return new Promise((o,a)=>{let c=yu(r,e,{stdio:["ignore","pipe","pipe"]}),u="";c.stderr?.on("data",l=>{u+=l.toString("utf8")}),c.on("error",a),c.on("close",l=>{l===0?o():a(new Error(`${r} ${e.join(" ")} exited ${l}: ${u.trim()}`))})})}var Hn,Wn,Fr,Bo=ke(()=>{"use strict";F();Hn=M("supervisor.systemd"),Wn="coze-bridge.service",Fr={platform:"linux",renderConfig(r){return`[Unit]
41
+ `},configPath(r){return Sf(r.homeDir,"Library","LaunchAgents",`${Kr}.plist`)},async install(r){let e=this.configPath(r);await _f(vf(e),{recursive:!0}),await bf(e,this.renderConfig(r),"utf8"),Fn.info("plist written",{plistPath:e}),await Bo("launchctl",["load","-w",e]),Fn.info("launchd job loaded",{label:Kr})},async uninstall(r){let e=this.configPath(r);await Bo("launchctl",["unload","-w",e]).catch(i=>Fn.warn("launchctl unload failed (ignored)",{err:String(i)})),await yf(e).catch(i=>{if(i.code!=="ENOENT")throw i}),Fn.info("launchd job removed",{plistPath:e})}}});import{spawn as Cf}from"node:child_process";import{mkdir as Ef,unlink as Af,writeFile as Df}from"node:fs/promises";import{dirname as kf,join as Pf}from"node:path";function Wn(r,e){return new Promise((i,a)=>{let x=Cf(r,e,{stdio:["ignore","pipe","pipe"]}),f="";x.stderr?.on("data",u=>{f+=u.toString("utf8")}),x.on("error",a),x.on("close",u=>{u===0?i():a(new Error(`${r} ${e.join(" ")} exited ${u}: ${f.trim()}`))})})}var Kn,Hn,Wr,Mo=Pe(()=>{"use strict";U();Kn=T("supervisor.systemd"),Hn="coze-bridge.service",Wr={platform:"linux",renderConfig(r){return`[Unit]
42
42
  Description=Coze Bridge daemon
43
43
  After=network.target
44
44
 
@@ -52,7 +52,7 @@ StandardError=append:${r.logFile}
52
52
 
53
53
  [Install]
54
54
  WantedBy=default.target
55
- `},configPath(r){return Au(r.homeDir,".config","systemd","user",Wn)},async install(r){let e=this.configPath(r);await vu(Eu(e),{recursive:!0}),await Cu(e,this.renderConfig(r),"utf8"),Hn.info("systemd unit written",{unitPath:e}),await jn("systemctl",["--user","daemon-reload"]),await jn("systemctl",["--user","enable","--now",Wn]),Hn.info("systemd unit enabled",{unitName:Wn})},async uninstall(r){let e=this.configPath(r);await jn("systemctl",["--user","disable","--now",Wn]).catch(o=>Hn.warn("systemctl disable failed (ignored)",{err:String(o)})),await Su(e).catch(o=>{if(o.code!=="ENOENT")throw o}),await jn("systemctl",["--user","daemon-reload"]).catch(()=>{}),Hn.info("systemd unit removed",{unitPath:e})}}});import{spawn as Du}from"node:child_process";import{join as Lu}from"node:path";function zo(r,e){return new Promise((o,a)=>{let c=Du(r,e,{stdio:["ignore","pipe","pipe"],shell:!1}),u="";c.stderr?.on("data",l=>{u+=l.toString("utf8")}),c.on("error",a),c.on("close",l=>{l===0?o():a(new Error(`${r} ${e.join(" ")} exited ${l}: ${u.trim()}`))})})}var Kr,Gn,Hr,qo=ke(()=>{"use strict";F();Kr=M("supervisor.taskscheduler"),Gn="CozeBridge",Hr={platform:"win32",renderConfig(r){return`<?xml version="1.0" encoding="UTF-16"?>
55
+ `},configPath(r){return Pf(r.homeDir,".config","systemd","user",Hn)},async install(r){let e=this.configPath(r);await Ef(kf(e),{recursive:!0}),await Df(e,this.renderConfig(r),"utf8"),Kn.info("systemd unit written",{unitPath:e}),await Wn("systemctl",["--user","daemon-reload"]),await Wn("systemctl",["--user","enable","--now",Hn]),Kn.info("systemd unit enabled",{unitName:Hn})},async uninstall(r){let e=this.configPath(r);await Wn("systemctl",["--user","disable","--now",Hn]).catch(i=>Kn.warn("systemctl disable failed (ignored)",{err:String(i)})),await Af(e).catch(i=>{if(i.code!=="ENOENT")throw i}),await Wn("systemctl",["--user","daemon-reload"]).catch(()=>{}),Kn.info("systemd unit removed",{unitPath:e})}}});import{spawn as If}from"node:child_process";import{join as Tf}from"node:path";function zo(r,e){return new Promise((i,a)=>{let x=If(r,e,{stdio:["ignore","pipe","pipe"],shell:!1}),f="";x.stderr?.on("data",u=>{f+=u.toString("utf8")}),x.on("error",a),x.on("close",u=>{u===0?i():a(new Error(`${r} ${e.join(" ")} exited ${u}: ${f.trim()}`))})})}var jr,jn,Gr,qo=Pe(()=>{"use strict";U();jr=T("supervisor.taskscheduler"),jn="CozeBridge",Gr={platform:"win32",renderConfig(r){return`<?xml version="1.0" encoding="UTF-16"?>
56
56
  <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
57
57
  <RegistrationInfo>
58
58
  <Description>Coze Bridge daemon</Description>
@@ -76,19 +76,19 @@ WantedBy=default.target
76
76
  </Exec>
77
77
  </Actions>
78
78
  </Task>
79
- `},configPath(r){return Lu(r.homeDir,".coze","bridge","task.xml")},async install(r){let e=`"${r.nodeBin}" "${r.entry}" --daemon`;await zo("schtasks",["/Create","/SC","ONLOGON","/TN",Gn,"/TR",e,"/RU",r.userName,"/F"]),Kr.info("task scheduler entry created",{task:Gn})},async uninstall(r){await zo("schtasks",["/Delete","/TN",Gn,"/F"]).catch(e=>Kr.warn("schtasks /Delete failed (ignored)",{err:String(e)})),Kr.info("task scheduler entry removed",{task:Gn})}}});var Wr={};ms(Wr,{buildContext:()=>Iu,getSupervisor:()=>Tu,launchdSupervisor:()=>Ur,systemdSupervisor:()=>Fr,taskSchedulerSupervisor:()=>Hr});import{homedir as Pu,userInfo as ku}from"node:os";function Tu(r=process.platform){switch(r){case"darwin":return Ur;case"linux":return Fr;case"win32":return Hr;default:throw new Error(`unsupported platform for OS supervisor: ${r}`)}}function Iu(){let r=W();return{nodeBin:process.execPath,entry:Mr(r),logFile:r.logFile,homeDir:Pu(),userName:ku().username}}var jr=ke(()=>{"use strict";ue();Or();Oo();Bo();qo()});at();F();import{readdir as ea}from"node:fs/promises";import{mkdir as V0,writeFile as Y0}from"node:fs/promises";import{join as Z0}from"node:path";var $0={"claude-code":"CLAUDE.md",codex:"AGENTS.md",openclaw:"SOUL.md"};async function Je(r,e,o,a){await V0(r,{recursive:!0});let c=$0[e],u=Z0(r,c),l=Q0(e,o,a);return await Y0(u,l,"utf8"),u}function Q0(r,e,o){let a=`# Coze Agent: ${e}
79
+ `},configPath(r){return Tf(r.homeDir,".coze","bridge","task.xml")},async install(r){let e=`"${r.nodeBin}" "${r.entry}" --daemon`;await zo("schtasks",["/Create","/SC","ONLOGON","/TN",jn,"/TR",e,"/RU",r.userName,"/F"]),jr.info("task scheduler entry created",{task:jn})},async uninstall(r){await zo("schtasks",["/Delete","/TN",jn,"/F"]).catch(e=>jr.warn("schtasks /Delete failed (ignored)",{err:String(e)})),jr.info("task scheduler entry removed",{task:jn})}}});var Jr={};ws(Jr,{buildContext:()=>Bf,getSupervisor:()=>Of,launchdSupervisor:()=>Hr,systemdSupervisor:()=>Wr,taskSchedulerSupervisor:()=>Gr});import{homedir as Lf,userInfo as Nf}from"node:os";function Of(r=process.platform){switch(r){case"darwin":return Hr;case"linux":return Wr;case"win32":return Gr;default:throw new Error(`unsupported platform for OS supervisor: ${r}`)}}function Bf(){let r=H();return{nodeBin:process.execPath,entry:zr(r),logFile:r.logFile,homeDir:Lf(),userName:Nf().username}}var Vr=Pe(()=>{"use strict";ce();qr();Ro();Mo();qo()});Ue();U();import{readdir as ea}from"node:fs/promises";import{mkdir as Y0,writeFile as X0}from"node:fs/promises";import{join as $0}from"node:path";var Z0={"claude-code":"CLAUDE.md",codex:"AGENTS.md",openclaw:"SOUL.md"};async function Ve(r,e,i,a){await Y0(r,{recursive:!0});let x=Z0[e],f=$0(r,x),u=Q0(e,i,a);return await X0(f,u,"utf8"),f}function Q0(r,e,i){let a=`# Coze Agent: ${e}
80
80
 
81
81
  > framework: \`${r}\`
82
82
 
83
- `,c=o?.trim()?o.endsWith(`
84
- `)?o:`${o}
83
+ `,x=i?.trim()?i.endsWith(`
84
+ `)?i:`${i}
85
85
  `:`_No instructions provided._
86
86
  `;return`${a}---
87
87
 
88
- ${c}`}var ve=M("agent-detail-sync"),Xt=class{constructor(e){this.opts=e}opts;async syncAll(e){let o=this.opts.paths.agentsRoot,a;try{a=await ea(o)}catch(c){ve.info("agents dir not found, skip detail sync",{root:o,err:String(c)});return}ve.info("starting detail sync",{reason:e,count:a.length});for(let c of a)try{await this.syncOne(c)}catch(u){ve.warn("detail sync failed for agent, skipping",{agentId:c,err:String(u)})}ve.info("detail sync done",{reason:e})}async syncOne(e){let o=await xe(e,this.opts.paths);if(!o){ve.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(l){ve.warn("detail RPC failed, using local data",{agentId:e,err:String(l)});return}if(a.agentId&&a.agentId!==e){ve.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:a.agentId});return}let c=!1,u=!1;if(a.agentName&&a.agentName!==o.agentName&&(o.agentName=a.agentName,c=!0),a.description!==void 0&&a.description!==o.description&&(o.description=a.description,c=!0),a.cozeIdentity&&a.cozeIdentity!==o.cozeIdentity&&(o.cozeIdentity=a.cozeIdentity,c=!0,u=!0),a.deployType&&ve.info("detail.deployType",{agentId:e,deployType:a.deployType}),!c){ve.debug("detail sync: no diff",{agentId:e});return}await he(o,this.opts.paths),ve.info("detail sync: config updated",{agentId:e,identityChanged:u,agentName:o.agentName}),u&&(await Je(o.workspace,o.framework,e,o.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};at();import{spawn as ta}from"node:child_process";import{mkdir as na,readFile as Ns,readdir as ra,rm as sa,stat as Yt,writeFile as ia}from"node:fs/promises";import{join as Ne,normalize as oa,relative as Rs,resolve as aa,sep as Ms}from"node:path";var Ss="https://llm-gateway.coze.cn",Vt="auto";function ar(r){return{model:r.model??Vt,...r.modelToken?{modelToken:r.modelToken}:{}}}function Cs(r){return!r||r===Vt}function Es(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=Ss,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),Cs(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function As(r){let e=[];return Cs(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_provider="openai"'),e.push("-c",`model_provider_overrides.openai.base_url="${Ss}/v1"`)),e}function Ds(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}function Ls(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Ps(r){let{_meta:e,...o}=r;return{stripped:o,meta:e}}function xt(r){if(!r?.cozeAgentId)throw new Error("missing _meta.cozeAgentId");return r.cozeAgentId}var A=class extends Error{code;retriable;cause;constructor(e,o,a){super(o),this.name="BridgeError",this.code=e,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};F();ue();function Xe(r,e){if(Ls(r)!=="cloud")throw new A("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var $=M("agent-handlers"),ks=5*1024*1024,xa=1,ca=6,ua=new Set(["node_modules",".git",".coze","dist","build",".next"]),fa=3e4,Zt=class{constructor(e){this.opts=e}opts;async listSkills(e){Xe(e._meta,"_agent/listSkills");let o=xt(e._meta),a=await this.loadAgentCfg(o),c=a?.workspace??Ie(o).workspace,u=a?.skills??[],l=[];for(let p of u){let m=Ne(c,p.relPath,"SKILL.md");await Yt(m).then(w=>w.isFile()).catch(()=>!1)&&l.push({skillId:p.skillId,skillName:p.skillName,downloadUrl:p.downloadUrl??"",...p.description?{description:p.description}:{},...p.version?{version:p.version}:{}})}return{skills:l}}async addSkills(e){Xe(e._meta,"_agent/addSkills");let o=xt(e._meta),a=await this.requireAgentCfg(o),c=e.skills??[],u=[...a.skills??[]],l=new Map(u.map((m,b)=>[m.skillId,b])),p=[];for(let m of c){if(!m.skillName)throw new A("IPC_BAD_REQUEST","skill missing skillName");let b=da(m.skillName),w=la(a.framework),y=Ne(w,b),E=Ne(a.workspace,y);await na(E,{recursive:!0});let T=await ga(m.downloadUrl);ma(T)?await _a(T,E):await ia(Ne(E,"SKILL.md"),T.toString("utf8"),"utf8");let k={skillId:m.skillId,skillName:m.skillName,relPath:y,installedAt:Date.now(),...m.description?{description:m.description}:{},...m.version?{version:m.version}:{},...m.downloadUrl?{downloadUrl:m.downloadUrl}:{}},N=l.get(m.skillId);N!==void 0?u[N]=k:(l.set(m.skillId,u.length),u.push(k)),p.push(m),$.info("skill installed",{agentId:o,skillId:m.skillId,skillName:m.skillName,relPath:y})}return await Jt(o,u),await this.reloadAgentSessions(o,"skills-added"),{installedSkills:p}}async removeSkills(e){Xe(e._meta,"_agent/removeSkills");let o=xt(e._meta),a=await this.requireAgentCfg(o),c=new Set(e.skillIds??[]),u=a.skills??[],l=[];for(let p of u){if(!c.has(p.skillId)){l.push(p);continue}let m=Ne(a.workspace,p.relPath);await sa(m,{recursive:!0,force:!0}),$.info("skill removed",{agentId:o,skillId:p.skillId,relPath:p.relPath})}return await Jt(o,l),await this.reloadAgentSessions(o,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,o){return this.reloadAgentSessions(e,o)}async reloadAgentSessions(e,o){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex")for(let[c,u]of a.sessions)try{await a.downstream.sessionLoad({sessionId:u,cwd:a.workspace}),$.info("session reloaded",{reason:o,agentId:e,framework:a.framework,cloudId:c,acpId:u})}catch(l){$.warn("session reload failed",{reason:o,agentId:e,framework:a.framework,cloudId:c,acpId:u,err:String(l)})}}async updateAgent(e){if(!e.cozeIdentity?.trim())return $.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let o=e.agentId,a=await xe(o);if(!a)throw new A("AGENT_NOT_FOUND",`agent not found: ${o}`);return a.cozeIdentity===e.cozeIdentity?($.info("_agent/update: cozeIdentity unchanged, noop",{agentId:o}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await he(a),await Je(a.workspace,a.framework,o,e.cozeIdentity),$.info("_agent/update: cozeIdentity rewritten",{agentId:o,framework:a.framework}),await this.reloadAgentSessions(o,"identity-changed"),{ok:!0})}async disconnectAgent(e){let o=e.agentId;if(!o)throw new A("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await xe(o);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await he(a),$.info("agent disconnected",{agentId:o,reason:e.reason??"",force:e.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(o,e.reason??"disconnect"),{ok:!0}):($.warn("_agent/disconnect: agent not found, ignoring",{agentId:o}),{ok:!0})}async switchModel(e){if(Xe(e._meta,"_agent/switchModel"),!e.agentId)throw new A("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let o=e.model&&e.model.trim()?e.model:Vt,a=e.modelToken?.trim()||void 0,c=await xe(e.agentId);if(!c)throw new A("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);c.model=o,a!==void 0?c.modelToken=a:delete c.modelToken,await he(c),$.info("_agent/switchModel: model/modelToken persisted",{agentId:e.agentId,model:o,hasToken:!!a,reason:e.reason??"",force:e.force??!1});let u=this.opts.agents.get(e.agentId);if(!u)return $.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(u.status==="switching")return $.info("_agent/switchModel: already switching, params updated via config",{agentId:e.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new A("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");u.status="switching";let l=u.msgQueue.enqueue(async()=>{}),p=setTimeout(()=>{$.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),u.downstream.stop("switchModel idle timeout").catch(m=>$.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(m)}))},fa);try{return await l.catch(m=>$.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(m)})),clearTimeout(p),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(m){clearTimeout(p),$.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(m)});let b=await xe(e.agentId).catch(()=>null);throw b&&(b.disconnectedAt=Date.now(),b.disconnectReason=`model switch failed: ${m instanceof Error?m.message:String(m)}`,await he(b).catch(w=>$.warn("write disconnect marker failed (ignored)",{err:String(w)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${m instanceof Error?m.message:String(m)}`).catch(w=>$.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(w)})):u.status="disconnected",m instanceof A&&(m.code==="MODEL_SWITCH_FAILED"||m.code==="AGENT_NOT_FOUND")?m:new A("MODEL_SWITCH_FAILED",m instanceof Error?m.message:String(m),{cause:m})}}async getFileTree(e){Xe(e._meta,"_agent/getFileTree");let o=e._meta,a=xt(o),c=this.resolveWorkspace(a),u=e.filePath??"",l=this.safeJoin(c,u),p=await Yt(l).catch(()=>null);if(!p)throw new A("IPC_BAD_REQUEST",`path not found: ${u}`);let m=wa(e.depth);return p.isDirectory()?{tree:await Os(c,l,u,m)}:{tree:[{name:ba(u),path:Bs(u||"."),isDir:!1,size:p.size,modifiedAt:Math.floor(p.mtimeMs)}]}}async getFileContent(e){Xe(e._meta,"_agent/getFileContent");let o=xt(e._meta),a=this.resolveWorkspace(o);if(!e.filePath)throw new A("IPC_BAD_REQUEST","filePath required");let c=this.safeJoin(a,e.filePath),u=await Yt(c).catch(()=>null);if(!u||!u.isFile())throw new A("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(u.size>ks)throw new A("IPC_BAD_REQUEST",`file too large: ${u.size} bytes (max ${ks})`);let l=await Ns(c);return l.includes(0)?{content:l.toString("base64"),encoding:"base64",size:u.size}:{content:l.toString("utf8"),encoding:"utf-8",size:u.size}}resolveWorkspace(e){let o=this.opts.agents.get(e);return o?o.workspace:Ie(e).workspace}safeJoin(e,o){let a=aa(e,o||"."),c=Rs(e,a);if(c.startsWith("..")||c===".."||c.startsWith(`..${Ms}`))throw new A("IPC_BAD_REQUEST",`path escapes workspace: ${o}`);return a}loadAgentCfg(e){return xe(e)}async requireAgentCfg(e){let o=await this.loadAgentCfg(e);if(!o)throw new A("AGENT_NOT_FOUND",`no config for agent: ${e}`);return o}};function da(r){let e=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new A("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function la(r){return r==="claude-code"?Ne(".claude","skills"):Ne(".agents","skills")}var ha=3e4,Ts=50*1024*1024,Is=3e4;async function ga(r){if(!r)throw new A("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return pa(r);if(r.startsWith("file:")){let e=new URL(r).pathname,o=await Ns(e);if(o.length>Ts)throw new A("IPC_BAD_REQUEST",`skill too large: ${o.length} bytes`);return o}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,o=setTimeout(()=>e.abort(),ha);try{let a=await fetch(r,{signal:e.signal});if(!a.ok)throw new A("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let c=await a.arrayBuffer();if(c.byteLength>Ts)throw new A("IPC_BAD_REQUEST",`skill too large: ${c.byteLength} bytes`);return Buffer.from(c)}finally{clearTimeout(o)}}throw new A("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function pa(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new A("IPC_BAD_REQUEST","bad data URL");let o=!!e[2],a=e[3]??"";return o?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function ma(r){return r.length>=2&&r[0]===31&&r[1]===139}async function _a(r,e){await new Promise((o,a)=>{let c=ta("tar",["-xzf","-","-C",e,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),u="";c.stderr?.on("data",p=>{u+=String(p)});let l=setTimeout(()=>{c.kill("SIGKILL"),a(new A("IPC_BAD_REQUEST",`tar extract timeout (${Is}ms)`))},Is);c.on("error",p=>{clearTimeout(l),a(new A("IPC_BAD_REQUEST",`tar spawn failed: ${p.message}`,{cause:p}))}),c.on("exit",p=>{clearTimeout(l),p===0?o():a(new A("IPC_BAD_REQUEST",`tar exit ${p}${u?`: ${u.trim().slice(0,200)}`:""}`))}),c.stdin?.end(r)})}async function Os(r,e,o,a){if(a<=0)return[];let c;try{c=await ra(e,{withFileTypes:!0})}catch{return[]}let u=[];for(let l of c){if(ua.has(l.name))continue;let p=Ne(e,l.name),m=oa(Ne(o,l.name)),b=null;try{b=await Yt(p)}catch{continue}let w={name:l.name,path:Bs(Rs(r,p)),isDir:b.isDirectory(),size:b.size,modifiedAt:Math.floor(b.mtimeMs)};b.isDirectory()&&a>1&&(w.children=await Os(r,p,m,a-1)),u.push(w)}return u.sort((l,p)=>l.isDir!==p.isDir?l.isDir?-1:1:l.name.localeCompare(p.name)),u}function wa(r){return!r||r<=0?xa:Math.min(r,ca)}function ba(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function Bs(r){return r.split(Ms).join("/")}F();var Et=M("agent-health-reporter"),ya=3e4,$t=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??ya}opts;timer=null;inFlight=!1;intervalMs;start(){this.timer||(this.timer=setInterval(()=>{this.tick()},this.intervalMs),this.timer.unref?.(),Et.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,Et.info("heartbeat stopped"))}async tick(){if(this.inFlight){Et.debug("previous tick still in-flight, skip");return}let e=this.opts.getDeviceId();if(!e){Et.debug("deviceId not available, skip tick (\u5C1A\u672A pair)");return}this.inFlight=!0;try{let o=[...this.opts.core.agents.values()];for(let a of o){let c=va(a);if(!c)continue;let u={status:c,_meta:{cozeAgentId:a.agentId,cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",u)}catch(l){Et.warn("heartbeat send failed",{agentId:a.agentId,status:c,err:String(l)})}}}finally{this.inFlight=!1}}};function va(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}at();import{mkdir as xr,rm as Ia}from"node:fs/promises";import{spawn as Da}from"node:child_process";function ct(r,e,o){return o===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:o}}function zs(r,e){return e===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:e}}function ut(r,e){return{jsonrpc:"2.0",id:r,result:e}}function Ve(r,e){return{jsonrpc:"2.0",id:r,error:e}}var Qt=class extends Error{code;data;constructor(e){super(`JSON-RPC error code=${e.code} ${e.message}`),this.name="RemoteRpcError",this.code=e.code,e.data!==void 0&&(this.data=e.data)}},K={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,AGENT_NOT_FOUND:-32001,AGENT_BUSY:-32002,AGENT_TIMEOUT:-32003,AGENT_SPAWN_FAILED:-32004,OPERATION_NOT_ALLOWED_FOR_LOCAL:-32005,AGENT_DISCONNECTED:-32006,MODEL_SWITCHING:-32007,MODEL_SWITCH_FAILED:-32008};function en(r){return"method"in r&&"id"in r&&r.id!==void 0}function qs(r){return"method"in r&&!("id"in r)}function tn(r){return!("method"in r)&&"id"in r}var Sa={AGENT_NOT_FOUND:K.AGENT_NOT_FOUND,AGENT_BUSY:K.AGENT_BUSY,AGENT_DISCONNECTED:K.AGENT_DISCONNECTED,AGENT_TIMEOUT:K.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:K.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:K.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:K.INTERNAL_ERROR,BRIDGE_INTERNAL:K.INTERNAL_ERROR,IPC_AUTH_FAILED:K.INTERNAL_ERROR,IPC_BAD_REQUEST:K.INVALID_REQUEST,MODEL_SWITCHING:K.MODEL_SWITCHING,MODEL_SWITCH_FAILED:K.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:K.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:K.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:K.INTERNAL_ERROR};function nn(r){return r instanceof A?{code:Sa[r.code]??K.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:K.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function Us(r){let e=r.data,o=e?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new A(o,r.message,{retriable:e?.retriable??!1,cause:r.data})}function Fs(r){return`${JSON.stringify(r)}
89
- `}var rn=class{buffer="";onError;constructor(e={}){this.onError=e.onError}push(e){this.buffer+=typeof e=="string"?e:e.toString("utf8");let o=this.buffer.split(`
90
- `);this.buffer=o.pop()??"";let a=[];for(let c of o){let u=c.replace(/\r$/,"").trim();if(u)try{a.push(JSON.parse(u))}catch(l){this.onError?.({line:u,error:l})}}return a}flush(){if(!this.buffer)return[];let e=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!e)return[];try{return[JSON.parse(e)]}catch(o){return this.onError?.({line:e,error:o}),[]}}};var Hs={"session/prompt":"session.prompt","session/cancel":"session.cancel","session/new":"session.new","session/load":"session.load","_agent/create":"agent.create","_agent/health":"agent.health","_agent/pair":"agent.pair","_agent/listSkills":"agent.listSkills","_agent/addSkills":"agent.addSkills","_agent/removeSkills":"agent.removeSkills","_agent/getFileTree":"agent.getFileTree","_agent/getFileContent":"agent.getFileContent","_agent/detail":"agent.detail","_agent/update":"agent.update","_agent/disconnect":"agent.disconnect","_agent/switchModel":"agent.switchModel",initialize:"initialize"},Bf=Object.fromEntries(Object.entries(Hs).map(([r,e])=>[e,r])),Ca={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":["agentId"],"agent.listSkills":["agentId"],"agent.addSkills":["agentId"],"agent.removeSkills":["agentId"],"agent.getFileTree":["agentId"],"agent.getFileContent":["agentId"],"agent.detail":["agentId"],"agent.update":["agentId"],"agent.disconnect":["agentId"],"agent.switchModel":["agentId"],"agent.pair":[],initialize:[]},ft=class{seq=0;next(e,o){this.seq+=1;let a=Hs[e]??Ea(e),c=Ca[a]??[],u=[a,String(this.seq)];if(c.length>0){let l=c.map(m=>Ks(o?.[m]??"")),p=Aa(l).join(":");p&&u.push(p)}else o&&Object.values(o).some(l=>l)&&u.push(Object.values(o).filter(Boolean).map(l=>Ks(String(l))).join(":"));return u.join("_")}reset(){this.seq=0}};function Ea(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Ks(r){return r.replace(/[:_\s]+/g,"-")}function Aa(r){let e=r.length;for(;e>0&&!r[e-1];)e-=1;return r.slice(0,e)}F();var La=3e4;function Ws(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var Ke=class{constructor(e){this.opts=e;this.log=M(`downstream.${this.constructor.name}`),this.decoder=new rn({onError:o=>this.log.warn("decode line failed",{line:o.line})})}opts;child;decoder;pending=new Map;idAllocator=new ft;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(e){return e}async start(){if(this.child)throw new A("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",o=Da(this.opts.command,this.opts.args,{cwd:this.opts.cwd,env:{...this.sanitizeEnv(process.env),...this.opts.env},stdio:["pipe","pipe","pipe"],detached:e});this.child=o,o.stdout?.setEncoding("utf8"),o.stdout?.on("data",a=>{for(let c of this.decoder.push(a))this.dispatch(c)}),o.stderr?.setEncoding("utf8"),o.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),o.on("exit",(a,c)=>{this.stopped=!0,this.failAllPending(new A("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${c})`));for(let u of this.exitHandlers)u(a,c)}),o.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new A("AGENT_SPAWN_FAILED",String(a),{cause:a}))}),this.log.info("downstream started",{command:this.opts.command,pid:o.pid,cwd:this.opts.cwd})}async stop(e){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:e});let o=this.child,a=new Promise(u=>o.once("exit",()=>u()));Ws(o.pid,"SIGTERM");let c=setTimeout(()=>{o.killed||Ws(o.pid,"SIGKILL")},5e3);try{await a}finally{clearTimeout(c)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(e){return this.call("initialize",e)}sessionNew(e){return this.call("session/new",{mcpServers:[],...e})}sessionLoad(e){return this.call("session/load",{mcpServers:[],...e})}sessionPrompt(e){return this.call("session/prompt",e,0)}async sessionCancel(e){if(!this.child||this.stopped)return;let o=this.idAllocator.next("session/cancel");this.writeFrame(ct(o,"session/cancel",e))}onUpdate(e){this.updateHandlers.push(e)}onAgentRequest(e){this.agentRequestHandlers.push(e)}respondAgentRequest(e,o){if(!(!this.child||this.stopped))try{this.writeFrame(ut(e,o))}catch(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,o){if(!(!this.child||this.stopped))try{this.writeFrame(Ve(e,o))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,o,a=La){if(!this.child||this.stopped)return Promise.reject(new A("AGENT_PROTOCOL_ERROR","downstream not started"));let c=this.idAllocator.next(e),u=ct(c,e,o),l=a>0&&Number.isFinite(a);return new Promise((p,m)=>{let b=l?setTimeout(()=>{this.pending.delete(c),m(new A("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(c,{resolve:p,reject:m,timer:b,method:e});try{this.writeFrame(u)}catch(w){b&&clearTimeout(b),this.pending.delete(c),m(w)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new A("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(Fs(e))}dispatch(e){if(tn(e)){let o=e.id!==null?this.pending.get(e.id):void 0;if(!o){this.log.warn("orphan response",{id:e.id});return}this.pending.delete(e.id),o.timer&&clearTimeout(o.timer),e.error?o.reject(Us(e.error)):o.resolve(e.result);return}if(qs(e)){if(e.method==="session/update")for(let o of this.updateHandlers)Promise.resolve(o(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if(en(e)){let o=e;this.handleAgentRequest(o).catch(a=>this.log.error("agent request handler failed",{method:o.method,err:String(a)}))}}async handleAgentRequest(e){if(this.agentRequestHandlers.length===0){this.writeFrame(Ve(e.id,{code:-32601,message:`method not handled by Bridge: ${e.method}`}));return}for(let o of this.agentRequestHandlers)try{await o(e)}catch(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Ve(e.id,nn(a)))}catch{}}}failAllPending(e){for(let o of this.pending.values())o.timer&&clearTimeout(o.timer),o.reject(e);this.pending.clear()}};var Pa="@zed-industries/claude-code-acp@latest";function ka(r){let e={};for(let[o,a]of Object.entries(r))a!==void 0&&(o.startsWith("CLAUDE")||o==="AI_AGENT"||o==="BAGGAGE"||(e[o]=a));return e}var sn=class extends Ke{framework="claude-code";constructor(e){let o=e.command??"npx",a=e.args??["-y",Pa],c={command:o,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(c)}sanitizeEnv(e){return ka(e)}};var Ta="@zed-industries/codex-acp@latest",on=class extends Ke{framework="codex";constructor(e){let o=e.command??"npx",a=e.args??["-y",Ta],c=e.extraArgs?[...a,...e.extraArgs]:a,u={command:o,args:c,cwd:e.cwd,...e.env?{env:e.env}:{}};super(u)}};import{spawn as js}from"node:child_process";F();var an=class extends Ke{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(e){let o=e.profile??"coze",a=e.sessionName??"default",c=["--profile",o,"acp","--session",`agent:${e.agentId}:${a}`],u={command:e.command,args:c,cwd:e.cwd,...e.env?{env:e.env}:{}};super(u),this.profile=o,this.agentId=e.agentId,this.sessionName=a,this.registerLog=M("downstream.openclaw.register")}async start(){await this.registerAgent().catch(e=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(e)})}),await super.start()}registerAgent(){return new Promise((e,o)=>{let a=js(this.opts.command,["--profile",this.profile,"agents","add",this.agentId,"--workspace",this.opts.cwd,"--non-interactive"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),c="";a.stderr?.on("data",u=>{c+=u.toString("utf8")}),a.on("error",o),a.on("close",u=>{u===0?(this.registered=!0,this.registerLog.info("agent registered",{agentId:this.agentId,profile:this.profile}),e()):o(new A("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${u}: ${c.trim()}`))})})}async cleanup(e){this.registered&&await new Promise(o=>{let a=js(this.opts.command,["--profile",this.profile,"agents","delete",this.agentId,"--force"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),c="";a.stderr?.on("data",u=>{c+=u.toString("utf8")}),a.on("error",u=>{this.registerLog.warn("openclaw agents delete failed (best-effort)",{agentId:this.agentId,err:String(u)}),o()}),a.on("close",u=>{u===0?this.registerLog.info("agent unregistered",{agentId:this.agentId}):this.registerLog.warn("openclaw agents delete non-zero exit",{agentId:this.agentId,code:u,stderr:c.trim()}),this.registered=!1,o()})})}get acpSessionName(){return this.sessionName}};F();ue();var xn=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(e){return this.disposed?Promise.reject(new Error("AsyncQueue disposed")):this.closed?Promise.reject(new Error("AsyncQueue closed")):new Promise((o,a)=>{this.slots.push({task:e,resolve:o,reject:a}),this.drain()})}close(){this.closed=!0}dispose(e=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(e)}get size(){return this.slots.length}get isRunning(){return this.running}async drain(){if(!this.running){this.running=!0;try{for(;this.slots.length>0&&!this.disposed;){let e=this.slots.shift();if(!e)break;try{let o=await e.task();e.resolve(o)}catch(o){e.reject(o)}}}finally{this.running=!1}}}};var cn=class{agentId;framework;workspace;msgQueue;sessions=new Map;verifiedSessions=new Set;activeTriggers=new Map;status="starting";lastActiveAt=Date.now();_downstream;constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this._downstream=e.downstream,this.msgQueue=new xn}get downstream(){return this._downstream}swap(e){this._downstream=e,this.verifiedSessions.clear(),this.activeTriggers.clear()}async dispose(e){this.status="stopped",this.msgQueue.dispose(new Error(`AgentSession disposed${e?`: ${e}`:""}`)),await this._downstream.stop(e)}};var j=M("agent-manager"),Na=(r,e,o,a,c)=>{switch(r){case"claude-code":{let u=c?Es(c):void 0;return new sn({cwd:o,...u&&Object.keys(u).length>0?{env:u}:{}})}case"codex":{let u=c?As(c):[],l=c?Ds(c):void 0;return new on({cwd:o,...u.length>0?{extraArgs:u}:{},...l&&Object.keys(l).length>0?{env:l}:{}})}case"openclaw":return new an({command:e,cwd:o,agentId:a})}},Ra=[0,5e3,5e3],Ma=2e4,Gs={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},un=class{paths;config;registry;factory;restartDelaysMs;createTimeoutMs;healthReporter;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??Na,this.restartDelaysMs=e.restartDelaysMs??Ra,this.createTimeoutMs=e.createTimeoutMs??Ma,this.healthReporter=e.healthReporter}async createAgent(e){if(!e.agentId)throw new A("IPC_BAD_REQUEST","agentId required");if(!e.framework)throw new A("IPC_BAD_REQUEST","framework required");this.registry.reviveIfDisconnected?.(e.agentId);let o=this.registry.get(e.agentId);if(o){if(o.framework!==e.framework)throw new A("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${o.framework})`);if(o.status==="error")j.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await o.dispose("rebuild after error").catch(m=>j.warn("dispose stale agent failed (ignored)",{err:String(m)})),this.registry.unregister(e.agentId);else return j.info("agent already exists,return current",{agentId:e.agentId}),{ok:!0,agentId:o.agentId,workspace:o.workspace,pid:o.downstream.pid()??0,framework:o.framework}}let a=this.config.frameworksCache?.[e.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let c=Ie(e.agentId,this.paths),u=e.workspace??c.workspace,l=new AbortController,p=setTimeout(()=>l.abort(new A("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(e,c,u,a,l.signal)}finally{clearTimeout(p)}}async createAgentInner(e,o,a,c,u){let l=()=>{if(u.aborted)throw u.reason instanceof Error?u.reason:new A("AGENT_TIMEOUT","_agent/create aborted")},p,m,b=!1;try{await xr(o.root,{recursive:!0}),await xr(a,{recursive:!0}),await xr(o.logs,{recursive:!0}),l(),e.framework!=="openclaw"&&await Je(a,e.framework,e.agentId,e.cozeIdentity),l();let w=await xe(e.agentId,this.paths).catch(()=>null),y=ar({model:e.model??w?.model,modelToken:e.modelToken??w?.modelToken});if(p=this.factory(e.framework,c.path,a,e.agentId,y),await p.start(),l(),await p.initialize(Gs),l(),e.framework==="openclaw"&&await Je(a,"openclaw",e.agentId,e.cozeIdentity),m=new cn({agentId:e.agentId,framework:e.framework,workspace:a,downstream:p}),m.status="ok",w?.sessions){for(let[k,N]of Object.entries(w.sessions))m.sessions.set(k,N);Object.keys(w.sessions).length>0&&j.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(w.sessions).length})}this.registry.register(m),b=!0;let E={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:w?.createdAt??Date.now(),sessions:w?.sessions??{},model:y.model};y.modelToken&&(E.modelToken=y.modelToken),w?.skills&&(E.skills=w.skills),w?.agentName&&(E.agentName=w.agentName),w?.description&&(E.description=w.description),await he(E,this.paths);let T=p.pid()??0;return j.info("agent created",{agentId:e.agentId,framework:e.framework,pid:T}),this.installRestartHook(m),{ok:!0,agentId:e.agentId,workspace:a,pid:T,framework:e.framework}}catch(w){throw j.error("agent create failed,rolling back",{agentId:e.agentId,err:String(w)}),p?.cleanup&&await p.cleanup("rollback").catch(y=>j.warn("downstream cleanup failed (ignored)",{err:String(y)})),p&&await p.stop("rollback").catch(()=>{}),b&&m&&(await m.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Ia(o.root,{recursive:!0,force:!0}).catch(y=>j.warn("rm agent dir failed (ignored)",{err:String(y)})),w instanceof A?w:new A("AGENT_SPAWN_FAILED",String(w),{cause:w})}}async reportHealth(e,o,a){if(!this.healthReporter){j.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:o});return}try{await this.healthReporter({status:o,_meta:{cozeAgentId:e.agentId}}),j.info("_agent/health reported",{agentId:e.agentId,status:o,cause:a})}catch(c){j.warn("_agent/health upstream failed (ignored)",{agentId:e.agentId,status:o,err:String(c)})}}installRestartHook(e){let o=0,a=c=>{if(e.status==="stopped"||e.status==="disconnected"||e.status==="switching")return;if(o>=this.restartDelaysMs.length){j.error("agent restart exhausted",{agentId:e.agentId,attempts:o,...c}),e.status="error",this.reportHealth(e,"error",c);return}let u=this.restartDelaysMs[o]??5e3;o+=1,e.status="degraded",j.warn("agent restart scheduled",{agentId:e.agentId,attempt:o,delayMs:u,...c}),setTimeout(()=>{this.doRestart(e,o).then(l=>{l?(o=0,e.status="ok"):a(null)})},u)};e.downstream.onExit((c,u)=>a({code:c,signal:u}))}async spawnAndInitialize(e,o){let a=await xe(e.agentId,this.paths).catch(()=>null),c=a?ar(a):void 0,u=this.factory(e.framework,o,e.workspace,e.agentId,c);try{return await u.start(),await u.initialize(Gs),u}catch(l){throw await u.stop("spawnAndInitialize failed").catch(()=>{}),l}}rewireSession(e,o){e.swap(o),this.registry.attachHooks?.(e),this.installRestartHook(e)}async doRestart(e,o){let a=this.config.frameworksCache?.[e.framework];if(!a)return j.error("framework cache missing during restart",{agentId:e.agentId,framework:e.framework}),e.status="error",!1;j.info("agent restart attempt",{agentId:e.agentId,attempt:o});try{let c=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,c),j.info("agent restart succeeded",{agentId:e.agentId,attempt:o}),!0}catch(c){return j.warn("agent restart attempt failed",{agentId:e.agentId,attempt:o,err:String(c)}),!1}}async executeModelSwitch(e){let o=this.registry.get(e);if(!o)throw new A("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=this.config.frameworksCache?.[o.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${o.framework} not detected; cannot respawn for switchModel`);j.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:o.framework}),await o.downstream.stop("switchModel").catch(l=>{j.warn("stop old downstream failed (ignored, continuing)",{agentId:e,err:String(l)})});let c;try{c=await this.spawnAndInitialize(o,a.path)}catch(l){throw new A("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${l instanceof Error?l.message:String(l)}`,{cause:l})}this.rewireSession(o,c);let u=[...o.sessions.entries()];for(let[l,p]of u)try{await c.sessionLoad({sessionId:p,cwd:o.workspace}),o.verifiedSessions.add(p)}catch(m){throw new A("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${l} (acp=${p}): ${m instanceof Error?m.message:String(m)}`,{cause:m})}u.length>0&&j.info("executeModelSwitch: session/load reloaded",{agentId:e,count:u.length}),o.status="ok",j.info("executeModelSwitch: success",{agentId:e,framework:o.framework})}};F();import{spawn as Oa}from"node:child_process";import{constants as Js,access as Ba}from"node:fs/promises";import{delimiter as za,join as qa}from"node:path";var Ua=M("framework-detector"),Xs={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Fa=[".exe",".cmd",".bat",".ps1"],At=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Oa,access:e.access??Ba}}async detect(e){let o=Xs[e],a=await this.which(o);if(!a)return Ua.debug("framework binary not found",{framework:e,bin:o}),null;let c=await this.probeVersion(a);return{path:a,version:c}}async detectAll(){let e=await Promise.all(Object.keys(Xs).map(async a=>[a,await this.detect(a)])),o={};for(let[a,c]of e)c&&(o[a]=c);return o}async which(e){let o=this.env.pathEnv.split(za).filter(Boolean),a=this.env.platform==="win32"?["",...Fa]:[""];for(let c of o)for(let u of a){let l=qa(c,e+u);if(await this.isExecutable(l))return l}return null}async isExecutable(e){try{let o=this.env.platform==="win32"?Js.F_OK:Js.X_OK;return await this.env.access(e,o),!0}catch{return!1}}async probeVersion(e){return new Promise(o=>{let a="",c=!1,u,l=p=>{c||(c=!0,u&&clearTimeout(u),o(p.trim()||"unknown"))};try{let p=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});u=setTimeout(()=>{p.kill("SIGKILL"),l("unknown")},5e3),p.stdout?.on("data",m=>{a+=m.toString("utf8")}),p.on("error",()=>l("unknown")),p.on("close",()=>{let m=Ha(a).split(/\r?\n/)[0]??"";l(m)})}catch{l("unknown")}})}},Ka=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function Ha(r){return r.replace(Ka,"")}ir();ue();function fn(r){return Wt(r??W().configFile)}function Dt(r,e){return jt(e??W().configFile,r)}at();F();var te=M("core"),Wa=5*6e4,ja=3e4,dn=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new ft;pendingUpstream=new Map;pendingBridge=new Map;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths}registerExtension(e,o){this.extensions[e]=o}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),te.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){te.info("Core stopping",{reason:e}),await Promise.all([...this.agents.values()].map(o=>o.dispose(e))),this.agents.clear(),await this.upstream.stop(e)}get(e){return this.agents.get(e)}register(e){this.agents.set(e.agentId,e),this.attachDownstreamHooks(e),te.info("agent registered",{agentId:e.agentId,framework:e.framework})}unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&te.info("agent revived from disconnect",{agentId:e})}attachDownstreamHooks(e){e.downstream.onUpdate(o=>{this.forwardUpdate(e,o)}),e.downstream.onAgentRequest(o=>{this.handleAgentRequest(e,o)}),e.downstream.onExit((o,a)=>{te.warn("agent downstream exited",{agentId:e.agentId,code:o,signal:a})})}attachHooks(e){this.attachDownstreamHooks(e)}async handleFrame(e){if(tn(e)){this.handleUpstreamResponse(e);return}if(en(e))try{if(e.method.startsWith("_agent/")){let o=this.extensions[e.method];if(!o){await this.sendError(e.id,K.METHOD_NOT_FOUND,`extension not registered: ${e.method}`);return}let a=await o(e,this);await this.upstream.send(ut(e.id,a));return}if(e.method.startsWith("session/")){let o=await this.routeSessionMethod(e);await this.upstream.send(ut(e.id,o));return}if(e.method==="initialize"){await this.upstream.send(ut(e.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(e.id,K.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(o){te.error("handleFrame failed",{method:e.method,err:String(o)}),await this.upstream.send(Ve(e.id,nn(o)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new A("IPC_BAD_REQUEST",`${e.method} requires params`);let o=e.params,a=o._meta?.cozeAgentId;if(!a)throw new A("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let c=this.agents.get(a);if(!c)throw this.disconnectedAgents.has(a)?new A("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new A("AGENT_NOT_FOUND",`agent not found: ${a}`);if(c.status==="switching")throw new A("MODEL_SWITCHING",`agent ${a} is switching model; retry later`,{retriable:!0});let u=Date.now(),l=!1;try{let p=await c.msgQueue.enqueue(()=>this.dispatchSessionCall(c,e.method,o));return l=!0,p}finally{te.info("session call done",{agentId:c.agentId,method:e.method,durationMs:Date.now()-u,ok:l})}}async dispatchSessionCall(e,o,a){e.lastActiveAt=Date.now();let{stripped:c}=Ps(a);switch(o){case"session/new":{let u=c;return await e.downstream.sessionNew({...u,cwd:u.cwd||e.workspace})}case"session/load":{let u=c,l=u.sessionId,p=e.sessions.get(l);try{let m=p??l,b=await e.downstream.sessionLoad({...u,sessionId:m,cwd:u.cwd||e.workspace});return p||e.sessions.set(l,m),b}catch(m){te.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:l,err:String(m)});let b=await e.downstream.sessionNew({cwd:u.cwd||e.workspace});return e.sessions.set(l,b.sessionId),{}}}case"session/prompt":{let u=c,l=u.sessionId,p=e.sessions.get(l),m=!1;if(p&&!e.verifiedSessions.has(p))try{await e.downstream.sessionLoad({sessionId:p,cwd:e.workspace}),e.verifiedSessions.add(p),te.info("session restored via session/load",{agentId:e.agentId,cloudId:l,acpId:p})}catch(y){te.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:l,acpId:p,err:String(y)}),e.sessions.delete(l),p=void 0}p||(p=(await e.downstream.sessionNew({cwd:e.workspace})).sessionId,e.sessions.set(l,p),e.verifiedSessions.add(p),m=!0);let b=a._meta?.cozeTriggerMsgId;b?e.activeTriggers.set(p,b):e.activeTriggers.delete(p);let w=await e.downstream.sessionPrompt({...u,sessionId:p});return m&&this.persistSessionMapping(e),w}case"session/cancel":{let l=c.sessionId;if(!l)throw new A("IPC_BAD_REQUEST","session/cancel: missing sessionId");let p=e.sessions.get(l);return p&&await e.downstream.sessionCancel({sessionId:p}),{ok:!0}}default:throw new A("IPC_BAD_REQUEST",`session method not supported: ${o}`)}}forwardUpdate(e,o){let a=o.sessionId,c=this.reverseSessionId(e,a);if(!c){te.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let u={cozeAgentId:e.agentId},l=e.activeTriggers.get(a);l&&(u.cozeTriggerMsgId=l),this.upstream.send(zs("session/update",{...o,sessionId:c,_meta:u})).catch(p=>te.warn("forward update failed",{agentId:e.agentId,err:String(p)}))}handleAgentRequest(e,o){if(o.method==="session/request_permission"){this.forwardPermissionRequest(e,o);return}te.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:o.method}),e.downstream.respondAgentRequestError(o.id,{code:K.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${o.method}`})}forwardPermissionRequest(e,o){let a=this.upstreamIds.next("session/request_permission"),c=o.params??{},l=c.sessionId,p=l?e.activeTriggers.get(l):void 0,m={cozeAgentId:e.agentId};p&&(m.cozeTriggerMsgId=p);let b=l?this.reverseSessionId(e,l):void 0,w={...c,...b?{sessionId:b}:{},_meta:m},y=setTimeout(()=>{let E=this.pendingUpstream.get(a);E&&(this.pendingUpstream.delete(a),te.warn("upstream permission request timed out,replying cancelled to agent",{agentId:e.agentId,upstreamId:a}),e.downstream.respondAgentRequest(E.agentRequestId,{outcome:{kind:"cancelled"}}))},Wa);this.pendingUpstream.set(a,{agentRequestId:o.id,session:e,method:o.method,timer:y}),this.upstream.send(ct(a,"session/request_permission",w)).catch(E=>{let T=this.pendingUpstream.get(a);T&&(clearTimeout(T.timer),this.pendingUpstream.delete(a)),te.error("forward permission request failed",{agentId:e.agentId,err:String(E)}),e.downstream.respondAgentRequestError(o.id,{code:K.INTERNAL_ERROR,message:`upstream send failed: ${String(E)}`})})}handleUpstreamResponse(e){if(e.id===null)return;let o=this.pendingUpstream.get(e.id);if(o){this.pendingUpstream.delete(e.id),clearTimeout(o.timer),e.error?o.session.downstream.respondAgentRequestError(o.agentRequestId,e.error):o.session.downstream.respondAgentRequest(o.agentRequestId,e.result);return}let a=this.pendingBridge.get(e.id);if(a){this.pendingBridge.delete(e.id),clearTimeout(a.timer),e.error?a.reject(new Qt(e.error)):a.resolve(e.result);return}te.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,o,a=ja){let c=this.upstreamIds.next(e);return new Promise((u,l)=>{let p=setTimeout(()=>{this.pendingBridge.delete(c),l(new A("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(c,{method:e,resolve:u,reject:l,timer:p}),this.upstream.send(ct(c,e,o)).catch(m=>{let b=this.pendingBridge.get(c);b&&(clearTimeout(b.timer),this.pendingBridge.delete(c)),l(m)})})}async persistSessionMapping(e){if(this.paths)try{await or(e.agentId,e.sessions,this.paths)}catch(o){te.warn("persist session mapping failed",{agentId:e.agentId,err:String(o)})}}reverseSessionId(e,o){for(let[a,c]of e.sessions.entries())if(c===o)return a}sendError(e,o,a){return this.upstream.send(Ve(e,{code:o,message:a}))}};F();ue();import{randomBytes as Ga}from"node:crypto";import{chmod as Ja,mkdir as Xa,writeFile as Vs}from"node:fs/promises";import{createServer as Va}from"node:http";import{dirname as Ya}from"node:path";var Za=1e6,cr=M("ipc"),ln=class{server=null;port=0;token="";routes;paths;constructor(e){this.routes=new Map(e.routes.map(o=>[`${o.method} ${o.path}`,o])),this.paths=e.paths??W()}async start(){this.token=Ga(32).toString("hex");let e=Va((a,c)=>{this.dispatch(a,c)});this.server=e,await new Promise((a,c)=>{e.once("error",c),e.listen(0,"127.0.0.1",()=>a())});let o=e.address();if(!o||typeof o!="object")throw new Error("failed to obtain IPC port");return this.port=o.port,await this.persistAuthFiles(),cr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((o,a)=>{e.close(c=>c?a(c):o())}),this.server=null)}async persistAuthFiles(){await Xa(Ya(this.paths.portFile),{recursive:!0}),await Vs(this.paths.portFile,String(this.port),"utf8"),await Vs(this.paths.tokenFile,this.token,"utf8");try{await Ja(this.paths.tokenFile,384)}catch(e){cr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,o){if(e.headers.authorization!==`Bearer ${this.token}`){Lt(o,401,{error:"unauthorized"});return}let c=`${e.method} ${(e.url??"").split("?")[0]}`,u=this.routes.get(c);if(!u){Lt(o,404,{error:"not found"});return}let l=null;if(e.method==="POST")try{l=await $a(e)}catch(p){Lt(o,400,{error:"invalid json",detail:String(p)});return}try{let p=await u.handler(l,e);Lt(o,200,p??{ok:!0})}catch(p){cr.error("IPC handler failed",{key:c,err:String(p)}),Lt(o,500,{error:p instanceof Error?p.message:String(p)})}}};function Lt(r,e,o){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(o))}async function $a(r){let e=[],o=0;for await(let c of r){let u=c;if(o+=u.length,o>Za)throw new Error("body too large");e.push(u)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var vo=Te(oi(),1);var Nc=Te(to(),1),Rc=Te(Pn(),1),Mc=Te(ht(),1),Oc=Te(vr(),1),Bc=Te(Er(),1),zc=Te(Tr(),1),uo=Te(Nn(),1),qc=Te(co(),1);var fo=uo.default;F();var Mn="1008033",lo="1289";var ho="pbbp2",go="https://www.coze.cn",po="/api/coze_claw/resource/get_frontier_key",Uc="https://www.coze.cn",Fc="wss://frontier.coze.cn";function mo(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Uc}function _o(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Fc}function On(r){let e={},o=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return o&&(e["x-tt-env"]=o),a&&(e["x-use-ppe"]=a),e}var ie=M("upstream.frontier"),bo="application/json",yo="none",Bn=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){ie.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:go,...On(this.opts.ppeOverride)};class o extends fo{constructor(p){super(p,ho,{headers:e})}send(p,...m){if(bs("debug"))try{let b;typeof p=="string"?b=Buffer.from(p,"utf8"):p instanceof Buffer?b=p:p instanceof ArrayBuffer?b=new Uint8Array(p):ArrayBuffer.isView(p)?b=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):b=new Uint8Array(0);let w=Buffer.from(b.slice(0,128)).toString("hex");ie.debug("WS raw frame out",{bytes:b.byteLength,headHex:w})}catch(b){ie.warn("WS raw frame dump failed",{err:String(b)})}super.send(p,...m)}}let a=_o(this.opts.urlOverride),c={url:a,ws:o,fpID:lo,aID:Mn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:bo,force:!0},payloadEncoding:{encoding:yo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},u=new vo.FWS(c);u.onopen=()=>{this.opened=!0,this.openCount+=1;let l=this.openCount===1;ie.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:l,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:l})).catch(p=>ie.warn("onConnect handler threw (ignored)",{err:String(p)}))},u.onclose=l=>{this.opened=!1,ie.info("frontier closed",{code:l.code,reason:l.reason,willReconnect:l.willReconnect})},u.onerror=l=>{ie.warn("frontier error",{code:l.code,msg:l.message})},u.onmessage=l=>this.handleMessage(l),this.fws=u,await u.connect()}async stop(e){let o=this.fws;if(o){this.fws=null,this.opened=!1;try{o.close(1e3,e??"bridge shutdown")}catch(a){ie.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let o=this.fws;if(!o)throw new A("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),c=e;ie.info("frontier frame out",{method:c.method,jsonrpcId:c.id,size:a.length});try{await o.send(a,{service:33555712,method:1,payloadType:bo,payloadEncoding:yo})}catch(u){throw new A("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(u)}`,{cause:u})}}onFrame(e){this.handler=e}onConnect(e){this.connectHandler=e}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(e){let o=e.message?.service;if(o!==33555712){ie.debug("drop non-adapter frontier frame",{service:o});return}let a=Wc(e);if(!a){ie.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){ie.debug("frame received but no onFrame handler",{size:a.length});return}let c;try{c=JSON.parse(a)}catch(u){ie.warn("frontier message JSON parse failed",{err:String(u),head:a.slice(0,80)});return}ie.info("frontier frame in",{logid:Hc(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:c.id}),Promise.resolve(this.handler(c)).catch(u=>ie.warn("frontier frame handler threw",{err:String(u)}))}};function Hc(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function Wc(r){let e=r.message;if(e?.textPayload)return e.textPayload;let o=e?.payload;if(!o)return null;try{return Buffer.from(o).toString("utf8")}catch{return null}}F();function Co(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var So=M("handshake");async function Eo(r){let e=mo(r.endpoint),o=r.timeoutMs??1e4,a=`${jc(e)}${po}?aid=${encodeURIComponent(Mn)}`,c={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...On(r.ppeOverride)},u=new AbortController,l=setTimeout(()=>u.abort(),o);So.info("frontier key handshake",{base:e});try{let p=await fetch(a,{method:"GET",headers:c,signal:u.signal}),m=p.headers.get("x-tt-logid")??"",b=p.headers.get("x-tt-trace-id")??"";if(!p.ok){let T=await p.text().catch(()=>"");throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${p.status} logid=${m}: ${T.slice(0,200)}`)}let w=await p.json();if(w.code!==void 0&&w.code!==0)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${w.code} msg=${w.msg??"-"} logid=${m}`);let y=w.data?.access_key,E=w.data?.device_id;if(!y||!E)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${m}: ${JSON.stringify(w)}`);return So.info("handshake ok",{remoteDeviceId:E,logid:m,traceId:b}),{accessKey:y,deviceId:E}}catch(p){throw p instanceof A?p:p.name==="AbortError"?new A("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${o}ms)`):new A("UPSTREAM_HANDSHAKE_FAILED",String(p),{cause:p})}finally{clearTimeout(l)}}function jc(r){return r.endsWith("/")?r.slice(0,-1):r}F();var Nr=M("upstream.switchable"),zn=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,o){if(this.inner===e)return;Nr.info("swap upstream",{reason:o});let a=this.inner;this.inner=e,this.handler&&e.onFrame(this.handler),this.connectHandler&&e.onConnect&&e.onConnect(this.connectHandler);try{await e.start()}catch(c){throw Nr.error("swap target start failed, reverting",{err:String(c)}),this.inner=a,c}await a.stop(o??"swapped").catch(c=>Nr.warn("previous upstream stop threw (ignored)",{err:String(c)}))}current(){return this.inner}start(){return this.inner.start()}stop(e){return this.inner.stop(e)}send(e){return this.inner.send(e)}onFrame(e){this.handler=e,this.inner.onFrame(e)}onConnect(e){this.connectHandler=e,this.inner.onConnect?.(e)}isConnected(){return this.inner.isConnected()}};F();var Rr=M("upstream"),Bt=class{handler=null;async start(){Rr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Rr.info("NoopUpstream stopped",{reason:e})}async send(e){Rr.debug("NoopUpstream.send (dropped)",{method:"method"in e?e.method:void 0})}onFrame(e){this.handler=e}isConnected(){return!1}async injectFrame(e){this.handler&&await this.handler(e)}};F();ue();F();ue();import{readFileSync as Gc,unlinkSync as Jc}from"node:fs";import{mkdir as Xc,readFile as Ao,unlink as Do,writeFile as Vc}from"node:fs/promises";import{dirname as Yc}from"node:path";var Zc=M("single-instance"),qn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??W().pidFile,e.processTitle&&(process.title=e.processTitle)}async acquire(){let e=await this.readExistingPid();return e!==null&&this.isAlive(e)?{kind:"already-running",pid:e}:(e!==null&&(Zc.warn("removing stale pid file",{stalePid:e}),await Do(this.pidFile).catch(()=>{})),await Xc(Yc(this.pidFile),{recursive:!0}),await Vc(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Ao(this.pidFile,"utf8")).trim()===String(process.pid)&&await Do(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Ao(this.pidFile,"utf8"),o=Number.parseInt(e.trim(),10);return Number.isFinite(o)&&o>0?o:null}catch(e){if(e.code==="ENOENT")return null;throw e}}isAlive(e){try{return process.kill(e,0),!0}catch(o){return o.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Gc(this.pidFile,"utf8").trim()===String(process.pid)&&Jc(this.pidFile)}catch{}})}};var ne=M("daemon"),$c="coze-bridge-daemon";async function Po(){let r=new qn({processTitle:$c}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let o=await fn(),a=o??{};sr({pid:process.pid}),ne.info(o?"loaded bridge config":"initialized bridge config");try{let I=new At;a.frameworksCache=await I.detectAll(),ne.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(I){ne.warn("framework detection failed",{err:String(I)})}await Dt(a);let c=new zn(new Bt),u=W(),l=new dn({upstream:c,paths:u});await eu(u,l);let p=new un({paths:u,config:a,registry:l,healthReporter:async I=>{await l.sendRequest("_agent/health",I)}}),m,b,w=null,y=null;l.registerExtension("_agent/create",async I=>p.createAgent(I.params)),l.registerExtension("_agent/health",async()=>({ok:!0}));let E=new Zt({agents:l.agents,disposeAndMarkDisconnected:async(I,H)=>{let J=l.agents.get(I);J&&(await J.dispose(`disconnect: ${H}`).catch(Ae=>ne.warn("dispose during disconnect failed (ignored)",{agentId:I,err:String(Ae)})),J.status="disconnected",l.unregister(I)),l.disconnectedAgents.add(I)},executeModelSwitch:I=>p.executeModelSwitch(I)});l.registerExtension("_agent/listSkills",I=>E.listSkills(I.params)),l.registerExtension("_agent/addSkills",I=>E.addSkills(I.params)),l.registerExtension("_agent/removeSkills",I=>E.removeSkills(I.params)),l.registerExtension("_agent/getFileTree",I=>E.getFileTree(I.params)),l.registerExtension("_agent/getFileContent",I=>E.getFileContent(I.params)),l.registerExtension("_agent/update",I=>E.updateAgent(I.params)),l.registerExtension("_agent/disconnect",I=>E.disconnectAgent(I.params)),l.registerExtension("_agent/switchModel",I=>E.switchModel(I.params));let T=new Xt({paths:u,handlers:E,sendDetail:I=>l.sendRequest("_agent/detail",I)});c.onConnect(({initial:I})=>{ne.info("frontier upstream connected, triggering detail sync",{initial:I}),T.syncAll(I?"initial-connect":"reconnect").catch(H=>ne.warn("detail sync top-level error (ignored)",{err:String(H)}))});let k=new ln({paths:u,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...l.agents.keys()],deviceId:w??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async I=>{let H=I,J=H?.privatecode,Ae=H?.pairing_code;if(!J||!Ae)throw new A("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let ze=Co(H.env),be=H.handshake_url,ye=H.frontier_url,me=Qc(H.env,be,ye),nt=!!m&&m!==J,qt=b!==void 0&&b!==me;if(nt||qt){ne.warn("pair config switched, resetting agents",{pcChanged:nt,envChanged:qt,previousPc:m?Lo(m):"",nextPc:Lo(J),previousEnvKey:b??"",nextEnvKey:me});for(let Pe of[...l.agents.values()])await Pe.dispose("pair config switch").catch(()=>{}),l.agents.delete(Pe.agentId);await c.swap(new Bt,"pair switch").catch(()=>{})}let Ut=await Eo({privatecode:J,...be?{endpoint:be}:{},ppeOverride:ze});w=Ut.deviceId,sr({deviceId:w,pid:process.pid});let De=new Bn({handshake:Ut,privatecode:J,...ye?{urlOverride:ye}:{},ppeOverride:ze});await c.swap(De,"pair"),m=J,b=me;let Le=Object.keys(a.frameworksCache??{});try{let Pe=await l.sendRequest("_agent/pair",{pairCode:Ae,patToken:J,frameworks:Le,_meta:{cozeDeviceId:w}});return ne.info("_agent/pair ok",{pairResult:Pe}),y||(y=new $t({core:l,getDeviceId:()=>w??""})),y.start(),{ok:!0,note:"paired with cloud"}}catch(Pe){return ne.error("_agent/pair failed",{err:String(Pe)}),{ok:!1,note:`pair failed: ${String(Pe)}`}}}},{method:"POST",path:"/_agent/create",handler:async I=>{let H=I;return{ok:!0,result:await p.createAgent(H)}}},{method:"POST",path:"/refresh",handler:async()=>{ne.info("IPC /refresh: re-detecting frameworks");let I=new At;return a.frameworksCache=await I.detectAll(),await Dt(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(ne.info("IPC /shutdown received"),setImmediate(()=>{ce.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:N,token:G}=await k.start();await l.start();let oe=null,ce={port:N,token:G,core:l,ipc:k,shutdown(I){return oe||(ne.info("daemon shutdown",{reason:I}),oe=(async()=>{y?.stop(),await l.stop(I),await k.stop(),await r.release()})(),oe)}};for(let I of["SIGTERM","SIGINT"])process.on(I,()=>{ce.shutdown(I).then(()=>process.exit(0))});return ne.info("daemon ready",{port:N,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),ce}function Lo(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function Qc(r,e,o){return`${r??""}|${e??""}|${o??""}`}async function eu(r,e){let{readdir:o}=await import("node:fs/promises"),a;try{a=await o(r.agentsRoot)}catch{return}let{loadAgentConfig:c,enforceAgentConfigMode:u}=await Promise.resolve().then(()=>(at(),vs));for(let l of a){await u(l,r).catch(p=>ne.warn("enforceAgentConfigMode failed (ignored)",{agentId:l,err:String(p)}));try{let p=await c(l,r);p?.disconnectedAt&&(e.disconnectedAgents.add(l),ne.info("agent marked disconnected on startup",{agentId:l,disconnectedAt:p.disconnectedAt,reason:p.disconnectReason??""}))}catch(p){ne.warn("failed to load agent config on startup, skipping",{agentId:l,err:String(p)})}}}Or();ue();import{readFile as To}from"node:fs/promises";var je=class{paths;constructor(e){this.paths=e??W()}async probe(e=1e3){let o=await this.readAuth();if(!o)return{kind:"not-running"};try{let a=await this.fetch(o,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...o}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:cu(a)}}}async request(e){let o=await this.readAuth();if(!o)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(o,e)}async readAuth(){try{let[e,o]=await Promise.all([To(this.paths.portFile,"utf8"),To(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),c=o.trim();return!Number.isFinite(a)||a<=0||!c?null:{port:a,token:c}}catch(e){if(e.code==="ENOENT")return null;throw e}}async fetch(e,o){let a=o.body!==void 0,c={Authorization:`Bearer ${e.token}`};a&&(c["content-type"]="application/json");let u=new AbortController,l=setTimeout(()=>u.abort(),o.timeoutMs??5e3);try{let p=await fetch(`http://127.0.0.1:${e.port}${o.path}`,{method:o.method,headers:c,body:a?JSON.stringify(o.body):void 0,signal:u.signal}),m=await p.text();return{status:p.status,body:xu(m)}}finally{clearTimeout(l)}}};function xu(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function cu(r){return r instanceof Error?r.message:String(r)}F();ue();import{copyFile as Io,mkdir as uu,readFile as Br,writeFile as fu}from"node:fs/promises";import{dirname as du,resolve as zr,sep as Un}from"node:path";import{fileURLToPath as lu}from"node:url";F();ue();var No=M("dist-install");function hu(r){let e=lu(r),o=du(e),a=`${Un}src${Un}`;if(o.includes(a)||o.endsWith(`${Un}src${Un}cli`))return null;let c=zr(o,"index.js"),u=zr(o,"..","package.json");return{dist:c,pkgJson:u}}async function Ro(r={}){let e=r.paths??W(),o=hu(import.meta.url),a=r.sourceDist??o?.dist,c=r.sourcePackageJson??o?.pkgJson;if(!a||!c)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let u;try{u=JSON.parse(await Br(c,"utf8")).version??"unknown"}catch(y){return No.warn("cannot read source package.json,skip dist install",{err:String(y)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(y)}`}}let l=await fn(e.configFile)??{},p=l.libVersion;if(p===u)try{return await Br(e.libEntry),{kind:"already-current",libVersion:u}}catch{}await uu(e.libDir,{recursive:!0}),await Io(a,e.libEntry),await Io(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let m=zr(e.libDir,"package.json"),b=`${JSON.stringify({type:"module"},null,2)}
91
- `;return await Br(m,"utf8").catch(()=>null)!==b&&await fu(m,b),l.libVersion=u,await Dt(l,e.configFile),No.info("dist installed",{libEntry:e.libEntry,fromVersion:p,toVersion:u}),p?{kind:"version-changed",fromVersion:p,toVersion:u,libEntry:e.libEntry}:{kind:"first-install",libVersion:u,libEntry:e.libEntry}}var Nu=M("cli");function zt(r,e){let o=[],a;for(let c=0;c<r.length;c++){let u=r[c];if(u===e){a=r[c+1],c+=1;continue}if(u.startsWith(`${e}=`)){a=u.slice(e.length+1);continue}o.push(u)}return{value:a,rest:o}}function Ru(r){let e=r.slice(2);if(e.includes("--daemon"))return{mode:"daemon"};if(e.includes("--status"))return{mode:"status"};if(e.includes("--stop"))return{mode:"stop"};if(e.includes("--refresh"))return{mode:"refresh"};if(e.includes("--uninstall"))return{mode:"uninstall"};if(e.includes("--install-service"))return{mode:"install-service"};if(e.includes("--help")||e.includes("-h")||e.length===0)return{mode:"help"};let o=e,{value:a,rest:c}=zt(o,"--pat-token");o=c;let{value:u,rest:l}=zt(o,"--pair-code");o=l;let{value:p,rest:m}=zt(o,"--env");o=m;let{value:b,rest:w}=zt(o,"--handshake-url");o=w;let{value:y,rest:E}=zt(o,"--frontier-url");if(o=E,!a||!u)return{mode:"help"};let T={mode:"pair",privatecode:a,pairingCode:u};return p&&(T.env=p),b&&(T.handshakeUrl=b),y&&(T.frontierUrl=y),T}var Mu=`
88
+ ${x}`}var be=T("agent-detail-sync"),Jt=class{constructor(e){this.opts=e}opts;async syncAll(e){let i=this.opts.paths.agentsRoot,a;try{a=await ea(i)}catch(x){be.info("agents dir not found, skip detail sync",{root:i,err:String(x)});return}be.info("starting detail sync",{reason:e,count:a.length});for(let x of a)try{await this.syncOne(x)}catch(f){be.warn("detail sync failed for agent, skipping",{agentId:x,err:String(f)})}be.info("detail sync done",{reason:e})}async syncOne(e){let i=await ae(e,this.opts.paths);if(!i){be.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(u){be.warn("detail RPC failed, using local data",{agentId:e,err:String(u)});return}if(a.agentId&&a.agentId!==e){be.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:a.agentId});return}let x=!1,f=!1;if(a.agentName&&a.agentName!==i.agentName&&(i.agentName=a.agentName,x=!0),a.description!==void 0&&a.description!==i.description&&(i.description=a.description,x=!0),a.cozeIdentity&&a.cozeIdentity!==i.cozeIdentity&&(i.cozeIdentity=a.cozeIdentity,x=!0,f=!0),a.deployType&&be.info("detail.deployType",{agentId:e,deployType:a.deployType}),!x){be.debug("detail sync: no diff",{agentId:e});return}await de(i,this.opts.paths),be.info("detail sync: config updated",{agentId:e,identityChanged:f,agentName:i.agentName}),f&&(await Ve(i.workspace,i.framework,e,i.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};Ue();import{spawn as ta}from"node:child_process";import{mkdir as na,readFile as Ns,readdir as ra,rm as sa,stat as Yt,writeFile as ia}from"node:fs/promises";import{join as Le,normalize as oa,relative as Os,resolve as aa,sep as Bs}from"node:path";function Ss(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Cs(r){let{_meta:e,...i}=r;return{stripped:i,meta:e}}function xt(r){if(!r?.cozeAgentId)throw new Error("missing _meta.cozeAgentId");return r.cozeAgentId}var A=class extends Error{code;retriable;cause;constructor(e,i,a){super(i),this.name="BridgeError",this.code=e,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};U();ce();function Ye(r,e){if(Ss(r)!=="cloud")throw new A("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var Es="https://llm-gateway.coze.cn",Vt="auto";function fr(r){return{model:r.model??Vt,...r.modelToken?{modelToken:r.modelToken}:{}}}function As(r){return!r||r===Vt}function Ds(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=Es,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),As(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function ks(r){let e=[];return As(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_provider="openai"'),e.push("-c",`model_provider_overrides.openai.base_url="${Es}/v1"`)),e}function Ps(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}var $=T("agent-handlers"),Is=5*1024*1024,xa=1,ca=6,fa=new Set(["node_modules",".git",".coze","dist","build",".next"]),ua=3e4,Xt=class{constructor(e){this.opts=e}opts;async listSkills(e){Ye(e._meta,"_agent/listSkills");let i=xt(e._meta),a=await this.loadAgentCfg(i),x=a?.workspace??Te(i).workspace,f=a?.skills??[],u=[];for(let h of f){let p=Le(x,h.relPath,"SKILL.md");await Yt(p).then(b=>b.isFile()).catch(()=>!1)&&u.push({skillId:h.skillId,skillName:h.skillName,downloadUrl:h.downloadUrl??"",...h.description?{description:h.description}:{},...h.version?{version:h.version}:{}})}return{skills:u}}async addSkills(e){Ye(e._meta,"_agent/addSkills");let i=xt(e._meta),a=await this.requireAgentCfg(i),x=e.skills??[],f=[...a.skills??[]],u=new Map(f.map((p,w)=>[p.skillId,w])),h=[];for(let p of x){if(!p.skillName)throw new A("IPC_BAD_REQUEST","skill missing skillName");let w=da(p.skillName),b=la(a.framework),y=Le(b,w),E=Le(a.workspace,y);await na(E,{recursive:!0});let P=await ga(p.downloadUrl);ma(P)?await wa(P,E):await ia(Le(E,"SKILL.md"),P.toString("utf8"),"utf8");let I={skillId:p.skillId,skillName:p.skillName,relPath:y,installedAt:Date.now(),...p.description?{description:p.description}:{},...p.version?{version:p.version}:{},...p.downloadUrl?{downloadUrl:p.downloadUrl}:{}},L=u.get(p.skillId);L!==void 0?f[L]=I:(u.set(p.skillId,f.length),f.push(I)),h.push(p),$.info("skill installed",{agentId:i,skillId:p.skillId,skillName:p.skillName,relPath:y})}return await jt(i,f),await this.reloadAgentSessions(i,"skills-added"),{installedSkills:h}}async removeSkills(e){Ye(e._meta,"_agent/removeSkills");let i=xt(e._meta),a=await this.requireAgentCfg(i),x=new Set(e.skillIds??[]),f=a.skills??[],u=[];for(let h of f){if(!x.has(h.skillId)){u.push(h);continue}let p=Le(a.workspace,h.relPath);await sa(p,{recursive:!0,force:!0}),$.info("skill removed",{agentId:i,skillId:h.skillId,relPath:h.relPath})}return await jt(i,u),await this.reloadAgentSessions(i,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,i){return this.reloadAgentSessions(e,i)}async reloadAgentSessions(e,i){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex")for(let[x,f]of a.sessions)try{await a.downstream.sessionLoad({sessionId:f,cwd:a.workspace}),$.info("session reloaded",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f})}catch(u){$.warn("session reload failed",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f,err:String(u)})}}async updateAgent(e){if(!e.cozeIdentity?.trim())return $.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let i=e.agentId,a=await ae(i);if(!a)throw new A("AGENT_NOT_FOUND",`agent not found: ${i}`);return a.cozeIdentity===e.cozeIdentity?($.info("_agent/update: cozeIdentity unchanged, noop",{agentId:i}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await de(a),await Ve(a.workspace,a.framework,i,e.cozeIdentity),$.info("_agent/update: cozeIdentity rewritten",{agentId:i,framework:a.framework}),await this.reloadAgentSessions(i,"identity-changed"),{ok:!0})}async disconnectAgent(e){let i=e.agentId;if(!i)throw new A("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await ae(i);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await de(a),$.info("agent disconnected",{agentId:i,reason:e.reason??"",force:e.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(i,e.reason??"disconnect"),{ok:!0}):($.warn("_agent/disconnect: agent not found, ignoring",{agentId:i}),{ok:!0})}async switchModel(e){if(Ye(e._meta,"_agent/switchModel"),!e.agentId)throw new A("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let i=e.model&&e.model.trim()?e.model:Vt,a=e.modelToken?.trim()||void 0,x=await ae(e.agentId);if(!x)throw new A("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);x.model=i,a!==void 0?x.modelToken=a:delete x.modelToken,await de(x),$.info("_agent/switchModel: model/modelToken persisted",{agentId:e.agentId,model:i,hasToken:!!a,reason:e.reason??"",force:e.force??!1});let f=this.opts.agents.get(e.agentId);if(!f)return $.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(f.status==="switching")return $.info("_agent/switchModel: already switching, params updated via config",{agentId:e.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new A("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");f.status="switching";let u=f.msgQueue.enqueue(async()=>{}),h=setTimeout(()=>{$.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),f.downstream.stop("switchModel idle timeout").catch(p=>$.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(p)}))},ua);try{return await u.catch(p=>$.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(p)})),clearTimeout(h),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(p){clearTimeout(h),$.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(p)});let w=await ae(e.agentId).catch(()=>null);throw w&&(w.disconnectedAt=Date.now(),w.disconnectReason=`model switch failed: ${p instanceof Error?p.message:String(p)}`,await de(w).catch(b=>$.warn("write disconnect marker failed (ignored)",{err:String(b)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${p instanceof Error?p.message:String(p)}`).catch(b=>$.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(b)})):f.status="disconnected",p instanceof A&&(p.code==="MODEL_SWITCH_FAILED"||p.code==="AGENT_NOT_FOUND")?p:new A("MODEL_SWITCH_FAILED",p instanceof Error?p.message:String(p),{cause:p})}}async getFileTree(e){Ye(e._meta,"_agent/getFileTree");let i=e._meta,a=xt(i),x=this.resolveWorkspace(a),f=e.filePath??"",u=this.safeJoin(x,f),h=await Yt(u).catch(()=>null);if(!h)throw new A("IPC_BAD_REQUEST",`path not found: ${f}`);let p=_a(e.depth);return h.isDirectory()?{tree:await Rs(x,u,f,p)}:{tree:[{name:ya(f),path:Ms(f||"."),isDir:!1,size:h.size,modifiedAt:Math.floor(h.mtimeMs)}]}}async getFileContent(e){Ye(e._meta,"_agent/getFileContent");let i=xt(e._meta),a=this.resolveWorkspace(i);if(!e.filePath)throw new A("IPC_BAD_REQUEST","filePath required");let x=this.safeJoin(a,e.filePath),f=await Yt(x).catch(()=>null);if(!f||!f.isFile())throw new A("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(f.size>Is)throw new A("IPC_BAD_REQUEST",`file too large: ${f.size} bytes (max ${Is})`);let u=await Ns(x);return u.includes(0)?{content:u.toString("base64"),encoding:"base64",size:f.size}:{content:u.toString("utf8"),encoding:"utf-8",size:f.size}}resolveWorkspace(e){let i=this.opts.agents.get(e);return i?i.workspace:Te(e).workspace}safeJoin(e,i){let a=aa(e,i||"."),x=Os(e,a);if(x.startsWith("..")||x===".."||x.startsWith(`..${Bs}`))throw new A("IPC_BAD_REQUEST",`path escapes workspace: ${i}`);return a}loadAgentCfg(e){return ae(e)}async requireAgentCfg(e){let i=await this.loadAgentCfg(e);if(!i)throw new A("AGENT_NOT_FOUND",`no config for agent: ${e}`);return i}};function da(r){let e=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new A("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function la(r){return r==="claude-code"?Le(".claude","skills"):Le(".agents","skills")}var ha=3e4,Ts=50*1024*1024,Ls=3e4;async function ga(r){if(!r)throw new A("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return pa(r);if(r.startsWith("file:")){let e=new URL(r).pathname,i=await Ns(e);if(i.length>Ts)throw new A("IPC_BAD_REQUEST",`skill too large: ${i.length} bytes`);return i}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,i=setTimeout(()=>e.abort(),ha);try{let a=await fetch(r,{signal:e.signal});if(!a.ok)throw new A("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let x=await a.arrayBuffer();if(x.byteLength>Ts)throw new A("IPC_BAD_REQUEST",`skill too large: ${x.byteLength} bytes`);return Buffer.from(x)}finally{clearTimeout(i)}}throw new A("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function pa(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new A("IPC_BAD_REQUEST","bad data URL");let i=!!e[2],a=e[3]??"";return i?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function ma(r){return r.length>=2&&r[0]===31&&r[1]===139}async function wa(r,e){await new Promise((i,a)=>{let x=ta("tar",["-xzf","-","-C",e,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),f="";x.stderr?.on("data",h=>{f+=String(h)});let u=setTimeout(()=>{x.kill("SIGKILL"),a(new A("IPC_BAD_REQUEST",`tar extract timeout (${Ls}ms)`))},Ls);x.on("error",h=>{clearTimeout(u),a(new A("IPC_BAD_REQUEST",`tar spawn failed: ${h.message}`,{cause:h}))}),x.on("exit",h=>{clearTimeout(u),h===0?i():a(new A("IPC_BAD_REQUEST",`tar exit ${h}${f?`: ${f.trim().slice(0,200)}`:""}`))}),x.stdin?.end(r)})}async function Rs(r,e,i,a){if(a<=0)return[];let x;try{x=await ra(e,{withFileTypes:!0})}catch{return[]}let f=[];for(let u of x){if(fa.has(u.name))continue;let h=Le(e,u.name),p=oa(Le(i,u.name)),w=null;try{w=await Yt(h)}catch{continue}let b={name:u.name,path:Ms(Os(r,h)),isDir:w.isDirectory(),size:w.size,modifiedAt:Math.floor(w.mtimeMs)};w.isDirectory()&&a>1&&(b.children=await Rs(r,h,p,a-1)),f.push(b)}return f.sort((u,h)=>u.isDir!==h.isDir?u.isDir?-1:1:u.name.localeCompare(h.name)),f}function _a(r){return!r||r<=0?xa:Math.min(r,ca)}function ya(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function Ms(r){return r.split(Bs).join("/")}U();var Ct=T("agent-health-reporter"),ba=3e4,$t=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??ba}opts;timer=null;inFlight=!1;intervalMs;start(){this.timer||(this.timer=setInterval(()=>{this.tick()},this.intervalMs),this.timer.unref?.(),Ct.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,Ct.info("heartbeat stopped"))}async tick(){if(this.inFlight){Ct.debug("previous tick still in-flight, skip");return}let e=this.opts.getDeviceId();if(!e){Ct.debug("deviceId not available, skip tick (\u5C1A\u672A pair)");return}this.inFlight=!0;try{let i=[...this.opts.core.agents.values()];for(let a of i){let x=va(a);if(!x)continue;let f={status:x,_meta:{cozeAgentId:a.agentId,cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",f)}catch(u){Ct.warn("heartbeat send failed",{agentId:a.agentId,status:x,err:String(u)})}}}finally{this.inFlight=!1}}};function va(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}Ue();import{mkdir as ur,rm as La}from"node:fs/promises";import{spawn as Da}from"node:child_process";function ct(r,e,i){return i===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:i}}function zs(r,e){return e===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:e}}function ft(r,e){return{jsonrpc:"2.0",id:r,result:e}}function Xe(r,e){return{jsonrpc:"2.0",id:r,error:e}}var Zt=class extends Error{code;data;constructor(e){super(`JSON-RPC error code=${e.code} ${e.message}`),this.name="RemoteRpcError",this.code=e.code,e.data!==void 0&&(this.data=e.data)}},K={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,AGENT_NOT_FOUND:-32001,AGENT_BUSY:-32002,AGENT_TIMEOUT:-32003,AGENT_SPAWN_FAILED:-32004,OPERATION_NOT_ALLOWED_FOR_LOCAL:-32005,AGENT_DISCONNECTED:-32006,MODEL_SWITCHING:-32007,MODEL_SWITCH_FAILED:-32008};function Qt(r){return"method"in r&&"id"in r&&r.id!==void 0}function qs(r){return"method"in r&&!("id"in r)}function en(r){return!("method"in r)&&"id"in r}var Sa={AGENT_NOT_FOUND:K.AGENT_NOT_FOUND,AGENT_BUSY:K.AGENT_BUSY,AGENT_DISCONNECTED:K.AGENT_DISCONNECTED,AGENT_TIMEOUT:K.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:K.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:K.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:K.INTERNAL_ERROR,BRIDGE_INTERNAL:K.INTERNAL_ERROR,IPC_AUTH_FAILED:K.INTERNAL_ERROR,IPC_BAD_REQUEST:K.INVALID_REQUEST,MODEL_SWITCHING:K.MODEL_SWITCHING,MODEL_SWITCH_FAILED:K.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:K.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:K.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:K.INTERNAL_ERROR};function tn(r){return r instanceof A?{code:Sa[r.code]??K.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:K.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function Fs(r){let e=r.data,i=e?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new A(i,r.message,{retriable:e?.retriable??!1,cause:r.data})}function Us(r){return`${JSON.stringify(r)}
89
+ `}var nn=class{buffer="";onError;constructor(e={}){this.onError=e.onError}push(e){this.buffer+=typeof e=="string"?e:e.toString("utf8");let i=this.buffer.split(`
90
+ `);this.buffer=i.pop()??"";let a=[];for(let x of i){let f=x.replace(/\r$/,"").trim();if(f)try{a.push(JSON.parse(f))}catch(u){this.onError?.({line:f,error:u})}}return a}flush(){if(!this.buffer)return[];let e=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!e)return[];try{return[JSON.parse(e)]}catch(i){return this.onError?.({line:e,error:i}),[]}}};var Hs={"session/prompt":"session.prompt","session/cancel":"session.cancel","session/new":"session.new","session/load":"session.load","_agent/create":"agent.create","_agent/health":"agent.health","_agent/pair":"agent.pair","_agent/listSkills":"agent.listSkills","_agent/addSkills":"agent.addSkills","_agent/removeSkills":"agent.removeSkills","_agent/getFileTree":"agent.getFileTree","_agent/getFileContent":"agent.getFileContent","_agent/detail":"agent.detail","_agent/update":"agent.update","_agent/disconnect":"agent.disconnect","_agent/switchModel":"agent.switchModel",initialize:"initialize"},qu=Object.fromEntries(Object.entries(Hs).map(([r,e])=>[e,r])),Ca={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":["agentId"],"agent.listSkills":["agentId"],"agent.addSkills":["agentId"],"agent.removeSkills":["agentId"],"agent.getFileTree":["agentId"],"agent.getFileContent":["agentId"],"agent.detail":["agentId"],"agent.update":["agentId"],"agent.disconnect":["agentId"],"agent.switchModel":["agentId"],"agent.pair":[],initialize:[]},ut=class{seq=0;next(e,i){this.seq+=1;let a=Hs[e]??Ea(e),x=Ca[a]??[],f=[a,String(this.seq)];if(x.length>0){let u=x.map(p=>Ks(i?.[p]??"")),h=Aa(u).join(":");h&&f.push(h)}else i&&Object.values(i).some(u=>u)&&f.push(Object.values(i).filter(Boolean).map(u=>Ks(String(u))).join(":"));return f.join("_")}reset(){this.seq=0}};function Ea(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Ks(r){return r.replace(/[:_\s]+/g,"-")}function Aa(r){let e=r.length;for(;e>0&&!r[e-1];)e-=1;return r.slice(0,e)}U();var ka=3e4;function Ws(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var Ke=class{constructor(e){this.opts=e;this.log=T(`downstream.${this.constructor.name}`),this.decoder=new nn({onError:i=>this.log.warn("decode line failed",{line:i.line})})}opts;child;decoder;pending=new Map;idAllocator=new ut;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(e){return e}async start(){if(this.child)throw new A("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",i=Da(this.opts.command,this.opts.args,{cwd:this.opts.cwd,env:{...this.sanitizeEnv(process.env),...this.opts.env},stdio:["pipe","pipe","pipe"],detached:e});this.child=i,i.stdout?.setEncoding("utf8"),i.stdout?.on("data",a=>{for(let x of this.decoder.push(a))this.dispatch(x)}),i.stderr?.setEncoding("utf8"),i.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),i.on("exit",(a,x)=>{this.stopped=!0,this.failAllPending(new A("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${x})`));for(let f of this.exitHandlers)f(a,x)}),i.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new A("AGENT_SPAWN_FAILED",String(a),{cause:a}))}),this.log.info("downstream started",{command:this.opts.command,pid:i.pid,cwd:this.opts.cwd})}async stop(e){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:e});let i=this.child,a=new Promise(f=>i.once("exit",()=>f()));Ws(i.pid,"SIGTERM");let x=setTimeout(()=>{i.killed||Ws(i.pid,"SIGKILL")},5e3);try{await a}finally{clearTimeout(x)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(e){return this.call("initialize",e)}sessionNew(e){return this.call("session/new",{mcpServers:[],...e})}sessionLoad(e){return this.call("session/load",{mcpServers:[],...e})}sessionPrompt(e){return this.call("session/prompt",e,0)}async sessionCancel(e){if(!this.child||this.stopped)return;let i=this.idAllocator.next("session/cancel");this.writeFrame(ct(i,"session/cancel",e))}onUpdate(e){this.updateHandlers.push(e)}onAgentRequest(e){this.agentRequestHandlers.push(e)}respondAgentRequest(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(ft(e,i))}catch(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(Xe(e,i))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,i,a=ka){if(!this.child||this.stopped)return Promise.reject(new A("AGENT_PROTOCOL_ERROR","downstream not started"));let x=this.idAllocator.next(e),f=ct(x,e,i),u=a>0&&Number.isFinite(a);return new Promise((h,p)=>{let w=u?setTimeout(()=>{this.pending.delete(x),p(new A("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(x,{resolve:h,reject:p,timer:w,method:e});try{this.writeFrame(f)}catch(b){w&&clearTimeout(w),this.pending.delete(x),p(b)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new A("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(Us(e))}dispatch(e){if(en(e)){let i=e.id!==null?this.pending.get(e.id):void 0;if(!i){this.log.warn("orphan response",{id:e.id});return}this.pending.delete(e.id),i.timer&&clearTimeout(i.timer),e.error?i.reject(Fs(e.error)):i.resolve(e.result);return}if(qs(e)){if(e.method==="session/update")for(let i of this.updateHandlers)Promise.resolve(i(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if(Qt(e)){let i=e;this.handleAgentRequest(i).catch(a=>this.log.error("agent request handler failed",{method:i.method,err:String(a)}))}}async handleAgentRequest(e){if(this.agentRequestHandlers.length===0){this.writeFrame(Xe(e.id,{code:-32601,message:`method not handled by Bridge: ${e.method}`}));return}for(let i of this.agentRequestHandlers)try{await i(e)}catch(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Xe(e.id,tn(a)))}catch{}}}failAllPending(e){for(let i of this.pending.values())i.timer&&clearTimeout(i.timer),i.reject(e);this.pending.clear()}};var Pa="@zed-industries/claude-code-acp@latest";function Ia(r){let e={};for(let[i,a]of Object.entries(r))a!==void 0&&(i.startsWith("CLAUDE")||i==="AI_AGENT"||i==="BAGGAGE"||(e[i]=a));return e}var rn=class extends Ke{framework="claude-code";constructor(e){let i=e.command??"npx",a=e.args??["-y",Pa],x={command:i,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(x)}sanitizeEnv(e){return Ia(e)}};var Ta="@zed-industries/codex-acp@latest",sn=class extends Ke{framework="codex";constructor(e){let i=e.command??"npx",a=e.args??["-y",Ta],x=e.extraArgs?[...a,...e.extraArgs]:a,f={command:i,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f)}};import{spawn as js}from"node:child_process";U();var on=class extends Ke{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(e){let i=e.profile??"coze",a=e.sessionName??"default",x=["--profile",i,"acp","--session",`agent:${e.agentId}:${a}`],f={command:e.command,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f),this.profile=i,this.agentId=e.agentId,this.sessionName=a,this.registerLog=T("downstream.openclaw.register")}async start(){await this.registerAgent().catch(e=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(e)})}),await super.start()}registerAgent(){return new Promise((e,i)=>{let a=js(this.opts.command,["--profile",this.profile,"agents","add",this.agentId,"--workspace",this.opts.cwd,"--non-interactive"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",i),a.on("close",f=>{f===0?(this.registered=!0,this.registerLog.info("agent registered",{agentId:this.agentId,profile:this.profile}),e()):i(new A("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${f}: ${x.trim()}`))})})}async cleanup(e){this.registered&&await new Promise(i=>{let a=js(this.opts.command,["--profile",this.profile,"agents","delete",this.agentId,"--force"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",f=>{this.registerLog.warn("openclaw agents delete failed (best-effort)",{agentId:this.agentId,err:String(f)}),i()}),a.on("close",f=>{f===0?this.registerLog.info("agent unregistered",{agentId:this.agentId}):this.registerLog.warn("openclaw agents delete non-zero exit",{agentId:this.agentId,code:f,stderr:x.trim()}),this.registered=!1,i()})})}get acpSessionName(){return this.sessionName}};U();ce();var an=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(e){return this.disposed?Promise.reject(new Error("AsyncQueue disposed")):this.closed?Promise.reject(new Error("AsyncQueue closed")):new Promise((i,a)=>{this.slots.push({task:e,resolve:i,reject:a}),this.drain()})}close(){this.closed=!0}dispose(e=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(e)}get size(){return this.slots.length}get isRunning(){return this.running}async drain(){if(!this.running){this.running=!0;try{for(;this.slots.length>0&&!this.disposed;){let e=this.slots.shift();if(!e)break;try{let i=await e.task();e.resolve(i)}catch(i){e.reject(i)}}}finally{this.running=!1}}}};var xn=class{agentId;framework;workspace;msgQueue;sessions=new Map;verifiedSessions=new Set;activeTriggers=new Map;status="starting";lastActiveAt=Date.now();_downstream;constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this._downstream=e.downstream,this.msgQueue=new an}get downstream(){return this._downstream}swap(e){this._downstream=e,this.verifiedSessions.clear(),this.activeTriggers.clear()}async dispose(e){this.status="stopped",this.msgQueue.dispose(new Error(`AgentSession disposed${e?`: ${e}`:""}`)),await this._downstream.stop(e)}};var W=T("agent-manager"),Na=(r,e,i,a,x)=>{switch(r){case"claude-code":{let f=x?Ds(x):void 0;return new rn({cwd:i,...f&&Object.keys(f).length>0?{env:f}:{}})}case"codex":{let f=x?ks(x):[],u=x?Ps(x):void 0;return new sn({cwd:i,...f.length>0?{extraArgs:f}:{},...u&&Object.keys(u).length>0?{env:u}:{}})}case"openclaw":return new on({command:e,cwd:i,agentId:a})}},Oa=[0,5e3,5e3],Ba=2e4,Gs={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},cn=class{paths;config;registry;factory;restartDelaysMs;createTimeoutMs;healthReporter;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??Na,this.restartDelaysMs=e.restartDelaysMs??Oa,this.createTimeoutMs=e.createTimeoutMs??Ba,this.healthReporter=e.healthReporter}async createAgent(e){if(!e.agentId)throw new A("IPC_BAD_REQUEST","agentId required");if(!e.framework)throw new A("IPC_BAD_REQUEST","framework required");this.registry.reviveIfDisconnected?.(e.agentId);let i=this.registry.get(e.agentId);if(i){if(i.framework!==e.framework)throw new A("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${i.framework})`);if(i.status==="error")W.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await i.dispose("rebuild after error").catch(p=>W.warn("dispose stale agent failed (ignored)",{err:String(p)})),this.registry.unregister(e.agentId);else return W.info("agent already exists,return current",{agentId:e.agentId}),{ok:!0,agentId:i.agentId,workspace:i.workspace,pid:i.downstream.pid()??0,framework:i.framework}}let a=this.config.frameworksCache?.[e.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let x=Te(e.agentId,this.paths),f=e.workspace??x.workspace,u=new AbortController,h=setTimeout(()=>u.abort(new A("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(e,x,f,a,u.signal)}finally{clearTimeout(h)}}async createAgentInner(e,i,a,x,f){let u=()=>{if(f.aborted)throw f.reason instanceof Error?f.reason:new A("AGENT_TIMEOUT","_agent/create aborted")},h,p,w=!1;try{await ur(i.root,{recursive:!0}),await ur(a,{recursive:!0}),await ur(i.logs,{recursive:!0}),u(),e.framework!=="openclaw"&&await Ve(a,e.framework,e.agentId,e.cozeIdentity),u();let b=await ae(e.agentId,this.paths).catch(()=>null),y=fr({model:e.model??b?.model,modelToken:e.modelToken??b?.modelToken});if(h=this.factory(e.framework,x.path,a,e.agentId,y),await h.start(),u(),await h.initialize(Gs),u(),e.framework==="openclaw"&&await Ve(a,"openclaw",e.agentId,e.cozeIdentity),p=new xn({agentId:e.agentId,framework:e.framework,workspace:a,downstream:h}),p.status="ok",b?.sessions){for(let[I,L]of Object.entries(b.sessions))p.sessions.set(I,L);Object.keys(b.sessions).length>0&&W.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(b.sessions).length})}this.registry.register(p),w=!0;let E={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:b?.createdAt??Date.now(),sessions:b?.sessions??{},model:y.model};y.modelToken&&(E.modelToken=y.modelToken),b?.skills&&(E.skills=b.skills),b?.agentName&&(E.agentName=b.agentName),b?.description&&(E.description=b.description),await de(E,this.paths);let P=h.pid()??0;return W.info("agent created",{agentId:e.agentId,framework:e.framework,pid:P}),this.installRestartHook(p),{ok:!0,agentId:e.agentId,workspace:a,pid:P,framework:e.framework}}catch(b){throw W.error("agent create failed,rolling back",{agentId:e.agentId,err:String(b)}),h?.cleanup&&await h.cleanup("rollback").catch(y=>W.warn("downstream cleanup failed (ignored)",{err:String(y)})),h&&await h.stop("rollback").catch(()=>{}),w&&p&&(await p.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await La(i.root,{recursive:!0,force:!0}).catch(y=>W.warn("rm agent dir failed (ignored)",{err:String(y)})),b instanceof A?b:new A("AGENT_SPAWN_FAILED",String(b),{cause:b})}}async reportHealth(e,i,a){if(!this.healthReporter){W.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:i});return}try{await this.healthReporter({status:i,_meta:{cozeAgentId:e.agentId}}),W.info("_agent/health reported",{agentId:e.agentId,status:i,cause:a})}catch(x){W.warn("_agent/health upstream failed (ignored)",{agentId:e.agentId,status:i,err:String(x)})}}installRestartHook(e){let i=0,a=x=>{if(e.status==="stopped"||e.status==="disconnected"||e.status==="switching")return;if(i>=this.restartDelaysMs.length){W.error("agent restart exhausted",{agentId:e.agentId,attempts:i,...x}),e.status="error",this.reportHealth(e,"error",x);return}let f=this.restartDelaysMs[i]??5e3;i+=1,e.status="degraded",W.warn("agent restart scheduled",{agentId:e.agentId,attempt:i,delayMs:f,...x}),setTimeout(()=>{this.doRestart(e,i).then(u=>{u?(i=0,e.status="ok"):a(null)})},f)};e.downstream.onExit((x,f)=>a({code:x,signal:f}))}async spawnAndInitialize(e,i){let a=await ae(e.agentId,this.paths).catch(()=>null),x=a?fr(a):void 0,f=this.factory(e.framework,i,e.workspace,e.agentId,x);try{return await f.start(),await f.initialize(Gs),f}catch(u){throw await f.stop("spawnAndInitialize failed").catch(()=>{}),u}}rewireSession(e,i){e.swap(i),this.registry.attachHooks?.(e),this.installRestartHook(e)}async doRestart(e,i){let a=this.config.frameworksCache?.[e.framework];if(!a)return W.error("framework cache missing during restart",{agentId:e.agentId,framework:e.framework}),e.status="error",!1;W.info("agent restart attempt",{agentId:e.agentId,attempt:i});try{let x=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,x),W.info("agent restart succeeded",{agentId:e.agentId,attempt:i}),!0}catch(x){return W.warn("agent restart attempt failed",{agentId:e.agentId,attempt:i,err:String(x)}),!1}}async executeModelSwitch(e){let i=this.registry.get(e);if(!i)throw new A("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=this.config.frameworksCache?.[i.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${i.framework} not detected; cannot respawn for switchModel`);W.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:i.framework}),await i.downstream.stop("switchModel").catch(u=>{W.warn("stop old downstream failed (ignored, continuing)",{agentId:e,err:String(u)})});let x;try{x=await this.spawnAndInitialize(i,a.path)}catch(u){throw new A("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${u instanceof Error?u.message:String(u)}`,{cause:u})}this.rewireSession(i,x);let f=[...i.sessions.entries()];for(let[u,h]of f)try{await x.sessionLoad({sessionId:h,cwd:i.workspace}),i.verifiedSessions.add(h)}catch(p){throw new A("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${u} (acp=${h}): ${p instanceof Error?p.message:String(p)}`,{cause:p})}f.length>0&&W.info("executeModelSwitch: session/load reloaded",{agentId:e,count:f.length}),i.status="ok",W.info("executeModelSwitch: success",{agentId:e,framework:i.framework})}};U();import{spawn as Ra}from"node:child_process";import{constants as Js,access as Ma}from"node:fs/promises";import{delimiter as za,join as qa}from"node:path";var Fa=T("framework-detector"),Vs={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Ua=[".exe",".cmd",".bat",".ps1"],Et=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Ra,access:e.access??Ma}}async detect(e){let i=Vs[e],a=await this.which(i);if(!a)return Fa.debug("framework binary not found",{framework:e,bin:i}),null;let x=await this.probeVersion(a);return{path:a,version:x}}async detectAll(){let e=await Promise.all(Object.keys(Vs).map(async a=>[a,await this.detect(a)])),i={};for(let[a,x]of e)x&&(i[a]=x);return i}async which(e){let i=this.env.pathEnv.split(za).filter(Boolean),a=this.env.platform==="win32"?["",...Ua]:[""];for(let x of i)for(let f of a){let u=qa(x,e+f);if(await this.isExecutable(u))return u}return null}async isExecutable(e){try{let i=this.env.platform==="win32"?Js.F_OK:Js.X_OK;return await this.env.access(e,i),!0}catch{return!1}}async probeVersion(e){return new Promise(i=>{let a="",x=!1,f,u=h=>{x||(x=!0,f&&clearTimeout(f),i(h.trim()||"unknown"))};try{let h=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});f=setTimeout(()=>{h.kill("SIGKILL"),u("unknown")},5e3),h.stdout?.on("data",p=>{a+=p.toString("utf8")}),h.on("error",()=>u("unknown")),h.on("close",()=>{let p=Ha(a).split(/\r?\n/)[0]??"";u(p)})}catch{u("unknown")}})}},Ka=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function Ha(r){return r.replace(Ka,"")}ar();ce();function fn(r){return Ft(r??H().configFile)}function At(r,e){return Ut(e??H().configFile,r)}Ue();U();var ee=T("core"),Wa=5*6e4,ja=3e4,un=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new ut;pendingUpstream=new Map;pendingBridge=new Map;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths}registerExtension(e,i){this.extensions[e]=i}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),ee.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){ee.info("Core stopping",{reason:e}),await Promise.all([...this.agents.values()].map(i=>i.dispose(e))),this.agents.clear(),await this.upstream.stop(e)}get(e){return this.agents.get(e)}register(e){this.agents.set(e.agentId,e),this.attachDownstreamHooks(e),ee.info("agent registered",{agentId:e.agentId,framework:e.framework})}unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&ee.info("agent revived from disconnect",{agentId:e})}attachDownstreamHooks(e){e.downstream.onUpdate(i=>{this.forwardUpdate(e,i)}),e.downstream.onAgentRequest(i=>{this.handleAgentRequest(e,i)}),e.downstream.onExit((i,a)=>{ee.warn("agent downstream exited",{agentId:e.agentId,code:i,signal:a})})}attachHooks(e){this.attachDownstreamHooks(e)}async handleFrame(e){if(en(e)){this.handleUpstreamResponse(e);return}if(Qt(e))try{if(e.method.startsWith("_agent/")){let i=this.extensions[e.method];if(!i){await this.sendError(e.id,K.METHOD_NOT_FOUND,`extension not registered: ${e.method}`);return}let a=await i(e,this);await this.upstream.send(ft(e.id,a));return}if(e.method.startsWith("session/")){let i=await this.routeSessionMethod(e);await this.upstream.send(ft(e.id,i));return}if(e.method==="initialize"){await this.upstream.send(ft(e.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(e.id,K.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(i){ee.error("handleFrame failed",{method:e.method,err:String(i)}),await this.upstream.send(Xe(e.id,tn(i)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new A("IPC_BAD_REQUEST",`${e.method} requires params`);let i=e.params,a=i._meta?.cozeAgentId;if(!a)throw new A("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let x=this.agents.get(a);if(!x)throw this.disconnectedAgents.has(a)?new A("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new A("AGENT_NOT_FOUND",`agent not found: ${a}`);if(x.status==="switching")throw new A("MODEL_SWITCHING",`agent ${a} is switching model; retry later`,{retriable:!0});let f=Date.now(),u=!1;try{let h=await x.msgQueue.enqueue(()=>this.dispatchSessionCall(x,e.method,i));return u=!0,h}finally{ee.info("session call done",{agentId:x.agentId,method:e.method,durationMs:Date.now()-f,ok:u})}}async dispatchSessionCall(e,i,a){e.lastActiveAt=Date.now();let{stripped:x}=Cs(a);switch(i){case"session/new":{let f=x;return await e.downstream.sessionNew({...f,cwd:f.cwd||e.workspace})}case"session/load":{let f=x,u=f.sessionId,h=e.sessions.get(u);try{let p=h??u,w=await e.downstream.sessionLoad({...f,sessionId:p,cwd:f.cwd||e.workspace});return h||e.sessions.set(u,p),w}catch(p){ee.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,err:String(p)});let w=await e.downstream.sessionNew({cwd:f.cwd||e.workspace});return e.sessions.set(u,w.sessionId),{}}}case"session/prompt":{let f=x,u=f.sessionId,h=e.sessions.get(u),p=!1;if(h&&!e.verifiedSessions.has(h))try{await e.downstream.sessionLoad({sessionId:h,cwd:e.workspace}),e.verifiedSessions.add(h),ee.info("session restored via session/load",{agentId:e.agentId,cloudId:u,acpId:h})}catch(y){ee.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,acpId:h,err:String(y)}),e.sessions.delete(u),h=void 0}h||(h=(await e.downstream.sessionNew({cwd:e.workspace})).sessionId,e.sessions.set(u,h),e.verifiedSessions.add(h),p=!0);let w=a._meta?.cozeTriggerMsgId;w?e.activeTriggers.set(h,w):e.activeTriggers.delete(h);let b=await e.downstream.sessionPrompt({...f,sessionId:h});return p&&this.persistSessionMapping(e),b}case"session/cancel":{let u=x.sessionId;if(!u)throw new A("IPC_BAD_REQUEST","session/cancel: missing sessionId");let h=e.sessions.get(u);return h&&await e.downstream.sessionCancel({sessionId:h}),{ok:!0}}default:throw new A("IPC_BAD_REQUEST",`session method not supported: ${i}`)}}forwardUpdate(e,i){let a=i.sessionId,x=this.reverseSessionId(e,a);if(!x){ee.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let f={cozeAgentId:e.agentId},u=e.activeTriggers.get(a);u&&(f.cozeTriggerMsgId=u),this.upstream.send(zs("session/update",{...i,sessionId:x,_meta:f})).catch(h=>ee.warn("forward update failed",{agentId:e.agentId,err:String(h)}))}handleAgentRequest(e,i){if(i.method==="session/request_permission"){this.forwardPermissionRequest(e,i);return}ee.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:i.method}),e.downstream.respondAgentRequestError(i.id,{code:K.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${i.method}`})}forwardPermissionRequest(e,i){let a=this.upstreamIds.next("session/request_permission"),x=i.params??{},u=x.sessionId,h=u?e.activeTriggers.get(u):void 0,p={cozeAgentId:e.agentId};h&&(p.cozeTriggerMsgId=h);let w=u?this.reverseSessionId(e,u):void 0,b={...x,...w?{sessionId:w}:{},_meta:p},y=setTimeout(()=>{let E=this.pendingUpstream.get(a);E&&(this.pendingUpstream.delete(a),ee.warn("upstream permission request timed out,replying cancelled to agent",{agentId:e.agentId,upstreamId:a}),e.downstream.respondAgentRequest(E.agentRequestId,{outcome:{kind:"cancelled"}}))},Wa);this.pendingUpstream.set(a,{agentRequestId:i.id,session:e,method:i.method,timer:y}),this.upstream.send(ct(a,"session/request_permission",b)).catch(E=>{let P=this.pendingUpstream.get(a);P&&(clearTimeout(P.timer),this.pendingUpstream.delete(a)),ee.error("forward permission request failed",{agentId:e.agentId,err:String(E)}),e.downstream.respondAgentRequestError(i.id,{code:K.INTERNAL_ERROR,message:`upstream send failed: ${String(E)}`})})}handleUpstreamResponse(e){if(e.id===null)return;let i=this.pendingUpstream.get(e.id);if(i){this.pendingUpstream.delete(e.id),clearTimeout(i.timer),e.error?i.session.downstream.respondAgentRequestError(i.agentRequestId,e.error):i.session.downstream.respondAgentRequest(i.agentRequestId,e.result);return}let a=this.pendingBridge.get(e.id);if(a){this.pendingBridge.delete(e.id),clearTimeout(a.timer),e.error?a.reject(new Zt(e.error)):a.resolve(e.result);return}ee.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,i,a=ja){let x=this.upstreamIds.next(e);return new Promise((f,u)=>{let h=setTimeout(()=>{this.pendingBridge.delete(x),u(new A("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(x,{method:e,resolve:f,reject:u,timer:h}),this.upstream.send(ct(x,e,i)).catch(p=>{let w=this.pendingBridge.get(x);w&&(clearTimeout(w.timer),this.pendingBridge.delete(x)),u(p)})})}async persistSessionMapping(e){if(this.paths)try{await cr(e.agentId,e.sessions,this.paths)}catch(i){ee.warn("persist session mapping failed",{agentId:e.agentId,err:String(i)})}}reverseSessionId(e,i){for(let[a,x]of e.sessions.entries())if(x===i)return a}sendError(e,i,a){return this.upstream.send(Xe(e,{code:i,message:a}))}};U();ce();import{randomBytes as Ga}from"node:crypto";import{chmod as Ja,mkdir as Va,writeFile as Ys}from"node:fs/promises";import{createServer as Ya}from"node:http";import{dirname as Xa}from"node:path";var $a=1e6,dr=T("ipc"),dn=class{server=null;port=0;token="";routes;paths;constructor(e){this.routes=new Map(e.routes.map(i=>[`${i.method} ${i.path}`,i])),this.paths=e.paths??H()}async start(){this.token=Ga(32).toString("hex");let e=Ya((a,x)=>{this.dispatch(a,x)});this.server=e,await new Promise((a,x)=>{e.once("error",x),e.listen(0,"127.0.0.1",()=>a())});let i=e.address();if(!i||typeof i!="object")throw new Error("failed to obtain IPC port");return this.port=i.port,await this.persistAuthFiles(),dr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((i,a)=>{e.close(x=>x?a(x):i())}),this.server=null)}async persistAuthFiles(){await Va(Xa(this.paths.portFile),{recursive:!0}),await Ys(this.paths.portFile,String(this.port),"utf8"),await Ys(this.paths.tokenFile,this.token,"utf8");try{await Ja(this.paths.tokenFile,384)}catch(e){dr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,i){if(e.headers.authorization!==`Bearer ${this.token}`){Dt(i,401,{error:"unauthorized"});return}let x=`${e.method} ${(e.url??"").split("?")[0]}`,f=this.routes.get(x);if(!f){Dt(i,404,{error:"not found"});return}let u=null;if(e.method==="POST")try{u=await Za(e)}catch(h){Dt(i,400,{error:"invalid json",detail:String(h)});return}try{let h=await f.handler(u,e);Dt(i,200,h??{ok:!0})}catch(h){dr.error("IPC handler failed",{key:x,err:String(h)}),Dt(i,500,{error:h instanceof Error?h.message:String(h)})}}};function Dt(r,e,i){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(i))}async function Za(r){let e=[],i=0;for await(let x of r){let f=x;if(i+=f.length,i>$a)throw new Error("body too large");e.push(f)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var vo=Ie(oi(),1);var Nc=Ie(to(),1),Oc=Ie(kn(),1),Bc=Ie(ht(),1),Rc=Ie(Er(),1),Mc=Ie(kr(),1),zc=Ie(Or(),1),fo=Ie(Ln(),1),qc=Ie(co(),1);var uo=fo.default;U();var On="1008033",lo="1289";var ho="pbbp2",go="https://www.coze.cn",po="/api/coze_claw/resource/get_frontier_key",Fc="https://www.coze.cn",Uc="wss://frontier.coze.cn";function mo(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Fc}function wo(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Uc}function Bn(r){let e={},i=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return i&&(e["x-tt-env"]=i),a&&(e["x-use-ppe"]=a),e}var se=T("upstream.frontier"),yo="application/json",bo="none",Rn=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){se.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:go,...Bn(this.opts.ppeOverride)};class i extends uo{constructor(h){super(h,ho,{headers:e})}send(h,...p){if(bs("debug"))try{let w;typeof h=="string"?w=Buffer.from(h,"utf8"):h instanceof Buffer?w=h:h instanceof ArrayBuffer?w=new Uint8Array(h):ArrayBuffer.isView(h)?w=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):w=new Uint8Array(0);let b=Buffer.from(w.slice(0,128)).toString("hex");se.debug("WS raw frame out",{bytes:w.byteLength,headHex:b})}catch(w){se.warn("WS raw frame dump failed",{err:String(w)})}super.send(h,...p)}}let a=wo(this.opts.urlOverride),x={url:a,ws:i,fpID:lo,aID:On,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:yo,force:!0},payloadEncoding:{encoding:bo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},f=new vo.FWS(x);f.onopen=()=>{this.opened=!0,this.openCount+=1;let u=this.openCount===1;se.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:u,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:u})).catch(h=>se.warn("onConnect handler threw (ignored)",{err:String(h)}))},f.onclose=u=>{this.opened=!1,se.info("frontier closed",{code:u.code,reason:u.reason,willReconnect:u.willReconnect})},f.onerror=u=>{se.warn("frontier error",{code:u.code,msg:u.message})},f.onmessage=u=>this.handleMessage(u),this.fws=f,await f.connect()}async stop(e){let i=this.fws;if(i){this.fws=null,this.opened=!1;try{i.close(1e3,e??"bridge shutdown")}catch(a){se.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let i=this.fws;if(!i)throw new A("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),x=e;se.info("frontier frame out",{method:x.method,jsonrpcId:x.id,size:a.length});try{await i.send(a,{service:33555712,method:1,payloadType:yo,payloadEncoding:bo})}catch(f){throw new A("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(f)}`,{cause:f})}}onFrame(e){this.handler=e}onConnect(e){this.connectHandler=e}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(e){let i=e.message?.service;if(i!==33555712){se.debug("drop non-adapter frontier frame",{service:i});return}let a=Wc(e);if(!a){se.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){se.debug("frame received but no onFrame handler",{size:a.length});return}let x;try{x=JSON.parse(a)}catch(f){se.warn("frontier message JSON parse failed",{err:String(f),head:a.slice(0,80)});return}se.info("frontier frame in",{logid:Hc(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:x.id}),Promise.resolve(this.handler(x)).catch(f=>se.warn("frontier frame handler threw",{err:String(f)}))}};function Hc(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function Wc(r){let e=r.message;if(e?.textPayload)return e.textPayload;let i=e?.payload;if(!i)return null;try{return Buffer.from(i).toString("utf8")}catch{return null}}U();function Co(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var So=T("handshake");async function Eo(r){let e=mo(r.endpoint),i=r.timeoutMs??1e4,a=`${jc(e)}${po}?aid=${encodeURIComponent(On)}`,x={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...Bn(r.ppeOverride)},f=new AbortController,u=setTimeout(()=>f.abort(),i);So.info("frontier key handshake",{base:e});try{let h=await fetch(a,{method:"GET",headers:x,signal:f.signal}),p=h.headers.get("x-tt-logid")??"",w=h.headers.get("x-tt-trace-id")??"";if(!h.ok){let P=await h.text().catch(()=>"");throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${h.status} logid=${p}: ${P.slice(0,200)}`)}let b=await h.json();if(b.code!==void 0&&b.code!==0)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${b.code} msg=${b.msg??"-"} logid=${p}`);let y=b.data?.access_key,E=b.data?.device_id;if(!y||!E)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${p}: ${JSON.stringify(b)}`);return So.info("handshake ok",{remoteDeviceId:E,logid:p,traceId:w}),{accessKey:y,deviceId:E}}catch(h){throw h instanceof A?h:h.name==="AbortError"?new A("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${i}ms)`):new A("UPSTREAM_HANDSHAKE_FAILED",String(h),{cause:h})}finally{clearTimeout(u)}}function jc(r){return r.endsWith("/")?r.slice(0,-1):r}U();var Rr=T("upstream.switchable"),Mn=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,i){if(this.inner===e)return;Rr.info("swap upstream",{reason:i});let a=this.inner;this.inner=e,this.handler&&e.onFrame(this.handler),this.connectHandler&&e.onConnect&&e.onConnect(this.connectHandler);try{await e.start()}catch(x){throw Rr.error("swap target start failed, reverting",{err:String(x)}),this.inner=a,x}await a.stop(i??"swapped").catch(x=>Rr.warn("previous upstream stop threw (ignored)",{err:String(x)}))}current(){return this.inner}start(){return this.inner.start()}stop(e){return this.inner.stop(e)}send(e){return this.inner.send(e)}onFrame(e){this.handler=e,this.inner.onFrame(e)}onConnect(e){this.connectHandler=e,this.inner.onConnect?.(e)}isConnected(){return this.inner.isConnected()}};U();var Mr=T("upstream"),Rt=class{handler=null;async start(){Mr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Mr.info("NoopUpstream stopped",{reason:e})}async send(e){Mr.debug("NoopUpstream.send (dropped)",{method:"method"in e?e.method:void 0})}onFrame(e){this.handler=e}isConnected(){return!1}async injectFrame(e){this.handler&&await this.handler(e)}};U();ce();U();ce();import{readFileSync as Gc,unlinkSync as Jc}from"node:fs";import{mkdir as Vc,readFile as Ao,unlink as Do,writeFile as Yc}from"node:fs/promises";import{dirname as Xc}from"node:path";var $c=T("single-instance"),zn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??H().pidFile,e.processTitle&&(process.title=e.processTitle)}async acquire(){let e=await this.readExistingPid();return e!==null&&this.isAlive(e)?{kind:"already-running",pid:e}:(e!==null&&($c.warn("removing stale pid file",{stalePid:e}),await Do(this.pidFile).catch(()=>{})),await Vc(Xc(this.pidFile),{recursive:!0}),await Yc(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Ao(this.pidFile,"utf8")).trim()===String(process.pid)&&await Do(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Ao(this.pidFile,"utf8"),i=Number.parseInt(e.trim(),10);return Number.isFinite(i)&&i>0?i:null}catch(e){if(e.code==="ENOENT")return null;throw e}}isAlive(e){try{return process.kill(e,0),!0}catch(i){return i.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Gc(this.pidFile,"utf8").trim()===String(process.pid)&&Jc(this.pidFile)}catch{}})}};var q=T("daemon"),Zc="coze-bridge-daemon";async function Po(){let r=new zn({processTitle:Zc}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let i=await fn(),a=i??{};xr({pid:process.pid}),q.info(i?"loaded bridge config":"initialized bridge config");try{let D=new Et;a.frameworksCache=await D.detectAll(),q.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(D){q.warn("framework detection failed",{err:String(D)})}await At(a);let x=new Mn(new Rt),f=H(),u=new un({upstream:x,paths:f});await ef(f,u);let h=new cn({paths:f,config:a,registry:u,healthReporter:async D=>{await u.sendRequest("_agent/health",D)}}),p,w,b=null,y=null;u.registerExtension("_agent/create",async D=>h.createAgent(D.params)),u.registerExtension("_agent/health",async()=>({ok:!0}));let E=new Xt({agents:u.agents,disposeAndMarkDisconnected:async(D,z)=>{let G=u.agents.get(D);G&&(await G.dispose(`disconnect: ${z}`).catch(Ee=>q.warn("dispose during disconnect failed (ignored)",{agentId:D,err:String(Ee)})),G.status="disconnected",u.unregister(D)),u.disconnectedAgents.add(D)},executeModelSwitch:D=>h.executeModelSwitch(D)});u.registerExtension("_agent/listSkills",D=>E.listSkills(D.params)),u.registerExtension("_agent/addSkills",D=>E.addSkills(D.params)),u.registerExtension("_agent/removeSkills",D=>E.removeSkills(D.params)),u.registerExtension("_agent/getFileTree",D=>E.getFileTree(D.params)),u.registerExtension("_agent/getFileContent",D=>E.getFileContent(D.params)),u.registerExtension("_agent/update",D=>E.updateAgent(D.params)),u.registerExtension("_agent/disconnect",D=>E.disconnectAgent(D.params)),u.registerExtension("_agent/switchModel",D=>E.switchModel(D.params));let P=new Jt({paths:f,handlers:E,sendDetail:D=>u.sendRequest("_agent/detail",D)});x.onConnect(({initial:D})=>{q.info("frontier upstream connected, triggering detail sync",{initial:D}),P.syncAll(D?"initial-connect":"reconnect").catch(z=>q.warn("detail sync top-level error (ignored)",{err:String(z)}))});let I=new dn({paths:f,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...u.agents.keys()],deviceId:b??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async D=>{let z=D,G=z?.privatecode,Ee=z?.pairing_code;if(!G||!Ee)throw new A("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let Me=Co(z.env),_e=z.handshake_url,ye=z.frontier_url,ge=Qc(z.env,_e,ye),rt=!!p&&p!==G,Mt=w!==void 0&&w!==ge;if(rt||Mt){q.warn("pair config switched, resetting agents",{pcChanged:rt,envChanged:Mt,previousPc:p?ko(p):"",nextPc:ko(G),previousEnvKey:w??"",nextEnvKey:ge});for(let ke of[...u.agents.values()])await ke.dispose("pair config switch").catch(()=>{}),u.agents.delete(ke.agentId);await x.swap(new Rt,"pair switch").catch(()=>{})}let zt=await Eo({privatecode:G,..._e?{endpoint:_e}:{},ppeOverride:Me});b=zt.deviceId,xr({deviceId:b,pid:process.pid});let Ae=new Rn({handshake:zt,privatecode:G,...ye?{urlOverride:ye}:{},ppeOverride:Me});await x.swap(Ae,"pair"),p=G,w=ge;let De=Object.keys(a.frameworksCache??{});try{let ke=await u.sendRequest("_agent/pair",{pairCode:Ee,patToken:G,frameworks:De,_meta:{cozeDeviceId:b}});q.info("_agent/pair ok",{pairResult:ke}),y||(y=new $t({core:u,getDeviceId:()=>b??""})),y.start();let te;return z.agent_id&&(te=await tf(z.agent_id,f,h,Ge=>u.sendRequest("_agent/detail",Ge)).catch(Ge=>(q.error("--agent-id ensureAgent failed",{agentId:z.agent_id,err:String(Ge)}),{ok:!1,agentId:z.agent_id??"",note:String(Ge)}))),{ok:!0,note:"paired with cloud",...te?{agent:te}:{}}}catch(ke){return q.error("_agent/pair failed",{err:String(ke)}),{ok:!1,note:`pair failed: ${String(ke)}`}}}},{method:"POST",path:"/_agent/create",handler:async D=>{let z=D;return{ok:!0,result:await h.createAgent(z)}}},{method:"POST",path:"/refresh",handler:async()=>{q.info("IPC /refresh: re-detecting frameworks");let D=new Et;return a.frameworksCache=await D.detectAll(),await At(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(q.info("IPC /shutdown received"),setImmediate(()=>{xe.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:L,token:j}=await I.start();await u.start(),nf(f,h).catch(D=>q.warn("auto-revive top-level error (ignored)",{err:String(D)}));let ie=null,xe={port:L,token:j,core:u,ipc:I,shutdown(D){return ie||(q.info("daemon shutdown",{reason:D}),ie=(async()=>{y?.stop(),await u.stop(D),await I.stop(),await r.release()})(),ie)}};for(let D of["SIGTERM","SIGINT"])process.on(D,()=>{xe.shutdown(D).then(()=>process.exit(0))});return q.info("daemon ready",{port:L,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),xe}function ko(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function Qc(r,e,i){return`${r??""}|${e??""}|${i??""}`}async function ef(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.agentsRoot)}catch{return}let{loadAgentConfig:x,enforceAgentConfigMode:f}=await Promise.resolve().then(()=>(Ue(),Gt));for(let u of a){await f(u,r).catch(h=>q.warn("enforceAgentConfigMode failed (ignored)",{agentId:u,err:String(h)}));try{let h=await x(u,r);h?.disconnectedAt&&(e.disconnectedAgents.add(u),q.info("agent marked disconnected on startup",{agentId:u,disconnectedAt:h.disconnectedAt,reason:h.disconnectReason??""}))}catch(h){q.warn("failed to load agent config on startup, skipping",{agentId:u,err:String(h)})}}}async function tf(r,e,i,a){let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Ue(),Gt)),f=await x(r,e);if(f){q.info("--agent-id: local config found, reconnecting",{agentId:r,framework:f.framework,hadDisconnect:!!f.disconnectedAt});let p={agentId:f.agentId,framework:f.framework,...f.cozeIdentity?{cozeIdentity:f.cozeIdentity}:{},...f.model?{model:f.model}:{},...f.modelToken?{modelToken:f.modelToken}:{}};return await i.createAgent(p),{ok:!0,agentId:r,note:f.disconnectedAt?"revived from local config":"connected from local config"}}q.info("--agent-id: local config missing, pulling _agent/detail from cloud",{agentId:r});let u=await a({_meta:{cozeAgentId:r}});if(!u.framework)throw new A("AGENT_NOT_FOUND",`agent ${r} \u4E0D\u5728\u672C\u5730; \u4E91\u7AEF _agent/detail \u54CD\u5E94\u7F3A framework \u5B57\u6BB5 (D36 \u534F\u8BAE\u6269\u5C55\u672A\u751F\u6548), \u65E0\u6CD5\u5728\u672C\u673A\u65B0\u5EFA`);let h={agentId:u.agentId,framework:u.framework,...u.cozeIdentity?{cozeIdentity:u.cozeIdentity}:{},...u.model?{model:u.model}:{},...u.modelToken?{modelToken:u.modelToken}:{}};return await i.createAgent(h),{ok:!0,agentId:r,note:"created from cloud detail"}}async function nf(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.agentsRoot)}catch{return{revived:0,skipped:0,total:0}}if(a.length===0)return{revived:0,skipped:0,total:0};let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Ue(),Gt));q.info("auto-revive: scanning local agents on startup",{count:a.length});let f=0,u=0;for(let h of a){let p;try{p=await x(h,r)}catch(w){q.warn("auto-revive: load config failed (skipping)",{agentId:h,err:String(w)}),u+=1;continue}if(!p){u+=1;continue}if(p.disconnectedAt){q.info("auto-revive: skip disconnected agent",{agentId:h,disconnectedAt:p.disconnectedAt}),u+=1;continue}try{q.info("auto-revive: spawning",{agentId:h,framework:p.framework}),await e.createAgent({agentId:p.agentId,framework:p.framework,...p.cozeIdentity?{cozeIdentity:p.cozeIdentity}:{},...p.model?{model:p.model}:{},...p.modelToken?{modelToken:p.modelToken}:{}}),f+=1}catch(w){q.warn("auto-revive: createAgent failed (skipping)",{agentId:h,framework:p.framework,err:String(w)}),u+=1}}return q.info("auto-revive: done",{revived:f,skipped:u,total:a.length}),{revived:f,skipped:u,total:a.length}}qr();ce();import{readFile as To}from"node:fs/promises";var je=class{paths;constructor(e){this.paths=e??H()}async probe(e=1e3){let i=await this.readAuth();if(!i)return{kind:"not-running"};try{let a=await this.fetch(i,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...i}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:df(a)}}}async request(e){let i=await this.readAuth();if(!i)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(i,e)}async readAuth(){try{let[e,i]=await Promise.all([To(this.paths.portFile,"utf8"),To(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),x=i.trim();return!Number.isFinite(a)||a<=0||!x?null:{port:a,token:x}}catch(e){if(e.code==="ENOENT")return null;throw e}}async fetch(e,i){let a=i.body!==void 0,x={Authorization:`Bearer ${e.token}`};a&&(x["content-type"]="application/json");let f=new AbortController,u=setTimeout(()=>f.abort(),i.timeoutMs??5e3);try{let h=await fetch(`http://127.0.0.1:${e.port}${i.path}`,{method:i.method,headers:x,body:a?JSON.stringify(i.body):void 0,signal:f.signal}),p=await h.text();return{status:h.status,body:uf(p)}}finally{clearTimeout(u)}}};function uf(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function df(r){return r instanceof Error?r.message:String(r)}U();ce();import{copyFile as Lo,mkdir as lf,readFile as Fr,writeFile as hf}from"node:fs/promises";import{dirname as gf,resolve as Ur,sep as qn}from"node:path";import{fileURLToPath as pf}from"node:url";U();ce();var No=T("dist-install");function mf(r){let e=pf(r),i=gf(e),a=`${qn}src${qn}`;if(i.includes(a)||i.endsWith(`${qn}src${qn}cli`))return null;let x=Ur(i,"index.js"),f=Ur(i,"..","package.json");return{dist:x,pkgJson:f}}async function Oo(r={}){let e=r.paths??H(),i=mf(import.meta.url),a=r.sourceDist??i?.dist,x=r.sourcePackageJson??i?.pkgJson;if(!a||!x)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let f;try{f=JSON.parse(await Fr(x,"utf8")).version??"unknown"}catch(y){return No.warn("cannot read source package.json,skip dist install",{err:String(y)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(y)}`}}let u=await fn(e.configFile)??{},h=u.libVersion;if(h===f)try{return await Fr(e.libEntry),{kind:"already-current",libVersion:f}}catch{}await lf(e.libDir,{recursive:!0}),await Lo(a,e.libEntry),await Lo(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let p=Ur(e.libDir,"package.json"),w=`${JSON.stringify({type:"module"},null,2)}
91
+ `;return await Fr(p,"utf8").catch(()=>null)!==w&&await hf(p,w),u.libVersion=f,await At(u,e.configFile),No.info("dist installed",{libEntry:e.libEntry,fromVersion:h,toVersion:f}),h?{kind:"version-changed",fromVersion:h,toVersion:f,libEntry:e.libEntry}:{kind:"first-install",libVersion:f,libEntry:e.libEntry}}var Rf=T("cli");function yt(r,e){let i=[],a;for(let x=0;x<r.length;x++){let f=r[x];if(f===e){a=r[x+1],x+=1;continue}if(f.startsWith(`${e}=`)){a=f.slice(e.length+1);continue}i.push(f)}return{value:a,rest:i}}function Mf(r){let e=r.slice(2);if(e.includes("--daemon"))return{mode:"daemon"};if(e.includes("--status"))return{mode:"status"};if(e.includes("--stop"))return{mode:"stop"};if(e.includes("--refresh"))return{mode:"refresh"};if(e.includes("--uninstall"))return{mode:"uninstall"};if(e.includes("--install-service"))return{mode:"install-service"};if(e.includes("--help")||e.includes("-h")||e.length===0)return{mode:"help"};let i=e,{value:a,rest:x}=yt(i,"--pat-token");i=x;let{value:f,rest:u}=yt(i,"--pair-code");i=u;let{value:h,rest:p}=yt(i,"--env");i=p;let{value:w,rest:b}=yt(i,"--handshake-url");i=b;let{value:y,rest:E}=yt(i,"--frontier-url");i=E;let{value:P}=yt(i,"--agent-id");if(!a||!f)return{mode:"help"};let I={mode:"pair",privatecode:a,pairingCode:f};return h&&(I.env=h),w&&(I.handshakeUrl=w),y&&(I.frontierUrl=y),P&&(I.agentId=P),I}var zf=`
92
92
  coze-bridge - local bridge daemon for cloud Agent Service
93
93
 
94
94
  Usage:
@@ -107,38 +107,42 @@ Environment routing (optional, per-pair, not persisted):
107
107
  --handshake-url <url> override HTTP base (default https://www.coze.cn)
108
108
  --frontier-url <url> override Frontier WS URL (default wss://frontier.coze.cn)
109
109
 
110
- Example: npx -y coze-bridge --pat-token=sat_xxx --pair-code=xxx --env=ppe_xxx
110
+ Auto-connect agent (optional):
111
+ --agent-id <id> pair \u540E\u81EA\u52A8 connect \u6307\u5B9A agent \u2014 \u672C\u5730\u5DF2\u6709\u8D70 reconnect/
112
+ revive, \u6CA1\u6709\u8D70 _agent/detail \u62C9\u4E91\u7AEF\u8BE6\u60C5\u7136\u540E\u672C\u5730\u65B0\u5EFA
113
+
114
+ Example: npx -y coze-bridge --pat-token=sat_xxx --pair-code=xxx --env=ppe_xxx --agent-id=7639628097007927571
111
115
 
112
116
  Internal:
113
117
  <node> <entry> --daemon daemon mode (OS supervisor only)
114
- `.trimStart();async function Uo(r=process.argv,e={}){let o=Ru(r);switch(o.mode){case"help":return process.stdout.write(Mu),0;case"daemon":{try{await Po()}catch(a){return Nu.error("daemon start failed",{err:String(a)}),1}return new Promise(()=>{})}case"status":return Ou(e);case"stop":return Bu(e);case"refresh":return zu(e);case"uninstall":return qu(e);case"install-service":return Uu();case"pair":{let a={};return o.env&&(a.env=o.env),o.handshakeUrl&&(a.handshakeUrl=o.handshakeUrl),o.frontierUrl&&(a.frontierUrl=o.frontierUrl),Fu(o.privatecode,o.pairingCode,e,a)}}}async function Ou(r){let e=new je(r.paths),o=await e.probe();if(o.kind==="not-running")return process.stdout.write(`coze-bridge: not running
115
- `),1;if(o.kind==="stale")return process.stdout.write(`coze-bridge: stale (${o.reason})
118
+ `.trimStart();async function Fo(r=process.argv,e={}){let i=Mf(r);switch(i.mode){case"help":return process.stdout.write(zf),0;case"daemon":{try{await Po()}catch(a){return Rf.error("daemon start failed",{err:String(a)}),1}return new Promise(()=>{})}case"status":return qf(e);case"stop":return Ff(e);case"refresh":return Uf(e);case"uninstall":return Kf(e);case"install-service":return Hf();case"pair":{let a={};return i.env&&(a.env=i.env),i.handshakeUrl&&(a.handshakeUrl=i.handshakeUrl),i.frontierUrl&&(a.frontierUrl=i.frontierUrl),Wf(i.privatecode,i.pairingCode,e,a,i.agentId)}}}async function qf(r){let e=new je(r.paths),i=await e.probe();if(i.kind==="not-running")return process.stdout.write(`coze-bridge: not running
119
+ `),1;if(i.kind==="stale")return process.stdout.write(`coze-bridge: stale (${i.reason})
116
120
  `),1;let a=await e.request({method:"GET",path:"/status"});return process.stdout.write(`coze-bridge: running
117
121
  ${JSON.stringify(a.body,null,2)}
118
- `),0}async function Bu(r){let e=new je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running
122
+ `),0}async function Ff(r){let e=new je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running
119
123
  `),0;try{return await e.request({method:"POST",path:"/shutdown"}),process.stdout.write(`coze-bridge: stopped
120
124
  `),0}catch(a){return process.stdout.write(`coze-bridge: stop failed: ${String(a)}
121
- `),1}}async function zu(r){let e=new je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running (start daemon first)
125
+ `),1}}async function Uf(r){let e=new je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running (start daemon first)
122
126
  `),1;try{let a=await e.request({method:"POST",path:"/refresh"});return a.status===200?(process.stdout.write(`coze-bridge: refreshed
123
127
  ${JSON.stringify(a.body,null,2)}
124
128
  `),0):(process.stderr.write(`coze-bridge: refresh failed: ${JSON.stringify(a.body)}
125
129
  `),1)}catch(a){return process.stderr.write(`coze-bridge: refresh failed: ${String(a)}
126
- `),1}}async function qu(r){let e=new je(r.paths);if((await e.probe()).kind==="connected"){process.stdout.write(`coze-bridge: stopping daemon...
127
- `);try{await e.request({method:"POST",path:"/shutdown"})}catch(u){process.stderr.write(`coze-bridge: stop failed (continuing): ${String(u)}
128
- `)}await new Promise(u=>setTimeout(u,500))}if(!r.skipSupervisor)try{let{getSupervisor:u,buildContext:l}=await Promise.resolve().then(()=>(jr(),Wr)),p=u();await p.uninstall(l()),process.stdout.write(`coze-bridge: ${p.platform} supervisor unregistered
129
- `)}catch(u){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(u)}
130
- `)}let a=r.paths??W(),{rm:c}=await import("node:fs/promises");try{await c(a.cozeRoot,{recursive:!0,force:!0}),process.stdout.write(`coze-bridge: removed ${a.cozeRoot}
131
- `)}catch(u){return process.stderr.write(`coze-bridge: remove failed: ${String(u)}
130
+ `),1}}async function Kf(r){let e=new je(r.paths);if((await e.probe()).kind==="connected"){process.stdout.write(`coze-bridge: stopping daemon...
131
+ `);try{await e.request({method:"POST",path:"/shutdown"})}catch(f){process.stderr.write(`coze-bridge: stop failed (continuing): ${String(f)}
132
+ `)}await new Promise(f=>setTimeout(f,500))}if(!r.skipSupervisor)try{let{getSupervisor:f,buildContext:u}=await Promise.resolve().then(()=>(Vr(),Jr)),h=f();await h.uninstall(u()),process.stdout.write(`coze-bridge: ${h.platform} supervisor unregistered
133
+ `)}catch(f){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(f)}
134
+ `)}let a=r.paths??H(),{rm:x}=await import("node:fs/promises");try{await x(a.cozeRoot,{recursive:!0,force:!0}),process.stdout.write(`coze-bridge: removed ${a.cozeRoot}
135
+ `)}catch(f){return process.stderr.write(`coze-bridge: remove failed: ${String(f)}
132
136
  `),1}return process.stdout.write(`coze-bridge: uninstalled
133
- `),0}async function Uu(){try{let{getSupervisor:r,buildContext:e}=await Promise.resolve().then(()=>(jr(),Wr)),o=r(),a=e();return process.stdout.write(`coze-bridge: installing ${o.platform} supervisor...
134
- `),await o.install(a),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
137
+ `),0}async function Hf(){try{let{getSupervisor:r,buildContext:e}=await Promise.resolve().then(()=>(Vr(),Jr)),i=r(),a=e();return process.stdout.write(`coze-bridge: installing ${i.platform} supervisor...
138
+ `),await i.install(a),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
135
139
  `),0}catch(r){return process.stderr.write(`coze-bridge: --install-service failed: ${String(r)}
136
- `),1}}async function Fu(r,e,o,a={}){let c=new je(o.paths),u=o.spawnDaemon??ko;if(!o.skipDistInstall){let m=await Ro({paths:o.paths});m.kind==="version-changed"?(process.stdout.write(`coze-bridge: upgraded ${m.fromVersion} \u2192 ${m.toVersion}
137
- `),(await c.probe()).kind==="connected"&&(await c.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(w=>setTimeout(w,500)))):m.kind==="first-install"&&process.stdout.write(`coze-bridge: installed ${m.libVersion}
138
- `)}let l=await c.probe();if(l.kind!=="connected"&&(process.stdout.write(`coze-bridge: starting daemon...
139
- `),await u({paths:o.paths}),l=await Ku(c,o.waitTimeoutMs??1e4,o.sleep??Hu),l.kind!=="connected"))return process.stderr.write(`coze-bridge: daemon did not come up: ${l.kind}
140
- `),1;let p={privatecode:r,pairing_code:e};a.env&&(p.env=a.env),a.handshakeUrl&&(p.handshake_url=a.handshakeUrl),a.frontierUrl&&(p.frontier_url=a.frontierUrl);try{let m=await c.request({method:"POST",path:"/pair",body:p});return m.status===200&&m.body?.ok?(process.stdout.write(`coze-bridge: paired (${m.body.note??"ok"})
141
- `),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(m.body)}
142
- `),1)}catch(m){return process.stderr.write(`coze-bridge: pair failed: ${String(m)}
143
- `),1}}async function Ku(r,e,o){let a=Date.now()+e;for(;Date.now()<a;){let c=await r.probe(500);if(c.kind==="connected")return c;await o(200)}return r.probe(500)}function Hu(r){return new Promise(e=>setTimeout(e,r))}Uo(process.argv).then(r=>process.exit(r),r=>{process.stderr.write(`fatal: ${r instanceof Error?r.stack??r.message:String(r)}
140
+ `),1}}async function Wf(r,e,i,a={},x){let f=new je(i.paths),u=i.spawnDaemon??Io;if(!i.skipDistInstall){let w=await Oo({paths:i.paths});w.kind==="version-changed"?(process.stdout.write(`coze-bridge: upgraded ${w.fromVersion} \u2192 ${w.toVersion}
141
+ `),(await f.probe()).kind==="connected"&&(await f.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(y=>setTimeout(y,500)))):w.kind==="first-install"&&process.stdout.write(`coze-bridge: installed ${w.libVersion}
142
+ `)}let h=await f.probe();if(h.kind!=="connected"&&(process.stdout.write(`coze-bridge: starting daemon...
143
+ `),await u({paths:i.paths}),h=await jf(f,i.waitTimeoutMs??1e4,i.sleep??Gf),h.kind!=="connected"))return process.stderr.write(`coze-bridge: daemon did not come up: ${h.kind}
144
+ `),1;let p={privatecode:r,pairing_code:e};a.env&&(p.env=a.env),a.handshakeUrl&&(p.handshake_url=a.handshakeUrl),a.frontierUrl&&(p.frontier_url=a.frontierUrl),x&&(p.agent_id=x);try{let w=await f.request({method:"POST",path:"/pair",body:p});return w.status===200&&w.body?.ok?(process.stdout.write(`coze-bridge: paired (${w.body.note??"ok"})
145
+ `),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(w.body)}
146
+ `),1)}catch(w){return process.stderr.write(`coze-bridge: pair failed: ${String(w)}
147
+ `),1}}async function jf(r,e,i){let a=Date.now()+e;for(;Date.now()<a;){let x=await r.probe(500);if(x.kind==="connected")return x;await i(200)}return r.probe(500)}function Gf(r){return new Promise(e=>setTimeout(e,r))}Fo(process.argv).then(r=>process.exit(r),r=>{process.stderr.write(`fatal: ${r instanceof Error?r.stack??r.message:String(r)}
144
148
  `),process.exit(1)});