univer-cli 0.1.8 → 0.1.9

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.
@@ -1 +0,0 @@
1
- const _0x36aff2=_0x2520;(function(_0x55e456,_0xa2b9b6){const _0x35c70a=_0x2520,_0x3a6ffb=_0x55e456();while(!![]){try{const _0x128d26=parseInt(_0x35c70a(0x165))/0x1*(-parseInt(_0x35c70a(0x25b))/0x2)+-parseInt(_0x35c70a(0x189))/0x3*(-parseInt(_0x35c70a(0x276))/0x4)+-parseInt(_0x35c70a(0x2aa))/0x5*(-parseInt(_0x35c70a(0x28d))/0x6)+parseInt(_0x35c70a(0x16f))/0x7+parseInt(_0x35c70a(0x1dd))/0x8*(parseInt(_0x35c70a(0x2ae))/0x9)+-parseInt(_0x35c70a(0x237))/0xa+parseInt(_0x35c70a(0x1ef))/0xb*(-parseInt(_0x35c70a(0x305))/0xc);if(_0x128d26===_0xa2b9b6)break;else _0x3a6ffb['push'](_0x3a6ffb['shift']());}catch(_0x141e59){_0x3a6ffb['push'](_0x3a6ffb['shift']());}}}(_0x17c6,0x74fd6));import{o as _0x2f1ff1}from'./rolldown-runtime-D8j-JhcR.js';import{gn as _0x15c0a0}from'./vendor-DjomC5bd.js';import{a as _0x5d4d91,i as _0x342520,n as _0x1c4023,o as _0xa72db0,r as _0x5b3da3}from'./trace-DPfd8LdJ.js';import{fork as _0x5216c6,spawn as _0x2cbe4a}from'node:child_process';import{constants as _0xda507d,existsSync as _0x3408b8,mkdirSync as _0x1d2bf4,readFileSync as _0x3aca60}from'node:fs';import{access as _0x4c0e27,appendFile as _0x5d4cf5,mkdir as _0x3e1c0c,readFile as _0x1cbf14,readdir as _0x1b8daa,realpath as _0x245e41,rename as _0x48a321,rm as _0x38a832,stat as _0x4ea62a,writeFile as _0x3af822}from'node:fs/promises';import{basename as _0x4f5863,dirname as _0x37fe88,extname as _0x1f02a0,join as _0x37d775,resolve as _0x36a426}from'node:path';import{fileURLToPath as _0x51abce,pathToFileURL as _0x3e1266}from'node:url';import{createRequire as _0x228c0a}from'node:module';import{hostname as _0x1b1ff5}from'node:os';import{createHash as _0x422e06,randomUUID as _0xc88da5}from'node:crypto';import _0x1b07d7 from'node:net';import _0x1a7e61 from'node:process';import{EventEmitter as _0x3b474e}from'node:events';const x={'Health':_0x36aff2(0x232),'Shutdown':'daemon.shutdown','SessionCreateWorkbook':'session.createWorkbook','SessionEvalJs':_0x36aff2(0x21c),'SessionExportWorkbookFile':_0x36aff2(0x210),'SessionExportWorkbookData':_0x36aff2(0x1b7),'SessionDispose':_0x36aff2(0x228),'SessionGetWorkbook':'session.getWorkbook','SessionLoadWorkbook':_0x36aff2(0x19e),'SessionLoadWorkbookDataReplayPack':_0x36aff2(0x27f)};var ge=class{[_0x36aff2(0x302)](_0x2242f2){}[_0x36aff2(0x24c)](_0x4b83a6){}[_0x36aff2(0x19b)](_0x5b571b){}[_0x36aff2(0x2c8)](_0x1379a2){}['event'](_0x5ce051){}async[_0x36aff2(0x1b6)](){}};function _e(_0x3bb285,_0x595733=new Date()){const _0x30b2ed=_0x36aff2;let _0x1a4b44=_0x1c4023[_0x30b2ed(0x1c2)]();return{'time':_0x595733[_0x30b2ed(0x29b)](),'level':_0x3bb285['level']??'info','event_name':_0x3bb285[_0x30b2ed(0x1ce)],'component':_0x3bb285[_0x30b2ed(0x22d)],'process_role':_0x3bb285[_0x30b2ed(0x28a)],'pid':process[_0x30b2ed(0x28b)],..._0x3bb285[_0x30b2ed(0x29d)]===void 0x0?{}:{'message':_0x3bb285['message']},..._0x1a4b44===void 0x0?{}:{'trace_id':_0x1a4b44['traceId'],'span_id':_0x1a4b44[_0x30b2ed(0x2c3)],'trace_flags':_0x1a4b44['traceFlags'],..._0x1a4b44[_0x30b2ed(0x1c9)]===void 0x0?{}:{'parent_span_id':_0x1a4b44[_0x30b2ed(0x1c9)]}},..._0x3bb285[_0x30b2ed(0x2c8)]===void 0x0?{}:{'error':ve(_0x3bb285['error'])},..._0x3bb285[_0x30b2ed(0x288)]??{}};}function ve(_0x503c72){const _0x3ae501=_0x36aff2;return _0x503c72 instanceof Error?{'message':_0x503c72[_0x3ae501(0x29d)],'name':_0x503c72[_0x3ae501(0x2b5)],...be(_0x503c72),..._0x503c72['stack']===void 0x0?{}:{'stack':_0x503c72[_0x3ae501(0x1c4)]},...ye(_0x503c72)}:{'message':typeof _0x503c72==_0x3ae501(0x23b)?_0x503c72:JSON['stringify'](_0x503c72)};}function ye(_0x35ee12){const _0x571d75=_0x36aff2;let _0x3a919f=_0x35ee12;return typeof _0x3a919f[_0x571d75(0x27b)]=='string'?{'code':_0x3a919f[_0x571d75(0x27b)]}:{};}function be(_0x3433f7){const _0x1ffdc6=_0x36aff2;let _0x431476=_0x3433f7;return _0x431476[_0x1ffdc6(0x213)]===null||typeof _0x431476['logFields']!='object'||Array[_0x1ffdc6(0x2d9)](_0x431476[_0x1ffdc6(0x213)])?{}:{'details':_0x431476[_0x1ffdc6(0x213)]};}var xe=_0x2f1ff1(_0x15c0a0(),0x1)[_0x36aff2(0x2f5)],Se=0xa*0x400*0x400,Ce=0x5,we=0x3e8,Te=class{[_0x36aff2(0x1c0)];['ready'];[_0x36aff2(0x1aa)];[_0x36aff2(0x181)];['maxArchiveFiles'];[_0x36aff2(0x1df)];[_0x36aff2(0x17a)];[_0x36aff2(0x280)]=!0x1;['nextRotationCheckAt']=0x0;[_0x36aff2(0x2da)];[_0x36aff2(0x223)]=!0x1;constructor(_0x2d6110){const _0x3132e1=_0x36aff2;this[_0x3132e1(0x1aa)]=_0x2d6110[_0x3132e1(0x1aa)]===!0x0,this[_0x3132e1(0x181)]=_0x2d6110[_0x3132e1(0x181)],this[_0x3132e1(0x22e)]=_0x2d6110[_0x3132e1(0x22e)]??Ce,this['maxBytes']=_0x2d6110[_0x3132e1(0x1df)]??Se,this['rotationCheckIntervalMs']=_0x2d6110[_0x3132e1(0x17a)]??we,this['destination']=new xe({'dest':_0x2d6110['logPath'],'mkdir':!0x0,'sync':!0x1}),this[_0x3132e1(0x304)]=new Promise(_0x3a1c2d=>{const _0x2e910e=_0x3132e1;this['destination'][_0x2e910e(0x2ba)](_0x2e910e(0x304),()=>{_0x3a1c2d();}),this[_0x2e910e(0x1c0)][_0x2e910e(0x2ba)](_0x2e910e(0x2c8),()=>{_0x3a1c2d();});});}['debug'](_0x134cb0){const _0x37fe49=_0x36aff2;this[_0x37fe49(0x1ff)]({..._0x134cb0,'level':_0x37fe49(0x302)});}[_0x36aff2(0x24c)](_0x181497){const _0x20726a=_0x36aff2;this['event']({..._0x181497,'level':_0x20726a(0x24c)});}[_0x36aff2(0x19b)](_0x1c8470){const _0x31e0a7=_0x36aff2;this[_0x31e0a7(0x1ff)]({..._0x1c8470,'level':'warn'});}[_0x36aff2(0x2c8)](_0x3a3b62){const _0x563a86=_0x36aff2;this[_0x563a86(0x1ff)]({..._0x3a3b62,'level':_0x563a86(0x2c8)});}[_0x36aff2(0x1ff)](_0xd64622){const _0x4de78a=_0x36aff2;if(!(this[_0x4de78a(0x280)]||this[_0x4de78a(0x223)]))try{this['saturated']=!this['destination'][_0x4de78a(0x2bd)](JSON[_0x4de78a(0x188)](_e(_0xd64622))+'\x0a'),this[_0x4de78a(0x223)]&&this['destination']['once']('drain',()=>{const _0x1bb4ee=_0x4de78a;this[_0x1bb4ee(0x223)]=!0x1;}),this[_0x4de78a(0x23c)]();}catch{}}async[_0x36aff2(0x1b6)](){const _0x2a0029=_0x36aff2;this[_0x2a0029(0x280)]||(await this[_0x2a0029(0x304)],await new Promise(_0x70ac91=>{const _0x170b9d=_0x2a0029;this[_0x170b9d(0x1c0)][_0x170b9d(0x1b6)](()=>{_0x70ac91();});}),await this['rotationInFlight'],this[_0x2a0029(0x1aa)]&&(this[_0x2a0029(0x280)]=!0x0,this[_0x2a0029(0x1c0)][_0x2a0029(0x206)]()));}[_0x36aff2(0x23c)](){const _0x37e3ea=_0x36aff2;let _0x9d5414=Date['now']();this[_0x37e3ea(0x2da)]!==void 0x0||_0x9d5414<this[_0x37e3ea(0x275)]||(this[_0x37e3ea(0x275)]=_0x9d5414+this[_0x37e3ea(0x17a)],this[_0x37e3ea(0x2da)]=this['rotateIfNeeded']()['catch'](()=>{})[_0x37e3ea(0x174)](()=>{this['rotationInFlight']=void 0x0;}));}async[_0x36aff2(0x307)](){const _0x4cbd94=_0x36aff2;await this['ready'],await je({'logPath':this['logPath'],'maxArchiveFiles':this['maxArchiveFiles'],'maxBytes':this[_0x4cbd94(0x1df)],'flush':async()=>{await new Promise(_0x351632=>{const _0x4020ac=_0x2520;this[_0x4020ac(0x1c0)]['flush'](()=>{_0x351632();});});}})&&!this[_0x4cbd94(0x280)]&&this['destination']['reopen'](this[_0x4cbd94(0x181)]);}};function Ee(_0x3c24dc){return new Te(_0x3c24dc);}function De(_0x1cc769){let {env:_0x5d3c0f,role:_0x58b7dc,..._0x525204}=_0x1cc769,_0x4e3d95=S(_0x5d3c0f);return Ee({..._0x525204,'logPath':ke(_0x4e3d95,_0x58b7dc)});}function Oe(_0x548a80=process.env){const _0x37455c=_0x36aff2;let _0x266e3f=_0x548a80[_0x37455c(0x1d8)]?.[_0x37455c(0x230)]();if(_0x266e3f)return _0x36a426(_0x266e3f);let _0x20e684=_0x548a80['HOME']?.['trim']()||_0x548a80[_0x37455c(0x1e2)]?.[_0x37455c(0x230)]();if(!_0x20e684)throw Error(_0x37455c(0x1c1));return _0x36a426(_0x20e684,_0x37455c(0x1c5));}function S(_0x3f495b=process.env){const _0xde6e5d=_0x36aff2;let _0x34cd6a=Oe(_0x3f495b),_0x57eb26=_0x37d775(_0x34cd6a,_0xde6e5d(0x282));return{'homeDir':_0x34cd6a,'logsDir':_0x57eb26,'cliLogPath':_0x37d775(_0x57eb26,'cli.jsonl'),'daemonLogPath':_0x37d775(_0x57eb26,'daemon.jsonl'),'runtimeLogPath':_0x37d775(_0x57eb26,'runtime.jsonl'),'viewHostLogPath':_0x37d775(_0x57eb26,_0xde6e5d(0x26c))};}function ke(_0x59502f,_0x4f7173){const _0xb470f8=_0x36aff2;switch(_0x4f7173){case _0xb470f8(0x308):return _0x59502f[_0xb470f8(0x25c)];case _0xb470f8(0x1a3):return _0x59502f['daemonLogPath'];case _0xb470f8(0x2f0):return _0x59502f[_0xb470f8(0x21b)];case _0xb470f8(0x25d):return _0x59502f['viewHostLogPath'];}}async function Ae(_0x3b14e0,_0x476263){const _0x1c7c80=_0x36aff2;await _0x3e1c0c(_0x37fe88(_0x3b14e0),{'recursive':!0x0,'mode':0x1c0}),await _0x5d4cf5(_0x3b14e0,_0x476263+'\x0a',_0x1c7c80(0x216));try{await je({'logPath':_0x3b14e0,'maxArchiveFiles':Ce,'maxBytes':Se});}catch{}}async function je(_0x14077a){const _0x532419=_0x36aff2;if(_0x14077a[_0x532419(0x1df)]<=0x0)return!0x1;await _0x14077a[_0x532419(0x1b6)]?.();let _0x5d9f9d;try{_0x5d9f9d=await _0x4ea62a(_0x14077a[_0x532419(0x181)]);}catch{return!0x1;}if(!_0x5d9f9d['isFile']()||_0x5d9f9d[_0x532419(0x1bc)]<_0x14077a[_0x532419(0x1df)])return!0x1;let _0x482cd1=_0x37d775(_0x37fe88(_0x14077a[_0x532419(0x181)]),_0x532419(0x2e4));await _0x3e1c0c(_0x482cd1,{'recursive':!0x0,'mode':0x1c0});let _0xb565c2=_0x37d775(_0x482cd1,_0x4f5863(_0x14077a['logPath'])+'.'+Ne(new Date())+'.'+process[_0x532419(0x28b)]);try{await _0x48a321(_0x14077a[_0x532419(0x181)],_0xb565c2);}catch{return!0x1;}return await Me({'archiveDir':_0x482cd1,'maxArchiveFiles':_0x14077a['maxArchiveFiles'],'prefix':_0x4f5863(_0x14077a[_0x532419(0x181)])+'.'}),!0x0;}async function Me(_0x57f42e){const _0x5ba87a=_0x36aff2;if(_0x57f42e['maxArchiveFiles']<0x0)return;let _0x149cec;try{_0x149cec=await _0x1b8daa(_0x57f42e[_0x5ba87a(0x177)]);}catch{return;}let _0x3bf1c5=_0x149cec[_0x5ba87a(0x18c)](_0x1d362d=>_0x1d362d[_0x5ba87a(0x24e)](_0x57f42e[_0x5ba87a(0x1e8)]))['sort']()[_0x5ba87a(0x286)]();await Promise[_0x5ba87a(0x190)](_0x3bf1c5['slice'](_0x57f42e[_0x5ba87a(0x22e)])[_0x5ba87a(0x1d5)](async _0x20d546=>await _0x38a832(_0x37d775(_0x57f42e['archiveDir'],_0x20d546),{'force':!0x0})));}function Ne(_0x2b5c54){const _0x540257=_0x36aff2;return _0x2b5c54[_0x540257(0x29b)]()[_0x540257(0x2bc)](/[^0-9A-Za-z]/gu,'');}var Pe=0x46,Fe=_0x36aff2(0x245);function Ie(_0x333da6=process.env){const _0x2f40fe=_0x36aff2;let _0x2f502b=_0x333da6[_0x2f40fe(0x1d8)]?.[_0x2f40fe(0x230)]();if(_0x2f502b)return _0x36a426(_0x2f502b);let _0x312d4d=_0x333da6[_0x2f40fe(0x1ba)]?.[_0x2f40fe(0x230)]()||_0x333da6[_0x2f40fe(0x1e2)]?.[_0x2f40fe(0x230)]();if(!_0x312d4d)throw Error(_0x2f40fe(0x1c1));return _0x36a426(_0x312d4d,_0x2f40fe(0x1c5));}function C(_0x17704b=process.env){const _0x244926=_0x36aff2;let _0x2d0178=Ie(_0x17704b),_0x2d2ce4=_0x37d775(_0x2d0178,_0x244926(0x1a3)),_0x45f3c3=_0x37d775(_0x2d0178,_0x244926(0x252)),_0x4b17f2=S(_0x17704b),_0xfcba5d=Le(_0x2d0178);return{'homeDir':_0x2d0178,'daemonDir':_0x2d2ce4,'logsDir':_0x4b17f2['logsDir'],'daemonLogPath':_0x4b17f2[_0x244926(0x24a)],'sessionRoot':_0x45f3c3,'socketPath':_0xfcba5d,'pidPath':_0x37d775(_0x2d2ce4,_0x244926(0x23d)),'metaPath':_0x37d775(_0x2d2ce4,'daemon.meta.json'),'lockPath':_0x37d775(_0x2d2ce4,_0x244926(0x24b))};}function Le(_0x515183,_0xb3560e=process[_0x36aff2(0x207)]){const _0x1a2f2e=_0x36aff2;let _0x57af38=_0x37d775(_0x515183,'daemon','daemon.sock');return _0xb3560e===_0x1a2f2e(0x203)?Fe+_0x1a2f2e(0x2fe)+ze(_0x57af38):_0x57af38[_0x1a2f2e(0x2a0)]<=Pe?_0x57af38:_0x37d775('/tmp',_0x1a2f2e(0x1e9)+ze(_0x57af38)+_0x1a2f2e(0x208));}function w(_0x50ae2e){const _0x3f80f0=_0x36aff2;return _0x50ae2e[_0x3f80f0(0x24e)](Fe);}function Re(_0x2f99ef,_0x3d38ec=process.env){const _0x14c50d=_0x36aff2;let _0x28425a=_0x37d775(C(_0x3d38ec)[_0x14c50d(0x218)],_0x2f99ef);return{'sessionDir':_0x28425a,'tracePath':S(_0x3d38ec)[_0x14c50d(0x21b)],'stderrPath':_0x37d775(_0x28425a,'stderr.log')};}function ze(_0x2fffda){const _0x5775fc=_0x36aff2;return _0x422e06('sha1')[_0x5775fc(0x266)](_0x2fffda)[_0x5775fc(0x2b6)]('hex')[_0x5775fc(0x17f)](0x0,0x10);}var Be=0x3a98,Ve=0x7530;async function T(_0x47ce3f={}){const _0xd2effe=_0x36aff2;return await D({'jsonrpc':_0xd2effe(0x20f),'id':k(),'method':x['Health']},{..._0x47ce3f,'autoStart':!0x1});}async function E(_0x20e4ac={}){const _0x3e2035=_0x36aff2;let _0x25dadd=_0x20e4ac[_0x3e2035(0x1a5)]??_0x1a7e61['env'],{readDaemonBuildId:_0xebbb4a}=await import(_0x3e2035(0x1d0)),_0x18c95f=_0xebbb4a(_0x25dadd);try{let _0x10d799=await T({..._0x20e4ac,'autoStart':!0x1});return lt(_0x18c95f,_0x10d799[_0x3e2035(0x29a)]),_0x10d799;}catch(_0x30f4a9){if(_0x20e4ac[_0x3e2035(0x271)]===!0x1)throw _0x30f4a9;}let _0x4f5c3f=await it(_0x25dadd,_0x18c95f,_0x20e4ac[_0x3e2035(0x2d1)]),_0x1ae803=_0x20e4ac[_0x3e2035(0x2cc)]??Be,_0x109255=Date[_0x3e2035(0x26f)]()+_0x1ae803,_0x4c692d;for(;Date[_0x3e2035(0x26f)]()<_0x109255;)try{let _0x3e5111=await T({..._0x20e4ac,'autoStart':!0x1});return lt(_0x18c95f,_0x3e5111[_0x3e2035(0x29a)]),_0x3e5111;}catch(_0x1db083){_0x4c692d=_0x1db083,await ft(0x64);}throw Error([_0x3e2035(0x254)+_0x1ae803+'ms',_0x3e2035(0x2a8)+_0x4f5c3f['command']+'\x20'+_0x4f5c3f[_0x3e2035(0x1a9)][_0x3e2035(0x20b)]('\x20'),'last\x20health\x20error:\x20'+dt(_0x4c692d)][_0x3e2035(0x20b)](';\x20'));}async function He(_0x5429ad={}){const _0x5cb4b3=_0x36aff2;let _0xfd03f0=C(_0x5429ad[_0x5cb4b3(0x1a5)]??_0x1a7e61[_0x5cb4b3(0x1a5)]);try{return $e(await T({..._0x5429ad,'autoStart':!0x1}),_0xfd03f0);}catch(_0xd4fcee){return rt(_0xfd03f0)?tt(_0xfd03f0,_0xd4fcee):et(_0xfd03f0);}}async function Ue(_0x56aa83={}){return await E(_0x56aa83);}function _0x2520(_0x29c34b,_0x45ec12){_0x29c34b=_0x29c34b-0x165;const _0x17c6ee=_0x17c6();let _0x2520f3=_0x17c6ee[_0x29c34b];return _0x2520f3;}async function We(_0x2815a3={}){const _0x71f155=_0x36aff2;let _0x43d776=C(_0x2815a3[_0x71f155(0x1a5)]??_0x1a7e61[_0x71f155(0x1a5)]);try{await D({'jsonrpc':'2.0','id':k(),'method':x[_0x71f155(0x295)]},{..._0x2815a3,'autoStart':!0x1});}catch{await ot(_0x43d776['socketPath']),await _0x38a832(_0x43d776[_0x71f155(0x2f1)],{'force':!0x0})['catch'](()=>void 0x0),await _0x38a832(_0x43d776[_0x71f155(0x1eb)],{'force':!0x0})[_0x71f155(0x178)](()=>void 0x0),await _0x38a832(_0x43d776[_0x71f155(0x1e1)],{'recursive':!0x0,'force':!0x0})[_0x71f155(0x178)](()=>void 0x0);return;}let _0x1b8a97=Date[_0x71f155(0x26f)]()+(_0x2815a3[_0x71f155(0x2cc)]??Be);for(;Date[_0x71f155(0x26f)]()<_0x1b8a97;){if(!at(_0x43d776['socketPath'])&&!_0x3408b8(_0x43d776['pidPath'])&&!_0x3408b8(_0x43d776['metaPath']))return;await ft(0x64);}throw Error(_0x71f155(0x1f4));}async function Ge(_0x4550c0,_0x4c4218,_0x2e8856={}){const _0x1795de=_0x36aff2;return await E(_0x2e8856),await D({'jsonrpc':'2.0','id':k(),'method':x[_0x1795de(0x193)],'params':{'workbookPath':_0x4550c0,'workbookData':_0x4c4218,'cwd':_0x2e8856[_0x1795de(0x191)]}},_0x2e8856);}async function Ke(_0x21aa7a,_0x25f9b0,_0x59fbbb={}){const _0x58cec7=_0x36aff2;return await E(_0x59fbbb),await D({'jsonrpc':'2.0','id':k(),'method':x['SessionLoadWorkbookDataReplayPack'],'params':{'workbookPath':_0x21aa7a,'cwd':_0x59fbbb[_0x58cec7(0x191)],'baseWorkbookData':_0x25f9b0['baseWorkbookData'],'mutations':_0x25f9b0[_0x58cec7(0x1fe)]}},_0x59fbbb);}async function qe(_0x4e8a7f,_0x52650e={}){const _0x8157fc=_0x36aff2;return await E(_0x52650e),await D({'jsonrpc':_0x8157fc(0x20f),'id':k(),'method':x[_0x8157fc(0x16e)],'params':{'workbookPath':_0x4e8a7f,'cwd':_0x52650e['cwd']}},_0x52650e);}async function Je(_0x48e84a,_0x4410a8={}){const _0x329f5e=_0x36aff2;return await E(_0x4410a8),await D({'jsonrpc':_0x329f5e(0x20f),'id':k(),'method':x[_0x329f5e(0x289)],'params':{'workbookPath':_0x48e84a,'cwd':_0x4410a8['cwd'],'id':_0x4410a8['id'],'name':_0x4410a8[_0x329f5e(0x2b5)]}},_0x4410a8);}async function Ye(_0x4cf2f5,_0xfa6a3d,_0x3357c8={}){const _0x36ab2b=_0x36aff2;return await E(_0x3357c8),await D({'jsonrpc':_0x36ab2b(0x20f),'id':k(),'method':x[_0x36ab2b(0x1ac)],'params':{'workbookPath':_0x4cf2f5,'code':_0xfa6a3d,'cwd':_0x3357c8[_0x36ab2b(0x191)],'mutates':_0x3357c8[_0x36ab2b(0x1d6)]}},_0x3357c8);}async function Xe(_0x3949c0,_0x1753a7={}){const _0x19e59a=_0x36aff2;return await E(_0x1753a7),await D({'jsonrpc':_0x19e59a(0x20f),'id':k(),'method':x[_0x19e59a(0x253)],'params':{'workbookPath':_0x3949c0,'cwd':_0x1753a7[_0x19e59a(0x191)]}},_0x1753a7);}async function Ze(_0x19310b,_0x1a84f7,_0x2764c0={}){const _0x2e1aea=_0x36aff2;return await E(_0x2764c0),await D({'jsonrpc':'2.0','id':k(),'method':x['SessionExportWorkbookFile'],'params':{'workbookPath':_0x19310b,'cwd':_0x2764c0[_0x2e1aea(0x191)],'format':_0x1a84f7[_0x2e1aea(0x285)],'outputPath':_0x1a84f7['outputPath']}},_0x2764c0);}async function Qe(_0x57b202,_0x27f940={}){const _0x4c6315=_0x36aff2;return await E(_0x27f940),await D({'jsonrpc':_0x4c6315(0x20f),'id':k(),'method':x['SessionDispose'],'params':{'workbookPath':_0x57b202,'cwd':_0x27f940[_0x4c6315(0x191)]}},_0x27f940);}async function D(_0x1a0328,_0x14f71c){const _0xb3b9db=_0x36aff2;return await _0x1c4023[_0xb3b9db(0x1f0)]({'name':_0xa72db0[_0xb3b9db(0x28c)],'kind':_0xb3b9db(0x2b2)},async()=>{const _0x1bf0d4=_0xb3b9db;let _0x20fb6f=C(_0x14f71c[_0x1bf0d4(0x1a5)]??_0x1a7e61['env']);w(_0x20fb6f[_0x1bf0d4(0x292)])||await _0x4c0e27(_0x20fb6f[_0x1bf0d4(0x292)],_0xda507d[_0x1bf0d4(0x22b)]);let _0x11f122=await ct(_0x20fb6f[_0x1bf0d4(0x292)],{..._0x1a0328,'meta':_0x1c4023[_0x1bf0d4(0x29c)](_0x1a0328['meta'])},_0x14f71c[_0x1bf0d4(0x2a2)]??Ve);if(_0x11f122[_0x1bf0d4(0x2c8)])throw Error(_0x11f122[_0x1bf0d4(0x2c8)][_0x1bf0d4(0x29d)]);return _0x11f122[_0x1bf0d4(0x277)];});}function $e(_0x13f722,_0xddebea){const _0x417322=_0x36aff2;return{'ok':!0x0,'daemon':{'state':_0x417322(0x248),'pid':_0x13f722[_0x417322(0x28b)],'runtimeRoot':_0x13f722['runtimeRoot'],'socketPath':_0x13f722[_0x417322(0x292)],'startedAt':_0x13f722[_0x417322(0x258)],'sessionCount':_0x13f722['sessionCount'],'buildId':_0x13f722[_0x417322(0x29a)]},'paths':O(_0xddebea),'next':[{'command':_0x417322(0x2b7),'reason':_0x417322(0x1e0)}],'diagnostics':[]};}function et(_0x31d2a4){const _0x146b66=_0x36aff2;return{'ok':!0x0,'daemon':nt(_0x146b66(0x24f),_0x31d2a4),'paths':O(_0x31d2a4),'next':[{'command':_0x146b66(0x1ee),'reason':_0x146b66(0x24d)}],'diagnostics':[]};}function tt(_0x4f71bf,_0x3f14dc){const _0x3f07a3=_0x36aff2;return{'ok':!0x0,'daemon':nt(_0x3f07a3(0x2f7),_0x4f71bf),'paths':O(_0x4f71bf),'next':[{'command':_0x3f07a3(0x2b7),'reason':'clear\x20stale\x20daemon\x20runtime\x20files'},{'command':_0x3f07a3(0x1ee),'reason':'start\x20a\x20fresh\x20daemon'}],'diagnostics':[{'message':_0x3f14dc instanceof Error?_0x3f14dc[_0x3f07a3(0x29d)]:String(_0x3f14dc)}]};}function nt(_0x55e30d,_0x276940){const _0x4bc222=_0x36aff2;return{'state':_0x55e30d,'pid':null,'runtimeRoot':_0x276940[_0x4bc222(0x1f1)],'socketPath':_0x276940[_0x4bc222(0x292)],'startedAt':null,'sessionCount':0x0,'buildId':null};}function O(_0x3925fb){const _0x5a811a=_0x36aff2;return{'metaPath':_0x3925fb[_0x5a811a(0x1eb)],'lockPath':_0x3925fb[_0x5a811a(0x1e1)]};}function rt(_0x948b11){const _0x1ca5e8=_0x36aff2;return at(_0x948b11[_0x1ca5e8(0x292)])||_0x3408b8(_0x948b11[_0x1ca5e8(0x2f1)])||_0x3408b8(_0x948b11[_0x1ca5e8(0x1eb)]);}async function it(_0x1499bf,_0x4e4f55,_0x3b19cf){const _0x52af28=_0x36aff2;let _0x21ba92=st(_0x3b19cf);return _0x1d2bf4(C(_0x1499bf)[_0x52af28(0x204)],{'recursive':!0x0,'mode':0x1c0}),_0x2cbe4a(_0x21ba92['command'],_0x21ba92[_0x52af28(0x1a9)],{..._0x21ba92[_0x52af28(0x191)]===void 0x0?{}:{'cwd':_0x21ba92['cwd']},'detached':!0x0,'stdio':[_0x52af28(0x1bf),_0x52af28(0x1bf),_0x52af28(0x1bf)],'env':ut(_0x1499bf,_0x4e4f55)})[_0x52af28(0x2d4)](),_0x21ba92;}function at(_0x431915){return w(_0x431915)?!0x1:_0x3408b8(_0x431915);}async function ot(_0x3867a2){const _0x3dc1de=_0x36aff2;w(_0x3867a2)||await _0x38a832(_0x3867a2,{'force':!0x0})[_0x3dc1de(0x178)](()=>void 0x0);}function st(_0xe54980){const _0x4d6a3a=_0x36aff2;if(_0xe54980===void 0x0)throw Error(_0x4d6a3a(0x16c));return{'command':_0xe54980['command']??_0x1a7e61[_0x4d6a3a(0x2d3)],..._0xe54980[_0x4d6a3a(0x191)]===void 0x0?{}:{'cwd':_0xe54980[_0x4d6a3a(0x191)]},'args':[..._0xe54980[_0x4d6a3a(0x1d4)]??[],_0xe54980[_0x4d6a3a(0x255)],..._0xe54980['args']??[_0x4d6a3a(0x265)]][_0x4d6a3a(0x1d5)](String)};}async function ct(_0x1ec199,_0xc9797a,_0x2bf6ae){return await new Promise((_0x28e99f,_0x50e1a3)=>{const _0x1b8082=_0x2520;let _0x25951a=_0x1b07d7[_0x1b8082(0x2fc)](_0x1ec199),_0x3763fa='',_0x4a53d7=setTimeout(()=>{const _0x1313fb=_0x1b8082;_0x25951a[_0x1313fb(0x1a1)](),_0x50e1a3(Error(_0x1313fb(0x2ad)+_0xc9797a[_0x1313fb(0x182)]));},_0x2bf6ae);_0x25951a['on'](_0x1b8082(0x27e),()=>{const _0x1a0203=_0x1b8082;_0x25951a[_0x1a0203(0x2bd)](JSON[_0x1a0203(0x188)](_0xc9797a)+'\x0a');}),_0x25951a['on'](_0x1b8082(0x1d9),_0x1bf946=>{const _0x84fc91=_0x1b8082;_0x3763fa+=_0x1bf946[_0x84fc91(0x234)](_0x84fc91(0x216));let _0x3d6987=_0x3763fa[_0x84fc91(0x27a)]('\x0a');_0x3d6987<0x0||(clearTimeout(_0x4a53d7),_0x25951a[_0x84fc91(0x206)](),_0x28e99f(JSON[_0x84fc91(0x2c9)](_0x3763fa[_0x84fc91(0x17f)](0x0,_0x3d6987)['trim']())));}),_0x25951a['on'](_0x1b8082(0x2c8),_0x10b8f3=>{clearTimeout(_0x4a53d7),_0x50e1a3(_0x10b8f3);});});}function lt(_0x410303,_0x34db1c){const _0x2569eb=_0x36aff2;if(_0x410303!==_0x34db1c)throw Error(_0x2569eb(0x202)+_0x410303+_0x2569eb(0x1a7)+_0x34db1c+_0x2569eb(0x215));}function ut(_0x3a1277,_0x3a46de){const _0x49d54e=_0x36aff2;let _0x3f1d2b={..._0x3a1277,'UNIVER_DAEMON_BUILD_ID_OVERRIDE':_0x3a46de};return delete _0x3f1d2b[_0x49d54e(0x2c1)],delete _0x3f1d2b['VITEST'],delete _0x3f1d2b[_0x49d54e(0x2d6)],delete _0x3f1d2b[_0x49d54e(0x172)],_0x3f1d2b;}function dt(_0x13ff18){const _0x2cc43=_0x36aff2;return _0x13ff18 instanceof Error?_0x13ff18[_0x2cc43(0x29d)]:String(_0x13ff18);}function k(){const _0xd47c4a=_0x36aff2;return _0xd47c4a(0x2e0)+Date[_0xd47c4a(0x26f)]()[_0xd47c4a(0x234)](0x24)+'-'+Math[_0xd47c4a(0x1cd)]()['toString'](0x10)[_0xd47c4a(0x17f)](0x2,0x8);}async function ft(_0x5c80b3){await new Promise(_0x47a7e1=>{setTimeout(_0x47a7e1,_0x5c80b3);});}var pt=0x1388,mt=0xea60,ht=class extends _0x3b474e{[_0x36aff2(0x175)];[_0x36aff2(0x2be)];[_0x36aff2(0x17d)]=new Map();[_0x36aff2(0x2a2)];[_0x36aff2(0x16b)]='';[_0x36aff2(0x168)]=_0x36aff2(0x303);constructor(_0x326a8c,_0x325e32){const _0x3063f6=_0x36aff2;super(),this[_0x3063f6(0x301)]=_0x326a8c,this[_0x3063f6(0x2be)]=_0x325e32[_0x3063f6(0x2be)]??pt,this['rpcTimeoutMs']=_0x325e32['rpcTimeoutMs']??mt,this['child']=_0x5216c6(_0x325e32['executionPlanePath'],[],{'cwd':_0x325e32['cwd'],'env':{...process.env,..._0x325e32['env'],'UNIVER_SESSION_ID':_0x326a8c},'execArgv':_0x325e32[_0x3063f6(0x1d4)],'stdio':[_0x3063f6(0x1bf),_0x3063f6(0x1bf),'pipe',_0x3063f6(0x2fd)]}),this[_0x3063f6(0x175)][_0x3063f6(0x16b)]?.['on'](_0x3063f6(0x1d9),_0x4333bf=>{const _0x1d2357=_0x3063f6;this[_0x1d2357(0x16b)]+=_0x4333bf[_0x1d2357(0x234)](),_0x325e32[_0x1d2357(0x200)]?.(_0x4333bf);}),this['child']['on'](_0x3063f6(0x29d),_0x174700=>{const _0x1a03a6=_0x3063f6;if(_0x174700[_0x1a03a6(0x28e)]===_0x1a03a6(0x304)&&(this[_0x1a03a6(0x168)]=_0x1a03a6(0x304),this['emit'](_0x1a03a6(0x304))),_0x174700[_0x1a03a6(0x28e)]===_0x1a03a6(0x2d0)&&_0x174700['id']!==void 0x0&&_0x174700[_0x1a03a6(0x1d9)]){let _0x2896bd=this[_0x1a03a6(0x17d)]['get'](_0x174700['id']);if(!_0x2896bd)return;clearTimeout(_0x2896bd[_0x1a03a6(0x17c)]),this['pendingRequests'][_0x1a03a6(0x278)](_0x174700['id']),_0x2896bd['resolve'](_0x174700[_0x1a03a6(0x1d9)]);}}),this[_0x3063f6(0x175)]['on'](_0x3063f6(0x166),(_0x26746d,_0x1bcc65)=>{const _0x420b5d=_0x3063f6;this[_0x420b5d(0x168)]=_0x420b5d(0x19a),this[_0x420b5d(0x169)](Error(_0x420b5d(0x1ab)+(_0x26746d??_0x420b5d(0x2ca))+_0x420b5d(0x212)+(_0x1bcc65??'null')+')'+this[_0x420b5d(0x1dc)]())),this[_0x420b5d(0x21f)](_0x420b5d(0x166),_0x26746d,_0x1bcc65);}),this[_0x3063f6(0x175)]['on'](_0x3063f6(0x2c8),_0x4fad44=>{const _0x5ead18=_0x3063f6;this['emit'](_0x5ead18(0x2c8),_0x4fad44);});}['destroy'](){const _0x1eb575=_0x36aff2;this['status']==='destroying'||this[_0x1eb575(0x168)]==='exited'||(this[_0x1eb575(0x168)]='destroying',this[_0x1eb575(0x175)][_0x1eb575(0x239)]('SIGTERM'),setTimeout(()=>{const _0x4e0fe9=_0x1eb575;this['child'][_0x4e0fe9(0x2f4)]===null&&this['child'][_0x4e0fe9(0x239)](_0x4e0fe9(0x2bf));},this[_0x1eb575(0x2be)])[_0x1eb575(0x2d4)]());}[_0x36aff2(0x1f9)](){const _0x574b50=_0x36aff2;return this[_0x574b50(0x175)][_0x574b50(0x2f4)]===null&&this['child'][_0x574b50(0x1d3)]===null;}async['sendRpc'](_0x34e607,_0x37eae3){const _0x3f8e4e=_0x36aff2;if(this[_0x3f8e4e(0x168)]!==_0x3f8e4e(0x304))throw Error(_0x3f8e4e(0x300));let _0xfc5b6e=_0x37eae3?.[_0x3f8e4e(0x2cb)]??this[_0x3f8e4e(0x2a2)];return new Promise((_0x5c0cfa,_0x42b2d0)=>{const _0x1890cb=_0x3f8e4e;let _0x411af0=setTimeout(()=>{const _0xd13b5e=_0x2520;this[_0xd13b5e(0x17d)]['delete'](_0x34e607['id']),_0x42b2d0(Error(_0xd13b5e(0x2c4)));},_0xfc5b6e);this[_0x1890cb(0x17d)][_0x1890cb(0x1fd)](_0x34e607['id'],{'resolve':_0x5c0cfa,'reject':_0x42b2d0,'timeout':_0x411af0}),this[_0x1890cb(0x175)][_0x1890cb(0x224)]({'type':_0x1890cb(0x1c6),'id':_0x34e607['id'],'data':{..._0x34e607,'meta':_0x1c4023['injectMeta'](_0x34e607[_0x1890cb(0x240)])}});});}async[_0x36aff2(0x241)](_0x5a986a=0x7530){const _0x46e40f=_0x36aff2;if(this['status']!=='ready'){if(!this[_0x46e40f(0x1f9)]())throw Error(_0x46e40f(0x1b0)+this[_0x46e40f(0x1dc)]());return await new Promise((_0x4bf758,_0x5ad9c0)=>{const _0x485344=_0x46e40f;let _0x1a05c6=()=>{const _0xb787bd=_0x2520;clearTimeout(_0x5bd39d),this['off'](_0xb787bd(0x304),_0x5d1e3e),this[_0xb787bd(0x238)](_0xb787bd(0x166),_0x2e0aff),this[_0xb787bd(0x238)](_0xb787bd(0x2c8),_0x51b4ea);},_0x5d1e3e=()=>{_0x1a05c6(),_0x4bf758();},_0x2e0aff=()=>{const _0x4656aa=_0x2520;_0x1a05c6(),_0x5ad9c0(Error('Runner\x20exited\x20before\x20ready'+this[_0x4656aa(0x1dc)]()));},_0x51b4ea=_0xbe0ed0=>{const _0x19047a=_0x2520;_0x1a05c6(),_0x5ad9c0(Error(_0x19047a(0x2cd)+_0xbe0ed0['message']));},_0x5bd39d=setTimeout(()=>{const _0x38a4f3=_0x2520;_0x1a05c6(),_0x5ad9c0(Error(_0x38a4f3(0x270)));},_0x5a986a);this[_0x485344(0x2ba)]('ready',_0x5d1e3e),this[_0x485344(0x2ba)](_0x485344(0x166),_0x2e0aff),this[_0x485344(0x2ba)]('error',_0x51b4ea);});}}['formatStderr'](){const _0xd4553a=_0x36aff2;let _0x22f42b=this[_0xd4553a(0x16b)][_0xd4553a(0x230)]();return _0x22f42b[_0xd4553a(0x2a0)]===0x0?'':'\x0a'+_0x22f42b;}[_0x36aff2(0x169)](_0x4d25d6){const _0x301454=_0x36aff2;for(let _0x3e42b0 of this[_0x301454(0x17d)][_0x301454(0x1b2)]())clearTimeout(_0x3e42b0[_0x301454(0x17c)]),_0x3e42b0['reject'](_0x4d25d6);this[_0x301454(0x17d)][_0x301454(0x176)]();}};let A=function(_0x4d03a4){const _0x2e644a=_0x36aff2;return _0x4d03a4['CreateWorkbook']=_0x2e644a(0x2a4),_0x4d03a4[_0x2e644a(0x21e)]=_0x2e644a(0x283),_0x4d03a4[_0x2e644a(0x261)]=_0x2e644a(0x179),_0x4d03a4['ExportWorkbookData']='exportWorkbookData',_0x4d03a4[_0x2e644a(0x201)]=_0x2e644a(0x281),_0x4d03a4[_0x2e644a(0x229)]='loadWorkbookDataReplayPack',_0x4d03a4;}({});var gt=0x384*0x3e8,_t=class{['env'];[_0x36aff2(0x260)];['resolveExecutionPlaneOptions'];[_0x36aff2(0x252)]=new Map();[_0x36aff2(0x233)];constructor(_0x3b5319){const _0x375774=_0x36aff2;this[_0x375774(0x1a5)]=_0x3b5319[_0x375774(0x1a5)]??process.env,this[_0x375774(0x260)]=_0x3b5319[_0x375774(0x260)]??new ge(),this['resolveExecutionPlaneOptions']=_0x3b5319[_0x375774(0x256)],this[_0x375774(0x233)]=_0x3b5319[_0x375774(0x233)]??vt(this[_0x375774(0x1a5)],gt);}[_0x36aff2(0x2e5)](){const _0x3222d4=_0x36aff2;return this['sessions'][_0x3222d4(0x1bc)];}['getSessionIdleTtlMs'](){const _0x100253=_0x36aff2;return this[_0x100253(0x233)];}async[_0x36aff2(0x221)](_0x133546){const _0x1d828a=_0x36aff2;let _0x3f2af5=await this[_0x1d828a(0x1ae)](_0x133546[_0x1d828a(0x22c)][_0x1d828a(0x20c)]),_0x538a56=this[_0x1d828a(0x252)][_0x1d828a(0x2e2)](_0x3f2af5);return _0x538a56?this[_0x1d828a(0x268)](_0x538a56,_0x133546[_0x1d828a(0x22c)]):null;}async[_0x36aff2(0x2a4)](_0x334eb1){const _0xc19fde=_0x36aff2;let _0x2c8fd0=await this[_0xc19fde(0x1c8)](_0x334eb1['identity'][_0xc19fde(0x20c)]),_0x1e6f05=await _0x2c8fd0[_0xc19fde(0x2b1)][_0xc19fde(0x2af)]({'jsonrpc':_0xc19fde(0x20f),'id':N(_0x2c8fd0['sessionId']),'method':A['CreateWorkbook'],'params':{'id':_0x334eb1[_0xc19fde(0x264)],'name':_0x334eb1[_0xc19fde(0x2b3)]}});if(_0x1e6f05[_0xc19fde(0x2c8)])throw Error(_0x1e6f05[_0xc19fde(0x2c8)][_0xc19fde(0x29d)]);return await this[_0xc19fde(0x20a)](_0x2c8fd0,_0xc19fde(0x1b9)),{'session':this[_0xc19fde(0x268)](_0x2c8fd0,_0x334eb1[_0xc19fde(0x22c)]),'workbookData':_0x1e6f05[_0xc19fde(0x277)][_0xc19fde(0x197)]};}async[_0x36aff2(0x2ac)](_0x4ec2d8){const _0x81cbbd=_0x36aff2;let _0x2407ab=await this[_0x81cbbd(0x1c8)](_0x4ec2d8[_0x81cbbd(0x22c)][_0x81cbbd(0x20c)]),_0x4efdb5=await _0x2407ab[_0x81cbbd(0x2b1)][_0x81cbbd(0x2af)]({'jsonrpc':'2.0','id':N(_0x2407ab[_0x81cbbd(0x301)]),'method':A[_0x81cbbd(0x201)],'params':{'workbookData':_0x4ec2d8['workbookData']}});if(_0x4efdb5[_0x81cbbd(0x2c8)])throw Error(_0x4efdb5['error'][_0x81cbbd(0x29d)]);return await this['touchSession'](_0x2407ab,_0x81cbbd(0x227)),{'session':this[_0x81cbbd(0x268)](_0x2407ab,_0x4ec2d8[_0x81cbbd(0x22c)]),'workbookData':_0x4efdb5[_0x81cbbd(0x277)]['workbookData']};}async['loadWorkbookDataReplayPack'](_0x501649){const _0x17ec71=_0x36aff2;let _0x55d110=await this[_0x17ec71(0x1c8)](_0x501649['identity'][_0x17ec71(0x20c)]),_0x564370={'baseWorkbookData':_0x501649[_0x17ec71(0x18f)][_0x17ec71(0x29e)],'mutations':_0x501649[_0x17ec71(0x18f)][_0x17ec71(0x1fe)]},_0x4831c7=await _0x55d110[_0x17ec71(0x2b1)]['sendRpc']({'jsonrpc':_0x17ec71(0x20f),'id':N(_0x55d110[_0x17ec71(0x301)]),'method':A[_0x17ec71(0x229)],'params':_0x564370});if(_0x4831c7['error'])throw Error(_0x4831c7[_0x17ec71(0x2c8)][_0x17ec71(0x29d)]);return await this[_0x17ec71(0x20a)](_0x55d110,_0x17ec71(0x1d2)),{'session':this['toRuntimeSessionInfo'](_0x55d110,_0x501649[_0x17ec71(0x22c)]),'workbookData':_0x4831c7['result'][_0x17ec71(0x197)]};}async['ensureWorkbookDataReplayPackLoaded'](_0x53b1d0){const _0x8ce102=_0x36aff2;let _0x17dc2a=await this[_0x8ce102(0x1a6)](_0x53b1d0[_0x8ce102(0x22c)][_0x8ce102(0x20c)]);if(!_0x17dc2a[_0x8ce102(0x27c)])return await this['touchSession'](_0x17dc2a[_0x8ce102(0x26e)],_0x8ce102(0x2de)),{'loaded':!0x1,'session':this[_0x8ce102(0x268)](_0x17dc2a[_0x8ce102(0x26e)],_0x53b1d0['identity'])};let _0x4b5bef=await _0x53b1d0['loadReplayPack']();return await this['loadReplayPackIntoSession'](_0x17dc2a['session'],_0x4b5bef),await this['touchSession'](_0x17dc2a[_0x8ce102(0x26e)],_0x8ce102(0x1d2)),{'loaded':!0x0,'session':this[_0x8ce102(0x268)](_0x17dc2a[_0x8ce102(0x26e)],_0x53b1d0['identity'])};}async[_0x36aff2(0x2e6)](_0x1d4ffb){const _0x76d5b1=_0x36aff2;let _0x2a74ea=await this[_0x76d5b1(0x1c8)](_0x1d4ffb[_0x76d5b1(0x22c)][_0x76d5b1(0x20c)]),_0x42a89c=await _0x2a74ea[_0x76d5b1(0x2b1)][_0x76d5b1(0x2af)]({'jsonrpc':_0x76d5b1(0x20f),'id':N(_0x2a74ea[_0x76d5b1(0x301)]),'method':A['EvalJs'],'params':{'code':_0x1d4ffb['code'],'mutates':_0x1d4ffb[_0x76d5b1(0x1d6)]}});if(_0x42a89c[_0x76d5b1(0x2c8)])throw Error(_0x42a89c[_0x76d5b1(0x2c8)][_0x76d5b1(0x29d)]);await this['touchSession'](_0x2a74ea,_0x76d5b1(0x1a4));let _0x5b5e92=_0x42a89c[_0x76d5b1(0x277)][_0x76d5b1(0x1fe)];return{..._0x5b5e92===void 0x0?{}:{'mutations':_0x5b5e92},'session':this[_0x76d5b1(0x268)](_0x2a74ea,_0x1d4ffb['identity']),'value':_0x42a89c['result']['value']};}async[_0x36aff2(0x26b)](_0x59662b){const _0x351331=_0x36aff2;let _0x46343c=await this[_0x351331(0x1c8)](_0x59662b['identity'][_0x351331(0x20c)]),_0x30befe=await _0x46343c[_0x351331(0x2b1)][_0x351331(0x2af)]({'jsonrpc':'2.0','id':N(_0x46343c[_0x351331(0x301)]),'method':A['ExportWorkbookData']});if(_0x30befe[_0x351331(0x2c8)])throw Error(_0x30befe[_0x351331(0x2c8)][_0x351331(0x29d)]);return await this[_0x351331(0x20a)](_0x46343c,_0x351331(0x1b5)),{'session':this['toRuntimeSessionInfo'](_0x46343c,_0x59662b[_0x351331(0x22c)]),'workbookData':_0x30befe['result'][_0x351331(0x197)]};}async[_0x36aff2(0x179)](_0x3101d8){const _0x20de7e=_0x36aff2;let _0x4c1a9a=await this[_0x20de7e(0x1c8)](_0x3101d8[_0x20de7e(0x22c)][_0x20de7e(0x20c)]),_0x501083=await _0x4c1a9a['runner']['sendRpc']({'jsonrpc':_0x20de7e(0x20f),'id':N(_0x4c1a9a['sessionId']),'method':A[_0x20de7e(0x261)],'params':{'format':_0x3101d8[_0x20de7e(0x285)],'outputPath':_0x3101d8['outputPath']}});if(_0x501083['error'])throw Error(_0x501083[_0x20de7e(0x2c8)][_0x20de7e(0x29d)]);await this[_0x20de7e(0x20a)](_0x4c1a9a,_0x20de7e(0x1bd));let _0x5b8d61=_0x501083[_0x20de7e(0x277)];return{'format':_0x5b8d61[_0x20de7e(0x285)],'outputPath':_0x5b8d61[_0x20de7e(0x1b8)],'session':this[_0x20de7e(0x268)](_0x4c1a9a,_0x3101d8['identity']),'sizeBytes':_0x5b8d61[_0x20de7e(0x1d1)]};}async[_0x36aff2(0x1de)](_0x32517f){const _0x900768=_0x36aff2;let _0x5e1252=await this[_0x900768(0x1ae)](_0x32517f[_0x900768(0x22c)][_0x900768(0x20c)]),_0x5bca94=this[_0x900768(0x252)][_0x900768(0x2e2)](_0x5e1252);_0x5bca94&&await this['destroySession'](_0x5bca94,'explicit-dispose');}async[_0x36aff2(0x1d7)](_0x5791e4=Date[_0x36aff2(0x26f)]()){const _0x4a95e5=_0x36aff2;let _0x2eb06c=Array[_0x4a95e5(0x1ad)](this['sessions'][_0x4a95e5(0x1b2)]());for(let _0x248a75 of _0x2eb06c)_0x5791e4-Date[_0x4a95e5(0x2c9)](_0x248a75[_0x4a95e5(0x1cc)])<this['sessionIdleTtlMs']||await this[_0x4a95e5(0x2f3)](_0x248a75,'idle-unload');}async[_0x36aff2(0x2e8)](_0x5a15bb=_0x36aff2(0x19c)){const _0x5b636f=_0x36aff2;let _0x24fc7a=Array[_0x5b636f(0x1ad)](this[_0x5b636f(0x252)][_0x5b636f(0x1b2)]());for(let _0x508051 of _0x24fc7a)await this[_0x5b636f(0x2f3)](_0x508051,_0x5a15bb);}async[_0x36aff2(0x1ae)](_0x536731){try{return await _0x245e41(_0x536731);}catch{return _0x536731;}}async[_0x36aff2(0x1c8)](_0x20bf65){const _0x49c31a=_0x36aff2;return(await this['ensureSessionState'](_0x20bf65))[_0x49c31a(0x26e)];}async[_0x36aff2(0x1a6)](_0x437a14){const _0x274a24=_0x36aff2;let _0x4a11a8=await this[_0x274a24(0x1ae)](_0x437a14),_0x504a29=this[_0x274a24(0x252)][_0x274a24(0x2e2)](_0x4a11a8);if(_0x504a29)return{'created':!0x1,'session':_0x504a29};let _0x28346c=yt(),_0xde0c2a=Re(_0x28346c,this[_0x274a24(0x1a5)]);await _0x3e1c0c(_0xde0c2a[_0x274a24(0x23e)],{'recursive':!0x0,'mode':0x1c0});let _0x1d74e8=this['resolveExecutionPlaneOptions'](bt(this[_0x274a24(0x256)])),_0x192bfd=new ht(_0x28346c,{'cwd':xt(_0x1d74e8[_0x274a24(0x255)]),'env':Object[_0x274a24(0x167)](Object[_0x274a24(0x2dc)](this[_0x274a24(0x1a5)])['filter'](_0x140c75=>_0x140c75[0x1]!==void 0x0)),'execArgv':_0x1d74e8[_0x274a24(0x1d4)],'executionPlanePath':_0x1d74e8[_0x274a24(0x255)],'onStderrChunk':_0x2a6b28=>{const _0x24ef46=_0x274a24;Ae(_0xde0c2a[_0x24ef46(0x194)],_0x2a6b28['toString']()[_0x24ef46(0x180)]());}});await _0x192bfd[_0x274a24(0x241)]();let _0x768877={'sessionId':_0x28346c,'workbookIdentity':_0x4a11a8,'createdAt':new Date()[_0x274a24(0x29b)](),'lastAccessedAt':new Date()['toISOString'](),'runner':_0x192bfd,'paths':_0xde0c2a};return _0x192bfd['on'](_0x274a24(0x166),()=>{const _0x2d3f02=_0x274a24;this[_0x2d3f02(0x260)][_0x2d3f02(0x19b)]({'event_name':_0x342520['RuntimeRunnerExit'],'component':_0x5b3da3[_0x2d3f02(0x1e7)],'process_role':_0x5d4d91['Runtime'],'fields':{...j(this[_0x2d3f02(0x1a5)],_0x28346c),'session_id':_0x28346c,'workbook_identity':_0x4a11a8}}),this[_0x2d3f02(0x260)][_0x2d3f02(0x1b6)](),this[_0x2d3f02(0x2f3)](_0x768877,_0x2d3f02(0x2a6));}),this[_0x274a24(0x252)][_0x274a24(0x1fd)](_0x4a11a8,_0x768877),this[_0x274a24(0x260)][_0x274a24(0x24c)]({'event_name':_0x342520[_0x274a24(0x291)],'component':_0x5b3da3[_0x274a24(0x2a7)],'process_role':_0x5d4d91['Runtime'],'fields':{...j(this[_0x274a24(0x1a5)],_0x28346c),'created_at':_0x768877[_0x274a24(0x1a0)],'session_id':_0x28346c,'workbook_identity':_0x4a11a8}}),await this['logger'][_0x274a24(0x1b6)](),{'created':!0x0,'session':_0x768877};}async[_0x36aff2(0x2e1)](_0x29fa6e,_0x3b2c5c){const _0x1e9221=_0x36aff2;let _0x32338e={'baseWorkbookData':_0x3b2c5c['baseWorkbookData'],'mutations':_0x3b2c5c[_0x1e9221(0x1fe)]},_0x3366b4=await _0x29fa6e[_0x1e9221(0x2b1)][_0x1e9221(0x2af)]({'jsonrpc':'2.0','id':N(_0x29fa6e[_0x1e9221(0x301)]),'method':A[_0x1e9221(0x229)],'params':_0x32338e});if(_0x3366b4[_0x1e9221(0x2c8)])throw Error(_0x3366b4[_0x1e9221(0x2c8)][_0x1e9221(0x29d)]);return _0x3366b4[_0x1e9221(0x277)][_0x1e9221(0x197)];}async[_0x36aff2(0x20a)](_0x2606f8,_0x3552b8){const _0xa81762=_0x36aff2;_0x2606f8['lastAccessedAt']=new Date()[_0xa81762(0x29b)](),this[_0xa81762(0x260)][_0xa81762(0x24c)]({'event_name':_0x342520[_0xa81762(0x291)],'component':_0x5b3da3[_0xa81762(0x2a7)],'process_role':_0x5d4d91[_0xa81762(0x18b)],'fields':{...j(this[_0xa81762(0x1a5)],_0x2606f8[_0xa81762(0x301)]),'event':_0x3552b8,'session_id':_0x2606f8[_0xa81762(0x301)],'timestamp':_0x2606f8[_0xa81762(0x1cc)],'workbook_identity':_0x2606f8['workbookIdentity']}}),await this[_0xa81762(0x260)][_0xa81762(0x1b6)]();}async[_0x36aff2(0x2f3)](_0xa15df2,_0x66ae55){const _0x48bdbc=_0x36aff2;this[_0x48bdbc(0x252)][_0x48bdbc(0x2e2)](_0xa15df2[_0x48bdbc(0x220)])===_0xa15df2&&(this[_0x48bdbc(0x252)][_0x48bdbc(0x278)](_0xa15df2[_0x48bdbc(0x220)]),_0xa15df2['runner'][_0x48bdbc(0x1a1)](),this[_0x48bdbc(0x260)][_0x48bdbc(0x24c)]({'event_name':_0x342520[_0x48bdbc(0x2a1)],'component':_0x5b3da3['RuntimeSession'],'process_role':_0x5d4d91[_0x48bdbc(0x18b)],'fields':{...j(this[_0x48bdbc(0x1a5)],_0xa15df2[_0x48bdbc(0x301)]),'reason':_0x66ae55,'session_id':_0xa15df2[_0x48bdbc(0x301)],'timestamp':new Date()[_0x48bdbc(0x29b)](),'workbook_identity':_0xa15df2[_0x48bdbc(0x220)]}}),await this[_0x48bdbc(0x260)][_0x48bdbc(0x1b6)]());}[_0x36aff2(0x268)](_0x21663e,_0x3309f4){const _0x30a126=_0x36aff2;return{'sessionId':_0x21663e[_0x30a126(0x301)],'packageIdentity':_0x3309f4,'createdAt':_0x21663e['createdAt'],'lastAccessedAt':_0x21663e[_0x30a126(0x1cc)]};}};function vt(_0xbe5a90,_0x52bae6){const _0x5b6399=_0x36aff2;let _0x14e229=_0xbe5a90[_0x5b6399(0x20d)]?.[_0x5b6399(0x230)]();if(!_0x14e229)return _0x52bae6;let _0x5be48a=Number(_0x14e229);return!Number[_0x5b6399(0x23a)](_0x5be48a)||_0x5be48a<0x0?_0x52bae6:_0x5be48a;}function j(_0x53089b,_0x595b30){const _0x4f34ce=_0x36aff2;return{'deployment.environment.name':_0x4f34ce(0x1f5),'distribution.channel':M(_0x53089b,_0x4f34ce(0x2fb))??'unknown','service.instance.id':_0x595b30,'service.name':_0x4f34ce(0x27d),...M(_0x53089b,_0x4f34ce(0x299))===void 0x0?{}:{'build.id':M(_0x53089b,'UNIVER_CLI_BUILD_ID')},...M(_0x53089b,_0x4f34ce(0x16a))===void 0x0?{}:{'service.version':M(_0x53089b,_0x4f34ce(0x16a))}};}function M(_0x2e5a5b,_0x4fe2ef){const _0x44aa4f=_0x36aff2;let _0xd10550=_0x2e5a5b[_0x4fe2ef]?.[_0x44aa4f(0x230)]();return _0xd10550===void 0x0||_0xd10550[_0x44aa4f(0x2a0)]===0x0?void 0x0:_0xd10550;}function N(_0x4a395c){const _0xb37450=_0x36aff2;return _0x4a395c+'-'+Date['now']()[_0xb37450(0x234)](0x24)+'-'+Math[_0xb37450(0x1cd)]()['toString'](0x10)[_0xb37450(0x17f)](0x2,0x8);}function yt(){const _0x28c4e2=_0x36aff2;return _0x28c4e2(0x20e)+Date[_0x28c4e2(0x26f)]()['toString'](0x24)+'-'+Math[_0x28c4e2(0x1cd)]()[_0x28c4e2(0x234)](0x10)[_0x28c4e2(0x17f)](0x2,0x8);}function bt(_0x1632cb){const _0x266327=_0x36aff2;return _0x51abce(import.meta.url)[_0x266327(0x250)](_0x266327(0x222))?_0x266327(0x2eb):'source';}function xt(_0x428af3){return _0x37fe88(_0x37fe88(_0x428af3));}var St=class{[_0x36aff2(0x2b2)];[_0x36aff2(0x19f)];constructor(_0x1a6997={}){const _0x1a6b04=_0x36aff2;this[_0x1a6b04(0x2b2)]=_0x1a6997[_0x1a6b04(0x2b2)]??{'sessionCreateWorkbook':Je,'sessionDisposeWorkbook':Qe,'sessionEvalJs':Ye,'sessionExportWorkbookData':Xe,'sessionExportWorkbookFile':Ze,'sessionGetWorkbook':qe,'sessionLoadWorkbookDataReplayPack':Ke,'sessionLoadWorkbook':Ge},this[_0x1a6b04(0x19f)]=_0x1a6997[_0x1a6b04(0x21a)]??{};}async[_0x36aff2(0x2a4)](_0x20e0a4){const _0x5ddcd3=_0x36aff2;let _0x1bdc8b=await this[_0x5ddcd3(0x2b2)]['sessionCreateWorkbook'](_0x20e0a4['identity'][_0x5ddcd3(0x20c)],{...this[_0x5ddcd3(0x19f)],..._0x20e0a4[_0x5ddcd3(0x191)]===void 0x0?{}:{'cwd':_0x20e0a4[_0x5ddcd3(0x191)]},..._0x20e0a4['workbookId']===void 0x0?{}:{'id':_0x20e0a4[_0x5ddcd3(0x264)]},..._0x20e0a4['workbookName']===void 0x0?{}:{'name':_0x20e0a4[_0x5ddcd3(0x2b3)]}});return{'session':P(_0x1bdc8b[_0x5ddcd3(0x26e)],_0x20e0a4[_0x5ddcd3(0x22c)]),'workbookData':_0x1bdc8b[_0x5ddcd3(0x197)]};}async[_0x36aff2(0x221)](_0x5b96ab){const _0x4c4f24=_0x36aff2;let _0x53d4a5=await this['client']['sessionGetWorkbook'](_0x5b96ab[_0x4c4f24(0x22c)][_0x4c4f24(0x20c)],{...this['options'],..._0x5b96ab[_0x4c4f24(0x191)]===void 0x0?{}:{'cwd':_0x5b96ab[_0x4c4f24(0x191)]}});return!_0x53d4a5[_0x4c4f24(0x1da)]||_0x53d4a5[_0x4c4f24(0x26e)]===null?null:P(_0x53d4a5['session'],_0x5b96ab['identity']);}async[_0x36aff2(0x2ac)](_0x4a65e2){const _0x512378=_0x36aff2;let _0x46eb45=await this[_0x512378(0x2b2)][_0x512378(0x294)](_0x4a65e2['identity'][_0x512378(0x20c)],_0x4a65e2['workbookData'],{...this[_0x512378(0x19f)],..._0x4a65e2[_0x512378(0x191)]===void 0x0?{}:{'cwd':_0x4a65e2[_0x512378(0x191)]}});return{'session':P(_0x46eb45[_0x512378(0x26e)],_0x4a65e2['identity']),'workbookData':_0x46eb45[_0x512378(0x197)]};}async[_0x36aff2(0x272)](_0x2d5bbd){const _0x207fcc=_0x36aff2;let _0xe90250=await this[_0x207fcc(0x2b2)][_0x207fcc(0x1b1)](_0x2d5bbd[_0x207fcc(0x22c)][_0x207fcc(0x20c)],{'baseWorkbookData':_0x2d5bbd['replayPack'][_0x207fcc(0x29e)],'mutations':_0x2d5bbd[_0x207fcc(0x18f)]['mutations']},{...this[_0x207fcc(0x19f)],..._0x2d5bbd[_0x207fcc(0x191)]===void 0x0?{}:{'cwd':_0x2d5bbd[_0x207fcc(0x191)]}});return{'session':P(_0xe90250[_0x207fcc(0x26e)],_0x2d5bbd[_0x207fcc(0x22c)]),'workbookData':_0xe90250[_0x207fcc(0x197)]};}async[_0x36aff2(0x1cb)](_0x4b0d02){const _0x3f3b6c=_0x36aff2;let _0x41ac14=await this[_0x3f3b6c(0x221)](_0x4b0d02);if(_0x41ac14!==null)return{'loaded':!0x1,'session':_0x41ac14};let _0x2ce9af=await _0x4b0d02['loadReplayPack']();return{'loaded':!0x0,'session':(await this[_0x3f3b6c(0x272)]({..._0x4b0d02[_0x3f3b6c(0x191)]===void 0x0?{}:{'cwd':_0x4b0d02['cwd']},'identity':_0x4b0d02[_0x3f3b6c(0x22c)],'replayPack':_0x2ce9af}))[_0x3f3b6c(0x26e)]};}async[_0x36aff2(0x2e6)](_0x246bde){const _0x19a557=_0x36aff2;let _0xb91552=await this[_0x19a557(0x2b2)][_0x19a557(0x2e7)](_0x246bde[_0x19a557(0x22c)][_0x19a557(0x20c)],_0x246bde[_0x19a557(0x27b)],{...this[_0x19a557(0x19f)],..._0x246bde['cwd']===void 0x0?{}:{'cwd':_0x246bde[_0x19a557(0x191)]},..._0x246bde[_0x19a557(0x1d6)]===void 0x0?{}:{'mutates':_0x246bde[_0x19a557(0x1d6)]}});return{..._0xb91552[_0x19a557(0x1fe)]===void 0x0?{}:{'mutations':_0xb91552['mutations']},'session':P(_0xb91552[_0x19a557(0x26e)],_0x246bde[_0x19a557(0x22c)]),'value':_0xb91552[_0x19a557(0x1bb)]};}async[_0x36aff2(0x26b)](_0x36344c){const _0x4039c6=_0x36aff2;let _0x60532b=await this['client'][_0x4039c6(0x2ec)](_0x36344c[_0x4039c6(0x22c)][_0x4039c6(0x20c)],{...this['options'],..._0x36344c[_0x4039c6(0x191)]===void 0x0?{}:{'cwd':_0x36344c[_0x4039c6(0x191)]}});return{'session':P(_0x60532b[_0x4039c6(0x26e)],_0x36344c[_0x4039c6(0x22c)]),'workbookData':_0x60532b[_0x4039c6(0x197)]};}async[_0x36aff2(0x179)](_0x20702d){const _0x354287=_0x36aff2;let _0xf5229b=await this[_0x354287(0x2b2)][_0x354287(0x2c2)](_0x20702d[_0x354287(0x22c)][_0x354287(0x20c)],{'format':_0x20702d['format'],'outputPath':_0x20702d['outputPath']},{...this['options'],..._0x20702d[_0x354287(0x191)]===void 0x0?{}:{'cwd':_0x20702d[_0x354287(0x191)]}});return{'format':_0xf5229b['format'],'outputPath':_0xf5229b[_0x354287(0x1b8)],'session':P(_0xf5229b[_0x354287(0x26e)],_0x20702d[_0x354287(0x22c)]),'sizeBytes':_0xf5229b[_0x354287(0x1d1)]};}async[_0x36aff2(0x1de)](_0x49b9e3){const _0x3d68ec=_0x36aff2;await this[_0x3d68ec(0x2b2)][_0x3d68ec(0x170)](_0x49b9e3[_0x3d68ec(0x22c)][_0x3d68ec(0x20c)],{...this[_0x3d68ec(0x19f)],..._0x49b9e3[_0x3d68ec(0x191)]===void 0x0?{}:{'cwd':_0x49b9e3[_0x3d68ec(0x191)]}});}};function P(_0x5df464,_0x96fd07){const _0xe8c8f0=_0x36aff2;return{'createdAt':_0x5df464[_0xe8c8f0(0x1a0)],'lastAccessedAt':_0x5df464[_0xe8c8f0(0x1cc)],'packageIdentity':_0x96fd07,'sessionId':_0x5df464[_0xe8c8f0(0x301)]};}var F=class extends Error{[_0x36aff2(0x27b)];constructor(_0x22d8a0,_0x2b6ee8,_0x18b190){const _0x3d1c1c=_0x36aff2;super(_0x2b6ee8,_0x18b190),this[_0x3d1c1c(0x2b5)]='WorkbookPackageError',this['code']=_0x22d8a0;}},Ct=class extends F{constructor(_0x507536){const _0x3b5c30=_0x36aff2;super('ERR_INVALID_WORKBOOK_PACKAGE_PATH',_0x3b5c30(0x2ee)+_0x507536),this[_0x3b5c30(0x2b5)]=_0x3b5c30(0x263);}},wt=class extends F{constructor(_0x1f1f9d){const _0x2f071f=_0x36aff2;super(_0x2f071f(0x173),_0x2f071f(0x214)+_0x1f1f9d),this[_0x2f071f(0x2b5)]=_0x2f071f(0x2b8);}},I=class extends F{constructor(_0xbffd5e,_0x2849c7,_0x4ec34e){const _0x150284=_0x36aff2;super(_0x150284(0x236),_0x150284(0x2a3)+_0xbffd5e+':\x20'+_0x2849c7,_0x4ec34e),this[_0x150284(0x2b5)]=_0x150284(0x231);}},Tt=class extends F{constructor(_0x108da4,_0x51fd2d,_0x44fa78){const _0x7d97b7=_0x36aff2;super(_0x7d97b7(0x269),_0x7d97b7(0x1e4)+_0x108da4+':\x20'+_0x51fd2d,_0x44fa78),this[_0x7d97b7(0x2b5)]=_0x7d97b7(0x226);}},Et=class extends F{constructor(_0x244dbb){const _0x1afddc=_0x36aff2;super(_0x1afddc(0x273),_0x1afddc(0x1f6)+_0x244dbb),this['name']=_0x1afddc(0x26a);}},Dt=class extends F{constructor(_0x70a30,_0x3618c5){const _0x504e3c=_0x36aff2;super('ERR_WORKBOOK_PACKAGE_LOCK_TIMEOUT',_0x3618c5===null?'Workbook\x20package\x20is\x20busy:\x20'+_0x70a30:_0x504e3c(0x279)+_0x70a30+_0x504e3c(0x2e9)+_0x3618c5[_0x504e3c(0x2b4)]+_0x504e3c(0x1a2)+_0x3618c5[_0x504e3c(0x28b)]+_0x504e3c(0x2fa)+_0x3618c5[_0x504e3c(0x2c0)]+')'),this[_0x504e3c(0x242)]=_0x3618c5,this[_0x504e3c(0x2b5)]=_0x504e3c(0x1af);}};function Ot(_0xc300a5={}){const _0x1e979f=_0x36aff2;return{'unitID':_0xc300a5[_0x1e979f(0x23f)]??null,'initRev':_0xc300a5['initRev']??null,'syncedRev':_0xc300a5['syncedRev']??null};}function kt(_0x3cb85b,_0x5be486){const _0x2d5db6=_0x36aff2;if(!At(_0x3cb85b))throw new I(_0x5be486,_0x2d5db6(0x183));let _0x14f604=_0x3cb85b[_0x2d5db6(0x23f)],_0x28d3ce=_0x3cb85b[_0x2d5db6(0x2ab)],_0x35c5e9=_0x3cb85b[_0x2d5db6(0x235)];if(_0x14f604!==null&&typeof _0x14f604!=_0x2d5db6(0x23b))throw new I(_0x5be486,'unitID\x20must\x20be\x20a\x20string\x20or\x20null');if(_0x28d3ce!==null&&!jt(_0x28d3ce))throw new I(_0x5be486,_0x2d5db6(0x217));if(_0x35c5e9!==null&&!jt(_0x35c5e9))throw new I(_0x5be486,'syncedRev\x20must\x20be\x20a\x20non-negative\x20integer\x20or\x20null');return{'unitID':_0x14f604,'initRev':_0x28d3ce,'syncedRev':_0x35c5e9};}function At(_0x24f87c){const _0x1302d5=_0x36aff2;return typeof _0x24f87c==_0x1302d5(0x171)&&!!_0x24f87c&&!Array['isArray'](_0x24f87c);}function jt(_0x13b637){const _0x166257=_0x36aff2;return typeof _0x13b637==_0x166257(0x251)&&Number['isInteger'](_0x13b637)&&_0x13b637>=0x0;}function L(_0x22c69b,_0x5eb32c){const _0x438ebe=_0x36aff2;if(!Mt(_0x22c69b))throw new I(_0x5eb32c,_0x438ebe(0x18e));if(typeof _0x22c69b['id']!=_0x438ebe(0x23b)||_0x22c69b['id'][_0x438ebe(0x2a0)]===0x0)throw new I(_0x5eb32c,_0x438ebe(0x1b4));if(!Mt(_0x22c69b[_0x438ebe(0x2c5)]))throw new I(_0x5eb32c,_0x438ebe(0x2ed));return _0x22c69b;}function Mt(_0x1f102c){const _0x5b7253=_0x36aff2;return typeof _0x1f102c==_0x5b7253(0x171)&&!!_0x1f102c&&!Array[_0x5b7253(0x2d9)](_0x1f102c);}function Nt(_0x981363,_0x30bef1){const _0x25ecf6=_0x36aff2;let _0x9c92b2=Ft(_0x981363,_0x30bef1,_0x25ecf6(0x1fa)),_0x154fb6=Lt(_0x9c92b2[_0x25ecf6(0x25e)],_0x30bef1,'local\x20changeset'),_0x278e73=Rt(_0x9c92b2[_0x25ecf6(0x196)],_0x30bef1,_0x25ecf6(0x1fa)),_0x489f81=_0x9c92b2[_0x25ecf6(0x29d)],_0x4ddd3e=_0x9c92b2[_0x25ecf6(0x1fe)];if(typeof _0x489f81!=_0x25ecf6(0x23b))throw new I(_0x30bef1,_0x25ecf6(0x1be));if(!Array['isArray'](_0x4ddd3e))throw new I(_0x30bef1,'local\x20changeset.mutations\x20must\x20be\x20an\x20array');return{'sid':_0x154fb6,'reqId':_0x278e73,'message':_0x489f81,'mutations':_0x4ddd3e['map']((_0x3af4a9,_0x117f29)=>L(_0x3af4a9,_0x30bef1+_0x25ecf6(0x247)+_0x117f29+']'))};}function Pt(_0x13d990,_0x20ea2a){const _0xe948de=_0x36aff2;let _0x5e99ee=Ft(_0x13d990,_0x20ea2a,'synced\x20changeset'),_0x5d67a7=Lt(_0x5e99ee[_0xe948de(0x25e)],_0x20ea2a,_0xe948de(0x257)),_0x225cb1=Rt(_0x5e99ee[_0xe948de(0x196)],_0x20ea2a,'synced\x20changeset'),_0x4b2fdc=_0x5e99ee['baseRev'],_0x3bb30d=_0x5e99ee[_0xe948de(0x1cf)],_0x1e5537=_0x5e99ee['mutations'],_0x57391c=_0x5e99ee[_0xe948de(0x29d)];if(!It(_0x4b2fdc))throw new I(_0x20ea2a,_0xe948de(0x297));if(!It(_0x3bb30d))throw new I(_0x20ea2a,_0xe948de(0x25f));if(!Array['isArray'](_0x1e5537))throw new I(_0x20ea2a,_0xe948de(0x225));if(_0x57391c!==void 0x0&&typeof _0x57391c!='string')throw new I(_0x20ea2a,_0xe948de(0x2e3));return{'sid':_0x5d67a7,'reqId':_0x225cb1,'baseRev':_0x4b2fdc,'revision':_0x3bb30d,'mutations':_0x1e5537[_0xe948de(0x1d5)]((_0x10bb8e,_0x252d55)=>L(_0x10bb8e,_0x20ea2a+_0xe948de(0x247)+_0x252d55+']')),..._0x57391c===void 0x0?{}:{'message':_0x57391c}};}function Ft(_0x193c2d,_0x40c346,_0x43a6c6){const _0x51ee1f=_0x36aff2;if(typeof _0x193c2d!='object'||!_0x193c2d||Array[_0x51ee1f(0x2d9)](_0x193c2d))throw new I(_0x40c346,_0x43a6c6+_0x51ee1f(0x2cf));return _0x193c2d;}function It(_0x20ce5a){const _0x45f859=_0x36aff2;return typeof _0x20ce5a=='number'&&Number[_0x45f859(0x1fc)](_0x20ce5a)&&_0x20ce5a>=0x0;}function Lt(_0x5c0162,_0x506475,_0xd7e0ce){const _0x16986=_0x36aff2;if(typeof _0x5c0162!='string'||_0x5c0162[_0x16986(0x2a0)]===0x0)throw new I(_0x506475,_0xd7e0ce+_0x16986(0x298));return _0x5c0162;}function Rt(_0x2ef9ef,_0x5ac497,_0x5156e1){const _0x5d4e40=_0x36aff2;if(typeof _0x2ef9ef!=_0x5d4e40(0x251)||!Number['isInteger'](_0x2ef9ef)||_0x2ef9ef<0x1)throw new I(_0x5ac497,_0x5156e1+_0x5d4e40(0x2db));return _0x2ef9ef;}const zt=['.univer','.unv'];var Bt=class e{constructor(_0xcee12e){const _0x25f1e6=_0x36aff2;this[_0x25f1e6(0x1bb)]=_0xcee12e;}static[_0x36aff2(0x2c9)](_0x3cf6b6){const _0x16e7ff=_0x36aff2;let _0x28e6bf=_0x3cf6b6[_0x16e7ff(0x230)]();if(_0x28e6bf[_0x16e7ff(0x2a0)]===0x0||!Vt(_0x1f02a0(_0x28e6bf)))throw new Ct(_0x3cf6b6);return new e(_0x28e6bf);}get['extension'](){const _0xe99d6d=_0x36aff2;return _0x1f02a0(this[_0xe99d6d(0x1bb)]);}};function Vt(_0x14397b){const _0x1c1d07=_0x36aff2;return zt[_0x1c1d07(0x1db)](_0x14397b);}var Ht=class e{[_0x36aff2(0x20c)];constructor(_0x55e6ab){const _0x4955de=_0x36aff2;this[_0x4955de(0x20c)]=_0x55e6ab['absolutePath'];}static['fromAbsolutePath'](_0x53220f){let _0x5f54fa=_0x36a426(_0x53220f),_0x50de92=Bt['parse'](_0x5f54fa);if(_0x5f54fa!==_0x53220f||!Vt(_0x50de92['extension']))throw new Ct(_0x53220f);return new e({'absolutePath':_0x5f54fa});}},R=_0x36aff2(0x259),z=_0x36aff2(0x195),B='local-mutations.jsonl',V=_0x36aff2(0x2bb),H=_0x36aff2(0x1c3),Ut=class{constructor(_0x3afedd={}){const _0x40f63e=_0x36aff2;this[_0x40f63e(0x19f)]=_0x3afedd;}async[_0x36aff2(0x1f8)](_0x14c1bd){const _0x355064=_0x36aff2;let _0x5b2803=Bt[_0x355064(0x2c9)](_0x14c1bd[_0x355064(0x18a)]);return Ht[_0x355064(0x2df)](_0x36a426(_0x14c1bd[_0x355064(0x191)]??process['cwd'](),_0x5b2803[_0x355064(0x1bb)]));}async[_0x36aff2(0x2f9)](_0x4bfbf1){const _0xab8df9=_0x36aff2;return await U(_0x4bfbf1[_0xab8df9(0x22c)],_0xab8df9(0x2f9),this[_0xab8df9(0x19f)],async()=>{const _0x5dacdb=_0xab8df9;let _0x4e95ec=Ot(_0x4bfbf1[_0x5dacdb(0x219)]),_0x1e33f5=new G(_0x4bfbf1[_0x5dacdb(0x22c)],this[_0x5dacdb(0x19f)],{'lockWrites':!0x1});return await Wt(_0x4bfbf1['identity']),await _0x3e1c0c(_0x4bfbf1[_0x5dacdb(0x22c)][_0x5dacdb(0x20c)],{'recursive':!0x0}),await Promise['all']([_0x1e33f5[_0x5dacdb(0x2f8)](_0x4e95ec),_0x1e33f5[_0x5dacdb(0x1e5)](_0x4bfbf1[_0x5dacdb(0x28f)]),_0x1e33f5[_0x5dacdb(0x1e3)]([]),_0x1e33f5[_0x5dacdb(0x2b0)]([]),_0x1e33f5['replaceSyncedChangesets'](_0x4bfbf1['syncedChangesets']??[])]),new G(_0x4bfbf1['identity'],this['options']);});}async['open'](_0x305e81){const _0x4ebc78=_0x36aff2;return new G(_0x305e81,this[_0x4ebc78(0x19f)]);}async[_0x36aff2(0x1ca)](_0x30ee44,_0x34f213){const _0xa518f=_0x36aff2;return await U(_0x30ee44,_0xa518f(0x1ca),this[_0xa518f(0x19f)],async()=>{const _0x965409=_0xa518f;let _0x3f87d4=new Zt(new G(_0x30ee44,this['options'],{'lockWrites':!0x1}));try{let _0xb5ca93=await _0x34f213(_0x3f87d4);return await tn(_0x30ee44,_0x3f87d4['takeWrites'](),this[_0x965409(0x19f)]),_0xb5ca93;}catch(_0x1e0fd7){throw new Tt(_0x30ee44['absolutePath'],_0x1e0fd7 instanceof Error?_0x1e0fd7[_0x965409(0x29d)]:String(_0x1e0fd7),_0x1e0fd7 instanceof Error?{'cause':_0x1e0fd7}:void 0x0);}});}};function _0x17c6(){const _0x3cb94f=['originalContent','SessionLoadWorkbook','stderrPath','init-workbook-data.json','reqId','workbookData','lockRetryIntervalMs','appendLocalChangeset','exited','warn','shutdown','lockTimeoutMs','session.loadWorkbook','options','createdAt','destroy','\x20(pid\x20','daemon','eval-js','env','ensureSessionState',',\x20got\x20','append-local-mutations','args','closeAfterFlush','Runner\x20process\x20exited\x20(code=','SessionEvalJs','from','resolveWorkbookIdentity','WorkbookPackageLockTimeoutError','Runner\x20exited\x20before\x20ready','sessionLoadWorkbookDataReplayPack','values','univer','mutation.id\x20must\x20be\x20a\x20non-empty\x20string','export-workbook','flush','session.exportWorkbookData','outputPath','create-workbook','HOME','value','size','export-workbook-file','local\x20changeset.message\x20must\x20be\x20a\x20string','ignore','destination','Cannot\x20resolve\x20home\x20directory\x20for\x20UNIVER_HOME\x20fallback','active','synced-changesets.jsonl','stack','.univer','rpc-request','replace-local-changesets','ensureSession','parentSpanId','transaction','ensureWorkbookDataReplayPackLoaded','lastAccessedAt','random','event_name','revision','./build-id-BAjJE5TZ.js','sizeBytes','load-workbook-replay-pack','signalCode','execArgv','map','mutates','unloadIdleSessions','UNIVER_HOME','data','exists','includes','formatStderr','6141032HtHZig','dispose','maxBytes','daemon\x20is\x20running','lockPath','USERPROFILE','replaceLocalMutations','Workbook\x20package\x20transaction\x20failed\x20for\x20','setInitWorkbookData','append-synced-changesets','RuntimeRunner','prefix','univer-','getLocalMutations','metaPath','syncedChangesets','all','univer\x20daemon\x20start','5504290hEjiwS','withSpan','homeDir','bin','execution-plane','Daemon\x20did\x20not\x20stop\x20before\x20timeout','local','Workbook\x20package\x20already\x20exists:\x20','run-help','resolveIdentity','isAlive','local\x20changeset','rolled_back','isInteger','set','mutations','event','onStderrChunk','LoadWorkbook','Daemon\x20build\x20mismatch.\x20Expected\x20','win32','daemonDir','workbook\x20data\x20must\x20be\x20an\x20object','end','platform','.sock','touchedFiles','touchSession','join','absolutePath','UNIVER_DAEMON_SESSION_IDLE_TTL_MS','session-','2.0','session.exportWorkbookFile','cli.js',',\x20signal=','logFields','Missing\x20workbook\x20package\x20file:\x20','.\x20Run\x20`univer\x20daemon\x20stop`\x20and\x20retry.','utf8','initRev\x20must\x20be\x20a\x20non-negative\x20integer\x20or\x20null','sessionRoot','manifest','daemonOptions','runtimeLogPath','session.evalJs','apps','EvalJs','emit','workbookIdentity','getSession','.js','saturated','send','synced\x20changeset.mutations\x20must\x20be\x20an\x20array','WorkbookPackageTransactionError','load-workbook','session.dispose','LoadWorkbookDataReplayPack','resolve','F_OK','identity','component','maxArchiveFiles','min','trim','WorkbookPackageFileInvalidError','daemon.health','sessionIdleTtlMs','toString','syncedRev','ERR_WORKBOOK_PACKAGE_FILE_INVALID','1173210tvFDOo','off','kill','isFinite','string','scheduleRotationIfNeeded','daemon.pid','sessionDir','unitID','meta','waitForReady','holder','split','--import','\x5c\x5c.\x5cpipe\x5c','daemon.js','.mutations[','running','packages','daemonLogPath','daemon.lock','info','daemon\x20is\x20stopped','startsWith','stopped','endsWith','number','sessions','SessionExportWorkbookData','Timed\x20out\x20waiting\x20for\x20daemon\x20startup\x20after\x20','modulePath','resolveExecutionPlaneOptions','synced\x20changeset','startedAt','manifest.json','isProcessAlive','2iuavHo','cliLogPath','view-host','sid','synced\x20changeset.revision\x20must\x20be\x20a\x20non-negative\x20integer','logger','ExportWorkbookFile','getSyncedChangesets','InvalidWorkbookPackagePathError','workbookId','serve','update','takeWrites','toRuntimeSessionInfo','ERR_WORKBOOK_PACKAGE_TRANSACTION_FAILED','WorkbookPackageAlreadyExistsError','exportWorkbookData','view-host.jsonl','serializeTouchedFile','session','now','Runner\x20startup\x20timeout','autoStart','loadWorkbookDataReplayPack','ERR_WORKBOOK_PACKAGE_ALREADY_EXISTS','set-init-workbook-data','nextRotationCheckAt','8pioqlm','result','delete','Workbook\x20package\x20is\x20busy:\x20','indexOf','code','created','univer-runtime','connect','session.loadWorkbookDataReplayPack','closed','loadWorkbook','logs','evaljs','source','format','reverse','max','fields','SessionCreateWorkbook','process_role','pid','DaemonRpcClient','6vMMLCX','type','initWorkbookData','src','RuntimeSessionCreated','socketPath','basePackage','sessionLoadWorkbook','Shutdown','keys','synced\x20changeset.baseRev\x20must\x20be\x20a\x20non-negative\x20integer','.sid\x20must\x20be\x20a\x20non-empty\x20string','UNIVER_CLI_BUILD_ID','buildId','toISOString','injectMeta','message','baseWorkbookData','localChangesets','length','RuntimeSessionDisposed','rpcTimeoutMs','Invalid\x20workbook\x20package\x20file\x20','createWorkbook','index.ts','runner-exit','RuntimeSession','entry:\x20','committing','1236905vqGSQP','initRev','loadWorkbookData','Daemon\x20RPC\x20timeout\x20for\x20','9iWAnrP','sendRpc','replaceLocalChangesets','runner','client','workbookName','operation','name','digest','univer\x20daemon\x20stop','WorkbookPackageFileMissingError','workspace-dist','once','local-changesets.jsonl','replace','write','destroyGraceMs','SIGKILL','hostname','NODE_OPTIONS','sessionExportWorkbookFile','spanId','RPC\x20timeout','params','getInitWorkbookData','packaged','error','parse','null','timeoutMs','startTimeoutMs','Runner\x20startup\x20error:\x20','topics','\x20must\x20be\x20an\x20object','rpc-response','daemonEntry','.tmp-','execPath','unref','browser','VITEST_POOL_ID','lockWrites','ENOENT','isArray','rotationInFlight','.reqId\x20must\x20be\x20a\x20positive\x20integer','entries','appendLocalMutations','ensure-workbook-replay-pack-loaded','fromAbsolutePath','daemon-','loadReplayPackIntoSession','get','synced\x20changeset.message\x20must\x20be\x20a\x20string\x20when\x20present','archive','getSessionCount','evalJs','sessionEvalJs','destroyAll','\x20is\x20being\x20modified\x20by\x20operation\x20','writeOptions','dist','sessionExportWorkbookData','mutation.params\x20must\x20be\x20an\x20object','Invalid\x20workbook\x20package\x20path:\x20','.tx-','runtime','pidPath','add','destroySession','exitCode','default','getLocalChangesets','unreachable','setManifest','initialize','\x20on\x20','UNIVER_DISTRIBUTION_CHANNEL','createConnection','ipc','univer-daemon-','localMutations','Runner\x20not\x20ready','sessionId','debug','starting','ready','12UbGSQt','Missing\x20transaction\x20value\x20for\x20','rotateIfNeeded','cli','626683msisRx','exit','fromEntries','status','rejectPendingRequests','UNIVER_CLI_VERSION','stderr','Daemon\x20process\x20entry\x20is\x20not\x20configured.\x20Pass\x20DaemonClientOptions.daemonEntry\x20from\x20the\x20CLI\x20runtime\x20manifest.','set-manifest','SessionGetWorkbook','1555932ivvooK','sessionDisposeWorkbook','object','VITEST_WORKER_ID','ERR_WORKBOOK_PACKAGE_FILE_MISSING','finally','child','clear','archiveDir','catch','exportWorkbookFile','rotationCheckIntervalMs','invalid\x20JSONL\x20at\x20line\x20','timeout','pendingRequests','relativePath','slice','trimEnd','logPath','method','manifest\x20must\x20be\x20an\x20object','replaceSyncedChangesets','main.ts','journal.json','internal','stringify','729447VDueVq','workbookPath','Runtime','filter','removed','mutation\x20must\x20be\x20an\x20object','replayPack','allSettled','cwd'];_0x17c6=function(){return _0x3cb94f;};return _0x17c6();}async function Wt(_0x21af39){const _0x3ca255=_0x36aff2;try{if(!(await _0x4ea62a(_0x21af39[_0x3ca255(0x20c)]))['isDirectory']()||(await _0x1b8daa(_0x21af39[_0x3ca255(0x20c)]))[_0x3ca255(0x2a0)]>0x0)throw new Et(_0x21af39[_0x3ca255(0x20c)]);}catch(_0xee1da4){if(Q(_0xee1da4)&&_0xee1da4[_0x3ca255(0x27b)]===_0x3ca255(0x2d8))return;throw _0xee1da4;}}async function U(_0x5f553f,_0x2f3832,_0xa4f9b8,_0x1d8847){await Gt(_0x5f553f,_0x2f3832,_0xa4f9b8);try{return await _0x1d8847();}finally{await Yt(_0x5f553f);}}async function Gt(_0x186962,_0x49c38e,_0x161c3e){const _0x1e59d1=_0x36aff2;let _0x3a7109=_0x161c3e[_0x1e59d1(0x19d)]??0x1388,_0x1cd8c8=_0x161c3e[_0x1e59d1(0x198)]??0x32,_0x3cfa23=Date[_0x1e59d1(0x26f)](),_0xc748c3=null;for(await _0x3e1c0c(_0x37fe88(W(_0x186962)),{'recursive':!0x0});;){try{await _0x3af822(W(_0x186962),Y({'pid':process[_0x1e59d1(0x28b)],'hostname':_0x1b1ff5(),'createdAt':new Date()[_0x1e59d1(0x29b)](),'operation':_0x49c38e}),{'encoding':_0x1e59d1(0x216),'flag':'wx'});return;}catch(_0x397c12){if(!Q(_0x397c12)||_0x397c12[_0x1e59d1(0x27b)]!=='EEXIST')throw _0x397c12;}let _0x420b0a=await Kt(_0x186962,_0x161c3e);if(_0xc748c3=_0x420b0a[_0x1e59d1(0x242)],!_0x420b0a[_0x1e59d1(0x18d)]){if(Date['now']()-_0x3cfa23>=_0x3a7109)throw new Dt(_0x186962[_0x1e59d1(0x20c)],_0xc748c3);await Xt(Math[_0x1e59d1(0x22f)](_0x1cd8c8,Math[_0x1e59d1(0x287)](_0x3a7109-(Date[_0x1e59d1(0x26f)]()-_0x3cfa23),0x0)));}}}async function Kt(_0x31f0a6,_0x3709fa){const _0x54ad8b=_0x36aff2;let _0x53992b=await qt(_0x31f0a6);return _0x53992b===null||_0x53992b['hostname']!==_0x1b1ff5()||Jt(_0x53992b[_0x54ad8b(0x28b)],_0x3709fa)?{'holder':_0x53992b,'removed':!0x1}:(await Yt(_0x31f0a6),{'holder':_0x53992b,'removed':!0x0});}async function qt(_0x24ab64){const _0xec91d5=_0x36aff2;try{let _0x3c6ac4=JSON[_0xec91d5(0x2c9)](await _0x1cbf14(W(_0x24ab64),_0xec91d5(0x216)));if(!on(_0x3c6ac4))return null;let _0x267c47=_0x3c6ac4[_0xec91d5(0x28b)],_0x197987=_0x3c6ac4[_0xec91d5(0x2c0)],_0x4c125f=_0x3c6ac4[_0xec91d5(0x1a0)],_0x3c8258=_0x3c6ac4[_0xec91d5(0x2b4)];return typeof _0x267c47!=_0xec91d5(0x251)||!Number[_0xec91d5(0x1fc)](_0x267c47)||typeof _0x197987!=_0xec91d5(0x23b)||typeof _0x4c125f!='string'||typeof _0x3c8258!=_0xec91d5(0x23b)?null:{'pid':_0x267c47,'hostname':_0x197987,'createdAt':_0x4c125f,'operation':_0x3c8258};}catch{return null;}}function Jt(_0x52e0e2,_0x5cd0d3){const _0x3a897a=_0x36aff2;if(_0x5cd0d3['isProcessAlive']!==void 0x0)return _0x5cd0d3[_0x3a897a(0x25a)](_0x52e0e2);try{return process[_0x3a897a(0x239)](_0x52e0e2,0x0),!0x0;}catch{return!0x1;}}async function Yt(_0x5eed1b){const _0x54b32e=_0x36aff2;await _0x38a832(W(_0x5eed1b),{'force':!0x0})[_0x54b32e(0x178)](()=>void 0x0);}function W(_0xeb543){const _0x387acd=_0x36aff2;return _0xeb543[_0x387acd(0x20c)]+'.lock';}async function Xt(_0x4e76a1){_0x4e76a1<=0x0||await new Promise(_0x2b033f=>{setTimeout(_0x2b033f,_0x4e76a1);});}var G=class{constructor(_0x1eba29,_0x331233,_0x3b7a48={'lockWrites':!0x0}){const _0x358806=_0x36aff2;this[_0x358806(0x22c)]=_0x1eba29,this[_0x358806(0x19f)]=_0x331233,this[_0x358806(0x2ea)]=_0x3b7a48;}async['getManifest'](){return await Qt(this['identity'],R,(_0x46457f,_0x134c87)=>kt(_0x46457f,_0x134c87));}async[_0x36aff2(0x2f8)](_0x355f99){const _0x4a21e3=_0x36aff2;await this[_0x4a21e3(0x2bd)](_0x4a21e3(0x16d),()=>J(this[_0x4a21e3(0x22c)],R,Y(_0x355f99)));}async[_0x36aff2(0x2c6)](){const _0x4d0f0a=_0x36aff2;return await Qt(this[_0x4d0f0a(0x22c)],z,en);}async['setInitWorkbookData'](_0x21251f){const _0x200f82=_0x36aff2;await this[_0x200f82(0x2bd)](_0x200f82(0x274),()=>J(this['identity'],z,Y(_0x21251f)));}async[_0x36aff2(0x1ea)](){const _0x56d0a6=_0x36aff2;return await K(this[_0x56d0a6(0x22c)],B,L);}async[_0x36aff2(0x2dd)](_0x29851e){const _0x37559d=_0x36aff2;_0x29851e[_0x37559d(0x2a0)]!==0x0&&await this[_0x37559d(0x2bd)](_0x37559d(0x1a8),()=>rn(this[_0x37559d(0x22c)],B,X(_0x29851e)));}async[_0x36aff2(0x1e3)](_0x457540){const _0x90a90f=_0x36aff2;await this[_0x90a90f(0x2bd)]('replace-local-mutations',()=>J(this['identity'],B,X(_0x457540)));}async[_0x36aff2(0x2f6)](){const _0x34748e=_0x36aff2;return await K(this[_0x34748e(0x22c)],V,Nt);}async[_0x36aff2(0x199)](_0x3d5a76){const _0x4369ae=_0x36aff2;await this[_0x4369ae(0x2bd)]('append-local-changeset',()=>rn(this['identity'],V,X([_0x3d5a76])));}async['replaceLocalChangesets'](_0x472fe5){const _0x54d065=_0x36aff2;await this[_0x54d065(0x2bd)](_0x54d065(0x1c7),()=>J(this[_0x54d065(0x22c)],V,X(_0x472fe5)));}async[_0x36aff2(0x262)](){const _0x3dd5f3=_0x36aff2;return await K(this[_0x3dd5f3(0x22c)],H,Pt);}async['appendSyncedChangesets'](_0x3b9e5c){const _0x355ebd=_0x36aff2;_0x3b9e5c[_0x355ebd(0x2a0)]!==0x0&&await this['write'](_0x355ebd(0x1e6),()=>rn(this[_0x355ebd(0x22c)],H,X(_0x3b9e5c)));}async[_0x36aff2(0x184)](_0x433669){const _0x59e1af=_0x36aff2;await this[_0x59e1af(0x2bd)]('replace-synced-changesets',()=>J(this[_0x59e1af(0x22c)],H,X(_0x433669)));}async[_0x36aff2(0x2bd)](_0x1918f9,_0x505c63){const _0x2e1807=_0x36aff2;if(!this[_0x2e1807(0x2ea)][_0x2e1807(0x2d7)]){await _0x505c63();return;}await U(this[_0x2e1807(0x22c)],_0x1918f9,this[_0x2e1807(0x19f)],_0x505c63);}},Zt=class{[_0x36aff2(0x22c)];[_0x36aff2(0x209)]=new Set();[_0x36aff2(0x28f)];[_0x36aff2(0x29f)];['localMutations'];[_0x36aff2(0x219)];[_0x36aff2(0x1ec)];constructor(_0x5e223c){const _0x52a8a4=_0x36aff2;this[_0x52a8a4(0x293)]=_0x5e223c,this[_0x52a8a4(0x22c)]=_0x5e223c[_0x52a8a4(0x22c)];}async['getManifest'](){const _0x3687c9=_0x36aff2;return this[_0x3687c9(0x219)]??=await this[_0x3687c9(0x293)]['getManifest'](),this[_0x3687c9(0x219)];}async[_0x36aff2(0x2f8)](_0x276f32){const _0xc91b47=_0x36aff2;this[_0xc91b47(0x219)]=_0x276f32,this[_0xc91b47(0x209)][_0xc91b47(0x2f2)](_0xc91b47(0x219));}async[_0x36aff2(0x2c6)](){const _0x392dbe=_0x36aff2;return this['initWorkbookData']??=await this[_0x392dbe(0x293)][_0x392dbe(0x2c6)](),this[_0x392dbe(0x28f)];}async[_0x36aff2(0x1e5)](_0x4265e6){const _0x55f155=_0x36aff2;this['initWorkbookData']=_0x4265e6,this[_0x55f155(0x209)][_0x55f155(0x2f2)](_0x55f155(0x28f));}async['getLocalMutations'](){const _0x15e109=_0x36aff2;return this[_0x15e109(0x2ff)]??=await this['basePackage'][_0x15e109(0x1ea)](),this[_0x15e109(0x2ff)];}async[_0x36aff2(0x2dd)](_0x1c0ca6){const _0x52330b=_0x36aff2;_0x1c0ca6['length']!==0x0&&(this[_0x52330b(0x2ff)]=[...await this[_0x52330b(0x1ea)](),..._0x1c0ca6],this['touchedFiles'][_0x52330b(0x2f2)](_0x52330b(0x2ff)));}async['replaceLocalMutations'](_0x2c6d54){const _0x1a8454=_0x36aff2;this['localMutations']=[..._0x2c6d54],this[_0x1a8454(0x209)][_0x1a8454(0x2f2)](_0x1a8454(0x2ff));}async[_0x36aff2(0x2f6)](){const _0x374458=_0x36aff2;return this['localChangesets']??=await this[_0x374458(0x293)][_0x374458(0x2f6)](),this[_0x374458(0x29f)];}async['appendLocalChangeset'](_0x10468f){const _0x5787e5=_0x36aff2;this['localChangesets']=[...await this[_0x5787e5(0x2f6)](),_0x10468f],this[_0x5787e5(0x209)][_0x5787e5(0x2f2)](_0x5787e5(0x29f));}async[_0x36aff2(0x2b0)](_0x410967){const _0x1fd584=_0x36aff2;this[_0x1fd584(0x29f)]=[..._0x410967],this[_0x1fd584(0x209)][_0x1fd584(0x2f2)]('localChangesets');}async[_0x36aff2(0x262)](){const _0x38d2a5=_0x36aff2;return this['syncedChangesets']??=await this['basePackage']['getSyncedChangesets'](),this[_0x38d2a5(0x1ec)];}async['appendSyncedChangesets'](_0x345af2){const _0x43681c=_0x36aff2;_0x345af2[_0x43681c(0x2a0)]!==0x0&&(this['syncedChangesets']=[...await this[_0x43681c(0x262)](),..._0x345af2],this[_0x43681c(0x209)][_0x43681c(0x2f2)](_0x43681c(0x1ec)));}async['replaceSyncedChangesets'](_0x47bea2){const _0x286307=_0x36aff2;this[_0x286307(0x1ec)]=[..._0x47bea2],this[_0x286307(0x209)][_0x286307(0x2f2)]('syncedChangesets');}[_0x36aff2(0x267)](){const _0x4f9598=_0x36aff2;let _0x3a04fb=new Map();for(let _0x294a15 of this[_0x4f9598(0x209)])_0x3a04fb[_0x4f9598(0x1fd)](an(_0x294a15),this[_0x4f9598(0x26d)](_0x294a15));return _0x3a04fb;}['serializeTouchedFile'](_0x33abd2){const _0x5cbc76=_0x36aff2;switch(_0x33abd2){case _0x5cbc76(0x219):return Y(Z(this['manifest'],_0x33abd2));case _0x5cbc76(0x28f):return Y(Z(this[_0x5cbc76(0x28f)],_0x33abd2));case _0x5cbc76(0x2ff):return X(Z(this[_0x5cbc76(0x2ff)],_0x33abd2));case _0x5cbc76(0x29f):return X(Z(this['localChangesets'],_0x33abd2));case _0x5cbc76(0x1ec):return X(Z(this[_0x5cbc76(0x1ec)],_0x33abd2));}}};async function Qt(_0x415afa,_0x35d7bf,_0x3686bd){const _0x45a145=_0x36aff2;let _0x1b9b1c=_0x37d775(_0x415afa[_0x45a145(0x20c)],_0x35d7bf),_0x5e25e4=await q(_0x1b9b1c),_0x46eed8;try{_0x46eed8=JSON[_0x45a145(0x2c9)](_0x5e25e4);}catch(_0x5a2d7c){throw new I(_0x1b9b1c,_0x5a2d7c instanceof Error?_0x5a2d7c[_0x45a145(0x29d)]:String(_0x5a2d7c),_0x5a2d7c instanceof Error?{'cause':_0x5a2d7c}:void 0x0);}return _0x3686bd(_0x46eed8,_0x1b9b1c);}async function K(_0x330bf3,_0x306818,_0x2b10e0){return(await $t(_0x330bf3,_0x306818))['map'](({value:_0x7dcb3a,label:_0x139371})=>_0x2b10e0(_0x7dcb3a,_0x139371));}async function $t(_0x2ab5d9,_0x3726c6){const _0x95eb3b=_0x36aff2;let _0xfd5ef8=_0x37d775(_0x2ab5d9[_0x95eb3b(0x20c)],_0x3726c6),_0x5f1f2a=(await q(_0xfd5ef8))['trim']();return _0x5f1f2a['length']===0x0?[]:_0x5f1f2a[_0x95eb3b(0x243)](/\r?\n/u)[_0x95eb3b(0x1d5)]((_0x48127b,_0x2a4cb5)=>{const _0x463c5c=_0x95eb3b;let _0x3cc2d0;try{_0x3cc2d0=JSON['parse'](_0x48127b);}catch(_0x430966){throw new I(_0xfd5ef8,_0x463c5c(0x17b)+(_0x2a4cb5+0x1)+':\x20'+(_0x430966 instanceof Error?_0x430966[_0x463c5c(0x29d)]:String(_0x430966)),_0x430966 instanceof Error?{'cause':_0x430966}:void 0x0);}return{'value':_0x3cc2d0,'label':_0xfd5ef8+':'+(_0x2a4cb5+0x1)};});}async function q(_0xaca1f7){const _0x107fa5=_0x36aff2;try{if(!(await _0x4ea62a(_0xaca1f7))['isFile']())throw new wt(_0xaca1f7);return await _0x1cbf14(_0xaca1f7,'utf8');}catch(_0x486362){throw Q(_0x486362)&&_0x486362['code']===_0x107fa5(0x2d8)?new wt(_0xaca1f7):_0x486362;}}function en(_0xbb4c63,_0x339b9c){const _0x282100=_0x36aff2;if(typeof _0xbb4c63!=_0x282100(0x171)||!_0xbb4c63||Array[_0x282100(0x2d9)](_0xbb4c63))throw new I(_0x339b9c,_0x282100(0x205));return _0xbb4c63;}async function tn(_0xa756c4,_0x5945b5,_0x174e3f){const _0x52fa46=_0x36aff2;if(_0x5945b5[_0x52fa46(0x1bc)]===0x0)return;let _0x1ddef4=_0xa756c4['absolutePath']+_0x52fa46(0x2ef)+process[_0x52fa46(0x28b)]+'-'+_0xc88da5(),_0x5222ef=await Promise[_0x52fa46(0x1ed)]([..._0x5945b5[_0x52fa46(0x296)]()][_0x52fa46(0x1d5)](async _0x3c2ed7=>({'relativePath':_0x3c2ed7,'originalContent':await q(_0x37d775(_0xa756c4[_0x52fa46(0x20c)],_0x3c2ed7))})));await _0x3e1c0c(_0x1ddef4,{'recursive':!0x0}),await nn(_0x1ddef4,{'state':_0x52fa46(0x2a9),'files':_0x5222ef});try{for(let [_0x13097a,_0x5038e0]of _0x5945b5)await _0x174e3f['beforeCommitFile']?.(_0x13097a),await J(_0xa756c4,_0x13097a,_0x5038e0);await nn(_0x1ddef4,{'state':'committed','files':_0x5222ef});}catch(_0xc20fff){try{for(let _0x51c8a8 of _0x5222ef)await J(_0xa756c4,_0x51c8a8[_0x52fa46(0x17e)],_0x51c8a8[_0x52fa46(0x192)]);await nn(_0x1ddef4,{'state':_0x52fa46(0x1fb),'files':_0x5222ef});}catch(_0x3997b5){throw Error((_0xc20fff instanceof Error?_0xc20fff[_0x52fa46(0x29d)]:String(_0xc20fff))+';\x20rollback\x20failed:\x20'+(_0x3997b5 instanceof Error?_0x3997b5[_0x52fa46(0x29d)]:String(_0x3997b5)),_0xc20fff instanceof Error?{'cause':_0xc20fff}:void 0x0);}throw _0xc20fff;}finally{await _0x38a832(_0x1ddef4,{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0);}}async function nn(_0x3f17ef,_0x94ba1c){const _0x409fce=_0x36aff2;await _0x3af822(_0x37d775(_0x3f17ef,_0x409fce(0x186)),Y(_0x94ba1c),_0x409fce(0x216));}async function rn(_0x103501,_0x341ca4,_0x5bc0bc){const _0x46da8a=_0x36aff2;await _0x3e1c0c(_0x103501['absolutePath'],{'recursive':!0x0}),await _0x5d4cf5(_0x37d775(_0x103501[_0x46da8a(0x20c)],_0x341ca4),_0x5bc0bc,_0x46da8a(0x216));}async function J(_0x3d050d,_0x41c710,_0x20e773){const _0x41f13a=_0x36aff2;let _0x1c1c9b=_0x37d775(_0x3d050d[_0x41f13a(0x20c)],_0x41c710),_0x4f209a=_0x1c1c9b+_0x41f13a(0x2d2)+process['pid']+'-'+_0xc88da5();try{await _0x3e1c0c(_0x37fe88(_0x1c1c9b),{'recursive':!0x0}),await _0x3af822(_0x4f209a,_0x20e773,_0x41f13a(0x216)),await _0x48a321(_0x4f209a,_0x1c1c9b);}finally{await _0x38a832(_0x4f209a,{'force':!0x0})['catch'](()=>void 0x0);}}function an(_0x376af6){const _0x20bb4b=_0x36aff2;switch(_0x376af6){case _0x20bb4b(0x219):return R;case _0x20bb4b(0x28f):return z;case _0x20bb4b(0x2ff):return B;case _0x20bb4b(0x29f):return V;case _0x20bb4b(0x1ec):return H;}}function Y(_0x4c9dc3){const _0xc724af=_0x36aff2;return JSON[_0xc724af(0x188)](_0x4c9dc3)+'\x0a';}function X(_0x275759){const _0x1e9839=_0x36aff2;return _0x275759['length']===0x0?'':_0x275759['map'](_0x3def9b=>JSON[_0x1e9839(0x188)](_0x3def9b))[_0x1e9839(0x20b)]('\x0a')+'\x0a';}function Z(_0x5e5a70,_0x4ae15e){const _0x1d30c1=_0x36aff2;if(_0x5e5a70===void 0x0)throw Error(_0x1d30c1(0x306)+_0x4ae15e);return _0x5e5a70;}function Q(_0x348f94){const _0x165bd5=_0x36aff2;return _0x348f94 instanceof Error&&_0x165bd5(0x27b)in _0x348f94;}function on(_0x2751f0){const _0x18c368=_0x36aff2;return typeof _0x2751f0==_0x18c368(0x171)&&!!_0x2751f0&&!Array[_0x18c368(0x2d9)](_0x2751f0);}var sn=_0x228c0a(import.meta.url),$=_n(_0x37fe88(_0x51abce(import.meta.url)));function cn(_0x1d130f=process.env){const _0x415b9b=_0x36aff2;let _0x2b8946=un(_0x1d130f);return _0x2b8946===_0x415b9b(0x284)?dn():_0x2b8946==='workspace-dist'?fn():mn();}function ln(_0x2f7a3e=process.env){const _0x48f9aa=_0x36aff2;return{'daemonEntry':cn(_0x2f7a3e)[_0x48f9aa(0x2d1)]};}function un(_0x1a3dbe=process.env){const _0x4c8022=_0x36aff2;let _0x549152=_0x1a3dbe['UNIVER_CLI_RUNTIME_MODE']?.[_0x4c8022(0x230)]();return _0x549152===_0x4c8022(0x284)||_0x549152==='workspace-dist'||_0x549152===_0x4c8022(0x2c7)?_0x549152:_0x51abce(import.meta.url)[_0x4c8022(0x250)]('.ts')?_0x4c8022(0x284):gn($)?_0x4c8022(0x2b9):_0x4c8022(0x2c7);}function dn(){const _0x2806f3=_0x36aff2;let _0x2f9646=_0x36a426($,'../..'),_0x3cb4b7=sn[_0x2806f3(0x22a)]('tsx');return{'mode':_0x2806f3(0x284),'packageRoot':$,'cliEntry':{'execArgv':[_0x2806f3(0x244),_0x3cb4b7],'modulePath':_0x37d775($,_0x2806f3(0x290),_0x2806f3(0x2a5))},'daemonEntry':{'execArgv':[_0x2806f3(0x244),_0x3cb4b7],'modulePath':_0x37d775($,_0x2806f3(0x290),_0x2806f3(0x1a3),_0x2806f3(0x185))},'runtimeExecutionPlaneEntry':{'execArgv':[_0x2806f3(0x244),_0x3cb4b7],'modulePath':_0x37d775(_0x2f9646,_0x2806f3(0x249),_0x2806f3(0x27d),_0x2806f3(0x290),_0x2806f3(0x1f3),'main.ts')},'runHelpTopicsRoot':_0x37d775($,_0x2806f3(0x290),_0x2806f3(0x1f7),_0x2806f3(0x2ce)),'viewAssetsRoot':hn(_0x2f9646)};}function fn(){const _0x1f9f2a=_0x36aff2;let _0x64823a=pn($),_0x808357=_0x37d775(_0x64823a,'internal','univer-runner.js');return{'mode':_0x1f9f2a(0x2b9),'packageRoot':$,'cliEntry':{'execArgv':[],'modulePath':_0x37d775(_0x64823a,_0x1f9f2a(0x187),_0x1f9f2a(0x211))},'daemonEntry':{'execArgv':[],'modulePath':_0x37d775(_0x64823a,_0x1f9f2a(0x187),'daemon.js')},'runtimeExecutionPlaneEntry':{'execArgv':[],'modulePath':_0x808357},'runHelpTopicsRoot':_0x37d775(_0x64823a,_0x1f9f2a(0x1f7),_0x1f9f2a(0x2ce)),'viewAssetsRoot':_0x37d775(_0x64823a,'view',_0x1f9f2a(0x2d5))};}function pn(_0x2fa948){return gn(_0x2fa948)?_0x37d775(_0x2fa948,'dist'):_0x2fa948;}function mn(){const _0x45bf9b=_0x36aff2;return{'mode':_0x45bf9b(0x2c7),'packageRoot':$,'cliEntry':{'execArgv':[],'modulePath':_0x37d775($,'internal','cli.js')},'daemonEntry':{'execArgv':[],'modulePath':_0x37d775($,_0x45bf9b(0x187),_0x45bf9b(0x246))},'runtimeExecutionPlaneEntry':{'execArgv':[],'modulePath':_0x37d775($,_0x45bf9b(0x187),'univer-runner.js')},'runHelpTopicsRoot':_0x37d775($,_0x45bf9b(0x1f7),_0x45bf9b(0x2ce)),'viewAssetsRoot':_0x37d775($,'view',_0x45bf9b(0x2d5))};}function hn(_0x2df31a){const _0xd56786=_0x36aff2;let _0x48896b=_0x37d775(_0x2df31a,_0xd56786(0x249),'view-host',_0xd56786(0x2eb),_0xd56786(0x2d5));return _0x3408b8(_0x48896b)?_0x48896b:_0x37d775(_0x2df31a,_0xd56786(0x249),_0xd56786(0x25d),_0xd56786(0x290),_0xd56786(0x2d5));}function gn(_0x300c5a){const _0x4b6c39=_0x36aff2;return _0x4f5863(_0x300c5a)==='cli'&&_0x4f5863(_0x37fe88(_0x300c5a))===_0x4b6c39(0x21d);}function _n(_0x3f641e){const _0xf9f5c5=_0x36aff2;let _0x5b0c55=_0x3f641e;for(;;){let _0x2408a9=_0x37d775(_0x5b0c55,'package.json');if(_0x3408b8(_0x2408a9)&&JSON[_0xf9f5c5(0x2c9)](_0x3aca60(_0x2408a9,'utf8'))[_0xf9f5c5(0x1f2)]?.[_0xf9f5c5(0x1b3)]!==void 0x0)return _0x5b0c55;let _0x3d9da0=_0x37fe88(_0x5b0c55);if(_0x3d9da0===_0x5b0c55)throw Error('Unable\x20to\x20resolve\x20univer-cli\x20package\x20root\x20from\x20'+_0x3f641e);_0x5b0c55=_0x3d9da0;}}export{_t as a,We as c,De as d,S as f,St as i,w as l,x as m,cn as n,Ue as o,ge as p,Ut as r,He as s,ln as t,C as u};