@univer-cli/univer-collaboration-runtime 1.0.0-rc.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +12 -12
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3d1750=_0x2899;(function(_0x50d3a1,_0x4a5209){const _0x1b17d9=_0x2899,_0x236288=_0x50d3a1();while(!![]){try{const _0xf2edee=-parseInt(_0x1b17d9(0x23f))/0x1*(parseInt(_0x1b17d9(0x166))/0x2)+parseInt(_0x1b17d9(0x240))/0x3*(-parseInt(_0x1b17d9(0x159))/0x4)+-parseInt(_0x1b17d9(0x15c))/0x5+-parseInt(_0x1b17d9(0x205))/0x6+-parseInt(_0x1b17d9(0x18a))/0x7+-parseInt(_0x1b17d9(0x237))/0x8*(-parseInt(_0x1b17d9(0x110))/0x9)+parseInt(_0x1b17d9(0x162))/0xa;if(_0xf2edee===_0x4a5209)break;else _0x236288['push'](_0x236288['shift']());}catch(_0x18c537){_0x236288['push'](_0x236288['shift']());}}}(_0x3d14,0x51d81));import{CommandType as _0x3428b1,DependentOn as _0x5418a4,ICommandService as _0x8f1c98,IUniverInstanceService as _0x399d02,Inject as _0x132537,Injector as _0x3f90a4,Plugin as _0x1d55c6,UniverInstanceType as _0x550821,registerDependencies as _0x5dfa11,sequenceExecute as _0xf7bb5f,toDisposable as _0x59fe24}from'@univerjs/core';import{CompressMutationService as _0x7d731a,ISnapshotServerService as _0x1915ff,ITransformService as _0x3b833a,RevertRevisionMutation as _0x3038df,RevisionService as _0x404d94,SnapshotService as _0x9d3c59,UniverCollaborationPlugin as _0x20bf45,isTransformMutationsSuccess as _0x5941e5,parseChangesetToProtocol as _0x1cd93e,parseMutationToProtocol as _0x2dcdf0,parseProtocolChangeset as _0x1575f4,transformSnapshotToBaseData as _0x2d6862,transformSnapshotToBoardData as _0x206dca,transformSnapshotToDocumentData as _0x13acb9,transformSnapshotToSlideData as _0xb2ce4a,transformSnapshotToWorkbookData as _0x13e39f}from'@univerjs-pro/collaboration';import{FormulaCalculationSessionService as _0x1ae1f2}from'@univerjs/engine-formula';import{CmdRspCode as _0x22ffe8,CombCmd as _0x526731,isError as _0x24cb5b}from'@univerjs/protocol';import{PersistFormulaLastValuesCommand as _0x9eac81}from'@univerjs-pro/engine-formula';import{DocStateChangeManagerService as _0x297c2e,RichTextEditingMutation as _0x58b414}from'@univerjs/docs';import{IRenderManagerService as _0x11b6c3}from'@univerjs/engine-render';import{FUniver as _0x25264f}from'@univerjs/core/facade';import'@univerjs-pro/bases/facade';import'@univerjs-pro/boards/facade';import'@univerjs-pro/slides/facade';import'@univerjs/docs/facade';import'@univerjs/sheets/facade';import _0x9b6041 from'@oxc-project/runtime/helpers/decorateParam';import _0x53d4b2 from'@oxc-project/runtime/helpers/decorate';var j=class extends Error{[_0x3d1750(0x1b5)];[_0x3d1750(0x21e)];constructor(_0x2f1d31,_0x2b68fd,_0x38d5c5={}){const _0x36d269=_0x3d1750;super(_0x2b68fd,_0x38d5c5),this['name']='CollaborationRuntimeError',this[_0x36d269(0x1b5)]=_0x2f1d31,this[_0x36d269(0x21e)]=_0x38d5c5[_0x36d269(0x21e)]??!0x1;}},se=class{[_0x3d1750(0x227)];[_0x3d1750(0x256)];[_0x3d1750(0x1e2)]=[];['_disposables']=[];[_0x3d1750(0x14c)]=0x0;constructor(_0x489a03,_0xed8360,_0x3cee19){const _0x89e1f6=_0x3d1750;this[_0x89e1f6(0x227)]=_0x489a03,this[_0x89e1f6(0x256)]=_0xed8360,this[_0x89e1f6(0x10e)][_0x89e1f6(0x12b)](_0x489a03[_0x89e1f6(0x11d)]['onMutationExecutedForCollab']((_0x470813,_0x4ac3d1)=>{const _0x35d2f2=_0x89e1f6;this[_0x35d2f2(0x222)](_0x470813,_0x4ac3d1,_0x3cee19);})),_0x3cee19===_0x550821[_0x89e1f6(0x1c4)]&&(_0x489a03[_0x89e1f6(0x1c7)][_0x89e1f6(0x257)](_0x11b6c3),this['_subscribeToDocumentState']());}get['pending'](){const _0x2244d6=_0x3d1750;return this[_0x2244d6(0x1e2)];}[_0x3d1750(0x1c5)](_0x44cc96){const _0x106c9b=_0x3d1750;return this[_0x106c9b(0x1e2)]['slice'](_0x44cc96);}[_0x3d1750(0x1e8)](_0x35a810){const _0x2057ee=_0x3d1750;this[_0x2057ee(0x1e2)]['splice'](0x0,this[_0x2057ee(0x1e2)][_0x2057ee(0x171)],..._0x35a810);}[_0x3d1750(0xfe)](){const _0x9e122=_0x3d1750;return this[_0x9e122(0x1e2)][_0x9e122(0x24b)](0x0);}[_0x3d1750(0xe1)](_0x797e36){const _0x1975eb=_0x3d1750;this[_0x1975eb(0x1e2)][_0x1975eb(0x239)](..._0x797e36);}async['suppress'](_0x171c4e){const _0x2eb80d=_0x3d1750;this[_0x2eb80d(0x14c)]+=0x1;try{return await _0x171c4e();}finally{--this[_0x2eb80d(0x14c)];}}[_0x3d1750(0x1c1)](){for(let _0x2f3f99 of this['_disposables']['splice'](0x0))_0x2f3f99['dispose']();}['_captureCommandMutation'](_0x5106ca,_0x4693e4,_0x4cec3d){const _0xe800dd=_0x3d1750;if(this[_0xe800dd(0x14c)]>0x0||_0x5106ca[_0xe800dd(0x178)]!==_0x3428b1[_0xe800dd(0x217)]||_0x4693e4?.[_0xe800dd(0xf6)]||_0x4693e4?.[_0xe800dd(0xea)]||_0x4693e4?.[_0xe800dd(0x148)])return;let _0x5eecf9=_0x5106ca[_0xe800dd(0x1fa)];if(_0x5eecf9?.['unitId']!==void 0x0&&_0x5eecf9['unitId']!==this[_0xe800dd(0x256)]){if(_0x5eecf9[_0xe800dd(0x111)]===_0x9eac81['id'])return;throw new j('COLLABORATION_INVALID_INPUT',_0xe800dd(0x192)+this[_0xe800dd(0x256)]+_0xe800dd(0x244)+_0x5106ca['id']+_0xe800dd(0x1ee)+String(_0x5eecf9[_0xe800dd(0xeb)]));}if(_0x5eecf9?.[_0xe800dd(0xeb)]===void 0x0||_0x4cec3d===_0x550821[_0xe800dd(0x1c4)]&&_0x5106ca['id']===_0x58b414['id'])return;if(_0x5106ca['id']===_0x3038df['id'])throw new j(_0xe800dd(0x1b1),_0xe800dd(0x1c6));let _0x4d197e=_0x5106ca,_0x245833=this[_0xe800dd(0x227)][_0xe800dd(0x1ca)][_0xe800dd(0x21c)][_0xe800dd(0x254)]()[_0xe800dd(0x1c3)],_0x4a7105=(this['_kernel']['compressMutationService'][_0xe800dd(0x21c)]['fetchThroughInterceptors'](_0x245833)([_0x4d197e],this[_0xe800dd(0x227)][_0xe800dd(0x248)])??[_0x4d197e])[0x0];_0x4a7105&&this[_0xe800dd(0x1e2)][_0xe800dd(0x12b)](_0x2dcdf0(_0x4a7105));}[_0x3d1750(0x1cd)](){const _0x1b16e4=_0x3d1750;let _0x24708f=this[_0x1b16e4(0x227)][_0x1b16e4(0x1c7)][_0x1b16e4(0x257)](_0x297c2e)['docStateChange$'][_0x1b16e4(0x229)](_0x1f7f03=>{const _0x38117d=_0x1b16e4;if(this[_0x38117d(0x14c)]>0x0||_0x1f7f03?.[_0x38117d(0xeb)]!==this['_unitId'])return;let _0x406acc={'id':_0x1f7f03['commandId'],'params':{'actions':_0x1f7f03[_0x38117d(0x1ba)]['actions'],'textRanges':null,'unitId':_0x1f7f03[_0x38117d(0xeb)]},'type':_0x3428b1[_0x38117d(0x217)]};this[_0x38117d(0x1e2)][_0x38117d(0x12b)](_0x2dcdf0(_0x406acc));});this['_disposables'][_0x1b16e4(0x12b)](_0x59fe24(()=>_0x24708f[_0x1b16e4(0x1a9)]()));}},ce=new Set(['formula.mutation.set-trigger-formula-calculation-start',_0x3d1750(0x1a0),_0x3d1750(0x1f5),'formula.mutation.set-calculation-result','formula.mutation.set-array-formula-data',_0x3d1750(0x1a5),_0x3d1750(0x214)]),le=new Set(['createBase',_0x3d1750(0xfb),'createWorkbook',_0x3d1750(0x1f7),_0x3d1750(0x1b3),'createUniverSheet',_0x3d1750(0x145)]);function ue(_0x6d93a9,_0x2947eb,_0x240874){const _0x4d5b1e=_0x3d1750;let _0x4fa8f1=_0x25264f[_0x4d5b1e(0x17e)](_0x6d93a9);return{async 'execute'(_0x56efb7,_0x240642){const _0x39f147=_0x4d5b1e;if(_0x56efb7[_0x39f147(0x171)]>_0x240874)throw new j(_0x39f147(0x1b1),_0x39f147(0x11e)+_0x240874+_0x39f147(0x134));let _0x501925=_0x240642===_0x39f147(0x16e)?M(_0x4fa8f1):void 0x0,_0x5d96b7=de(_0x4fa8f1,_0x2947eb);try{return await Function(_0x39f147(0x1b4),_0x39f147(0x1af)+_0x56efb7+_0x39f147(0x1d1))(_0x5d96b7);}finally{_0x501925?.['dispose']();}}};}function _0x2899(_0x1f5451,_0x1de416){_0x1f5451=_0x1f5451-0xde;const _0x3d141f=_0x3d14();let _0x289944=_0x3d141f[_0x1f5451];return _0x289944;}function de(_0x562f2a,_0x4af196){return new Proxy(_0x562f2a,{'get'(_0xab1151,_0x218a7f,_0x207d55){const _0x4324c5=_0x2899;return le['has'](_0x218a7f)?()=>{const _0x6859dd=_0x2899;throw new j(_0x6859dd(0x1b1),_0x6859dd(0x103)+_0x4af196+'\x20cannot\x20call\x20'+String(_0x218a7f));}:Reflect[_0x4324c5(0x257)](_0xab1151,_0x218a7f,_0x207d55);}});}function M(_0x43d8e4){const _0x15bf45=_0x3d1750;return _0x43d8e4['addEvent'](_0x43d8e4[_0x15bf45(0x242)]['BeforeCommandExecute'],_0x4a136f=>{const _0x2c16fc=_0x15bf45;let _0x14ce9e=_0x4a136f;if(N(_0x14ce9e))throw _0x14ce9e[_0x2c16fc(0x117)]=!0x0,new j(_0x2c16fc(0x1b1),_0x2c16fc(0x24a)+_0x14ce9e['id']);});}function N(_0x39a958){const _0x4825f0=_0x3d1750;return _0x39a958[_0x4825f0(0x178)]===_0x3428b1[_0x4825f0(0x149)]||_0x39a958[_0x4825f0(0x178)]===_0x3428b1[_0x4825f0(0x217)]&&!ce[_0x4825f0(0x224)](_0x39a958['id']);}function P(_0x23ebf7){const _0x1b8dd3=_0x3d1750;if(_0x23ebf7===void 0x0)return null;if(_0x23ebf7===null||typeof _0x23ebf7==_0x1b8dd3(0x1a4)||typeof _0x23ebf7==_0x1b8dd3(0x1eb))return _0x23ebf7;if(typeof _0x23ebf7==_0x1b8dd3(0x1ab)){if(Number[_0x1b8dd3(0x1d2)](_0x23ebf7))return _0x23ebf7;throw I();}if(Array[_0x1b8dd3(0x142)](_0x23ebf7))return _0x23ebf7['map'](P);if(F(_0x23ebf7))return Object[_0x1b8dd3(0xe4)](Object[_0x1b8dd3(0x157)](_0x23ebf7)[_0x1b8dd3(0x215)](([_0xf8ef53,_0x590204])=>[_0xf8ef53,P(_0x590204)]));throw I();}function F(_0x37300f){const _0x4f1eff=_0x3d1750;if(typeof _0x37300f!=_0x4f1eff(0x1c2)||!_0x37300f)return!0x1;let _0x2566a6=Object['getPrototypeOf'](_0x37300f);return _0x2566a6===Object['prototype']||_0x2566a6===null;}function I(){const _0xfb1006=_0x3d1750;return new j('COLLABORATION_INVALID_INPUT',_0xfb1006(0x1f6));}var L=class{[_0x3d1750(0x12a)]=Promise['resolve']();[_0x3d1750(0xf3)](_0x37882d){const _0x18fdd9=_0x3d1750;let _0x3aaf74=this[_0x18fdd9(0x12a)][_0x18fdd9(0x1e1)](_0x37882d,_0x37882d);return this[_0x18fdd9(0x12a)]=_0x3aaf74[_0x18fdd9(0x1e1)](()=>void 0x0,()=>void 0x0),_0x3aaf74;}};function R(_0x3948ae,_0x2f5331,_0x4a45fc,_0x23c571){const _0xa7fc05=_0x3d1750;if(!Array[_0xa7fc05(0x142)](_0x3948ae))throw new j(_0xa7fc05(0x23c),'Backend\x20changesets\x20must\x20be\x20an\x20array');let _0x1449d9=[..._0x3948ae]['sort']((_0x5b029c,_0x222f67)=>_0x5b029c[_0xa7fc05(0x1e9)]-_0x222f67[_0xa7fc05(0x1e9)]),_0x3b7fec=_0x23c571;for(let _0x42be85 of _0x1449d9){if(!_0x42be85||typeof _0x42be85!='object'||!Array[_0xa7fc05(0x142)](_0x42be85[_0xa7fc05(0x13a)])||_0x42be85[_0xa7fc05(0x13a)][_0xa7fc05(0x124)](_0x5261=>!_0x5261||typeof _0x5261!=_0xa7fc05(0x1c2)||!('id'in _0x5261)||typeof _0x5261['id']!=_0xa7fc05(0x1eb)||!('data'in _0x5261)||typeof _0x5261[_0xa7fc05(0x1be)]!=_0xa7fc05(0x1eb))||!Number[_0xa7fc05(0x1df)](_0x42be85['baseRev'])||!Number[_0xa7fc05(0x1df)](_0x42be85[_0xa7fc05(0x1e9)])||_0x42be85[_0xa7fc05(0x120)]!==_0x2f5331||_0x42be85['type']!==_0x4a45fc||_0x42be85[_0xa7fc05(0x246)]!==_0x3b7fec||_0x42be85['revision']!==_0x3b7fec+0x1)throw new j('COLLABORATION_PROTOCOL_ERROR',_0xa7fc05(0x114));_0x3b7fec=_0x42be85[_0xa7fc05(0x1e9)];}return _0x1449d9;}function z(_0x576fe8){const _0xbdfd9f=_0x3d1750;return{'baseRevision':_0x576fe8[_0xbdfd9f(0x246)],'mutationCount':_0x576fe8['mutations'][_0xbdfd9f(0x171)],'revision':_0x576fe8['revision'],..._0x576fe8[_0xbdfd9f(0x133)]===void 0x0?{}:{'sid':_0x576fe8[_0xbdfd9f(0x133)]},..._0x576fe8['reqId']===void 0x0?{}:{'reqId':_0x576fe8['reqId']}};}function B(_0x58837a,_0x5c75e3,_0x1ced97,_0x19ff1a,_0x56b8a5,_0x2a6c18=_0x3d1750(0x14f)){const _0x29fdd0=_0x3d1750;if(_0x56b8a5['some'](_0x5a3e53=>_0x5a3e53[_0x29fdd0(0x13a)][_0x29fdd0(0x124)](_0xe14974=>_0xe14974['id']===_0x3038df['id'])))throw new j('COLLABORATION_PROTOCOL_ERROR',_0x29fdd0(0x139));let _0x191e2b=_0x19ff1a;for(let _0x4d0cc1 of _0x56b8a5){let _0x23cb51=_0x191e2b+0x1;if(_0x4d0cc1[_0x29fdd0(0x120)]!==_0x5c75e3||_0x4d0cc1[_0x29fdd0(0x178)]!==_0x1ced97||_0x4d0cc1['baseRev']!==_0x191e2b||_0x4d0cc1[_0x29fdd0(0x1e9)]!==_0x23cb51)throw new j(_0x29fdd0(0x23c),_0x29fdd0(0x18c));let _0x3f3483=_0x1575f4(_0x4d0cc1),_0x12714a=_0x58837a[_0x29fdd0(0x1ca)]['interceptor']['getInterceptPoints']()[_0x29fdd0(0x16a)],_0x38de1e=_0x58837a[_0x29fdd0(0x1ca)][_0x29fdd0(0x21c)]['fetchThroughInterceptors'](_0x12714a)(_0x3f3483[_0x29fdd0(0x13a)],null)??_0x3f3483[_0x29fdd0(0x13a)],_0x497fd1=_0xf7bb5f(_0x38de1e,_0x58837a[_0x29fdd0(0x11d)],_0x2a6c18===_0x29fdd0(0x14f)?{'fromChangeset':!0x0}:{'fromCollab':!0x0});if(!_0x497fd1[_0x29fdd0(0x23b)])throw new j(_0x29fdd0(0x20d),_0x29fdd0(0x1e7)+_0x497fd1[_0x29fdd0(0x24f)]+':\x20'+String(_0x497fd1[_0x29fdd0(0x19d)]));let _0x44e81b=_0x58837a[_0x29fdd0(0x108)]['incrementRevOfUnit'](_0x5c75e3);if(_0x44e81b!==_0x23cb51)throw new j(_0x29fdd0(0x23c),_0x29fdd0(0x13e));_0x191e2b=_0x44e81b;}return _0x191e2b;}function V(_0x2a2511,_0x30bb37,_0xad496e){const _0x1d8d32=_0x3d1750;let _0x3be994=_0x25264f[_0x1d8d32(0x17e)](_0x2a2511);switch(_0xad496e){case _0x550821['UNIVER_SHEET']:return H(_0x3be994[_0x1d8d32(0x100)](_0x30bb37)?.[_0x1d8d32(0x123)](),_0x30bb37);case _0x550821[_0x1d8d32(0x1c4)]:return H(_0x3be994[_0x1d8d32(0x1a3)](_0x30bb37)?.['save'](),_0x30bb37);case _0x550821[_0x1d8d32(0xed)]:return H(_0x3be994[_0x1d8d32(0x1d7)](_0x30bb37)?.[_0x1d8d32(0x123)](),_0x30bb37);case _0x550821[_0x1d8d32(0x183)]:return H(_0x3be994[_0x1d8d32(0x13b)](_0x30bb37)?.['save'](),_0x30bb37);case _0x550821[_0x1d8d32(0x164)]:return H(_0x3be994['getBoard'](_0x30bb37)?.[_0x1d8d32(0x123)](),_0x30bb37);default:throw new j(_0x1d8d32(0x1b1),'Unsupported\x20collaboration\x20Unit\x20type:\x20'+_0xad496e);}}function H(_0xb19c15,_0x47fe51){const _0x1e6113=_0x3d1750;if(_0xb19c15===void 0x0)throw new j(_0x1e6113(0x20d),'Unit\x20'+_0x47fe51+'\x20is\x20unavailable');return structuredClone(_0xb19c15);}function _0x3d14(){const _0x171c83=['Snapshot\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','_baseRevision','csRejEvent','_config','clear','type','status','blockMeta','delete','max','format','newAPI','maxCodeLength\x20must\x20be\x20a\x20positive\x20safe\x20integer','SnapshotService\x20is\x20not\x20ready\x20until\x20the\x20Univer\x20factory\x20has\x20returned','UNIVER_CLI_SDK_MANUAL_COLLABORATION_PLUGIN','LEAVE','UNIVER_BASE','unitId\x20must\x20not\x20be\x20empty','_join','_heartbeat','reqId','mode','getConnectionState','4140899LixjGm','Backend\x20failed\x20to\x20fetch\x20changesets','Confirmed\x20changeset\x20history\x20is\x20not\x20contiguous','pathname','replacePendingMutations','Session\x20ticket\x20request\x20failed\x20with\x20HTTP\x20','pending','Collaboration\x20WebSocket\x20closed','Runtime\x20for\x20','\x20after\x20the\x20collaboration\x20runtime\x20entered\x20conflict','eventID','_univer','every','routeKey','addEventListener','unitType','getState','_lease','permission_rej','error','latestRevision','promise','formula.mutation.set-trigger-formula-calculation-stop','JOIN','stringify','getDocument','boolean','formula.mutation.set-formula-data','_validateAcceptedChangeset','size','_connection','unsubscribe','removeEventListener','number','changesets','reconnecting','\x20is\x20unavailable','return\x20(async\x20()\x20=>\x20{\x20','collabWebSocketUrl','COLLABORATION_INVALID_INPUT','collabSubmitChangesetUrl','createPresentation','univerAPI','code','awaiting-ack','changeset_should_retry','invalid','_waitForSubmission','redoState','reason','execute','getPendingMutations','data','Awaiting\x20changeset\x20echo\x20does\x20not\x20match\x20the\x20transformed\x20local\x20mutations','closed','dispose','object','COMPRESS_MUTATION_SEND','UNIVER_DOC','snapshotFrom','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20is\x20not\x20supported\x20by\x20this\x20runtime','injector','transform-failed','_capture','compressMutationService','COLLABORATION_UNAVAILABLE','OPEN','_subscribeToDocumentState','remote','_assertMutableState','write','\x20})();','isFinite','Failed\x20to\x20transform\x20the\x20Unit\x20snapshot','commitTimeoutMs','online','confirmed','getPresentation','fetchmissing','protocol','UNIVER_SHEET','Checkpoint\x20Unit\x20type\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20type','HEARTBEAT','cmd','from','isSafeInteger','_conflict','then','_pending','set','_release','Backend\x20returned\x20no\x20Unit\x20snapshot','Failed\x20to\x20fetch\x20preceding\x20changesets','Confirmed\x20mutation\x20replay\x20failed\x20at\x20index\x20','replacePending','revision','_failCommandWaiters','string','registerPlugin','changeset_ack','\x20for\x20Unit\x20','_rejectIfNotAccepting','findIndex','Failed\x20to\x20open\x20the\x20collaboration\x20backend','Sheet-shaped\x20snapshot\x20is\x20missing\x20workbook\x20metadata','Collaboration\x20HTTP\x20request\x20failed','_submissionWaiters','formula.mutation.set-trigger-formula-calculation','Collaboration\x20runtime\x20result\x20must\x20be\x20JSON-compatible','createDocument','_closePromise','acquire','params','Failed\x20to\x20establish\x20Collaboration\x20WebSocket','Unsupported\x20collaboration\x20Unit\x20type:\x20','_connect','join','_handle','rev','_requestCommand','fetch','Failed\x20to\x20send\x20Collaboration\x20WebSocket\x20command','_executor','17580lrVGti','_memberId','changeset_rej','unit','awaitingMutations','submitChangeset','Backend\x20failed\x20to\x20load\x20the\x20Unit\x20snapshot','changeset-rejected','COLLABORATION_LOAD_FAILED','pulled','finally','_connectPromise','_reconnectAttempts','_nextReqId','readyState','sheet.mutation.send-init-pivot-text-local','map','http:','MUTATION','csAckEvent','transformMutations','changeset','all','interceptor','snapshotServerUrl','retryable','m2Prime','Snapshot\x20block\x20','Changeset\x20submission\x20was\x20rejected','_captureCommandMutation','close','has','_injector','pull-required','_kernel','transformService','subscribe','Collaboration\x20WebSocket\x20closed\x20before\x20opening','getUnitOnRev','retry','unknown','message','csShouldRetryEvent','rejected','_replayRemoteChangesets','replace','permissionRejEvent','suppress','board','application/json','16BtcJuN','_setTransformConflict','unshift','The\x20same\x20changeset\x20submission\x20is\x20already\x20in\x20flight','result','COLLABORATION_PROTOCOL_ERROR','_startHeartbeat','nothing-to-commit','647366ofxJRv','32784hqOFZy','HELLO','Event','onStarting','\x20cannot\x20capture\x20mutation\x20','trim','baseRev','open','instanceService','_closeAfterFatalError','Read\x20execution\x20cannot\x20run\x20persistable\x20action\x20','splice','offline','commit','wsSessionTicketUrl','index','Failed\x20to\x20join\x20Unit\x20room','_scheduleReconnect','conflict','_consumeBufferedPrecedingChangesets','getInterceptPoints','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20pulled\x20in\x20place','_unitId','get','min','commitTimeoutMs\x20must\x20be\x20a\x20positive\x20safe\x20integer','Cannot\x20replace\x20mutations\x20after\x20a\x20changeset\x20is\x20awaiting\x20confirmation','prependPending','_knownHeadRevision','_closed','fromEntries','Timed\x20out\x20establishing\x20Collaboration\x20WebSocket','getSheetBlock','ticket','_fetchChangesets','RECV','fromChangeset','unitId','leases','UNIVER_SLIDE','workbook','\x20must\x20be\x20an\x20absolute\x20URL','ws:','values','_state','run','snapshotServerService','Invalid\x20JSON\x20response','fromCollab','ack','target','timer','randomUUID','createBoard','collaMsg','resolve','takePending','originalMeta','getWorkbook','Snapshot\x20contains\x20duplicate\x20block\x20ids','sessionTicket','Single-Unit\x20runtime\x20for\x20','_handleMessage','_socket','exportUnitData','GET','revisionService','The\x20same\x20Unit\x20id\x20cannot\x20be\x20joined\x20with\x20two\x20Unit\x20types','Collaboration\x20HTTP\x20request\x20failed\x20with\x20status\x20','COLLABORATION_CLOSED','Checkpoint\x20Unit\x20id\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20id','_ensureConnected','_disposables','_acceptingOperations','738909FKMTBj','trigger','createUniver','_inbound','Backend\x20returned\x20a\x20non-contiguous\x20changeset\x20range','pull','\x20request\x20is\x20already\x20active\x20for\x20','cancel','Collaboration\x20HELLO\x20response\x20is\x20invalid','Collaboration\x20WebSocket\x20is\x20not\x20online','_stopHeartbeat','find','acceptedChangeset','commandService','Code\x20is\x20longer\x20than\x20the\x20','_closeOwnedResources','unitID','invalid-revision','block','save','some','reject','unchanged','json','doc','_reconcilePrecedingChangesets','_tail','push','base64','takeInboundChangesets','snapshot','Changeset\x20submission\x20was\x20denied','m1Prime','up-to-date','_reconnectTimer','sid','\x20character\x20limit','_handleCollaborationEvent','fetchChangesets','_sid','precedingChangesets','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20replayed\x20in\x20place','mutations','getBase','_bufferedChangesets','add','Univer\x20revision\x20did\x20not\x20advance\x20to\x20the\x20confirmed\x20changeset\x20revision','Replacement\x20mutations\x20must\x20be\x20an\x20array','Collaboration\x20runtime\x20is\x20closing\x20or\x20closed','unit-data','isArray','catch','_awaiting','disposeUnit','searchParams','_operations','onlyLocal','COMMAND','Backend\x20failed\x20to\x20close\x20the\x20initial\x20revision\x20gap','Buffered\x20changeset\x20does\x20not\x20match\x20the\x20canonical\x20preceding\x20changeset','_suppressionDepth','unitData','_target','initial','permission-denied','_createAwaitingFromPending','invalid-changeset','incrementRevOfUnit','Replacement\x20mutations\x20must\x20contain\x20non-empty\x20id\x20and\x20string\x20data\x20fields','createUnit','new_changes','entries','_commandWaiters','92gZFGsV','memberID','new_changesets','3230510JjTHVd','Snapshot\x20Unit\x20identity\x20does\x20not\x20match\x20the\x20requested\x20Unit','Collaboration\x20HTTP\x20response\x20is\x20not\x20valid\x20JSON','_joined','ACK\x20revision\x20does\x20not\x20follow\x20the\x20applied\x20confirmed\x20revision','permission-rejected','23103300gDVwhp','Manual\x20collaboration\x20plugin\x20did\x20not\x20reach\x20the\x20Starting\x20lifecycle','UNIVER_BOARD','slide','2pkqlHO','kind','permission','flatMap','COMPRESS_MUTATION_APPLY','infoRsp','\x20returned\x20a\x20different\x20block\x20identity','https:','read','Timed\x20out\x20waiting\x20for\x20Collaboration\x20command\x20','httpRequest','length','Cannot\x20'];_0x3d14=function(){return _0x171c83;};return _0x3d14();}var fe=class{[_0x3d1750(0xeb)];[_0x3d1750(0x199)];[_0x3d1750(0x174)];[_0x3d1750(0x1ff)];['_univer'];[_0x3d1750(0x227)];['_closePromise'];['_acceptingOperations']=!0x0;['_closed']=!0x1;[_0x3d1750(0x1c9)];[_0x3d1750(0x204)];[_0x3d1750(0x147)]=new L();[_0x3d1750(0x13c)]=[];['_knownHeadRevision'];[_0x3d1750(0x1e0)]=null;[_0x3d1750(0x144)]=null;[_0x3d1750(0x137)]=crypto[_0x3d1750(0xfa)]();['_nextReqId']=0x1;constructor(_0x344001,_0x4b6f04,_0x3c9c31,_0x57feb5,_0x2e8e79,_0x150668,_0x54c895){const _0x5d70b0=_0x3d1750;this['unitId']=_0x344001,this[_0x5d70b0(0x199)]=_0x4b6f04,this[_0x5d70b0(0x174)]=_0x3c9c31,this[_0x5d70b0(0x1ff)]=_0x57feb5,this[_0x5d70b0(0x195)]=_0x2e8e79,this[_0x5d70b0(0x227)]=_0x150668,this[_0x5d70b0(0xe2)]=_0x3c9c31,this[_0x5d70b0(0x1c9)]=new se(_0x150668,_0x344001,_0x4b6f04),this[_0x5d70b0(0x204)]=ue(_0x2e8e79,_0x344001,_0x54c895);}['getState'](){const _0x6b917c=_0x3d1750;return{'awaitingChangeset':this[_0x6b917c(0x144)]===null?null:U(this[_0x6b917c(0x144)]),'baseRevision':this[_0x6b917c(0x174)],'bufferedChangesetCount':this[_0x6b917c(0x13c)][_0x6b917c(0x171)],'conflict':this[_0x6b917c(0x1e0)],'connection':this[_0x6b917c(0xe3)]?_0x6b917c(0x1c0):this[_0x6b917c(0x1ff)]['getConnectionState'](),'knownHeadRevision':this[_0x6b917c(0xe2)],'pendingMutationCount':this['_capture'][_0x6b917c(0x190)][_0x6b917c(0x171)]};}[_0x3d1750(0x1bd)](){const _0x19d763=_0x3d1750;return structuredClone(this[_0x19d763(0x1c9)][_0x19d763(0x190)]);}[_0x3d1750(0x202)](){const _0x4868e0=_0x3d1750;return this[_0x4868e0(0x1ef)]()||this[_0x4868e0(0x147)][_0x4868e0(0xf3)](async()=>(this['_assertMutableState'](_0x4868e0(0x202)),await this[_0x4868e0(0xe8)]()));}[_0x3d1750(0x115)](){const _0x33cb02=_0x3d1750;return this['_rejectIfNotAccepting']()||this[_0x33cb02(0x147)][_0x33cb02(0xf3)](async()=>{const _0x59c504=_0x33cb02;if(this[_0x59c504(0x1cf)]('pull'),await this[_0x59c504(0xe8)](),this[_0x59c504(0x13c)][_0x59c504(0x171)]===0x0)return{'state':this[_0x59c504(0x19a)](),'status':_0x59c504(0x131)};let _0x548ef9=[...this[_0x59c504(0x13c)]];if(_0x548ef9[_0x59c504(0x124)](_0x259668=>_0x259668[_0x59c504(0x13a)][_0x59c504(0x124)](_0xd2a17a=>_0xd2a17a['id']===_0x3038df['id'])))throw new j(_0x59c504(0x23c),_0x59c504(0x255));let _0x4c3f24=this[_0x59c504(0x174)],_0x152918=this[_0x59c504(0x144)]?W(this[_0x59c504(0x144)][_0x59c504(0x13a)],this[_0x59c504(0xeb)],this['unitType'],this[_0x59c504(0x174)]):null,_0x58e7b1=_0x1575f4({'baseRev':this[_0x59c504(0x174)],'memberID':'','mutations':[...this['_capture'][_0x59c504(0x190)]],'revision':0x0,'type':this[_0x59c504(0x199)],'unitID':this[_0x59c504(0xeb)],'userID':''})[_0x59c504(0x13a)],_0x4f04a9=[];for(let _0xf80260 of _0x548ef9){let _0x946ffc=_0x1575f4(_0xf80260);if(this['_awaiting']!==null&&_0xf80260[_0x59c504(0x133)]===this[_0x59c504(0x144)]['sid']&&_0xf80260['reqId']===this[_0x59c504(0x144)]['reqId']){let _0x459a82=(_0x152918??[])[_0x59c504(0x215)](_0x2dcdf0);G(_0xf80260[_0x59c504(0x13a)],_0x459a82)||await this[_0x59c504(0x249)](new j('COLLABORATION_PROTOCOL_ERROR',_0x59c504(0x1bf))),_0x4f04a9[_0x59c504(0x12b)]({'changeset':_0xf80260,'kind':_0x59c504(0x1b6)}),_0x152918=null;continue;}let _0x412d5d=_0x946ffc[_0x59c504(0x13a)];if(_0x152918!==null){let _0x27dc72=this[_0x59c504(0x227)]['transformService'][_0x59c504(0x219)](_0x412d5d,_0x152918,!0x1);if(!_0x5941e5(_0x27dc72))return this[_0x59c504(0x1e0)]={'message':_0x27dc72['error'][_0x59c504(0x22e)],'operation':_0x59c504(0x115),'reason':_0x59c504(0x1c8)},{'conflict':this[_0x59c504(0x1e0)],'state':this['getState'](),'status':_0x59c504(0x252)};_0x412d5d=_0x27dc72['m1Prime'],_0x152918=_0x27dc72[_0x59c504(0x21f)];}let _0x115775=this['_kernel'][_0x59c504(0x228)][_0x59c504(0x219)](_0x412d5d,_0x58e7b1,!0x1);if(!_0x5941e5(_0x115775))return this[_0x59c504(0x1e0)]={'message':_0x115775['error'][_0x59c504(0x22e)],'operation':_0x59c504(0x115),'reason':_0x59c504(0x1c8)},{'conflict':this[_0x59c504(0x1e0)],'state':this[_0x59c504(0x19a)](),'status':_0x59c504(0x252)};_0x4f04a9['push']({'changeset':_0x1cd93e({..._0x946ffc,'mutations':_0x115775[_0x59c504(0x130)]}),'kind':_0x59c504(0x1ce)}),_0x58e7b1=_0x115775[_0x59c504(0x21f)];}let _0x33e47f=_0x4c3f24;for(let _0x381c56 of _0x4f04a9){if(_0x381c56[_0x59c504(0x167)]===_0x59c504(0x1b6)){let _0x322ade=this[_0x59c504(0x227)]['revisionService'][_0x59c504(0x153)](this['unitId']);_0x322ade!==_0x381c56[_0x59c504(0x21a)][_0x59c504(0x1e9)]&&await this['_closeAfterFatalError'](new j(_0x59c504(0x23c),'Awaiting\x20changeset\x20echo\x20does\x20not\x20follow\x20the\x20current\x20revision')),_0x33e47f=_0x322ade;continue;}_0x33e47f=await this[_0x59c504(0x231)](_0x33e47f,[_0x381c56['changeset']]);}return this[_0x59c504(0x1c9)][_0x59c504(0x1e8)](_0x58e7b1[_0x59c504(0x215)](_0x2dcdf0)),this[_0x59c504(0x144)]!==null&&(this[_0x59c504(0x144)]=_0x152918===null?null:{...this[_0x59c504(0x144)],'baseRev':_0x33e47f,'mutations':_0x152918[_0x59c504(0x215)](_0x2dcdf0)}),this[_0x59c504(0x174)]=_0x33e47f,this[_0x59c504(0x13c)][_0x59c504(0x24b)](0x0),{'appliedChangesets':_0x548ef9[_0x59c504(0x215)](z),'fromRevision':_0x4c3f24,'state':this[_0x59c504(0x19a)](),'status':_0x59c504(0x20e),'toRevision':_0x33e47f,'transformedPendingMutationCount':_0x58e7b1['length']};});}[_0x3d1750(0x24d)](){return this['_rejectIfNotAccepting']()||this['_operations']['run'](async()=>{const _0x397b2e=_0x2899;this[_0x397b2e(0x1cf)]('commit');let _0x3ee71b=[],_0x45098a=[];if(this[_0x397b2e(0x144)]===null){if(this[_0x397b2e(0x1c9)][_0x397b2e(0x190)]['length']===0x0)return{'state':this[_0x397b2e(0x19a)](),'status':_0x397b2e(0x23e)};if(await this['_fetchChangesets'](),this[_0x397b2e(0x13c)][_0x397b2e(0x171)]>0x0)return{'baseRevision':this[_0x397b2e(0x174)],'confirmedChangesets':_0x3ee71b,'knownHeadRevision':this[_0x397b2e(0xe2)],'state':this[_0x397b2e(0x19a)](),'status':'pull-required'};this['_createAwaitingFromPending']();}for(;this[_0x397b2e(0x144)]!==null;){let _0xe22399=this[_0x397b2e(0x144)],_0x4de00b;try{_0x4de00b=await this['_handle'][_0x397b2e(0x20a)](_0xe22399);}catch{return{'changeset':U(_0xe22399),'confirmedChangesets':_0x3ee71b,'state':this['getState'](),'status':_0x397b2e(0x22d)};}if(_0x4de00b['status']==='retry'||_0x4de00b['status']==='unknown')return{'changeset':U(_0xe22399),'confirmedChangesets':_0x3ee71b,'state':this[_0x397b2e(0x19a)](),'status':_0x4de00b[_0x397b2e(0x179)]};if(_0x4de00b[_0x397b2e(0x179)]===_0x397b2e(0x230))return _0x4de00b[_0x397b2e(0x1bb)]===_0x397b2e(0x121)?(this[_0x397b2e(0x1c9)][_0x397b2e(0xe1)](_0xe22399['mutations']),this[_0x397b2e(0x144)]=null,await this[_0x397b2e(0xe8)](),{'baseRevision':this['_baseRevision'],'confirmedChangesets':_0x3ee71b,'knownHeadRevision':this[_0x397b2e(0xe2)],'state':this[_0x397b2e(0x19a)](),'status':_0x397b2e(0x226)}):(this[_0x397b2e(0x1e0)]={'message':_0x4de00b[_0x397b2e(0x22e)],'operation':'commit','reason':_0x4de00b[_0x397b2e(0x1bb)]===_0x397b2e(0x150)?_0x397b2e(0x161):_0x397b2e(0x20c)},{'conflict':this[_0x397b2e(0x1e0)],'confirmedChangesets':_0x3ee71b,'state':this[_0x397b2e(0x19a)](),'status':_0x397b2e(0x252)});let _0x402845=_0x4de00b[_0x397b2e(0x11c)];try{this[_0x397b2e(0x1a6)](_0xe22399,_0x4de00b[_0x397b2e(0x138)],_0x402845);}catch(_0x245a7a){await this['_closeAfterFatalError'](_0x245a7a);}let _0x52ec4f=_0xe22399[_0x397b2e(0x13a)];if(_0x4de00b[_0x397b2e(0x138)][_0x397b2e(0x171)]>0x0){let _0x1e7910=await this[_0x397b2e(0x129)](_0xe22399,_0x4de00b[_0x397b2e(0x138)]);if(_0x1e7910===null)return{'conflict':this[_0x397b2e(0x1e0)],'confirmedChangesets':_0x3ee71b,'state':this[_0x397b2e(0x19a)](),'status':_0x397b2e(0x252)};_0x52ec4f=_0x1e7910[_0x397b2e(0x209)];try{this[_0x397b2e(0x253)](_0x4de00b[_0x397b2e(0x138)]);}catch(_0x1263ab){await this['_closeAfterFatalError'](_0x1263ab);}_0x45098a[_0x397b2e(0x12b)](..._0x4de00b[_0x397b2e(0x138)]['map'](z));}G(_0x402845['mutations'],_0x52ec4f)||await this[_0x397b2e(0x249)](new j(_0x397b2e(0x23c),'Backend\x20returned\x20an\x20ACK\x20whose\x20mutations\x20do\x20not\x20match\x20the\x20submitted\x20changeset'));let _0x4383cb=this[_0x397b2e(0x227)][_0x397b2e(0x108)][_0x397b2e(0x153)](this['unitId']);if(_0x4383cb!==_0x402845[_0x397b2e(0x1e9)]&&await this['_closeAfterFatalError'](new j(_0x397b2e(0x23c),_0x397b2e(0x160))),this['_baseRevision']=_0x4383cb,this[_0x397b2e(0xe2)]=Math[_0x397b2e(0x17c)](this[_0x397b2e(0xe2)],_0x4383cb),this['_awaiting']=null,_0x3ee71b[_0x397b2e(0x12b)](z(_0x402845)),this[_0x397b2e(0x1c9)]['pending'][_0x397b2e(0x171)]===0x0)break;this[_0x397b2e(0x151)]();}return{'confirmedChangesets':_0x3ee71b,'reconciledChangesets':_0x45098a,'state':this[_0x397b2e(0x19a)](),'status':_0x397b2e(0x1d6)};});}async[_0x3d1750(0xe8)](){const _0x41bc23=_0x3d1750;let _0x147966=this[_0x41bc23(0xe2)],_0x51a882=await this['_handle']['fetchChangesets'](_0x147966,void 0x0);if(_0x24cb5b(_0x51a882[_0x41bc23(0x19d)])){let _0x28b3a6=_0x51a882['error'];throw new j(_0x41bc23(0x1cb),_0x28b3a6?.[_0x41bc23(0x22e)]||_0x41bc23(0x18b),{'retryable':!0x0});}let _0x189bf9=R(_0x51a882[_0x41bc23(0x1ac)],this['unitId'],this[_0x41bc23(0x199)],_0x147966),_0x52a873=_0x189bf9['at'](-0x1)?.[_0x41bc23(0x1e9)]??_0x147966;if(_0x51a882[_0x41bc23(0x19e)]!==void 0x0&&_0x51a882[_0x41bc23(0x19e)]!==_0x52a873)throw new j(_0x41bc23(0x23c),'Backend\x20latest\x20revision\x20does\x20not\x20match\x20its\x20continuous\x20changeset\x20range');return _0x189bf9[_0x41bc23(0x171)]===0x0?{'knownHeadRevision':this[_0x41bc23(0xe2)],'state':this[_0x41bc23(0x19a)](),'status':_0x41bc23(0x126)}:(this[_0x41bc23(0x13c)][_0x41bc23(0x12b)](..._0x189bf9),this[_0x41bc23(0xe2)]=_0x52a873,{'changesets':_0x189bf9[_0x41bc23(0x215)](z),'fromRevision':_0x147966,'state':this['getState'](),'status':'fetched','toRevision':_0x52a873});}[_0x3d1750(0x151)](){const _0x3d234e=_0x3d1750;let _0x274127=this['_capture'][_0x3d234e(0xfe)]();this[_0x3d234e(0x144)]={'baseRev':this[_0x3d234e(0x174)],'mutations':_0x274127,'reqId':this[_0x3d234e(0x212)],'sid':this[_0x3d234e(0x137)]},this[_0x3d234e(0x212)]+=0x1;}['_validateAcceptedChangeset'](_0x10328c,_0xec51a9,_0xd915e0){const _0x2cbae8=_0x3d1750;let _0xc8029f=R(_0xec51a9,this[_0x2cbae8(0xeb)],this[_0x2cbae8(0x199)],this[_0x2cbae8(0x174)])['at'](-0x1)?.[_0x2cbae8(0x1e9)]??this['_baseRevision'];if(_0xd915e0[_0x2cbae8(0x120)]!==this[_0x2cbae8(0xeb)]||_0xd915e0[_0x2cbae8(0x178)]!==this['unitType']||_0xd915e0[_0x2cbae8(0x133)]!==_0x10328c[_0x2cbae8(0x133)]||_0xd915e0[_0x2cbae8(0x187)]!==_0x10328c[_0x2cbae8(0x187)]||_0xd915e0[_0x2cbae8(0x246)]!==_0xc8029f||_0xd915e0[_0x2cbae8(0x1e9)]!==_0xc8029f+0x1)throw new j('COLLABORATION_PROTOCOL_ERROR','Backend\x20returned\x20an\x20ACK\x20that\x20does\x20not\x20match\x20the\x20submitted\x20changeset');}async[_0x3d1750(0x129)](_0x550f44,_0x39202b){const _0x454eb0=_0x3d1750;let _0x4709c5=W(_0x550f44['mutations'],this[_0x454eb0(0xeb)],this['unitType'],this[_0x454eb0(0x174)]),_0x4b0d88=W(this['_capture'][_0x454eb0(0x190)],this['unitId'],this[_0x454eb0(0x199)],this['_baseRevision']),_0x42f5ca=[];for(let _0x1b2958 of _0x39202b){let _0x89ea27=_0x1575f4(_0x1b2958),_0x4c1fbf=this[_0x454eb0(0x227)][_0x454eb0(0x228)][_0x454eb0(0x219)](_0x89ea27[_0x454eb0(0x13a)],_0x4709c5,!0x1);if(!_0x5941e5(_0x4c1fbf))return this[_0x454eb0(0x238)]('commit',_0x4c1fbf[_0x454eb0(0x19d)]),null;_0x4709c5=_0x4c1fbf['m2Prime'];let _0x27ecad=this[_0x454eb0(0x227)][_0x454eb0(0x228)][_0x454eb0(0x219)](_0x4c1fbf[_0x454eb0(0x130)],_0x4b0d88,!0x1);if(!_0x5941e5(_0x27ecad))return this['_setTransformConflict'](_0x454eb0(0x24d),_0x27ecad[_0x454eb0(0x19d)]),null;_0x4b0d88=_0x27ecad[_0x454eb0(0x21f)],_0x42f5ca[_0x454eb0(0x12b)](_0x1cd93e({..._0x89ea27,'mutations':_0x27ecad[_0x454eb0(0x130)]}));}let _0x1a9fd1=await this[_0x454eb0(0x231)](this[_0x454eb0(0x174)],_0x42f5ca);return this['_capture'][_0x454eb0(0x1e8)](_0x4b0d88[_0x454eb0(0x215)](_0x2dcdf0)),this[_0x454eb0(0x174)]=_0x1a9fd1,{'awaitingMutations':_0x4709c5[_0x454eb0(0x215)](_0x2dcdf0),'revision':_0x1a9fd1};}['_setTransformConflict'](_0x1d55f7,_0x267112){const _0x295daa=_0x3d1750;this['_conflict']={'message':_0x267112[_0x295daa(0x22e)],'operation':_0x1d55f7,'reason':_0x295daa(0x1c8)};}async[_0x3d1750(0x231)](_0x4a47d4,_0x587b9f){const _0x40dc3b=_0x3d1750;try{return await this[_0x40dc3b(0x1c9)][_0x40dc3b(0x234)](async()=>B(this[_0x40dc3b(0x227)],this[_0x40dc3b(0xeb)],this['unitType'],_0x4a47d4,_0x587b9f,_0x40dc3b(0x1ce)));}catch(_0x3adcae){return await this[_0x40dc3b(0x249)](_0x3adcae);}}async[_0x3d1750(0x249)](_0x50c228){const _0xbfd3e4=_0x3d1750;this[_0xbfd3e4(0x10f)]=!0x1,this[_0xbfd3e4(0x1f8)]??=this['_closeOwnedResources']();try{await this['_closePromise'];}catch{}throw _0x50c228;}[_0x3d1750(0x253)](_0x22a4db){const _0x11b842=_0x3d1750;let _0x4c4070=_0x22a4db['at'](-0x1)?.[_0x11b842(0x1e9)];if(_0x4c4070===void 0x0||this[_0x11b842(0x13c)][_0x11b842(0x171)]===0x0)return;let _0x102c1e=this[_0x11b842(0x13c)][_0x11b842(0x1f0)](({revision:_0x1e196d})=>_0x1e196d>_0x4c4070),_0x16b399=this[_0x11b842(0x13c)]['slice'](0x0,_0x102c1e===-0x1?this['_bufferedChangesets'][_0x11b842(0x171)]:_0x102c1e);for(let _0x50fb8e of _0x16b399){let _0x133f96=_0x22a4db[_0x11b842(0x11b)](({revision:_0x43bf39})=>_0x43bf39===_0x50fb8e['revision']);if(!_0x133f96||!pe(_0x50fb8e,_0x133f96))throw new j(_0x11b842(0x23c),_0x11b842(0x14b));}this[_0x11b842(0x13c)]['splice'](0x0,_0x16b399[_0x11b842(0x171)]);}[_0x3d1750(0x1bc)](_0x35fe0d){const _0x383328=_0x3d1750;return this[_0x383328(0x1ef)]()||this[_0x383328(0x147)][_0x383328(0xf3)](async()=>{const _0xf5ef40=_0x383328;_0x35fe0d[_0xf5ef40(0x188)]===_0xf5ef40(0x1d0)&&this[_0xf5ef40(0x1cf)](_0xf5ef40(0x1d0));let _0x5177fe=this[_0xf5ef40(0x1c9)][_0xf5ef40(0x190)]['length'],_0x2fa982=P(await this['_executor'][_0xf5ef40(0x1bc)](_0x35fe0d[_0xf5ef40(0x1b5)],_0x35fe0d[_0xf5ef40(0x188)]));return _0x35fe0d['mode']===_0xf5ef40(0x16e)?{'state':this['getState'](),'value':_0x2fa982}:{'mutations':this[_0xf5ef40(0x1c9)]['snapshotFrom'](_0x5177fe),'state':this[_0xf5ef40(0x19a)](),'value':_0x2fa982};});}[_0x3d1750(0x18e)](_0xbe8b5){const _0x49e06b=_0x3d1750;return this[_0x49e06b(0x1ef)]()||this[_0x49e06b(0x147)][_0x49e06b(0xf3)](async()=>{const _0x164278=_0x49e06b;if(this['_assertMutableState']('replace\x20mutations'),this[_0x164278(0x144)]!==null)throw new j(_0x164278(0x1b1),_0x164278(0xe0));let _0x2a7bae=me(_0xbe8b5),_0x2a3340=[...this[_0x164278(0x1c9)][_0x164278(0x190)]];this['_capture'][_0x164278(0x1e8)](_0x2a7bae);let _0x2d93ae=this['getState']();return{'pendingMutationCount':_0x2a7bae[_0x164278(0x171)],'previousMutationCount':_0x2a3340['length'],'state':_0x2d93ae};});}[_0x3d1750(0x106)](){const _0x5d8a34=_0x3d1750;return this[_0x5d8a34(0x1ef)]()||this['_operations'][_0x5d8a34(0xf3)](async()=>V(this[_0x5d8a34(0x195)],this['unitId'],this[_0x5d8a34(0x199)]));}[_0x3d1750(0x223)](){const _0x2e58a3=_0x3d1750;return this['_closePromise']?this[_0x2e58a3(0x1f8)]:(this[_0x2e58a3(0x10f)]=!0x1,this[_0x2e58a3(0x1f8)]=this[_0x2e58a3(0x147)][_0x2e58a3(0xf3)](async()=>await this[_0x2e58a3(0x11f)]()),this[_0x2e58a3(0x1f8)]);}async[_0x3d1750(0x11f)](){const _0x582e21=_0x3d1750;try{this['_capture'][_0x582e21(0x1c1)](),await this['_handle'][_0x582e21(0x223)]();}finally{try{this[_0x582e21(0x195)][_0x582e21(0x1c1)]();}finally{this[_0x582e21(0xe3)]=!0x0;}}}[_0x3d1750(0x1ef)](){const _0x44226c=_0x3d1750;return this[_0x44226c(0x10f)]?null:Promise['reject'](new j(_0x44226c(0x10b),_0x44226c(0x140)));}[_0x3d1750(0x1cf)](_0x1355cc){const _0x10553d=_0x3d1750;if(this['_conflict']!==null)throw new j(_0x10553d(0x1b1),_0x10553d(0x172)+_0x1355cc+_0x10553d(0x193));}};function U(_0x26f765){const _0x1110b6=_0x3d1750;return{'baseRevision':_0x26f765[_0x1110b6(0x246)],'mutationCount':_0x26f765[_0x1110b6(0x13a)][_0x1110b6(0x171)],'reqId':_0x26f765['reqId'],'revision':0x0,'sid':_0x26f765['sid']};}function W(_0x2024d8,_0x57a548,_0xd8af35,_0x5bd823){const _0x4ba468=_0x3d1750;return _0x1575f4({'baseRev':_0x5bd823,'memberID':'','mutations':[..._0x2024d8],'revision':0x0,'type':_0xd8af35,'unitID':_0x57a548,'userID':''})[_0x4ba468(0x13a)];}function pe(_0x921d77,_0x199127){const _0x2f84e1=_0x3d1750;return _0x921d77[_0x2f84e1(0x120)]===_0x199127[_0x2f84e1(0x120)]&&_0x921d77[_0x2f84e1(0x178)]===_0x199127[_0x2f84e1(0x178)]&&_0x921d77['baseRev']===_0x199127[_0x2f84e1(0x246)]&&_0x921d77[_0x2f84e1(0x1e9)]===_0x199127['revision']&&_0x921d77[_0x2f84e1(0x133)]===_0x199127[_0x2f84e1(0x133)]&&_0x921d77[_0x2f84e1(0x187)]===_0x199127[_0x2f84e1(0x187)]&&JSON[_0x2f84e1(0x1a2)](_0x921d77[_0x2f84e1(0x13a)])===JSON[_0x2f84e1(0x1a2)](_0x199127[_0x2f84e1(0x13a)]);}function G(_0x4ccad5,_0x427ef9){const _0x4c9661=_0x3d1750;return _0x4ccad5[_0x4c9661(0x171)]===_0x427ef9[_0x4c9661(0x171)]&&_0x4ccad5[_0x4c9661(0x196)]((_0x5de5c1,_0x628f04)=>_0x5de5c1['id']===_0x427ef9[_0x628f04]?.['id']&&_0x5de5c1[_0x4c9661(0x1be)]===_0x427ef9[_0x628f04]?.['data']);}function me(_0x27e7a2){const _0x390c01=_0x3d1750;if(!Array['isArray'](_0x27e7a2))throw new j(_0x390c01(0x1b1),_0x390c01(0x13f));return _0x27e7a2[_0x390c01(0x215)](_0x48744e=>{const _0x4d51cb=_0x390c01;if(!_0x48744e||typeof _0x48744e!=_0x4d51cb(0x1c2)||typeof _0x48744e['id']!=_0x4d51cb(0x1eb)||_0x48744e['id']['length']===0x0||typeof _0x48744e[_0x4d51cb(0x1be)]!=_0x4d51cb(0x1eb))throw new j(_0x4d51cb(0x1b1),_0x4d51cb(0x154));return{'data':_0x48744e[_0x4d51cb(0x1be)],'id':_0x48744e['id']};});}var K=class extends _0x1d55c6{[_0x3d1750(0x176)];[_0x3d1750(0x225)];static ['pluginName']=_0x3d1750(0x181);constructor(_0x14ddc0,_0x2cd058){super(),this['_config']=_0x14ddc0,this['_injector']=_0x2cd058;}[_0x3d1750(0x243)](){const _0x1c7968=_0x3d1750;this[_0x1c7968(0x176)][_0x1c7968(0xf4)]!==void 0x0&&_0x5dfa11(this[_0x1c7968(0x225)],[[_0x1915ff,{'useValue':this[_0x1c7968(0x176)][_0x1c7968(0xf4)]}]]),this['_config'][_0x1c7968(0x243)]({'commandService':this['_injector'][_0x1c7968(0x257)](_0x8f1c98),'compressMutationService':this[_0x1c7968(0x225)][_0x1c7968(0x257)](_0x7d731a),'instanceService':this[_0x1c7968(0x225)]['get'](_0x399d02),'injector':this[_0x1c7968(0x225)],'revisionService':this[_0x1c7968(0x225)][_0x1c7968(0x257)](_0x404d94),'transformService':this['_injector'][_0x1c7968(0x257)](_0x3b833a)});}};K=_0x53d4b2([_0x5418a4(_0x20bf45),_0x9b6041(0x1,_0x132537(_0x3f90a4))],K);function he(_0x59ec33,_0x377ef6){const _0x52fc67=_0x3d1750;let _0x4d4900;if(_0x59ec33[_0x52fc67(0x1ec)](K,{'onStarting'(_0x537b49){_0x4d4900=_0x537b49;},..._0x377ef6===void 0x0?{}:{'snapshotServerService':_0x377ef6}}),!_0x4d4900)throw Error(_0x52fc67(0x163));return _0x4d4900;}async function ge(_0x21ae53,_0x235c7c,_0x422a6c){const _0x483309=_0x3d1750;let _0x1fc4b3=await _0x21ae53[_0x483309(0x22b)](0x0);if(_0x24cb5b(_0x1fc4b3[_0x483309(0x19d)])){let _0x43b452=_0x1fc4b3[_0x483309(0x19d)];throw new j('COLLABORATION_LOAD_FAILED',_0x43b452?.[_0x483309(0x22e)]||_0x483309(0x20b));}let _0x5e90ab=_0x1fc4b3[_0x483309(0x12e)];if(!_0x5e90ab)throw new j(_0x483309(0x20d),_0x483309(0x1e5));_e(_0x5e90ab,_0x235c7c,_0x422a6c);try{switch(_0x422a6c){case _0x550821[_0x483309(0x1da)]:return{'changesets':_0x1fc4b3[_0x483309(0x1ac)],'unitData':await _0x13e39f(_0x5e90ab,await q(_0x21ae53,_0x5e90ab)),'unitType':_0x422a6c};case _0x550821['UNIVER_DOC']:return{'changesets':_0x1fc4b3[_0x483309(0x1ac)],'unitData':_0x13acb9(_0x5e90ab),'unitType':_0x422a6c};case _0x550821[_0x483309(0xed)]:return{'changesets':_0x1fc4b3['changesets'],'unitData':_0xb2ce4a(_0x5e90ab),'unitType':_0x422a6c};case _0x550821[_0x483309(0x183)]:return{'changesets':_0x1fc4b3[_0x483309(0x1ac)],'unitData':await _0x2d6862(_0x5e90ab,await q(_0x21ae53,_0x5e90ab)),'unitType':_0x422a6c};case _0x550821['UNIVER_BOARD']:return{'changesets':_0x1fc4b3[_0x483309(0x1ac)],'unitData':_0x206dca(_0x5e90ab),'unitType':_0x422a6c};default:throw new j(_0x483309(0x1b1),_0x483309(0x1fc)+_0x422a6c);}}catch(_0x544783){throw _0x544783 instanceof j?_0x544783:new j(_0x483309(0x20d),_0x483309(0x1d3),{'cause':_0x544783});}}function _e(_0xc25e54,_0x3d887a,_0x177267){const _0x5734a6=_0x3d1750;if(_0xc25e54[_0x5734a6(0x120)]!==_0x3d887a||_0xc25e54[_0x5734a6(0x178)]!==_0x177267)throw new j(_0x5734a6(0x20d),_0x5734a6(0x15d));if(!Number[_0x5734a6(0x1df)](_0xc25e54['rev'])||_0xc25e54[_0x5734a6(0x200)]<0x1)throw new j(_0x5734a6(0x20d),_0x5734a6(0x173));}async function q(_0xd2e86e,_0x3a3188){const _0x4db149=_0x3d1750;let _0x18127f=_0x3a3188[_0x4db149(0xee)];if(!_0x18127f)throw new j('COLLABORATION_LOAD_FAILED',_0x4db149(0x1f2));let _0x143572=Object[_0x4db149(0xf1)](_0x18127f[_0x4db149(0x17a)])[_0x4db149(0x169)](({blocks:_0x3575db})=>_0x3575db);if(new Set(_0x143572)[_0x4db149(0x1a7)]!==_0x143572[_0x4db149(0x171)])throw new j('COLLABORATION_LOAD_FAILED',_0x4db149(0x101));return await Promise[_0x4db149(0x21b)](_0x143572['map'](async _0x445fc1=>{const _0x3c343c=_0x4db149;let _0x5529e9=await _0xd2e86e[_0x3c343c(0xe6)](_0x445fc1);if(_0x24cb5b(_0x5529e9['error'])||!_0x5529e9[_0x3c343c(0x122)])throw new j('COLLABORATION_LOAD_FAILED',_0x5529e9['error']?.[_0x3c343c(0x22e)]||_0x3c343c(0x220)+_0x445fc1+_0x3c343c(0x1ae));if(_0x5529e9[_0x3c343c(0x122)]['id']!==_0x445fc1)throw new j(_0x3c343c(0x20d),'Snapshot\x20block\x20'+_0x445fc1+_0x3c343c(0x16c));return _0x5529e9[_0x3c343c(0x122)];}));}function ve(_0x4983d6){const _0x2723e7=_0x3d1750;let _0xe6983d=_0x4983d6['maxCodeLength']??0xa00000;if(!Number['isSafeInteger'](_0xe6983d)||_0xe6983d<=0x0)throw new j(_0x2723e7(0x1b1),_0x2723e7(0x17f));return{async 'load'(_0x2c33a8,_0x1c61ad){const _0x39babf=_0x2723e7;be(_0x2c33a8,_0x1c61ad);let _0x6f10bb,_0x6e06e1={'unitId':_0x2c33a8,'unitType':_0x1c61ad},_0x283dba={'unitId':_0x2c33a8,'unitType':_0x1c61ad,..._0x4983d6['snapshotServerService']===void 0x0?{}:{'resolveSnapshotService':()=>{const _0x2331d6=_0x2899;if(_0x6f10bb===void 0x0)throw new j('COLLABORATION_LOAD_FAILED',_0x2331d6(0x180));return _0x6f10bb;}}},_0x4d5ec6;try{_0x4d5ec6=await _0x4983d6['backend'][_0x39babf(0x247)](_0x6e06e1);}catch(_0xa6c320){throw new j(_0x39babf(0x1cb),_0x39babf(0x1f1),{'cause':_0xa6c320,'retryable':!0x0});}let _0x24e6d5;try{_0x24e6d5=await _0x4983d6[_0x39babf(0x112)](_0x283dba);let _0x531077=he(_0x24e6d5,_0x4983d6[_0x39babf(0xf4)]);_0x4983d6[_0x39babf(0xf4)]!==void 0x0&&(_0x6f10bb=_0x531077[_0x39babf(0x1c7)][_0x39babf(0x257)](_0x9d3c59));let _0xb2850f=await xe(_0x4d5ec6,_0x2c33a8,_0x1c61ad);Se(_0xb2850f,_0x6e06e1),Ce(_0x24e6d5,_0xb2850f);let _0x3c724c=B(_0x531077,_0x2c33a8,_0x1c61ad,J(_0xb2850f[_0x39babf(0x14d)]),_0xb2850f['changesets']),_0x4b0f07=await _0x4d5ec6['fetchChangesets'](_0x3c724c,void 0x0);if(_0x24cb5b(_0x4b0f07['error'])){let _0x11c9ed=_0x4b0f07[_0x39babf(0x19d)];throw new j('COLLABORATION_UNAVAILABLE',_0x11c9ed?.[_0x39babf(0x22e)]||_0x39babf(0x14a),{'retryable':!0x0});}let _0x53662d=R(_0x4b0f07[_0x39babf(0x1ac)],_0x2c33a8,_0x1c61ad,_0x3c724c),_0x2f9ee9=_0x53662d['at'](-0x1)?.[_0x39babf(0x1e9)]??_0x3c724c;if(_0x4b0f07[_0x39babf(0x19e)]!==void 0x0&&_0x4b0f07['latestRevision']!==_0x2f9ee9)throw new j(_0x39babf(0x23c),'Backend\x20latest\x20revision\x20does\x20not\x20match\x20the\x20initial\x20continuous\x20changeset\x20range');return _0x3c724c=B(_0x531077,_0x2c33a8,_0x1c61ad,_0x3c724c,_0x53662d),await ye(_0x531077),new fe(_0x2c33a8,_0x1c61ad,_0x3c724c,_0x4d5ec6,_0x24e6d5,_0x531077,_0xe6983d);}catch(_0x3ccfbf){try{await _0x4d5ec6['close']();}catch{}try{_0x24e6d5?.[_0x39babf(0x1c1)]();}catch{}throw _0x3ccfbf instanceof j?_0x3ccfbf:new j(_0x39babf(0x20d),'Failed\x20to\x20create\x20the\x20collaboration\x20runtime',{'cause':_0x3ccfbf});}}};}async function ye(_0x4e87f7){const _0xf722a7=_0x3d1750;_0x4e87f7[_0xf722a7(0x1c7)][_0xf722a7(0x224)](_0x1ae1f2)&&await _0x4e87f7[_0xf722a7(0x1c7)][_0xf722a7(0x257)](_0x1ae1f2)['waitForLatestApplied']();}function be(_0x387b41,_0x2c0a13){const _0x3ef1aa=_0x3d1750;if(_0x387b41[_0x3ef1aa(0x245)]()['length']===0x0)throw new j(_0x3ef1aa(0x1b1),_0x3ef1aa(0x184));if(_0x2c0a13!==_0x550821[_0x3ef1aa(0x1da)]&&_0x2c0a13!==_0x550821[_0x3ef1aa(0x1c4)]&&_0x2c0a13!==_0x550821[_0x3ef1aa(0xed)]&&_0x2c0a13!==_0x550821[_0x3ef1aa(0x183)]&&_0x2c0a13!==_0x550821[_0x3ef1aa(0x164)])throw new j('COLLABORATION_INVALID_INPUT','Unsupported\x20collaboration\x20Unit\x20type:\x20'+_0x2c0a13);}async function xe(_0x898e66,_0x3dfe05,_0x1b5ec1){const _0x110cd1=_0x3d1750;return _0x898e66[_0x110cd1(0x17d)]===_0x110cd1(0x141)?await _0x898e66['getUnitData']():await ge(_0x898e66,_0x3dfe05,_0x1b5ec1);}function Se(_0x31782f,_0x4094ae){const _0x896393=_0x3d1750;if(_0x31782f['unitType']!==_0x4094ae['unitType'])throw new j(_0x896393(0x20d),_0x896393(0x1db));if(_0x31782f['unitData']['id']!==_0x4094ae['unitId'])throw new j(_0x896393(0x20d),_0x896393(0x10c));J(_0x31782f[_0x896393(0x14d)]);}function J(_0x26287b){const _0x15a4e0=_0x3d1750;let _0x5ef129=_0x26287b[_0x15a4e0(0x200)];if(!Number[_0x15a4e0(0x1df)](_0x5ef129)||_0x5ef129===void 0x0||_0x5ef129<0x1)throw new j('COLLABORATION_LOAD_FAILED','Checkpoint\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer');return _0x5ef129;}function Ce(_0x5aa46c,_0x4f9c6a){const _0x3558f6=_0x3d1750;switch(_0x4f9c6a[_0x3558f6(0x199)]){case _0x550821[_0x3558f6(0x1da)]:_0x5aa46c['createUnit'](_0x4f9c6a[_0x3558f6(0x199)],structuredClone(_0x4f9c6a[_0x3558f6(0x14d)]));return;case _0x550821[_0x3558f6(0x1c4)]:_0x5aa46c[_0x3558f6(0x155)](_0x4f9c6a[_0x3558f6(0x199)],structuredClone(_0x4f9c6a[_0x3558f6(0x14d)]));return;case _0x550821[_0x3558f6(0xed)]:_0x5aa46c[_0x3558f6(0x155)](_0x4f9c6a[_0x3558f6(0x199)],structuredClone(_0x4f9c6a[_0x3558f6(0x14d)]));return;case _0x550821['UNIVER_BASE']:_0x5aa46c['createUnit'](_0x4f9c6a[_0x3558f6(0x199)],structuredClone(_0x4f9c6a['unitData']));return;case _0x550821[_0x3558f6(0x164)]:_0x5aa46c[_0x3558f6(0x155)](_0x4f9c6a['unitType'],structuredClone(_0x4f9c6a['unitData']));return;}}var we=class{[_0x3d1750(0x176)];[_0x3d1750(0x14e)];[_0x3d1750(0x19b)];['format']=_0x3d1750(0x12e);constructor(_0x4363a6,_0x39cd9a,_0x4fcbb7){const _0x63da67=_0x3d1750;this['_config']=_0x4363a6,this[_0x63da67(0x14e)]=_0x39cd9a,this[_0x63da67(0x19b)]=_0x4fcbb7;}[_0x3d1750(0x189)](){const _0x5626a6=_0x3d1750;return this[_0x5626a6(0x19b)]['getConnectionState']();}async[_0x3d1750(0x22b)](_0x4dbc42=0x0){const _0x459d00=_0x3d1750;let _0x5e3b1c=X(this[_0x459d00(0x176)][_0x459d00(0x21d)],this[_0x459d00(0x14e)][_0x459d00(0x199)],'unit',this[_0x459d00(0x14e)][_0x459d00(0xeb)],_0x459d00(0x200),_0x4dbc42),_0x57d0f3=await Y(this['_config'],_0x5e3b1c);return Te(_0x57d0f3['snapshot']),_0x57d0f3;}async['getSheetBlock'](_0x31409c){const _0x44b459=_0x3d1750;let _0x206e8a=X(this[_0x44b459(0x176)][_0x44b459(0x21d)],this[_0x44b459(0x14e)][_0x44b459(0x199)],_0x44b459(0x208),this[_0x44b459(0x14e)][_0x44b459(0xeb)],_0x44b459(0x122),_0x31409c),_0x1db795=await Y(this[_0x44b459(0x176)],_0x206e8a);return _0x1db795['block']&&typeof _0x1db795['block'][_0x44b459(0x1be)]=='string'&&(_0x1db795[_0x44b459(0x122)][_0x44b459(0x1be)]=Z(_0x1db795[_0x44b459(0x122)]['data'])),_0x1db795;}async[_0x3d1750(0x136)](_0x187492,_0x3144d9=0x0){const _0xf81607=_0x3d1750;let _0x32dde3=X(this['_config'][_0xf81607(0x21d)],this[_0xf81607(0x14e)][_0xf81607(0x199)],_0xf81607(0x208),this[_0xf81607(0x14e)][_0xf81607(0xeb)],_0xf81607(0x1d8));_0x32dde3[_0xf81607(0x146)][_0xf81607(0x1e3)]('from',String(_0x187492)),_0x32dde3[_0xf81607(0x146)][_0xf81607(0x1e3)]('to',String(_0x3144d9));let _0x1061e5=await Y(this[_0xf81607(0x176)],_0x32dde3);return this[_0xf81607(0x19b)][_0xf81607(0x12d)](),_0x1061e5;}async[_0x3d1750(0x20a)](_0x4b96c){const _0x5c93c1=_0x3d1750;await this[_0x5c93c1(0x19b)]['ensureOnline']();let _0x5981bd=this[_0x5c93c1(0x19b)]['waitForSubmission'](_0x4b96c[_0x5c93c1(0x133)],_0x4b96c['reqId']),_0x3dc18c={..._0x4b96c,'memberID':this['_lease']['memberId'],'revision':0x0,'type':this['_target'][_0x5c93c1(0x199)],'unitID':this['_target'][_0x5c93c1(0xeb)],'userID':''},_0x532413=X(this['_config']['collabSubmitChangesetUrl'],this[_0x5c93c1(0x14e)][_0x5c93c1(0x199)],'unit',this[_0x5c93c1(0x14e)][_0x5c93c1(0xeb)],_0x5c93c1(0x156)),_0x12a788=this[_0x5c93c1(0x176)]['httpRequest'](_0x532413,{'body':JSON[_0x5c93c1(0x1a2)]({'changeset':_0x3dc18c,'memberID':this[_0x5c93c1(0x19b)]['memberId'],'type':this['_target'][_0x5c93c1(0x199)],'unitID':this[_0x5c93c1(0x14e)][_0x5c93c1(0xeb)]}),'headers':{'content-type':'application/json'},'method':'POST'})['then'](async _0x58a73f=>_0x58a73f[_0x5c93c1(0x179)]===0x191||_0x58a73f['status']===0x193?'permission':_0x58a73f['status']===0x190||_0x58a73f[_0x5c93c1(0x179)]===0x199?_0x5c93c1(0x1b8):_0x58a73f['ok']?'accepted':_0x5c93c1(0x22d))[_0x5c93c1(0x143)](()=>_0x5c93c1(0x22d)),_0x123757=Ee(this[_0x5c93c1(0x176)][_0x5c93c1(0x1d4)]),_0x142567=_0x12a788[_0x5c93c1(0x1e1)](_0x255ad9=>_0x255ad9===_0x5c93c1(0x168)?{'status':_0x5c93c1(0x161)}:_0x255ad9==='invalid'?{'status':_0x5c93c1(0x20c)}:new Promise(()=>void 0x0)),_0x524355=await Promise['race']([_0x5981bd[_0x5c93c1(0x19f)],_0x142567,_0x123757[_0x5c93c1(0x19f)][_0x5c93c1(0x1e1)](()=>({'status':'timeout'}))])['finally'](()=>{const _0x37c1e1=_0x5c93c1;_0x5981bd[_0x37c1e1(0x117)](),_0x123757[_0x37c1e1(0x117)]();});if(_0x524355[_0x5c93c1(0x179)]==='timeout'){let _0x355e22=await _0x12a788;return _0x355e22===_0x5c93c1(0x168)?{'message':_0x5c93c1(0x12f),'reason':_0x5c93c1(0x150),'status':_0x5c93c1(0x230)}:_0x355e22===_0x5c93c1(0x1b8)?{'message':_0x5c93c1(0x221),'reason':'invalid-changeset','status':_0x5c93c1(0x230)}:{'status':'unknown'};}if(_0x524355['status']===_0x5c93c1(0x1c0))return{'status':_0x5c93c1(0x22d)};if(_0x524355['status']===_0x5c93c1(0x22c))return{'status':_0x5c93c1(0x22c)};if(_0x524355[_0x5c93c1(0x179)]==='permission-rejected')return{'message':_0x5c93c1(0x12f),'reason':'permission-denied','status':_0x5c93c1(0x230)};if(_0x524355['status']==='changeset-rejected'){let _0x49a714=await this[_0x5c93c1(0x136)](_0x4b96c[_0x5c93c1(0x246)],_0x4b96c[_0x5c93c1(0x246)]);return{'message':_0x5c93c1(0x221),'reason':_0x49a714['latestRevision']!==void 0x0&&_0x49a714[_0x5c93c1(0x19e)]<_0x4b96c[_0x5c93c1(0x246)]?_0x5c93c1(0x121):_0x5c93c1(0x152),'status':_0x5c93c1(0x230)};}let _0x3c0a40=_0x524355[_0x5c93c1(0x21a)],_0x1cecb0=await this[_0x5c93c1(0x136)](_0x4b96c[_0x5c93c1(0x246)],_0x3c0a40[_0x5c93c1(0x1e9)]-0x1);if(_0x24cb5b(_0x1cecb0[_0x5c93c1(0x19d)])){let _0x4a36aa=_0x1cecb0[_0x5c93c1(0x19d)];throw new j(_0x5c93c1(0x1cb),_0x4a36aa?.['message']||_0x5c93c1(0x1e6),{'retryable':!0x0});}return{'acceptedChangeset':_0x3c0a40,'precedingChangesets':_0x1cecb0[_0x5c93c1(0x1ac)],'status':'confirmed'};}async[_0x3d1750(0x223)](){const _0x286285=_0x3d1750;await this[_0x286285(0x19b)][_0x286285(0x223)]();}};async function Y(_0x2faf56,_0x1b4af5){const _0x26f7fd=_0x3d1750;let _0x150e28;try{_0x150e28=await _0x2faf56[_0x26f7fd(0x170)](_0x1b4af5,{'method':_0x26f7fd(0x107)});}catch(_0xb83415){throw new j(_0x26f7fd(0x1cb),_0x26f7fd(0x1f3),{'cause':_0xb83415,'retryable':!0x0});}if(!_0x150e28['ok'])throw new j(_0x26f7fd(0x1cb),_0x26f7fd(0x10a)+_0x150e28[_0x26f7fd(0x179)],{'retryable':_0x150e28['status']>=0x1f4});try{return await _0x150e28[_0x26f7fd(0x127)]();}catch(_0x5ea43f){throw new j(_0x26f7fd(0x23c),_0x26f7fd(0x15e),{'cause':_0x5ea43f});}}function X(_0x5ad5b1,..._0x4aeb82){const _0x1ac3f5=_0x3d1750;let _0x225129=new URL(_0x5ad5b1);return _0x225129[_0x1ac3f5(0x18d)]=_0x225129[_0x1ac3f5(0x18d)][_0x1ac3f5(0x232)](/\/$/,'')+'/'+_0x4aeb82[_0x1ac3f5(0x215)](_0x3492f0=>encodeURIComponent(String(_0x3492f0)))[_0x1ac3f5(0x1fe)]('/'),_0x225129;}function Te(_0xfa0bf3){const _0x31624a=_0x3d1750;if(!_0xfa0bf3)return;let _0x1525f5=[_0xfa0bf3[_0x31624a(0xee)],_0xfa0bf3[_0x31624a(0x128)],_0xfa0bf3[_0x31624a(0x165)],_0xfa0bf3[_0x31624a(0x235)]];for(let _0x2a5b4d of _0x1525f5)_0x2a5b4d&&typeof _0x2a5b4d[_0x31624a(0xff)]==_0x31624a(0x1eb)&&(_0x2a5b4d[_0x31624a(0xff)]=Z(_0x2a5b4d[_0x31624a(0xff)]));if(_0xfa0bf3[_0x31624a(0xee)]){for(let _0x517680 of Object[_0x31624a(0xf1)](_0xfa0bf3[_0x31624a(0xee)]['sheets']))typeof _0x517680[_0x31624a(0xff)]=='string'&&(_0x517680[_0x31624a(0xff)]=Z(_0x517680[_0x31624a(0xff)]));}}function Z(_0x5544e5){const _0x1b3d42=_0x3d1750;return Uint8Array[_0x1b3d42(0x1de)](Buffer['from'](_0x5544e5,_0x1b3d42(0x12c)));}function Ee(_0x59176e){let _0x1c57c5;return{'cancel':()=>{_0x1c57c5!==void 0x0&&clearTimeout(_0x1c57c5);},'promise':new Promise(_0x494d22=>{_0x1c57c5=setTimeout(_0x494d22,_0x59176e);})};}var De=class{[_0x3d1750(0x176)];['_state']=_0x3d1750(0x24c);[_0x3d1750(0x105)];[_0x3d1750(0x210)];['_memberId']='';['_joined']=new Map();[_0x3d1750(0x158)]=new Map();[_0x3d1750(0x1f4)]=new Map();[_0x3d1750(0x113)]=new Map();[_0x3d1750(0x186)];[_0x3d1750(0x132)];[_0x3d1750(0x211)]=0x0;constructor(_0x23cf34){this['_config']=_0x23cf34;}async[_0x3d1750(0x1f9)](_0x40b8b8){const _0x1ef8f2=_0x3d1750;let _0x3f5936=this[_0x1ef8f2(0x15f)][_0x1ef8f2(0x257)](_0x40b8b8['unitId']);if(_0x3f5936&&_0x3f5936[_0x1ef8f2(0xf8)][_0x1ef8f2(0x199)]!==_0x40b8b8[_0x1ef8f2(0x199)])throw new j(_0x1ef8f2(0x1b1),_0x1ef8f2(0x109));if(await this[_0x1ef8f2(0x10d)](),_0x3f5936)_0x3f5936[_0x1ef8f2(0xec)]+=0x1;else{try{await this[_0x1ef8f2(0x185)](_0x40b8b8);}catch(_0x351c5a){throw this[_0x1ef8f2(0x15f)][_0x1ef8f2(0x1a7)]===0x0&&(this[_0x1ef8f2(0xf2)]=_0x1ef8f2(0x1c0),this['_stopHeartbeat'](),this['_socket']?.[_0x1ef8f2(0x223)](0x3e8,'Initial\x20Unit\x20JOIN\x20failed'),this[_0x1ef8f2(0x105)]=void 0x0,this['_memberId']=''),_0x351c5a;}this['_joined'][_0x1ef8f2(0x1e3)](_0x40b8b8[_0x1ef8f2(0xeb)],{'leases':0x1,'target':_0x40b8b8});}let _0x70642c=!0x1,_0xb2a0f0=()=>this['_memberId'],_0x199d47=new Set();return{'close':async()=>{const _0x27532b=_0x1ef8f2;if(!_0x70642c){_0x70642c=!0x0;for(let _0x52dfd8 of _0x199d47)_0x52dfd8['cancel']();_0x199d47[_0x27532b(0x177)](),await this[_0x27532b(0x1e4)](_0x40b8b8['unitId']);}},'ensureOnline':async()=>await this[_0x1ef8f2(0x10d)](),'getConnectionState':()=>_0x70642c?_0x1ef8f2(0x1c0):this[_0x1ef8f2(0xf2)],get 'memberId'(){return _0xb2a0f0();},'takeInboundChangesets':()=>{const _0x4fcb1e=_0x1ef8f2;let _0xabd4de=this['_inbound']['get'](_0x40b8b8[_0x4fcb1e(0xeb)])??[];return this[_0x4fcb1e(0x113)][_0x4fcb1e(0x17b)](_0x40b8b8[_0x4fcb1e(0xeb)]),_0xabd4de;},'waitForSubmission':(_0x2d22da,_0x2d2322)=>{const _0x228d3b=_0x1ef8f2;let _0x51d9d2=this['_waitForSubmission'](_0x2d22da,_0x2d2322);return _0x199d47[_0x228d3b(0x13d)](_0x51d9d2),_0x51d9d2[_0x228d3b(0x19f)]['then'](()=>_0x199d47[_0x228d3b(0x17b)](_0x51d9d2),()=>_0x199d47[_0x228d3b(0x17b)](_0x51d9d2)),{'cancel':()=>{const _0x5e136d=_0x228d3b;_0x199d47[_0x5e136d(0x17b)](_0x51d9d2),_0x51d9d2['cancel']();},'promise':_0x51d9d2[_0x228d3b(0x19f)]};}};}async['_ensureConnected'](){const _0x135723=_0x3d1750;if(this[_0x135723(0xf2)]!==_0x135723(0x1d5)||this[_0x135723(0x105)]?.[_0x135723(0x213)]!==WebSocket[_0x135723(0x1cc)]){this[_0x135723(0x132)]!==void 0x0&&clearTimeout(this[_0x135723(0x132)]),this[_0x135723(0x132)]=void 0x0,this[_0x135723(0x210)]??=this['_connect']();try{await this[_0x135723(0x210)];}finally{this[_0x135723(0x210)]=void 0x0;}}}async[_0x3d1750(0x1fd)](){const _0x1af1a2=_0x3d1750;this[_0x1af1a2(0xf2)]=_0x1af1a2(0x1ad);let _0x10dc86=await this[_0x1af1a2(0x176)][_0x1af1a2(0x170)](this[_0x1af1a2(0x176)][_0x1af1a2(0x24e)],{'headers':{'content-type':_0x1af1a2(0x236)},'method':_0x1af1a2(0x107)});if(!_0x10dc86['ok'])throw this[_0x1af1a2(0xf2)]=_0x1af1a2(0x24c),new j(_0x1af1a2(0x1cb),_0x1af1a2(0x18f)+_0x10dc86[_0x1af1a2(0x179)],{'retryable':_0x10dc86[_0x1af1a2(0x179)]>=0x1f4});let _0x11a2c2=await _0x10dc86[_0x1af1a2(0x127)]();if(typeof _0x11a2c2[_0x1af1a2(0xe7)]!=_0x1af1a2(0x1eb)||_0x11a2c2[_0x1af1a2(0xe7)]['length']===0x0)throw this[_0x1af1a2(0xf2)]=_0x1af1a2(0x24c),new j(_0x1af1a2(0x23c),'Session\x20ticket\x20response\x20is\x20missing\x20a\x20ticket');let _0x20b859=new URL(this[_0x1af1a2(0x176)][_0x1af1a2(0x1b0)]);_0x20b859[_0x1af1a2(0x146)][_0x1af1a2(0x1e3)](_0x1af1a2(0x102),_0x11a2c2['ticket']);let _0x433e50=new WebSocket(_0x20b859);this[_0x1af1a2(0x105)]=_0x433e50,_0x433e50['addEventListener'](_0x1af1a2(0x22e),_0x25ef71=>this[_0x1af1a2(0x104)](_0x25ef71)),_0x433e50[_0x1af1a2(0x198)](_0x1af1a2(0x223),()=>{const _0x345204=_0x1af1a2;this['_socket']===_0x433e50&&(this[_0x345204(0x11a)](),this[_0x345204(0x1ea)](new j(_0x345204(0x1cb),_0x345204(0x191),{'retryable':!0x0})),this['_state']=this[_0x345204(0x15f)][_0x345204(0x1a7)]===0x0?_0x345204(0x1c0):_0x345204(0x1ad),this['_joined'][_0x345204(0x1a7)]>0x0&&this['_scheduleReconnect']());}),await Oe(_0x433e50);let _0x1ee966=await this[_0x1af1a2(0x201)](_0x526731[_0x1af1a2(0x241)],'',{'cmd':_0x526731[_0x1af1a2(0x241)],'routeKey':''});if(_0x1ee966[_0x1af1a2(0x1b5)]!==_0x22ffe8['OK']||typeof _0x1ee966[_0x1af1a2(0x16b)]?.[_0x1af1a2(0x15a)]!='string')throw _0x433e50['close'](),new j(_0x1af1a2(0x23c),_0x1af1a2(0x118));this['_memberId']=_0x1ee966[_0x1af1a2(0x16b)][_0x1af1a2(0x15a)],this['_state']='online';for(let {target:_0x5b3da5}of this[_0x1af1a2(0x15f)]['values']())try{await this[_0x1af1a2(0x185)](_0x5b3da5);}catch(_0x83faff){throw _0x433e50[_0x1af1a2(0x223)](0x3f3,'Failed\x20to\x20rejoin\x20Unit\x20room'),_0x83faff;}this['_reconnectAttempts']=0x0,this[_0x1af1a2(0x23d)]();}async[_0x3d1750(0x185)](_0x2425c1){const _0x47dcdc=_0x3d1750;let _0x11375f=await this[_0x47dcdc(0x201)](_0x526731[_0x47dcdc(0x1a1)],_0x2425c1['unitId'],{'cmd':_0x526731[_0x47dcdc(0x1a1)],'joinReq':{'rooms':[{'args':'','roomID':_0x2425c1['unitId']}]},'routeKey':_0x2425c1['unitId']});if(_0x11375f['code']!==_0x22ffe8['OK'])throw new j('COLLABORATION_UNAVAILABLE',typeof _0x11375f[_0x47dcdc(0x1bb)]=='string'?_0x11375f[_0x47dcdc(0x1bb)]:_0x47dcdc(0x250));}[_0x3d1750(0x201)](_0x1fd60a,_0x230271,_0x3cf1f5){const _0x1566a9=_0x3d1750;let _0x902671=this[_0x1566a9(0x105)];if(!_0x902671||_0x902671['readyState']!==WebSocket[_0x1566a9(0x1cc)])return Promise[_0x1566a9(0x125)](new j(_0x1566a9(0x1cb),_0x1566a9(0x119),{'retryable':!0x0}));let _0x18ec87=_0x1fd60a+':'+_0x230271;return new Promise((_0x4372be,_0xf323a1)=>{const _0x88c3f2=_0x1566a9;if(this[_0x88c3f2(0x158)][_0x88c3f2(0x224)](_0x18ec87)){_0xf323a1(new j(_0x88c3f2(0x23c),'A\x20'+_0x1fd60a+_0x88c3f2(0x116)+_0x230271));return;}let _0xd34de=setTimeout(()=>{const _0x5ee97a=_0x88c3f2;this[_0x5ee97a(0x158)][_0x5ee97a(0x17b)](_0x18ec87),_0xf323a1(new j(_0x5ee97a(0x1cb),_0x5ee97a(0x16f)+_0x1fd60a,{'retryable':!0x0}));},0x7530);this['_commandWaiters']['set'](_0x18ec87,{'reject':_0xf323a1,'resolve':_0x4372be,'timer':_0xd34de});try{_0x902671['send'](JSON[_0x88c3f2(0x1a2)](_0x3cf1f5));}catch(_0x44213b){this['_commandWaiters'][_0x88c3f2(0x17b)](_0x18ec87),clearTimeout(_0xd34de),_0xf323a1(new j('COLLABORATION_UNAVAILABLE',_0x88c3f2(0x203),{'cause':_0x44213b,'retryable':!0x0}));}});}[_0x3d1750(0x104)](_0x11ec62){const _0x1a50a2=_0x3d1750;if(typeof _0x11ec62[_0x1a50a2(0x1be)]!=_0x1a50a2(0x1eb))return;let _0x4e9e6c;try{_0x4e9e6c=JSON['parse'](_0x11ec62[_0x1a50a2(0x1be)]);}catch{this['_socket']?.[_0x1a50a2(0x223)](0x3eb,_0x1a50a2(0xf5));return;}let _0x38f498=typeof _0x4e9e6c['routeKey']==_0x1a50a2(0x1eb)?_0x4e9e6c[_0x1a50a2(0x197)]:'';if(_0x4e9e6c[_0x1a50a2(0x1dd)]===_0x526731[_0x1a50a2(0x241)]||_0x4e9e6c[_0x1a50a2(0x1dd)]===_0x526731[_0x1a50a2(0x1a1)]||_0x4e9e6c[_0x1a50a2(0x1dd)]===_0x526731[_0x1a50a2(0x1dc)]){let _0x28d2d1=_0x4e9e6c['cmd']+':'+_0x38f498,_0x20c426=this[_0x1a50a2(0x158)][_0x1a50a2(0x257)](_0x28d2d1);_0x20c426&&(this[_0x1a50a2(0x158)][_0x1a50a2(0x17b)](_0x28d2d1),clearTimeout(_0x20c426[_0x1a50a2(0xf9)]),_0x20c426[_0x1a50a2(0xfd)](_0x4e9e6c));return;}_0x4e9e6c['cmd']!==_0x526731[_0x1a50a2(0xe9)]||!_0x4e9e6c[_0x1a50a2(0xfc)]||this[_0x1a50a2(0x135)](_0x38f498,_0x4e9e6c[_0x1a50a2(0xfc)]);}[_0x3d1750(0x135)](_0x4ca2f9,_0x49c2f7){const _0xaaf1dc=_0x3d1750;let _0x4b7304=_0x49c2f7[_0xaaf1dc(0x194)],_0x22961b=_0x4b7304===_0xaaf1dc(0x1ed)?_0xaaf1dc(0x218):_0x4b7304===_0xaaf1dc(0x207)?_0xaaf1dc(0x175):_0x4b7304==='changeset_should_retry'?_0xaaf1dc(0x22f):_0x4b7304===_0xaaf1dc(0x19c)?_0xaaf1dc(0x233):_0x4b7304===_0xaaf1dc(0x15b)?'newCsEvent':void 0x0;if(!_0x22961b)return;let _0x16d5ed=ke(_0x49c2f7[_0x22961b]);if(!_0x16d5ed||_0x16d5ed['unitID']!==_0x4ca2f9)return;if(_0x4b7304==='new_changesets'){let _0x4198c1=this['_inbound']['get'](_0x4ca2f9)??[];_0x4198c1['push'](_0x16d5ed),this['_inbound']['set'](_0x4ca2f9,_0x4198c1);return;}let _0xabe406=Q(_0x16d5ed[_0xaaf1dc(0x133)],_0x16d5ed[_0xaaf1dc(0x187)]),_0x10f9d7=this[_0xaaf1dc(0x1f4)]['get'](_0xabe406);_0x10f9d7&&_0x10f9d7(_0x4b7304===_0xaaf1dc(0x1ed)?{'changeset':_0x16d5ed,'status':_0xaaf1dc(0xf7)}:_0x4b7304===_0xaaf1dc(0x1b7)?{'status':_0xaaf1dc(0x22c)}:_0x4b7304===_0xaaf1dc(0x19c)?{'status':_0xaaf1dc(0x161)}:{'status':_0xaaf1dc(0x20c)});}[_0x3d1750(0x1b9)](_0x458c58,_0x3445a5){const _0x35397a=_0x3d1750;let _0x51e43a=Q(_0x458c58,_0x3445a5);if(this[_0x35397a(0x1f4)][_0x35397a(0x224)](_0x51e43a))return{'cancel':()=>void 0x0,'promise':Promise[_0x35397a(0x125)](new j(_0x35397a(0x1b1),_0x35397a(0x23a)))};let _0x49eb3d=()=>void 0x0;return{'cancel':()=>_0x49eb3d({'status':_0x35397a(0x1c0)}),'promise':new Promise(_0x5de182=>{const _0xffbff5=_0x35397a;_0x49eb3d=_0x4b2a61=>{const _0x5b4716=_0x2899;this[_0x5b4716(0x1f4)][_0x5b4716(0x17b)](_0x51e43a)&&_0x5de182(_0x4b2a61);},this['_submissionWaiters'][_0xffbff5(0x1e3)](_0x51e43a,_0x49eb3d);})};}async[_0x3d1750(0x1e4)](_0x407dea){const _0x49645c=_0x3d1750;let _0x466be0=this[_0x49645c(0x15f)]['get'](_0x407dea);_0x466be0&&(--_0x466be0[_0x49645c(0xec)],!(_0x466be0[_0x49645c(0xec)]>0x0)&&(this[_0x49645c(0x15f)][_0x49645c(0x17b)](_0x407dea),this['_inbound'][_0x49645c(0x17b)](_0x407dea),this[_0x49645c(0x105)]?.[_0x49645c(0x213)]===WebSocket[_0x49645c(0x1cc)]&&this[_0x49645c(0x105)]['send'](JSON[_0x49645c(0x1a2)]({'cmd':_0x526731[_0x49645c(0x182)],'leaveReq':{'args':'','roomID':_0x407dea},'routeKey':_0x407dea})),this[_0x49645c(0x15f)][_0x49645c(0x1a7)]===0x0&&(this['_state']=_0x49645c(0x1c0),this[_0x49645c(0x132)]!==void 0x0&&clearTimeout(this['_reconnectTimer']),this[_0x49645c(0x132)]=void 0x0,this['_stopHeartbeat'](),this[_0x49645c(0x105)]?.[_0x49645c(0x223)](0x3e8,'No\x20active\x20Unit\x20leases'),this[_0x49645c(0x105)]=void 0x0,this[_0x49645c(0x206)]='')));}[_0x3d1750(0x251)](){const _0x4d8996=_0x3d1750;if(this[_0x4d8996(0x132)]!==void 0x0||this[_0x4d8996(0x211)]>=0x3){this[_0x4d8996(0x211)]>=0x3&&(this['_state']=_0x4d8996(0x24c));return;}let _0x588104=Math[_0x4d8996(0xde)](0x3e8*0x2**this['_reconnectAttempts'],0x4e20);this[_0x4d8996(0x211)]+=0x1,this[_0x4d8996(0x132)]=setTimeout(()=>{const _0x5180d1=_0x4d8996;this[_0x5180d1(0x132)]=void 0x0,this[_0x5180d1(0x210)]??=this[_0x5180d1(0x1fd)](),this[_0x5180d1(0x210)][_0x5180d1(0x143)](()=>this[_0x5180d1(0x251)]())[_0x5180d1(0x20f)](()=>{const _0x3b1ddb=_0x5180d1;this[_0x3b1ddb(0x210)]=void 0x0;});},_0x588104);}[_0x3d1750(0x23d)](){const _0x34b66d=_0x3d1750;this['_stopHeartbeat'](),this[_0x34b66d(0x186)]=setInterval(()=>{const _0x3c13e3=_0x34b66d;this[_0x3c13e3(0xf2)]==='online'&&this['_requestCommand'](_0x526731[_0x3c13e3(0x1dc)],'',{'cmd':_0x526731['HEARTBEAT'],'routeKey':''})[_0x3c13e3(0x143)](()=>this[_0x3c13e3(0x105)]?.[_0x3c13e3(0x223)](0x3f3,'Heartbeat\x20failed'));},0x7530);}[_0x3d1750(0x11a)](){const _0x16a876=_0x3d1750;this['_heartbeat']!==void 0x0&&clearInterval(this[_0x16a876(0x186)]),this[_0x16a876(0x186)]=void 0x0;}[_0x3d1750(0x1ea)](_0x449d6a){const _0x2b3184=_0x3d1750;for(let _0x29d80f of this['_commandWaiters']['values']())clearTimeout(_0x29d80f['timer']),_0x29d80f[_0x2b3184(0x125)](_0x449d6a);this['_commandWaiters'][_0x2b3184(0x177)]();}};function Oe(_0x1a86dc){return new Promise((_0x5d9c15,_0x1ad94d)=>{const _0x4a7b2a=_0x2899;let _0x2df5aa=()=>{const _0x50ea85=_0x2899;clearTimeout(_0x312b49),_0x1a86dc[_0x50ea85(0x1aa)](_0x50ea85(0x223),_0x2b217a),_0x1a86dc[_0x50ea85(0x1aa)]('error',_0x2a80b9),_0x1a86dc['removeEventListener']('open',_0x4a0e60);},_0x5aa00c=_0x25db97=>{const _0x219cce=_0x2899;_0x2df5aa(),_0x1ad94d(new j(_0x219cce(0x1cb),_0x25db97,{'retryable':!0x0}));},_0x2b217a=()=>_0x5aa00c(_0x4a7b2a(0x22a)),_0x2a80b9=()=>_0x5aa00c(_0x4a7b2a(0x1fb)),_0x4a0e60=()=>{_0x2df5aa(),_0x5d9c15();},_0x312b49=setTimeout(()=>{const _0x409e2b=_0x4a7b2a;_0x5aa00c(_0x409e2b(0xe5)),_0x1a86dc[_0x409e2b(0x223)](0x3e8,'Connection\x20timed\x20out');},0x7530);_0x1a86dc[_0x4a7b2a(0x198)](_0x4a7b2a(0x223),_0x2b217a,{'once':!0x0}),_0x1a86dc['addEventListener'](_0x4a7b2a(0x19d),_0x2a80b9,{'once':!0x0}),_0x1a86dc[_0x4a7b2a(0x198)]('open',_0x4a0e60,{'once':!0x0});});}function ke(_0x405c51){const _0x5ad2a9=_0x3d1750;if(!_0x405c51||typeof _0x405c51!='object')return null;let _0x265802=_0x405c51['cs'];return _0x265802&&typeof _0x265802==_0x5ad2a9(0x1c2)?_0x265802:null;}function Q(_0x52877f,_0x5606a4){return(_0x52877f??'')+':'+(_0x5606a4??0x0);}var Ae=class{[_0x3d1750(0x176)];['_connection'];constructor(_0x5d2164){const _0x5004cd=_0x3d1750;this[_0x5004cd(0x176)]=je(_0x5d2164),this[_0x5004cd(0x1a8)]=new De(this[_0x5004cd(0x176)]);}async[_0x3d1750(0x247)](_0x313c0c){const _0x1e8b0c=_0x3d1750;let _0x32b571=await this[_0x1e8b0c(0x1a8)][_0x1e8b0c(0x1f9)](_0x313c0c);return new we(this[_0x1e8b0c(0x176)],_0x313c0c,_0x32b571);}};function je(_0x5c65d8){const _0x2a81e5=_0x3d1750;let _0x345d54=$(_0x5c65d8[_0x2a81e5(0x21d)],_0x2a81e5(0x21d),[_0x2a81e5(0x216),_0x2a81e5(0x16d)]),_0x1240a3=$(_0x5c65d8[_0x2a81e5(0x1b2)],_0x2a81e5(0x1b2),['http:',_0x2a81e5(0x16d)]),_0x6be3b5=$(_0x5c65d8[_0x2a81e5(0x1b0)],_0x2a81e5(0x1b0),[_0x2a81e5(0xf0),'wss:',_0x2a81e5(0x216),'https:']);_0x6be3b5['protocol']===_0x2a81e5(0x216)&&(_0x6be3b5[_0x2a81e5(0x1d9)]=_0x2a81e5(0xf0)),_0x6be3b5[_0x2a81e5(0x1d9)]===_0x2a81e5(0x16d)&&(_0x6be3b5[_0x2a81e5(0x1d9)]='wss:');let _0x2723ba=$(_0x5c65d8[_0x2a81e5(0x24e)],_0x2a81e5(0x24e),['http:',_0x2a81e5(0x16d)]),_0x1eb9e9=_0x5c65d8[_0x2a81e5(0x1d4)]??0x7530;if(!Number[_0x2a81e5(0x1df)](_0x1eb9e9)||_0x1eb9e9<=0x0)throw new j(_0x2a81e5(0x1b1),_0x2a81e5(0xdf));return{'collabSubmitChangesetUrl':_0x1240a3,'collabWebSocketUrl':_0x6be3b5,'commitTimeoutMs':_0x1eb9e9,'httpRequest':_0x5c65d8['httpRequest']??globalThis['fetch']['bind'](globalThis),'snapshotServerUrl':_0x345d54,'wsSessionTicketUrl':_0x2723ba};}function $(_0x571931,_0x15df1c,_0x334d0f){const _0x43a268=_0x3d1750;let _0x221dfa;try{_0x221dfa=new URL(_0x571931);}catch{throw new j(_0x43a268(0x1b1),_0x15df1c+_0x43a268(0xef));}if(!_0x334d0f['includes'](_0x221dfa[_0x43a268(0x1d9)]))throw new j(_0x43a268(0x1b1),_0x15df1c+'\x20uses\x20an\x20unsupported\x20protocol');return _0x221dfa;}function Me(_0x34ba02){return new Ae(_0x34ba02);}export{j as CollaborationRuntimeError,Me as createCollaborationServerAdapter,ve as createUniverCollaborationRuntimeFactory};
|
|
1
|
+
const _0x5e6b2d=_0x67e3;(function(_0x18d7cb,_0x423073){const _0xb55c68=_0x67e3,_0x4f633f=_0x18d7cb();while(!![]){try{const _0x53c35c=-parseInt(_0xb55c68(0x1af))/0x1*(-parseInt(_0xb55c68(0x1c6))/0x2)+-parseInt(_0xb55c68(0x2e5))/0x3+parseInt(_0xb55c68(0x291))/0x4+parseInt(_0xb55c68(0x2fd))/0x5*(parseInt(_0xb55c68(0x2ea))/0x6)+-parseInt(_0xb55c68(0x315))/0x7*(parseInt(_0xb55c68(0x230))/0x8)+parseInt(_0xb55c68(0x24b))/0x9+-parseInt(_0xb55c68(0x1b6))/0xa;if(_0x53c35c===_0x423073)break;else _0x4f633f['push'](_0x4f633f['shift']());}catch(_0x18e37c){_0x4f633f['push'](_0x4f633f['shift']());}}}(_0x1384,0xd8e4f));import{CommandType as _0x583014,DependentOn as _0x57fa7a,ICommandService as _0x4398d7,IUniverInstanceService as _0x36c186,Inject as _0x191d9f,Injector as _0x857fc3,Plugin as _0x3590eb,UniverInstanceType as _0x35327a,registerDependencies as _0x2bb7ea,sequenceExecute as _0x200257,toDisposable as _0x21f8ea}from'@univerjs/core';import{CompressMutationService as _0x125608,ISnapshotServerService as _0x32e3ff,ITransformService as _0x1a5c37,RevertRevisionMutation as _0x5c912b,RevisionService as _0x2dad72,SnapshotService as _0x16d22b,UniverCollaborationPlugin as _0x59c157,isTransformMutationsSuccess as _0x5569a7,parseChangesetToProtocol as _0x14fe0e,parseMutationToProtocol as _0x46de9d,parseProtocolChangeset as _0x22f50a,transformSnapshotToBaseData as _0x3ded75,transformSnapshotToBoardData as _0x4c8227,transformSnapshotToDocumentData as _0x1dbd3a,transformSnapshotToSlideData as _0x226a08,transformSnapshotToWorkbookData as _0x2c2b13}from'@univerjs-pro/collaboration';import{FormulaCalculationSessionService as _0x1a0611}from'@univerjs/engine-formula';import{CmdRspCode as _0x21c0c8,CombCmd as _0x53cd9f,isError as _0x3e8af9}from'@univerjs/protocol';import{PersistFormulaLastValuesCommand as _0x565be5}from'@univerjs-pro/engine-formula';import{DocStateChangeManagerService as _0xe139b,RichTextEditingMutation as _0x21bc91}from'@univerjs/docs';import{IRenderManagerService as _0x1756f2}from'@univerjs/engine-render';import{FUniver as _0x23ff19}from'@univerjs/core/facade';import'@univerjs-pro/bases/facade';import'@univerjs-pro/boards/facade';import'@univerjs-pro/slides/facade';import'@univerjs/docs/facade';import'@univerjs/sheets/facade';import _0x4cf2f2 from'@oxc-project/runtime/helpers/decorateParam';import _0x2174d4 from'@oxc-project/runtime/helpers/decorate';var j=class extends Error{['code'];['retryable'];constructor(_0x5eb151,_0x55f2af,_0x1cb9a2={}){const _0x4b1519=_0x67e3;super(_0x55f2af,_0x1cb9a2),this[_0x4b1519(0x286)]='CollaborationRuntimeError',this[_0x4b1519(0x207)]=_0x5eb151,this['retryable']=_0x1cb9a2[_0x4b1519(0x24c)]??!0x1;}},se=class{[_0x5e6b2d(0x321)];[_0x5e6b2d(0x20a)];[_0x5e6b2d(0x2ae)]=[];[_0x5e6b2d(0x1d6)]=[];['_suppressionDepth']=0x0;constructor(_0x120bb2,_0x4a42a3,_0x28386c){const _0x1bd113=_0x5e6b2d;this[_0x1bd113(0x321)]=_0x120bb2,this['_unitId']=_0x4a42a3,this[_0x1bd113(0x1d6)]['push'](_0x120bb2[_0x1bd113(0x23e)][_0x1bd113(0x233)]((_0x2d7f71,_0x1debdd)=>{const _0x87d56b=_0x1bd113;this[_0x87d56b(0x1de)](_0x2d7f71,_0x1debdd,_0x28386c);})),_0x28386c===_0x35327a[_0x1bd113(0x2de)]&&(_0x120bb2[_0x1bd113(0x269)][_0x1bd113(0x31e)](_0x1756f2),this[_0x1bd113(0x2f1)]());}get[_0x5e6b2d(0x242)](){const _0x582851=_0x5e6b2d;return this[_0x582851(0x2ae)];}[_0x5e6b2d(0x1e3)](_0x341ac1){const _0x559e29=_0x5e6b2d;return this[_0x559e29(0x2ae)]['slice'](_0x341ac1);}[_0x5e6b2d(0x1ee)](_0x3d8bf8){const _0x2fe100=_0x5e6b2d;this[_0x2fe100(0x2ae)][_0x2fe100(0x2b9)](0x0,this[_0x2fe100(0x2ae)][_0x2fe100(0x31c)],..._0x3d8bf8);}['takePending'](){const _0x3e2247=_0x5e6b2d;return this[_0x3e2247(0x2ae)][_0x3e2247(0x2b9)](0x0);}[_0x5e6b2d(0x246)](_0x944f72){const _0x2d6a38=_0x5e6b2d;this['_pending'][_0x2d6a38(0x303)](..._0x944f72);}async['suppress'](_0x40953d){const _0x578073=_0x5e6b2d;this[_0x578073(0x29c)]+=0x1;try{return await _0x40953d();}finally{--this[_0x578073(0x29c)];}}['dispose'](){const _0x103394=_0x5e6b2d;for(let _0x7129c5 of this[_0x103394(0x1d6)]['splice'](0x0))_0x7129c5[_0x103394(0x24a)]();}[_0x5e6b2d(0x1de)](_0xc2401f,_0x2f0de9,_0x33a9d6){const _0x46dbe7=_0x5e6b2d;if(this[_0x46dbe7(0x29c)]>0x0||_0xc2401f[_0x46dbe7(0x1ce)]!==_0x583014[_0x46dbe7(0x2f4)]||_0x2f0de9?.[_0x46dbe7(0x1f2)]||_0x2f0de9?.[_0x46dbe7(0x296)]||_0x2f0de9?.['onlyLocal'])return;let _0xa95c44=_0xc2401f['params'];if(_0xa95c44?.[_0x46dbe7(0x274)]!==void 0x0&&_0xa95c44['unitId']!==this[_0x46dbe7(0x20a)]){if(_0xa95c44[_0x46dbe7(0x1bc)]===_0x565be5['id'])return;throw new j('COLLABORATION_INVALID_INPUT','Runtime\x20for\x20'+this['_unitId']+_0x46dbe7(0x201)+_0xc2401f['id']+_0x46dbe7(0x29f)+String(_0xa95c44['unitId']));}if(_0xa95c44?.['unitId']===void 0x0||_0x33a9d6===_0x35327a[_0x46dbe7(0x2de)]&&_0xc2401f['id']===_0x21bc91['id'])return;if(_0xc2401f['id']===_0x5c912b['id'])throw new j(_0x46dbe7(0x2bf),_0x46dbe7(0x1be));let _0x3649e5=_0xc2401f,_0xbb025a=this[_0x46dbe7(0x321)][_0x46dbe7(0x2f2)][_0x46dbe7(0x2d8)][_0x46dbe7(0x2d9)]()[_0x46dbe7(0x2ee)],_0x35ce6d=(this[_0x46dbe7(0x321)]['compressMutationService'][_0x46dbe7(0x2d8)][_0x46dbe7(0x1ed)](_0xbb025a)([_0x3649e5],this['_kernel'][_0x46dbe7(0x297)])??[_0x3649e5])[0x0];_0x35ce6d&&this['_pending']['push'](_0x46de9d(_0x35ce6d));}[_0x5e6b2d(0x2f1)](){const _0x536276=_0x5e6b2d;let _0x5de587=this[_0x536276(0x321)][_0x536276(0x269)][_0x536276(0x31e)](_0xe139b)[_0x536276(0x20b)][_0x536276(0x2ba)](_0x46c99e=>{const _0x3bea02=_0x536276;if(this[_0x3bea02(0x29c)]>0x0||_0x46c99e?.['unitId']!==this[_0x3bea02(0x20a)])return;let _0x1d09fe={'id':_0x46c99e['commandId'],'params':{'actions':_0x46c99e[_0x3bea02(0x300)]['actions'],'textRanges':null,'unitId':_0x46c99e['unitId']},'type':_0x583014[_0x3bea02(0x2f4)]};this[_0x3bea02(0x2ae)][_0x3bea02(0x1d8)](_0x46de9d(_0x1d09fe));});this[_0x536276(0x1d6)][_0x536276(0x1d8)](_0x21f8ea(()=>_0x5de587[_0x536276(0x237)]()));}},ce=new Set([_0x5e6b2d(0x1e1),_0x5e6b2d(0x200),_0x5e6b2d(0x217),_0x5e6b2d(0x316),_0x5e6b2d(0x1e9),_0x5e6b2d(0x1e0),_0x5e6b2d(0x20e)]),le=new Set([_0x5e6b2d(0x236),_0x5e6b2d(0x306),'createWorkbook',_0x5e6b2d(0x280),'createPresentation','createUniverSheet','disposeUnit']);function ue(_0x325e6d,_0x1d4b63,_0x24487c){const _0x1056d5=_0x5e6b2d;let _0x443915=_0x23ff19[_0x1056d5(0x1cf)](_0x325e6d);return{async 'execute'(_0x5b528e,_0x403684){const _0x4a9eaa=_0x1056d5;if(_0x5b528e[_0x4a9eaa(0x31c)]>_0x24487c)throw new j(_0x4a9eaa(0x2bf),_0x4a9eaa(0x1f5)+_0x24487c+_0x4a9eaa(0x1cc));let _0x1add65=_0x403684===_0x4a9eaa(0x307)?M(_0x443915):void 0x0,_0x42e4d1=de(_0x443915,_0x1d4b63);try{return await Function('univerAPI',_0x4a9eaa(0x253)+_0x5b528e+_0x4a9eaa(0x2eb))(_0x42e4d1);}finally{_0x1add65?.[_0x4a9eaa(0x24a)]();}}};}function de(_0x58a501,_0x360fdf){return new Proxy(_0x58a501,{'get'(_0x21341f,_0x37bd63,_0x4cdd0a){const _0x786e14=_0x67e3;return le[_0x786e14(0x30d)](_0x37bd63)?()=>{const _0x52b291=_0x786e14;throw new j('COLLABORATION_INVALID_INPUT',_0x52b291(0x1fc)+_0x360fdf+'\x20cannot\x20call\x20'+String(_0x37bd63));}:Reflect['get'](_0x21341f,_0x37bd63,_0x4cdd0a);}});}function M(_0x459ada){const _0x4655a5=_0x5e6b2d;return _0x459ada['addEvent'](_0x459ada[_0x4655a5(0x216)]['BeforeCommandExecute'],_0x2e00b5=>{const _0x4b95af=_0x4655a5;let _0x342459=_0x2e00b5;if(N(_0x342459))throw _0x342459[_0x4b95af(0x229)]=!0x0,new j('COLLABORATION_INVALID_INPUT',_0x4b95af(0x2a9)+_0x342459['id']);});}function N(_0x53e69e){const _0x2a4f6b=_0x5e6b2d;return _0x53e69e['type']===_0x583014['COMMAND']||_0x53e69e[_0x2a4f6b(0x1ce)]===_0x583014['MUTATION']&&!ce[_0x2a4f6b(0x30d)](_0x53e69e['id']);}function P(_0x3aedfe){const _0x2ea103=_0x5e6b2d;if(_0x3aedfe===void 0x0)return null;if(_0x3aedfe===null||typeof _0x3aedfe==_0x2ea103(0x276)||typeof _0x3aedfe=='string')return _0x3aedfe;if(typeof _0x3aedfe==_0x2ea103(0x1df)){if(Number['isFinite'](_0x3aedfe))return _0x3aedfe;throw I();}if(Array[_0x2ea103(0x31d)](_0x3aedfe))return _0x3aedfe[_0x2ea103(0x1db)](P);if(F(_0x3aedfe))return Object[_0x2ea103(0x26b)](Object[_0x2ea103(0x261)](_0x3aedfe)[_0x2ea103(0x1db)](([_0x42670d,_0x3d5277])=>[_0x42670d,P(_0x3d5277)]));throw I();}function F(_0x6998e){const _0x59e54b=_0x5e6b2d;if(typeof _0x6998e!='object'||!_0x6998e)return!0x1;let _0xa4e254=Object[_0x59e54b(0x2e9)](_0x6998e);return _0xa4e254===Object['prototype']||_0xa4e254===null;}function I(){const _0xb488ef=_0x5e6b2d;return new j(_0xb488ef(0x2bf),_0xb488ef(0x1c4));}var L=class{[_0x5e6b2d(0x30f)]=Promise[_0x5e6b2d(0x232)]();[_0x5e6b2d(0x223)](_0x209990){const _0x48969c=_0x5e6b2d;let _0xe016a3=this[_0x48969c(0x30f)][_0x48969c(0x1e7)](_0x209990,_0x209990);return this['_tail']=_0xe016a3[_0x48969c(0x1e7)](()=>void 0x0,()=>void 0x0),_0xe016a3;}};function R(_0x273a66,_0x5b7159,_0x2ac1d1,_0x550984){const _0x2a78aa=_0x5e6b2d;if(!Array[_0x2a78aa(0x31d)](_0x273a66))throw new j(_0x2a78aa(0x21d),_0x2a78aa(0x290));let _0x734ef1=[..._0x273a66]['sort']((_0x2737df,_0x480dfc)=>_0x2737df[_0x2a78aa(0x2f6)]-_0x480dfc[_0x2a78aa(0x2f6)]),_0xef61d4=_0x550984;for(let _0x4fa432 of _0x734ef1){if(!_0x4fa432||typeof _0x4fa432!=_0x2a78aa(0x23f)||!Array[_0x2a78aa(0x31d)](_0x4fa432[_0x2a78aa(0x2ab)])||_0x4fa432[_0x2a78aa(0x2ab)][_0x2a78aa(0x1c2)](_0x36e677=>!_0x36e677||typeof _0x36e677!=_0x2a78aa(0x23f)||!('id'in _0x36e677)||typeof _0x36e677['id']!=_0x2a78aa(0x241)||!('data'in _0x36e677)||typeof _0x36e677[_0x2a78aa(0x295)]!=_0x2a78aa(0x241))||!Number[_0x2a78aa(0x1b1)](_0x4fa432[_0x2a78aa(0x324)])||!Number[_0x2a78aa(0x1b1)](_0x4fa432[_0x2a78aa(0x2f6)])||_0x4fa432[_0x2a78aa(0x23b)]!==_0x5b7159||_0x4fa432[_0x2a78aa(0x1ce)]!==_0x2ac1d1||_0x4fa432[_0x2a78aa(0x324)]!==_0xef61d4||_0x4fa432['revision']!==_0xef61d4+0x1)throw new j(_0x2a78aa(0x21d),_0x2a78aa(0x289));_0xef61d4=_0x4fa432[_0x2a78aa(0x2f6)];}return _0x734ef1;}function z(_0x4ee90d){const _0x1951d0=_0x5e6b2d;return{'baseRevision':_0x4ee90d[_0x1951d0(0x324)],'mutationCount':_0x4ee90d[_0x1951d0(0x2ab)][_0x1951d0(0x31c)],'revision':_0x4ee90d[_0x1951d0(0x2f6)],..._0x4ee90d[_0x1951d0(0x287)]===void 0x0?{}:{'sid':_0x4ee90d[_0x1951d0(0x287)]},..._0x4ee90d[_0x1951d0(0x2df)]===void 0x0?{}:{'reqId':_0x4ee90d[_0x1951d0(0x2df)]}};}function B(_0x341338,_0x185351,_0x536c58,_0x308068,_0xf54baa,_0x5c6a6e='initial'){const _0x124d15=_0x5e6b2d;if(_0xf54baa[_0x124d15(0x1c2)](_0xea8157=>_0xea8157[_0x124d15(0x2ab)][_0x124d15(0x1c2)](_0x155f81=>_0x155f81['id']===_0x5c912b['id'])))throw new j(_0x124d15(0x21d),_0x124d15(0x1c7));let _0x20b908=_0x308068;for(let _0x203d96 of _0xf54baa){let _0x18b0c5=_0x20b908+0x1;if(_0x203d96['unitID']!==_0x185351||_0x203d96[_0x124d15(0x1ce)]!==_0x536c58||_0x203d96[_0x124d15(0x324)]!==_0x20b908||_0x203d96['revision']!==_0x18b0c5)throw new j(_0x124d15(0x21d),_0x124d15(0x2c5));let _0x61a760=_0x22f50a(_0x203d96),_0x4ead8e=_0x341338[_0x124d15(0x2f2)]['interceptor'][_0x124d15(0x2d9)]()['COMPRESS_MUTATION_APPLY'],_0x44431f=_0x341338[_0x124d15(0x2f2)][_0x124d15(0x2d8)]['fetchThroughInterceptors'](_0x4ead8e)(_0x61a760[_0x124d15(0x2ab)],null)??_0x61a760[_0x124d15(0x2ab)],_0x31225b=_0x200257(_0x44431f,_0x341338[_0x124d15(0x23e)],_0x5c6a6e===_0x124d15(0x20d)?{'fromChangeset':!0x0}:{'fromCollab':!0x0});if(!_0x31225b['result'])throw new j('COLLABORATION_LOAD_FAILED',_0x124d15(0x282)+_0x31225b[_0x124d15(0x25a)]+':\x20'+String(_0x31225b['error']));let _0x4063ca=_0x341338[_0x124d15(0x1b8)][_0x124d15(0x2b0)](_0x185351);if(_0x4063ca!==_0x18b0c5)throw new j(_0x124d15(0x21d),'Univer\x20revision\x20did\x20not\x20advance\x20to\x20the\x20confirmed\x20changeset\x20revision');_0x20b908=_0x4063ca;}return _0x20b908;}function V(_0x283ae2,_0x38c978,_0x145650){const _0x48c54a=_0x5e6b2d;let _0x305eeb=_0x23ff19['newAPI'](_0x283ae2);switch(_0x145650){case _0x35327a[_0x48c54a(0x304)]:return H(_0x305eeb[_0x48c54a(0x1cd)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);case _0x35327a['UNIVER_DOC']:return H(_0x305eeb[_0x48c54a(0x288)](_0x38c978)?.['save'](),_0x38c978);case _0x35327a['UNIVER_SLIDE']:return H(_0x305eeb[_0x48c54a(0x2ef)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);case _0x35327a[_0x48c54a(0x26e)]:return H(_0x305eeb[_0x48c54a(0x2b7)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);case _0x35327a[_0x48c54a(0x2dd)]:return H(_0x305eeb[_0x48c54a(0x218)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);default:throw new j(_0x48c54a(0x2bf),'Unsupported\x20collaboration\x20Unit\x20type:\x20'+_0x145650);}}function H(_0x4b3271,_0x46b41a){const _0x4a66e0=_0x5e6b2d;if(_0x4b3271===void 0x0)throw new j(_0x4a66e0(0x302),_0x4a66e0(0x2a8)+_0x46b41a+_0x4a66e0(0x213));return structuredClone(_0x4b3271);}function _0x1384(){const _0x273b85=['read','collabSubmitChangesetUrl','board','transformMutations','fetchmissing','race','has','Backend\x20latest\x20revision\x20does\x20not\x20match\x20the\x20initial\x20continuous\x20changeset\x20range','_tail','transform-failed','Session\x20ticket\x20request\x20failed\x20with\x20HTTP\x20','Collaboration\x20HTTP\x20request\x20failed','_injector','\x20after\x20the\x20collaboration\x20runtime\x20entered\x20conflict','2179646eprfMN','formula.mutation.set-calculation-result','JOIN','unitId\x20must\x20not\x20be\x20empty','unit','sessionTicket','Collaboration\x20HTTP\x20request\x20failed\x20with\x20status\x20','length','isArray','get','OPEN','pull-required','_kernel','No\x20active\x20Unit\x20leases','newCsEvent','baseRev','max','Failed\x20to\x20rejoin\x20Unit\x20room','HEARTBEAT','_memberId','_replayRemoteChangesets','target','731267kLmIcQ','join','isSafeInteger','The\x20same\x20changeset\x20submission\x20is\x20already\x20in\x20flight','offline','Snapshot\x20contains\x20duplicate\x20block\x20ids','_inbound','17263800gRtwPq','acceptedChangeset','revisionService','_handleMessage','\x20uses\x20an\x20unsupported\x20protocol','_closed','trigger','_setTransformConflict','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20is\x20not\x20supported\x20by\x20this\x20runtime','ticket','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20pulled\x20in\x20place','_socket','some','Backend\x20returned\x20an\x20ACK\x20that\x20does\x20not\x20match\x20the\x20submitted\x20changeset','Collaboration\x20runtime\x20result\x20must\x20be\x20JSON-compatible','_config','2OdSLIu','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20replayed\x20in\x20place','Collaboration\x20runtime\x20is\x20closing\x20or\x20closed','wsSessionTicketUrl','new_changes','commit','\x20character\x20limit','getWorkbook','type','newAPI','_ensureConnected','_connection','RECV','findIndex','Collaboration\x20WebSocket\x20is\x20not\x20online','block','_disposables','UNIVER_SLIDE','push','_handle','values','map','Snapshot\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','unitData','_captureCommandMutation','number','formula.mutation.set-formula-data','formula.mutation.set-trigger-formula-calculation-start','_fetchChangesets','snapshotFrom','parse','getConnectionState','_release','then','_validateAcceptedChangeset','formula.mutation.set-array-formula-data','_failCommandWaiters','Changeset\x20submission\x20was\x20rejected','unchanged','fetchThroughInterceptors','replacePending','getPendingMutations','Failed\x20to\x20send\x20Collaboration\x20WebSocket\x20command','Replacement\x20mutations\x20must\x20contain\x20non-empty\x20id\x20and\x20string\x20data\x20fields','fromCollab','invalid-changeset','Heartbeat\x20failed','Code\x20is\x20longer\x20than\x20the\x20','Collaboration\x20WebSocket\x20closed','Backend\x20returned\x20no\x20Unit\x20snapshot','error','closed','accepted','transformService','Single-Unit\x20runtime\x20for\x20','removeEventListener','commitTimeoutMs','routeKey','formula.mutation.set-trigger-formula-calculation-stop','\x20cannot\x20capture\x20mutation\x20','invalid-revision','finally','submitChangeset','_bufferedChangesets','conflict','code','memberId','from','_unitId','docStateChange$','clear','initial','sheet.mutation.send-init-pivot-text-local','Backend\x20failed\x20to\x20close\x20the\x20initial\x20revision\x20gap','maxCodeLength','backend','pulled','\x20is\x20unavailable','json','Sheet-shaped\x20snapshot\x20is\x20missing\x20workbook\x20metadata','Event','formula.mutation.set-trigger-formula-calculation','getBoard','Backend\x20returned\x20an\x20ACK\x20whose\x20mutations\x20do\x20not\x20match\x20the\x20submitted\x20changeset','Failed\x20to\x20establish\x20Collaboration\x20WebSocket','snapshotServerService','trim','COLLABORATION_PROTOCOL_ERROR','_reconnectTimer','protocol','open','https:','permission_rej','run','_knownHeadRevision','all','timer','replacePendingMutations','_conflict','cancel','onStarting','_scheduleReconnect','Checkpoint\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','GET','Timed\x20out\x20establishing\x20Collaboration\x20WebSocket','application/json','32VPYFEJ','snapshot','resolve','onMutationExecutedForCollab','changeset_should_retry','HELLO','createBase','unsubscribe','_reconnectAttempts','permission-rejected','blockMeta','unitID','getSheetBlock','createUnit','commandService','object','Replacement\x20mutations\x20must\x20be\x20an\x20array','string','pending','add','mode','latestRevision','prependPending','precedingChangesets','_awaiting','set','dispose','12604761exXqRc','retryable','m2Prime','_join','status','wss:','replace','close','return\x20(async\x20()\x20=>\x20{\x20','reconnecting','fetched','_rejectIfNotAccepting','getState','_nextReqId','stringify','index','Backend\x20latest\x20revision\x20does\x20not\x20match\x20its\x20continuous\x20changeset\x20range','Manual\x20collaboration\x20plugin\x20did\x20not\x20reach\x20the\x20Starting\x20lifecycle','changeset_ack','_connectPromise','Cannot\x20','_commandWaiters','entries','_requestCommand','sheets','csRejEvent','addEventListener','awaitingMutations','retry','_heartbeat','injector','changesets','fromEntries','_acceptingOperations','size','UNIVER_BASE','waitForSubmission','httpRequest','reason','getUnitData','unknown','unitId','_submissionWaiters','boolean','_waitForSubmission','kind','write','createUniver','new_changesets','format','pathname','fetch','message','createDocument','_closePromise','Confirmed\x20mutation\x20replay\x20failed\x20at\x20index\x20','_lease','changeset_rej','_handleCollaborationEvent','name','sid','getDocument','Backend\x20returned\x20a\x20non-contiguous\x20changeset\x20range','cmd','Timed\x20out\x20waiting\x20for\x20Collaboration\x20command\x20','_operations','fetchChangesets','COLLABORATION_CLOSED','Buffered\x20changeset\x20does\x20not\x20match\x20the\x20canonical\x20preceding\x20changeset','Backend\x20changesets\x20must\x20be\x20an\x20array','5845012YfLXZN','_createAwaitingFromPending','awaiting-ack','The\x20same\x20Unit\x20id\x20cannot\x20be\x20joined\x20with\x20two\x20Unit\x20types','data','fromChangeset','instanceService','getUnitOnRev','Unsupported\x20collaboration\x20Unit\x20type:\x20','COLLABORATION_UNAVAILABLE','LEAVE','_suppressionDepth','permission','csShouldRetryEvent','\x20for\x20Unit\x20','Session\x20ticket\x20response\x20is\x20missing\x20a\x20ticket','includes','memberID','Connection\x20timed\x20out','_closeAfterFatalError','\x20request\x20is\x20already\x20active\x20for\x20','_baseRevision','originalMeta','Unit\x20','Read\x20execution\x20cannot\x20run\x20persistable\x20action\x20','m1Prime','mutations','permissionRejEvent','reject','_pending','pull','incrementRevOfUnit','delete','collaMsg','acquire','rev','registerPlugin','_closeOwnedResources','getBase','searchParams','splice','subscribe','remote','Changeset\x20submission\x20was\x20denied','promise','takeInboundChangesets','COLLABORATION_INVALID_INPUT','ws:','readyState','save','_executor','online','Confirmed\x20changeset\x20history\x20is\x20not\x20contiguous','changeset-rejected','confirmed','_target','Failed\x20to\x20open\x20the\x20collaboration\x20backend','pluginName','_connect','unit-data','_stopHeartbeat','_consumeBufferedPrecedingChangesets','execute','replace\x20mutations','timeout','Checkpoint\x20Unit\x20type\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20type','_univer','snapshotServerUrl','invalid','_reconcilePrecedingChangesets','suppress','interceptor','getInterceptPoints','Awaiting\x20changeset\x20echo\x20does\x20not\x20follow\x20the\x20current\x20revision','_sid','rejected','UNIVER_BOARD','UNIVER_DOC','reqId','ack','Failed\x20to\x20join\x20Unit\x20room','_joined','ACK\x20revision\x20does\x20not\x20follow\x20the\x20applied\x20confirmed\x20revision','ensureOnline','562266SWzoiW','\x20returned\x20a\x20different\x20block\x20identity','workbook','csAckEvent','getPrototypeOf','48YWQgVg','\x20})();','permission-denied','leases','COMPRESS_MUTATION_SEND','getPresentation','http:','_subscribeToDocumentState','compressMutationService','_capture','MUTATION','Failed\x20to\x20create\x20the\x20collaboration\x20runtime','revision','collabWebSocketUrl','find','_state','catch','POST','unitType','284165QLyAFs','changeset','eventID','redoState','Cannot\x20replace\x20mutations\x20after\x20a\x20changeset\x20is\x20awaiting\x20confirmation','COLLABORATION_LOAD_FAILED','unshift','UNIVER_SHEET','_assertMutableState','createBoard'];_0x1384=function(){return _0x273b85;};return _0x1384();}var fe=class{[_0x5e6b2d(0x274)];['unitType'];[_0x5e6b2d(0x2a6)];[_0x5e6b2d(0x1d9)];['_univer'];['_kernel'];[_0x5e6b2d(0x281)];[_0x5e6b2d(0x26c)]=!0x0;[_0x5e6b2d(0x1bb)]=!0x1;[_0x5e6b2d(0x2f3)];['_executor'];['_operations']=new L();[_0x5e6b2d(0x205)]=[];[_0x5e6b2d(0x224)];[_0x5e6b2d(0x228)]=null;['_awaiting']=null;[_0x5e6b2d(0x2db)]=crypto['randomUUID']();['_nextReqId']=0x1;constructor(_0x41662c,_0x3c266a,_0x1ffd11,_0x366642,_0x3a306e,_0x54bd1a,_0x3a0971){const _0x13561f=_0x5e6b2d;this[_0x13561f(0x274)]=_0x41662c,this[_0x13561f(0x2fc)]=_0x3c266a,this[_0x13561f(0x2a6)]=_0x1ffd11,this[_0x13561f(0x1d9)]=_0x366642,this[_0x13561f(0x2d3)]=_0x3a306e,this[_0x13561f(0x321)]=_0x54bd1a,this[_0x13561f(0x224)]=_0x1ffd11,this[_0x13561f(0x2f3)]=new se(_0x54bd1a,_0x41662c,_0x3c266a),this['_executor']=ue(_0x3a306e,_0x41662c,_0x3a0971);}[_0x5e6b2d(0x257)](){const _0x13caec=_0x5e6b2d;return{'awaitingChangeset':this[_0x13caec(0x248)]===null?null:U(this['_awaiting']),'baseRevision':this[_0x13caec(0x2a6)],'bufferedChangesetCount':this[_0x13caec(0x205)][_0x13caec(0x31c)],'conflict':this[_0x13caec(0x228)],'connection':this['_closed']?_0x13caec(0x1f9):this['_handle'][_0x13caec(0x1e5)](),'knownHeadRevision':this[_0x13caec(0x224)],'pendingMutationCount':this['_capture'][_0x13caec(0x242)]['length']};}[_0x5e6b2d(0x1ef)](){const _0xd2acf5=_0x5e6b2d;return structuredClone(this[_0xd2acf5(0x2f3)]['pending']);}[_0x5e6b2d(0x27e)](){const _0x3972cc=_0x5e6b2d;return this[_0x3972cc(0x256)]()||this[_0x3972cc(0x28c)][_0x3972cc(0x223)](async()=>(this[_0x3972cc(0x305)](_0x3972cc(0x27e)),await this[_0x3972cc(0x1e2)]()));}[_0x5e6b2d(0x2af)](){const _0x38b86a=_0x5e6b2d;return this['_rejectIfNotAccepting']()||this[_0x38b86a(0x28c)][_0x38b86a(0x223)](async()=>{const _0x373537=_0x38b86a;if(this[_0x373537(0x305)](_0x373537(0x2af)),await this[_0x373537(0x1e2)](),this['_bufferedChangesets'][_0x373537(0x31c)]===0x0)return{'state':this[_0x373537(0x257)](),'status':'up-to-date'};let _0x1eb9ec=[...this['_bufferedChangesets']];if(_0x1eb9ec[_0x373537(0x1c2)](_0x51e035=>_0x51e035[_0x373537(0x2ab)][_0x373537(0x1c2)](_0x367da8=>_0x367da8['id']===_0x5c912b['id'])))throw new j('COLLABORATION_PROTOCOL_ERROR',_0x373537(0x1c0));let _0x315845=this['_baseRevision'],_0x1352b8=this[_0x373537(0x248)]?W(this[_0x373537(0x248)][_0x373537(0x2ab)],this['unitId'],this['unitType'],this[_0x373537(0x2a6)]):null,_0x3f3581=_0x22f50a({'baseRev':this[_0x373537(0x2a6)],'memberID':'','mutations':[...this[_0x373537(0x2f3)][_0x373537(0x242)]],'revision':0x0,'type':this['unitType'],'unitID':this[_0x373537(0x274)],'userID':''})['mutations'],_0x56138e=[];for(let _0x16e78b of _0x1eb9ec){let _0x5e87ee=_0x22f50a(_0x16e78b);if(this[_0x373537(0x248)]!==null&&_0x16e78b['sid']===this[_0x373537(0x248)][_0x373537(0x287)]&&_0x16e78b[_0x373537(0x2df)]===this[_0x373537(0x248)]['reqId']){let _0x4926ad=(_0x1352b8??[])[_0x373537(0x1db)](_0x46de9d);G(_0x16e78b[_0x373537(0x2ab)],_0x4926ad)||await this[_0x373537(0x2a4)](new j(_0x373537(0x21d),'Awaiting\x20changeset\x20echo\x20does\x20not\x20match\x20the\x20transformed\x20local\x20mutations')),_0x56138e[_0x373537(0x1d8)]({'changeset':_0x16e78b,'kind':_0x373537(0x293)}),_0x1352b8=null;continue;}let _0x72e664=_0x5e87ee[_0x373537(0x2ab)];if(_0x1352b8!==null){let _0x40b000=this[_0x373537(0x321)][_0x373537(0x1fb)]['transformMutations'](_0x72e664,_0x1352b8,!0x1);if(!_0x5569a7(_0x40b000))return this[_0x373537(0x228)]={'message':_0x40b000[_0x373537(0x1f8)][_0x373537(0x27f)],'operation':_0x373537(0x2af),'reason':_0x373537(0x310)},{'conflict':this['_conflict'],'state':this['getState'](),'status':'conflict'};_0x72e664=_0x40b000[_0x373537(0x2aa)],_0x1352b8=_0x40b000[_0x373537(0x24d)];}let _0x4ad8ba=this[_0x373537(0x321)]['transformService'][_0x373537(0x30a)](_0x72e664,_0x3f3581,!0x1);if(!_0x5569a7(_0x4ad8ba))return this['_conflict']={'message':_0x4ad8ba[_0x373537(0x1f8)][_0x373537(0x27f)],'operation':_0x373537(0x2af),'reason':'transform-failed'},{'conflict':this[_0x373537(0x228)],'state':this[_0x373537(0x257)](),'status':'conflict'};_0x56138e[_0x373537(0x1d8)]({'changeset':_0x14fe0e({..._0x5e87ee,'mutations':_0x4ad8ba[_0x373537(0x2aa)]}),'kind':_0x373537(0x2bb)}),_0x3f3581=_0x4ad8ba['m2Prime'];}let _0x29b669=_0x315845;for(let _0xe23950 of _0x56138e){if(_0xe23950[_0x373537(0x278)]===_0x373537(0x293)){let _0x390ec8=this['_kernel']['revisionService']['incrementRevOfUnit'](this[_0x373537(0x274)]);_0x390ec8!==_0xe23950[_0x373537(0x2fe)][_0x373537(0x2f6)]&&await this[_0x373537(0x2a4)](new j(_0x373537(0x21d),_0x373537(0x2da))),_0x29b669=_0x390ec8;continue;}_0x29b669=await this[_0x373537(0x1ad)](_0x29b669,[_0xe23950['changeset']]);}return this[_0x373537(0x2f3)][_0x373537(0x1ee)](_0x3f3581[_0x373537(0x1db)](_0x46de9d)),this['_awaiting']!==null&&(this['_awaiting']=_0x1352b8===null?null:{...this[_0x373537(0x248)],'baseRev':_0x29b669,'mutations':_0x1352b8[_0x373537(0x1db)](_0x46de9d)}),this[_0x373537(0x2a6)]=_0x29b669,this[_0x373537(0x205)]['splice'](0x0),{'appliedChangesets':_0x1eb9ec[_0x373537(0x1db)](z),'fromRevision':_0x315845,'state':this[_0x373537(0x257)](),'status':_0x373537(0x212),'toRevision':_0x29b669,'transformedPendingMutationCount':_0x3f3581[_0x373537(0x31c)]};});}[_0x5e6b2d(0x1cb)](){const _0x1998b7=_0x5e6b2d;return this[_0x1998b7(0x256)]()||this[_0x1998b7(0x28c)][_0x1998b7(0x223)](async()=>{const _0x424610=_0x1998b7;this[_0x424610(0x305)]('commit');let _0x537a9e=[],_0xb0eb5e=[];if(this[_0x424610(0x248)]===null){if(this[_0x424610(0x2f3)][_0x424610(0x242)][_0x424610(0x31c)]===0x0)return{'state':this['getState'](),'status':'nothing-to-commit'};if(await this[_0x424610(0x1e2)](),this[_0x424610(0x205)]['length']>0x0)return{'baseRevision':this[_0x424610(0x2a6)],'confirmedChangesets':_0x537a9e,'knownHeadRevision':this['_knownHeadRevision'],'state':this['getState'](),'status':_0x424610(0x320)};this['_createAwaitingFromPending']();}for(;this[_0x424610(0x248)]!==null;){let _0x251b24=this[_0x424610(0x248)],_0x5d3604;try{_0x5d3604=await this['_handle'][_0x424610(0x204)](_0x251b24);}catch{return{'changeset':U(_0x251b24),'confirmedChangesets':_0x537a9e,'state':this['getState'](),'status':_0x424610(0x273)};}if(_0x5d3604[_0x424610(0x24f)]===_0x424610(0x267)||_0x5d3604['status']===_0x424610(0x273))return{'changeset':U(_0x251b24),'confirmedChangesets':_0x537a9e,'state':this[_0x424610(0x257)](),'status':_0x5d3604[_0x424610(0x24f)]};if(_0x5d3604['status']==='rejected')return _0x5d3604[_0x424610(0x271)]==='invalid-revision'?(this[_0x424610(0x2f3)][_0x424610(0x246)](_0x251b24['mutations']),this[_0x424610(0x248)]=null,await this['_fetchChangesets'](),{'baseRevision':this['_baseRevision'],'confirmedChangesets':_0x537a9e,'knownHeadRevision':this[_0x424610(0x224)],'state':this[_0x424610(0x257)](),'status':_0x424610(0x320)}):(this[_0x424610(0x228)]={'message':_0x5d3604[_0x424610(0x27f)],'operation':_0x424610(0x1cb),'reason':_0x5d3604[_0x424610(0x271)]===_0x424610(0x2ec)?_0x424610(0x239):_0x424610(0x2c6)},{'conflict':this[_0x424610(0x228)],'confirmedChangesets':_0x537a9e,'state':this[_0x424610(0x257)](),'status':_0x424610(0x206)});let _0x65068b=_0x5d3604[_0x424610(0x1b7)];try{this['_validateAcceptedChangeset'](_0x251b24,_0x5d3604[_0x424610(0x247)],_0x65068b);}catch(_0x5e0c5b){await this[_0x424610(0x2a4)](_0x5e0c5b);}let _0x2f2a38=_0x251b24['mutations'];if(_0x5d3604[_0x424610(0x247)][_0x424610(0x31c)]>0x0){let _0x158e63=await this[_0x424610(0x2d6)](_0x251b24,_0x5d3604[_0x424610(0x247)]);if(_0x158e63===null)return{'conflict':this[_0x424610(0x228)],'confirmedChangesets':_0x537a9e,'state':this[_0x424610(0x257)](),'status':'conflict'};_0x2f2a38=_0x158e63[_0x424610(0x266)];try{this['_consumeBufferedPrecedingChangesets'](_0x5d3604['precedingChangesets']);}catch(_0xdca64f){await this[_0x424610(0x2a4)](_0xdca64f);}_0xb0eb5e[_0x424610(0x1d8)](..._0x5d3604['precedingChangesets']['map'](z));}G(_0x65068b[_0x424610(0x2ab)],_0x2f2a38)||await this[_0x424610(0x2a4)](new j('COLLABORATION_PROTOCOL_ERROR',_0x424610(0x219)));let _0x1b4bc9=this[_0x424610(0x321)][_0x424610(0x1b8)][_0x424610(0x2b0)](this[_0x424610(0x274)]);if(_0x1b4bc9!==_0x65068b[_0x424610(0x2f6)]&&await this['_closeAfterFatalError'](new j(_0x424610(0x21d),_0x424610(0x2e3))),this[_0x424610(0x2a6)]=_0x1b4bc9,this[_0x424610(0x224)]=Math[_0x424610(0x325)](this[_0x424610(0x224)],_0x1b4bc9),this[_0x424610(0x248)]=null,_0x537a9e['push'](z(_0x65068b)),this[_0x424610(0x2f3)]['pending'][_0x424610(0x31c)]===0x0)break;this['_createAwaitingFromPending']();}return{'confirmedChangesets':_0x537a9e,'reconciledChangesets':_0xb0eb5e,'state':this[_0x424610(0x257)](),'status':_0x424610(0x2c7)};});}async[_0x5e6b2d(0x1e2)](){const _0x156f18=_0x5e6b2d;let _0x3497f0=this[_0x156f18(0x224)],_0x505228=await this[_0x156f18(0x1d9)]['fetchChangesets'](_0x3497f0,void 0x0);if(_0x3e8af9(_0x505228[_0x156f18(0x1f8)])){let _0x4472b0=_0x505228[_0x156f18(0x1f8)];throw new j('COLLABORATION_UNAVAILABLE',_0x4472b0?.['message']||'Backend\x20failed\x20to\x20fetch\x20changesets',{'retryable':!0x0});}let _0x58b86f=R(_0x505228[_0x156f18(0x26a)],this[_0x156f18(0x274)],this[_0x156f18(0x2fc)],_0x3497f0),_0x5019a1=_0x58b86f['at'](-0x1)?.[_0x156f18(0x2f6)]??_0x3497f0;if(_0x505228[_0x156f18(0x245)]!==void 0x0&&_0x505228[_0x156f18(0x245)]!==_0x5019a1)throw new j(_0x156f18(0x21d),_0x156f18(0x25b));return _0x58b86f[_0x156f18(0x31c)]===0x0?{'knownHeadRevision':this['_knownHeadRevision'],'state':this[_0x156f18(0x257)](),'status':_0x156f18(0x1ec)}:(this[_0x156f18(0x205)]['push'](..._0x58b86f),this[_0x156f18(0x224)]=_0x5019a1,{'changesets':_0x58b86f[_0x156f18(0x1db)](z),'fromRevision':_0x3497f0,'state':this[_0x156f18(0x257)](),'status':_0x156f18(0x255),'toRevision':_0x5019a1});}[_0x5e6b2d(0x292)](){const _0x451b46=_0x5e6b2d;let _0x2b30b3=this[_0x451b46(0x2f3)]['takePending']();this[_0x451b46(0x248)]={'baseRev':this['_baseRevision'],'mutations':_0x2b30b3,'reqId':this[_0x451b46(0x258)],'sid':this[_0x451b46(0x2db)]},this[_0x451b46(0x258)]+=0x1;}[_0x5e6b2d(0x1e8)](_0x431565,_0xf684b6,_0x36e34c){const _0x564e8d=_0x5e6b2d;let _0x985d5c=R(_0xf684b6,this[_0x564e8d(0x274)],this[_0x564e8d(0x2fc)],this[_0x564e8d(0x2a6)])['at'](-0x1)?.[_0x564e8d(0x2f6)]??this['_baseRevision'];if(_0x36e34c[_0x564e8d(0x23b)]!==this[_0x564e8d(0x274)]||_0x36e34c[_0x564e8d(0x1ce)]!==this[_0x564e8d(0x2fc)]||_0x36e34c[_0x564e8d(0x287)]!==_0x431565[_0x564e8d(0x287)]||_0x36e34c[_0x564e8d(0x2df)]!==_0x431565['reqId']||_0x36e34c['baseRev']!==_0x985d5c||_0x36e34c[_0x564e8d(0x2f6)]!==_0x985d5c+0x1)throw new j(_0x564e8d(0x21d),_0x564e8d(0x1c3));}async[_0x5e6b2d(0x2d6)](_0x335f43,_0x5c8ad1){const _0x285df7=_0x5e6b2d;let _0x41c336=W(_0x335f43[_0x285df7(0x2ab)],this[_0x285df7(0x274)],this['unitType'],this[_0x285df7(0x2a6)]),_0x5e5909=W(this[_0x285df7(0x2f3)][_0x285df7(0x242)],this[_0x285df7(0x274)],this[_0x285df7(0x2fc)],this['_baseRevision']),_0x2980a7=[];for(let _0x4dd84a of _0x5c8ad1){let _0x3d56fc=_0x22f50a(_0x4dd84a),_0x12115f=this['_kernel']['transformService'][_0x285df7(0x30a)](_0x3d56fc[_0x285df7(0x2ab)],_0x41c336,!0x1);if(!_0x5569a7(_0x12115f))return this[_0x285df7(0x1bd)]('commit',_0x12115f[_0x285df7(0x1f8)]),null;_0x41c336=_0x12115f[_0x285df7(0x24d)];let _0x32350e=this['_kernel'][_0x285df7(0x1fb)][_0x285df7(0x30a)](_0x12115f[_0x285df7(0x2aa)],_0x5e5909,!0x1);if(!_0x5569a7(_0x32350e))return this[_0x285df7(0x1bd)](_0x285df7(0x1cb),_0x32350e[_0x285df7(0x1f8)]),null;_0x5e5909=_0x32350e[_0x285df7(0x24d)],_0x2980a7[_0x285df7(0x1d8)](_0x14fe0e({..._0x3d56fc,'mutations':_0x32350e[_0x285df7(0x2aa)]}));}let _0x2ae501=await this[_0x285df7(0x1ad)](this[_0x285df7(0x2a6)],_0x2980a7);return this[_0x285df7(0x2f3)]['replacePending'](_0x5e5909[_0x285df7(0x1db)](_0x46de9d)),this[_0x285df7(0x2a6)]=_0x2ae501,{'awaitingMutations':_0x41c336[_0x285df7(0x1db)](_0x46de9d),'revision':_0x2ae501};}[_0x5e6b2d(0x1bd)](_0x1a4d12,_0x28ac9a){const _0x257857=_0x5e6b2d;this[_0x257857(0x228)]={'message':_0x28ac9a['message'],'operation':_0x1a4d12,'reason':_0x257857(0x310)};}async[_0x5e6b2d(0x1ad)](_0x5e84e5,_0x5ccfce){const _0x149f16=_0x5e6b2d;try{return await this[_0x149f16(0x2f3)][_0x149f16(0x2d7)](async()=>B(this[_0x149f16(0x321)],this[_0x149f16(0x274)],this[_0x149f16(0x2fc)],_0x5e84e5,_0x5ccfce,'remote'));}catch(_0x17fe4d){return await this[_0x149f16(0x2a4)](_0x17fe4d);}}async[_0x5e6b2d(0x2a4)](_0x25c5f0){const _0x5391ad=_0x5e6b2d;this[_0x5391ad(0x26c)]=!0x1,this[_0x5391ad(0x281)]??=this['_closeOwnedResources']();try{await this[_0x5391ad(0x281)];}catch{}throw _0x25c5f0;}[_0x5e6b2d(0x2ce)](_0xab4df0){const _0x9e3e7b=_0x5e6b2d;let _0x3cb66c=_0xab4df0['at'](-0x1)?.['revision'];if(_0x3cb66c===void 0x0||this['_bufferedChangesets'][_0x9e3e7b(0x31c)]===0x0)return;let _0x1c8fae=this[_0x9e3e7b(0x205)][_0x9e3e7b(0x1d3)](({revision:_0x5c52c4})=>_0x5c52c4>_0x3cb66c),_0x2b9e57=this[_0x9e3e7b(0x205)]['slice'](0x0,_0x1c8fae===-0x1?this[_0x9e3e7b(0x205)][_0x9e3e7b(0x31c)]:_0x1c8fae);for(let _0x2f266e of _0x2b9e57){let _0x1a8f09=_0xab4df0[_0x9e3e7b(0x2f8)](({revision:_0x20c7ca})=>_0x20c7ca===_0x2f266e['revision']);if(!_0x1a8f09||!pe(_0x2f266e,_0x1a8f09))throw new j('COLLABORATION_PROTOCOL_ERROR',_0x9e3e7b(0x28f));}this['_bufferedChangesets'][_0x9e3e7b(0x2b9)](0x0,_0x2b9e57[_0x9e3e7b(0x31c)]);}['execute'](_0x4e8803){const _0x2becdf=_0x5e6b2d;return this['_rejectIfNotAccepting']()||this['_operations'][_0x2becdf(0x223)](async()=>{const _0x1f5460=_0x2becdf;_0x4e8803[_0x1f5460(0x244)]===_0x1f5460(0x279)&&this[_0x1f5460(0x305)]('write');let _0x462235=this['_capture'][_0x1f5460(0x242)]['length'],_0x1e7e34=P(await this[_0x1f5460(0x2c3)][_0x1f5460(0x2cf)](_0x4e8803[_0x1f5460(0x207)],_0x4e8803[_0x1f5460(0x244)]));return _0x4e8803[_0x1f5460(0x244)]===_0x1f5460(0x307)?{'state':this['getState'](),'value':_0x1e7e34}:{'mutations':this['_capture'][_0x1f5460(0x1e3)](_0x462235),'state':this[_0x1f5460(0x257)](),'value':_0x1e7e34};});}[_0x5e6b2d(0x227)](_0x22db6e){const _0x161fee=_0x5e6b2d;return this[_0x161fee(0x256)]()||this['_operations'][_0x161fee(0x223)](async()=>{const _0x5f35ed=_0x161fee;if(this[_0x5f35ed(0x305)](_0x5f35ed(0x2d0)),this['_awaiting']!==null)throw new j(_0x5f35ed(0x2bf),_0x5f35ed(0x301));let _0x42bdf0=me(_0x22db6e),_0x401920=[...this[_0x5f35ed(0x2f3)][_0x5f35ed(0x242)]];this['_capture'][_0x5f35ed(0x1ee)](_0x42bdf0);let _0x1c180b=this[_0x5f35ed(0x257)]();return{'pendingMutationCount':_0x42bdf0[_0x5f35ed(0x31c)],'previousMutationCount':_0x401920['length'],'state':_0x1c180b};});}['exportUnitData'](){const _0x2d79b6=_0x5e6b2d;return this[_0x2d79b6(0x256)]()||this[_0x2d79b6(0x28c)][_0x2d79b6(0x223)](async()=>V(this[_0x2d79b6(0x2d3)],this[_0x2d79b6(0x274)],this[_0x2d79b6(0x2fc)]));}[_0x5e6b2d(0x252)](){const _0x562b14=_0x5e6b2d;return this[_0x562b14(0x281)]?this[_0x562b14(0x281)]:(this['_acceptingOperations']=!0x1,this['_closePromise']=this[_0x562b14(0x28c)][_0x562b14(0x223)](async()=>await this['_closeOwnedResources']()),this[_0x562b14(0x281)]);}async[_0x5e6b2d(0x2b6)](){const _0x194e19=_0x5e6b2d;try{this[_0x194e19(0x2f3)][_0x194e19(0x24a)](),await this['_handle']['close']();}finally{try{this[_0x194e19(0x2d3)]['dispose']();}finally{this[_0x194e19(0x1bb)]=!0x0;}}}[_0x5e6b2d(0x256)](){const _0x31141d=_0x5e6b2d;return this[_0x31141d(0x26c)]?null:Promise['reject'](new j(_0x31141d(0x28e),_0x31141d(0x1c8)));}[_0x5e6b2d(0x305)](_0x4bf413){const _0x2398a8=_0x5e6b2d;if(this[_0x2398a8(0x228)]!==null)throw new j('COLLABORATION_INVALID_INPUT',_0x2398a8(0x25f)+_0x4bf413+_0x2398a8(0x314));}};function U(_0x40b4e8){const _0x1b04d3=_0x5e6b2d;return{'baseRevision':_0x40b4e8[_0x1b04d3(0x324)],'mutationCount':_0x40b4e8[_0x1b04d3(0x2ab)][_0x1b04d3(0x31c)],'reqId':_0x40b4e8[_0x1b04d3(0x2df)],'revision':0x0,'sid':_0x40b4e8[_0x1b04d3(0x287)]};}function W(_0x13c76c,_0x5b2991,_0x26e01c,_0x27a13d){return _0x22f50a({'baseRev':_0x27a13d,'memberID':'','mutations':[..._0x13c76c],'revision':0x0,'type':_0x26e01c,'unitID':_0x5b2991,'userID':''})['mutations'];}function pe(_0x29850a,_0x171cb4){const _0x304f14=_0x5e6b2d;return _0x29850a['unitID']===_0x171cb4['unitID']&&_0x29850a[_0x304f14(0x1ce)]===_0x171cb4['type']&&_0x29850a['baseRev']===_0x171cb4[_0x304f14(0x324)]&&_0x29850a[_0x304f14(0x2f6)]===_0x171cb4[_0x304f14(0x2f6)]&&_0x29850a[_0x304f14(0x287)]===_0x171cb4[_0x304f14(0x287)]&&_0x29850a[_0x304f14(0x2df)]===_0x171cb4[_0x304f14(0x2df)]&&JSON[_0x304f14(0x259)](_0x29850a[_0x304f14(0x2ab)])===JSON[_0x304f14(0x259)](_0x171cb4[_0x304f14(0x2ab)]);}function G(_0x530d76,_0x402c4d){const _0x25a48b=_0x5e6b2d;return _0x530d76[_0x25a48b(0x31c)]===_0x402c4d['length']&&_0x530d76['every']((_0x5e5d0d,_0x2d2a15)=>_0x5e5d0d['id']===_0x402c4d[_0x2d2a15]?.['id']&&_0x5e5d0d['data']===_0x402c4d[_0x2d2a15]?.[_0x25a48b(0x295)]);}function me(_0x5683e3){const _0x3ac151=_0x5e6b2d;if(!Array[_0x3ac151(0x31d)](_0x5683e3))throw new j(_0x3ac151(0x2bf),_0x3ac151(0x240));return _0x5683e3[_0x3ac151(0x1db)](_0x14f5e6=>{const _0x41fe01=_0x3ac151;if(!_0x14f5e6||typeof _0x14f5e6!=_0x41fe01(0x23f)||typeof _0x14f5e6['id']!='string'||_0x14f5e6['id'][_0x41fe01(0x31c)]===0x0||typeof _0x14f5e6['data']!=_0x41fe01(0x241))throw new j(_0x41fe01(0x2bf),_0x41fe01(0x1f1));return{'data':_0x14f5e6[_0x41fe01(0x295)],'id':_0x14f5e6['id']};});}var K=class extends _0x3590eb{['_config'];[_0x5e6b2d(0x313)];static [_0x5e6b2d(0x2ca)]='UNIVER_CLI_SDK_MANUAL_COLLABORATION_PLUGIN';constructor(_0x4147ac,_0x4ad59d){const _0xcdb319=_0x5e6b2d;super(),this[_0xcdb319(0x1c5)]=_0x4147ac,this[_0xcdb319(0x313)]=_0x4ad59d;}[_0x5e6b2d(0x22a)](){const _0x5d56d7=_0x5e6b2d;this[_0x5d56d7(0x1c5)]['snapshotServerService']!==void 0x0&&_0x2bb7ea(this[_0x5d56d7(0x313)],[[_0x32e3ff,{'useValue':this[_0x5d56d7(0x1c5)]['snapshotServerService']}]]),this['_config'][_0x5d56d7(0x22a)]({'commandService':this[_0x5d56d7(0x313)]['get'](_0x4398d7),'compressMutationService':this[_0x5d56d7(0x313)]['get'](_0x125608),'instanceService':this[_0x5d56d7(0x313)][_0x5d56d7(0x31e)](_0x36c186),'injector':this[_0x5d56d7(0x313)],'revisionService':this[_0x5d56d7(0x313)][_0x5d56d7(0x31e)](_0x2dad72),'transformService':this[_0x5d56d7(0x313)]['get'](_0x1a5c37)});}};K=_0x2174d4([_0x57fa7a(_0x59c157),_0x4cf2f2(0x1,_0x191d9f(_0x857fc3))],K);function he(_0x3d77e4,_0x5b8587){const _0x7b233f=_0x5e6b2d;let _0x4ccc17;if(_0x3d77e4[_0x7b233f(0x2b5)](K,{'onStarting'(_0xf38616){_0x4ccc17=_0xf38616;},..._0x5b8587===void 0x0?{}:{'snapshotServerService':_0x5b8587}}),!_0x4ccc17)throw Error(_0x7b233f(0x25c));return _0x4ccc17;}async function ge(_0x2265c0,_0x46744c,_0x324b77){const _0x223693=_0x5e6b2d;let _0x25bb9b=await _0x2265c0[_0x223693(0x298)](0x0);if(_0x3e8af9(_0x25bb9b[_0x223693(0x1f8)])){let _0x44e1ac=_0x25bb9b[_0x223693(0x1f8)];throw new j('COLLABORATION_LOAD_FAILED',_0x44e1ac?.[_0x223693(0x27f)]||'Backend\x20failed\x20to\x20load\x20the\x20Unit\x20snapshot');}let _0x5d8cc9=_0x25bb9b['snapshot'];if(!_0x5d8cc9)throw new j(_0x223693(0x302),_0x223693(0x1f7));_e(_0x5d8cc9,_0x46744c,_0x324b77);try{switch(_0x324b77){case _0x35327a[_0x223693(0x304)]:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':await _0x2c2b13(_0x5d8cc9,await q(_0x2265c0,_0x5d8cc9)),'unitType':_0x324b77};case _0x35327a['UNIVER_DOC']:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':_0x1dbd3a(_0x5d8cc9),'unitType':_0x324b77};case _0x35327a[_0x223693(0x1d7)]:return{'changesets':_0x25bb9b['changesets'],'unitData':_0x226a08(_0x5d8cc9),'unitType':_0x324b77};case _0x35327a[_0x223693(0x26e)]:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':await _0x3ded75(_0x5d8cc9,await q(_0x2265c0,_0x5d8cc9)),'unitType':_0x324b77};case _0x35327a[_0x223693(0x2dd)]:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':_0x4c8227(_0x5d8cc9),'unitType':_0x324b77};default:throw new j(_0x223693(0x2bf),_0x223693(0x299)+_0x324b77);}}catch(_0x4252d6){throw _0x4252d6 instanceof j?_0x4252d6:new j('COLLABORATION_LOAD_FAILED','Failed\x20to\x20transform\x20the\x20Unit\x20snapshot',{'cause':_0x4252d6});}}function _e(_0x5bc7f8,_0x11d7c0,_0x1fc2f3){const _0x11bcc2=_0x5e6b2d;if(_0x5bc7f8[_0x11bcc2(0x23b)]!==_0x11d7c0||_0x5bc7f8[_0x11bcc2(0x1ce)]!==_0x1fc2f3)throw new j(_0x11bcc2(0x302),'Snapshot\x20Unit\x20identity\x20does\x20not\x20match\x20the\x20requested\x20Unit');if(!Number['isSafeInteger'](_0x5bc7f8[_0x11bcc2(0x2b4)])||_0x5bc7f8['rev']<0x1)throw new j(_0x11bcc2(0x302),_0x11bcc2(0x1dc));}async function q(_0x34944d,_0x4a0339){const _0x1faefd=_0x5e6b2d;let _0x1ad05c=_0x4a0339[_0x1faefd(0x2e7)];if(!_0x1ad05c)throw new j('COLLABORATION_LOAD_FAILED',_0x1faefd(0x215));let _0x109a8b=Object[_0x1faefd(0x1da)](_0x1ad05c[_0x1faefd(0x23a)])['flatMap'](({blocks:_0x394709})=>_0x394709);if(new Set(_0x109a8b)[_0x1faefd(0x26d)]!==_0x109a8b['length'])throw new j(_0x1faefd(0x302),_0x1faefd(0x1b4));return await Promise[_0x1faefd(0x225)](_0x109a8b[_0x1faefd(0x1db)](async _0x477622=>{const _0x332fa9=_0x1faefd;let _0x460532=await _0x34944d[_0x332fa9(0x23c)](_0x477622);if(_0x3e8af9(_0x460532['error'])||!_0x460532[_0x332fa9(0x1d5)])throw new j(_0x332fa9(0x302),_0x460532[_0x332fa9(0x1f8)]?.[_0x332fa9(0x27f)]||'Snapshot\x20block\x20'+_0x477622+_0x332fa9(0x213));if(_0x460532[_0x332fa9(0x1d5)]['id']!==_0x477622)throw new j(_0x332fa9(0x302),'Snapshot\x20block\x20'+_0x477622+_0x332fa9(0x2e6));return _0x460532[_0x332fa9(0x1d5)];}));}function ve(_0x2b6c2f){const _0x48bdd7=_0x5e6b2d;let _0x42f687=_0x2b6c2f[_0x48bdd7(0x210)]??0xa00000;if(!Number[_0x48bdd7(0x1b1)](_0x42f687)||_0x42f687<=0x0)throw new j(_0x48bdd7(0x2bf),'maxCodeLength\x20must\x20be\x20a\x20positive\x20safe\x20integer');return{async 'load'(_0x5a95bf,_0x24e172){const _0x2ae629=_0x48bdd7;be(_0x5a95bf,_0x24e172);let _0x50fada,_0x4ab515={'unitId':_0x5a95bf,'unitType':_0x24e172},_0x1c83a7={'unitId':_0x5a95bf,'unitType':_0x24e172,..._0x2b6c2f[_0x2ae629(0x21b)]===void 0x0?{}:{'resolveSnapshotService':()=>{const _0x3239e4=_0x2ae629;if(_0x50fada===void 0x0)throw new j(_0x3239e4(0x302),'SnapshotService\x20is\x20not\x20ready\x20until\x20the\x20Univer\x20factory\x20has\x20returned');return _0x50fada;}}},_0x20f013;try{_0x20f013=await _0x2b6c2f[_0x2ae629(0x211)][_0x2ae629(0x220)](_0x4ab515);}catch(_0x1d33e9){throw new j(_0x2ae629(0x29a),_0x2ae629(0x2c9),{'cause':_0x1d33e9,'retryable':!0x0});}let _0xf03f82;try{_0xf03f82=await _0x2b6c2f[_0x2ae629(0x27a)](_0x1c83a7);let _0x3e72e4=he(_0xf03f82,_0x2b6c2f[_0x2ae629(0x21b)]);_0x2b6c2f[_0x2ae629(0x21b)]!==void 0x0&&(_0x50fada=_0x3e72e4['injector'][_0x2ae629(0x31e)](_0x16d22b));let _0x24ef43=await xe(_0x20f013,_0x5a95bf,_0x24e172);Se(_0x24ef43,_0x4ab515),Ce(_0xf03f82,_0x24ef43);let _0x238616=B(_0x3e72e4,_0x5a95bf,_0x24e172,J(_0x24ef43['unitData']),_0x24ef43[_0x2ae629(0x26a)]),_0x3a7306=await _0x20f013['fetchChangesets'](_0x238616,void 0x0);if(_0x3e8af9(_0x3a7306[_0x2ae629(0x1f8)])){let _0x564f0f=_0x3a7306['error'];throw new j(_0x2ae629(0x29a),_0x564f0f?.[_0x2ae629(0x27f)]||_0x2ae629(0x20f),{'retryable':!0x0});}let _0x316755=R(_0x3a7306['changesets'],_0x5a95bf,_0x24e172,_0x238616),_0x4e4b92=_0x316755['at'](-0x1)?.['revision']??_0x238616;if(_0x3a7306[_0x2ae629(0x245)]!==void 0x0&&_0x3a7306['latestRevision']!==_0x4e4b92)throw new j('COLLABORATION_PROTOCOL_ERROR',_0x2ae629(0x30e));return _0x238616=B(_0x3e72e4,_0x5a95bf,_0x24e172,_0x238616,_0x316755),await ye(_0x3e72e4),new fe(_0x5a95bf,_0x24e172,_0x238616,_0x20f013,_0xf03f82,_0x3e72e4,_0x42f687);}catch(_0x43dada){try{await _0x20f013[_0x2ae629(0x252)]();}catch{}try{_0xf03f82?.[_0x2ae629(0x24a)]();}catch{}throw _0x43dada instanceof j?_0x43dada:new j(_0x2ae629(0x302),_0x2ae629(0x2f5),{'cause':_0x43dada});}}};}async function ye(_0x1dbf4f){const _0x43cc65=_0x5e6b2d;_0x1dbf4f['injector']['has'](_0x1a0611)&&await _0x1dbf4f[_0x43cc65(0x269)]['get'](_0x1a0611)['waitForLatestApplied']();}function be(_0x47f85c,_0x21de7d){const _0x2881d6=_0x5e6b2d;if(_0x47f85c[_0x2881d6(0x21c)]()[_0x2881d6(0x31c)]===0x0)throw new j(_0x2881d6(0x2bf),_0x2881d6(0x318));if(_0x21de7d!==_0x35327a[_0x2881d6(0x304)]&&_0x21de7d!==_0x35327a[_0x2881d6(0x2de)]&&_0x21de7d!==_0x35327a[_0x2881d6(0x1d7)]&&_0x21de7d!==_0x35327a[_0x2881d6(0x26e)]&&_0x21de7d!==_0x35327a['UNIVER_BOARD'])throw new j(_0x2881d6(0x2bf),'Unsupported\x20collaboration\x20Unit\x20type:\x20'+_0x21de7d);}async function xe(_0x76bbea,_0x58a8cd,_0x2e2466){const _0x3d79fe=_0x5e6b2d;return _0x76bbea[_0x3d79fe(0x27c)]===_0x3d79fe(0x2cc)?await _0x76bbea[_0x3d79fe(0x272)]():await ge(_0x76bbea,_0x58a8cd,_0x2e2466);}function Se(_0x6778fa,_0x5911a9){const _0x1bfa7b=_0x5e6b2d;if(_0x6778fa[_0x1bfa7b(0x2fc)]!==_0x5911a9[_0x1bfa7b(0x2fc)])throw new j('COLLABORATION_LOAD_FAILED',_0x1bfa7b(0x2d2));if(_0x6778fa[_0x1bfa7b(0x1dd)]['id']!==_0x5911a9[_0x1bfa7b(0x274)])throw new j(_0x1bfa7b(0x302),'Checkpoint\x20Unit\x20id\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20id');J(_0x6778fa[_0x1bfa7b(0x1dd)]);}function J(_0x3d23b0){const _0x1a16ac=_0x5e6b2d;let _0x534732=_0x3d23b0[_0x1a16ac(0x2b4)];if(!Number['isSafeInteger'](_0x534732)||_0x534732===void 0x0||_0x534732<0x1)throw new j(_0x1a16ac(0x302),_0x1a16ac(0x22c));return _0x534732;}function Ce(_0x34b5b6,_0x99b9c){const _0x3f3ee0=_0x5e6b2d;switch(_0x99b9c[_0x3f3ee0(0x2fc)]){case _0x35327a[_0x3f3ee0(0x304)]:_0x34b5b6['createUnit'](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c['unitData']));return;case _0x35327a['UNIVER_DOC']:_0x34b5b6['createUnit'](_0x99b9c['unitType'],structuredClone(_0x99b9c['unitData']));return;case _0x35327a['UNIVER_SLIDE']:_0x34b5b6['createUnit'](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c[_0x3f3ee0(0x1dd)]));return;case _0x35327a['UNIVER_BASE']:_0x34b5b6[_0x3f3ee0(0x23d)](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c['unitData']));return;case _0x35327a[_0x3f3ee0(0x2dd)]:_0x34b5b6[_0x3f3ee0(0x23d)](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c[_0x3f3ee0(0x1dd)]));return;}}var we=class{['_config'];[_0x5e6b2d(0x2c8)];[_0x5e6b2d(0x283)];[_0x5e6b2d(0x27c)]=_0x5e6b2d(0x231);constructor(_0x2e3d27,_0x5f0166,_0x4755a2){const _0x1fb303=_0x5e6b2d;this[_0x1fb303(0x1c5)]=_0x2e3d27,this[_0x1fb303(0x2c8)]=_0x5f0166,this[_0x1fb303(0x283)]=_0x4755a2;}[_0x5e6b2d(0x1e5)](){const _0x2896b6=_0x5e6b2d;return this[_0x2896b6(0x283)]['getConnectionState']();}async[_0x5e6b2d(0x298)](_0x56b0e6=0x0){const _0x3aff09=_0x5e6b2d;let _0xc0b31e=X(this['_config'][_0x3aff09(0x2d4)],this['_target'][_0x3aff09(0x2fc)],_0x3aff09(0x319),this[_0x3aff09(0x2c8)]['unitId'],_0x3aff09(0x2b4),_0x56b0e6),_0x37a0a2=await Y(this[_0x3aff09(0x1c5)],_0xc0b31e);return Te(_0x37a0a2['snapshot']),_0x37a0a2;}async[_0x5e6b2d(0x23c)](_0x832a46){const _0x17fdcb=_0x5e6b2d;let _0x3bf1e4=X(this['_config'][_0x17fdcb(0x2d4)],this[_0x17fdcb(0x2c8)][_0x17fdcb(0x2fc)],_0x17fdcb(0x319),this[_0x17fdcb(0x2c8)][_0x17fdcb(0x274)],'block',_0x832a46),_0xf84af5=await Y(this[_0x17fdcb(0x1c5)],_0x3bf1e4);return _0xf84af5['block']&&typeof _0xf84af5[_0x17fdcb(0x1d5)][_0x17fdcb(0x295)]==_0x17fdcb(0x241)&&(_0xf84af5['block'][_0x17fdcb(0x295)]=Z(_0xf84af5[_0x17fdcb(0x1d5)][_0x17fdcb(0x295)])),_0xf84af5;}async[_0x5e6b2d(0x28d)](_0x173599,_0x56be63=0x0){const _0x2f463a=_0x5e6b2d;let _0xdfdfed=X(this[_0x2f463a(0x1c5)][_0x2f463a(0x2d4)],this[_0x2f463a(0x2c8)][_0x2f463a(0x2fc)],'unit',this[_0x2f463a(0x2c8)][_0x2f463a(0x274)],_0x2f463a(0x30b));_0xdfdfed['searchParams'][_0x2f463a(0x249)](_0x2f463a(0x209),String(_0x173599)),_0xdfdfed[_0x2f463a(0x2b8)][_0x2f463a(0x249)]('to',String(_0x56be63));let _0x37b0fb=await Y(this[_0x2f463a(0x1c5)],_0xdfdfed);return this['_lease'][_0x2f463a(0x2be)](),_0x37b0fb;}async['submitChangeset'](_0x58a94d){const _0x3db965=_0x5e6b2d;await this['_lease'][_0x3db965(0x2e4)]();let _0x41f5d7=this[_0x3db965(0x283)][_0x3db965(0x26f)](_0x58a94d['sid'],_0x58a94d[_0x3db965(0x2df)]),_0x31b08d={..._0x58a94d,'memberID':this['_lease'][_0x3db965(0x208)],'revision':0x0,'type':this['_target']['unitType'],'unitID':this[_0x3db965(0x2c8)][_0x3db965(0x274)],'userID':''},_0x238e7f=X(this['_config'][_0x3db965(0x308)],this['_target'][_0x3db965(0x2fc)],_0x3db965(0x319),this[_0x3db965(0x2c8)]['unitId'],_0x3db965(0x1ca)),_0x2675a3=this[_0x3db965(0x1c5)][_0x3db965(0x270)](_0x238e7f,{'body':JSON[_0x3db965(0x259)]({'changeset':_0x31b08d,'memberID':this[_0x3db965(0x283)][_0x3db965(0x208)],'type':this[_0x3db965(0x2c8)][_0x3db965(0x2fc)],'unitID':this['_target'][_0x3db965(0x274)]}),'headers':{'content-type':'application/json'},'method':_0x3db965(0x2fb)})[_0x3db965(0x1e7)](async _0x34a2bd=>_0x34a2bd['status']===0x191||_0x34a2bd[_0x3db965(0x24f)]===0x193?_0x3db965(0x29d):_0x34a2bd[_0x3db965(0x24f)]===0x190||_0x34a2bd[_0x3db965(0x24f)]===0x199?_0x3db965(0x2d5):_0x34a2bd['ok']?_0x3db965(0x1fa):'unknown')[_0x3db965(0x2fa)](()=>'unknown'),_0x7c1ae0=Ee(this[_0x3db965(0x1c5)][_0x3db965(0x1fe)]),_0x3dd285=_0x2675a3[_0x3db965(0x1e7)](_0x153dea=>_0x153dea===_0x3db965(0x29d)?{'status':_0x3db965(0x239)}:_0x153dea===_0x3db965(0x2d5)?{'status':_0x3db965(0x2c6)}:new Promise(()=>void 0x0)),_0x40b4e7=await Promise[_0x3db965(0x30c)]([_0x41f5d7[_0x3db965(0x2bd)],_0x3dd285,_0x7c1ae0[_0x3db965(0x2bd)][_0x3db965(0x1e7)](()=>({'status':_0x3db965(0x2d1)}))])[_0x3db965(0x203)](()=>{const _0xebed92=_0x3db965;_0x41f5d7[_0xebed92(0x229)](),_0x7c1ae0[_0xebed92(0x229)]();});if(_0x40b4e7[_0x3db965(0x24f)]==='timeout'){let _0x979feb=await _0x2675a3;return _0x979feb===_0x3db965(0x29d)?{'message':_0x3db965(0x2bc),'reason':_0x3db965(0x2ec),'status':'rejected'}:_0x979feb==='invalid'?{'message':_0x3db965(0x1eb),'reason':_0x3db965(0x1f3),'status':_0x3db965(0x2dc)}:{'status':_0x3db965(0x273)};}if(_0x40b4e7[_0x3db965(0x24f)]===_0x3db965(0x1f9))return{'status':_0x3db965(0x273)};if(_0x40b4e7['status']===_0x3db965(0x267))return{'status':_0x3db965(0x267)};if(_0x40b4e7[_0x3db965(0x24f)]===_0x3db965(0x239))return{'message':_0x3db965(0x2bc),'reason':_0x3db965(0x2ec),'status':_0x3db965(0x2dc)};if(_0x40b4e7[_0x3db965(0x24f)]===_0x3db965(0x2c6)){let _0x282889=await this[_0x3db965(0x28d)](_0x58a94d[_0x3db965(0x324)],_0x58a94d[_0x3db965(0x324)]);return{'message':_0x3db965(0x1eb),'reason':_0x282889[_0x3db965(0x245)]!==void 0x0&&_0x282889[_0x3db965(0x245)]<_0x58a94d[_0x3db965(0x324)]?_0x3db965(0x202):_0x3db965(0x1f3),'status':_0x3db965(0x2dc)};}let _0x55c10e=_0x40b4e7[_0x3db965(0x2fe)],_0x3c394b=await this[_0x3db965(0x28d)](_0x58a94d[_0x3db965(0x324)],_0x55c10e[_0x3db965(0x2f6)]-0x1);if(_0x3e8af9(_0x3c394b['error'])){let _0x1b2829=_0x3c394b['error'];throw new j('COLLABORATION_UNAVAILABLE',_0x1b2829?.[_0x3db965(0x27f)]||'Failed\x20to\x20fetch\x20preceding\x20changesets',{'retryable':!0x0});}return{'acceptedChangeset':_0x55c10e,'precedingChangesets':_0x3c394b['changesets'],'status':_0x3db965(0x2c7)};}async[_0x5e6b2d(0x252)](){const _0x2e6412=_0x5e6b2d;await this[_0x2e6412(0x283)]['close']();}};async function Y(_0x66ffeb,_0x5b8957){const _0x406c38=_0x5e6b2d;let _0x3be458;try{_0x3be458=await _0x66ffeb['httpRequest'](_0x5b8957,{'method':_0x406c38(0x22d)});}catch(_0x51a003){throw new j('COLLABORATION_UNAVAILABLE',_0x406c38(0x312),{'cause':_0x51a003,'retryable':!0x0});}if(!_0x3be458['ok'])throw new j(_0x406c38(0x29a),_0x406c38(0x31b)+_0x3be458[_0x406c38(0x24f)],{'retryable':_0x3be458['status']>=0x1f4});try{return await _0x3be458[_0x406c38(0x214)]();}catch(_0x1c9015){throw new j('COLLABORATION_PROTOCOL_ERROR','Collaboration\x20HTTP\x20response\x20is\x20not\x20valid\x20JSON',{'cause':_0x1c9015});}}function X(_0xa1aceb,..._0x1037b8){const _0x787d59=_0x5e6b2d;let _0x987640=new URL(_0xa1aceb);return _0x987640[_0x787d59(0x27d)]=_0x987640['pathname'][_0x787d59(0x251)](/\/$/,'')+'/'+_0x1037b8[_0x787d59(0x1db)](_0x4b2da0=>encodeURIComponent(String(_0x4b2da0)))[_0x787d59(0x1b0)]('/'),_0x987640;}function Te(_0x49b15e){const _0x2b9440=_0x5e6b2d;if(!_0x49b15e)return;let _0x272400=[_0x49b15e[_0x2b9440(0x2e7)],_0x49b15e['doc'],_0x49b15e['slide'],_0x49b15e[_0x2b9440(0x309)]];for(let _0x494b4c of _0x272400)_0x494b4c&&typeof _0x494b4c[_0x2b9440(0x2a7)]==_0x2b9440(0x241)&&(_0x494b4c[_0x2b9440(0x2a7)]=Z(_0x494b4c[_0x2b9440(0x2a7)]));if(_0x49b15e[_0x2b9440(0x2e7)]){for(let _0x5a160e of Object['values'](_0x49b15e[_0x2b9440(0x2e7)][_0x2b9440(0x263)]))typeof _0x5a160e[_0x2b9440(0x2a7)]=='string'&&(_0x5a160e[_0x2b9440(0x2a7)]=Z(_0x5a160e[_0x2b9440(0x2a7)]));}}function _0x67e3(_0x126240,_0x5b0725){_0x126240=_0x126240-0x1ad;const _0x1384d3=_0x1384();let _0x67e357=_0x1384d3[_0x126240];return _0x67e357;}function Z(_0x1c84f2){const _0x37ca71=_0x5e6b2d;return Uint8Array['from'](Buffer[_0x37ca71(0x209)](_0x1c84f2,'base64'));}function Ee(_0x38dc0b){let _0x300cc5;return{'cancel':()=>{_0x300cc5!==void 0x0&&clearTimeout(_0x300cc5);},'promise':new Promise(_0x4c5fe4=>{_0x300cc5=setTimeout(_0x4c5fe4,_0x38dc0b);})};}var De=class{['_config'];[_0x5e6b2d(0x2f9)]=_0x5e6b2d(0x1b3);['_socket'];[_0x5e6b2d(0x25e)];['_memberId']='';[_0x5e6b2d(0x2e2)]=new Map();['_commandWaiters']=new Map();[_0x5e6b2d(0x275)]=new Map();[_0x5e6b2d(0x1b5)]=new Map();[_0x5e6b2d(0x268)];['_reconnectTimer'];[_0x5e6b2d(0x238)]=0x0;constructor(_0x593e3c){const _0x91d3db=_0x5e6b2d;this[_0x91d3db(0x1c5)]=_0x593e3c;}async[_0x5e6b2d(0x2b3)](_0x17bdfa){const _0x58d504=_0x5e6b2d;let _0x1ef7ff=this['_joined'][_0x58d504(0x31e)](_0x17bdfa['unitId']);if(_0x1ef7ff&&_0x1ef7ff[_0x58d504(0x1ae)][_0x58d504(0x2fc)]!==_0x17bdfa[_0x58d504(0x2fc)])throw new j(_0x58d504(0x2bf),_0x58d504(0x294));if(await this[_0x58d504(0x1d0)](),_0x1ef7ff)_0x1ef7ff[_0x58d504(0x2ed)]+=0x1;else{try{await this[_0x58d504(0x24e)](_0x17bdfa);}catch(_0x136b3f){throw this[_0x58d504(0x2e2)][_0x58d504(0x26d)]===0x0&&(this['_state']='closed',this[_0x58d504(0x2cd)](),this[_0x58d504(0x1c1)]?.[_0x58d504(0x252)](0x3e8,'Initial\x20Unit\x20JOIN\x20failed'),this[_0x58d504(0x1c1)]=void 0x0,this[_0x58d504(0x328)]=''),_0x136b3f;}this['_joined'][_0x58d504(0x249)](_0x17bdfa['unitId'],{'leases':0x1,'target':_0x17bdfa});}let _0x4e8ae5=!0x1,_0x1ec984=()=>this['_memberId'],_0x62a432=new Set();return{'close':async()=>{const _0x4718e0=_0x58d504;if(!_0x4e8ae5){_0x4e8ae5=!0x0;for(let _0x6d49 of _0x62a432)_0x6d49[_0x4718e0(0x229)]();_0x62a432[_0x4718e0(0x20c)](),await this['_release'](_0x17bdfa[_0x4718e0(0x274)]);}},'ensureOnline':async()=>await this[_0x58d504(0x1d0)](),'getConnectionState':()=>_0x4e8ae5?_0x58d504(0x1f9):this['_state'],get 'memberId'(){return _0x1ec984();},'takeInboundChangesets':()=>{const _0x484e63=_0x58d504;let _0x5f5fae=this[_0x484e63(0x1b5)][_0x484e63(0x31e)](_0x17bdfa['unitId'])??[];return this['_inbound']['delete'](_0x17bdfa['unitId']),_0x5f5fae;},'waitForSubmission':(_0x40ad49,_0x12d0ab)=>{const _0x1e5e63=_0x58d504;let _0x346fa0=this['_waitForSubmission'](_0x40ad49,_0x12d0ab);return _0x62a432[_0x1e5e63(0x243)](_0x346fa0),_0x346fa0['promise'][_0x1e5e63(0x1e7)](()=>_0x62a432[_0x1e5e63(0x2b1)](_0x346fa0),()=>_0x62a432['delete'](_0x346fa0)),{'cancel':()=>{const _0xadbbcb=_0x1e5e63;_0x62a432[_0xadbbcb(0x2b1)](_0x346fa0),_0x346fa0['cancel']();},'promise':_0x346fa0[_0x1e5e63(0x2bd)]};}};}async[_0x5e6b2d(0x1d0)](){const _0x56e080=_0x5e6b2d;if(this[_0x56e080(0x2f9)]!==_0x56e080(0x2c4)||this['_socket']?.['readyState']!==WebSocket[_0x56e080(0x31f)]){this[_0x56e080(0x21e)]!==void 0x0&&clearTimeout(this['_reconnectTimer']),this[_0x56e080(0x21e)]=void 0x0,this[_0x56e080(0x25e)]??=this[_0x56e080(0x2cb)]();try{await this['_connectPromise'];}finally{this[_0x56e080(0x25e)]=void 0x0;}}}async['_connect'](){const _0x5702ed=_0x5e6b2d;this['_state']=_0x5702ed(0x254);let _0x310865=await this[_0x5702ed(0x1c5)][_0x5702ed(0x270)](this[_0x5702ed(0x1c5)]['wsSessionTicketUrl'],{'headers':{'content-type':_0x5702ed(0x22f)},'method':_0x5702ed(0x22d)});if(!_0x310865['ok'])throw this[_0x5702ed(0x2f9)]=_0x5702ed(0x1b3),new j(_0x5702ed(0x29a),_0x5702ed(0x311)+_0x310865[_0x5702ed(0x24f)],{'retryable':_0x310865[_0x5702ed(0x24f)]>=0x1f4});let _0x24b83e=await _0x310865[_0x5702ed(0x214)]();if(typeof _0x24b83e['ticket']!=_0x5702ed(0x241)||_0x24b83e[_0x5702ed(0x1bf)][_0x5702ed(0x31c)]===0x0)throw this['_state']=_0x5702ed(0x1b3),new j(_0x5702ed(0x21d),_0x5702ed(0x2a0));let _0x5dad11=new URL(this['_config']['collabWebSocketUrl']);_0x5dad11[_0x5702ed(0x2b8)]['set'](_0x5702ed(0x31a),_0x24b83e[_0x5702ed(0x1bf)]);let _0x1ad289=new WebSocket(_0x5dad11);this[_0x5702ed(0x1c1)]=_0x1ad289,_0x1ad289[_0x5702ed(0x265)](_0x5702ed(0x27f),_0x286b2d=>this['_handleMessage'](_0x286b2d)),_0x1ad289[_0x5702ed(0x265)]('close',()=>{const _0x398a43=_0x5702ed;this[_0x398a43(0x1c1)]===_0x1ad289&&(this[_0x398a43(0x2cd)](),this[_0x398a43(0x1ea)](new j('COLLABORATION_UNAVAILABLE',_0x398a43(0x1f6),{'retryable':!0x0})),this[_0x398a43(0x2f9)]=this['_joined'][_0x398a43(0x26d)]===0x0?'closed':_0x398a43(0x254),this[_0x398a43(0x2e2)][_0x398a43(0x26d)]>0x0&&this[_0x398a43(0x22b)]());}),await Oe(_0x1ad289);let _0x2d22fa=await this[_0x5702ed(0x262)](_0x53cd9f['HELLO'],'',{'cmd':_0x53cd9f['HELLO'],'routeKey':''});if(_0x2d22fa[_0x5702ed(0x207)]!==_0x21c0c8['OK']||typeof _0x2d22fa['infoRsp']?.[_0x5702ed(0x2a2)]!=_0x5702ed(0x241))throw _0x1ad289['close'](),new j(_0x5702ed(0x21d),'Collaboration\x20HELLO\x20response\x20is\x20invalid');this[_0x5702ed(0x328)]=_0x2d22fa['infoRsp'][_0x5702ed(0x2a2)],this[_0x5702ed(0x2f9)]=_0x5702ed(0x2c4);for(let {target:_0x9e0986}of this['_joined'][_0x5702ed(0x1da)]())try{await this[_0x5702ed(0x24e)](_0x9e0986);}catch(_0x34a21d){throw _0x1ad289[_0x5702ed(0x252)](0x3f3,_0x5702ed(0x326)),_0x34a21d;}this[_0x5702ed(0x238)]=0x0,this['_startHeartbeat']();}async[_0x5e6b2d(0x24e)](_0x2dbc27){const _0x1772d6=_0x5e6b2d;let _0x5e5338=await this[_0x1772d6(0x262)](_0x53cd9f['JOIN'],_0x2dbc27[_0x1772d6(0x274)],{'cmd':_0x53cd9f[_0x1772d6(0x317)],'joinReq':{'rooms':[{'args':'','roomID':_0x2dbc27[_0x1772d6(0x274)]}]},'routeKey':_0x2dbc27[_0x1772d6(0x274)]});if(_0x5e5338[_0x1772d6(0x207)]!==_0x21c0c8['OK'])throw new j(_0x1772d6(0x29a),typeof _0x5e5338['reason']==_0x1772d6(0x241)?_0x5e5338[_0x1772d6(0x271)]:_0x1772d6(0x2e1));}[_0x5e6b2d(0x262)](_0x3076f4,_0x595332,_0x56c230){const _0x9877c7=_0x5e6b2d;let _0x47dbdf=this[_0x9877c7(0x1c1)];if(!_0x47dbdf||_0x47dbdf[_0x9877c7(0x2c1)]!==WebSocket[_0x9877c7(0x31f)])return Promise[_0x9877c7(0x2ad)](new j('COLLABORATION_UNAVAILABLE',_0x9877c7(0x1d4),{'retryable':!0x0}));let _0x182939=_0x3076f4+':'+_0x595332;return new Promise((_0x54c274,_0x2b8887)=>{const _0x596f98=_0x9877c7;if(this[_0x596f98(0x260)][_0x596f98(0x30d)](_0x182939)){_0x2b8887(new j('COLLABORATION_PROTOCOL_ERROR','A\x20'+_0x3076f4+_0x596f98(0x2a5)+_0x595332));return;}let _0x161b58=setTimeout(()=>{const _0x544cf2=_0x596f98;this[_0x544cf2(0x260)][_0x544cf2(0x2b1)](_0x182939),_0x2b8887(new j(_0x544cf2(0x29a),_0x544cf2(0x28b)+_0x3076f4,{'retryable':!0x0}));},0x7530);this[_0x596f98(0x260)]['set'](_0x182939,{'reject':_0x2b8887,'resolve':_0x54c274,'timer':_0x161b58});try{_0x47dbdf['send'](JSON[_0x596f98(0x259)](_0x56c230));}catch(_0x2ee49f){this[_0x596f98(0x260)][_0x596f98(0x2b1)](_0x182939),clearTimeout(_0x161b58),_0x2b8887(new j(_0x596f98(0x29a),_0x596f98(0x1f0),{'cause':_0x2ee49f,'retryable':!0x0}));}});}[_0x5e6b2d(0x1b9)](_0x2bbefe){const _0x4cddf9=_0x5e6b2d;if(typeof _0x2bbefe[_0x4cddf9(0x295)]!='string')return;let _0x5ec1b9;try{_0x5ec1b9=JSON[_0x4cddf9(0x1e4)](_0x2bbefe[_0x4cddf9(0x295)]);}catch{this[_0x4cddf9(0x1c1)]?.[_0x4cddf9(0x252)](0x3eb,'Invalid\x20JSON\x20response');return;}let _0x3b9631=typeof _0x5ec1b9[_0x4cddf9(0x1ff)]==_0x4cddf9(0x241)?_0x5ec1b9[_0x4cddf9(0x1ff)]:'';if(_0x5ec1b9['cmd']===_0x53cd9f[_0x4cddf9(0x235)]||_0x5ec1b9[_0x4cddf9(0x28a)]===_0x53cd9f[_0x4cddf9(0x317)]||_0x5ec1b9[_0x4cddf9(0x28a)]===_0x53cd9f[_0x4cddf9(0x327)]){let _0x1ab09a=_0x5ec1b9[_0x4cddf9(0x28a)]+':'+_0x3b9631,_0x2f7448=this['_commandWaiters'][_0x4cddf9(0x31e)](_0x1ab09a);_0x2f7448&&(this[_0x4cddf9(0x260)][_0x4cddf9(0x2b1)](_0x1ab09a),clearTimeout(_0x2f7448[_0x4cddf9(0x226)]),_0x2f7448['resolve'](_0x5ec1b9));return;}_0x5ec1b9['cmd']!==_0x53cd9f[_0x4cddf9(0x1d2)]||!_0x5ec1b9[_0x4cddf9(0x2b2)]||this[_0x4cddf9(0x285)](_0x3b9631,_0x5ec1b9[_0x4cddf9(0x2b2)]);}['_handleCollaborationEvent'](_0x3b3380,_0x571228){const _0x556576=_0x5e6b2d;let _0x4203dc=_0x571228[_0x556576(0x2ff)],_0x277474=_0x4203dc===_0x556576(0x25d)?_0x556576(0x2e8):_0x4203dc===_0x556576(0x284)?_0x556576(0x264):_0x4203dc===_0x556576(0x234)?_0x556576(0x29e):_0x4203dc===_0x556576(0x222)?_0x556576(0x2ac):_0x4203dc===_0x556576(0x27b)?_0x556576(0x323):void 0x0;if(!_0x277474)return;let _0x1f84b4=ke(_0x571228[_0x277474]);if(!_0x1f84b4||_0x1f84b4[_0x556576(0x23b)]!==_0x3b3380)return;if(_0x4203dc===_0x556576(0x27b)){let _0x5c0419=this[_0x556576(0x1b5)][_0x556576(0x31e)](_0x3b3380)??[];_0x5c0419[_0x556576(0x1d8)](_0x1f84b4),this[_0x556576(0x1b5)][_0x556576(0x249)](_0x3b3380,_0x5c0419);return;}let _0x3bf8ef=Q(_0x1f84b4['sid'],_0x1f84b4[_0x556576(0x2df)]),_0x355feb=this[_0x556576(0x275)]['get'](_0x3bf8ef);_0x355feb&&_0x355feb(_0x4203dc===_0x556576(0x25d)?{'changeset':_0x1f84b4,'status':_0x556576(0x2e0)}:_0x4203dc===_0x556576(0x234)?{'status':'retry'}:_0x4203dc==='permission_rej'?{'status':_0x556576(0x239)}:{'status':_0x556576(0x2c6)});}[_0x5e6b2d(0x277)](_0xa3019c,_0x5bb06b){const _0x2fb354=_0x5e6b2d;let _0x1f4899=Q(_0xa3019c,_0x5bb06b);if(this[_0x2fb354(0x275)][_0x2fb354(0x30d)](_0x1f4899))return{'cancel':()=>void 0x0,'promise':Promise[_0x2fb354(0x2ad)](new j(_0x2fb354(0x2bf),_0x2fb354(0x1b2)))};let _0x1dcc75=()=>void 0x0;return{'cancel':()=>_0x1dcc75({'status':_0x2fb354(0x1f9)}),'promise':new Promise(_0x178cc7=>{const _0xb4f109=_0x2fb354;_0x1dcc75=_0x540780=>{const _0x5af6b3=_0x67e3;this[_0x5af6b3(0x275)][_0x5af6b3(0x2b1)](_0x1f4899)&&_0x178cc7(_0x540780);},this[_0xb4f109(0x275)][_0xb4f109(0x249)](_0x1f4899,_0x1dcc75);})};}async[_0x5e6b2d(0x1e6)](_0x4672fa){const _0x2bce36=_0x5e6b2d;let _0x11a21a=this[_0x2bce36(0x2e2)][_0x2bce36(0x31e)](_0x4672fa);_0x11a21a&&(--_0x11a21a['leases'],!(_0x11a21a[_0x2bce36(0x2ed)]>0x0)&&(this['_joined'][_0x2bce36(0x2b1)](_0x4672fa),this[_0x2bce36(0x1b5)]['delete'](_0x4672fa),this[_0x2bce36(0x1c1)]?.[_0x2bce36(0x2c1)]===WebSocket[_0x2bce36(0x31f)]&&this[_0x2bce36(0x1c1)]['send'](JSON[_0x2bce36(0x259)]({'cmd':_0x53cd9f[_0x2bce36(0x29b)],'leaveReq':{'args':'','roomID':_0x4672fa},'routeKey':_0x4672fa})),this['_joined'][_0x2bce36(0x26d)]===0x0&&(this[_0x2bce36(0x2f9)]=_0x2bce36(0x1f9),this[_0x2bce36(0x21e)]!==void 0x0&&clearTimeout(this[_0x2bce36(0x21e)]),this[_0x2bce36(0x21e)]=void 0x0,this['_stopHeartbeat'](),this[_0x2bce36(0x1c1)]?.[_0x2bce36(0x252)](0x3e8,_0x2bce36(0x322)),this[_0x2bce36(0x1c1)]=void 0x0,this[_0x2bce36(0x328)]='')));}[_0x5e6b2d(0x22b)](){const _0x41ed03=_0x5e6b2d;if(this[_0x41ed03(0x21e)]!==void 0x0||this['_reconnectAttempts']>=0x3){this['_reconnectAttempts']>=0x3&&(this[_0x41ed03(0x2f9)]=_0x41ed03(0x1b3));return;}let _0x1573df=Math['min'](0x3e8*0x2**this[_0x41ed03(0x238)],0x4e20);this[_0x41ed03(0x238)]+=0x1,this['_reconnectTimer']=setTimeout(()=>{const _0x5d734d=_0x41ed03;this[_0x5d734d(0x21e)]=void 0x0,this[_0x5d734d(0x25e)]??=this[_0x5d734d(0x2cb)](),this[_0x5d734d(0x25e)][_0x5d734d(0x2fa)](()=>this['_scheduleReconnect']())[_0x5d734d(0x203)](()=>{const _0x1d31d3=_0x5d734d;this[_0x1d31d3(0x25e)]=void 0x0;});},_0x1573df);}['_startHeartbeat'](){const _0x4be435=_0x5e6b2d;this['_stopHeartbeat'](),this[_0x4be435(0x268)]=setInterval(()=>{const _0xd9f780=_0x4be435;this[_0xd9f780(0x2f9)]===_0xd9f780(0x2c4)&&this[_0xd9f780(0x262)](_0x53cd9f[_0xd9f780(0x327)],'',{'cmd':_0x53cd9f['HEARTBEAT'],'routeKey':''})['catch'](()=>this[_0xd9f780(0x1c1)]?.[_0xd9f780(0x252)](0x3f3,_0xd9f780(0x1f4)));},0x7530);}[_0x5e6b2d(0x2cd)](){const _0x3e014b=_0x5e6b2d;this[_0x3e014b(0x268)]!==void 0x0&&clearInterval(this[_0x3e014b(0x268)]),this['_heartbeat']=void 0x0;}['_failCommandWaiters'](_0x263616){const _0x8bca22=_0x5e6b2d;for(let _0x58ab22 of this['_commandWaiters']['values']())clearTimeout(_0x58ab22[_0x8bca22(0x226)]),_0x58ab22['reject'](_0x263616);this[_0x8bca22(0x260)][_0x8bca22(0x20c)]();}};function Oe(_0x3c7982){return new Promise((_0x5b6e82,_0x5b84fb)=>{const _0x410072=_0x67e3;let _0x30adc0=()=>{const _0x125860=_0x67e3;clearTimeout(_0x2e8a63),_0x3c7982['removeEventListener']('close',_0x110a5b),_0x3c7982[_0x125860(0x1fd)](_0x125860(0x1f8),_0x559a24),_0x3c7982[_0x125860(0x1fd)](_0x125860(0x220),_0x2ec262);},_0x49229f=_0x5a940a=>{_0x30adc0(),_0x5b84fb(new j('COLLABORATION_UNAVAILABLE',_0x5a940a,{'retryable':!0x0}));},_0x110a5b=()=>_0x49229f('Collaboration\x20WebSocket\x20closed\x20before\x20opening'),_0x559a24=()=>_0x49229f(_0x410072(0x21a)),_0x2ec262=()=>{_0x30adc0(),_0x5b6e82();},_0x2e8a63=setTimeout(()=>{const _0x5daefa=_0x410072;_0x49229f(_0x5daefa(0x22e)),_0x3c7982[_0x5daefa(0x252)](0x3e8,_0x5daefa(0x2a3));},0x7530);_0x3c7982[_0x410072(0x265)]('close',_0x110a5b,{'once':!0x0}),_0x3c7982[_0x410072(0x265)](_0x410072(0x1f8),_0x559a24,{'once':!0x0}),_0x3c7982['addEventListener']('open',_0x2ec262,{'once':!0x0});});}function ke(_0xcd3372){const _0x42ebbe=_0x5e6b2d;if(!_0xcd3372||typeof _0xcd3372!=_0x42ebbe(0x23f))return null;let _0x2a5a36=_0xcd3372['cs'];return _0x2a5a36&&typeof _0x2a5a36==_0x42ebbe(0x23f)?_0x2a5a36:null;}function Q(_0x57d2c7,_0x118998){return(_0x57d2c7??'')+':'+(_0x118998??0x0);}var Ae=class{[_0x5e6b2d(0x1c5)];['_connection'];constructor(_0x49f00b){const _0x35e099=_0x5e6b2d;this[_0x35e099(0x1c5)]=je(_0x49f00b),this[_0x35e099(0x1d1)]=new De(this[_0x35e099(0x1c5)]);}async[_0x5e6b2d(0x220)](_0x19abd3){const _0x4e65a6=_0x5e6b2d;let _0x267390=await this[_0x4e65a6(0x1d1)][_0x4e65a6(0x2b3)](_0x19abd3);return new we(this['_config'],_0x19abd3,_0x267390);}};function je(_0x267911){const _0x2df132=_0x5e6b2d;let _0x44bf35=$(_0x267911[_0x2df132(0x2d4)],'snapshotServerUrl',[_0x2df132(0x2f0),'https:']),_0x407079=$(_0x267911['collabSubmitChangesetUrl'],_0x2df132(0x308),['http:','https:']),_0x27d5cf=$(_0x267911[_0x2df132(0x2f7)],_0x2df132(0x2f7),[_0x2df132(0x2c0),'wss:',_0x2df132(0x2f0),_0x2df132(0x221)]);_0x27d5cf[_0x2df132(0x21f)]==='http:'&&(_0x27d5cf[_0x2df132(0x21f)]=_0x2df132(0x2c0)),_0x27d5cf['protocol']==='https:'&&(_0x27d5cf[_0x2df132(0x21f)]=_0x2df132(0x250));let _0x28bbcf=$(_0x267911[_0x2df132(0x1c9)],_0x2df132(0x1c9),[_0x2df132(0x2f0),_0x2df132(0x221)]),_0x5f4aac=_0x267911[_0x2df132(0x1fe)]??0x7530;if(!Number['isSafeInteger'](_0x5f4aac)||_0x5f4aac<=0x0)throw new j(_0x2df132(0x2bf),'commitTimeoutMs\x20must\x20be\x20a\x20positive\x20safe\x20integer');return{'collabSubmitChangesetUrl':_0x407079,'collabWebSocketUrl':_0x27d5cf,'commitTimeoutMs':_0x5f4aac,'httpRequest':_0x267911[_0x2df132(0x270)]??globalThis[_0x2df132(0x27e)]['bind'](globalThis),'snapshotServerUrl':_0x44bf35,'wsSessionTicketUrl':_0x28bbcf};}function $(_0x585c39,_0x3eef5f,_0x1d55cd){const _0x4da14f=_0x5e6b2d;let _0x189c1f;try{_0x189c1f=new URL(_0x585c39);}catch{throw new j(_0x4da14f(0x2bf),_0x3eef5f+'\x20must\x20be\x20an\x20absolute\x20URL');}if(!_0x1d55cd[_0x4da14f(0x2a1)](_0x189c1f[_0x4da14f(0x21f)]))throw new j(_0x4da14f(0x2bf),_0x3eef5f+_0x4da14f(0x1ba));return _0x189c1f;}function Me(_0x3b8e3f){return new Ae(_0x3b8e3f);}export{j as CollaborationRuntimeError,Me as createCollaborationServerAdapter,ve as createUniverCollaborationRuntimeFactory};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univer-cli/univer-collaboration-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@oxc-project/runtime": "0.142.0",
|
|
22
|
-
"@univerjs-pro/bases": "1.0.0
|
|
23
|
-
"@univerjs-pro/boards": "1.0.0
|
|
24
|
-
"@univerjs-pro/collaboration": "1.0.0
|
|
25
|
-
"@univerjs-pro/engine-formula": "1.0.0
|
|
26
|
-
"@univerjs-pro/slides": "1.0.0
|
|
27
|
-
"@univerjs/core": "1.0.0
|
|
28
|
-
"@univerjs/docs": "1.0.0
|
|
29
|
-
"@univerjs/engine-formula": "1.0.0
|
|
30
|
-
"@univerjs/engine-render": "1.0.0
|
|
31
|
-
"@univerjs/protocol": "1.0.0
|
|
32
|
-
"@univerjs/sheets": "1.0.0
|
|
22
|
+
"@univerjs-pro/bases": "1.0.0",
|
|
23
|
+
"@univerjs-pro/boards": "1.0.0",
|
|
24
|
+
"@univerjs-pro/collaboration": "1.0.0",
|
|
25
|
+
"@univerjs-pro/engine-formula": "1.0.0",
|
|
26
|
+
"@univerjs-pro/slides": "1.0.0",
|
|
27
|
+
"@univerjs/core": "1.0.0",
|
|
28
|
+
"@univerjs/docs": "1.0.0",
|
|
29
|
+
"@univerjs/engine-formula": "1.0.0",
|
|
30
|
+
"@univerjs/engine-render": "1.0.0",
|
|
31
|
+
"@univerjs/protocol": "1.0.0",
|
|
32
|
+
"@univerjs/sheets": "1.0.0"
|
|
33
33
|
}
|
|
34
34
|
}
|