@univerjs-pro/collaboration-client 0.22.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/en-US.js +1 -1
  5. package/lib/cjs/locale/es-ES.js +1 -1
  6. package/lib/cjs/locale/fa-IR.js +1 -1
  7. package/lib/cjs/locale/fr-FR.js +1 -1
  8. package/lib/cjs/locale/ja-JP.js +1 -1
  9. package/lib/cjs/locale/ko-KR.js +1 -1
  10. package/lib/cjs/locale/ru-RU.js +1 -1
  11. package/lib/cjs/locale/sk-SK.js +1 -1
  12. package/lib/cjs/locale/vi-VN.js +1 -1
  13. package/lib/cjs/locale/zh-CN.js +1 -1
  14. package/lib/cjs/locale/zh-TW.js +1 -1
  15. package/lib/es/facade.js +1 -1
  16. package/lib/es/index.js +1 -1
  17. package/lib/es/locale/ca-ES.js +1 -1
  18. package/lib/es/locale/en-US.js +1 -1
  19. package/lib/es/locale/es-ES.js +1 -1
  20. package/lib/es/locale/fa-IR.js +1 -1
  21. package/lib/es/locale/fr-FR.js +1 -1
  22. package/lib/es/locale/ja-JP.js +1 -1
  23. package/lib/es/locale/ko-KR.js +1 -1
  24. package/lib/es/locale/ru-RU.js +1 -1
  25. package/lib/es/locale/sk-SK.js +1 -1
  26. package/lib/es/locale/vi-VN.js +1 -1
  27. package/lib/es/locale/zh-CN.js +1 -1
  28. package/lib/es/locale/zh-TW.js +1 -1
  29. package/lib/facade.js +1 -1
  30. package/lib/index.js +1 -1
  31. package/lib/locale/ca-ES.js +1 -1
  32. package/lib/locale/en-US.js +1 -1
  33. package/lib/locale/es-ES.js +1 -1
  34. package/lib/locale/fa-IR.js +1 -1
  35. package/lib/locale/fr-FR.js +1 -1
  36. package/lib/locale/ja-JP.js +1 -1
  37. package/lib/locale/ko-KR.js +1 -1
  38. package/lib/locale/ru-RU.js +1 -1
  39. package/lib/locale/sk-SK.js +1 -1
  40. package/lib/locale/vi-VN.js +1 -1
  41. package/lib/locale/zh-CN.js +1 -1
  42. package/lib/locale/zh-TW.js +1 -1
  43. package/lib/umd/facade.js +1 -1
  44. package/lib/umd/index.js +1 -1
  45. package/lib/umd/locale/ca-ES.js +1 -1
  46. package/lib/umd/locale/en-US.js +1 -1
  47. package/lib/umd/locale/es-ES.js +1 -1
  48. package/lib/umd/locale/fa-IR.js +1 -1
  49. package/lib/umd/locale/fr-FR.js +1 -1
  50. package/lib/umd/locale/ja-JP.js +1 -1
  51. package/lib/umd/locale/ko-KR.js +1 -1
  52. package/lib/umd/locale/ru-RU.js +1 -1
  53. package/lib/umd/locale/sk-SK.js +1 -1
  54. package/lib/umd/locale/vi-VN.js +1 -1
  55. package/lib/umd/locale/zh-CN.js +1 -1
  56. package/lib/umd/locale/zh-TW.js +1 -1
  57. package/package.json +11 -11
package/lib/cjs/index.js CHANGED
@@ -1 +1 @@
1
- const _0x280611=_0xed3c;(function(_0x143c15,_0x29b622){const _0x8e4a11=_0xed3c,_0x2c6083=_0x143c15();while(!![]){try{const _0x445eb4=-parseInt(_0x8e4a11(0x378))/0x1*(parseInt(_0x8e4a11(0x319))/0x2)+-parseInt(_0x8e4a11(0x2bb))/0x3+parseInt(_0x8e4a11(0x3b0))/0x4+-parseInt(_0x8e4a11(0x199))/0x5+-parseInt(_0x8e4a11(0x2a0))/0x6+parseInt(_0x8e4a11(0x19b))/0x7+parseInt(_0x8e4a11(0x134))/0x8;if(_0x445eb4===_0x29b622)break;else _0x2c6083['push'](_0x2c6083['shift']());}catch(_0x5726ae){_0x2c6083['push'](_0x2c6083['shift']());}}}(_0x57d9,0xdbbfe),Object[_0x280611(0x150)](exports,Symbol['toStringTag'],{'value':_0x280611(0x221)}));let _univerjs_pro_collaboration=require('@univerjs-pro/collaboration'),_univerjs_core=require('@univerjs/core'),_univerjs_docs=require('@univerjs/docs'),_univerjs_sheets=require('@univerjs/sheets'),rxjs=require('rxjs'),_univerjs_protocol=require('@univerjs/protocol'),_univerjs_telemetry=require('@univerjs/telemetry'),rxjs_operators=require('rxjs/operators'),_univerjs_network=require('@univerjs/network'),_univerjs_pro_license=require('@univerjs-pro/license'),_univerjs_drawing=require('@univerjs/drawing'),_noble_ciphers_aes_js=require('@noble/ciphers/aes.js'),_noble_ciphers_utils_js=require('@noble/ciphers/utils.js');const DEFAULT_SNAPSHOT_SERVER_URL=_0x280611(0x1df),SNAPSHOT_URL_KEY='SNAPSHOT_URL_KEY',DEFAULT_SEND_CHANGESET_TIMEOUT=0x7d0,DEFAULT_COLLAB_WEB_SOCKET_URL='ws://127.0.0.1:8000/universer-api/comb/connect',DEFAULT_WS_SESSION_TICKET_URL=_0x280611(0x2fa),HEARTBEAT_INTERVAL_KEY=_0x280611(0x147),DEFAULT_HEARTBEAT_INTERVAL=0x7530,HEARTBEAT_TIMEOUT_KEY=_0x280611(0x194),DEFAULT_HEARTBEAT_TIMEOUT=0x4e20,DEFAULT_RETRY_CONNECTING_INTERVAL=0x4e20,RETRY_CONNECTING_MAX_COUNT_KEY=_0x280611(0x392),LOCAL_CACHE_INTERVAL_KEY=_0x280611(0x26d),LOCAL_CACHE_INTERVAL=0x3e8,DEFAULT_COLLAB_SUBMIT_CHANGESET_URL='/universer-api/comb',DEFAULT_LOGIN_URL=_0x280611(0x31b),REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY=_0x280611(0x2b2),DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT=_0x280611(0x393),TELEMETRY_COLLABORATION_NEW_CHANGESET=_0x280611(0x1c0);function summaryChangesetSize(_0xc5e923){const _0x5c36ea=_0x280611;return JSON[_0x5c36ea(0x241)](_0xc5e923)[_0x5c36ea(0x182)];}function _typeof(_0xf66be6){'@babel/helpers - typeof';const _0x3021dc=_0x280611;return _typeof=_0x3021dc(0x36b)==typeof Symbol&&_0x3021dc(0x23f)==typeof Symbol[_0x3021dc(0x1fc)]?function(_0x5a3569){return typeof _0x5a3569;}:function(_0x20c31c){const _0x489e52=_0x3021dc;return _0x20c31c&&'function'==typeof Symbol&&_0x20c31c['constructor']===Symbol&&_0x20c31c!==Symbol[_0x489e52(0x153)]?'symbol':typeof _0x20c31c;},_typeof(_0xf66be6);}function toPrimitive(_0x44738e,_0x4a0fbc){const _0x2edd3b=_0x280611;if('object'!=_typeof(_0x44738e)||!_0x44738e)return _0x44738e;var _0x3bd8f3=_0x44738e[Symbol[_0x2edd3b(0x2a6)]];if(void 0x0!==_0x3bd8f3){var _0xd75af9=_0x3bd8f3['call'](_0x44738e,_0x4a0fbc||_0x2edd3b(0x151));if(_0x2edd3b(0x394)!=_typeof(_0xd75af9))return _0xd75af9;throw new TypeError(_0x2edd3b(0x1ac));}return('string'===_0x4a0fbc?String:Number)(_0x44738e);}function toPropertyKey(_0xe94ee2){const _0x34eecd=_0x280611;var _0x255c40=toPrimitive(_0xe94ee2,'string');return _0x34eecd(0x23f)==_typeof(_0x255c40)?_0x255c40:_0x255c40+'';}function _defineProperty(_0x4b6763,_0x18bd34,_0x388954){return(_0x18bd34=toPropertyKey(_0x18bd34))in _0x4b6763?Object['defineProperty'](_0x4b6763,_0x18bd34,{'value':_0x388954,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x4b6763[_0x18bd34]=_0x388954,_0x4b6763;}let CollaborationUIEventId=function(_0x304587){const _0x18c124=_0x280611;return _0x304587[_0x18c124(0x284)]='OTHER_CLIENT_EDITING',_0x304587[_0x18c124(0x14d)]=_0x18c124(0x14d),_0x304587[_0x18c124(0x295)]=_0x18c124(0x295),_0x304587[_0x18c124(0x231)]=_0x18c124(0x231),_0x304587[_0x18c124(0x3a4)]=_0x18c124(0x3a4),_0x304587[_0x18c124(0x383)]='SOCKET_FAILED_RETRY',_0x304587['SOCKET_FAILED']=_0x18c124(0x1d0),_0x304587[_0x18c124(0x14f)]=_0x18c124(0x14f),_0x304587;}({});var CollaborationUIEventService=class{constructor(){const _0x1b9333=_0x280611;_defineProperty(this,_0x1b9333(0x2b5),new rxjs[(_0x1b9333(0x323))]()),_defineProperty(this,_0x1b9333(0x138),this[_0x1b9333(0x2b5)][_0x1b9333(0x2dc)]());}['emitEvent'](_0x2d4edf){this['_event$']['next'](_0x2d4edf);}},CommentService=class{constructor(){const _0x3f9e44=_0x280611;_defineProperty(this,'_commentUpdate$',new rxjs[(_0x3f9e44(0x323))]()),_defineProperty(this,_0x3f9e44(0x2d2),this['_commentUpdate$'][_0x3f9e44(0x2dc)]());}['onCommentUpdate'](_0x4c944b){const _0x17abb9=_0x280611;this[_0x17abb9(0x2a1)]['next'](_0x4c944b);}};function __decorateParam(_0x32844a,_0x1b182b){return function(_0x3eb198,_0x512f81){_0x1b182b(_0x3eb198,_0x512f81,_0x32844a);};}function __decorate(_0x427825,_0x540482,_0x9f1acb,_0x2a9278){const _0x144daf=_0x280611;var _0x3498a4=arguments['length'],_0x53c4af=_0x3498a4<0x3?_0x540482:_0x2a9278===null?_0x2a9278=Object[_0x144daf(0x286)](_0x540482,_0x9f1acb):_0x2a9278,_0x4007e2;if(typeof Reflect===_0x144daf(0x394)&&typeof Reflect[_0x144daf(0x2e4)]===_0x144daf(0x36b))_0x53c4af=Reflect[_0x144daf(0x2e4)](_0x427825,_0x540482,_0x9f1acb,_0x2a9278);else{for(var _0x30c92d=_0x427825[_0x144daf(0x182)]-0x1;_0x30c92d>=0x0;_0x30c92d--)if(_0x4007e2=_0x427825[_0x30c92d])_0x53c4af=(_0x3498a4<0x3?_0x4007e2(_0x53c4af):_0x3498a4>0x3?_0x4007e2(_0x540482,_0x9f1acb,_0x53c4af):_0x4007e2(_0x540482,_0x9f1acb))||_0x53c4af;}return _0x3498a4>0x3&&_0x53c4af&&Object['defineProperty'](_0x540482,_0x9f1acb,_0x53c4af),_0x53c4af;}let MemberService=class MemberService extends _univerjs_core['Disposable']{constructor(_0x4e734b,_0x3e9529){const _0x42fd7f=_0x280611;super(),this[_0x42fd7f(0x3f4)]=_0x4e734b,this[_0x42fd7f(0x3f7)]=_0x3e9529,_defineProperty(this,'_roomMembers',new Map()),_defineProperty(this,_0x42fd7f(0x39e),new rxjs['Subject']()),this[_0x42fd7f(0x14e)]((0x0,rxjs['merge'])(this[_0x42fd7f(0x3f4)][_0x42fd7f(0x369)](_univerjs_core[_0x42fd7f(0x1db)][_0x42fd7f(0x2c3)])[_0x42fd7f(0x1d5)]((0x0,rxjs_operators[_0x42fd7f(0x21c)])(_0x192078=>_0x192078[_0x42fd7f(0x296)]())),this[_0x42fd7f(0x3f4)][_0x42fd7f(0x369)](_univerjs_core[_0x42fd7f(0x1db)][_0x42fd7f(0x1d4)])['pipe']((0x0,rxjs_operators[_0x42fd7f(0x21c)])(_0x277255=>_0x277255['getUnitId']())))[_0x42fd7f(0x23c)](_0x5ad03a=>this['_removeRoom'](_0x5ad03a)));}[_0x280611(0x1a2)](_0x24f551){const _0x2f6e69=_0x280611;if(this[_0x2f6e69(0x1fb)]['has'](_0x24f551))return(0x0,rxjs['of'])(this[_0x2f6e69(0x1fb)]['get'](_0x24f551));return this[_0x2f6e69(0x39e)][_0x2f6e69(0x1d5)]((0x0,rxjs_operators[_0x2f6e69(0x21c)])(_0x589e17=>{const _0x28add5=_0x2f6e69;if(_0x589e17===_0x24f551)return this[_0x28add5(0x1fb)][_0x28add5(0x206)](_0x589e17);}));}['setCurrentUser'](_0x1f8288){const _0x237378=_0x280611;this[_0x237378(0x3f7)][_0x237378(0x3d0)](_0x1f8288);}[_0x280611(0x217)](){const _0x4ae2ea=_0x280611;return this[_0x4ae2ea(0x3f7)][_0x4ae2ea(0x217)]();}[_0x280611(0x401)](_0x324791,_0xa84703){const _0x4f3117=_0x280611;let _0x3330ff=this[_0x4f3117(0x1fb)]['get'](_0x324791);!_0x3330ff&&(_0x3330ff=new RoomMember(),this[_0x4f3117(0x1fb)]['set'](_0x324791,_0x3330ff),this[_0x4f3117(0x39e)][_0x4f3117(0x3fc)](_0x324791)),_0x3330ff[_0x4f3117(0x401)](_0xa84703);}[_0x280611(0x1b6)](_0x50ac14,_0x8696e1){const _0xe1609=_0x280611,_0x5c6896=this['_roomMembers'][_0xe1609(0x206)](_0x50ac14);if(_0x5c6896)_0x5c6896['removeMember'](_0x8696e1);}['getRoom'](_0x21f3d5){const _0x42a64e=_0x280611;return this[_0x42a64e(0x1fb)][_0x42a64e(0x206)](_0x21f3d5);}[_0x280611(0x3f9)](_0x344945,_0x2cb1fc){const _0x164181=_0x280611,_0x20649c=this[_0x164181(0x1fb)][_0x164181(0x206)](_0x344945);if(_0x20649c)return _0x20649c['getMember'](_0x2cb1fc);}[_0x280611(0x19a)](_0x1dc339){const _0x844150=_0x280611,_0x4c6b50=this[_0x844150(0x1fb)][_0x844150(0x206)](_0x1dc339);_0x4c6b50&&(_0x4c6b50[_0x844150(0x3fb)](),this[_0x844150(0x1fb)][_0x844150(0x2be)](_0x1dc339));}['dispose'](){const _0x4174e2=_0x280611;this[_0x4174e2(0x1fb)][_0x4174e2(0x379)](_0x49197e=>_0x49197e[_0x4174e2(0x3fb)]()),this[_0x4174e2(0x1fb)][_0x4174e2(0x31e)](),this['_roomCreated$']['complete']();}};MemberService=__decorate([__decorateParam(0x0,_univerjs_core[_0x280611(0x3d4)]),__decorateParam(0x1,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x2ef)]))],MemberService);var RoomMember=class extends _univerjs_core[_0x280611(0x2e8)]{constructor(..._0x308958){const _0x105787=_0x280611;super(..._0x308958),_defineProperty(this,_0x105787(0x324),new Map()),_defineProperty(this,_0x105787(0x37c),new rxjs['BehaviorSubject'](this['_members'])),_defineProperty(this,_0x105787(0x1a8),this[_0x105787(0x37c)][_0x105787(0x2dc)]());}[_0x280611(0x3fb)](){const _0x417e46=_0x280611;this[_0x417e46(0x324)]['clear'](),this['_members$']['complete']();}[_0x280611(0x401)](_0x3adb8d){const _0xf5dac5=_0x280611;this[_0xf5dac5(0x324)][_0xf5dac5(0x14a)](_0x3adb8d[_0xf5dac5(0x3cf)],_0x3adb8d),this[_0xf5dac5(0x400)]();}['removeMember'](_0x4be7f1){const _0x522dec=_0x280611;this[_0x522dec(0x324)]['delete'](_0x4be7f1),this[_0x522dec(0x400)]();}['getMember'](_0x4bfef1){const _0x4e5e00=_0x280611;return this[_0x4e5e00(0x324)][_0x4e5e00(0x206)](_0x4bfef1);}[_0x280611(0x1cd)](){const _0x3d707b=_0x280611;return Array[_0x3d707b(0x21d)](this[_0x3d707b(0x324)]['values']());}[_0x280611(0x400)](){const _0x202079=_0x280611;this['_members$']['next'](this[_0x202079(0x324)]);}};let SessionStatus=function(_0x4e8c4f){const _0x50b8d9=_0x280611;return _0x4e8c4f[_0x4e8c4f[_0x50b8d9(0x31d)]=0x0]='IDLE',_0x4e8c4f[_0x4e8c4f[_0x50b8d9(0x283)]=0x1]=_0x50b8d9(0x283),_0x4e8c4f[_0x4e8c4f[_0x50b8d9(0x2eb)]=0x2]=_0x50b8d9(0x2eb),_0x4e8c4f[_0x4e8c4f[_0x50b8d9(0x174)]=0x3]=_0x50b8d9(0x174),_0x4e8c4f;}({});const FailedReason={[_univerjs_protocol['CmdRspCode'][_0x280611(0x3db)]]:_0x280611(0x169),[_univerjs_protocol[_0x280611(0x320)][_0x280611(0x1e8)]]:'session.room-full',[_univerjs_protocol[_0x280611(0x320)][_0x280611(0x239)]]:_0x280611(0x20e),[_univerjs_protocol['CmdRspCode'][_0x280611(0x1c5)]]:_0x280611(0x183),[_univerjs_protocol[_0x280611(0x320)][_0x280611(0x367)]]:_0x280611(0x27c)};let CollaborationSession=class CollaborationSession extends _univerjs_core[_0x280611(0x3a3)]{get['sessionStatus'](){const _0x3c469b=_0x280611;return this[_0x3c469b(0x1a4)][_0x3c469b(0x34e)]();}constructor(_0x2dced7,_0x146b01,_0x1ab14a,_0x41e353,_0x21611d,_0x269f9c,_0x169dae,_0x578999){const _0x20b3bc=_0x280611;super(),this[_0x20b3bc(0x363)]=_0x2dced7,this[_0x20b3bc(0x1eb)]=_0x1ab14a,this['_configService']=_0x41e353,this[_0x20b3bc(0x32e)]=_0x21611d,this['_commentService']=_0x269f9c,this['_collaborationUIEventService']=_0x169dae,this[_0x20b3bc(0x23a)]=_0x578999,_defineProperty(this,_0x20b3bc(0x1a4),new rxjs['BehaviorSubject'](0x0)),_defineProperty(this,'sessionStatus$',this[_0x20b3bc(0x1a4)][_0x20b3bc(0x2dc)]()),_defineProperty(this,_0x20b3bc(0x2b5),new rxjs['Subject']()),_defineProperty(this,_0x20b3bc(0x138),this[_0x20b3bc(0x2b5)][_0x20b3bc(0x2dc)]()),_defineProperty(this,_0x20b3bc(0x343),void 0x0),_defineProperty(this,_0x20b3bc(0x170),void 0x0),_defineProperty(this,_0x20b3bc(0x39c),void 0x0),_defineProperty(this,_0x20b3bc(0x17f),![]),_defineProperty(this,_0x20b3bc(0x372),null),this[_0x20b3bc(0x17f)]=!!this[_0x20b3bc(0x23a)],_0x146b01['pipe']((0x0,rxjs[_0x20b3bc(0x1d1)])(this[_0x20b3bc(0x33e)]))[_0x20b3bc(0x23c)](_0x42cc41=>{const _0x7c2c97=_0x20b3bc;if(typeof _0x42cc41===_0x7c2c97(0x38b))return;this[_0x7c2c97(0x343)]=_0x42cc41;if(_0x42cc41)this[_0x7c2c97(0x2a3)](_0x42cc41),this['_socketMessageSubscription']=_0x42cc41[_0x7c2c97(0x2df)][_0x7c2c97(0x23c)](_0x3c3f41=>{const _0x1bafd6=_0x7c2c97;if(_0x3c3f41[_0x1bafd6(0x21f)]!==this['_unitID'])return;this[_0x1bafd6(0x380)](_0x3c3f41);});else{var _0x179a5c;this[_0x7c2c97(0x18e)](),this[_0x7c2c97(0x1a4)]['next'](0x2),(_0x179a5c=this[_0x7c2c97(0x170)])===null||_0x179a5c===void 0x0||_0x179a5c['unsubscribe'](),this['_socketMessageSubscription']=null;}});}[_0x280611(0x2a7)](){const _0x23672a=_0x280611;var _0x4d4a10,_0x5215bc;return(_0x4d4a10=(_0x5215bc=this['_socket'])===null||_0x5215bc===void 0x0?void 0x0:_0x5215bc[_0x23672a(0x3cf)])!==null&&_0x4d4a10!==void 0x0?_0x4d4a10:null;}[_0x280611(0x3fb)](){const _0x4b4a40=_0x280611;super['dispose'](),this['close'](),this[_0x4b4a40(0x33e)][_0x4b4a40(0x3fc)](),this[_0x4b4a40(0x33e)][_0x4b4a40(0x3af)]();}[_0x280611(0x371)](){const _0x8e529d=_0x280611;var _0x150c76,_0x511a09;this[_0x8e529d(0x18e)](),(_0x150c76=this[_0x8e529d(0x343)])===null||_0x150c76===void 0x0||_0x150c76[_0x8e529d(0x28a)]({'cmd':_univerjs_protocol[_0x8e529d(0x3ea)][_0x8e529d(0x312)],'data':{'roomID':this[_0x8e529d(0x363)]}}),(_0x511a09=this[_0x8e529d(0x343)])===null||_0x511a09===void 0x0||_0x511a09[_0x8e529d(0x371)](),this[_0x8e529d(0x2b5)][_0x8e529d(0x3af)](),this[_0x8e529d(0x1a4)][_0x8e529d(0x3af)]();}['_onCombEvent'](_0x12ea95){const _0x49e002=_0x280611;if(_0x12ea95[_0x49e002(0x201)]===_univerjs_protocol[_0x49e002(0x3ea)][_0x49e002(0x2db)])this[_0x49e002(0x2e9)](_0x12ea95);else{if(_0x12ea95[_0x49e002(0x201)]===_univerjs_protocol[_0x49e002(0x3ea)][_0x49e002(0x1dd)])this['_onRecvEvent'](_0x12ea95);}}['_joinRoom'](_0x3e3517){const _0x9ca366=_0x280611;this['_sessionStatus$'][_0x9ca366(0x3fc)](0x1),_0x3e3517[_0x9ca366(0x28a)]({'cmd':_univerjs_protocol[_0x9ca366(0x3ea)][_0x9ca366(0x2db)],'routeKey':this[_0x9ca366(0x363)],'routeType':'','data':{'rooms':[{'roomID':this[_0x9ca366(0x363)]}]}});}[_0x280611(0x2e9)](_0x480baf){const _0xcfe1c8=_0x280611;var _0x24c7d5;if(_0x480baf[_0xcfe1c8(0x17c)]in FailedReason){this[_0xcfe1c8(0x13e)][_0xcfe1c8(0x3f2)]({'id':_0xcfe1c8(0x3a4),'data':FailedReason[_0x480baf[_0xcfe1c8(0x17c)]]}),this[_0xcfe1c8(0x1a4)]['next'](0x2);return;}this['_sessionStatus$'][_0xcfe1c8(0x3fc)](0x3);const _0x373b9e=(_0x24c7d5=_0x480baf[_0xcfe1c8(0x35d)][_0xcfe1c8(0x3ed)][this[_0xcfe1c8(0x363)]])===null||_0x24c7d5===void 0x0?void 0x0:_0x24c7d5[_0xcfe1c8(0x351)];if(_0x373b9e)_0x373b9e['forEach'](_0x5e4ae2=>this[_0xcfe1c8(0x32e)][_0xcfe1c8(0x401)](this[_0xcfe1c8(0x363)],_0x5e4ae2));}[_0x280611(0x385)](_0x5b9244){const _0x539672=_0x280611;try{const _0x3a6597=_0x5b9244[_0x539672(0x35d)];switch(_0x3a6597[_0x539672(0x1ad)]){case _univerjs_pro_collaboration['CollaborationEvent']['USERS_ENTER']:this['_onUserJoin'](_0x3a6597),this['_event$'][_0x539672(0x3fc)](_0x3a6597);break;case _univerjs_pro_collaboration[_0x539672(0x282)][_0x539672(0x3cc)]:this[_0x539672(0x13c)](_0x3a6597),this[_0x539672(0x2b5)][_0x539672(0x3fc)](_0x3a6597);break;case _univerjs_pro_collaboration[_0x539672(0x282)][_0x539672(0x327)]:case _univerjs_pro_collaboration['CollaborationEvent'][_0x539672(0x2fd)]:this[_0x539672(0x325)](),this[_0x539672(0x39b)](),this['_event$'][_0x539672(0x3fc)](_0x3a6597);break;case _univerjs_pro_collaboration[_0x539672(0x282)][_0x539672(0x1b0)]:this[_0x539672(0x1eb)][_0x539672(0x166)]('save\x20fail\x20reason\x20is\x20'+JSON['stringify'](_0x3a6597)),this[_0x539672(0x2b5)]['next'](_0x3a6597);break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x539672(0x28e)]:this[_0x539672(0x21e)][_0x539672(0x398)](_0x3a6597[_0x539672(0x35d)]),this[_0x539672(0x2b5)][_0x539672(0x3fc)](_0x3a6597);break;default:this['_event$'][_0x539672(0x3fc)](_0x3a6597);}}catch(_0x355504){this[_0x539672(0x1eb)][_0x539672(0x166)](_0x355504,_0x5b9244);}}[_0x280611(0x368)](_0x7f2233){const _0x526596=_0x280611;this[_0x526596(0x32e)]['updateMember'](this[_0x526596(0x363)],_0x7f2233[_0x526596(0x35d)]);}['_onUserLeave'](_0x37de66){const _0x49d265=_0x280611;this[_0x49d265(0x32e)]['removeMember'](this[_0x49d265(0x363)],_0x37de66[_0x49d265(0x35d)][_0x49d265(0x3cf)]);}async[_0x280611(0x28a)](_0x2d29c4,_0x3f291d){const _0x26f3c2=_0x280611;if(this['sessionStatus']!==0x3||!this[_0x26f3c2(0x343)])throw new Error(_0x26f3c2(0x1f9));try{_0x2d29c4[_0x26f3c2(0x1ad)]===_univerjs_pro_collaboration[_0x26f3c2(0x282)]['SUBMIT_CHANGESET']&&(this['_scheduleCollaborationTimeoutTimer'](),this['_startTelemetryCollaborationNewChangeset'](_0x2d29c4)),this[_0x26f3c2(0x343)][_0x26f3c2(0x28a)]({'cmd':_univerjs_protocol[_0x26f3c2(0x3ea)][_0x26f3c2(0x162)],'routeKey':_0x3f291d,'routeType':'','data':_0x2d29c4});}catch(_0x5e192c){this[_0x26f3c2(0x1eb)][_0x26f3c2(0x166)](_0x5e192c);}}[_0x280611(0x388)](){const _0xe2a573=_0x280611;var _0x38c08d;this[_0xe2a573(0x39c)]=setTimeout(()=>{const _0x43dc71=_0xe2a573;this[_0x43dc71(0x39c)]=null,this[_0x43dc71(0x13e)][_0x43dc71(0x3f2)]({'id':'SUBMIT_CHANGESET_TIMEOUT'});},(_0x38c08d=this[_0xe2a573(0x273)][_0xe2a573(0x1b8)](_0xe2a573(0x194)))!==null&&_0x38c08d!==void 0x0?_0x38c08d:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x280611(0x39b)](){const _0x1d2093=_0x280611;this[_0x1d2093(0x39c)]&&(clearTimeout(this[_0x1d2093(0x39c)]),this['_collaborationTimeoutTimer']=null);}['_startTelemetryCollaborationNewChangeset'](_0x1749e8){const _0x34121c=_0x280611;if(!this[_0x34121c(0x17f)])return;const {data:_0x24a207}=_0x1749e8,{unitID:_0x18560f,changeset:_0x380be0}=_0x24a207,{mutations:_0x17cb02,type:_0x402052}=_0x380be0;this[_0x34121c(0x372)]={'unitId':_0x18560f,'type':_0x402052,'startTime':performance['now'](),'stopTime':0x0,'duration':0x0,'size':summaryChangesetSize(_0x17cb02)};}[_0x280611(0x325)](){const _0x20282e=_0x280611;if(!this[_0x20282e(0x17f)])return;if(!this[_0x20282e(0x372)]){this[_0x20282e(0x1eb)][_0x20282e(0x166)]('[CollaborationSession]','telemetry\x20info\x20is\x20not\x20initialized');return;}this[_0x20282e(0x372)][_0x20282e(0x350)]=performance['now'](),this[_0x20282e(0x372)][_0x20282e(0x300)]=this[_0x20282e(0x372)][_0x20282e(0x350)]-this[_0x20282e(0x372)][_0x20282e(0x1ff)],this[_0x20282e(0x23a)]['capture'](TELEMETRY_COLLABORATION_NEW_CHANGESET,this[_0x20282e(0x372)]),this[_0x20282e(0x372)]=null;}[_0x280611(0x18e)](){const _0x2caa0b=_0x280611;this[_0x2caa0b(0x372)]=null;}};CollaborationSession=__decorate([__decorateParam(0x2,_univerjs_core['ILogService']),__decorateParam(0x3,_univerjs_core[_0x280611(0x2f5)]),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(MemberService)),__decorateParam(0x5,(0x0,_univerjs_core[_0x280611(0x3d8)])(CommentService)),__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService)),__decorateParam(0x7,(0x0,_univerjs_core[_0x280611(0x29f)])(_univerjs_telemetry[_0x280611(0x2f8)]))],CollaborationSession);const ILocalCacheService=(0x0,_univerjs_core[_0x280611(0x27f)])('collaboration-client.local-cache-service');function getLocalCacheKey(_0x1759c1){return'unit-cache-'+_0x1759c1;}function extractTargetFromFirstChangeset(_0x4205c7){const _0x2b68da=_0x280611,{unitID:_0x1068c1,mutations:_0x1f8455}=_0x4205c7;return{'unitId':_0x1068c1,'subUnitId':_0x1f8455[_0x2b68da(0x182)]>0x0?_0x1f8455[0x0][_0x2b68da(0x224)]['subUnitId']:null};}function _0xed3c(_0x329b0e,_0x166566){_0x329b0e=_0x329b0e-0x133;const _0x57d946=_0x57d9();let _0xed3c99=_0x57d946[_0x329b0e];return _0xed3c99;}let SheetTransformSelectionsService=class SheetTransformSelectionsService{constructor(_0x38d938,_0x390ad1,_0x25d91e){const _0x4e4e7d=_0x280611;this[_0x4e4e7d(0x240)]=_0x38d938,this['_transformService']=_0x390ad1,this[_0x4e4e7d(0x236)]=_0x25d91e;}[_0x280611(0x2d5)](_0x274751){const _0x5265e2=_0x280611;var _0x519bf9,_0x264835;const _0x264754=this[_0x5265e2(0x240)][_0x5265e2(0x206)](_univerjs_sheets['SheetsSelectionsService']),{unitId:_0x3616f3,subUnitId:_0x34a9a1}=extractTargetFromFirstChangeset(_0x274751),_0xf76bed=_0x264754===null||_0x264754===void 0x0?void 0x0:_0x264754['getWorkbookSelections'](_0x3616f3)[_0x5265e2(0x251)](),_0x47ec7f=(_0x519bf9=this[_0x5265e2(0x236)][_0x5265e2(0x2fe)](_0x3616f3))===null||_0x519bf9===void 0x0||(_0x519bf9=_0x519bf9[_0x5265e2(0x2ee)]())===null||_0x519bf9===void 0x0?void 0x0:_0x519bf9[_0x5265e2(0x20d)]();if(_0xf76bed[_0x5265e2(0x182)]===0x0||!_0x3616f3||!_0x34a9a1)return;const _0x627e7=[{'id':_univerjs_sheets[_0x5265e2(0x2aa)]['id'],'params':{'unitId':_0x3616f3,'subUnitId':_0x47ec7f,'selections':_univerjs_core[_0x5265e2(0x18d)][_0x5265e2(0x1b3)](_0xf76bed)}}],_0x4c48ca=this[_0x5265e2(0x3b4)][_0x5265e2(0x13f)](_0x274751,_0x627e7);if(!(0x0,_univerjs_pro_collaboration[_0x5265e2(0x292)])(_0x4c48ca))throw _0x4c48ca['error'];const _0x2af7db=(_0x264835=_0x4c48ca['m2Prime'][0x0])===null||_0x264835===void 0x0||(_0x264835=_0x264835[_0x5265e2(0x224)])===null||_0x264835===void 0x0?void 0x0:_0x264835['selections'];if(Array[_0x5265e2(0x3e1)](_0x2af7db)&&_0x2af7db[_0x5265e2(0x182)]){if(_0x2af7db[_0x5265e2(0x182)]===_0x627e7[0x0][_0x5265e2(0x224)][_0x5265e2(0x281)][_0x5265e2(0x182)]&&_0x2af7db[_0x5265e2(0x265)]((_0x8426c1,_0x160914)=>_univerjs_core['Rectangle']['equals'](_0x8426c1['range'],_0x627e7[0x0][_0x5265e2(0x224)][_0x5265e2(0x281)][_0x160914][_0x5265e2(0x32b)])))return;this[_0x5265e2(0x240)][_0x5265e2(0x206)](_univerjs_core[_0x5265e2(0x34f)])[_0x5265e2(0x262)](_univerjs_sheets[_0x5265e2(0x2aa)]['id'],{'unitId':_0x3616f3,'subUnitId':_0x47ec7f,'selections':_0x2af7db});}}};SheetTransformSelectionsService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x1,_univerjs_pro_collaboration[_0x280611(0x39f)]),__decorateParam(0x2,_univerjs_core[_0x280611(0x3d4)])],SheetTransformSelectionsService);const ISingleActiveUnitService=(0x0,_univerjs_core['createIdentifier'])(_0x280611(0x3c5));let UnitStatus=function(_0x40784f){const _0x22a14c=_0x280611;return _0x40784f[_0x40784f[_0x22a14c(0x24b)]=0x0]=_0x22a14c(0x24b),_0x40784f[_0x40784f[_0x22a14c(0x184)]=0x1]='OTHER_CLIENTS_EDITING',_0x40784f;}({});const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY='collaboration-client.config',configSymbol=Symbol(COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};function isSplitChunkMutation(_0x28b70b){const _0x28b018=_0x280611;var _0x2a3cdb;return!!((_0x2a3cdb=_0x28b70b[_0x28b018(0x224)])===null||_0x2a3cdb===void 0x0?void 0x0:_0x2a3cdb[_0x28b018(0x3f3)]);}const SINGLE_CHANGESET_MUTATIONS=new Set([_univerjs_sheets['InsertSheetMutation']['id']]);function assembleSheetChangeset(_0x3a1478,_0x5880c7,_0x59de87,_0x5d3a1f,_0x594a7c){const _0x3efcfb=_0x280611;var _0x104112,_0x1683ee,_0x2c99d7,_0x8ef6d0;const _0x14e44f=[];for(const _0x12ac45 of _0x3a1478){if(SINGLE_CHANGESET_MUTATIONS[_0x3efcfb(0x390)](_0x12ac45['id'])){if(_0x14e44f[_0x3efcfb(0x182)]>0x0)break;_0x14e44f[_0x3efcfb(0x1c7)](_0x12ac45);break;}if(isSplitChunkMutation(_0x12ac45)){if(_0x14e44f[_0x3efcfb(0x182)]>0x0)break;_0x14e44f[_0x3efcfb(0x1c7)](_0x12ac45);break;}_0x14e44f['push'](_0x12ac45);}const _0x3c6a54=(_0x104112=(_0x1683ee=_0x594a7c[_0x3efcfb(0x217)]())===null||_0x1683ee===void 0x0?void 0x0:_0x1683ee[_0x3efcfb(0x382)])!==null&&_0x104112!==void 0x0?_0x104112:_0x3efcfb(0x2ce),_0xd534e7=(_0x2c99d7=(_0x8ef6d0=_0x594a7c['getCurrentUser']())===null||_0x8ef6d0===void 0x0?void 0x0:_0x8ef6d0[_0x3efcfb(0x3cf)])!==null&&_0x2c99d7!==void 0x0?_0x2c99d7:_0x3efcfb(0x2ce);return{'changeset':{'unitID':_0x5880c7,'type':(0x0,_univerjs_pro_collaboration[_0x3efcfb(0x1ba)])(_0x59de87[_0x3efcfb(0x33c)](_0x5880c7)),'baseRev':_0x5d3a1f[_0x3efcfb(0x3c0)](_0x5880c7),'revision':0x0,'userID':_0x3c6a54,'memberID':_0xd534e7,'mutations':_0x14e44f},'pendingMutations':_0x3a1478['slice'](_0x14e44f[_0x3efcfb(0x182)])};}function assembleDocChangeset(_0x43d95b,_0x4f307a,_0x4e76a4,_0xa98b23,_0x2d4ce5){const _0x2861ac=_0x280611;var _0xea8a87,_0x494d45,_0x39bb11,_0x4c2b8b;const _0x5d3461=[_0x43d95b[_0x2861ac(0x1e1)]((_0x1d3992,_0x37a0f1)=>{const _0x105ffb=_0x2861ac;var _0x37dd4a;const {id:_0xf94bf7}=_0x1d3992,{id:_0x315a42,type:_0x17f189}=_0x37a0f1,_0x1ea31f=(_0x37dd4a=_0x1d3992['params'])!==null&&_0x37dd4a!==void 0x0?_0x37dd4a:{'actions':null},_0xca03c8=_0x37a0f1[_0x105ffb(0x224)];if(_0xf94bf7&&_0xf94bf7!==_0x315a42)throw new Error('Cannot\x20assemble\x20a\x20changeset\x20from\x20multiple\x20mutations\x20of\x20different\x20types:\x20'+_0xf94bf7+_0x105ffb(0x1aa)+_0x315a42+'.');return{..._0x1d3992,'id':_0x315a42,'type':_0x17f189,'params':{'unitId':_0xca03c8['unitId'],'textRanges':_0xca03c8[_0x105ffb(0x2bd)],'actions':_univerjs_core[_0x105ffb(0x309)][_0x105ffb(0x36f)](_0x1ea31f['actions'],_0xca03c8[_0x105ffb(0x1e9)])}};},{})],_0x16c3c6=(_0xea8a87=(_0x494d45=_0x2d4ce5[_0x2861ac(0x217)]())===null||_0x494d45===void 0x0?void 0x0:_0x494d45[_0x2861ac(0x382)])!==null&&_0xea8a87!==void 0x0?_0xea8a87:_0x2861ac(0x2ce),_0x33c285=(_0x39bb11=(_0x4c2b8b=_0x2d4ce5[_0x2861ac(0x217)]())===null||_0x4c2b8b===void 0x0?void 0x0:_0x4c2b8b[_0x2861ac(0x3cf)])!==null&&_0x39bb11!==void 0x0?_0x39bb11:'unknown';return{'changeset':{'unitID':_0x4f307a,'type':(0x0,_univerjs_pro_collaboration[_0x2861ac(0x1ba)])(_0x4e76a4['getUnitType'](_0x4f307a)),'baseRev':_0xa98b23[_0x2861ac(0x3c0)](_0x4f307a),'revision':0x0,'userID':_0x16c3c6,'memberID':_0x33c285,'mutations':_0x5d3461},'pendingMutations':[]};}function createTimerObservable$(_0x1e6bca,_0x133ec4){const _0xe69e05=_0x280611,_0x4f07be=new rxjs['ReplaySubject'](0x1);return setTimeout(()=>_0x4f07be[_0xe69e05(0x3fc)](_0x133ec4),_0x1e6bca),_0x4f07be[_0xe69e05(0x2dc)]()[_0xe69e05(0x1d5)]((0x0,rxjs[_0xe69e05(0x190)])(0x1));}var _PendingState,_AwaitingState,_AwaitingWithPendingState;let CollaborationStatus=function(_0x134f5c){const _0x4045e4=_0x280611;return _0x134f5c['NOT_COLLAB']=_0x4045e4(0x2e1),_0x134f5c[_0x4045e4(0x3a2)]=_0x4045e4(0x1c1),_0x134f5c['PENDING']=_0x4045e4(0x2ec),_0x134f5c['AWAITING']='awaiting',_0x134f5c[_0x4045e4(0x139)]=_0x4045e4(0x1f6),_0x134f5c[_0x4045e4(0x34b)]=_0x4045e4(0x25e),_0x134f5c[_0x4045e4(0x295)]=_0x4045e4(0x216),_0x134f5c[_0x4045e4(0x2eb)]=_0x4045e4(0x21a),_0x134f5c;}({});const MAX_RETRY_TIMEOUT=0x4e20,MAX_RETRY_TOTAL_TIMEOUT=0x2bf20;var CollaborationState=class{constructor(_0x44c9a9,_0x388033,_0x157ecd,_0x6da56d,_0x2b460b,_0x50631e,_0x9014b8,_0x3b6eb7,_0x3fe87f){const _0x24c668=_0x280611;this[_0x24c668(0x181)]=_0x44c9a9,this[_0x24c668(0x148)]=_0x388033,this[_0x24c668(0x27b)]=_0x2b460b,this['_commandService']=_0x50631e,this[_0x24c668(0x1c3)]=_0x9014b8,this[_0x24c668(0x196)]=_0x3b6eb7,this[_0x24c668(0x37f)]=_0x3fe87f,_defineProperty(this,_0x24c668(0x1d7),null),_defineProperty(this,_0x24c668(0x2d1),[]),this[_0x24c668(0x1d7)]=_0x157ecd,this[_0x24c668(0x2d1)]=_0x6da56d;}['_checkMissing'](_0x450eab){const _0xfeb1af=_0x280611,_0x304786=this[_0xfeb1af(0x196)][_0xfeb1af(0x3c0)](this[_0xfeb1af(0x181)]);if(_0x450eab[_0xfeb1af(0x247)]>_0x304786+0x1)return this[_0xfeb1af(0x27b)][_0xfeb1af(0x2f4)]({'from':_0x304786,'to':_0x450eab[_0xfeb1af(0x247)]-0x1}),!![];return![];}[_0x280611(0x205)](_0x3efeee){const _0x2a2111=_0x280611;this[_0x2a2111(0x1c3)][_0x2a2111(0x279)](this[_0x2a2111(0x181)],_0x3efeee);}[_0x280611(0x31f)](_0x3cd714){const _0x54c118=_0x280611;var _0x172951,_0x2c7010;(_0x172951=(_0x2c7010=this['_handler'])[_0x54c118(0x38e)])===null||_0x172951===void 0x0||_0x172951[_0x54c118(0x3de)](_0x2c7010,_0x3cd714);}[_0x280611(0x38d)](_0x39e799){const _0x3dfc75=_0x280611;var _0x357696,_0x16f615;return(_0x357696=(_0x16f615=this[_0x3dfc75(0x27b)])[_0x3dfc75(0x213)])===null||_0x357696===void 0x0?void 0x0:_0x357696[_0x3dfc75(0x3de)](_0x16f615,_0x39e799);}[_0x280611(0x36c)](_0x2a7c24){const _0x3b67c1=_0x280611;var _0x4ecfce,_0x3ee825;return(_0x4ecfce=(_0x3ee825=this[_0x3b67c1(0x27b)])['onTransformState'])===null||_0x4ecfce===void 0x0?void 0x0:_0x4ecfce[_0x3b67c1(0x3de)](_0x3ee825,_0x2a7c24);}[_0x280611(0x188)](_0x69dd7b){const _0x5ab4a1=_0x280611;var _0xa34c1f,_0x179705,_0x210506;return(_0xa34c1f=(_0x179705=(_0x210506=this[_0x5ab4a1(0x27b)])[_0x5ab4a1(0x1bd)])===null||_0x179705===void 0x0?void 0x0:_0x179705[_0x5ab4a1(0x3de)](_0x210506,_0x69dd7b))!==null&&_0xa34c1f!==void 0x0?_0xa34c1f:_0x69dd7b;}[_0x280611(0x272)](_0x4d48f4){const _0x378f21=_0x280611;var _0x5e248b,_0x7a8eae,_0x4b7c0e;return(_0x5e248b=(_0x7a8eae=(_0x4b7c0e=this[_0x378f21(0x27b)])[_0x378f21(0x1e6)])===null||_0x7a8eae===void 0x0?void 0x0:_0x7a8eae[_0x378f21(0x3de)](_0x4b7c0e,_0x4d48f4))!==null&&_0x5e248b!==void 0x0?_0x5e248b:_0x4d48f4;}[_0x280611(0x163)](_0x476622){const _0x2148c2=_0x280611;if(this[_0x2148c2(0x148)]===_univerjs_core[_0x2148c2(0x1db)][_0x2148c2(0x1d4)]){const {unitID:_0x187d6a,mutations:_0xbbddda,memberID:_0x14e318}=_0x476622,_0x50fa6d=_0xbbddda[_0x2148c2(0x182)]>0x0?_0xbbddda[0x0]['params'][_0x2148c2(0x2bd)]:[];if(Array[_0x2148c2(0x3e1)](_0x50fa6d)&&_0x50fa6d[_0x2148c2(0x182)]>0x0){var _0x36a88d,_0x2ec9b4;(_0x36a88d=(_0x2ec9b4=this[_0x2148c2(0x27b)])[_0x2148c2(0x2b1)])===null||_0x36a88d===void 0x0||_0x36a88d['call'](_0x2ec9b4,{'unitID':_0x187d6a,'memberID':_0x14e318,'textRanges':_0x50fa6d});}}}[_0x280611(0x301)](){const _0x452383=_0x280611;var _0x5b6809;(_0x5b6809=this['_localCacheService'])===null||_0x5b6809===void 0x0||_0x5b6809[_0x452383(0x136)](this[_0x452383(0x181)],this[_0x452383(0x148)],this['_awaitingChangeset'],this['_pendingMutations']);}[_0x280611(0x32c)](){const _0x2072dd=_0x280611;return this[_0x2072dd(0x196)][_0x2072dd(0x3c0)](this['unitID']);}[_0x280611(0x192)](){const _0x28523d=_0x280611;this[_0x28523d(0x196)][_0x28523d(0x226)](this[_0x28523d(0x181)]);}['_executeRemoteChangeset'](_0x581170){const _0x5227a5=_0x280611;let _0x29fa9b=this[_0x5227a5(0x188)](_0x581170);_0x29fa9b=this[_0x5227a5(0x272)](_0x29fa9b);const _0x4022c7=(0x0,_univerjs_core[_0x5227a5(0x3bc)])(_0x29fa9b[_0x5227a5(0x3a1)],this[_0x5227a5(0x349)],{'fromCollab':!![]});if(!_0x4022c7[_0x5227a5(0x297)]){var _0x3d4233;if(_0x4022c7[_0x5227a5(0x166)]instanceof Error)throw _0x4022c7['error'];throw new Error((_0x3d4233=_0x4022c7['error'])!==null&&_0x3d4233!==void 0x0?_0x3d4233:_0x5227a5(0x3b2));}this['_transformIMECache'](_0x29fa9b),this[_0x5227a5(0x36c)](_0x29fa9b),this[_0x5227a5(0x205)](_0x581170),this[_0x5227a5(0x31f)](_0x29fa9b),this['_syncEditingCollabCursor'](_0x29fa9b),this['_incrementRevisionNumber']();}};let SyncedState=class SyncedState extends CollaborationState{constructor(_0x7c84e6,_0x1aa9bc,_0x3fe3fc,_0x5dd43c,_0x379ff0,_0x5b412a,_0x1e6c97,_0x236ac3,_0x544359,_0x493e95){const _0x33774a=_0x280611;super(_0x7c84e6,_0x1aa9bc,null,[],_0x3fe3fc,_0x1e6c97,_0x5b412a,_0x5dd43c,_0x493e95),this[_0x33774a(0x240)]=_0x379ff0,this['_logService']=_0x236ac3,this[_0x33774a(0x3b4)]=_0x544359,this[_0x33774a(0x2a4)]=_0x493e95,_defineProperty(this,'status',_0x33774a(0x1c1));}[_0x280611(0x1f4)](_0x22e63a){const _0x2e02bb=_0x280611,_0x33402f=this[_0x2e02bb(0x240)]['createInstance'](PendingState,this[_0x2e02bb(0x181)],this['type'],[_0x22e63a],this[_0x2e02bb(0x27b)]);return _0x33402f[_0x2e02bb(0x335)](),_0x33402f[_0x2e02bb(0x301)](),_0x33402f;}['onRemoteChangeset'](_0x3ea4bd){const _0x308d98=_0x280611;if(this[_0x308d98(0x3a0)](_0x3ea4bd))return this[_0x308d98(0x240)][_0x308d98(0x3d6)](FetchingMissState,this['unitID'],this[_0x308d98(0x148)],null,[],null,[_0x3ea4bd],this['_handler']);try{const _0x29fcf0=this[_0x308d98(0x3b4)][_0x308d98(0x13f)](_0x3ea4bd,[_univerjs_pro_collaboration[_0x308d98(0x2e2)]]);if((0x0,_univerjs_pro_collaboration[_0x308d98(0x292)])(_0x29fcf0)){const {c1Prime:_0x122780}=_0x29fcf0;return this[_0x308d98(0x2f3)](_0x122780),this;}throw _0x29fcf0[_0x308d98(0x166)];}catch(_0xe73de9){return this['_logService']['error'](_0xe73de9),this[_0x308d98(0x220)](![]);}}[_0x280611(0x220)](_0x4784a0){const _0x1dc83f=_0x280611;return this['_injector'][_0x1dc83f(0x3d6)](ConflictState,this['unitID'],this[_0x1dc83f(0x148)],null,[],this[_0x1dc83f(0x27b)],_0x4784a0);}['onRemoteAck'](_0x18833d){const _0x3ab9e4=_0x280611;if(_0x18833d[_0x3ab9e4(0x247)]<=this['_getCurrentRevision']())return this;throw new Error(_0x3ab9e4(0x15b));}[_0x280611(0x39a)](){const _0x272a4f=_0x280611;throw new Error(_0x272a4f(0x3d7));}['onRemoteRetry'](){return this;}[_0x280611(0x2a5)](){const _0x32f3b0=_0x280611;return this[_0x32f3b0(0x240)][_0x32f3b0(0x3d6)](OfflineState,this[_0x32f3b0(0x181)],this[_0x32f3b0(0x148)],null,[],this[_0x32f3b0(0x27b)]);}[_0x280611(0x326)](){return this;}['resend'](){const _0x1eecfa=_0x280611;throw new Error(_0x1eecfa(0x3fe));}[_0x280611(0x1be)](){const _0xace31e=_0x280611,_0x402e65=this['_revisionService'][_0xace31e(0x3c0)](this[_0xace31e(0x181)]);return this[_0xace31e(0x27b)][_0xace31e(0x2f4)]({'from':_0x402e65,'to':0x0}),this[_0xace31e(0x240)][_0xace31e(0x3d6)](FetchingMissState,this[_0xace31e(0x181)],this[_0xace31e(0x148)],null,[],null,[],this['_handler']);}};SyncedState=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration[_0x280611(0x3aa)])),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x5,_univerjs_core['IUndoRedoService']),__decorateParam(0x6,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0x7,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0x8,_univerjs_pro_collaboration['ITransformService']),__decorateParam(0x9,(0x0,_univerjs_core[_0x280611(0x29f)])(ILocalCacheService))],SyncedState);let PendingState=_PendingState=class PendingState extends CollaborationState{constructor(_0x53161e,_0x363dff,_0x21f153,_0x4d70e3,_0x1d2685,_0x4cb563,_0xa02161,_0x1719ac,_0x5ad52b,_0xae7aca,_0x103e10,_0x383892,_0x1105d9,_0x2fd5cd){const _0x3e8022=_0x280611;super(_0x53161e,_0x363dff,null,_0x21f153,_0x4d70e3,_0x5ad52b,_0x1105d9,_0x4cb563,_0x2fd5cd),this[_0x3e8022(0x240)]=_0x1d2685,this[_0x3e8022(0x32e)]=_0xa02161,this[_0x3e8022(0x1eb)]=_0x1719ac,this[_0x3e8022(0x273)]=_0xae7aca,this['_transformService']=_0x103e10,this[_0x3e8022(0x3f4)]=_0x383892,_defineProperty(this,_0x3e8022(0x34c),'pending'),_defineProperty(this,_0x3e8022(0x175),null),_defineProperty(this,_0x3e8022(0x2d3),null);}[_0x280611(0x1f4)](_0x1b05bb){const _0x1cd659=_0x280611;return this[_0x1cd659(0x2d1)][_0x1cd659(0x1c7)](_0x1b05bb),this[_0x1cd659(0x301)](),this;}['onRemoteChangeset'](_0xc592a1){const _0x1d4386=_0x280611;if(this[_0x1d4386(0x3a0)](_0xc592a1))return this[_0x1d4386(0x1ae)](),this['_injector'][_0x1d4386(0x3d6)](FetchingMissState,this[_0x1d4386(0x181)],this[_0x1d4386(0x148)],null,this['_pendingMutations'],null,[_0xc592a1],this['_handler']);try{const _0x38b5e0=this[_0x1d4386(0x3b4)][_0x1d4386(0x13f)](_0xc592a1,this[_0x1d4386(0x2d1)]);if((0x0,_univerjs_pro_collaboration[_0x1d4386(0x292)])(_0x38b5e0)){const {c1Prime:_0x3ee2ab,m2Prime:_0x2051f0}=_0x38b5e0;this[_0x1d4386(0x2f3)](_0x3ee2ab);const _0x36e7a5=this['_injector']['createInstance'](_PendingState,this['unitID'],this['type'],_0x2051f0,this[_0x1d4386(0x27b)]);this[_0x1d4386(0x1ae)]();const _0x1be74a=new Date()['getTime'](),_0x31e24b=this[_0x1d4386(0x175)]?Math[_0x1d4386(0x228)](this[_0x1d4386(0x175)]-_0x1be74a,0x0):this[_0x1d4386(0x144)]();return _0x36e7a5[_0x1d4386(0x335)](_0x31e24b),_0x36e7a5;}throw _0x38b5e0['error'];}catch(_0x1e9edb){return this[_0x1d4386(0x1eb)]['error'](_0x1e9edb),this[_0x1d4386(0x220)](![]);}}[_0x280611(0x328)](_0x21a223){const _0x5405a9=_0x280611;if(_0x21a223[_0x5405a9(0x247)]<=this['_getCurrentRevision']())return this;throw new Error(_0x5405a9(0x29e));}[_0x280611(0x39a)](){throw new Error('[PendingState]:\x20received\x20rejection.');}[_0x280611(0x364)](){return this;}[_0x280611(0x2a5)](){const _0x20f547=_0x280611;return this[_0x20f547(0x1ae)](),this[_0x20f547(0x240)][_0x20f547(0x3d6)](OfflineState,this[_0x20f547(0x181)],this[_0x20f547(0x148)],null,this['_pendingMutations'],this['_handler']);}[_0x280611(0x326)](){return this;}[_0x280611(0x335)](_0x180c86){const _0xa8b7bc=_0x280611,_0xae7954=_0x180c86!==null&&_0x180c86!==void 0x0?_0x180c86:this[_0xa8b7bc(0x144)]();this[_0xa8b7bc(0x175)]=new Date()[_0xa8b7bc(0x3bd)]()+_0xae7954,this[_0xa8b7bc(0x2d3)]=setTimeout(()=>{const _0x16e3b8=_0xa8b7bc;this['_clearScheduledTask']();let _0x20f243=null;switch(this[_0x16e3b8(0x148)]){case _univerjs_core[_0x16e3b8(0x1db)][_0x16e3b8(0x2c3)]:_0x20f243=assembleSheetChangeset(this[_0x16e3b8(0x2d1)],this[_0x16e3b8(0x181)],this[_0x16e3b8(0x3f4)],this[_0x16e3b8(0x196)],this[_0x16e3b8(0x32e)]);break;case _univerjs_core[_0x16e3b8(0x1db)][_0x16e3b8(0x1d4)]:if(this[_0x16e3b8(0x2d1)][_0x16e3b8(0x265)](_0x339359=>_0x339359['id']===_univerjs_docs[_0x16e3b8(0x340)]['id']))_0x20f243=assembleDocChangeset(this[_0x16e3b8(0x2d1)],this[_0x16e3b8(0x181)],this[_0x16e3b8(0x3f4)],this[_0x16e3b8(0x196)],this[_0x16e3b8(0x32e)]);else _0x20f243=assembleSheetChangeset(this['_pendingMutations'],this[_0x16e3b8(0x181)],this['_univerInstanceService'],this['_revisionService'],this[_0x16e3b8(0x32e)]);break;default:throw new Error('[PendingState]:\x20unhandled\x20univer\x20type:\x20'+this['type']+_0x16e3b8(0x314));}const {changeset:_0x43603f,pendingMutations:_0x51edad}=_0x20f243;this[_0x16e3b8(0x27b)][_0x16e3b8(0x391)](_0x43603f);const _0x40a78=_0x51edad[_0x16e3b8(0x182)]?this['_injector'][_0x16e3b8(0x3d6)](AwaitingWithPendingState,this[_0x16e3b8(0x181)],this[_0x16e3b8(0x148)],_0x43603f,_0x51edad,this[_0x16e3b8(0x27b)],void 0x0):this[_0x16e3b8(0x240)][_0x16e3b8(0x3d6)](AwaitingState,this[_0x16e3b8(0x181)],this[_0x16e3b8(0x148)],_0x43603f,this['_handler']);_0x40a78[_0x16e3b8(0x301)](),this[_0x16e3b8(0x27b)]['onStateChange'](this,_0x40a78);},_0xae7954);}[_0x280611(0x144)](){const _0x803ed8=_0x280611;var _0x4aa9fd;const _0x1cb1e1=this[_0x803ed8(0x273)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x4aa9fd=_0x1cb1e1===null||_0x1cb1e1===void 0x0?void 0x0:_0x1cb1e1['sendChangesetTimeout'])!==null&&_0x4aa9fd!==void 0x0?_0x4aa9fd:DEFAULT_SEND_CHANGESET_TIMEOUT;}[_0x280611(0x357)](){const _0x341283=_0x280611;throw new Error(_0x341283(0x32f));}['_clearScheduledTask'](){const _0x2b1b89=_0x280611;this['_sendingTimer']!=null&&(clearTimeout(this[_0x2b1b89(0x2d3)]),this['_sendingTimer']=null);}[_0x280611(0x220)](_0x13da98){const _0x1edc24=_0x280611;return this[_0x1edc24(0x1ae)](),this[_0x1edc24(0x240)]['createInstance'](ConflictState,this[_0x1edc24(0x181)],this[_0x1edc24(0x148)],null,this['_pendingMutations'],this[_0x1edc24(0x27b)],_0x13da98);}};PendingState=_PendingState=__decorate([__decorateParam(0x4,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration['RevisionService'])),__decorateParam(0x6,(0x0,_univerjs_core[_0x280611(0x3d8)])(MemberService)),__decorateParam(0x7,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0x8,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0x9,_univerjs_core[_0x280611(0x2f5)]),__decorateParam(0xa,_univerjs_pro_collaboration['ITransformService']),__decorateParam(0xb,_univerjs_core[_0x280611(0x3d4)]),__decorateParam(0xc,_univerjs_core[_0x280611(0x18b)]),__decorateParam(0xd,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],PendingState);let AwaitingState=_AwaitingState=class AwaitingState extends CollaborationState{constructor(_0x4feaed,_0x4bbf5d,_0x5a7c75,_0xd2b149,_0x43b6dc,_0x371d00,_0x44129c,_0x42b4c6,_0x2fe8bd,_0x9148c5,_0xa74901){const _0x2a1897=_0x280611;super(_0x4feaed,_0x4bbf5d,_0x5a7c75,[],_0xd2b149,_0x44129c,_0x9148c5,_0x371d00,_0xa74901),this[_0x2a1897(0x240)]=_0x43b6dc,this[_0x2a1897(0x1eb)]=_0x42b4c6,this['_transformService']=_0x2fe8bd,_defineProperty(this,_0x2a1897(0x34c),_0x2a1897(0x26b)),_defineProperty(this,_0x2a1897(0x329),0x0),_defineProperty(this,_0x2a1897(0x294),0x0),_defineProperty(this,_0x2a1897(0x36e),void 0x0),_defineProperty(this,'_sender',void 0x0);}[_0x280611(0x1f4)](_0x4e395b){const _0x4683e6=_0x280611;this[_0x4683e6(0x1ae)]();const _0x3fbba9=this[_0x4683e6(0x240)][_0x4683e6(0x3d6)](AwaitingWithPendingState,this[_0x4683e6(0x181)],this[_0x4683e6(0x148)],this[_0x4683e6(0x1d7)],[_0x4e395b],this['_handler'],this[_0x4683e6(0x36e)]);return _0x3fbba9[_0x4683e6(0x301)](),_0x3fbba9;}[_0x280611(0x3cb)](_0x523ad3){const _0x22e05c=_0x280611;if(this['_checkMissing'](_0x523ad3))return this['_clearScheduledTask'](),this[_0x22e05c(0x240)][_0x22e05c(0x3d6)](FetchingMissState,this[_0x22e05c(0x181)],this[_0x22e05c(0x148)],this['_awaitingChangeset'],[],null,[_0x523ad3],this['_handler']);try{const _0x5a7658=this['_transformService'][_0x22e05c(0x1da)]([_0x523ad3],[this[_0x22e05c(0x1d7)]],![]);if((0x0,_univerjs_pro_collaboration['isTransformChangesetsSuccess'])(_0x5a7658)){const {c1Prime:_0x1803ef,c2Prime:_0x5cc6a0}=_0x5a7658;this[_0x22e05c(0x2f3)](_0x1803ef[0x0]),_0x5cc6a0[0x0][_0x22e05c(0x22f)]=this[_0x22e05c(0x32c)](),this['_clearScheduledTask']();const _0x2e5ca3=this['_injector'][_0x22e05c(0x3d6)](_AwaitingState,this[_0x22e05c(0x181)],this[_0x22e05c(0x148)],_0x5cc6a0[0x0],this[_0x22e05c(0x27b)]);return _0x2e5ca3[_0x22e05c(0x301)](),_0x2e5ca3;}throw _0x5a7658['error'];}catch(_0x3fefb7){return this['_logService'][_0x22e05c(0x166)](_0x3fefb7),this['_onConflict'](![]);}}['onRemoteAck'](_0xc737de){const _0x24c569=_0x280611;this[_0x24c569(0x1ae)]();const _0x464982=this[_0x24c569(0x196)][_0x24c569(0x3c0)](this['unitID']);if(_0xc737de[_0x24c569(0x247)]<=_0x464982)return this;if(this['_checkMissing'](_0xc737de))return this[_0x24c569(0x240)][_0x24c569(0x3d6)](FetchingMissState,this[_0x24c569(0x181)],this['type'],this[_0x24c569(0x1d7)],[],_0xc737de[_0x24c569(0x247)],[],this[_0x24c569(0x27b)]);this[_0x24c569(0x192)]();const _0x4482a6=this[_0x24c569(0x240)][_0x24c569(0x3d6)](SyncedState,this[_0x24c569(0x181)],this['type'],this[_0x24c569(0x27b)]);return _0x4482a6[_0x24c569(0x301)](),_0x4482a6;}['onRemoteRej'](_0xa8ac3d){const _0x5d4541=_0x280611;return this[_0x5d4541(0x220)](!!(_0xa8ac3d===null||_0xa8ac3d===void 0x0?void 0x0:_0xa8ac3d[_0x5d4541(0x3a6)]));}['onRemoteRetry'](_0x4e1614){const _0x3dacc5=_0x280611;if(this[_0x3dacc5(0x294)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x3dacc5(0x2a5)]();return this['_resendTimer']=createTimerObservable$(this[_0x3dacc5(0x329)],{'timeout':this[_0x3dacc5(0x329)],'reqId':_0x4e1614[_0x3dacc5(0x1b9)]}),this[_0x3dacc5(0x1c9)]=this[_0x3dacc5(0x36e)][_0x3dacc5(0x23c)](({reqId:_0x52a0d7,timeout:_0x56a7dc})=>{const _0x2114ad=_0x3dacc5;this[_0x2114ad(0x3cd)](_0x52a0d7,_0x56a7dc);}),this;}['toggleOffline'](){const _0x31a45f=_0x280611;return this['_clearScheduledTask'](),this[_0x31a45f(0x240)][_0x31a45f(0x3d6)](OfflineState,this['unitID'],this[_0x31a45f(0x148)],this[_0x31a45f(0x1d7)],[],this[_0x31a45f(0x27b)]);}[_0x280611(0x326)](){return this;}[_0x280611(0x357)](){const _0x140918=_0x280611;this[_0x140918(0x27b)][_0x140918(0x391)](this[_0x140918(0x1d7)]);}['_onConflict'](_0x317af0){const _0x13864b=_0x280611;return this[_0x13864b(0x1ae)](),this[_0x13864b(0x240)][_0x13864b(0x3d6)](ConflictState,this['unitID'],this[_0x13864b(0x148)],this[_0x13864b(0x1d7)],[],this[_0x13864b(0x27b)],_0x317af0);}[_0x280611(0x3cd)](_0xda9d65,_0x2729c7){const _0x19e9a7=_0x280611;var _0x39eaee;_0xda9d65===((_0x39eaee=this[_0x19e9a7(0x1d7)])===null||_0x39eaee===void 0x0?void 0x0:_0x39eaee[_0x19e9a7(0x1b9)])&&(this[_0x19e9a7(0x357)](),this['_resendTimeout']=_0x2729c7===0x0?0x3e8:Math[_0x19e9a7(0x18f)](_0x2729c7*0x2,MAX_RETRY_TIMEOUT),this[_0x19e9a7(0x294)]+=this[_0x19e9a7(0x329)]);}['_clearScheduledTask'](){const _0x2fce86=_0x280611;var _0x3c82a1;(_0x3c82a1=this[_0x2fce86(0x1c9)])===null||_0x3c82a1===void 0x0||_0x3c82a1[_0x2fce86(0x2a8)](),this[_0x2fce86(0x329)]=0x0,this[_0x2fce86(0x294)]=0x0;}};AwaitingState=_AwaitingState=__decorate([__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x5,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration['RevisionService'])),__decorateParam(0x6,_univerjs_core['ICommandService']),__decorateParam(0x7,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0x8,_univerjs_pro_collaboration[_0x280611(0x39f)]),__decorateParam(0x9,_univerjs_core[_0x280611(0x18b)]),__decorateParam(0xa,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],AwaitingState);let AwaitingWithPendingState=_AwaitingWithPendingState=class AwaitingWithPendingState extends CollaborationState{constructor(_0x1c4e22,_0x1a3d68,_0x534ab1,_0x51bf9d,_0x110429,_0x2a90fc,_0x4d7b5a,_0x13a8e3,_0x74a8b2,_0x533557,_0x4af04d,_0x305f74,_0x380782){const _0xa6c98b=_0x280611;super(_0x1c4e22,_0x1a3d68,_0x534ab1,_0x51bf9d,_0x110429,_0x74a8b2,_0x305f74,_0x13a8e3,_0x380782),this[_0xa6c98b(0x240)]=_0x4d7b5a,this[_0xa6c98b(0x1eb)]=_0x533557,this[_0xa6c98b(0x3b4)]=_0x4af04d,this[_0xa6c98b(0x2a4)]=_0x380782,_defineProperty(this,_0xa6c98b(0x34c),_0xa6c98b(0x1f6)),_defineProperty(this,_0xa6c98b(0x329),0x0),_defineProperty(this,_0xa6c98b(0x294),0x0),_defineProperty(this,_0xa6c98b(0x36e),void 0x0),_defineProperty(this,_0xa6c98b(0x1c9),void 0x0),_0x2a90fc&&(this[_0xa6c98b(0x36e)]=_0x2a90fc,this[_0xa6c98b(0x1c9)]=this['_resendTimer'][_0xa6c98b(0x23c)](({reqId:_0x289829,timeout:_0x7ad637})=>{this['_resendWithTimeout'](_0x289829,_0x7ad637);}));}[_0x280611(0x1f4)](_0x40eed0){const _0x11c908=_0x280611;return this[_0x11c908(0x2d1)][_0x11c908(0x1c7)](_0x40eed0),this;}['onRemoteChangeset'](_0x280147){const _0x1f3afc=_0x280611;if(this['_checkMissing'](_0x280147))return this['_clearScheduledTask'](),this[_0x1f3afc(0x240)][_0x1f3afc(0x3d6)](FetchingMissState,this[_0x1f3afc(0x181)],this[_0x1f3afc(0x148)],this[_0x1f3afc(0x1d7)],this[_0x1f3afc(0x2d1)],null,[_0x280147],this['_handler']);try{const _0x5fea59=this[_0x1f3afc(0x3b4)]['transformChangesets']([_0x280147],[this[_0x1f3afc(0x1d7)]],![]);if((0x0,_univerjs_pro_collaboration[_0x1f3afc(0x141)])(_0x5fea59)){const {c1Prime:_0x5f149e,c2Prime:_0x3121b1}=_0x5fea59,_0x26cd85=this[_0x1f3afc(0x3b4)][_0x1f3afc(0x13f)](_0x5f149e[0x0],this['_pendingMutations']);if((0x0,_univerjs_pro_collaboration[_0x1f3afc(0x292)])(_0x26cd85)){const {c1Prime:_0x270024,m2Prime:_0x4b9b2b}=_0x26cd85;return this[_0x1f3afc(0x2f3)](_0x270024),_0x3121b1[0x0][_0x1f3afc(0x22f)]=this[_0x1f3afc(0x32c)](),this[_0x1f3afc(0x1ae)](),this['_injector']['createInstance'](_AwaitingWithPendingState,this['unitID'],this[_0x1f3afc(0x148)],_0x3121b1[0x0],_0x4b9b2b,this[_0x1f3afc(0x27b)],void 0x0);}throw _0x26cd85['error'];}throw _0x5fea59[_0x1f3afc(0x166)];}catch(_0x21c322){return this[_0x1f3afc(0x1eb)][_0x1f3afc(0x166)](_0x21c322),this[_0x1f3afc(0x220)](![]);}}[_0x280611(0x328)](_0x430dc0){const _0x51fe36=_0x280611;this['_clearScheduledTask']();const _0x1afa7c=this['_getCurrentRevision']();if(_0x430dc0[_0x51fe36(0x247)]<=_0x1afa7c)return this;if(this['_checkMissing'](_0x430dc0))return this['_injector'][_0x51fe36(0x3d6)](FetchingMissState,this[_0x51fe36(0x181)],this[_0x51fe36(0x148)],this['_awaitingChangeset'],this['_pendingMutations'],_0x430dc0[_0x51fe36(0x247)],[],this[_0x51fe36(0x27b)]);this[_0x51fe36(0x192)]();const _0x48c1ff=this['_injector']['createInstance'](PendingState,this['unitID'],this[_0x51fe36(0x148)],this[_0x51fe36(0x2d1)],this['_handler']);return _0x48c1ff[_0x51fe36(0x335)](),_0x48c1ff[_0x51fe36(0x301)](),_0x48c1ff;}[_0x280611(0x39a)](_0x1de2c0){const _0xe34652=_0x280611;return this[_0xe34652(0x220)](!!(_0x1de2c0===null||_0x1de2c0===void 0x0?void 0x0:_0x1de2c0[_0xe34652(0x3a6)]));}[_0x280611(0x364)](_0x362a39){const _0x28f79f=_0x280611;if(this[_0x28f79f(0x294)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x28f79f(0x2a5)]();return this[_0x28f79f(0x36e)]=createTimerObservable$(this['_resendTimeout'],{'timeout':this[_0x28f79f(0x329)],'reqId':_0x362a39[_0x28f79f(0x1b9)]}),this['_sender']=this[_0x28f79f(0x36e)][_0x28f79f(0x23c)](({reqId:_0x566c4f,timeout:_0x1aa03c})=>{const _0x385a33=_0x28f79f;this[_0x385a33(0x3cd)](_0x566c4f,_0x1aa03c);}),this;}[_0x280611(0x2a5)](){const _0x468560=_0x280611;return this[_0x468560(0x1ae)](),this[_0x468560(0x240)]['createInstance'](OfflineState,this[_0x468560(0x181)],this[_0x468560(0x148)],this[_0x468560(0x1d7)],this[_0x468560(0x2d1)],this['_handler']);}['toggleOnline'](){return this;}[_0x280611(0x357)](){const _0x5dd15c=_0x280611;this['_handler']['onSendChangeset'](this[_0x5dd15c(0x1d7)]);}[_0x280611(0x220)](_0x423378){const _0x5d6335=_0x280611;return this['_clearScheduledTask'](),this[_0x5d6335(0x240)][_0x5d6335(0x3d6)](ConflictState,this[_0x5d6335(0x181)],this[_0x5d6335(0x148)],null,this[_0x5d6335(0x2d1)],this[_0x5d6335(0x27b)],_0x423378);}['_resendWithTimeout'](_0x590a2b,_0x5c6996){const _0x4776f5=_0x280611;var _0xaf86bc;_0x590a2b===((_0xaf86bc=this[_0x4776f5(0x1d7)])===null||_0xaf86bc===void 0x0?void 0x0:_0xaf86bc[_0x4776f5(0x1b9)])&&(this['resend'](),this['_resendTimeout']=_0x5c6996===0x0?0x3e8:Math[_0x4776f5(0x18f)](_0x5c6996*0x2,MAX_RETRY_TIMEOUT),this[_0x4776f5(0x294)]+=this[_0x4776f5(0x329)]);}[_0x280611(0x1ae)](){const _0x5a2821=_0x280611;var _0x151263;(_0x151263=this[_0x5a2821(0x1c9)])===null||_0x151263===void 0x0||_0x151263[_0x5a2821(0x2a8)](),this[_0x5a2821(0x329)]=0x0,this[_0x5a2821(0x294)]=0x0;}};function _0x57d9(){const _0x331c98=['error$','_state','_initRequestHeader','enableSingleActiveInstanceLock','setShowComponents','objectID','JSONX','SheetTransformSelectionsService','\x0aCurrent:\x20','_transitionLocked','HELLO','textEncoder','DRAWING_IMAGE_ALLOW_IMAGE_LIST','changesets','_replayCachedMutations','LEAVE','_transformStack','\x20in\x20_schedule.','\x0aAfter:\x20','_imageSourceCache','m2Prime','_onRemoteChangeset','75622jPNfoD','confirm','/universer-api/oidc/authpage','c2Prime','IDLE','clear','_transformSelections','CmdRspCode','DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','sid','Subject','_members','_stopTelemetryCollaborationNewChangeset','toggleOnline','CHANGESET_ACK','onRemoteAck','_resendTimeout','_clearRedo','range','_getCurrentRevision','Injector','_memberService','[PendingState]:\x20invalid\x20calling\x20to\x20`resend`.','_type','ISnapshotServerService','onLocalMutation','_redoStacks','Failed\x20to\x20update\x20permission\x20point','_schedule','cfgEnableObjInherit','_waitForHeartbeatResponse','isInternalEditorID','PERSON','_getCtorByUniverInstanceType','state$','getUnitType','/collaborator','dispose$','&source=','RichTextEditingMutation','/resources','body','_socket','SUCCUSS','_acknowledgeAwaitingIfReady','/universer-api/stream/file/upload','unitId','onlyLocal','_commandService','UPDATE_CURSOR','FETCH_MISS','status','ConflictState','getValue','ICommandService','stopTime','members','getCollabEntity','_decreaseWaiting','unit','encrypt','_getRedoStack','resend','INetworkConditionService','target','HTTPRequest','joinRsp','_networkConditionService','data','PSEUDO_FETCH_MISSING_RESULT','missingChangesets','CollaborationUIEventService','collaboration-client.config','IAuthzIoService','_unitID','onRemoteRetry','_initMergeInterceptor','_substituteUndoStack','GLOBAL_ROOMS_CNT_EXCEEDS','_onUserJoin','getTypeOfUnitDisposed$','DEFAULT_FILE_NAME','function','_transformStateCache','WorkbookEditablePermission','_resendTimer','compose','parseChangesetToProtocol','close','_telemetryInfo','ERROR_IMAGE_TYPE','[CollaborationEntity]:\x20invalid\x20state\x20transition!\x20State\x20transferred\x20from\x20is\x20not\x20the\x20current\x20state.\x0aBefore:\x20','[FetchMissState]:\x20missing\x20changesets\x20response\x20still\x20has\x20revision\x20gaps.','setWaitCount','CommandType','29FdEBGA','forEach','updateCollaborator','focused$','_members$','onTransformState','loadUnit','_localCacheService','_onCombEvent','_permissionService','userID','SOCKET_FAILED_RETRY','liveShareOperation','_onRecvEvent','_collaborationSessionService','method','_scheduleCollaborationTimeoutTimer','hostname','FetchingMissState','undefined','patch','_transformIMECache','onTransformSelections','IMentionIOService','has','onSendChangeset','RETRY_CONNECTING_MAX_COUNT','/universer-api/uniscript','object','getResourcesRequest','find','update','onCommentUpdate','interceptor','onRemoteRej','_clearCollaborationTimeoutTimer','_collaborationTimeoutTimer','_httpService','_roomCreated$','ITransformService','_checkMissing','mutations','SYNCED','RxDisposable','JOIN_ROOM_FAILED','MergeInterceptorFactory','isPermissionRej','create','leaveEvent','transformStack\x20failed!','RevisionService','readyForCollab','[FetchingMissState]:\x20not\x20expected\x20to\x20receive\x20ack\x20when\x20`this._awaitingChangeset`\x20is\x20null!','CollaborationSessionService','CompressMutationService','complete','1022388IYKrTc','onStarting','[CollaborationState]:\x20apply\x20error!','_onRemoteRetry','_transformService','updatePermissionPoint','state','replace','ILogService','getTypeOfUnitAdded$','newCsEvent','serializeCombRequest','sequenceExecute','getTime','reverse','\x20to\x20','getCurrentRevOfUnit','roles','_changesetSessionId','[OfflineState]:\x20received\x20acknowledgement.','[FetchingMissState]:\x20invalid\x20calling\x20to\x20`resend`.','univer-pro.collaboration-client.single-active-unit-service','firstValueFrom','src','collabWebSocketUrl','BASE64','registerDependencies','onRemoteChangeset','USERS_LEAVE','_resendWithTimeout','shouldCloseConn','memberID','setCurrentUser','SnapshotServerOverHTTPService','avatar','startsWith','IUniverInstanceService','SHOULD_CLOSE_CONN','createInstance','[SyncedState]:\x20received\x20rejection.','Inject','getInterceptPoints','Quantity','FAIL','Error\x20on\x20receiving\x20event','DisposableCollection','call','UnitStatus','setCfgEnableObjInherit','isArray','refreshPermission','socketService','getLocalCacheKey','_unitInfo$','entityInit$','resolve','/block/','version','CombCmd','AwaitingWithPendingState','/unit/','roomInfos','_isPermissionRej','_fetchMissChangesets','packageName','onMissedChangesetFetched','emitEvent','__splitChunk__','_univerInstanceService','univer-pro.collaboration-client-socket-service','updateSnapshot','_userManagerService','editing\x20status\x20changed\x20to','getMember','originalMeta','dispose','next','connection\x20error','[SyncedState]:\x20invalid\x20calling\x20to\x20`resend`.','post','_emitMembers','updateMember','url','_clearLocalCache','toString','[FetchMissState]','_snapshotServerService','liveShareNewHost','socket\x20open.','_onMessage','_undoStacks','_entityInit$','34865160yoccha','LIVESHARE_TERMINATE','updateOfflineData','LOCAL_CACHE_INTERVAL_KEY','event$','AWAITING_WITH_PENDING','LIVESHARE_FETCH_OPERATIONS','_doCreateSocket','_onUserLeave','SyncedState','_collaborationUIEventService','transformMutationsWithChangeset','createSocket','isTransformChangesetsSuccess','UniverLicensePlugin','[CollaborationEntity]','_getSendChangesetTimeout','commentUpdateEvent','close$','HEARTBEAT_INTERVAL','type','DEFAULT_WS_SESSION_TICKET_URL','set','DataLoaderService','copyFileMeta','PERMISSION_DENIED','disposeWithMe','SUBMIT_CHANGESET_TIMEOUT','defineProperty','default','_candidateSocket','prototype','entries','UNISCRIPT_RUN','retryConnectingInterval','saveSheetBlock','[serializeCombRequest]:\x20should\x20not\x20fall\x20into\x20default\x20branch!','_lockTransition','saveSnapshot','[SyncedState]:\x20received\x20acknowledgement.','_showConflictNotification','init','SheetPermissionInitController','authzUrl','filter','_applyRemoteChangeset','INGEST','_syncEditingCollabCursor','uuidv4','getLatestCsReqIdBySid','error','put','_acknowledgeAwaiting','session.join-failed','isTransformMutationsWithChangesetFailure','collaborators','_collaborationPaused','socket$','fetching\x20missing\x20changesets\x20from\x20','setConfig','_socketMessageSubscription','_initDependencies','/rev/','ISingleActiveUnitService','ONLINE','_scheduleCompleteTimestamp','ImageUploadStatusType','_retryConnectingTimer','listCollaborators','file','_collabSessionService','_change$','code','_onRemoteACK','getFocusedUnit','_shouldReportTelemetry','HEARTBEAT','unitID','length','session.room-permission-denied','OTHER_CLIENTS_EDITING','_substituteRedoStack','_localeService','touchDependencies','_transformRemoteChangesetByIMECache','downloadEndpointUrl','batchAllowed','IUndoRedoService','_getUndoStack','Tools','_throwTelemetryCollaborationNewChangeset','min','take','apply','_incrementRevisionNumber','_sessions','HEARTBEAT_TIMEOUT','resourceIDs','_revisionService','/new_changes','_eventService','7919110ElSbKE','_removeRoom','9400160vJNZIv','_queuedRemoteChangesets','status$','enableOfflineEditing','override','allowed','_initUnitPermissionChange','waitForRoom$','{fileID}','_sessionStatus$','sheets','/-/object/-/batch_allowed','_replaceFileID','members$','_cfgEnableObjInherit','\x20-\x20','_createHandler','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','eventID','_clearScheduledTask','putCollaborators','MSG_FOR_ERROR','[CollaborationUndoRedoService]','CHANGESET_REJ','deepClone','charCodeAt','_registerDependencies','removeMember','_socketReady','getConfig','reqId','mapDocumentTypeToUniverInstanceType','listRoles','getCollabEntity$','onTransformRemoteChangesetByIMECache','fetchMiss','[CollaborationSocketService]:\x20failed\x20to\x20get\x20web\x20socket\x20factory!','collaboration_new_changeset','synced','FETCH_MISSING','_undoRedoService','COMPRESS_MUTATION_APPLY','JOIN_ROOM_PERMISSION_DENIED','editingUnit','push','loadOfflineData','_sender','USERS_ENTER','objects','MentionType','getAllMembers','LIVESHARE_REQUEST_HOST','CollaborativeUndoRedoService','SOCKET_FAILED','takeUntil','location','withCredentials','UNIVER_DOC','pipe','HEARTBEAT_TIMEOUT_KEY','_awaitingChangeset','_createInitialState','saveImage','transformChangesets','UniverInstanceType','LIVESHARE_OPERATION','RECV','_listenToNetworkCondition','/universer-api/snapshot','_changesetReqId','reduce','readAsDataURL','_socketService','__Key__','[CollaborationEntity]:\x20initial\x20state\x20has\x20been\x20created\x20before.\x20You\x20should\x20not\x20call\x20\x22init\x22\x20twice.','onTransformRemoteChangesetByStateCache','&assign=','JOIN_ROOM_FULL','actions','randomBytes','_logService','_sendHeartbeatTimer','getSnapshotAPIPath','awaitingChangeset','loadDoc','encodeURIComponent','uniscriptRunEvent','sort','getGlobalObject','appendMutation','SNAPSHOT_URL_KEY','awaiting_with_pending','reject','_entities','[CollaborationSession]:\x20should\x20not\x20send\x20message\x20when\x20the\x20session\x20is\x20offline!','_singleActiveUnitService','_roomMembers','iterator','_config','_unlockTransition','startTime','/universer-api/file/{fileID}/sign-url','cmd','_status$','_getSignURL','signUrlServerUrl','_transformUndoredo','get','[CollaborationSessionService]','_acknowledgedAwaitingRevision','_getDownloadEndpointURL','cbc','This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!','NEW_CHANGESETS','getSheetId','session.room-not-exists','createCollaborator','submit\x20changeset\x20error!','debug','_tryReconnect','onTransformIME','collaboratorID','auth.needGotoLoginAlert','conflict','getCurrentUser','_startCollaboration','[OfflineState]:\x20invalid\x20calling\x20to\x20`resend`.','offline','_onRemoteRejected','map','from','_commentService','routeKey','_onConflict','Module','Plugin','session','params','_sendHeartbeat','incrementRevOfUnit','_isEchoedAwaitingChangeset','max','concatBytes','action','CollaborationImageIoService','0.22.0','snapshot','string','baseRev','disableLocalCache','CLOSE_ROOM','collabSubmitChangesetUrl','getDrawingImageAllowSize','LIVESHARE_NEW_HOST','CommentService','_instanceService','_onConnectionFailed','[DataLoaderService]','JOIN_ROOM_NOT_EXISTS','_telemetryService','FileId','subscribe','includes','POST','symbol','_injector','stringify','floor','UniverCollaborationPlugin','CollaborationController','fetchMissingChangesets','OfflineState','revision','UPDATE_PERMISSION_OBJ','append','catch','NO_OTHER_CLIENTS_EDITING','merge','_timeoutTimer','collaMsg','COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY','_clearRetryConnectingTimer','getCurrentSelections','[OfflineState]:\x20received\x20changeset.','[OfflineState]:\x20received\x20rejection.','_HTTPService','@univerjs-pro/collaboration-client','subject','Univer','_updateStatus','_clearTimeoutTimer','fetchThroughInterceptors','open$','joinEvent','registerHTTPInterceptor','fetch_missing','_toggleOffline','_transformAndApplyRemoteChangeset','_retryCount','executeCommand','headers','delay','every','_init','_onOffline','ErrorCode','_state$','CollaborationSocketService','awaiting','_snapshotService','LOCAL_CACHE_INTERVAL','onTransformRemoteChangesetByIMECache\x20callback\x20is\x20not\x20added\x20yet.','rev','toDisposable','LocaleService','_transformRemoteChangesetByStateCache','_configService','UniverNetworkPlugin','workbook','href','_getAPIPrefixPath','/allowed','transformUndoRedo','sessionStatus$','_handler','session.room-cnt-exceeds','ImageSourceType','encode','createIdentifier','HTTPService','selections','CollaborationEvent','JOINING','OTHER_CLIENT_EDITING','permissionRejEvent','getOwnPropertyDescriptor','IPermissionService','closeSession','_clearHeartbeatTimer','send','findIndex','size','_remoteChangesetQueue','COMMENT_UPDATE','pluginName','PERMISSION_REJ','parseProtocolChangeset','isTransformMutationsWithChangesetSuccess','requestParams','_maxTotalRetryTimeout','CONFLICT','getUnitId','result','you\x20should\x20override\x20\x22IUndoRedoService\x22\x20provided\x20in\x20\x22core\x22\x20package!','_initCloseConn','Unknown\x20type.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.','requireSession','name','[CollaborationSessionService]:\x20socket\x20error','[PendingState]:\x20received\x20acknowledgement.','Optional','5319210ofUEOY','_commentUpdate$','[ConflictState]:\x20invalid\x20calling\x20to\x20`resend`.','_joinRoom','localCacheService','toggleOffline','toPrimitive','getMemberID','unsubscribe','failed\x20to\x20apply\x20missed\x20changesets!','SetSelectionsOperation','deserializeToCombResponse','onMutationExecutedForCollab','_compressMutationService','CollaborationStatus','csShouldRetryEvent','initWorkbookPermissionChange','onSyncEditingCollabCursor','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','_clearUndo','loginUrlKey','_event$','enableCollaboration','_waitCount','x-univer-host','ThresholdInterceptorFactory','_getAPIPrefix','4468956IDKHaw','CollaborationUIEventId','textRanges','delete','objectType','loadUnitOfRevision','ERROR_EXCEED_SIZE','_rescheduleHeartbeat','UNIVER_SHEET','/object/','_exhaustRemoteChangesetQueue','onTransformRemoteChangesetByStateCache\x20callback\x20is\x20not\x20added\x20yet.','shareReplay','ERROR_IMAGE','IContextService','SUBMIT_CHANGESET','add','FileSource','addHandlerCallback','unknown','fromCollab','BehaviorSubject','_pendingMutations','commentUpdate$','_sendingTimer','[CollaborationController]:\x20invalid\x20univer\x20type:\x20','transformSelections','c1Prime','_getUploadFileURL','_getLoginPath','origin','uploadFileServerUrl','JOIN','asObservable','_handlerCallback','_onLocalMutation','message$','MUTATION','not_collab','EmptyMutationInfo','_handleRemoteChangesets','decorate','unitInfo$','DEFAULT_COLLAB_WEB_SOCKET_URL','_toggleOnline','Disposable','_onJoinRoomEvent','change$','OFFLINE','pending','_socket$','getActiveSheet','UserManagerService','DocCollaborationEntity','_disableEditing','IImageIoService','_executeRemoteChangeset','onMissingChangesets','IConfigService','_createSocket','_sheetTransformSelectionsService','ITelemetryService','_submitChangeset','/universer-api/user/session-ticket','[UniverCollaborationClientPlugin]','fetching\x20the\x20latest\x20document\x20from\x20the\x20server.','CHANGESET_SHOULD_RETRY','getUnit','/universer-api/authz','duration','_updateLocalCache','_updateState'];_0x57d9=function(){return _0x331c98;};return _0x57d9();}AwaitingWithPendingState=_AwaitingWithPendingState=__decorate([__decorateParam(0x6,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x7,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration[_0x280611(0x3aa)])),__decorateParam(0x8,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0x9,_univerjs_core['ILogService']),__decorateParam(0xa,_univerjs_pro_collaboration[_0x280611(0x39f)]),__decorateParam(0xb,_univerjs_core[_0x280611(0x18b)]),__decorateParam(0xc,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],AwaitingWithPendingState);let ConflictState=class ConflictState extends CollaborationState{constructor(_0x21da23,_0x3dbbc5,_0xa524b4,_0xebf553,_0x5d698f,_0x32b9b4=![],_0x4e7473,_0x210a89,_0x55ba37,_0x1ad481,_0xd6dbb6,_0x1e195f,_0x771660){const _0xe27ad6=_0x280611;super(_0x21da23,_0x3dbbc5,_0xa524b4,_0xebf553,_0x5d698f,_0x210a89,_0x55ba37,_0x1ad481,_0x771660),this['_isPermissionRej']=_0x32b9b4,this[_0xe27ad6(0x381)]=_0x4e7473,this[_0xe27ad6(0x186)]=_0xd6dbb6,this[_0xe27ad6(0x13e)]=_0x1e195f,this[_0xe27ad6(0x2a4)]=_0x771660,_defineProperty(this,_0xe27ad6(0x34c),_0xe27ad6(0x216)),this[_0xe27ad6(0x15c)](),this[_0xe27ad6(0x403)](),this[_0xe27ad6(0x2f1)]();}[_0x280611(0x1f4)](){return this;}[_0x280611(0x3cb)](){return this;}['onRemoteAck'](){return this;}[_0x280611(0x39a)](){return this;}[_0x280611(0x364)](){return this;}['toggleOffline'](){return this;}[_0x280611(0x326)](){return this;}[_0x280611(0x357)](){const _0x3d820e=_0x280611;throw new Error(_0x3d820e(0x2a2));}['_clearLocalCache'](){const _0x59c6dc=_0x280611;var _0x38f9a9;(_0x38f9a9=this['_localCacheService'])===null||_0x38f9a9===void 0x0||_0x38f9a9['updateOfflineData'](this['unitID'],this[_0x59c6dc(0x148)],null,[]);}[_0x280611(0x15c)](){const _0x160e96=_0x280611;if(this[_0x160e96(0x3ee)])this[_0x160e96(0x13e)]['emitEvent']({'id':_0x160e96(0x14d)});else this[_0x160e96(0x13e)][_0x160e96(0x3f2)]({'id':_0x160e96(0x295)});}[_0x280611(0x2f1)](){const _0x25fc8c=_0x280611;this[_0x25fc8c(0x381)][_0x25fc8c(0x3b5)](new _univerjs_sheets[(_0x25fc8c(0x36d))](this[_0x25fc8c(0x181)])['id'],![]);}};ConflictState=__decorate([__decorateParam(0x6,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x287)])),__decorateParam(0x7,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0x8,_univerjs_core[_0x280611(0x18b)]),__decorateParam(0x9,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration[_0x280611(0x3aa)])),__decorateParam(0xa,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x271)])),__decorateParam(0xb,(0x0,_univerjs_core[_0x280611(0x3d8)])(CollaborationUIEventService)),__decorateParam(0xc,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],ConflictState);let OfflineState=class OfflineState extends CollaborationState{constructor(_0x5ce196,_0x1338f1,_0x5240e5,_0x421ef6,_0x1bfc44,_0x296199,_0x499c9a,_0x109e15,_0x355c55,_0x32daf4){const _0x2b4dda=_0x280611;super(_0x5ce196,_0x1338f1,_0x5240e5,_0x421ef6,_0x1bfc44,_0x109e15,_0x355c55,_0x499c9a,_0x32daf4),this[_0x2b4dda(0x240)]=_0x296199,_defineProperty(this,_0x2b4dda(0x34c),_0x2b4dda(0x21a));}[_0x280611(0x1f4)](_0x25dc24){const _0x9f1059=_0x280611;return this['_pendingMutations'][_0x9f1059(0x1c7)](_0x25dc24),this[_0x9f1059(0x301)](),this;}['onRemoteChangeset'](_0x3113de){const _0x2b5807=_0x280611;throw new Error(_0x2b5807(0x252));}[_0x280611(0x328)](){const _0x5bf3c1=_0x280611;throw new Error(_0x5bf3c1(0x3c3));}[_0x280611(0x39a)](){const _0x113b82=_0x280611;throw new Error(_0x113b82(0x253));}[_0x280611(0x364)](){return this;}['toggleOffline'](){return this;}[_0x280611(0x326)](){const _0x3a0a68=_0x280611,{_injector:_0x1a793e,_pendingMutations:_0x41f643,_awaitingChangeset:_0x47f972,unitID:_0x129815,_handler:_0x5d0a5c,type:_0x27f862}=this,_0x471fbe=createOnlineState(_0x1a793e,_0x129815,_0x27f862,_0x47f972,_0x41f643,_0x5d0a5c);if(_0x471fbe instanceof PendingState)_0x471fbe[_0x3a0a68(0x335)]();else{if(_0x471fbe instanceof AwaitingWithPendingState||_0x471fbe instanceof AwaitingState)_0x471fbe[_0x3a0a68(0x357)]();}return _0x471fbe;}['resend'](){const _0x425094=_0x280611;throw new Error(_0x425094(0x219));}};OfflineState=__decorate([__decorateParam(0x5,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core['Injector'])),__decorateParam(0x6,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration[_0x280611(0x3aa)])),__decorateParam(0x7,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0x8,_univerjs_core[_0x280611(0x18b)]),__decorateParam(0x9,(0x0,_univerjs_core[_0x280611(0x29f)])(ILocalCacheService))],OfflineState);let FetchingMissState=class FetchingMissState extends CollaborationState{constructor(_0x415ade,_0x232de5,_0xa09057,_0x94669c,_0x4f83a7,_0xc5f480,_0x3cfda7,_0x477207,_0xf61ff,_0x5932ea,_0xd890f2,_0x5de194,_0x25c521,_0x52882c){const _0x521a05=_0x280611;super(_0x415ade,_0x232de5,_0xa09057,_0x94669c,_0x3cfda7,_0xd890f2,_0x5de194,_0xf61ff,_0x52882c),this[_0x521a05(0x208)]=_0x4f83a7,this[_0x521a05(0x19c)]=_0xc5f480,this[_0x521a05(0x240)]=_0x477207,this[_0x521a05(0x1eb)]=_0x5932ea,this[_0x521a05(0x3b4)]=_0x25c521,this[_0x521a05(0x2a4)]=_0x52882c,_defineProperty(this,_0x521a05(0x34c),_0x521a05(0x25e));}[_0x280611(0x3f1)](_0x4d3f96){const _0x5b2111=_0x280611;try{if(this[_0x5b2111(0x2e3)](_0x4d3f96)[_0x5b2111(0x35f)])throw new Error(_0x5b2111(0x375));if(this['_handleRemoteChangesets']([...this['_queuedRemoteChangesets']][_0x5b2111(0x1f2)]((_0x28ed4b,_0x57694c)=>_0x28ed4b[_0x5b2111(0x247)]-_0x57694c[_0x5b2111(0x247)]))[_0x5b2111(0x35f)])return this[_0x5b2111(0x19c)]=[],this[_0x5b2111(0x301)](),this['_handler']['onMissingChangesets']({'from':this[_0x5b2111(0x32c)](),'to':0x0}),this;const _0x46c787=this[_0x5b2111(0x1d7)],_0x87ea00=this[_0x5b2111(0x2d1)];let _0x3969bc;if(_0x46c787&&_0x87ea00[_0x5b2111(0x182)]!==0x0)_0x3969bc=this[_0x5b2111(0x240)][_0x5b2111(0x3d6)](AwaitingWithPendingState,this['unitID'],this['type'],_0x46c787,_0x87ea00,this[_0x5b2111(0x27b)],void 0x0);else{if(_0x46c787&&_0x87ea00[_0x5b2111(0x182)]===0x0)_0x46c787[_0x5b2111(0x22f)]=this[_0x5b2111(0x32c)](),_0x3969bc=this['_injector']['createInstance'](AwaitingState,this[_0x5b2111(0x181)],this[_0x5b2111(0x148)],_0x46c787,this[_0x5b2111(0x27b)]);else{if(_0x87ea00['length']!==0x0){const _0xc7f4bb=this[_0x5b2111(0x240)]['createInstance'](PendingState,this[_0x5b2111(0x181)],this[_0x5b2111(0x148)],_0x87ea00,this[_0x5b2111(0x27b)]);_0xc7f4bb[_0x5b2111(0x335)](),_0x3969bc=_0xc7f4bb;}else _0x3969bc=this[_0x5b2111(0x240)][_0x5b2111(0x3d6)](SyncedState,this['unitID'],this['type'],this['_handler']);}}return _0x3969bc[_0x5b2111(0x301)](),_0x3969bc;}catch(_0x593c19){return this[_0x5b2111(0x1eb)]['error'](_0x5b2111(0x405),_0x5b2111(0x2a9),_0x593c19),this[_0x5b2111(0x240)][_0x5b2111(0x3d6)](ConflictState,this['unitID'],this[_0x5b2111(0x148)],this['_awaitingChangeset'],this[_0x5b2111(0x2d1)],this['_handler'],![]);}}[_0x280611(0x2e3)](_0x29c573){const _0x319eac=_0x280611;this[_0x319eac(0x345)]();for(let _0x41d5bd=0x0;_0x41d5bd<_0x29c573[_0x319eac(0x182)];_0x41d5bd++){const _0x11764c=_0x29c573[_0x41d5bd],_0x364228=this[_0x319eac(0x32c)]();if(_0x11764c[_0x319eac(0x247)]<=_0x364228)continue;if(_0x11764c[_0x319eac(0x247)]>_0x364228+0x1)return{'missingChangesets':!![]};if(this[_0x319eac(0x227)](_0x11764c)){this['_acknowledgeAwaiting']();continue;}this[_0x319eac(0x260)](_0x11764c),this[_0x319eac(0x345)]();}return{'missingChangesets':![]};}[_0x280611(0x260)](_0x39cf9c){const _0x32eaee=_0x280611;let _0x37ca5a=_0x39cf9c,_0x502b69=this[_0x32eaee(0x1d7)];if(_0x502b69){const _0x2d7c38=this[_0x32eaee(0x3b4)]['transformChangesets']([_0x39cf9c],[_0x502b69],![]);if(!(0x0,_univerjs_pro_collaboration[_0x32eaee(0x141)])(_0x2d7c38))throw _0x2d7c38[_0x32eaee(0x166)];_0x37ca5a=_0x2d7c38['c1Prime'][0x0],_0x502b69=_0x2d7c38[_0x32eaee(0x31c)][0x0];}let _0x2d3ab4=this[_0x32eaee(0x2d1)];if(_0x2d3ab4['length']){const _0x55eaa9=this[_0x32eaee(0x3b4)][_0x32eaee(0x13f)](_0x37ca5a,_0x2d3ab4);if(!(0x0,_univerjs_pro_collaboration[_0x32eaee(0x292)])(_0x55eaa9))throw _0x55eaa9[_0x32eaee(0x166)];_0x37ca5a=_0x55eaa9[_0x32eaee(0x2d6)],_0x2d3ab4=_0x55eaa9[_0x32eaee(0x317)];}this['_executeRemoteChangeset'](_0x37ca5a);if(_0x502b69)_0x502b69[_0x32eaee(0x22f)]=this[_0x32eaee(0x32c)]();this[_0x32eaee(0x1d7)]=_0x502b69,this['_pendingMutations']=_0x2d3ab4;}[_0x280611(0x345)](){const _0x343a57=_0x280611;if(!this[_0x343a57(0x1d7)]||this[_0x343a57(0x208)]==null)return;const _0x593719=this[_0x343a57(0x32c)]();if(this[_0x343a57(0x208)]<=_0x593719)throw new Error('[FetchingMissState]:\x20received\x20stale\x20ack\x20revision:\x20'+this['_acknowledgedAwaitingRevision']+'.');if(this['_acknowledgedAwaitingRevision']===_0x593719+0x1)this[_0x343a57(0x168)]();}['_acknowledgeAwaiting'](){const _0x1d7a33=_0x280611;this[_0x1d7a33(0x192)](),this[_0x1d7a33(0x1d7)]=null,this['_acknowledgedAwaitingRevision']=null;}['_isEchoedAwaitingChangeset'](_0x508006){const _0x3ab709=_0x280611,_0x37f6b1=this[_0x3ab709(0x1d7)];if(!_0x37f6b1)return![];if(!_0x37f6b1[_0x3ab709(0x322)]||_0x37f6b1[_0x3ab709(0x1b9)]===null||_0x37f6b1[_0x3ab709(0x1b9)]===void 0x0)return![];return _0x508006['unitID']===_0x37f6b1[_0x3ab709(0x181)]&&_0x508006[_0x3ab709(0x322)]===_0x37f6b1[_0x3ab709(0x322)]&&_0x508006['reqId']===_0x37f6b1[_0x3ab709(0x1b9)];}[_0x280611(0x357)](){const _0x349a62=_0x280611;throw new Error(_0x349a62(0x3c4));}['appendMutation'](_0x38cb09){return this['_pendingMutations']['push'](_0x38cb09),this;}[_0x280611(0x3cb)](_0x4610b5){const _0x4dbb0a=_0x280611;return this['_queuedRemoteChangesets'][_0x4dbb0a(0x1c7)](_0x4610b5),this;}[_0x280611(0x328)](_0x1069c3){const _0x4a29a2=_0x280611;if(this[_0x4a29a2(0x1d7)]){const _0x1e2e9b=this[_0x4a29a2(0x32c)]();if(_0x1069c3['revision']<=_0x1e2e9b)return this;else{if(_0x1e2e9b+0x1===_0x1069c3[_0x4a29a2(0x247)])this[_0x4a29a2(0x192)](),this[_0x4a29a2(0x1d7)]=null,this[_0x4a29a2(0x208)]=null;else this[_0x4a29a2(0x208)]=_0x1069c3[_0x4a29a2(0x247)];}return this;}if(_0x1069c3[_0x4a29a2(0x247)]<=this[_0x4a29a2(0x32c)]())return this;throw new Error(_0x4a29a2(0x3ac));}[_0x280611(0x39a)](_0x46633f){const _0x2556c8=_0x280611;return this[_0x2556c8(0x220)](!!(_0x46633f===null||_0x46633f===void 0x0?void 0x0:_0x46633f['isPermissionRej']));}[_0x280611(0x364)](){return this;}[_0x280611(0x2a5)](){const _0x4e5935=_0x280611;return this[_0x4e5935(0x240)]['createInstance'](OfflineState,this[_0x4e5935(0x181)],this[_0x4e5935(0x148)],this['_awaitingChangeset'],this[_0x4e5935(0x2d1)],this[_0x4e5935(0x27b)]);}[_0x280611(0x326)](){return this;}[_0x280611(0x220)](_0x336dfe){const _0x137422=_0x280611;return this[_0x137422(0x240)][_0x137422(0x3d6)](ConflictState,this[_0x137422(0x181)],this[_0x137422(0x148)],this['_awaitingChangeset'],this[_0x137422(0x2d1)],this[_0x137422(0x27b)],_0x336dfe);}};FetchingMissState=__decorate([__decorateParam(0x7,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x8,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration['RevisionService'])),__decorateParam(0x9,_univerjs_core['ILogService']),__decorateParam(0xa,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0xb,_univerjs_core['IUndoRedoService']),__decorateParam(0xc,_univerjs_pro_collaboration[_0x280611(0x39f)]),__decorateParam(0xd,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],FetchingMissState);function createOnlineState(_0x46c076,_0x4290d4,_0x455744,_0x1ad7dc,_0x42927a,_0x1012c3){const _0x4c1749=_0x280611;if(_0x1ad7dc&&_0x42927a['length'])return _0x46c076[_0x4c1749(0x3d6)](AwaitingWithPendingState,_0x4290d4,_0x455744,_0x1ad7dc,_0x42927a,_0x1012c3,void 0x0);if(_0x1ad7dc)return _0x46c076[_0x4c1749(0x3d6)](AwaitingState,_0x4290d4,_0x455744,_0x1ad7dc,_0x1012c3);if(_0x42927a['length'])return _0x46c076[_0x4c1749(0x3d6)](PendingState,_0x4290d4,_0x455744,_0x42927a,_0x1012c3);return _0x46c076[_0x4c1749(0x3d6)](SyncedState,_0x4290d4,_0x455744,_0x1012c3);}let CollaborationEntity=class CollaborationEntity extends _univerjs_core['RxDisposable']{get[_0x280611(0x3b6)](){const _0x4b1e3b=_0x280611;return this[_0x4b1e3b(0x304)];}constructor(_0x312024,_0x5eac34,_0x183682,_0x5e110e,_0x58b842,_0x3babef,_0x4d6a20,_0x49223c,_0x3f3497,_0x49000f,_0x56a5c7,_0x1f3bf6,_0x91decb,_0x32b03c){const _0x5eeb01=_0x280611;super(),this[_0x5eeb01(0x181)]=_0x312024,this['session']=_0x5eac34,this[_0x5eeb01(0x330)]=_0x183682,this['_injector']=_0x5e110e,this[_0x5eeb01(0x2ad)]=_0x58b842,this['_localeService']=_0x3babef,this['_revisionService']=_0x4d6a20,this['_eventService']=_0x49223c,this['_univerInstanceService']=_0x3f3497,this[_0x5eeb01(0x1eb)]=_0x49000f,this[_0x5eeb01(0x349)]=_0x56a5c7,this[_0x5eeb01(0x381)]=_0x1f3bf6,this[_0x5eeb01(0x1fa)]=_0x91decb,this[_0x5eeb01(0x37f)]=_0x32b03c,_defineProperty(this,_0x5eeb01(0x269),new rxjs['BehaviorSubject'](null)),_defineProperty(this,_0x5eeb01(0x33b),this[_0x5eeb01(0x269)][_0x5eeb01(0x2dc)]()),_defineProperty(this,_0x5eeb01(0x304),void 0x0),_defineProperty(this,_0x5eeb01(0x16c),![]),_defineProperty(this,_0x5eeb01(0x3c2),''),_defineProperty(this,_0x5eeb01(0x1e0),0x0),_defineProperty(this,_0x5eeb01(0x19d),this[_0x5eeb01(0x33b)][_0x5eeb01(0x1d5)]((0x0,rxjs[_0x5eeb01(0x21c)])(_0x3a887f=>{const _0x24b2f2=_0x5eeb01;if(_0x3a887f)return _0x3a887f[_0x24b2f2(0x34c)];return _0x24b2f2(0x21a);}),(0x0,rxjs[_0x5eeb01(0x2c7)])(0x1))),_defineProperty(this,'_transitionLocked',![]),_defineProperty(this,'_remoteChangesetQueue',[]);}async[_0x280611(0x15d)](){const _0xb176fc=_0x280611;if(this['state'])throw new Error(_0xb176fc(0x1e5));await this[_0xb176fc(0x266)]();}['pauseCollaboration'](){const _0x2a9c97=_0x280611;return this[_0x2a9c97(0x16c)]=!![],(0x0,_univerjs_core[_0x2a9c97(0x270)])(()=>{const _0x29370f=_0x2a9c97;this[_0x29370f(0x16c)]=![],this[_0x29370f(0x2c5)]();});}[_0x280611(0x332)](_0x410504){const _0x28cd43=_0x280611;this[_0x28cd43(0x2de)](_0x410504);}['_updateState'](_0x5d1e0c){const _0x40045c=_0x280611;this[_0x40045c(0x304)]=_0x5d1e0c,this['_state$'][_0x40045c(0x3fc)](_0x5d1e0c);}async[_0x280611(0x266)](){const _0x284960=_0x280611;this['_updateState'](await this[_0x284960(0x1d8)]());if(this[_0x284960(0x1fa)]){var _0xb719f1;(_0xb719f1=this[_0x284960(0x1fa)])===null||_0xb719f1===void 0x0||_0xb719f1[_0x284960(0x1c6)](this[_0x284960(0x181)]),this[_0x284960(0x14e)](this['_singleActiveUnitService']['getUnitStatus$'](this[_0x284960(0x181)])[_0x284960(0x23c)](_0x591245=>{const _0x19ea5d=_0x284960;this[_0x19ea5d(0x1eb)]['debug'](_0x19ea5d(0x143),_0x19ea5d(0x3f8),_0x591245),_0x591245===0x1?(this[_0x19ea5d(0x198)]['emitEvent']({'id':'OTHER_CLIENT_EDITING'}),this[_0x19ea5d(0x381)][_0x19ea5d(0x3b5)](new _univerjs_sheets[(_0x19ea5d(0x36d))](this[_0x19ea5d(0x181)])['id'],![]),this[_0x19ea5d(0x381)][_0x19ea5d(0x307)](![])):(this['_permissionService'][_0x19ea5d(0x3b5)](new _univerjs_sheets[(_0x19ea5d(0x36d))](this[_0x19ea5d(0x181)])['id'],!![]),this[_0x19ea5d(0x381)][_0x19ea5d(0x307)](!![]));}));}let _0x4db669=![];return this[_0x284960(0x14e)](this['session'][_0x284960(0x27a)][_0x284960(0x23c)](_0x99d751=>{const _0x42ca06=_0x284960;if(_0x99d751===0x3)this[_0x42ca06(0x2e7)](_0x4db669);else _0x99d751===0x2&&(_0x4db669=!![],this[_0x42ca06(0x25f)]());})),this['disposeWithMe'](this['session'][_0x284960(0x138)][_0x284960(0x23c)](_0x559b49=>{const _0x3a2dd4=_0x284960;try{switch(_0x559b49[_0x3a2dd4(0x1ad)]){case _univerjs_pro_collaboration[_0x3a2dd4(0x282)]['NEW_CHANGESETS']:this['_onRemoteChangeset']((0x0,_univerjs_pro_collaboration['parseProtocolChangeset'])(_0x559b49['data']));break;case _univerjs_pro_collaboration[_0x3a2dd4(0x282)]['CHANGESET_ACK']:this['_onRemoteACK'](_0x559b49[_0x3a2dd4(0x35d)]);break;case _univerjs_pro_collaboration[_0x3a2dd4(0x282)][_0x3a2dd4(0x1b2)]:this['_onRemoteRejected']();break;case _univerjs_pro_collaboration[_0x3a2dd4(0x282)]['CHANGESET_SHOULD_RETRY']:this['_onRemoteRetry'](_0x559b49[_0x3a2dd4(0x35d)]);break;case _univerjs_pro_collaboration['CollaborationEvent']['PSEUDO_FETCH_MISSING_RESULT']:this['_onFetchMissResult'](_0x559b49[_0x3a2dd4(0x35d)][_0x3a2dd4(0x310)][_0x3a2dd4(0x21c)](_0x319f37=>(0x0,_univerjs_pro_collaboration[_0x3a2dd4(0x291)])(_0x319f37)));break;case _univerjs_pro_collaboration[_0x3a2dd4(0x282)][_0x3a2dd4(0x290)]:this[_0x3a2dd4(0x21b)]({'isPermissionRej':!![]});break;case _univerjs_pro_collaboration['CollaborationEvent']['UNISCRIPT_RUN']:break;}}catch(_0x28c93a){console[_0x3a2dd4(0x166)](_0x3a2dd4(0x3dc),_0x28c93a);throw _0x28c93a;}})),this['_state'];}['_unlockTransition'](){this['_transitionLocked']=![];}[_0x280611(0x159)](){const _0x4acbba=_0x280611;if(this[_0x4acbba(0x30c)])throw new Error('[CollaborationEntity]:\x20cannot\x20lock\x20transition\x20twice!\x20This\x20is\x20an\x20implementation\x20error,\x20meaning\x20you\x20transit\x20the\x20collaboration\x20state\x20again\x20in\x20the\x20process\x20of\x20a\x20previous\x20transition.\x20This\x20should\x20never\x20happen.');this[_0x4acbba(0x30c)]=!![];}['_onLocalMutation'](_0x564d04){const _0x10d79a=_0x280611;this['_lockTransition'](),this[_0x10d79a(0x302)](this['_state'][_0x10d79a(0x1f4)](_0x564d04)),this[_0x10d79a(0x1fe)]();}[_0x280611(0x318)](_0x49e2a3){const _0x2d0d2f=_0x280611;if(_0x49e2a3['revision']<=this['_revisionService'][_0x2d0d2f(0x3c0)](this[_0x2d0d2f(0x181)]))return;if(this[_0x2d0d2f(0x16c)]){this[_0x2d0d2f(0x28d)]['push'](_0x49e2a3);return;}this[_0x2d0d2f(0x161)](_0x49e2a3);}[_0x280611(0x2c5)](){const _0x39014d=_0x280611;this[_0x39014d(0x28d)][_0x39014d(0x379)](_0xbb603f=>this[_0x39014d(0x161)](_0xbb603f)),this[_0x39014d(0x28d)]=[];}[_0x280611(0x161)](_0x3d3c9c){const _0x5ea661=_0x280611,_0x17df14=this['_compressMutationService']['interceptor'][_0x5ea661(0x25a)](this[_0x5ea661(0x2ad)][_0x5ea661(0x399)]['getInterceptPoints']()[_0x5ea661(0x1c4)])(_0x3d3c9c[_0x5ea661(0x3a1)],null)||_0x3d3c9c[_0x5ea661(0x3a1)],_0x3150af={..._0x3d3c9c,'mutations':_0x17df14};this[_0x5ea661(0x159)](),this[_0x5ea661(0x302)](this[_0x5ea661(0x304)][_0x5ea661(0x3cb)](_0x3150af)),this[_0x5ea661(0x1fe)]();}[_0x280611(0x17d)](_0x546743){const _0x2ab678=_0x280611;this[_0x2ab678(0x159)](),this['_updateState'](this[_0x2ab678(0x304)][_0x2ab678(0x328)](_0x546743)),this[_0x2ab678(0x1fe)]();}['_onRemoteRejected'](_0x3e8a4c){const _0x284ad4=_0x280611;this[_0x284ad4(0x159)](),this[_0x284ad4(0x302)](this['_state'][_0x284ad4(0x39a)](_0x3e8a4c)),this[_0x284ad4(0x1fe)]();}[_0x280611(0x3b3)](_0x4650be){const _0x5b316b=_0x280611;this[_0x5b316b(0x159)](),this[_0x5b316b(0x302)](this[_0x5b316b(0x304)][_0x5b316b(0x364)](_0x4650be)),this[_0x5b316b(0x1fe)]();}['_onFetchMissResult'](_0x328ace){const _0x6871f9=_0x280611;if(!(this[_0x6871f9(0x304)]instanceof FetchingMissState))throw new TypeError('[CollaborationEntity]:\x20cannot\x20apply\x20missing\x20results\x20on\x20other\x20states!');const _0x26bfb1=_0x328ace[_0x6871f9(0x21c)](_0x42fe5b=>{const _0x26cf97=_0x6871f9,_0x187a96=this[_0x26cf97(0x2ad)][_0x26cf97(0x399)]['fetchThroughInterceptors'](this[_0x26cf97(0x2ad)][_0x26cf97(0x399)][_0x26cf97(0x3d9)]()['COMPRESS_MUTATION_APPLY'])(_0x42fe5b[_0x26cf97(0x3a1)],null)||_0x42fe5b[_0x26cf97(0x3a1)];return{..._0x42fe5b,'mutations':_0x187a96};});this[_0x6871f9(0x159)](),this['_updateState'](this['_state'][_0x6871f9(0x3f1)](_0x26bfb1)),this[_0x6871f9(0x1fe)]();}[_0x280611(0x25f)](){const _0x2afe0a=_0x280611;this[_0x2afe0a(0x159)](),this[_0x2afe0a(0x302)](this[_0x2afe0a(0x304)][_0x2afe0a(0x2a5)]()),this[_0x2afe0a(0x1fe)]();}[_0x280611(0x2e7)](_0x18c5e7=![]){const _0xbd2c4f=_0x280611;this[_0xbd2c4f(0x159)](),this[_0xbd2c4f(0x302)](this[_0xbd2c4f(0x304)][_0xbd2c4f(0x326)]()),this['_unlockTransition']();const _0x3d0110=this[_0xbd2c4f(0x304)];_0x18c5e7&&_0x3d0110 instanceof SyncedState&&(this[_0xbd2c4f(0x159)](),this[_0xbd2c4f(0x302)](_0x3d0110[_0xbd2c4f(0x1be)]()),this[_0xbd2c4f(0x1fe)]());}async['_createInitialState'](){return new Promise(_0x321c39=>{const _0x4d8bd3=_0xed3c;this[_0x4d8bd3(0x223)][_0x4d8bd3(0x27a)][_0x4d8bd3(0x1d5)]((0x0,rxjs['take'])(0x1))[_0x4d8bd3(0x23c)](async _0x21f941=>{_0x321c39(await this['_createInitialStateImpl'](_0x21f941===0x3));});});}[_0x280611(0x1ab)](){const _0x592a52=this['unitID'];return{'onStateChange':(_0x1e2759,_0x15192d)=>{const _0xf4d295=_0xed3c;if(_0x1e2759!==this[_0xf4d295(0x304)])throw new Error(_0xf4d295(0x374)+_0x1e2759[_0xf4d295(0x34c)]+_0xf4d295(0x315)+_0x15192d['status']+_0xf4d295(0x30b)+this[_0xf4d295(0x304)]['status']);this['_updateState'](_0x15192d);},'onSendChangeset':_0x1ca8ce=>{const _0x5c9f13=_0xed3c;!_0x1ca8ce[_0x5c9f13(0x322)]&&(_0x1ca8ce[_0x5c9f13(0x322)]=this[_0x5c9f13(0x3c2)],_0x1ca8ce[_0x5c9f13(0x1b9)]=++this['_changesetReqId']);const _0x9b3100={'eventID':_univerjs_pro_collaboration[_0x5c9f13(0x282)][_0x5c9f13(0x2ca)],'data':{'unitID':_0x1ca8ce[_0x5c9f13(0x181)],'unitType':this['_type'],'changeset':_0x1ca8ce,'memberID':this[_0x5c9f13(0x223)]['getMemberID']()}};this[_0x5c9f13(0x223)][_0x5c9f13(0x28a)](_0x9b3100,this['unitID']);},'onMissingChangesets':({from:_0x1167da,to:_0x27ff64})=>{const _0x480749=_0xed3c;this[_0x480749(0x1eb)][_0x480749(0x211)](_0x480749(0x143),_0x480749(0x16e)+_0x1167da+_0x480749(0x3bf)+_0x27ff64);const _0x31df56={'eventID':_univerjs_pro_collaboration[_0x480749(0x282)][_0x480749(0x1c2)],'data':{'unitID':_0x592a52,'unitType':this[_0x480749(0x330)],'from':_0x1167da,'to':_0x27ff64}};this[_0x480749(0x223)][_0x480749(0x28a)](_0x31df56,this['unitID']);}};}async['_createInitialStateImpl'](_0x24f58d){const _0x4a8756=_0x280611;var _0x5245f0,_0x57be3f,_0x529a57;const _0x5ab21e=await((_0x5245f0=this['_localCacheService'])===null||_0x5245f0===void 0x0?void 0x0:_0x5245f0[_0x4a8756(0x1c8)](this['unitID'])),_0x5628e3=(_0x57be3f=_0x5ab21e===null||_0x5ab21e===void 0x0?void 0x0:_0x5ab21e[_0x4a8756(0x3a1)])!==null&&_0x57be3f!==void 0x0?_0x57be3f:[],_0xba972e=(_0x529a57=_0x5ab21e===null||_0x5ab21e===void 0x0?void 0x0:_0x5ab21e['awaitingChangeset'])!==null&&_0x529a57!==void 0x0?_0x529a57:null,_0x198092=!!(_0xba972e===null||_0xba972e===void 0x0?void 0x0:_0xba972e[_0x4a8756(0x322)])&&!!(_0xba972e===null||_0xba972e===void 0x0?void 0x0:_0xba972e[_0x4a8756(0x1b9)]);this[_0x4a8756(0x3c2)]=_0x198092?_0xba972e['sid']:(0x0,_univerjs_pro_collaboration[_0x4a8756(0x164)])(),this[_0x4a8756(0x1e0)]=_0x198092?_0xba972e[_0x4a8756(0x1b9)]:0x0;const _0x28cb4a=this[_0x4a8756(0x181)];try{this[_0x4a8756(0x311)](_0xba972e,_0x5628e3);}catch(_0x2b19a5){this[_0x4a8756(0x1eb)][_0x4a8756(0x166)](_0x2b19a5);}const _0x13f861=this['_createHandler']();if(_0x24f58d){const _0x402db8=createOnlineState(this[_0x4a8756(0x240)],_0x28cb4a,this['_type'],_0xba972e,_0x5628e3,_0x13f861);if(_0x402db8 instanceof PendingState)_0x402db8[_0x4a8756(0x335)]();else{if(_0x402db8 instanceof AwaitingWithPendingState||_0x402db8 instanceof AwaitingState)_0x402db8[_0x4a8756(0x357)]();}return _0x402db8;}return this[_0x4a8756(0x240)][_0x4a8756(0x3d6)](OfflineState,_0x28cb4a,this[_0x4a8756(0x330)],_0xba972e,_0x5628e3,_0x13f861);}[_0x280611(0x311)](_0x192e67,_0x14edcb){const _0x44a81b=_0x280611;var _0x349505,_0xce90a1;const _0x285f2f=this['_compressMutationService']['interceptor'][_0x44a81b(0x25a)](this[_0x44a81b(0x2ad)][_0x44a81b(0x399)][_0x44a81b(0x3d9)]()['COMPRESS_MUTATION_APPLY']);(_0x349505=_0x285f2f((_0x192e67===null||_0x192e67===void 0x0?void 0x0:_0x192e67['mutations'])||[],null))===null||_0x349505===void 0x0||_0x349505[_0x44a81b(0x379)](_0x43a479=>this[_0x44a81b(0x349)][_0x44a81b(0x262)](_0x43a479['id'],_0x43a479['params'])),(_0xce90a1=_0x285f2f(_0x14edcb||[],null))===null||_0xce90a1===void 0x0||_0xce90a1[_0x44a81b(0x379)](_0x5be564=>this[_0x44a81b(0x349)][_0x44a81b(0x262)](_0x5be564['id'],_0x5be564[_0x44a81b(0x224)]));}};CollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core['Injector'])),__decorateParam(0x4,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration[_0x280611(0x3ae)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core['LocaleService'])),__decorateParam(0x6,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration['RevisionService'])),__decorateParam(0x7,(0x0,_univerjs_core[_0x280611(0x3d8)])(CollaborationUIEventService)),__decorateParam(0x8,_univerjs_core['IUniverInstanceService']),__decorateParam(0x9,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0xa,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0xb,_univerjs_core['IPermissionService']),__decorateParam(0xc,(0x0,_univerjs_core['Optional'])(ISingleActiveUnitService)),__decorateParam(0xd,(0x0,_univerjs_core[_0x280611(0x29f)])(ILocalCacheService))],CollaborationEntity);let DocCollaborationEntity=class DocCollaborationEntity extends CollaborationEntity{constructor(_0x2b49a0,_0x46509c,_0x5ae816,_0x2653c4,_0x4f3b95,_0x49c3e1,_0x447fff,_0x25b672,_0x4a17d1,_0x186f58,_0x39dda2,_0x302d85,_0x2cfc23,_0x210018){const _0x54d596=_0x280611;super(_0x2b49a0,_0x5ae816,_0x46509c,_0x2653c4,_0x4f3b95,_0x49c3e1,_0x447fff,_0x25b672,_0x4a17d1,_0x186f58,_0x39dda2,_0x302d85,_0x2cfc23,_0x210018),this[_0x54d596(0x181)]=_0x2b49a0,this[_0x54d596(0x148)]=_0x46509c,_defineProperty(this,_0x54d596(0x2dd),null);}[_0x280611(0x2cd)](_0x393cc0){const _0x5cbd99=_0x280611;this[_0x5cbd99(0x2dd)]=_0x393cc0;}[_0x280611(0x3fb)](){const _0x415660=_0x280611;this[_0x415660(0x2dd)]=null,super[_0x415660(0x3fb)]();}[_0x280611(0x1ab)](){const _0x453dd5=_0x280611,_0x41f296=super[_0x453dd5(0x1ab)]();return _0x41f296[_0x453dd5(0x213)]=_0x3d5bae=>{const _0x2c0905=_0x453dd5;var _0x19c678,_0x140f11;return(_0x19c678=this[_0x2c0905(0x2dd)])===null||_0x19c678===void 0x0||(_0x140f11=_0x19c678[_0x2c0905(0x213)])===null||_0x140f11===void 0x0?void 0x0:_0x140f11[_0x2c0905(0x3de)](_0x19c678,_0x3d5bae);},_0x41f296[_0x453dd5(0x37d)]=_0x5bbe80=>{const _0xb6446b=_0x453dd5;var _0xfdf99e,_0x21d83e;return(_0xfdf99e=this[_0xb6446b(0x2dd)])===null||_0xfdf99e===void 0x0||(_0x21d83e=_0xfdf99e[_0xb6446b(0x37d)])===null||_0x21d83e===void 0x0?void 0x0:_0x21d83e['call'](_0xfdf99e,_0x5bbe80);},_0x41f296[_0x453dd5(0x38e)]=_0x7a8a6e=>{const _0x4e2552=_0x453dd5;var _0xb3a4c4,_0x11e09a;return(_0xb3a4c4=this['_handlerCallback'])===null||_0xb3a4c4===void 0x0||(_0x11e09a=_0xb3a4c4[_0x4e2552(0x38e)])===null||_0x11e09a===void 0x0?void 0x0:_0x11e09a['call'](_0xb3a4c4,_0x7a8a6e);},_0x41f296['onSyncEditingCollabCursor']=_0x2b6b64=>{const _0xfcaf58=_0x453dd5;var _0x676ed,_0x920fb5;return(_0x676ed=this['_handlerCallback'])===null||_0x676ed===void 0x0||(_0x920fb5=_0x676ed[_0xfcaf58(0x2b1)])===null||_0x920fb5===void 0x0?void 0x0:_0x920fb5[_0xfcaf58(0x3de)](_0x676ed,_0x2b6b64);},_0x41f296[_0x453dd5(0x1bd)]=_0x1e204a=>{const _0x234f0e=_0x453dd5;var _0x154c70,_0x928778,_0x49abb1;if(!((_0x154c70=this[_0x234f0e(0x2dd)])===null||_0x154c70===void 0x0?void 0x0:_0x154c70[_0x234f0e(0x1bd)]))throw new Error(_0x234f0e(0x26e));return(_0x928778=this[_0x234f0e(0x2dd)])===null||_0x928778===void 0x0||(_0x49abb1=_0x928778[_0x234f0e(0x1bd)])===null||_0x49abb1===void 0x0?void 0x0:_0x49abb1[_0x234f0e(0x3de)](_0x928778,_0x1e204a);},_0x41f296[_0x453dd5(0x1e6)]=_0x11db6e=>{const _0x49b110=_0x453dd5;var _0xf706df,_0x39bc00,_0x523228;if(!((_0xf706df=this[_0x49b110(0x2dd)])===null||_0xf706df===void 0x0?void 0x0:_0xf706df[_0x49b110(0x1e6)]))throw new Error(_0x49b110(0x2c6));return(_0x39bc00=this['_handlerCallback'])===null||_0x39bc00===void 0x0||(_0x523228=_0x39bc00['onTransformRemoteChangesetByStateCache'])===null||_0x523228===void 0x0?void 0x0:_0x523228[_0x49b110(0x3de)](_0x39bc00,_0x11db6e);},_0x41f296;}async[_0x280611(0x266)](){const _0x8fb63d=_0x280611,_0x5835c6=await super[_0x8fb63d(0x266)]();return this[_0x8fb63d(0x14e)](this[_0x8fb63d(0x349)]['onMutationExecutedForCollab']((_0x43ae47,_0x67ba1f)=>{const _0x35e1d9=_0x8fb63d;if(_0x43ae47[_0x35e1d9(0x148)]!==_univerjs_core[_0x35e1d9(0x377)][_0x35e1d9(0x2e0)]||(_0x67ba1f===null||_0x67ba1f===void 0x0?void 0x0:_0x67ba1f[_0x35e1d9(0x2cf)])||(_0x67ba1f===null||_0x67ba1f===void 0x0?void 0x0:_0x67ba1f[_0x35e1d9(0x348)]))return;if(_0x43ae47['id']===_univerjs_docs[_0x35e1d9(0x340)]['id'])return;const _0x4c7fd2=_0x43ae47[_0x35e1d9(0x224)];if((_0x4c7fd2===null||_0x4c7fd2===void 0x0?void 0x0:_0x4c7fd2[_0x35e1d9(0x347)])!==this[_0x35e1d9(0x181)])return;const _0x3068dd=_0x43ae47,_0x8fd53c=this[_0x35e1d9(0x2ad)][_0x35e1d9(0x399)]['fetchThroughInterceptors'](this[_0x35e1d9(0x2ad)][_0x35e1d9(0x399)][_0x35e1d9(0x3d9)]()['COMPRESS_MUTATION_SEND'])([_0x3068dd],this[_0x35e1d9(0x3f4)])||[_0x3068dd];this['_onLocalMutation'](_0x8fd53c[0x0]);})),_0x5835c6;}};DocCollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration[_0x280611(0x3ae)])),__decorateParam(0x5,(0x0,_univerjs_core['Inject'])(_univerjs_core['LocaleService'])),__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration[_0x280611(0x3aa)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x280611(0x3d8)])(CollaborationUIEventService)),__decorateParam(0x8,_univerjs_core['IUniverInstanceService']),__decorateParam(0x9,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0xa,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0xb,_univerjs_core['IPermissionService']),__decorateParam(0xc,(0x0,_univerjs_core[_0x280611(0x29f)])(ISingleActiveUnitService)),__decorateParam(0xd,(0x0,_univerjs_core[_0x280611(0x29f)])(ILocalCacheService))],DocCollaborationEntity);let SheetCollaborationEntity=class SheetCollaborationEntity extends CollaborationEntity{constructor(_0x580853,_0x38f3fd,_0x17d000,_0x2ee41e,_0x9f540e,_0x2c62b1,_0x3af50e,_0x26ade7,_0x4435ef,_0x145c65,_0x324a73,_0x31954c,_0x240de6,_0x13e881,_0x2b3b8f){super(_0x580853,_0x17d000,_0x38f3fd,_0x2ee41e,_0x9f540e,_0x2c62b1,_0x3af50e,_0x4435ef,_0x145c65,_0x324a73,_0x31954c,_0x240de6,_0x13e881,_0x2b3b8f),this['unitID']=_0x580853,this['type']=_0x38f3fd,this['_sheetTransformSelectionsService']=_0x26ade7;}[_0x280611(0x1ab)](){const _0x18b8ba=_0x280611,_0x327c33=super[_0x18b8ba(0x1ab)]();return _0x327c33[_0x18b8ba(0x38e)]=_0x2213e4=>this[_0x18b8ba(0x2f7)]['transformSelections'](_0x2213e4),_0x327c33;}async[_0x280611(0x266)](){const _0x5e6bb9=_0x280611,_0x4e1461=await super[_0x5e6bb9(0x266)]();return this[_0x5e6bb9(0x14e)](this[_0x5e6bb9(0x349)][_0x5e6bb9(0x2ac)]((_0x339005,_0x3589e6)=>{const _0x33c0aa=_0x5e6bb9;if(_0x339005[_0x33c0aa(0x148)]!==_univerjs_core[_0x33c0aa(0x377)]['MUTATION']||(_0x3589e6===null||_0x3589e6===void 0x0?void 0x0:_0x3589e6[_0x33c0aa(0x2cf)])||(_0x3589e6===null||_0x3589e6===void 0x0?void 0x0:_0x3589e6[_0x33c0aa(0x348)]))return;const _0x1ffd7a=_0x339005['params'];if((_0x1ffd7a===null||_0x1ffd7a===void 0x0?void 0x0:_0x1ffd7a['unitId'])!==this['unitID'])return;const _0x3931a6=_0x339005,_0x2884c2=this[_0x33c0aa(0x2ad)]['interceptor'][_0x33c0aa(0x25a)](this[_0x33c0aa(0x2ad)][_0x33c0aa(0x399)][_0x33c0aa(0x3d9)]()['COMPRESS_MUTATION_SEND'])([_0x3931a6],this[_0x33c0aa(0x3f4)])||[_0x3931a6];this[_0x33c0aa(0x2de)](_0x2884c2[0x0]);})),_0x4e1461;}};SheetCollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration[_0x280611(0x3ae)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x271)])),__decorateParam(0x6,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_pro_collaboration['RevisionService'])),__decorateParam(0x7,(0x0,_univerjs_core[_0x280611(0x3d8)])(SheetTransformSelectionsService)),__decorateParam(0x8,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService)),__decorateParam(0x9,_univerjs_core['IUniverInstanceService']),__decorateParam(0xa,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0xb,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0xc,_univerjs_core[_0x280611(0x287)]),__decorateParam(0xd,(0x0,_univerjs_core[_0x280611(0x29f)])(ISingleActiveUnitService)),__decorateParam(0xe,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],SheetCollaborationEntity);const INetworkConditionService=(0x0,_univerjs_core['createIdentifier'])('univer-pro.collaboration-client.network-condition.service');function deserializeToCombResponse(_0x392528){const _0x1d6365=_0x280611,_0x3004a0=_0x392528[_0x1d6365(0x35d)],_0x5d78c0=JSON['parse'](_0x3004a0);switch(_0x5d78c0[_0x1d6365(0x201)]){case _univerjs_protocol[_0x1d6365(0x3ea)][_0x1d6365(0x180)]:case _univerjs_protocol['CombCmd']['HELLO']:{const _0x27fe6b=_0x5d78c0['infoRsp'];return{..._0x5d78c0,'data':_0x27fe6b,'cmd':_0x5d78c0[_0x1d6365(0x201)]};}case _univerjs_protocol[_0x1d6365(0x3ea)][_0x1d6365(0x2db)]:{const _0x48b276=_0x5d78c0[_0x1d6365(0x35b)];return{..._0x5d78c0,'data':_0x48b276,'cmd':_0x5d78c0[_0x1d6365(0x201)]};}case _univerjs_protocol[_0x1d6365(0x3ea)]['RECV']:{const _0x2320fa=_0x5d78c0[_0x1d6365(0x24e)];switch(_0x2320fa[_0x1d6365(0x1ad)]){case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x290)]:var _0x2562fa;return{..._0x5d78c0,'data':{..._0x2320fa,'data':(_0x2562fa=_0x2320fa[_0x1d6365(0x285)])===null||_0x2562fa===void 0x0?void 0x0:_0x2562fa['cs']},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x327)]:var _0x4362b1;return{..._0x5d78c0,'data':{..._0x2320fa,'data':(_0x4362b1=_0x2320fa['csAckEvent'])===null||_0x4362b1===void 0x0?void 0x0:_0x4362b1['cs']},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x20c)]:var _0x1473c4;return{..._0x5d78c0,'data':{..._0x2320fa,'data':(_0x1473c4=_0x2320fa[_0x1d6365(0x3ba)])===null||_0x1473c4===void 0x0?void 0x0:_0x1473c4['cs']},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x1b2)]:var _0x4be318;return{..._0x5d78c0,'data':{..._0x2320fa,'data':(_0x4be318=_0x2320fa['csRejEvent'])===null||_0x4be318===void 0x0?void 0x0:_0x4be318['cs']},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration['CollaborationEvent']['CHANGESET_SHOULD_RETRY']:var _0x372196;return{..._0x5d78c0,'data':{..._0x2320fa,'data':(_0x372196=_0x2320fa[_0x1d6365(0x2af)])===null||_0x372196===void 0x0?void 0x0:_0x372196['cs']},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x34a)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa['updateCursorEvent']},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x1ca)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x25c)]},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x3cc)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x3a8)]},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x234)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x407)]},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x13a)]:case _univerjs_pro_collaboration['CollaborationEvent'][_0x1d6365(0x1dc)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x384)]},'cmd':_0x5d78c0['cmd']};case _univerjs_pro_collaboration['CollaborationEvent'][_0x1d6365(0x135)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x407)]},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x1b0)]:return{..._0x5d78c0,'data':_0x2320fa,'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x28e)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x145)]},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x248)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa['updatePermissionObjEvent']},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x3d5)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x3ce)]},'cmd':_0x5d78c0[_0x1d6365(0x201)]};case _univerjs_pro_collaboration[_0x1d6365(0x282)][_0x1d6365(0x155)]:return{..._0x5d78c0,'data':{..._0x2320fa,'data':_0x2320fa[_0x1d6365(0x1f1)]},'cmd':_0x5d78c0[_0x1d6365(0x201)]};default:return _0x5d78c0;}}default:return _0x5d78c0;}}function serializeCombRequest(_0x1cc0b3){const _0x222a33=_0x280611;switch(_0x1cc0b3[_0x222a33(0x201)]){case _univerjs_protocol[_0x222a33(0x3ea)]['HEARTBEAT']:case _univerjs_protocol['CombCmd'][_0x222a33(0x30d)]:return JSON['stringify']({'cmd':_0x1cc0b3[_0x222a33(0x201)],'routeKey':_0x1cc0b3[_0x222a33(0x21f)]});case _univerjs_protocol[_0x222a33(0x3ea)][_0x222a33(0x162)]:{let _0x202cd6;switch(_0x1cc0b3[_0x222a33(0x35d)][_0x222a33(0x1ad)]){case _univerjs_pro_collaboration['CollaborationEvent'][_0x222a33(0x34a)]:_0x202cd6={'eventID':_univerjs_pro_collaboration[_0x222a33(0x282)]['UPDATE_CURSOR'],'updateCursorEvent':_0x1cc0b3[_0x222a33(0x35d)]['data']};break;case _univerjs_pro_collaboration[_0x222a33(0x282)]['USERS_LEAVE']:_0x202cd6={'eventID':_univerjs_pro_collaboration[_0x222a33(0x282)][_0x222a33(0x3cc)],'leaveEvent':_0x1cc0b3[_0x222a33(0x35d)]['data']};break;case _univerjs_pro_collaboration[_0x222a33(0x282)]['USERS_ENTER']:_0x202cd6={'eventID':_univerjs_pro_collaboration['CollaborationEvent'][_0x222a33(0x1ca)],'joinEvent':_0x1cc0b3[_0x222a33(0x35d)][_0x222a33(0x35d)]};break;case _univerjs_pro_collaboration[_0x222a33(0x282)][_0x222a33(0x234)]:_0x202cd6={'eventID':_univerjs_pro_collaboration['CollaborationEvent'][_0x222a33(0x234)],'liveShareNewHost':_0x1cc0b3['data']['data']};break;case _univerjs_pro_collaboration[_0x222a33(0x282)]['LIVESHARE_OPERATION']:_0x202cd6={'eventID':_univerjs_pro_collaboration[_0x222a33(0x282)][_0x222a33(0x1dc)],'liveShareOperation':_0x1cc0b3[_0x222a33(0x35d)][_0x222a33(0x35d)]};break;case _univerjs_pro_collaboration[_0x222a33(0x282)][_0x222a33(0x135)]:_0x202cd6={'eventID':_univerjs_pro_collaboration[_0x222a33(0x282)][_0x222a33(0x135)],'liveShareTerminate':_0x1cc0b3[_0x222a33(0x35d)]['data']};break;case _univerjs_pro_collaboration[_0x222a33(0x282)][_0x222a33(0x1ce)]:_0x202cd6={'eventID':_univerjs_pro_collaboration['CollaborationEvent']['LIVESHARE_REQUEST_HOST'],'liveShareRequestHost':_0x1cc0b3['data'][_0x222a33(0x35d)]};break;case _univerjs_pro_collaboration[_0x222a33(0x282)]['LIVESHARE_FETCH_OPERATIONS']:_0x202cd6={'eventID':_univerjs_pro_collaboration[_0x222a33(0x282)][_0x222a33(0x13a)]};break;default:_0x202cd6={'eventID':_0x1cc0b3[_0x222a33(0x35d)][_0x222a33(0x1ad)]};}return JSON['stringify']({'cmd':_0x1cc0b3[_0x222a33(0x201)],'routeKey':_0x1cc0b3[_0x222a33(0x21f)],'collaMsg':_0x202cd6});}case _univerjs_protocol[_0x222a33(0x3ea)][_0x222a33(0x2db)]:return JSON['stringify']({'cmd':_0x1cc0b3[_0x222a33(0x201)],'routeKey':_0x1cc0b3[_0x222a33(0x21f)],'joinReq':_0x1cc0b3[_0x222a33(0x35d)]});case _univerjs_protocol[_0x222a33(0x3ea)]['LEAVE']:return JSON['stringify']({'cmd':_0x1cc0b3[_0x222a33(0x201)],'routeKey':_0x1cc0b3[_0x222a33(0x21f)],'leaveReq':_0x1cc0b3['data']});default:throw new Error(_0x222a33(0x158));}}const ICollaborationSocketService=(0x0,_univerjs_core[_0x280611(0x27f)])(_0x280611(0x3f5));function generateSubmitChangesPath(_0x43f7ae,_0x2d94d4,_0x5a1fb8){const _0x41e377=_0x280611;return _0x43f7ae+'/'+_0x2d94d4+'/unit/'+_0x5a1fb8+_0x41e377(0x197);}let CollaborationSocketService=class CollaborationSocketService extends _univerjs_core[_0x280611(0x2e8)]{constructor(_0x3eeea9,_0x55cc23,_0x494c58,_0x32a6a1,_0x52b227){const _0x1c9811=_0x280611;super(),this['_injector']=_0x3eeea9,this['_httpService']=_0x55cc23,this[_0x1c9811(0x273)]=_0x494c58,this[_0x1c9811(0x1eb)]=_0x32a6a1,this[_0x1c9811(0x406)]=_0x52b227;}[_0x280611(0x13b)](_0x159b73){const _0x3cfe52=_0x280611,_0x10e770=this[_0x3cfe52(0x240)][_0x3cfe52(0x206)](_univerjs_network['ISocketService']);if(!_0x10e770)throw new Error(_0x3cfe52(0x1bf));const _0x684721=_0x10e770[_0x3cfe52(0x140)](_0x159b73);if(!_0x684721)throw new Error('[CollaborationSocketService]:\x20failed\x20to\x20create\x20socket!');const _0xd4265c=new _univerjs_core[(_0x3cfe52(0x3dd))](),_0x5dd055=new rxjs[(_0x3cfe52(0x323))]();_0xd4265c[_0x3cfe52(0x2cb)](_0x684721[_0x3cfe52(0x146)][_0x3cfe52(0x23c)](_0x7adf5b=>_0x5dd055[_0x3cfe52(0x3fc)](_0x7adf5b))),_0xd4265c[_0x3cfe52(0x2cb)]((0x0,_univerjs_core['toDisposable'])(()=>_0x5dd055[_0x3cfe52(0x3af)]()));const _0x54111c=new rxjs[(_0x3cfe52(0x323))]();_0xd4265c['add'](_0x684721[_0x3cfe52(0x303)][_0x3cfe52(0x23c)](_0x263dfc=>_0x54111c['next'](_0x263dfc))),_0xd4265c[_0x3cfe52(0x2cb)]((0x0,_univerjs_core[_0x3cfe52(0x270)])(()=>_0x54111c[_0x3cfe52(0x3af)]()));const _0x3df161=new rxjs[(_0x3cfe52(0x323))]();_0xd4265c[_0x3cfe52(0x2cb)](_0x684721[_0x3cfe52(0x2df)][_0x3cfe52(0x23c)](_0x19d525=>{const _0xe81bde=_0x3cfe52,_0x3ee929=deserializeToCombResponse(_0x19d525);_0x3df161[_0xe81bde(0x3fc)](_0x3ee929);})),_0xd4265c[_0x3cfe52(0x2cb)]((0x0,_univerjs_core['toDisposable'])(()=>_0x3df161[_0x3cfe52(0x3af)]()));let _0x4877a2;const _0x608760=()=>{const _0x416df9=_0x3cfe52;_0x54111c[_0x416df9(0x3fc)](new Event('connection\x20error')),_0x5dd055[_0x416df9(0x3fc)](new Event(_0x416df9(0x3fd))),_0x4877a2[_0x416df9(0x371)]();};return _0x4877a2={'memberID':'','close$':_0x5dd055[_0x3cfe52(0x2dc)](),'error$':_0x54111c[_0x3cfe52(0x2dc)](),'open$':_0x684721[_0x3cfe52(0x25b)],'message$':_0x3df161[_0x3cfe52(0x2dc)](),'send':_0x4dbc58=>{const _0x40b783=_0x3cfe52;if(_0x4dbc58['cmd']===_univerjs_protocol[_0x40b783(0x3ea)][_0x40b783(0x162)]){if(_0x4dbc58[_0x40b783(0x35d)]['eventID']===_univerjs_pro_collaboration[_0x40b783(0x282)][_0x40b783(0x2ca)]){this[_0x40b783(0x2f9)](_0x4877a2,_0x4dbc58['data'])[_0x40b783(0x24a)](_0x18bc01=>{const _0x5e2af5=_0x40b783;this[_0x5e2af5(0x1eb)][_0x5e2af5(0x166)](_0x18bc01),_0x608760();});return;}if(_0x4dbc58[_0x40b783(0x35d)]['eventID']===_univerjs_pro_collaboration[_0x40b783(0x282)][_0x40b783(0x1c2)]){const _0x45a341=_0x4dbc58[_0x40b783(0x35d)];this[_0x40b783(0x3ef)](_0x45a341)['then'](_0x134ccf=>{const _0x1e3dd8=_0x40b783;_0x3df161[_0x1e3dd8(0x3fc)]({'cmd':_univerjs_protocol[_0x1e3dd8(0x3ea)]['RECV'],'code':_univerjs_protocol[_0x1e3dd8(0x320)]['OK'],'routeKey':_0x45a341[_0x1e3dd8(0x35d)][_0x1e3dd8(0x181)],'routeType':'','data':{'eventID':_univerjs_pro_collaboration[_0x1e3dd8(0x282)][_0x1e3dd8(0x35e)],'data':{'changesets':_0x134ccf}}});})[_0x40b783(0x24a)](_0x201fde=>{const _0x3abea3=_0x40b783;this[_0x3abea3(0x1eb)][_0x3abea3(0x166)](_0x201fde),_0x608760();});return;}}_0x684721[_0x40b783(0x28a)](serializeCombRequest(_0x4dbc58));},'close':()=>{const _0xa5e6d8=_0x3cfe52;_0x684721[_0xa5e6d8(0x371)](),_0xd4265c[_0xa5e6d8(0x3fb)]();}},_0x4877a2;}async[_0x280611(0x2f9)](_0x322883,_0x2ea812){const _0x1f24be=_0x280611;var _0x5cf495;const {unitType:_0x128f2c,unitID:_0xa7ad7a,changeset:_0xca651c}=_0x2ea812[_0x1f24be(0x35d)],_0x350402={'unitID':_0xa7ad7a,'memberID':_0x322883['memberID'],'type':_0x128f2c,'changeset':(0x0,_univerjs_pro_collaboration[_0x1f24be(0x370)])(_0xca651c)},_0x1019b6=this[_0x1f24be(0x273)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x300ad2=generateSubmitChangesPath((_0x5cf495=_0x1019b6===null||_0x1019b6===void 0x0?void 0x0:_0x1019b6[_0x1f24be(0x232)])!==null&&_0x5cf495!==void 0x0?_0x5cf495:DEFAULT_COLLAB_SUBMIT_CHANGESET_URL,_0x128f2c,_0xa7ad7a);try{await this[_0x1f24be(0x39d)][_0x1f24be(0x3ff)](_0x300ad2,{'body':_0x350402});}catch(_0x31f78d){this[_0x1f24be(0x1eb)][_0x1f24be(0x166)]('[CollaborationSession]',_0x1f24be(0x210));throw _0x31f78d;}}async[_0x280611(0x3ef)](_0x3594c5){const _0x2924b6=_0x280611,{unitID:_0x181233,from:_0x23d4e8,to:_0x4cbcef,unitType:_0x10b1ad}=_0x3594c5[_0x2924b6(0x35d)];return(await this['_snapshotServerService'][_0x2924b6(0x245)]({'metadata':void 0x0},{'unitID':_0x181233,'type':_0x10b1ad,'from':_0x23d4e8,'to':_0x4cbcef}))[_0x2924b6(0x310)][_0x2924b6(0x21c)](_0x406779=>{const _0x40f7f5=_0x2924b6;if(_0x406779[_0x40f7f5(0x3a1)]===null||_0x406779['mutations']===void 0x0)_0x406779[_0x40f7f5(0x3a1)]=[];return _0x406779;});}};CollaborationSocketService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x1,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_network[_0x280611(0x280)])),__decorateParam(0x2,_univerjs_core['IConfigService']),__decorateParam(0x3,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0x4,_univerjs_pro_collaboration[_0x280611(0x331)])],CollaborationSocketService);let CollaborationSessionService=class CollaborationSessionService extends _univerjs_core['Disposable']{get[_0x280611(0x343)](){const _0x1bea1f=_0x280611;return this[_0x1bea1f(0x2ed)][_0x1bea1f(0x34e)]();}constructor(_0x4dbc37,_0x5666d3,_0x396a12,_0x2b61e9,_0x3750a9,_0x2e4918){const _0x587689=_0x280611;super(),this[_0x587689(0x240)]=_0x4dbc37,this[_0x587689(0x1eb)]=_0x5666d3,this[_0x587689(0x273)]=_0x396a12,this[_0x587689(0x1e3)]=_0x2b61e9,this[_0x587689(0x13e)]=_0x3750a9,this[_0x587689(0x35c)]=_0x2e4918,_defineProperty(this,_0x587689(0x2ed),new rxjs[(_0x587689(0x2d0))](void 0x0)),_defineProperty(this,_0x587689(0x16d),this['_socket$']['asObservable']()),_defineProperty(this,_0x587689(0x152),null),_defineProperty(this,_0x587689(0x193),new Map()),_defineProperty(this,_0x587689(0x202),new rxjs[(_0x587689(0x2d0))](0x0)),_defineProperty(this,_0x587689(0x19d),this[_0x587689(0x202)][_0x587689(0x2dc)]()),_defineProperty(this,_0x587689(0x1b7),![]),_defineProperty(this,'_retryConnectingTimer',void 0x0),_defineProperty(this,_0x587689(0x261),0x0),_defineProperty(this,_0x587689(0x1ec),void 0x0),_defineProperty(this,'_timeoutTimer',void 0x0),this[_0x587689(0x1de)]();}[_0x280611(0x1de)](){const _0x5c0e56=_0x280611;if(!this['_networkConditionService'])return;this[_0x5c0e56(0x14e)](this[_0x5c0e56(0x35c)]['online$'][_0x5c0e56(0x23c)](_0x2daf0b=>{const _0x272e82=_0x5c0e56;if(_0x2daf0b&&!this[_0x272e82(0x343)])this['reconnect']();if(!_0x2daf0b)this['_onOffline']();}));}[_0x280611(0x3fb)](){const _0x228297=_0x280611;super[_0x228297(0x3fb)](),this[_0x228297(0x250)](),this[_0x228297(0x259)](),this[_0x228297(0x289)](),this[_0x228297(0x193)]['forEach'](_0x40e1ed=>_0x40e1ed[_0x228297(0x3fb)]()),this[_0x228297(0x193)]['clear'](),this[_0x228297(0x202)][_0x228297(0x3af)]();}async[_0x280611(0x29b)](_0x17f3fe){const _0x7f2e9d=_0x280611;if(this[_0x7f2e9d(0x193)][_0x7f2e9d(0x390)](_0x17f3fe))return this[_0x7f2e9d(0x193)]['get'](_0x17f3fe);this['_tryEnsureSocket']();const _0xaebdb=this[_0x7f2e9d(0x240)]['createInstance'](CollaborationSession,_0x17f3fe,this[_0x7f2e9d(0x2ed)][_0x7f2e9d(0x2dc)]());return this[_0x7f2e9d(0x193)][_0x7f2e9d(0x14a)](_0x17f3fe,_0xaebdb),_0xaebdb;}[_0x280611(0x288)](_0x235de7){const _0x21d82e=_0x280611,_0x361680=this[_0x21d82e(0x193)][_0x21d82e(0x206)](_0x235de7);_0x361680&&(this['_sessions'][_0x21d82e(0x2be)](_0x235de7),_0x361680['close']());if(!this[_0x21d82e(0x193)][_0x21d82e(0x28c)]){var _0x2eb27c;(_0x2eb27c=this[_0x21d82e(0x343)])===null||_0x2eb27c===void 0x0||_0x2eb27c[_0x21d82e(0x371)]();}}['reconnect'](){const _0x1b9411=_0x280611;this[_0x1b9411(0x261)]=0x0,this[_0x1b9411(0x250)](),this[_0x1b9411(0x212)]();}[_0x280611(0x250)](){const _0x3866db=_0x280611;this[_0x3866db(0x177)]!=null&&(clearTimeout(this[_0x3866db(0x177)]),this['_retryConnectingTimer']=null);}async[_0x280611(0x2f6)](){const _0x416217=_0x280611;var _0x454758;const _0x40cb0e=this[_0x416217(0x273)][_0x416217(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x57e1ff=(_0x454758=_0x40cb0e===null||_0x40cb0e===void 0x0?void 0x0:_0x40cb0e[_0x416217(0x3c8)])!==null&&_0x454758!==void 0x0?_0x454758:DEFAULT_COLLAB_WEB_SOCKET_URL,_0x16f2fd=await this['_socketService'][_0x416217(0x140)](_0x57e1ff);return this[_0x416217(0x152)]=_0x16f2fd,_0x16f2fd;}async['_tryEnsureSocket'](){const _0x54a377=_0x280611;try{var _0x5d7e2e,_0x82959e;const _0x110c27=(_0x5d7e2e=(_0x82959e=this[_0x54a377(0x343)])!==null&&_0x82959e!==void 0x0?_0x82959e:this['_candidateSocket'])!==null&&_0x5d7e2e!==void 0x0?_0x5d7e2e:await this[_0x54a377(0x2f6)]();if(_0x110c27){const _0x470ac8=_0x110c27[_0x54a377(0x28a)];_0x110c27['send']=_0x156f5a=>{const _0x36447f=_0x54a377;if(_0x156f5a[_0x36447f(0x201)]!==_univerjs_protocol[_0x36447f(0x3ea)]['LEAVE'])this[_0x36447f(0x2c2)]();return _0x470ac8[_0x36447f(0x191)](_0x110c27,[_0x156f5a]);},_0x110c27[_0x54a377(0x2df)][_0x54a377(0x23c)](_0x426df7=>this[_0x54a377(0x409)](_0x110c27,_0x426df7)),_0x110c27[_0x54a377(0x303)]['pipe']((0x0,rxjs_operators[_0x54a377(0x190)])(0x1))[_0x54a377(0x23c)](_0x3d35f7=>this[_0x54a377(0x1eb)][_0x54a377(0x166)](_0x54a377(0x29d),_0x3d35f7)),_0x110c27['open$'][_0x54a377(0x1d5)]((0x0,rxjs_operators[_0x54a377(0x190)])(0x1))['subscribe'](()=>{this['_onConnectionOpen'](_0x110c27);}),_0x110c27[_0x54a377(0x146)]['pipe']((0x0,rxjs_operators[_0x54a377(0x190)])(0x1))['subscribe'](_0x4cb545=>{const _0x3fe53b=_0x54a377;this[_0x3fe53b(0x1eb)][_0x3fe53b(0x211)](_0x3fe53b(0x207),'socket\x20close',_0x4cb545),this[_0x3fe53b(0x237)]();});}}catch(_0x1aab2c){this[_0x54a377(0x1eb)][_0x54a377(0x166)](_0x1aab2c),this[_0x54a377(0x237)]();}}['_onConnectionOpen'](_0x5a6752){const _0x2902df=_0x280611;this['_logService'][_0x2902df(0x211)](_0x2902df(0x207),_0x2902df(0x408)),_0x5a6752[_0x2902df(0x28a)]({'cmd':_univerjs_protocol['CombCmd']['HELLO']}),this[_0x2902df(0x2c2)]();}[_0x280611(0x267)](){const _0x52d789=_0x280611;this[_0x52d789(0x1b7)]=![],this['_candidateSocket']=null,this[_0x52d789(0x202)][_0x52d789(0x3fc)](0x2),this[_0x52d789(0x2ed)]['next'](null),this['_clearTimeoutTimer'](),this[_0x52d789(0x289)]();}[_0x280611(0x237)](){const _0x53770b=_0x280611;var _0x3fba5b;this['_onOffline']();if(this['_retryCount']<((_0x3fba5b=this['_configService']['getConfig'](_0x53770b(0x392)))!==null&&_0x3fba5b!==void 0x0?_0x3fba5b:0x3))this['_collaborationUIEventService'][_0x53770b(0x3f2)]({'id':_0x53770b(0x383)}),this[_0x53770b(0x212)]();else this[_0x53770b(0x13e)][_0x53770b(0x3f2)]({'id':_0x53770b(0x1d0)});}['_tryReconnect'](){const _0x26d7ee=_0x280611;var _0x3adb15;const _0x7742e4=this['_retryCount'],_0x5b7ef8=this[_0x26d7ee(0x273)][_0x26d7ee(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x4e3f7e=_0x7742e4===0x0?0x0:((_0x3adb15=_0x5b7ef8===null||_0x5b7ef8===void 0x0?void 0x0:_0x5b7ef8[_0x26d7ee(0x156)])!==null&&_0x3adb15!==void 0x0?_0x3adb15:DEFAULT_RETRY_CONNECTING_INTERVAL)*0x2**_0x7742e4;this['_retryConnectingTimer']=setTimeout(()=>{const _0x35fbd6=_0x26d7ee;clearTimeout(this[_0x35fbd6(0x177)]),this['_retryConnectingTimer']=null,this['_tryEnsureSocket']();},_0x4e3f7e),this[_0x26d7ee(0x261)]+=0x1;}['_onMessage'](_0x33d909,_0x1316bb){const _0x45b353=_0x280611,{cmd:_0x1ff556}=_0x1316bb;_0x1ff556===_univerjs_protocol[_0x45b353(0x3ea)]['HELLO']&&!this[_0x45b353(0x1b7)]&&(_0x33d909[_0x45b353(0x3cf)]=_0x1316bb[_0x45b353(0x35d)][_0x45b353(0x3cf)],this[_0x45b353(0x2ed)][_0x45b353(0x3fc)](_0x33d909),this[_0x45b353(0x202)][_0x45b353(0x3fc)](0x3),this['_socketReady']=!![],this[_0x45b353(0x152)]=null);if(_0x1ff556===_univerjs_protocol[_0x45b353(0x3ea)][_0x45b353(0x180)])this[_0x45b353(0x259)]();this[_0x45b353(0x2c2)]();}[_0x280611(0x2c2)](){const _0x320ffe=_0x280611;var _0x550a48;this[_0x320ffe(0x289)](),this[_0x320ffe(0x1ec)]=setTimeout(()=>this[_0x320ffe(0x225)](),(_0x550a48=this[_0x320ffe(0x273)][_0x320ffe(0x1b8)](_0x320ffe(0x147)))!==null&&_0x550a48!==void 0x0?_0x550a48:DEFAULT_HEARTBEAT_INTERVAL);}['_sendHeartbeat'](){const _0x5cb61e=_0x280611;this[_0x5cb61e(0x343)][_0x5cb61e(0x28a)]({'cmd':_univerjs_protocol['CombCmd'][_0x5cb61e(0x180)]}),this[_0x5cb61e(0x337)]();}['_waitForHeartbeatResponse'](){const _0x243c6b=_0x280611;var _0x282ed2;this['_timeoutTimer']=setTimeout(()=>this['_onConnectionFailed'](),(_0x282ed2=this[_0x243c6b(0x273)][_0x243c6b(0x1b8)](_0x243c6b(0x194)))!==null&&_0x282ed2!==void 0x0?_0x282ed2:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x280611(0x289)](){const _0xbed04=_0x280611;this[_0xbed04(0x1ec)]!=null&&(clearTimeout(this[_0xbed04(0x1ec)]),this[_0xbed04(0x1ec)]=null);}['_clearTimeoutTimer'](){const _0x5d82f9=_0x280611;this[_0x5d82f9(0x24d)]!=null&&(clearTimeout(this[_0x5d82f9(0x24d)]),this[_0x5d82f9(0x24d)]=null);}};CollaborationSessionService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x1,_univerjs_core['ILogService']),__decorateParam(0x2,_univerjs_core['IConfigService']),__decorateParam(0x3,ICollaborationSocketService),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService)),__decorateParam(0x5,(0x0,_univerjs_core[_0x280611(0x29f)])(INetworkConditionService))],CollaborationSessionService);let CollaborationController=class CollaborationController extends _univerjs_core[_0x280611(0x3a3)]{constructor(_0x340143,_0xca592e,_0x2643c0,_0x1d854d){const _0x41cc5d=_0x280611;var _0x1bcfef;super(),this[_0x41cc5d(0x240)]=_0x340143,this[_0x41cc5d(0x17a)]=_0xca592e,this[_0x41cc5d(0x273)]=_0x2643c0,this[_0x41cc5d(0x3f4)]=_0x1d854d,_defineProperty(this,_0x41cc5d(0x1f8),new Map()),_defineProperty(this,'_entityInit$',new rxjs[(_0x41cc5d(0x323))]()),_defineProperty(this,_0x41cc5d(0x3e6),this[_0x41cc5d(0x133)][_0x41cc5d(0x2dc)]());if(((_0x1bcfef=this[_0x41cc5d(0x273)][_0x41cc5d(0x1b8)](_0x41cc5d(0x361)))===null||_0x1bcfef===void 0x0?void 0x0:_0x1bcfef[_0x41cc5d(0x2b6)])!==![])this['_init']();}[_0x280611(0x3fb)](){const _0x56f6c4=_0x280611;super[_0x56f6c4(0x3fb)](),this[_0x56f6c4(0x1f8)][_0x56f6c4(0x379)](_0x56681d=>_0x56681d[_0x56f6c4(0x3fb)]()),this[_0x56f6c4(0x1f8)][_0x56f6c4(0x31e)]();}[_0x280611(0x352)](_0x1f25e2){const _0x4276c2=_0x280611;var _0x46e382;return(_0x46e382=this[_0x4276c2(0x1f8)][_0x4276c2(0x206)](_0x1f25e2))!==null&&_0x46e382!==void 0x0?_0x46e382:null;}[_0x280611(0x1bc)](_0x42ff24){const _0x4c03b5=_0x280611,_0x7978a5=this[_0x4c03b5(0x352)](_0x42ff24);if(_0x7978a5)return(0x0,rxjs['of'])(_0x7978a5);return this[_0x4c03b5(0x133)][_0x4c03b5(0x1d5)]((0x0,rxjs_operators[_0x4c03b5(0x160)])(_0x1d55cf=>_0x1d55cf['unitID']===_0x42ff24));}[_0x280611(0x3ab)](_0xec09a){const _0x2a215d=_0x280611;return(0x0,rxjs[_0x2a215d(0x3c6)])(this[_0x2a215d(0x1bc)](_0xec09a)[_0x2a215d(0x1d5)]((0x0,rxjs_operators[_0x2a215d(0x21c)])(()=>void 0x0)));}['_init'](){const _0xc5ef92=_0x280611,_0x3f4239=0x10;this['_univerInstanceService'][_0xc5ef92(0x3b9)](_univerjs_core[_0xc5ef92(0x1db)][_0xc5ef92(0x2c3)])[_0xc5ef92(0x1d5)]((0x0,rxjs[_0xc5ef92(0x1d1)])(this[_0xc5ef92(0x33e)]),(0x0,rxjs_operators[_0xc5ef92(0x264)])(_0x3f4239))[_0xc5ef92(0x23c)](async _0x1f6105=>{const _0x41417b=_0xc5ef92,_0x47aa51=_0x1f6105[_0x41417b(0x354)][_0x41417b(0x296)](),_0x551769=await this[_0x41417b(0x218)](_0x47aa51,_univerjs_core[_0x41417b(0x1db)][_0x41417b(0x2c3)]);this[_0x41417b(0x1f8)][_0x41417b(0x14a)](_0x47aa51,_0x551769);}),this[_0xc5ef92(0x3f4)][_0xc5ef92(0x3b9)](_univerjs_core[_0xc5ef92(0x1db)][_0xc5ef92(0x1d4)])[_0xc5ef92(0x1d5)]((0x0,rxjs[_0xc5ef92(0x1d1)])(this[_0xc5ef92(0x33e)]),(0x0,rxjs_operators['delay'])(_0x3f4239))[_0xc5ef92(0x1d5)]((0x0,rxjs_operators[_0xc5ef92(0x160)])(_0x37f562=>{const _0x1834aa=_0xc5ef92;return!_0x37f562['unit']['getUnitId']()[_0x1834aa(0x3d3)]('__');}))[_0xc5ef92(0x23c)](async _0x54f80e=>{const _0x5c1ccc=_0xc5ef92,_0x3d0d0e=_0x54f80e[_0x5c1ccc(0x354)][_0x5c1ccc(0x296)](),_0xecb3e7=await this['_startCollaboration'](_0x3d0d0e,_univerjs_core[_0x5c1ccc(0x1db)][_0x5c1ccc(0x1d4)]);this['_entities'][_0x5c1ccc(0x14a)](_0x3d0d0e,_0xecb3e7);}),(0x0,rxjs[_0xc5ef92(0x24c)])(this[_0xc5ef92(0x3f4)][_0xc5ef92(0x369)](_univerjs_core[_0xc5ef92(0x1db)][_0xc5ef92(0x2c3)]),this[_0xc5ef92(0x3f4)][_0xc5ef92(0x369)](_univerjs_core[_0xc5ef92(0x1db)][_0xc5ef92(0x1d4)]))[_0xc5ef92(0x1d5)]((0x0,rxjs[_0xc5ef92(0x1d1)])(this[_0xc5ef92(0x33e)]))[_0xc5ef92(0x23c)](_0x3e527f=>{const _0x4b086f=_0xc5ef92,_0x1abc4d=_0x3e527f['getUnitId'](),_0x2c5932=this[_0x4b086f(0x1f8)]['get'](_0x1abc4d);_0x2c5932&&(_0x2c5932[_0x4b086f(0x3fb)](),this[_0x4b086f(0x1f8)][_0x4b086f(0x2be)](_0x1abc4d));});}async[_0x280611(0x218)](_0x29d961,_0x3ccbc4){const _0x3a80ce=_0x280611,_0x4f5750=await this[_0x3a80ce(0x17a)][_0x3a80ce(0x29b)](_0x29d961),_0x1c9500=this[_0x3a80ce(0x240)][_0x3a80ce(0x3d6)](this[_0x3a80ce(0x33a)](_0x3ccbc4),_0x29d961,_0x3ccbc4,_0x4f5750);return await _0x1c9500['init'](),this[_0x3a80ce(0x133)]['next'](_0x1c9500),_0x1c9500;}[_0x280611(0x33a)](_0x996bed){const _0x1fd3d3=_0x280611;switch(_0x996bed){case _univerjs_core[_0x1fd3d3(0x1db)][_0x1fd3d3(0x1d4)]:return DocCollaborationEntity;case _univerjs_core['UniverInstanceType'][_0x1fd3d3(0x2c3)]:return SheetCollaborationEntity;default:throw new Error(_0x1fd3d3(0x2d4)+_0x996bed);}}};CollaborationController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x280611(0x3d8)])(CollaborationSessionService)),__decorateParam(0x2,_univerjs_core[_0x280611(0x2f5)]),__decorateParam(0x3,_univerjs_core[_0x280611(0x3d4)])],CollaborationController);var name=_0x280611(0x255),version=_0x280611(0x22c);const DEFAULT_FILE_NAME_KEY=_0x280611(0x36a),UNIVER_DEFAULT_FILE_NAME=_0x280611(0x257);let FileNameController=class FileNameController extends _univerjs_core[_0x280611(0x2e8)]{constructor(_0x31d121,_0x38314b){const _0x28a6b0=_0x280611;super(),this[_0x28a6b0(0x3f4)]=_0x31d121,this[_0x28a6b0(0x273)]=_0x38314b,this[_0x28a6b0(0x266)]();}[_0x280611(0x266)](){const _0x51d2a3=_0x280611;this[_0x51d2a3(0x14e)](this[_0x51d2a3(0x3f4)][_0x51d2a3(0x37b)][_0x51d2a3(0x23c)](()=>{const _0x322edc=_0x51d2a3;var _0x289ce9;const _0x82d74d=this[_0x322edc(0x3f4)][_0x322edc(0x17e)]();let _0x18cf25=(_0x289ce9=this['_configService']['getConfig'](_0x322edc(0x36a)))!==null&&_0x289ce9!==void 0x0?_0x289ce9:UNIVER_DEFAULT_FILE_NAME;if(_0x82d74d instanceof _univerjs_core['Workbook'])_0x18cf25=_0x82d74d[_0x322edc(0x29c)];document['title']=_0x18cf25;}));}};FileNameController=__decorate([__decorateParam(0x0,_univerjs_core[_0x280611(0x3d4)]),__decorateParam(0x1,_univerjs_core[_0x280611(0x2f5)])],FileNameController);let AuthServerService=class AuthServerService{constructor(_0x35165c,_0xe077a0,_0x3f2b06){const _0x5a73ef=_0x280611;this['_configService']=_0x35165c,this[_0x5a73ef(0x39d)]=_0xe077a0,this['localeService']=_0x3f2b06,this[_0x5a73ef(0x15d)]();}[_0x280611(0x15d)](){const _0x40a101=_0x280611;this['_httpService'][_0x40a101(0x25d)]({'priority':0x1,'interceptor':(_0x311f2f,_0x2526a3)=>{const _0x3f2bd2=_0x40a101;return _0x2526a3(_0x311f2f)[_0x3f2bd2(0x1d5)]((0x0,rxjs['concatMap'])(async _0x5b0a29=>{const _0x573278=_0x3f2bd2,_0x37560c=_0x5b0a29;if(_0x37560c[_0x573278(0x34c)]===0x191){if(typeof window===_0x573278(0x38b))throw new Error('[AuthServerService]:\x20you\x20should\x20provide\x20authentication\x20info\x20on\x20Node.js.');if(window[_0x573278(0x31a)](this['localeService']['t'](_0x573278(0x215)))){const _0x4ab86f=window[_0x573278(0x1f0)](window[_0x573278(0x1d2)][_0x573278(0x276)]);window['location'][_0x573278(0x276)]=this[_0x573278(0x2d8)]()+'?url='+_0x4ab86f;}}return _0x37560c;}));}});}[_0x280611(0x2d8)](){const _0x5a5c9e=_0x280611;var _0x130388;const _0x144eb0=this[_0x5a5c9e(0x273)][_0x5a5c9e(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x130388=_0x144eb0===null||_0x144eb0===void 0x0?void 0x0:_0x144eb0[_0x5a5c9e(0x2b4)])!==null&&_0x130388!==void 0x0?_0x130388:DEFAULT_LOGIN_URL;}};AuthServerService=__decorate([__decorateParam(0x0,_univerjs_core[_0x280611(0x2f5)]),__decorateParam(0x1,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_network[_0x280611(0x280)])),__decorateParam(0x2,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x280611(0x271)]))],AuthServerService);const DEFAULT_AUTHZ_URL_KEY$1=_0x280611(0x2ff);let AuthzIoHttpService=class AuthzIoHttpService extends _univerjs_core[_0x280611(0x2e8)]{constructor(_0x5bef29,_0x41b004){const _0x11d916=_0x280611;super(),this[_0x11d916(0x254)]=_0x5bef29,this['_configService']=_0x41b004,_defineProperty(this,_0x11d916(0x1a9),![]),this[_0x11d916(0x365)]();}[_0x280611(0x365)](){const _0x1783e3=_0x280611,_0x46e79d=this;this[_0x1783e3(0x14e)](this[_0x1783e3(0x254)][_0x1783e3(0x25d)]({'priority':0x3e7,'interceptor':(0x0,_univerjs_network[_0x1783e3(0x3a5)])({'isMatch'(_0x4e9d63){const _0xd4c529=_0x1783e3;var _0x564633;if(_0x4e9d63[_0xd4c529(0x387)]===_0xd4c529(0x23e)&&((_0x564633=_0x4e9d63[_0xd4c529(0x293)])===null||_0x564633===void 0x0?void 0x0:_0x564633[_0xd4c529(0x342)])){const {objectID:_0x3d32fd,objectType:_0x355679}=_0x4e9d63['requestParams'][_0xd4c529(0x342)]||{};if(!_0x3d32fd||_0x355679===void 0x0)return![];const _0x4f8073=_0x46e79d['_getAPIPrefixPath']()+'/'+_0x355679+_0xd4c529(0x2c4)+_0x3d32fd+_0xd4c529(0x278);if(_0x4e9d63[_0xd4c529(0x402)]===_0x4f8073)return!![];}return![];},'getParamsFromRequest'(_0x2602e1){const _0xce31fc=_0x1783e3;var _0x27314f;return(_0x27314f=_0x2602e1['requestParams'])===null||_0x27314f===void 0x0?void 0x0:_0x27314f[_0xce31fc(0x342)];},'mergeParamsToRequest'(_0x108297,_0x1f89c2){const _0x4446e0=_0x1783e3,_0x34093f=_0x46e79d[_0x4446e0(0x277)]()+_0x4446e0(0x1a6),_0x3918e4=_0x108297[_0x4446e0(0x1e1)]((_0xc494df,_0x5067d7)=>{const _0x1d59c9=_0x4446e0,{unitID:_0x1ff0c8,objectID:_0xec536b,objectType:_0x53a7ac,actions:_0x17bb82}=_0x5067d7;if(!_0xc494df[_0x1ff0c8])_0xc494df[_0x1ff0c8]={};if(!_0xc494df[_0x1ff0c8][_0xec536b])_0xc494df[_0x1ff0c8][_0xec536b]={'objectID':_0xec536b,'objectType':_0x53a7ac,'actions':[]};return _0xc494df[_0x1ff0c8][_0xec536b][_0x1d59c9(0x1e9)][_0x1d59c9(0x1c7)](..._0x17bb82),_0xc494df;},{}),_0x451188=[];for(const _0x27faf9 in _0x3918e4)for(const _0x24fdd5 in _0x3918e4[_0x27faf9]){const {actions:_0x4bfc45,objectType:_0xf8d81c}=_0x3918e4[_0x27faf9][_0x24fdd5],_0x44c6dc=[...new Set(_0x4bfc45)];_0x451188['push']({'unitID':_0x27faf9,'objectID':_0x24fdd5,'objectType':_0xf8d81c,'actions':_0x44c6dc});}return new _univerjs_network[(_0x4446e0(0x35a))](_0x4446e0(0x23e),_0x34093f,{'headers':_0x1f89c2[_0x4446e0(0x263)],'withCredentials':_0x1f89c2[_0x4446e0(0x1d3)],'responseType':_0x1f89c2['responseType'],'body':{'requests':_0x451188}});}},{'distributeResult'(_0x313dd3,_0x2a239d){const {objectActions:_0x60d7dd}=_0x313dd3;return _0x2a239d['map'](_0x5485f4=>{const _0x371f57=_0xed3c,{unitID:_0x59bd51,objectID:_0x8bb0fe,actions:_0x5cbbc3}=_0x5485f4,_0x5c57ae=_0x60d7dd['find'](_0x553551=>_0x553551[_0x371f57(0x181)]===_0x59bd51&&_0x553551['objectID']===_0x8bb0fe);return{'config':_0x5485f4,'result':{'actions':_0x5cbbc3[_0x371f57(0x21c)](_0x19adb8=>_0x5c57ae===null||_0x5c57ae===void 0x0?void 0x0:_0x5c57ae[_0x371f57(0x1e9)][_0x371f57(0x396)](_0x4d906d=>_0x4d906d[_0x371f57(0x22a)]===_0x19adb8))[_0x371f57(0x160)](_0x30404d=>!!_0x30404d),'error':_0x313dd3[_0x371f57(0x166)]}};});}})}));}[_0x280611(0x277)](){const _0x5018ec=_0x280611;var _0x69c537;const _0x2f7eea=this[_0x5018ec(0x273)][_0x5018ec(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x69c537=_0x2f7eea===null||_0x2f7eea===void 0x0?void 0x0:_0x2f7eea[_0x5018ec(0x15f)])!==null&&_0x69c537!==void 0x0?_0x69c537:DEFAULT_AUTHZ_URL_KEY$1;}async[_0x280611(0x3a7)](_0x1de25d){const _0x630695=_0x280611,_0x18fabf=this['_getAPIPrefixPath']()+'/'+_0x1de25d[_0x630695(0x2bf)]+'/object';return(await this[_0x630695(0x254)]['post'](_0x18fabf,{'body':_0x1de25d}))[_0x630695(0x342)]['objectID']||'';}async['list'](_0x152afa){const _0x133079=_0x280611,_0x4ac2b3=this['_getAPIPrefixPath']()+'/-/object/list';return(await this['_HTTPService']['post'](_0x4ac2b3,{'body':_0x152afa}))['body'][_0x133079(0x1cb)];}async[_0x280611(0x397)](_0x1d1241){const _0x477547=_0x280611;var _0x5019e0;const _0x20eb5c=this[_0x477547(0x277)]()+'/'+_0x1d1241[_0x477547(0x2bf)]+_0x477547(0x2c4)+_0x1d1241[_0x477547(0x308)],_0x5a3fdb=await this['_HTTPService'][_0x477547(0x167)](_0x20eb5c,{'body':_0x1d1241});if((_0x5a3fdb===null||_0x5a3fdb===void 0x0||(_0x5019e0=_0x5a3fdb['body'])===null||_0x5019e0===void 0x0||(_0x5019e0=_0x5019e0[_0x477547(0x166)])===null||_0x5019e0===void 0x0?void 0x0:_0x5019e0[_0x477547(0x17c)])!==0x1)throw new Error(_0x477547(0x334));}async[_0x280611(0x1a0)](_0x4e0582){const _0x3ff722=_0x280611,_0x12e30e=this[_0x3ff722(0x277)]()+'/'+_0x4e0582[_0x3ff722(0x2bf)]+_0x3ff722(0x2c4)+_0x4e0582[_0x3ff722(0x308)]+_0x3ff722(0x278);return(await this['_HTTPService'][_0x3ff722(0x3ff)](_0x12e30e,{'body':_0x4e0582}))['body'][_0x3ff722(0x1e9)];}async[_0x280611(0x18a)](_0x29d59c){const _0x2b49b6=_0x280611,_0x542e54=this[_0x2b49b6(0x277)]()+_0x2b49b6(0x1a6);return(await this[_0x2b49b6(0x254)][_0x2b49b6(0x3ff)](_0x542e54,{'body':{'requests':_0x29d59c}}))[_0x2b49b6(0x342)]['objectActions'];}async[_0x280611(0x1bb)](_0x2801cd){const _0x580470=_0x280611,_0x2c349b=this[_0x580470(0x277)]()+'/'+_0x2801cd[_0x580470(0x2bf)]+'/role',_0x42022d=await this[_0x580470(0x254)][_0x580470(0x3ff)](_0x2c349b,{'body':_0x2801cd});return{'roles':_0x42022d['body'][_0x580470(0x3c1)],'actions':_0x42022d[_0x580470(0x342)][_0x580470(0x1e9)]};}async['deleteCollaborator'](_0x2d7e52){const _0x458307=_0x280611,_0x9fd108=this['_getAPIPrefixPath']()+_0x458307(0x33d);await this[_0x458307(0x254)][_0x458307(0x2be)](_0x9fd108,{'params':{'collaboratorID':_0x2d7e52[_0x458307(0x214)],'objectID':_0x2d7e52['objectID'],'unitID':_0x2d7e52[_0x458307(0x181)]}});}async[_0x280611(0x37a)](_0x150bfd){const _0x295c0c=_0x280611,_0x5e1f33=this[_0x295c0c(0x277)]()+'/collaborator';await this[_0x295c0c(0x254)][_0x295c0c(0x38c)](_0x5e1f33,{'body':_0x150bfd});}async[_0x280611(0x20f)](_0x4dc6de){const _0x5c48e4=_0x280611,_0xa6c353=this['_getAPIPrefixPath']()+_0x5c48e4(0x33d);await this[_0x5c48e4(0x254)][_0x5c48e4(0x3ff)](_0xa6c353,{'body':_0x4dc6de});}async[_0x280611(0x178)](_0x52780f){const _0x273b1f=_0x280611;var _0x2432fc;const _0x596126=this[_0x273b1f(0x277)]()+_0x273b1f(0x33d),_0x4ca163=await this[_0x273b1f(0x254)][_0x273b1f(0x206)](_0x596126,{'params':{'objectID':_0x52780f['objectID'],'unitID':_0x52780f[_0x273b1f(0x181)]}});return this[_0x273b1f(0x3e0)]((_0x2432fc=_0x4ca163[_0x273b1f(0x342)][_0x273b1f(0x336)])!==null&&_0x2432fc!==void 0x0?_0x2432fc:![]),_0x4ca163[_0x273b1f(0x342)][_0x273b1f(0x16b)];}async[_0x280611(0x1af)](_0x2a3b17){const _0x345d58=_0x280611,_0x10a0c2=this[_0x345d58(0x277)]()+_0x345d58(0x33d);await this[_0x345d58(0x254)][_0x345d58(0x167)](_0x10a0c2,{'body':_0x2a3b17});}[_0x280611(0x3e0)](_0x375706){this['_cfgEnableObjInherit']=_0x375706;}['getCfgEnableObjInherit'](){return this['_cfgEnableObjInherit'];}};AuthzIoHttpService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_network[_0x280611(0x280)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x2f5)]))],AuthzIoHttpService);function base64ToBytes(_0x5df22b){const _0x5a879d=_0x280611,_0xa56fff=atob(_0x5df22b),_0x3ff6bf=new Uint8Array(_0xa56fff['length']);for(let _0x406baa=0x0;_0x406baa<_0xa56fff['length'];_0x406baa++)_0x3ff6bf[_0x406baa]=_0xa56fff[_0x5a879d(0x1b4)](_0x406baa);return _0x3ff6bf;}function bytesToBase64(_0x49c588){const _0x2dc48a=_0x280611;let _0x583f88='';for(let _0x10f11b=0x0;_0x10f11b<_0x49c588[_0x2dc48a(0x182)];_0x10f11b++)_0x583f88+=String['fromCharCode'](_0x49c588[_0x10f11b]);return btoa(_0x583f88);}function encrypt(_0x5d2e65,_0x1d5d1e){const _0x5dc56c=_0x280611,_0x4c1466=base64ToBytes(_0x1d5d1e),_0x392188=(0x0,_noble_ciphers_utils_js[_0x5dc56c(0x1ea)])(0x10);return bytesToBase64((0x0,_noble_ciphers_utils_js[_0x5dc56c(0x229)])(_0x392188,(0x0,_noble_ciphers_aes_js[_0x5dc56c(0x20a)])(_0x4c1466,_0x392188)[_0x5dc56c(0x355)]((0x0,_noble_ciphers_utils_js['utf8ToBytes'])(_0x5d2e65))));}function getAttachHeader(){const _0x5baf0b=_0x280611,_0x5e6b0e=(0x0,_univerjs_pro_license[_0x5baf0b(0x1f3)])()[_0x5baf0b(0x1e4)];if(typeof window!==_0x5baf0b(0x38b)&&typeof window[_0x5baf0b(0x1d2)]!=='undefined'&&_0x5e6b0e){const _0x424f55={'time':Math[_0x5baf0b(0x242)](Date['now']()/0x3e8),'domain':location[_0x5baf0b(0x389)]};return encrypt(JSON[_0x5baf0b(0x241)](_0x424f55),_0x5e6b0e);}}let DomainRequestService=class DomainRequestService{constructor(_0x43ba26){const _0x62cd3b=_0x280611;this['_httpService']=_0x43ba26,this[_0x62cd3b(0x305)]();}[_0x280611(0x305)](){const _0x2ad51f=_0x280611;this[_0x2ad51f(0x39d)][_0x2ad51f(0x25d)]({'interceptor':(_0xd422df,_0x28be8b)=>{const _0x329549=_0x2ad51f,_0x1fff20=getAttachHeader();if(_0x1fff20)_0xd422df[_0x329549(0x263)][_0x329549(0x14a)](_0x329549(0x2b8),_0x1fff20);return _0x28be8b(_0xd422df);}});}};DomainRequestService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_network[_0x280611(0x280)]))],DomainRequestService);let DataLoaderService=class DataLoaderService extends _univerjs_core[_0x280611(0x3a3)]{constructor(_0x555c51,_0x569c9f,_0x50e3e7){const _0x48d1b9=_0x280611;super(),this['_logService']=_0x555c51,this[_0x48d1b9(0x26c)]=_0x569c9f,this['_localCacheService']=_0x50e3e7,_defineProperty(this,'_unitInfo$',new rxjs[(_0x48d1b9(0x2d0))](null)),_defineProperty(this,_0x48d1b9(0x2e5),this[_0x48d1b9(0x3e5)][_0x48d1b9(0x2dc)]());}async['loadUnitOfRevision'](_0x4e1683,_0x592026,_0x244bd3){const _0x2694c0=_0x280611;this[_0x2694c0(0x3e5)]['next']({'unitId':_0x4e1683,'type':_0x592026});let _0x57a895=null;switch(_0x592026){case _univerjs_core[_0x2694c0(0x1db)][_0x2694c0(0x2c3)]:_0x57a895=await this['_snapshotService']['loadSheet'](_0x4e1683,_0x244bd3);break;case _univerjs_core[_0x2694c0(0x1db)]['UNIVER_DOC']:_0x57a895=await this[_0x2694c0(0x26c)][_0x2694c0(0x1ef)](_0x4e1683,_0x244bd3);break;default:this[_0x2694c0(0x1eb)][_0x2694c0(0x166)]('[DataLoaderService]',_0x2694c0(0x29a));break;}return _0x57a895;}async[_0x280611(0x37e)](_0x336ca5,_0x217580,_0x251361){const _0x3663b7=_0x280611;var _0x3cab84;this[_0x3663b7(0x3e5)][_0x3663b7(0x3fc)]({'unitId':_0x336ca5,'type':_0x217580,'subUnitId':_0x251361});let _0x248e42=0x0;const _0x35458e=await((_0x3cab84=this['_localCacheService'])===null||_0x3cab84===void 0x0?void 0x0:_0x3cab84[_0x3663b7(0x1c8)](_0x336ca5));if(_0x35458e&&(_0x35458e[_0x3663b7(0x1ee)]||_0x35458e[_0x3663b7(0x3a1)][_0x3663b7(0x182)]!==0x0))_0x248e42=_0x35458e[_0x3663b7(0x26f)];if(_0x248e42===0x0)this[_0x3663b7(0x1eb)][_0x3663b7(0x211)](_0x3663b7(0x238),_0x3663b7(0x2fc));return this[_0x3663b7(0x2c0)](_0x336ca5,_0x217580,_0x248e42);}};DataLoaderService=__decorate([__decorateParam(0x0,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration['SnapshotService'])),__decorateParam(0x2,(0x0,_univerjs_core[_0x280611(0x29f)])(ILocalCacheService))],DataLoaderService);const DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY=_0x280611(0x346),DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY=_0x280611(0x200);let CollaborationImageIoService=class CollaborationImageIoService{constructor(_0x457a45,_0x6d8789,_0x3f2f16){const _0x5beb69=_0x280611;this[_0x5beb69(0x39d)]=_0x457a45,this[_0x5beb69(0x273)]=_0x6d8789,this[_0x5beb69(0x3f4)]=_0x3f2f16,_defineProperty(this,_0x5beb69(0x2b7),0x0),_defineProperty(this,_0x5beb69(0x17b),new rxjs[(_0x5beb69(0x323))]()),_defineProperty(this,_0x5beb69(0x2ea),this[_0x5beb69(0x17b)]),_defineProperty(this,'_imageSourceCache',new Map());}[_0x280611(0x376)](_0x2d682e){const _0x1e1107=_0x280611;this[_0x1e1107(0x2b7)]=_0x2d682e,this[_0x1e1107(0x17b)][_0x1e1107(0x3fc)](_0x2d682e);}['getImageSourceCache'](_0x5459e2,_0x2f6352){const _0x2f892e=_0x280611;if(_0x2f6352===_univerjs_drawing['ImageSourceType'][_0x2f892e(0x3c9)]){const _0x6532b2=new Image();return _0x6532b2[_0x2f892e(0x3c7)]=_0x5459e2,_0x6532b2;}return this[_0x2f892e(0x316)][_0x2f892e(0x206)](_0x5459e2);}['addImageSourceCache'](_0x35be35,_0x28e819,_0x9edcf0){const _0x3509ea=_0x280611;if(_0x28e819===_univerjs_drawing[_0x3509ea(0x27d)][_0x3509ea(0x3c9)]||_0x9edcf0==null)return;this[_0x3509ea(0x316)][_0x3509ea(0x14a)](_0x35be35,_0x9edcf0);}async['getImage'](_0x411f41){const _0x5ddf66=_0x280611;try{const _0x2f0b7d=this['_replaceFileID'](this[_0x5ddf66(0x203)](),''+_0x411f41),_0x1a98e2=(await this['_httpService'][_0x5ddf66(0x206)](_0x2f0b7d))[_0x5ddf66(0x342)];if(_0x1a98e2[_0x5ddf66(0x166)]&&_0x1a98e2[_0x5ddf66(0x166)]['code']===_univerjs_protocol[_0x5ddf66(0x268)]['OK']){const _0x49d1b0=(0x0,_univerjs_core['resolveWithBasePath'])(_0x1a98e2['url'],this[_0x5ddf66(0x209)]());return Promise[_0x5ddf66(0x3e7)](_0x49d1b0);}return Promise[_0x5ddf66(0x1f7)](_0x1a98e2[_0x5ddf66(0x166)]);}catch(_0x44f249){return Promise['reject'](_0x44f249);}}async[_0x280611(0x1d9)](_0x6cb55){const _0x403d0f=_0x280611;let _0xedf1c6='';if(!_univerjs_drawing[_0x403d0f(0x30f)][_0x403d0f(0x23d)](_0x6cb55[_0x403d0f(0x148)]))return this[_0x403d0f(0x353)](),Promise['reject'](new Error(_univerjs_drawing['ImageUploadStatusType'][_0x403d0f(0x373)]));if(_0x6cb55['size']>(0x0,_univerjs_drawing[_0x403d0f(0x233)])())return this[_0x403d0f(0x353)](),Promise[_0x403d0f(0x1f7)](new Error(_univerjs_drawing[_0x403d0f(0x176)][_0x403d0f(0x2c1)]));try{const _0x5af6a0=new FormData();_0x5af6a0[_0x403d0f(0x249)](_0x403d0f(0x179),_0x6cb55);const _0x991d7a=this['_univerInstanceService'][_0x403d0f(0x17e)](),_0x366e58=_0x991d7a===null||_0x991d7a===void 0x0?void 0x0:_0x991d7a[_0x403d0f(0x296)]();if(!_0x366e58)throw new Error('unitId\x20is\x20not\x20found');const _0x4147ef=this['_getUploadFileURL']()+'?size='+_0x6cb55['size'][_0x403d0f(0x404)]()+_0x403d0f(0x33f)+_univerjs_protocol[_0x403d0f(0x2cc)]['UnitEmbedded']+_0x403d0f(0x1e7)+encodeURIComponent(_0x366e58),_0x2174e7={'body':_0x5af6a0},_0x179b78=(await this['_httpService'][_0x403d0f(0x3ff)](_0x4147ef,_0x2174e7))['body'];if(typeof _0x179b78[_0x403d0f(0x23b)]!==_0x403d0f(0x22e))return this[_0x403d0f(0x353)](),Promise['reject'](new Error(_univerjs_drawing[_0x403d0f(0x176)][_0x403d0f(0x2c8)]));_0xedf1c6=_0x179b78[_0x403d0f(0x23b)];}catch(_0x208214){return this['_decreaseWaiting'](),Promise[_0x403d0f(0x1f7)](new Error(_univerjs_drawing['ImageUploadStatusType'][_0x403d0f(0x2c8)]));}return new Promise((_0x51da50,_0x3a397b)=>{const _0x198707=_0x403d0f,_0x4f52e5=new FileReader();_0x4f52e5[_0x198707(0x1e2)](_0x6cb55),_0x4f52e5['onload']=_0x51f010=>{const _0x150b3b=_0x198707;var _0xde09aa;const _0x1fbcc5=(_0xde09aa=_0x51f010[_0x150b3b(0x359)])===null||_0xde09aa===void 0x0?void 0x0:_0xde09aa['result'];if(_0x1fbcc5==null){this[_0x150b3b(0x353)](),_0x3a397b(new Error(_univerjs_drawing[_0x150b3b(0x176)][_0x150b3b(0x2c8)]));return;}_0x51da50({'imageId':(0x0,_univerjs_core['generateRandomId'])(0x6),'imageSourceType':_univerjs_drawing['ImageSourceType']['UUID'],'source':_0xedf1c6,'base64Cache':_0x1fbcc5,'status':_univerjs_drawing[_0x150b3b(0x176)][_0x150b3b(0x344)]}),this[_0x150b3b(0x353)]();};});}[_0x280611(0x2d7)](){const _0xec8f91=_0x280611;var _0x261361;const _0x459205=this[_0xec8f91(0x273)][_0xec8f91(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x261361=_0x459205===null||_0x459205===void 0x0?void 0x0:_0x459205[_0xec8f91(0x2da)])!==null&&_0x261361!==void 0x0?_0x261361:DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY;}[_0x280611(0x203)](){const _0x3b4c54=_0x280611;var _0x587c57;const _0x437bfb=this[_0x3b4c54(0x273)][_0x3b4c54(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x587c57=_0x437bfb===null||_0x437bfb===void 0x0?void 0x0:_0x437bfb[_0x3b4c54(0x204)])!==null&&_0x587c57!==void 0x0?_0x587c57:DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY;}[_0x280611(0x209)](){const _0x1dd95a=_0x280611;var _0x6050f9;const _0x20b081=this[_0x1dd95a(0x273)][_0x1dd95a(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x6050f9=_0x20b081===null||_0x20b081===void 0x0?void 0x0:_0x20b081[_0x1dd95a(0x189)])!==null&&_0x6050f9!==void 0x0?_0x6050f9:location[_0x1dd95a(0x2d9)];}[_0x280611(0x1a7)](_0x2b019b,_0x5c8dd3){const _0x52d342=_0x280611;return _0x2b019b[_0x52d342(0x3b7)](_0x52d342(0x1a3),_0x5c8dd3);}[_0x280611(0x353)](){const _0x10c449=_0x280611;this[_0x10c449(0x2b7)]-=0x1,this[_0x10c449(0x17b)][_0x10c449(0x3fc)](this[_0x10c449(0x2b7)]);}};CollaborationImageIoService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_network['HTTPService'])),__decorateParam(0x1,_univerjs_core[_0x280611(0x2f5)]),__decorateParam(0x2,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core[_0x280611(0x3d4)]))],CollaborationImageIoService);const DEFAULT_AUTHZ_URL_KEY=_0x280611(0x2ff);let MentionIoHttpService=class MentionIoHttpService{constructor(_0x4abcb1,_0x2d627a){const _0x42d74d=_0x280611;this[_0x42d74d(0x273)]=_0x4abcb1,this['_HTTPService']=_0x2d627a;}[_0x280611(0x277)](){const _0x46efeb=_0x280611;var _0x49eded;const _0x34483c=this[_0x46efeb(0x273)][_0x46efeb(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x49eded=_0x34483c===null||_0x34483c===void 0x0?void 0x0:_0x34483c[_0x46efeb(0x15f)])!==null&&_0x49eded!==void 0x0?_0x49eded:DEFAULT_AUTHZ_URL_KEY;}async['list'](_0x13b821){const _0x1aded4=_0x280611,_0x114e3c=this[_0x1aded4(0x277)]()+'/collaborator';return{'list':[{'title':'People','mentions':(await this[_0x1aded4(0x254)][_0x1aded4(0x206)](_0x114e3c,{'params':{'objectID':_0x13b821[_0x1aded4(0x347)],'unitID':_0x13b821['unitId']}}))[_0x1aded4(0x342)][_0x1aded4(0x16b)][_0x1aded4(0x21c)](_0x42e37f=>({'objectId':_0x42e37f['id'],'name':_0x42e37f['subject'][_0x1aded4(0x29c)],'metadata':{'icon':_0x42e37f['subject'][_0x1aded4(0x3d2)]},'label':_0x42e37f[_0x1aded4(0x256)][_0x1aded4(0x29c)],'objectType':_univerjs_core[_0x1aded4(0x1cc)][_0x1aded4(0x339)]})),'metadata':{},'type':_univerjs_core['MentionType'][_0x1aded4(0x339)]}]};}};MentionIoHttpService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core['IConfigService'])),__decorateParam(0x1,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_network['HTTPService']))],MentionIoHttpService);let PermissionService=class PermissionService extends _univerjs_core[_0x280611(0x3a3)]{constructor(_0xdf5689,_0xb8ad92,_0x3959d0,_0x37e36d,_0x453871){const _0x34472c=_0x280611;super(),this[_0x34472c(0x240)]=_0xdf5689,this[_0x34472c(0x3f4)]=_0xb8ad92,this['_permissionService']=_0x3959d0,this['_collaborationSessionService']=_0x37e36d,this['_collaborationUIEventService']=_0x453871,this[_0x34472c(0x1a1)](),this['_initCloseConn']();}[_0x280611(0x299)](){const _0x113810=_0x280611,_0x8babed=async _0x470c26=>{const _0x3d18bd=_0xed3c;(await this[_0x3d18bd(0x386)][_0x3d18bd(0x29b)](_0x470c26))[_0x3d18bd(0x138)][_0x3d18bd(0x1d5)]((0x0,rxjs_operators[_0x3d18bd(0x160)])(_0x319a27=>_0x319a27[_0x3d18bd(0x1ad)]===_univerjs_pro_collaboration[_0x3d18bd(0x282)][_0x3d18bd(0x3d5)]),(0x0,rxjs_operators[_0x3d18bd(0x1d1)])(this['dispose$']))[_0x3d18bd(0x23c)](_0x75b6d6=>{const _0x2f017b=_0x3d18bd,{reason:_0x1eb75d}=_0x75b6d6[_0x2f017b(0x35d)];this[_0x2f017b(0x13e)][_0x2f017b(0x3f2)]({'id':_0x2f017b(0x231),'data':_0x1eb75d}),this[_0x2f017b(0x381)][_0x2f017b(0x3b5)](new _univerjs_sheets[(_0x2f017b(0x36d))](_0x470c26)['id'],![]),this[_0x2f017b(0x386)][_0x2f017b(0x288)](_0x470c26);});};(0x0,rxjs[_0x113810(0x24c)])(this[_0x113810(0x3f4)][_0x113810(0x3b9)](_univerjs_core[_0x113810(0x1db)][_0x113810(0x2c3)]),this[_0x113810(0x3f4)][_0x113810(0x3b9)](_univerjs_core[_0x113810(0x1db)]['UNIVER_DOC']))['pipe']((0x0,rxjs_operators[_0x113810(0x21c)])(_0x4beb68=>_0x4beb68[_0x113810(0x354)][_0x113810(0x296)]()),(0x0,rxjs_operators[_0x113810(0x160)])(_0x459fee=>!(0x0,_univerjs_core[_0x113810(0x338)])(_0x459fee)),(0x0,rxjs_operators[_0x113810(0x1d1)])(this[_0x113810(0x33e)]))[_0x113810(0x23c)](_0x637b18=>{_0x8babed(_0x637b18);});}[_0x280611(0x1a1)](){const _0x1ec42b=_0x280611,_0x542738=async _0x4cf55c=>{const _0x393685=_0xed3c,_0x1c72ce=await this[_0x393685(0x386)][_0x393685(0x29b)](_0x4cf55c),_0x4f882f=this[_0x393685(0x240)][_0x393685(0x206)](_univerjs_sheets[_0x393685(0x15e)]);_0x1c72ce['event$'][_0x393685(0x1d5)]((0x0,rxjs_operators[_0x393685(0x160)])(_0xc5d6c2=>_0xc5d6c2[_0x393685(0x1ad)]===_univerjs_pro_collaboration[_0x393685(0x282)]['UPDATE_PERMISSION_OBJ']),(0x0,rxjs_operators[_0x393685(0x1d1)])(this['dispose$']))['subscribe'](_0x11a07e=>{const _0x5bb2a1=_0x393685,{objectId:_0x1b1da4}=_0x11a07e[_0x5bb2a1(0x35d)];if(_0x1b1da4===_0x4cf55c)_0x4f882f[_0x5bb2a1(0x2b0)](_0x4cf55c);else _0x4f882f[_0x5bb2a1(0x3e2)](_0x4cf55c,_0x1b1da4);});};(0x0,rxjs[_0x1ec42b(0x24c)])(this[_0x1ec42b(0x3f4)][_0x1ec42b(0x3b9)](_univerjs_core[_0x1ec42b(0x1db)][_0x1ec42b(0x2c3)]))[_0x1ec42b(0x1d5)]((0x0,rxjs_operators[_0x1ec42b(0x21c)])(_0x47c3c2=>_0x47c3c2[_0x1ec42b(0x354)][_0x1ec42b(0x296)]()),(0x0,rxjs_operators[_0x1ec42b(0x160)])(_0x4a5bf3=>!(0x0,_univerjs_core[_0x1ec42b(0x338)])(_0x4a5bf3)),(0x0,rxjs_operators[_0x1ec42b(0x1d1)])(this[_0x1ec42b(0x33e)]))[_0x1ec42b(0x23c)](_0x475db5=>{_0x542738(_0x475db5);});}};PermissionService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x280611(0x3d8)])(_univerjs_core['Injector'])),__decorateParam(0x1,_univerjs_core[_0x280611(0x3d4)]),__decorateParam(0x2,_univerjs_core[_0x280611(0x287)]),__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(CollaborationSessionService)),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService))],PermissionService);let SnapshotServerOverHTTPService=class SnapshotServerOverHTTPService{constructor(_0x2c6106,_0x2224a3){const _0x98e69c=_0x280611;this['_configService']=_0x2c6106,this[_0x98e69c(0x39d)]=_0x2224a3;}async['getUnitOnRev'](_0x5859c3,_0x502fb7){const _0x18ac23=_0x280611;var _0x1cca35;const {unitID:_0x558451,type:_0x1f1b2c,revision:revision=0x0}=_0x502fb7,_0x5835f1=this[_0x18ac23(0x1ed)]()+'/'+_0x1f1b2c+'/unit/'+_0x558451+_0x18ac23(0x172)+revision,_0x4af0e1=(await this[_0x18ac23(0x39d)][_0x18ac23(0x206)](_0x5835f1))[_0x18ac23(0x342)],_0x4d71de=(_0x1cca35=_0x4af0e1[_0x18ac23(0x22d)])===null||_0x1cca35===void 0x0?void 0x0:_0x1cca35[_0x18ac23(0x275)];if(_0x4d71de){const _0x4f9515=_0x4d71de===null||_0x4d71de===void 0x0?void 0x0:_0x4d71de[_0x18ac23(0x3fa)];_0x4d71de[_0x18ac23(0x3fa)]=_univerjs_pro_collaboration[_0x18ac23(0x30e)][_0x18ac23(0x27e)]((0x0,_univerjs_pro_collaboration['b64DecodeUnicode'])(_0x4f9515)),Object[_0x18ac23(0x154)](_0x4d71de[_0x18ac23(0x1a5)])[_0x18ac23(0x379)](([,_0x2918a7])=>{const _0x246c19=_0x18ac23,_0x109e46=_0x2918a7[_0x246c19(0x3fa)];_0x2918a7['originalMeta']=_univerjs_pro_collaboration[_0x246c19(0x30e)]['encode']((0x0,_univerjs_pro_collaboration['b64DecodeUnicode'])(_0x109e46));});}return _0x4af0e1;}async['getSheetBlock'](_0xac8a6f,_0x97d5d3){const _0x5e0853=_0x280611,{unitID:_0x27fbb9,type:_0x10abdc,blockID:_0x217864}=_0x97d5d3,_0x427c67=this[_0x5e0853(0x2ba)]()+'/'+_0x10abdc+_0x5e0853(0x3ec)+_0x27fbb9+'/block/'+_0x217864;return(await this[_0x5e0853(0x39d)]['get'](_0x427c67))[_0x5e0853(0x342)];}async['getDeserializedSheetBlock'](_0x46f211,_0x346188){const _0x1ccc7a=_0x280611,{unitID:_0x310998,type:_0x50a25c,blockID:_0x2e7b80}=_0x346188,_0x16d53a=this[_0x1ccc7a(0x2ba)]()+_0x1ccc7a(0x3e8)+_0x50a25c+'/unit/'+_0x310998+'/block/'+_0x2e7b80;return(await this[_0x1ccc7a(0x39d)][_0x1ccc7a(0x206)](_0x16d53a))[_0x1ccc7a(0x342)];}async[_0x280611(0x245)](_0x565605,_0x1854de){const _0x4a0e73=_0x280611,{unitID:_0x19bea4,type:_0x23b869,from:_0x2211b9,to:_0x464934}=_0x1854de,_0x16748c=this['_getAPIPrefix']()+'/'+_0x23b869+_0x4a0e73(0x3ec)+_0x19bea4+'/fetchmissing?from='+_0x2211b9+'&to='+_0x464934;return(await this[_0x4a0e73(0x39d)]['get'](_0x16748c))[_0x4a0e73(0x342)];}[_0x280611(0x1ed)](){const _0xf6416d=_0x280611;var _0x217e40;return(_0x217e40=this['_configService'][_0xf6416d(0x1b8)](_0xf6416d(0x1f5)))!==null&&_0x217e40!==void 0x0?_0x217e40:this['_getAPIPrefix']();}['_getAPIPrefix'](){const _0x10084c=_0x280611;var _0x19493d;const _0x35925c=this[_0x10084c(0x273)][_0x10084c(0x1b8)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x19493d=_0x35925c===null||_0x35925c===void 0x0?void 0x0:_0x35925c['snapshotServerUrl'])!==null&&_0x19493d!==void 0x0?_0x19493d:DEFAULT_SNAPSHOT_SERVER_URL;}async[_0x280611(0x395)](_0x3c1296,_0x36e463){const _0x5a8620=_0x280611,_0xf5ea8='/universer-api/snapshot/'+_0x36e463[_0x5a8620(0x148)]+_0x5a8620(0x3ec)+_0x36e463[_0x5a8620(0x181)]+_0x5a8620(0x341);return(await this['_httpService'][_0x5a8620(0x206)](_0xf5ea8,{'params':{'resourceId':JSON[_0x5a8620(0x241)](_0x36e463[_0x5a8620(0x195)])}}))[_0x5a8620(0x342)];}[_0x280611(0x15a)](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}[_0x280611(0x3f6)](){const _0x1c9e39=_0x280611;throw new Error(_0x1c9e39(0x20b));}[_0x280611(0x157)](){const _0x5d2da3=_0x280611;throw new Error(_0x5d2da3(0x20b));}['saveChangeset'](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}[_0x280611(0x14c)](){const _0x5e5871=_0x280611;throw new Error(_0x5e5871(0x20b));}[_0x280611(0x165)](){const _0x2bddb7=_0x280611;throw new Error(_0x2bddb7(0x20b));}};SnapshotServerOverHTTPService=__decorate([__decorateParam(0x0,_univerjs_core[_0x280611(0x2f5)]),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_network['HTTPService']))],SnapshotServerOverHTTPService);let CollaborativeUndoRedoService=class CollaborativeUndoRedoService extends _univerjs_core['LocalUndoRedoService']{constructor(_0x43a544,_0x40f281,_0x15e83a,_0x3f3140,_0x2b7416){const _0x3fd427=_0x280611;super(_0x43a544,_0x40f281,_0x15e83a),this[_0x3fd427(0x3b4)]=_0x3f3140,this['_logService']=_0x2b7416;}[_0x280611(0x279)](_0x3d3bb6,_0x2b5c12){const _0x197dc6=_0x280611,_0x37c5fd=this[_0x197dc6(0x18c)](_0x3d3bb6);if(_0x37c5fd)try{const _0x8624de=this[_0x197dc6(0x313)](_0x37c5fd,_0x2b5c12);this[_0x197dc6(0x366)](_0x3d3bb6,_0x8624de);}catch(_0x1d18e4){this['_logService']['error'](_0x197dc6(0x1b1),_0x1d18e4),this[_0x197dc6(0x2b3)](_0x3d3bb6);}const _0x1062bd=this[_0x197dc6(0x356)](_0x3d3bb6);if(_0x1062bd)try{const _0x38d039=this[_0x197dc6(0x313)](_0x1062bd,_0x2b5c12);this['_substituteRedoStack'](_0x3d3bb6,_0x38d039);}catch(_0x2d60ce){this['_logService'][_0x197dc6(0x166)](_0x2d60ce),this[_0x197dc6(0x32a)](_0x3d3bb6);}}[_0x280611(0x2b3)](_0x2567ce){const _0x8db352=_0x280611,_0x333129=this[_0x8db352(0x18c)](_0x2567ce);_0x333129&&(_0x333129['length']=0x0,this[_0x8db352(0x258)]());}[_0x280611(0x32a)](_0x2f3a6c){const _0x53a412=_0x280611,_0x34eb47=this[_0x53a412(0x356)](_0x2f3a6c);_0x34eb47&&(_0x34eb47[_0x53a412(0x182)]=0x0,this[_0x53a412(0x258)]());}['_substituteUndoStack'](_0xe505f3,_0x42adba){const _0x3d6f6d=_0x280611;this[_0x3d6f6d(0x40a)][_0x3d6f6d(0x14a)](_0xe505f3,_0x42adba),this[_0x3d6f6d(0x258)]();}[_0x280611(0x185)](_0x909369,_0x293d1b){const _0x1c927c=_0x280611;this[_0x1c927c(0x333)][_0x1c927c(0x14a)](_0x909369,_0x293d1b),this[_0x1c927c(0x258)]();}[_0x280611(0x313)](_0x41e7e1,_0x2902c8){const _0x595516=_0x280611,_0x57257f=[];let _0x1a218a=_0x2902c8,_0x56ee33=_0x2902c8;for(let _0x4ce68e=_0x41e7e1['length']-0x1;_0x4ce68e>=0x0;_0x4ce68e--){const {unitID:_0x429a10,undoMutations:_0x323b68,redoMutations:_0x2d85f0}=_0x41e7e1[_0x4ce68e],_0x5f3149=this['_transformService']['transformMutationsWithChangeset'](_0x1a218a,_0x323b68),_0x2d8a2f=this[_0x595516(0x3b4)][_0x595516(0x13f)](_0x56ee33,_0x2d85f0);if((0x0,_univerjs_pro_collaboration[_0x595516(0x16a)])(_0x5f3149)||(0x0,_univerjs_pro_collaboration[_0x595516(0x16a)])(_0x2d8a2f)){this[_0x595516(0x1eb)][_0x595516(0x166)](_0x595516(0x1b1),_0x595516(0x3a9),_0x5f3149,_0x2d8a2f);break;}_0x1a218a=_0x5f3149[_0x595516(0x2d6)],_0x56ee33=_0x2d8a2f['c1Prime'],_0x57257f[_0x595516(0x1c7)]({'unitID':_0x429a10,'undoMutations':_0x5f3149['m2Prime'],'redoMutations':_0x2d8a2f['m2Prime']});}return _0x57257f[_0x595516(0x3be)]();}};CollaborativeUndoRedoService=__decorate([__decorateParam(0x0,_univerjs_core[_0x280611(0x3d4)]),__decorateParam(0x1,_univerjs_core[_0x280611(0x34f)]),__decorateParam(0x2,_univerjs_core[_0x280611(0x2c9)]),__decorateParam(0x3,_univerjs_pro_collaboration[_0x280611(0x39f)]),__decorateParam(0x4,_univerjs_core[_0x280611(0x3b8)])],CollaborativeUndoRedoService);let UniverCollaborationClientPlugin=class UniverCollaborationClientPlugin extends _univerjs_core[_0x280611(0x222)]{constructor(_0x1346a3={},_0x560993,_0x23a5f1,_0x5f52b6){const _0x50ccc6=_0x280611;super(),this[_0x50ccc6(0x1fd)]=_0x1346a3,this[_0x50ccc6(0x1eb)]=_0x560993,this[_0x50ccc6(0x240)]=_0x23a5f1,this[_0x50ccc6(0x273)]=_0x5f52b6;const {..._0x2f5b53}=(0x0,_univerjs_core[_0x50ccc6(0x24c)])({},defaultPluginConfig,_0x1346a3);if(!_0x2f5b53['socketService'])throw new Error('[UniverCollaborationClientPlugin]:\x20you\x20must\x20provide\x20a\x20socketService\x20implementation\x20in\x20config!');this['_config']=_0x2f5b53,this[_0x50ccc6(0x273)][_0x50ccc6(0x16f)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,_0x2f5b53);}[_0x280611(0x3b1)](){const _0xd2daa9=_0x280611;this['_registerDependencies'](),this[_0xd2daa9(0x171)]();}[_0x280611(0x1b5)](){const _0x3a1ea3=_0x280611;var _0x2363ef,_0x5482b7;if(this[_0x3a1ea3(0x240)][_0x3a1ea3(0x390)](_univerjs_core['IUndoRedoService']))this[_0x3a1ea3(0x1eb)][_0x3a1ea3(0x166)](_0x3a1ea3(0x2fb),_0x3a1ea3(0x298));const _0xabd7d4=(0x0,_univerjs_core['mergeOverrideWithDependencies'])([[_univerjs_core['IUndoRedoService'],{'useClass':CollaborativeUndoRedoService}],[CollaborationSessionService],[MemberService],[SheetTransformSelectionsService],[AuthServerService],[DomainRequestService],[CommentService],[PermissionService],[CollaborationUIEventService],[DataLoaderService],[ICollaborationSocketService,{'useClass':this['_config'][_0x3a1ea3(0x3e3)]}],[_univerjs_pro_collaboration[_0x3a1ea3(0x331)],{'useClass':SnapshotServerOverHTTPService}],[_univerjs_core[_0x3a1ea3(0x362)],{'useClass':AuthzIoHttpService}],[_univerjs_drawing[_0x3a1ea3(0x2f2)],{'useClass':CollaborationImageIoService}],[_univerjs_core[_0x3a1ea3(0x38f)],{'useClass':MentionIoHttpService}],[CollaborationController],[FileNameController]],(_0x2363ef=this[_0x3a1ea3(0x1fd)])===null||_0x2363ef===void 0x0?void 0x0:_0x2363ef[_0x3a1ea3(0x19f)]);if(!((_0x5482b7=this[_0x3a1ea3(0x1fd)])===null||_0x5482b7===void 0x0?void 0x0:_0x5482b7[_0x3a1ea3(0x306)])){const _0x429c9f=_0xabd7d4[_0x3a1ea3(0x28b)](([_0x4480a])=>_0x4480a===ISingleActiveUnitService);if(_0x429c9f!==-0x1)_0xabd7d4['splice'](_0x429c9f,0x1);}(0x0,_univerjs_core[_0x3a1ea3(0x3ca)])(this[_0x3a1ea3(0x240)],_0xabd7d4);}[_0x280611(0x171)](){const _0x12283a=_0x280611;var _0x449a49,_0x25ac3e;this[_0x12283a(0x240)]['get'](_univerjs_network[_0x12283a(0x280)])[_0x12283a(0x25d)]({'priority':0x14,'interceptor':(0x0,_univerjs_network[_0x12283a(0x2b9)])({'maxParallel':0x6})});if(!((_0x449a49=this[_0x12283a(0x1fd)])===null||_0x449a49===void 0x0?void 0x0:_0x449a49[_0x12283a(0x19e)])){var _0x24b026;(_0x24b026=this[_0x12283a(0x240)][_0x12283a(0x206)](ILocalCacheService,_univerjs_core[_0x12283a(0x3da)]['OPTIONAL']))===null||_0x24b026===void 0x0||_0x24b026[_0x12283a(0x230)]();}if((_0x25ac3e=this[_0x12283a(0x1fd)])===null||_0x25ac3e===void 0x0?void 0x0:_0x25ac3e['enableAuthServer'])(0x0,_univerjs_core[_0x12283a(0x187)])(this[_0x12283a(0x240)],[[AuthServerService]]);(0x0,_univerjs_core[_0x12283a(0x187)])(this[_0x12283a(0x240)],[[DomainRequestService],[CollaborationController],[PermissionService]]);}};_defineProperty(UniverCollaborationClientPlugin,_0x280611(0x28f),'UNIVER_COLLABORATION_CLIENT_PLUGIN'),_defineProperty(UniverCollaborationClientPlugin,_0x280611(0x3f0),name),_defineProperty(UniverCollaborationClientPlugin,_0x280611(0x3e9),version),UniverCollaborationClientPlugin=__decorate([(0x0,_univerjs_core['DependentOn'])(_univerjs_pro_license[_0x280611(0x142)],_univerjs_pro_collaboration[_0x280611(0x243)],_univerjs_network[_0x280611(0x274)]),__decorateParam(0x1,_univerjs_core[_0x280611(0x3b8)]),__decorateParam(0x2,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x280611(0x32d)])),__decorateParam(0x3,_univerjs_core['IConfigService'])],UniverCollaborationClientPlugin),Object[_0x280611(0x150)](exports,'AuthzIoHttpService',{'enumerable':!![],'get':function(){return AuthzIoHttpService;}}),Object[_0x280611(0x150)](exports,'AwaitingState',{'enumerable':!![],'get':function(){return AwaitingState;}}),Object['defineProperty'](exports,_0x280611(0x3eb),{'enumerable':!![],'get':function(){return AwaitingWithPendingState;}}),exports[_0x280611(0x24f)]=COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,Object[_0x280611(0x150)](exports,_0x280611(0x244),{'enumerable':!![],'get':function(){return CollaborationController;}}),Object[_0x280611(0x150)](exports,'CollaborationEntity',{'enumerable':!![],'get':function(){return CollaborationEntity;}}),Object['defineProperty'](exports,_0x280611(0x22b),{'enumerable':!![],'get':function(){return CollaborationImageIoService;}}),Object[_0x280611(0x150)](exports,'CollaborationSession',{'enumerable':!![],'get':function(){return CollaborationSession;}}),Object[_0x280611(0x150)](exports,_0x280611(0x3ad),{'enumerable':!![],'get':function(){return CollaborationSessionService;}}),Object[_0x280611(0x150)](exports,_0x280611(0x26a),{'enumerable':!![],'get':function(){return CollaborationSocketService;}}),exports[_0x280611(0x2ae)]=CollaborationStatus,exports[_0x280611(0x2bc)]=CollaborationUIEventId,exports[_0x280611(0x360)]=CollaborationUIEventService,Object[_0x280611(0x150)](exports,_0x280611(0x1cf),{'enumerable':!![],'get':function(){return CollaborativeUndoRedoService;}}),exports[_0x280611(0x235)]=CommentService,Object['defineProperty'](exports,_0x280611(0x34d),{'enumerable':!![],'get':function(){return ConflictState;}}),exports[_0x280611(0x2e6)]=DEFAULT_COLLAB_WEB_SOCKET_URL,exports[_0x280611(0x321)]=DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,exports[_0x280611(0x149)]=DEFAULT_WS_SESSION_TICKET_URL,Object[_0x280611(0x150)](exports,_0x280611(0x14b),{'enumerable':!![],'get':function(){return DataLoaderService;}}),Object[_0x280611(0x150)](exports,_0x280611(0x2f0),{'enumerable':!![],'get':function(){return DocCollaborationEntity;}}),Object['defineProperty'](exports,_0x280611(0x38a),{'enumerable':!![],'get':function(){return FetchingMissState;}}),exports['HEARTBEAT_INTERVAL_KEY']=HEARTBEAT_INTERVAL_KEY,exports[_0x280611(0x1d6)]=HEARTBEAT_TIMEOUT_KEY,exports['ICollaborationSocketService']=ICollaborationSocketService,exports['ILocalCacheService']=ILocalCacheService,exports[_0x280611(0x358)]=INetworkConditionService,exports[_0x280611(0x173)]=ISingleActiveUnitService,exports[_0x280611(0x26d)]=LOCAL_CACHE_INTERVAL,exports[_0x280611(0x137)]=LOCAL_CACHE_INTERVAL_KEY,Object[_0x280611(0x150)](exports,'MemberService',{'enumerable':!![],'get':function(){return MemberService;}}),Object[_0x280611(0x150)](exports,'MentionIoHttpService',{'enumerable':!![],'get':function(){return MentionIoHttpService;}}),Object[_0x280611(0x150)](exports,_0x280611(0x246),{'enumerable':!![],'get':function(){return OfflineState;}}),Object[_0x280611(0x150)](exports,'PendingState',{'enumerable':!![],'get':function(){return PendingState;}}),exports['REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY']=REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,exports['RETRY_CONNECTING_MAX_COUNT_KEY']=RETRY_CONNECTING_MAX_COUNT_KEY,exports['SessionStatus']=SessionStatus,Object[_0x280611(0x150)](exports,'SheetCollaborationEntity',{'enumerable':!![],'get':function(){return SheetCollaborationEntity;}}),Object['defineProperty'](exports,_0x280611(0x30a),{'enumerable':!![],'get':function(){return SheetTransformSelectionsService;}}),Object[_0x280611(0x150)](exports,_0x280611(0x3d1),{'enumerable':!![],'get':function(){return SnapshotServerOverHTTPService;}}),Object[_0x280611(0x150)](exports,_0x280611(0x13d),{'enumerable':!![],'get':function(){return SyncedState;}}),exports[_0x280611(0x3df)]=UnitStatus,Object[_0x280611(0x150)](exports,'UniverCollaborationClientPlugin',{'enumerable':!![],'get':function(){return UniverCollaborationClientPlugin;}}),exports[_0x280611(0x2ab)]=deserializeToCombResponse,exports[_0x280611(0x3e4)]=getLocalCacheKey,exports[_0x280611(0x3bb)]=serializeCombRequest;
1
+ const _0x8dd24f=_0x17f9;(function(_0xab4640,_0x278f2d){const _0x38c555=_0x17f9,_0x216a5c=_0xab4640();while(!![]){try{const _0x5e72d0=parseInt(_0x38c555(0x351))/0x1+-parseInt(_0x38c555(0x1d5))/0x2*(parseInt(_0x38c555(0x48c))/0x3)+parseInt(_0x38c555(0x2c2))/0x4*(parseInt(_0x38c555(0x35d))/0x5)+-parseInt(_0x38c555(0x303))/0x6*(parseInt(_0x38c555(0x480))/0x7)+parseInt(_0x38c555(0x27d))/0x8+parseInt(_0x38c555(0x41a))/0x9+-parseInt(_0x38c555(0x392))/0xa;if(_0x5e72d0===_0x278f2d)break;else _0x216a5c['push'](_0x216a5c['shift']());}catch(_0x308dab){_0x216a5c['push'](_0x216a5c['shift']());}}}(_0x9671,0x7dc1d),Object[_0x8dd24f(0x2bb)](exports,Symbol[_0x8dd24f(0x39a)],{'value':'Module'}));let _univerjs_pro_collaboration=require('@univerjs-pro/collaboration'),_univerjs_core=require('@univerjs/core'),_univerjs_docs=require('@univerjs/docs'),_univerjs_sheets=require('@univerjs/sheets'),rxjs=require('rxjs'),_univerjs_protocol=require('@univerjs/protocol'),_univerjs_telemetry=require('@univerjs/telemetry'),rxjs_operators=require('rxjs/operators'),_univerjs_network=require('@univerjs/network'),_univerjs_pro_license=require('@univerjs-pro/license'),_univerjs_drawing=require('@univerjs/drawing'),_noble_ciphers_aes_js=require('@noble/ciphers/aes.js'),_noble_ciphers_utils_js=require('@noble/ciphers/utils.js');const DEFAULT_SNAPSHOT_SERVER_URL=_0x8dd24f(0x419),SNAPSHOT_URL_KEY=_0x8dd24f(0x490),DEFAULT_SEND_CHANGESET_TIMEOUT=0x7d0,DEFAULT_COLLAB_WEB_SOCKET_URL='ws://127.0.0.1:8000/universer-api/comb/connect',DEFAULT_WS_SESSION_TICKET_URL=_0x8dd24f(0x3b5),HEARTBEAT_INTERVAL_KEY=_0x8dd24f(0x27f),DEFAULT_HEARTBEAT_INTERVAL=0x7530,HEARTBEAT_TIMEOUT_KEY=_0x8dd24f(0x360),DEFAULT_HEARTBEAT_TIMEOUT=0x4e20,DEFAULT_RETRY_CONNECTING_INTERVAL=0x4e20,RETRY_CONNECTING_MAX_COUNT_KEY=_0x8dd24f(0x285),LOCAL_CACHE_INTERVAL_KEY='LOCAL_CACHE_INTERVAL',LOCAL_CACHE_INTERVAL=0x3e8,DEFAULT_COLLAB_SUBMIT_CHANGESET_URL=_0x8dd24f(0x338),DEFAULT_LOGIN_URL=_0x8dd24f(0x271),REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY=_0x8dd24f(0x3cd),DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT=_0x8dd24f(0x1fa),TELEMETRY_COLLABORATION_NEW_CHANGESET=_0x8dd24f(0x3ca);function summaryChangesetSize(_0x1264dd){const _0x1860ff=_0x8dd24f;return JSON[_0x1860ff(0x2e7)](_0x1264dd)[_0x1860ff(0x3ec)];}function _typeof(_0x31d075){'@babel/helpers - typeof';const _0x558e40=_0x8dd24f;return _typeof=_0x558e40(0x387)==typeof Symbol&&_0x558e40(0x475)==typeof Symbol[_0x558e40(0x3ef)]?function(_0x4c33e2){return typeof _0x4c33e2;}:function(_0xabea13){const _0x2a8faf=_0x558e40;return _0xabea13&&_0x2a8faf(0x387)==typeof Symbol&&_0xabea13[_0x2a8faf(0x420)]===Symbol&&_0xabea13!==Symbol[_0x2a8faf(0x217)]?_0x2a8faf(0x475):typeof _0xabea13;},_typeof(_0x31d075);}function toPrimitive(_0x4f6ee4,_0x17f45d){const _0x156de8=_0x8dd24f;if(_0x156de8(0x3f1)!=_typeof(_0x4f6ee4)||!_0x4f6ee4)return _0x4f6ee4;var _0x1e2d13=_0x4f6ee4[Symbol[_0x156de8(0x226)]];if(void 0x0!==_0x1e2d13){var _0x547c6f=_0x1e2d13[_0x156de8(0x1e8)](_0x4f6ee4,_0x17f45d||_0x156de8(0x3d0));if(_0x156de8(0x3f1)!=_typeof(_0x547c6f))return _0x547c6f;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x156de8(0x269)===_0x17f45d?String:Number)(_0x4f6ee4);}function toPropertyKey(_0x347e4a){const _0x15e320=_0x8dd24f;var _0x489951=toPrimitive(_0x347e4a,_0x15e320(0x269));return _0x15e320(0x475)==_typeof(_0x489951)?_0x489951:_0x489951+'';}function _defineProperty(_0x41eadc,_0x454aef,_0x21a301){const _0x902a01=_0x8dd24f;return(_0x454aef=toPropertyKey(_0x454aef))in _0x41eadc?Object[_0x902a01(0x2bb)](_0x41eadc,_0x454aef,{'value':_0x21a301,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x41eadc[_0x454aef]=_0x21a301,_0x41eadc;}let CollaborationUIEventId=function(_0x5846f6){const _0xcb6b1a=_0x8dd24f;return _0x5846f6['OTHER_CLIENT_EDITING']='OTHER_CLIENT_EDITING',_0x5846f6[_0xcb6b1a(0x295)]=_0xcb6b1a(0x295),_0x5846f6[_0xcb6b1a(0x39d)]=_0xcb6b1a(0x39d),_0x5846f6[_0xcb6b1a(0x1b1)]=_0xcb6b1a(0x1b1),_0x5846f6['JOIN_ROOM_FAILED']=_0xcb6b1a(0x21a),_0x5846f6[_0xcb6b1a(0x309)]=_0xcb6b1a(0x309),_0x5846f6[_0xcb6b1a(0x384)]='SOCKET_FAILED',_0x5846f6[_0xcb6b1a(0x272)]=_0xcb6b1a(0x272),_0x5846f6;}({});var CollaborationUIEventService=class{constructor(){const _0x46f175=_0x8dd24f;_defineProperty(this,_0x46f175(0x1e4),new rxjs['Subject']()),_defineProperty(this,_0x46f175(0x45e),this[_0x46f175(0x1e4)][_0x46f175(0x2a8)]());}[_0x8dd24f(0x3a3)](_0x1c6a5f){const _0x202a2e=_0x8dd24f;this[_0x202a2e(0x1e4)][_0x202a2e(0x368)](_0x1c6a5f);}},CommentService=class{constructor(){const _0x34049c=_0x8dd24f;_defineProperty(this,_0x34049c(0x278),new rxjs[(_0x34049c(0x1c9))]()),_defineProperty(this,_0x34049c(0x45b),this[_0x34049c(0x278)][_0x34049c(0x2a8)]());}['onCommentUpdate'](_0x4ad648){const _0x2869ed=_0x8dd24f;this[_0x2869ed(0x278)]['next'](_0x4ad648);}};function __decorateParam(_0x2c2e83,_0x2ad7ec){return function(_0x3a5533,_0x62db60){_0x2ad7ec(_0x3a5533,_0x62db60,_0x2c2e83);};}function __decorate(_0x4159fa,_0xbde0cc,_0x16502a,_0x4a4022){const _0x212ba8=_0x8dd24f;var _0x25eb6c=arguments[_0x212ba8(0x3ec)],_0x41e6dc=_0x25eb6c<0x3?_0xbde0cc:_0x4a4022===null?_0x4a4022=Object[_0x212ba8(0x25a)](_0xbde0cc,_0x16502a):_0x4a4022,_0x4a6b60;if(typeof Reflect===_0x212ba8(0x3f1)&&typeof Reflect[_0x212ba8(0x3c2)]===_0x212ba8(0x387))_0x41e6dc=Reflect[_0x212ba8(0x3c2)](_0x4159fa,_0xbde0cc,_0x16502a,_0x4a4022);else{for(var _0xe357ac=_0x4159fa[_0x212ba8(0x3ec)]-0x1;_0xe357ac>=0x0;_0xe357ac--)if(_0x4a6b60=_0x4159fa[_0xe357ac])_0x41e6dc=(_0x25eb6c<0x3?_0x4a6b60(_0x41e6dc):_0x25eb6c>0x3?_0x4a6b60(_0xbde0cc,_0x16502a,_0x41e6dc):_0x4a6b60(_0xbde0cc,_0x16502a))||_0x41e6dc;}return _0x25eb6c>0x3&&_0x41e6dc&&Object[_0x212ba8(0x2bb)](_0xbde0cc,_0x16502a,_0x41e6dc),_0x41e6dc;}let MemberService=class MemberService extends _univerjs_core[_0x8dd24f(0x36a)]{constructor(_0x4348d5,_0x271783){const _0x7cd7d2=_0x8dd24f;super(),this[_0x7cd7d2(0x2c6)]=_0x4348d5,this['_userManagerService']=_0x271783,_defineProperty(this,_0x7cd7d2(0x448),new Map()),_defineProperty(this,_0x7cd7d2(0x3df),new rxjs[(_0x7cd7d2(0x1c9))]()),this['disposeWithMe']((0x0,rxjs['merge'])(this[_0x7cd7d2(0x2c6)][_0x7cd7d2(0x372)](_univerjs_core[_0x7cd7d2(0x322)][_0x7cd7d2(0x2b4)])[_0x7cd7d2(0x37f)]((0x0,rxjs_operators[_0x7cd7d2(0x441)])(_0x39d9b8=>_0x39d9b8['getUnitId']())),this[_0x7cd7d2(0x2c6)][_0x7cd7d2(0x372)](_univerjs_core[_0x7cd7d2(0x322)][_0x7cd7d2(0x2f9)])['pipe']((0x0,rxjs_operators['map'])(_0x4eb7bf=>_0x4eb7bf[_0x7cd7d2(0x3ad)]())))[_0x7cd7d2(0x1e7)](_0x153a80=>this[_0x7cd7d2(0x3ac)](_0x153a80)));}[_0x8dd24f(0x371)](_0x3f4b89){const _0x2f9b70=_0x8dd24f;if(this[_0x2f9b70(0x448)][_0x2f9b70(0x44f)](_0x3f4b89))return(0x0,rxjs['of'])(this[_0x2f9b70(0x448)][_0x2f9b70(0x44e)](_0x3f4b89));return this[_0x2f9b70(0x3df)][_0x2f9b70(0x37f)]((0x0,rxjs_operators[_0x2f9b70(0x441)])(_0x157e57=>{const _0x54db16=_0x2f9b70;if(_0x157e57===_0x3f4b89)return this['_roomMembers'][_0x54db16(0x44e)](_0x157e57);}));}[_0x8dd24f(0x489)](_0x788d56){const _0x48fcfd=_0x8dd24f;this['_userManagerService'][_0x48fcfd(0x489)](_0x788d56);}['getCurrentUser'](){const _0x515c94=_0x8dd24f;return this[_0x515c94(0x2c0)][_0x515c94(0x235)]();}[_0x8dd24f(0x2f0)](_0xf13bdb,_0xda4948){const _0x46e768=_0x8dd24f;let _0x4a8ae2=this['_roomMembers'][_0x46e768(0x44e)](_0xf13bdb);!_0x4a8ae2&&(_0x4a8ae2=new RoomMember(),this['_roomMembers']['set'](_0xf13bdb,_0x4a8ae2),this[_0x46e768(0x3df)][_0x46e768(0x368)](_0xf13bdb)),_0x4a8ae2[_0x46e768(0x2f0)](_0xda4948);}[_0x8dd24f(0x36f)](_0x1453de,_0x3facc1){const _0xa8bde2=_0x8dd24f,_0x1805bf=this[_0xa8bde2(0x448)][_0xa8bde2(0x44e)](_0x1453de);if(_0x1805bf)_0x1805bf[_0xa8bde2(0x36f)](_0x3facc1);}[_0x8dd24f(0x47c)](_0x32953f){return this['_roomMembers']['get'](_0x32953f);}[_0x8dd24f(0x1ed)](_0x16a231,_0x5e2249){const _0x2015d0=_0x8dd24f,_0x20f616=this[_0x2015d0(0x448)][_0x2015d0(0x44e)](_0x16a231);if(_0x20f616)return _0x20f616[_0x2015d0(0x1ed)](_0x5e2249);}[_0x8dd24f(0x3ac)](_0x1e79ac){const _0x1a7f19=_0x8dd24f,_0x103213=this['_roomMembers'][_0x1a7f19(0x44e)](_0x1e79ac);_0x103213&&(_0x103213['dispose'](),this[_0x1a7f19(0x448)][_0x1a7f19(0x430)](_0x1e79ac));}['dispose'](){const _0x3edc7f=_0x8dd24f;this[_0x3edc7f(0x448)][_0x3edc7f(0x1fe)](_0x89cb7f=>_0x89cb7f[_0x3edc7f(0x29f)]()),this['_roomMembers']['clear'](),this[_0x3edc7f(0x3df)]['complete']();}};MemberService=__decorate([__decorateParam(0x0,_univerjs_core[_0x8dd24f(0x39f)]),__decorateParam(0x1,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x3cb)]))],MemberService);var RoomMember=class extends _univerjs_core[_0x8dd24f(0x36a)]{constructor(..._0x9d3fe2){const _0x1eb794=_0x8dd24f;super(..._0x9d3fe2),_defineProperty(this,_0x1eb794(0x34d),new Map()),_defineProperty(this,_0x1eb794(0x355),new rxjs['BehaviorSubject'](this[_0x1eb794(0x34d)])),_defineProperty(this,_0x1eb794(0x2e4),this[_0x1eb794(0x355)][_0x1eb794(0x2a8)]());}[_0x8dd24f(0x29f)](){const _0x46d7f9=_0x8dd24f;this[_0x46d7f9(0x34d)][_0x46d7f9(0x431)](),this[_0x46d7f9(0x355)][_0x46d7f9(0x442)]();}[_0x8dd24f(0x2f0)](_0x4d94db){const _0x573b97=_0x8dd24f;this['_members'][_0x573b97(0x3d2)](_0x4d94db[_0x573b97(0x456)],_0x4d94db),this[_0x573b97(0x254)]();}[_0x8dd24f(0x36f)](_0x39ba34){this['_members']['delete'](_0x39ba34),this['_emitMembers']();}[_0x8dd24f(0x1ed)](_0x208527){const _0x59a0e4=_0x8dd24f;return this['_members'][_0x59a0e4(0x44e)](_0x208527);}[_0x8dd24f(0x3a4)](){const _0x1d1abd=_0x8dd24f;return Array['from'](this[_0x1d1abd(0x34d)][_0x1d1abd(0x3a0)]());}[_0x8dd24f(0x254)](){const _0x5712df=_0x8dd24f;this[_0x5712df(0x355)][_0x5712df(0x368)](this[_0x5712df(0x34d)]);}};let SessionStatus=function(_0x26e294){const _0x118c42=_0x8dd24f;return _0x26e294[_0x26e294[_0x118c42(0x33a)]=0x0]=_0x118c42(0x33a),_0x26e294[_0x26e294[_0x118c42(0x202)]=0x1]=_0x118c42(0x202),_0x26e294[_0x26e294[_0x118c42(0x23f)]=0x2]=_0x118c42(0x23f),_0x26e294[_0x26e294[_0x118c42(0x261)]=0x3]=_0x118c42(0x261),_0x26e294;}({});const FailedReason={[_univerjs_protocol[_0x8dd24f(0x438)]['FAIL']]:_0x8dd24f(0x1fb),[_univerjs_protocol['CmdRspCode'][_0x8dd24f(0x35f)]]:_0x8dd24f(0x25b),[_univerjs_protocol[_0x8dd24f(0x438)]['JOIN_ROOM_NOT_EXISTS']]:'session.room-not-exists',[_univerjs_protocol[_0x8dd24f(0x438)][_0x8dd24f(0x462)]]:_0x8dd24f(0x2a3),[_univerjs_protocol['CmdRspCode']['GLOBAL_ROOMS_CNT_EXCEEDS']]:_0x8dd24f(0x3a8)};let CollaborationSession=class CollaborationSession extends _univerjs_core['RxDisposable']{get['sessionStatus'](){const _0x249ca8=_0x8dd24f;return this[_0x249ca8(0x2e0)][_0x249ca8(0x3d1)]();}constructor(_0x35e7a1,_0x51d92e,_0x4ec059,_0x3b27ea,_0x38d849,_0x3dd43b,_0xcccde9,_0xb6bc5b){const _0x2d674f=_0x8dd24f;super(),this[_0x2d674f(0x45a)]=_0x35e7a1,this[_0x2d674f(0x305)]=_0x4ec059,this[_0x2d674f(0x3a9)]=_0x3b27ea,this['_memberService']=_0x38d849,this[_0x2d674f(0x251)]=_0x3dd43b,this[_0x2d674f(0x334)]=_0xcccde9,this[_0x2d674f(0x1be)]=_0xb6bc5b,_defineProperty(this,'_sessionStatus$',new rxjs[(_0x2d674f(0x33f))](0x0)),_defineProperty(this,_0x2d674f(0x222),this[_0x2d674f(0x2e0)][_0x2d674f(0x2a8)]()),_defineProperty(this,_0x2d674f(0x1e4),new rxjs[(_0x2d674f(0x1c9))]()),_defineProperty(this,'event$',this[_0x2d674f(0x1e4)][_0x2d674f(0x2a8)]()),_defineProperty(this,_0x2d674f(0x2b7),void 0x0),_defineProperty(this,'_socketMessageSubscription',void 0x0),_defineProperty(this,'_collaborationTimeoutTimer',void 0x0),_defineProperty(this,'_shouldReportTelemetry',![]),_defineProperty(this,_0x2d674f(0x20a),null),this[_0x2d674f(0x20d)]=!!this['_telemetryService'],_0x51d92e[_0x2d674f(0x37f)]((0x0,rxjs[_0x2d674f(0x32c)])(this[_0x2d674f(0x299)]))[_0x2d674f(0x1e7)](_0x35548c=>{const _0xb9354f=_0x2d674f;if(typeof _0x35548c===_0xb9354f(0x1ae))return;this['_socket']=_0x35548c;if(_0x35548c)this['_joinRoom'](_0x35548c),this['_socketMessageSubscription']=_0x35548c[_0xb9354f(0x21f)]['subscribe'](_0x11079d=>{const _0x513239=_0xb9354f;if(_0x11079d[_0x513239(0x34a)]!==this[_0x513239(0x45a)])return;this[_0x513239(0x352)](_0x11079d);});else{var _0x28b66c;this[_0xb9354f(0x213)](),this['_sessionStatus$'][_0xb9354f(0x368)](0x2),(_0x28b66c=this[_0xb9354f(0x3af)])===null||_0x28b66c===void 0x0||_0x28b66c[_0xb9354f(0x356)](),this['_socketMessageSubscription']=null;}});}[_0x8dd24f(0x492)](){const _0x32e3b4=_0x8dd24f;var _0x35ab88,_0x4c888e;return(_0x35ab88=(_0x4c888e=this[_0x32e3b4(0x2b7)])===null||_0x4c888e===void 0x0?void 0x0:_0x4c888e['memberID'])!==null&&_0x35ab88!==void 0x0?_0x35ab88:null;}['dispose'](){const _0x3a9e56=_0x8dd24f;super[_0x3a9e56(0x29f)](),this[_0x3a9e56(0x40b)](),this[_0x3a9e56(0x299)][_0x3a9e56(0x368)](),this[_0x3a9e56(0x299)]['complete']();}[_0x8dd24f(0x40b)](){const _0x56cf41=_0x8dd24f;var _0x206cef,_0x446a9b;this[_0x56cf41(0x213)](),(_0x206cef=this[_0x56cf41(0x2b7)])===null||_0x206cef===void 0x0||_0x206cef['send']({'cmd':_univerjs_protocol[_0x56cf41(0x201)][_0x56cf41(0x212)],'data':{'roomID':this['_unitID']}}),(_0x446a9b=this[_0x56cf41(0x2b7)])===null||_0x446a9b===void 0x0||_0x446a9b[_0x56cf41(0x40b)](),this[_0x56cf41(0x1e4)]['complete'](),this[_0x56cf41(0x2e0)][_0x56cf41(0x442)]();}[_0x8dd24f(0x352)](_0x5a1efb){const _0xd3cab3=_0x8dd24f;if(_0x5a1efb[_0xd3cab3(0x357)]===_univerjs_protocol['CombCmd']['JOIN'])this[_0xd3cab3(0x230)](_0x5a1efb);else{if(_0x5a1efb[_0xd3cab3(0x357)]===_univerjs_protocol['CombCmd'][_0xd3cab3(0x1f8)])this[_0xd3cab3(0x26a)](_0x5a1efb);}}[_0x8dd24f(0x2c9)](_0x38cf76){const _0x1f79ef=_0x8dd24f;this[_0x1f79ef(0x2e0)][_0x1f79ef(0x368)](0x1),_0x38cf76[_0x1f79ef(0x41b)]({'cmd':_univerjs_protocol[_0x1f79ef(0x201)]['JOIN'],'routeKey':this[_0x1f79ef(0x45a)],'routeType':'','data':{'rooms':[{'roomID':this['_unitID']}]}});}[_0x8dd24f(0x230)](_0x526641){const _0x318a7b=_0x8dd24f;var _0x1d0564;if(_0x526641['code']in FailedReason){this[_0x318a7b(0x334)][_0x318a7b(0x3a3)]({'id':_0x318a7b(0x21a),'data':FailedReason[_0x526641[_0x318a7b(0x22a)]]}),this['_sessionStatus$']['next'](0x2);return;}this[_0x318a7b(0x2e0)][_0x318a7b(0x368)](0x3);const _0x5cd8ad=(_0x1d0564=_0x526641[_0x318a7b(0x332)]['roomInfos'][this[_0x318a7b(0x45a)]])===null||_0x1d0564===void 0x0?void 0x0:_0x1d0564[_0x318a7b(0x2e9)];if(_0x5cd8ad)_0x5cd8ad['forEach'](_0x96d470=>this['_memberService']['updateMember'](this[_0x318a7b(0x45a)],_0x96d470));}[_0x8dd24f(0x26a)](_0x4157e5){const _0x2c8289=_0x8dd24f;try{const _0x3c31ed=_0x4157e5[_0x2c8289(0x332)];switch(_0x3c31ed['eventID']){case _univerjs_pro_collaboration[_0x2c8289(0x2ed)][_0x2c8289(0x39e)]:this[_0x2c8289(0x406)](_0x3c31ed),this[_0x2c8289(0x1e4)][_0x2c8289(0x368)](_0x3c31ed);break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x2c8289(0x30c)]:this[_0x2c8289(0x46a)](_0x3c31ed),this[_0x2c8289(0x1e4)]['next'](_0x3c31ed);break;case _univerjs_pro_collaboration['CollaborationEvent']['CHANGESET_ACK']:case _univerjs_pro_collaboration[_0x2c8289(0x2ed)][_0x2c8289(0x2c4)]:this[_0x2c8289(0x470)](),this[_0x2c8289(0x42e)](),this[_0x2c8289(0x1e4)][_0x2c8289(0x368)](_0x3c31ed);break;case _univerjs_pro_collaboration[_0x2c8289(0x2ed)][_0x2c8289(0x469)]:this[_0x2c8289(0x305)]['error'](_0x2c8289(0x3aa)+JSON['stringify'](_0x3c31ed)),this[_0x2c8289(0x1e4)][_0x2c8289(0x368)](_0x3c31ed);break;case _univerjs_pro_collaboration[_0x2c8289(0x2ed)][_0x2c8289(0x396)]:this['_commentService'][_0x2c8289(0x451)](_0x3c31ed[_0x2c8289(0x332)]),this[_0x2c8289(0x1e4)][_0x2c8289(0x368)](_0x3c31ed);break;default:this[_0x2c8289(0x1e4)][_0x2c8289(0x368)](_0x3c31ed);}}catch(_0x58aaeb){this[_0x2c8289(0x305)][_0x2c8289(0x35a)](_0x58aaeb,_0x4157e5);}}[_0x8dd24f(0x406)](_0x21a061){const _0x12e211=_0x8dd24f;this[_0x12e211(0x241)][_0x12e211(0x2f0)](this[_0x12e211(0x45a)],_0x21a061['data']);}[_0x8dd24f(0x46a)](_0x209e65){const _0x38e098=_0x8dd24f;this[_0x38e098(0x241)]['removeMember'](this[_0x38e098(0x45a)],_0x209e65[_0x38e098(0x332)]['memberID']);}async['send'](_0x52fc2c,_0x4fe119){const _0x32dbe0=_0x8dd24f;if(this[_0x32dbe0(0x273)]!==0x3||!this[_0x32dbe0(0x2b7)])throw new Error(_0x32dbe0(0x23c));try{_0x52fc2c[_0x32dbe0(0x468)]===_univerjs_pro_collaboration[_0x32dbe0(0x2ed)][_0x32dbe0(0x244)]&&(this[_0x32dbe0(0x225)](),this[_0x32dbe0(0x318)](_0x52fc2c)),this[_0x32dbe0(0x2b7)]['send']({'cmd':_univerjs_protocol[_0x32dbe0(0x201)][_0x32dbe0(0x443)],'routeKey':_0x4fe119,'routeType':'','data':_0x52fc2c});}catch(_0x1f5b74){this[_0x32dbe0(0x305)]['error'](_0x1f5b74);}}[_0x8dd24f(0x225)](){const _0x369368=_0x8dd24f;var _0x581492;this[_0x369368(0x210)]=setTimeout(()=>{const _0x5ceb1c=_0x369368;this[_0x5ceb1c(0x210)]=null,this['_collaborationUIEventService'][_0x5ceb1c(0x3a3)]({'id':'SUBMIT_CHANGESET_TIMEOUT'});},(_0x581492=this[_0x369368(0x3a9)][_0x369368(0x3c7)]('HEARTBEAT_TIMEOUT'))!==null&&_0x581492!==void 0x0?_0x581492:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x8dd24f(0x42e)](){const _0x16f8b9=_0x8dd24f;this[_0x16f8b9(0x210)]&&(clearTimeout(this[_0x16f8b9(0x210)]),this[_0x16f8b9(0x210)]=null);}['_startTelemetryCollaborationNewChangeset'](_0x50ad32){const _0x237b73=_0x8dd24f;if(!this[_0x237b73(0x20d)])return;const {data:_0x2418ba}=_0x50ad32,{unitID:_0x26eff1,changeset:_0x402f89}=_0x2418ba,{mutations:_0x584e7b,type:_0x59a4cd}=_0x402f89;this[_0x237b73(0x20a)]={'unitId':_0x26eff1,'type':_0x59a4cd,'startTime':performance['now'](),'stopTime':0x0,'duration':0x0,'size':summaryChangesetSize(_0x584e7b)};}[_0x8dd24f(0x470)](){const _0x456855=_0x8dd24f;if(!this[_0x456855(0x20d)])return;if(!this[_0x456855(0x20a)]){this[_0x456855(0x305)][_0x456855(0x35a)](_0x456855(0x3e6),_0x456855(0x2ff));return;}this[_0x456855(0x20a)][_0x456855(0x203)]=performance[_0x456855(0x1bd)](),this['_telemetryInfo'][_0x456855(0x1c6)]=this[_0x456855(0x20a)][_0x456855(0x203)]-this[_0x456855(0x20a)][_0x456855(0x1db)],this[_0x456855(0x1be)]['capture'](TELEMETRY_COLLABORATION_NEW_CHANGESET,this[_0x456855(0x20a)]),this[_0x456855(0x20a)]=null;}[_0x8dd24f(0x213)](){const _0x5938e2=_0x8dd24f;this[_0x5938e2(0x20a)]=null;}};CollaborationSession=__decorate([__decorateParam(0x2,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x3,_univerjs_core[_0x8dd24f(0x407)]),__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(MemberService)),__decorateParam(0x5,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CommentService)),__decorateParam(0x6,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationUIEventService)),__decorateParam(0x7,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(_univerjs_telemetry[_0x8dd24f(0x349)]))],CollaborationSession);const ILocalCacheService=(0x0,_univerjs_core[_0x8dd24f(0x418)])(_0x8dd24f(0x3e7));function getLocalCacheKey(_0x28e80b){const _0x26d0c4=_0x8dd24f;return _0x26d0c4(0x3dd)+_0x28e80b;}function extractTargetFromFirstChangeset(_0x1b93d9){const _0x1cfcb9=_0x8dd24f,{unitID:_0x2f5de7,mutations:_0x2f3b19}=_0x1b93d9;return{'unitId':_0x2f5de7,'subUnitId':_0x2f3b19[_0x1cfcb9(0x3ec)]>0x0?_0x2f3b19[0x0][_0x1cfcb9(0x491)]['subUnitId']:null};}let SheetTransformSelectionsService=class SheetTransformSelectionsService{constructor(_0x1dc4d3,_0x1e6a37,_0x2c2104){const _0x1f6d77=_0x8dd24f;this[_0x1f6d77(0x370)]=_0x1dc4d3,this[_0x1f6d77(0x3f2)]=_0x1e6a37,this[_0x1f6d77(0x375)]=_0x2c2104;}[_0x8dd24f(0x3f6)](_0x446184){const _0x16937b=_0x8dd24f;var _0x56c25c,_0x35507e;const _0x95d34a=this['_injector'][_0x16937b(0x44e)](_univerjs_sheets[_0x16937b(0x393)]),{unitId:_0x20326d,subUnitId:_0x2b9784}=extractTargetFromFirstChangeset(_0x446184),_0x2eb9cc=_0x95d34a===null||_0x95d34a===void 0x0?void 0x0:_0x95d34a[_0x16937b(0x25f)](_0x20326d)[_0x16937b(0x306)](),_0x3ba862=(_0x56c25c=this[_0x16937b(0x375)][_0x16937b(0x24c)](_0x20326d))===null||_0x56c25c===void 0x0||(_0x56c25c=_0x56c25c['getActiveSheet']())===null||_0x56c25c===void 0x0?void 0x0:_0x56c25c['getSheetId']();if(_0x2eb9cc['length']===0x0||!_0x20326d||!_0x2b9784)return;const _0x1f11a3=[{'id':_univerjs_sheets['SetSelectionsOperation']['id'],'params':{'unitId':_0x20326d,'subUnitId':_0x3ba862,'selections':_univerjs_core[_0x16937b(0x312)][_0x16937b(0x215)](_0x2eb9cc)}}],_0x15c0c3=this[_0x16937b(0x3f2)]['transformMutationsWithChangeset'](_0x446184,_0x1f11a3);if(!(0x0,_univerjs_pro_collaboration[_0x16937b(0x428)])(_0x15c0c3))throw _0x15c0c3['error'];const _0x4ffc97=(_0x35507e=_0x15c0c3[_0x16937b(0x28b)][0x0])===null||_0x35507e===void 0x0||(_0x35507e=_0x35507e[_0x16937b(0x491)])===null||_0x35507e===void 0x0?void 0x0:_0x35507e[_0x16937b(0x248)];if(Array[_0x16937b(0x2b5)](_0x4ffc97)&&_0x4ffc97[_0x16937b(0x3ec)]){if(_0x4ffc97['length']===_0x1f11a3[0x0][_0x16937b(0x491)][_0x16937b(0x248)][_0x16937b(0x3ec)]&&_0x4ffc97[_0x16937b(0x346)]((_0x105aa3,_0x445efe)=>_univerjs_core[_0x16937b(0x38c)][_0x16937b(0x44d)](_0x105aa3[_0x16937b(0x31e)],_0x1f11a3[0x0][_0x16937b(0x491)]['selections'][_0x445efe][_0x16937b(0x31e)])))return;this['_injector']['get'](_univerjs_core[_0x16937b(0x2f5)])[_0x16937b(0x25c)](_univerjs_sheets[_0x16937b(0x326)]['id'],{'unitId':_0x20326d,'subUnitId':_0x3ba862,'selections':_0x4ffc97});}}};SheetTransformSelectionsService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x1,_univerjs_pro_collaboration['ITransformService']),__decorateParam(0x2,_univerjs_core['IUniverInstanceService'])],SheetTransformSelectionsService);const ISingleActiveUnitService=(0x0,_univerjs_core['createIdentifier'])(_0x8dd24f(0x304));let UnitStatus=function(_0x19b502){const _0xe085b9=_0x8dd24f;return _0x19b502[_0x19b502[_0xe085b9(0x358)]=0x0]=_0xe085b9(0x358),_0x19b502[_0x19b502[_0xe085b9(0x1f4)]=0x1]='OTHER_CLIENTS_EDITING',_0x19b502;}({});const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY='collaboration-client.config',configSymbol=Symbol(COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};function isSplitChunkMutation(_0x1dac09){const _0x3d503c=_0x8dd24f;var _0x49031c;return!!((_0x49031c=_0x1dac09[_0x3d503c(0x491)])===null||_0x49031c===void 0x0?void 0x0:_0x49031c['__splitChunk__']);}const SINGLE_CHANGESET_MUTATIONS=new Set([_univerjs_sheets[_0x8dd24f(0x454)]['id']]);function assembleSheetChangeset(_0x2103d7,_0xa6f702,_0x1acab3,_0x3b2c49,_0x2cbf1f){const _0x38928f=_0x8dd24f;var _0x532154,_0xe67e69,_0x474157,_0x154e6d;const _0x3d8076=[];for(const _0x5d9dd9 of _0x2103d7){if(SINGLE_CHANGESET_MUTATIONS[_0x38928f(0x44f)](_0x5d9dd9['id'])){if(_0x3d8076[_0x38928f(0x3ec)]>0x0)break;_0x3d8076[_0x38928f(0x405)](_0x5d9dd9);break;}if(isSplitChunkMutation(_0x5d9dd9)){if(_0x3d8076[_0x38928f(0x3ec)]>0x0)break;_0x3d8076[_0x38928f(0x405)](_0x5d9dd9);break;}_0x3d8076[_0x38928f(0x405)](_0x5d9dd9);}const _0x337567=(_0x532154=(_0xe67e69=_0x2cbf1f[_0x38928f(0x235)]())===null||_0xe67e69===void 0x0?void 0x0:_0xe67e69[_0x38928f(0x1b9)])!==null&&_0x532154!==void 0x0?_0x532154:_0x38928f(0x1b5),_0x33a898=(_0x474157=(_0x154e6d=_0x2cbf1f[_0x38928f(0x235)]())===null||_0x154e6d===void 0x0?void 0x0:_0x154e6d[_0x38928f(0x456)])!==null&&_0x474157!==void 0x0?_0x474157:_0x38928f(0x1b5);return{'changeset':{'unitID':_0xa6f702,'type':(0x0,_univerjs_pro_collaboration[_0x38928f(0x364)])(_0x1acab3[_0x38928f(0x2da)](_0xa6f702)),'baseRev':_0x3b2c49[_0x38928f(0x329)](_0xa6f702),'revision':0x0,'userID':_0x337567,'memberID':_0x33a898,'mutations':_0x3d8076},'pendingMutations':_0x2103d7[_0x38928f(0x437)](_0x3d8076[_0x38928f(0x3ec)])};}function assembleDocChangeset(_0x2d2a66,_0x2b6999,_0x2fc444,_0x48b881,_0x43b3dd){const _0x11a59a=_0x8dd24f;var _0x193be0,_0x483d3f,_0x4e262b,_0x524fe3;const _0x4d7281=[_0x2d2a66[_0x11a59a(0x33d)]((_0x27c9b3,_0x59dc93)=>{const _0x45373a=_0x11a59a;var _0x3f6534;const {id:_0x5d1c05}=_0x27c9b3,{id:_0x4755d1,type:_0x4280a3}=_0x59dc93,_0x14c201=(_0x3f6534=_0x27c9b3[_0x45373a(0x491)])!==null&&_0x3f6534!==void 0x0?_0x3f6534:{'actions':null},_0x5d02d6=_0x59dc93[_0x45373a(0x491)];if(_0x5d1c05&&_0x5d1c05!==_0x4755d1)throw new Error(_0x45373a(0x44a)+_0x5d1c05+_0x45373a(0x401)+_0x4755d1+'.');return{..._0x27c9b3,'id':_0x4755d1,'type':_0x4280a3,'params':{'unitId':_0x5d02d6['unitId'],'textRanges':_0x5d02d6[_0x45373a(0x23d)],'actions':_univerjs_core[_0x45373a(0x1d9)]['compose'](_0x14c201[_0x45373a(0x3d7)],_0x5d02d6['actions'])}};},{})],_0x5b07f2=(_0x193be0=(_0x483d3f=_0x43b3dd[_0x11a59a(0x235)]())===null||_0x483d3f===void 0x0?void 0x0:_0x483d3f[_0x11a59a(0x1b9)])!==null&&_0x193be0!==void 0x0?_0x193be0:_0x11a59a(0x1b5),_0x1ffc58=(_0x4e262b=(_0x524fe3=_0x43b3dd['getCurrentUser']())===null||_0x524fe3===void 0x0?void 0x0:_0x524fe3['memberID'])!==null&&_0x4e262b!==void 0x0?_0x4e262b:'unknown';return{'changeset':{'unitID':_0x2b6999,'type':(0x0,_univerjs_pro_collaboration['mapDocumentTypeToUniverInstanceType'])(_0x2fc444[_0x11a59a(0x2da)](_0x2b6999)),'baseRev':_0x48b881[_0x11a59a(0x329)](_0x2b6999),'revision':0x0,'userID':_0x5b07f2,'memberID':_0x1ffc58,'mutations':_0x4d7281},'pendingMutations':[]};}function createTimerObservable$(_0x190539,_0x43d5d0){const _0x1c477f=_0x8dd24f,_0x5d8654=new rxjs[(_0x1c477f(0x2c7))](0x1);return setTimeout(()=>_0x5d8654[_0x1c477f(0x368)](_0x43d5d0),_0x190539),_0x5d8654[_0x1c477f(0x2a8)]()[_0x1c477f(0x37f)]((0x0,rxjs['take'])(0x1));}var _PendingState,_AwaitingState,_AwaitingWithPendingState;let CollaborationStatus=function(_0xf08dd0){const _0x34c91a=_0x8dd24f;return _0xf08dd0[_0x34c91a(0x220)]='not_collab',_0xf08dd0[_0x34c91a(0x330)]='synced',_0xf08dd0[_0x34c91a(0x2cb)]=_0x34c91a(0x1f1),_0xf08dd0[_0x34c91a(0x246)]=_0x34c91a(0x207),_0xf08dd0[_0x34c91a(0x385)]='awaiting_with_pending',_0xf08dd0[_0x34c91a(0x29c)]=_0x34c91a(0x259),_0xf08dd0['CONFLICT']=_0x34c91a(0x446),_0xf08dd0[_0x34c91a(0x23f)]=_0x34c91a(0x43a),_0xf08dd0;}({});const MAX_RETRY_TIMEOUT=0x4e20,MAX_RETRY_TOTAL_TIMEOUT=0x2bf20;var CollaborationState=class{constructor(_0x3bfd98,_0x20b2cd,_0x51d4b7,_0x58df39,_0x65c7f6,_0x45a7bc,_0x57c749,_0x2b5cb2,_0x21ad7a){const _0x7a6216=_0x8dd24f;this[_0x7a6216(0x398)]=_0x3bfd98,this['type']=_0x20b2cd,this[_0x7a6216(0x28f)]=_0x65c7f6,this[_0x7a6216(0x435)]=_0x45a7bc,this[_0x7a6216(0x2b1)]=_0x57c749,this['_revisionService']=_0x2b5cb2,this[_0x7a6216(0x2f3)]=_0x21ad7a,_defineProperty(this,_0x7a6216(0x288),null),_defineProperty(this,_0x7a6216(0x36c),[]),this['_awaitingChangeset']=_0x51d4b7,this[_0x7a6216(0x36c)]=_0x58df39;}[_0x8dd24f(0x29a)](_0x5b6b41){const _0x26b169=_0x8dd24f,_0x47ed3c=this[_0x26b169(0x340)][_0x26b169(0x329)](this[_0x26b169(0x398)]);if(_0x5b6b41[_0x26b169(0x276)]>_0x47ed3c+0x1)return this[_0x26b169(0x28f)][_0x26b169(0x26b)]({'from':_0x47ed3c,'to':_0x5b6b41[_0x26b169(0x276)]-0x1}),!![];return![];}['_transformUndoredo'](_0x1249c4){const _0x72491b=_0x8dd24f;this[_0x72491b(0x2b1)][_0x72491b(0x455)](this[_0x72491b(0x398)],_0x1249c4);}['_transformSelections'](_0x50e1b5){const _0x31c058=_0x8dd24f;var _0x43da8d,_0x35cd11;(_0x43da8d=(_0x35cd11=this[_0x31c058(0x28f)])['onTransformSelections'])===null||_0x43da8d===void 0x0||_0x43da8d['call'](_0x35cd11,_0x50e1b5);}[_0x8dd24f(0x42b)](_0xf7c8){const _0x950a38=_0x8dd24f;var _0x348f24,_0x4229c8;return(_0x348f24=(_0x4229c8=this[_0x950a38(0x28f)])['onTransformIME'])===null||_0x348f24===void 0x0?void 0x0:_0x348f24[_0x950a38(0x1e8)](_0x4229c8,_0xf7c8);}[_0x8dd24f(0x324)](_0x14c302){const _0x2effc5=_0x8dd24f;var _0x19f478,_0x846f9b;return(_0x19f478=(_0x846f9b=this[_0x2effc5(0x28f)])[_0x2effc5(0x298)])===null||_0x19f478===void 0x0?void 0x0:_0x19f478[_0x2effc5(0x1e8)](_0x846f9b,_0x14c302);}['_transformRemoteChangesetByIMECache'](_0x45ff34){const _0x35ee12=_0x8dd24f;var _0x172ced,_0x365033,_0x362b5d;return(_0x172ced=(_0x365033=(_0x362b5d=this[_0x35ee12(0x28f)])[_0x35ee12(0x214)])===null||_0x365033===void 0x0?void 0x0:_0x365033[_0x35ee12(0x1e8)](_0x362b5d,_0x45ff34))!==null&&_0x172ced!==void 0x0?_0x172ced:_0x45ff34;}['_transformRemoteChangesetByStateCache'](_0x8fc74b){const _0x2312da=_0x8dd24f;var _0x5a4be3,_0x24cf74,_0x59629b;return(_0x5a4be3=(_0x24cf74=(_0x59629b=this[_0x2312da(0x28f)])[_0x2312da(0x3dc)])===null||_0x24cf74===void 0x0?void 0x0:_0x24cf74['call'](_0x59629b,_0x8fc74b))!==null&&_0x5a4be3!==void 0x0?_0x5a4be3:_0x8fc74b;}[_0x8dd24f(0x415)](_0xdda7a7){const _0x33341a=_0x8dd24f;if(this['type']===_univerjs_core[_0x33341a(0x322)][_0x33341a(0x2f9)]){const {unitID:_0x74df2e,mutations:_0xd12e8,memberID:_0x2a9df9}=_0xdda7a7,_0x3b8097=_0xd12e8['length']>0x0?_0xd12e8[0x0][_0x33341a(0x491)][_0x33341a(0x23d)]:[];if(Array[_0x33341a(0x2b5)](_0x3b8097)&&_0x3b8097['length']>0x0){var _0x4fb735,_0x3adfdf;(_0x4fb735=(_0x3adfdf=this[_0x33341a(0x28f)])[_0x33341a(0x43d)])===null||_0x4fb735===void 0x0||_0x4fb735[_0x33341a(0x1e8)](_0x3adfdf,{'unitID':_0x74df2e,'memberID':_0x2a9df9,'textRanges':_0x3b8097});}}}[_0x8dd24f(0x252)](){const _0x7be42c=_0x8dd24f;var _0x1fdf28;(_0x1fdf28=this[_0x7be42c(0x2f3)])===null||_0x1fdf28===void 0x0||_0x1fdf28[_0x7be42c(0x347)](this[_0x7be42c(0x398)],this[_0x7be42c(0x376)],this[_0x7be42c(0x288)],this[_0x7be42c(0x36c)]);}[_0x8dd24f(0x1cc)](){const _0x5be875=_0x8dd24f;return this[_0x5be875(0x340)][_0x5be875(0x329)](this[_0x5be875(0x398)]);}[_0x8dd24f(0x390)](){const _0x3b874a=_0x8dd24f;this[_0x3b874a(0x340)][_0x3b874a(0x29b)](this[_0x3b874a(0x398)]);}['_executeRemoteChangeset'](_0x43fcfb){const _0x2069d7=_0x8dd24f;let _0x1891af=this['_transformRemoteChangesetByIMECache'](_0x43fcfb);_0x1891af=this[_0x2069d7(0x429)](_0x1891af);const _0x59048a=(0x0,_univerjs_core[_0x2069d7(0x23e)])(_0x1891af[_0x2069d7(0x38a)],this['_commandService'],{'fromCollab':!![]});if(!_0x59048a[_0x2069d7(0x46f)]){var _0x299b16;if(_0x59048a[_0x2069d7(0x35a)]instanceof Error)throw _0x59048a['error'];throw new Error((_0x299b16=_0x59048a['error'])!==null&&_0x299b16!==void 0x0?_0x299b16:_0x2069d7(0x22e));}this[_0x2069d7(0x42b)](_0x1891af),this['_transformStateCache'](_0x1891af),this[_0x2069d7(0x1f0)](_0x43fcfb),this[_0x2069d7(0x289)](_0x1891af),this['_syncEditingCollabCursor'](_0x1891af),this[_0x2069d7(0x390)]();}};let SyncedState=class SyncedState extends CollaborationState{constructor(_0x244688,_0x179576,_0x309a6f,_0x236f0d,_0x283d4f,_0x7690a4,_0x5a984e,_0x5aa34c,_0x33d950,_0x42d20e){const _0x17f278=_0x8dd24f;super(_0x244688,_0x179576,null,[],_0x309a6f,_0x5a984e,_0x7690a4,_0x236f0d,_0x42d20e),this[_0x17f278(0x370)]=_0x283d4f,this['_logService']=_0x5aa34c,this[_0x17f278(0x3f2)]=_0x33d950,this[_0x17f278(0x409)]=_0x42d20e,_defineProperty(this,_0x17f278(0x2db),_0x17f278(0x283));}['appendMutation'](_0x346e5e){const _0x25b2e8=_0x8dd24f,_0x3947fc=this[_0x25b2e8(0x370)][_0x25b2e8(0x439)](PendingState,this['unitID'],this['type'],[_0x346e5e],this[_0x25b2e8(0x28f)]);return _0x3947fc[_0x25b2e8(0x472)](),_0x3947fc[_0x25b2e8(0x252)](),_0x3947fc;}['onRemoteChangeset'](_0x21b492){const _0x42140f=_0x8dd24f;if(this[_0x42140f(0x29a)](_0x21b492))return this[_0x42140f(0x370)][_0x42140f(0x439)](FetchingMissState,this['unitID'],this[_0x42140f(0x376)],null,[],null,[_0x21b492],this[_0x42140f(0x28f)]);try{const _0x4520ee=this['_transformService']['transformMutationsWithChangeset'](_0x21b492,[_univerjs_pro_collaboration[_0x42140f(0x24e)]]);if((0x0,_univerjs_pro_collaboration[_0x42140f(0x428)])(_0x4520ee)){const {c1Prime:_0x459c8a}=_0x4520ee;return this[_0x42140f(0x257)](_0x459c8a),this;}throw _0x4520ee[_0x42140f(0x35a)];}catch(_0x215f11){return this['_logService'][_0x42140f(0x35a)](_0x215f11),this['_onConflict'](![]);}}[_0x8dd24f(0x3e8)](_0xfb85cf){const _0x3df623=_0x8dd24f;return this['_injector'][_0x3df623(0x439)](ConflictState,this['unitID'],this[_0x3df623(0x376)],null,[],this[_0x3df623(0x28f)],_0xfb85cf);}['onRemoteAck'](_0x19a0f2){const _0x1f08a8=_0x8dd24f;if(_0x19a0f2[_0x1f08a8(0x276)]<=this[_0x1f08a8(0x1cc)]())return this;throw new Error('[SyncedState]:\x20received\x20acknowledgement.');}[_0x8dd24f(0x2ee)](){throw new Error('[SyncedState]:\x20received\x20rejection.');}['onRemoteRetry'](){return this;}[_0x8dd24f(0x461)](){const _0x392fa4=_0x8dd24f;return this[_0x392fa4(0x370)][_0x392fa4(0x439)](OfflineState,this['unitID'],this[_0x392fa4(0x376)],null,[],this[_0x392fa4(0x28f)]);}[_0x8dd24f(0x464)](){return this;}['resend'](){const _0x32a590=_0x8dd24f;throw new Error(_0x32a590(0x2d1));}[_0x8dd24f(0x2a4)](){const _0x1b8d64=_0x8dd24f,_0xcd2d89=this[_0x1b8d64(0x340)][_0x1b8d64(0x329)](this['unitID']);return this[_0x1b8d64(0x28f)][_0x1b8d64(0x26b)]({'from':_0xcd2d89,'to':0x0}),this[_0x1b8d64(0x370)][_0x1b8d64(0x439)](FetchingMissState,this[_0x1b8d64(0x398)],this[_0x1b8d64(0x376)],null,[],null,[],this['_handler']);}};SyncedState=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x5,_univerjs_core[_0x8dd24f(0x275)]),__decorateParam(0x6,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0x7,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x8,_univerjs_pro_collaboration[_0x8dd24f(0x3a6)]),__decorateParam(0x9,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],SyncedState);let PendingState=_PendingState=class PendingState extends CollaborationState{constructor(_0x2bfd8e,_0x1fc2cd,_0x292ca1,_0x59f7c3,_0x3ad3a4,_0x163d15,_0x4a60da,_0x4f3fe1,_0x359a25,_0x2af05b,_0x5033ec,_0x39988c,_0x35793a,_0x2600c0){const _0x120670=_0x8dd24f;super(_0x2bfd8e,_0x1fc2cd,null,_0x292ca1,_0x59f7c3,_0x359a25,_0x35793a,_0x163d15,_0x2600c0),this[_0x120670(0x370)]=_0x3ad3a4,this[_0x120670(0x241)]=_0x4a60da,this[_0x120670(0x305)]=_0x4f3fe1,this['_configService']=_0x2af05b,this[_0x120670(0x3f2)]=_0x5033ec,this[_0x120670(0x2c6)]=_0x39988c,_defineProperty(this,_0x120670(0x2db),_0x120670(0x1f1)),_defineProperty(this,_0x120670(0x31f),null),_defineProperty(this,_0x120670(0x1c4),null);}[_0x8dd24f(0x1de)](_0xab673f){const _0x2ea13c=_0x8dd24f;return this[_0x2ea13c(0x36c)][_0x2ea13c(0x405)](_0xab673f),this[_0x2ea13c(0x252)](),this;}['onRemoteChangeset'](_0x27a4ed){const _0x189bc1=_0x8dd24f;if(this[_0x189bc1(0x29a)](_0x27a4ed))return this[_0x189bc1(0x1c7)](),this[_0x189bc1(0x370)][_0x189bc1(0x439)](FetchingMissState,this['unitID'],this['type'],null,this[_0x189bc1(0x36c)],null,[_0x27a4ed],this[_0x189bc1(0x28f)]);try{const _0xe19234=this[_0x189bc1(0x3f2)][_0x189bc1(0x335)](_0x27a4ed,this[_0x189bc1(0x36c)]);if((0x0,_univerjs_pro_collaboration[_0x189bc1(0x428)])(_0xe19234)){const {c1Prime:_0x1a9e81,m2Prime:_0x1f7613}=_0xe19234;this[_0x189bc1(0x257)](_0x1a9e81);const _0x1f9b60=this[_0x189bc1(0x370)][_0x189bc1(0x439)](_PendingState,this[_0x189bc1(0x398)],this[_0x189bc1(0x376)],_0x1f7613,this['_handler']);this['_clearScheduledTask']();const _0x3eb20d=new Date()[_0x189bc1(0x1bf)](),_0x39432c=this['_scheduleCompleteTimestamp']?Math[_0x189bc1(0x3b2)](this[_0x189bc1(0x31f)]-_0x3eb20d,0x0):this['_getSendChangesetTimeout']();return _0x1f9b60['_schedule'](_0x39432c),_0x1f9b60;}throw _0xe19234[_0x189bc1(0x35a)];}catch(_0x868252){return this[_0x189bc1(0x305)][_0x189bc1(0x35a)](_0x868252),this[_0x189bc1(0x3e8)](![]);}}[_0x8dd24f(0x21b)](_0x4d3761){const _0xfc20b0=_0x8dd24f;if(_0x4d3761[_0xfc20b0(0x276)]<=this[_0xfc20b0(0x1cc)]())return this;throw new Error('[PendingState]:\x20received\x20acknowledgement.');}[_0x8dd24f(0x2ee)](){const _0x497fd1=_0x8dd24f;throw new Error(_0x497fd1(0x3b9));}[_0x8dd24f(0x2d6)](){return this;}[_0x8dd24f(0x461)](){const _0x28d44a=_0x8dd24f;return this[_0x28d44a(0x1c7)](),this['_injector'][_0x28d44a(0x439)](OfflineState,this[_0x28d44a(0x398)],this[_0x28d44a(0x376)],null,this[_0x28d44a(0x36c)],this[_0x28d44a(0x28f)]);}['toggleOnline'](){return this;}['_schedule'](_0x234edc){const _0x528a92=_0x8dd24f,_0x12a235=_0x234edc!==null&&_0x234edc!==void 0x0?_0x234edc:this['_getSendChangesetTimeout']();this[_0x528a92(0x31f)]=new Date()[_0x528a92(0x1bf)]()+_0x12a235,this['_sendingTimer']=setTimeout(()=>{const _0x15089a=_0x528a92;this[_0x15089a(0x1c7)]();let _0x20c087=null;switch(this[_0x15089a(0x376)]){case _univerjs_core[_0x15089a(0x322)][_0x15089a(0x2b4)]:_0x20c087=assembleSheetChangeset(this['_pendingMutations'],this[_0x15089a(0x398)],this[_0x15089a(0x2c6)],this[_0x15089a(0x340)],this[_0x15089a(0x241)]);break;case _univerjs_core[_0x15089a(0x322)][_0x15089a(0x2f9)]:if(this[_0x15089a(0x36c)][_0x15089a(0x346)](_0x109b25=>_0x109b25['id']===_univerjs_docs[_0x15089a(0x440)]['id']))_0x20c087=assembleDocChangeset(this[_0x15089a(0x36c)],this[_0x15089a(0x398)],this[_0x15089a(0x2c6)],this['_revisionService'],this['_memberService']);else _0x20c087=assembleSheetChangeset(this['_pendingMutations'],this['unitID'],this[_0x15089a(0x2c6)],this[_0x15089a(0x340)],this[_0x15089a(0x241)]);break;default:throw new Error('[PendingState]:\x20unhandled\x20univer\x20type:\x20'+this[_0x15089a(0x376)]+_0x15089a(0x471));}const {changeset:_0x5cb1cc,pendingMutations:_0x31adb6}=_0x20c087;this[_0x15089a(0x28f)][_0x15089a(0x22b)](_0x5cb1cc);const _0x4fc22a=_0x31adb6[_0x15089a(0x3ec)]?this[_0x15089a(0x370)][_0x15089a(0x439)](AwaitingWithPendingState,this[_0x15089a(0x398)],this['type'],_0x5cb1cc,_0x31adb6,this['_handler'],void 0x0):this[_0x15089a(0x370)][_0x15089a(0x439)](AwaitingState,this[_0x15089a(0x398)],this[_0x15089a(0x376)],_0x5cb1cc,this['_handler']);_0x4fc22a[_0x15089a(0x252)](),this[_0x15089a(0x28f)][_0x15089a(0x339)](this,_0x4fc22a);},_0x12a235);}[_0x8dd24f(0x2cd)](){const _0x4900f6=_0x8dd24f;var _0x3ac55d;const _0x3b39a9=this[_0x4900f6(0x3a9)][_0x4900f6(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x3ac55d=_0x3b39a9===null||_0x3b39a9===void 0x0?void 0x0:_0x3b39a9[_0x4900f6(0x255)])!==null&&_0x3ac55d!==void 0x0?_0x3ac55d:DEFAULT_SEND_CHANGESET_TIMEOUT;}[_0x8dd24f(0x224)](){const _0x54ad13=_0x8dd24f;throw new Error(_0x54ad13(0x20c));}['_clearScheduledTask'](){const _0x357af4=_0x8dd24f;this[_0x357af4(0x1c4)]!=null&&(clearTimeout(this['_sendingTimer']),this[_0x357af4(0x1c4)]=null);}[_0x8dd24f(0x3e8)](_0x47e8c8){const _0x52f2a4=_0x8dd24f;return this['_clearScheduledTask'](),this[_0x52f2a4(0x370)][_0x52f2a4(0x439)](ConflictState,this[_0x52f2a4(0x398)],this[_0x52f2a4(0x376)],null,this['_pendingMutations'],this['_handler'],_0x47e8c8);}};PendingState=_PendingState=__decorate([__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x6,(0x0,_univerjs_core[_0x8dd24f(0x465)])(MemberService)),__decorateParam(0x7,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x8,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0x9,_univerjs_core['IConfigService']),__decorateParam(0xa,_univerjs_pro_collaboration[_0x8dd24f(0x3a6)]),__decorateParam(0xb,_univerjs_core[_0x8dd24f(0x39f)]),__decorateParam(0xc,_univerjs_core['IUndoRedoService']),__decorateParam(0xd,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],PendingState);let AwaitingState=_AwaitingState=class AwaitingState extends CollaborationState{constructor(_0x5355ce,_0x4c28f3,_0x17615a,_0x72338f,_0x4cd088,_0x5d5381,_0x2c25bc,_0x3c5376,_0x2f7b17,_0xd78862,_0x2fadcf){const _0x59a781=_0x8dd24f;super(_0x5355ce,_0x4c28f3,_0x17615a,[],_0x72338f,_0x2c25bc,_0xd78862,_0x5d5381,_0x2fadcf),this['_injector']=_0x4cd088,this[_0x59a781(0x305)]=_0x3c5376,this[_0x59a781(0x3f2)]=_0x2f7b17,_defineProperty(this,_0x59a781(0x2db),_0x59a781(0x207)),_defineProperty(this,_0x59a781(0x1d4),0x0),_defineProperty(this,_0x59a781(0x350),0x0),_defineProperty(this,_0x59a781(0x2d5),void 0x0),_defineProperty(this,_0x59a781(0x265),void 0x0);}['appendMutation'](_0x3cd63e){const _0x351f16=_0x8dd24f;this[_0x351f16(0x1c7)]();const _0x44387e=this['_injector']['createInstance'](AwaitingWithPendingState,this[_0x351f16(0x398)],this[_0x351f16(0x376)],this[_0x351f16(0x288)],[_0x3cd63e],this[_0x351f16(0x28f)],this['_resendTimer']);return _0x44387e[_0x351f16(0x252)](),_0x44387e;}['onRemoteChangeset'](_0x127c39){const _0x1c7fec=_0x8dd24f;if(this[_0x1c7fec(0x29a)](_0x127c39))return this[_0x1c7fec(0x1c7)](),this[_0x1c7fec(0x370)][_0x1c7fec(0x439)](FetchingMissState,this['unitID'],this[_0x1c7fec(0x376)],this[_0x1c7fec(0x288)],[],null,[_0x127c39],this[_0x1c7fec(0x28f)]);try{const _0x172c55=this[_0x1c7fec(0x3f2)][_0x1c7fec(0x37a)]([_0x127c39],[this['_awaitingChangeset']],![]);if((0x0,_univerjs_pro_collaboration[_0x1c7fec(0x29e)])(_0x172c55)){const {c1Prime:_0x1583fc,c2Prime:_0x5ecc11}=_0x172c55;this[_0x1c7fec(0x257)](_0x1583fc[0x0]),_0x5ecc11[0x0]['baseRev']=this[_0x1c7fec(0x1cc)](),this[_0x1c7fec(0x1c7)]();const _0x372bd8=this['_injector']['createInstance'](_AwaitingState,this[_0x1c7fec(0x398)],this['type'],_0x5ecc11[0x0],this[_0x1c7fec(0x28f)]);return _0x372bd8[_0x1c7fec(0x252)](),_0x372bd8;}throw _0x172c55[_0x1c7fec(0x35a)];}catch(_0x4446bd){return this['_logService']['error'](_0x4446bd),this[_0x1c7fec(0x3e8)](![]);}}[_0x8dd24f(0x21b)](_0x243a97){const _0x19beac=_0x8dd24f;this[_0x19beac(0x1c7)]();const _0x1cdad4=this[_0x19beac(0x340)][_0x19beac(0x329)](this[_0x19beac(0x398)]);if(_0x243a97[_0x19beac(0x276)]<=_0x1cdad4)return this;if(this[_0x19beac(0x29a)](_0x243a97))return this[_0x19beac(0x370)][_0x19beac(0x439)](FetchingMissState,this[_0x19beac(0x398)],this['type'],this[_0x19beac(0x288)],[],_0x243a97[_0x19beac(0x276)],[],this[_0x19beac(0x28f)]);this['_incrementRevisionNumber']();const _0x4762ef=this[_0x19beac(0x370)]['createInstance'](SyncedState,this[_0x19beac(0x398)],this[_0x19beac(0x376)],this[_0x19beac(0x28f)]);return _0x4762ef[_0x19beac(0x252)](),_0x4762ef;}['onRemoteRej'](_0x382fa5){const _0x1985e4=_0x8dd24f;return this[_0x1985e4(0x3e8)](!!(_0x382fa5===null||_0x382fa5===void 0x0?void 0x0:_0x382fa5['isPermissionRej']));}['onRemoteRetry'](_0x2bf4cf){const _0x19f0f4=_0x8dd24f;if(this[_0x19f0f4(0x350)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x19f0f4(0x461)]();return this[_0x19f0f4(0x2d5)]=createTimerObservable$(this['_resendTimeout'],{'timeout':this[_0x19f0f4(0x1d4)],'reqId':_0x2bf4cf['reqId']}),this[_0x19f0f4(0x265)]=this[_0x19f0f4(0x2d5)][_0x19f0f4(0x1e7)](({reqId:_0x1f9bbf,timeout:_0x3f95e4})=>{const _0x203671=_0x19f0f4;this[_0x203671(0x395)](_0x1f9bbf,_0x3f95e4);}),this;}[_0x8dd24f(0x461)](){const _0x40c283=_0x8dd24f;return this[_0x40c283(0x1c7)](),this['_injector'][_0x40c283(0x439)](OfflineState,this[_0x40c283(0x398)],this['type'],this[_0x40c283(0x288)],[],this[_0x40c283(0x28f)]);}['toggleOnline'](){return this;}[_0x8dd24f(0x224)](){const _0x4839a0=_0x8dd24f;this[_0x4839a0(0x28f)]['onSendChangeset'](this['_awaitingChangeset']);}['_onConflict'](_0x5c3413){const _0x55eb85=_0x8dd24f;return this['_clearScheduledTask'](),this[_0x55eb85(0x370)][_0x55eb85(0x439)](ConflictState,this[_0x55eb85(0x398)],this[_0x55eb85(0x376)],this[_0x55eb85(0x288)],[],this['_handler'],_0x5c3413);}['_resendWithTimeout'](_0x1322d8,_0x39f386){const _0x20f41c=_0x8dd24f;var _0x5692d7;_0x1322d8===((_0x5692d7=this[_0x20f41c(0x288)])===null||_0x5692d7===void 0x0?void 0x0:_0x5692d7[_0x20f41c(0x41e)])&&(this[_0x20f41c(0x224)](),this[_0x20f41c(0x1d4)]=_0x39f386===0x0?0x3e8:Math[_0x20f41c(0x3e3)](_0x39f386*0x2,MAX_RETRY_TIMEOUT),this['_maxTotalRetryTimeout']+=this[_0x20f41c(0x1d4)]);}[_0x8dd24f(0x1c7)](){const _0x349b05=_0x8dd24f;var _0x3f53b5;(_0x3f53b5=this['_sender'])===null||_0x3f53b5===void 0x0||_0x3f53b5[_0x349b05(0x356)](),this[_0x349b05(0x1d4)]=0x0,this[_0x349b05(0x350)]=0x0;}};AwaitingState=_AwaitingState=__decorate([__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x6,_univerjs_core['ICommandService']),__decorateParam(0x7,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x8,_univerjs_pro_collaboration[_0x8dd24f(0x3a6)]),__decorateParam(0x9,_univerjs_core[_0x8dd24f(0x275)]),__decorateParam(0xa,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],AwaitingState);let AwaitingWithPendingState=_AwaitingWithPendingState=class AwaitingWithPendingState extends CollaborationState{constructor(_0x242bc3,_0x3d02c0,_0x2bef84,_0x398709,_0x33bec5,_0x50fae8,_0x136b80,_0x2283ae,_0x1a894e,_0x29cd56,_0x44519f,_0x12945c,_0xe36a6c){const _0x152caf=_0x8dd24f;super(_0x242bc3,_0x3d02c0,_0x2bef84,_0x398709,_0x33bec5,_0x1a894e,_0x12945c,_0x2283ae,_0xe36a6c),this[_0x152caf(0x370)]=_0x136b80,this[_0x152caf(0x305)]=_0x29cd56,this[_0x152caf(0x3f2)]=_0x44519f,this[_0x152caf(0x409)]=_0xe36a6c,_defineProperty(this,_0x152caf(0x2db),_0x152caf(0x32b)),_defineProperty(this,_0x152caf(0x1d4),0x0),_defineProperty(this,_0x152caf(0x350),0x0),_defineProperty(this,_0x152caf(0x2d5),void 0x0),_defineProperty(this,_0x152caf(0x265),void 0x0),_0x50fae8&&(this['_resendTimer']=_0x50fae8,this[_0x152caf(0x265)]=this[_0x152caf(0x2d5)][_0x152caf(0x1e7)](({reqId:_0x3324b5,timeout:_0x39055b})=>{this['_resendWithTimeout'](_0x3324b5,_0x39055b);}));}['appendMutation'](_0x5a6a69){const _0x464ed6=_0x8dd24f;return this[_0x464ed6(0x36c)][_0x464ed6(0x405)](_0x5a6a69),this;}['onRemoteChangeset'](_0x133ee6){const _0xc63195=_0x8dd24f;if(this['_checkMissing'](_0x133ee6))return this[_0xc63195(0x1c7)](),this['_injector'][_0xc63195(0x439)](FetchingMissState,this[_0xc63195(0x398)],this[_0xc63195(0x376)],this['_awaitingChangeset'],this[_0xc63195(0x36c)],null,[_0x133ee6],this['_handler']);try{const _0xf50792=this[_0xc63195(0x3f2)][_0xc63195(0x37a)]([_0x133ee6],[this[_0xc63195(0x288)]],![]);if((0x0,_univerjs_pro_collaboration[_0xc63195(0x29e)])(_0xf50792)){const {c1Prime:_0x1e5bd5,c2Prime:_0x37a8c8}=_0xf50792,_0x1dfa01=this['_transformService'][_0xc63195(0x335)](_0x1e5bd5[0x0],this[_0xc63195(0x36c)]);if((0x0,_univerjs_pro_collaboration[_0xc63195(0x428)])(_0x1dfa01)){const {c1Prime:_0xd5d22b,m2Prime:_0x5d2325}=_0x1dfa01;return this[_0xc63195(0x257)](_0xd5d22b),_0x37a8c8[0x0][_0xc63195(0x1f5)]=this['_getCurrentRevision'](),this[_0xc63195(0x1c7)](),this['_injector'][_0xc63195(0x439)](_AwaitingWithPendingState,this['unitID'],this[_0xc63195(0x376)],_0x37a8c8[0x0],_0x5d2325,this[_0xc63195(0x28f)],void 0x0);}throw _0x1dfa01['error'];}throw _0xf50792['error'];}catch(_0xd3c54e){return this[_0xc63195(0x305)][_0xc63195(0x35a)](_0xd3c54e),this[_0xc63195(0x3e8)](![]);}}['onRemoteAck'](_0x314d1e){const _0xfddaa3=_0x8dd24f;this['_clearScheduledTask']();const _0xeac692=this[_0xfddaa3(0x1cc)]();if(_0x314d1e[_0xfddaa3(0x276)]<=_0xeac692)return this;if(this[_0xfddaa3(0x29a)](_0x314d1e))return this[_0xfddaa3(0x370)][_0xfddaa3(0x439)](FetchingMissState,this['unitID'],this[_0xfddaa3(0x376)],this[_0xfddaa3(0x288)],this[_0xfddaa3(0x36c)],_0x314d1e['revision'],[],this[_0xfddaa3(0x28f)]);this[_0xfddaa3(0x390)]();const _0x8f8429=this[_0xfddaa3(0x370)][_0xfddaa3(0x439)](PendingState,this[_0xfddaa3(0x398)],this[_0xfddaa3(0x376)],this['_pendingMutations'],this['_handler']);return _0x8f8429['_schedule'](),_0x8f8429['_updateLocalCache'](),_0x8f8429;}['onRemoteRej'](_0x1ec4cb){const _0x5a9789=_0x8dd24f;return this[_0x5a9789(0x3e8)](!!(_0x1ec4cb===null||_0x1ec4cb===void 0x0?void 0x0:_0x1ec4cb[_0x5a9789(0x463)]));}['onRemoteRetry'](_0x576f40){const _0x53e99a=_0x8dd24f;if(this[_0x53e99a(0x350)]>MAX_RETRY_TOTAL_TIMEOUT)return this['toggleOffline']();return this[_0x53e99a(0x2d5)]=createTimerObservable$(this['_resendTimeout'],{'timeout':this['_resendTimeout'],'reqId':_0x576f40['reqId']}),this[_0x53e99a(0x265)]=this['_resendTimer']['subscribe'](({reqId:_0x2013e5,timeout:_0x269832})=>{const _0x469fce=_0x53e99a;this[_0x469fce(0x395)](_0x2013e5,_0x269832);}),this;}[_0x8dd24f(0x461)](){const _0x1d01e8=_0x8dd24f;return this[_0x1d01e8(0x1c7)](),this[_0x1d01e8(0x370)][_0x1d01e8(0x439)](OfflineState,this[_0x1d01e8(0x398)],this[_0x1d01e8(0x376)],this[_0x1d01e8(0x288)],this[_0x1d01e8(0x36c)],this[_0x1d01e8(0x28f)]);}[_0x8dd24f(0x464)](){return this;}['resend'](){const _0x1d9329=_0x8dd24f;this[_0x1d9329(0x28f)][_0x1d9329(0x22b)](this[_0x1d9329(0x288)]);}[_0x8dd24f(0x3e8)](_0x337500){const _0x13f4ed=_0x8dd24f;return this[_0x13f4ed(0x1c7)](),this[_0x13f4ed(0x370)][_0x13f4ed(0x439)](ConflictState,this[_0x13f4ed(0x398)],this[_0x13f4ed(0x376)],null,this['_pendingMutations'],this[_0x13f4ed(0x28f)],_0x337500);}[_0x8dd24f(0x395)](_0x53c18c,_0x280d83){const _0xfb774b=_0x8dd24f;var _0x11a796;_0x53c18c===((_0x11a796=this[_0xfb774b(0x288)])===null||_0x11a796===void 0x0?void 0x0:_0x11a796[_0xfb774b(0x41e)])&&(this[_0xfb774b(0x224)](),this[_0xfb774b(0x1d4)]=_0x280d83===0x0?0x3e8:Math[_0xfb774b(0x3e3)](_0x280d83*0x2,MAX_RETRY_TIMEOUT),this[_0xfb774b(0x350)]+=this[_0xfb774b(0x1d4)]);}[_0x8dd24f(0x1c7)](){const _0x2cb143=_0x8dd24f;var _0x467f3a;(_0x467f3a=this[_0x2cb143(0x265)])===null||_0x467f3a===void 0x0||_0x467f3a[_0x2cb143(0x356)](),this[_0x2cb143(0x1d4)]=0x0,this[_0x2cb143(0x350)]=0x0;}};AwaitingWithPendingState=_AwaitingWithPendingState=__decorate([__decorateParam(0x6,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x8,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0x9,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0xa,_univerjs_pro_collaboration[_0x8dd24f(0x3a6)]),__decorateParam(0xb,_univerjs_core[_0x8dd24f(0x275)]),__decorateParam(0xc,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],AwaitingWithPendingState);let ConflictState=class ConflictState extends CollaborationState{constructor(_0x2ac000,_0x5be62a,_0x47e1bd,_0x3059ca,_0x56375f,_0x663890=![],_0x29ddb8,_0x38d3a7,_0x3a8659,_0x5650b1,_0x48aefc,_0x16ff4e,_0x5ac32f){const _0x3f5d3b=_0x8dd24f;super(_0x2ac000,_0x5be62a,_0x47e1bd,_0x3059ca,_0x56375f,_0x38d3a7,_0x3a8659,_0x5650b1,_0x5ac32f),this[_0x3f5d3b(0x30d)]=_0x663890,this['_permissionService']=_0x29ddb8,this[_0x3f5d3b(0x2ac)]=_0x48aefc,this[_0x3f5d3b(0x334)]=_0x16ff4e,this['localCacheService']=_0x5ac32f,_defineProperty(this,_0x3f5d3b(0x2db),_0x3f5d3b(0x446)),this['_showConflictNotification'](),this[_0x3f5d3b(0x1da)](),this[_0x3f5d3b(0x321)]();}[_0x8dd24f(0x1de)](){return this;}['onRemoteChangeset'](){return this;}[_0x8dd24f(0x21b)](){return this;}['onRemoteRej'](){return this;}[_0x8dd24f(0x2d6)](){return this;}[_0x8dd24f(0x461)](){return this;}[_0x8dd24f(0x464)](){return this;}[_0x8dd24f(0x224)](){const _0x46e61b=_0x8dd24f;throw new Error(_0x46e61b(0x2e5));}[_0x8dd24f(0x1da)](){const _0x43cf68=_0x8dd24f;var _0x4d8c4e;(_0x4d8c4e=this[_0x43cf68(0x2f3)])===null||_0x4d8c4e===void 0x0||_0x4d8c4e[_0x43cf68(0x347)](this[_0x43cf68(0x398)],this[_0x43cf68(0x376)],null,[]);}['_showConflictNotification'](){const _0x3c6958=_0x8dd24f;if(this[_0x3c6958(0x30d)])this[_0x3c6958(0x334)]['emitEvent']({'id':_0x3c6958(0x295)});else this[_0x3c6958(0x334)][_0x3c6958(0x3a3)]({'id':'CONFLICT'});}[_0x8dd24f(0x321)](){const _0x1305d4=_0x8dd24f;this['_permissionService']['updatePermissionPoint'](new _univerjs_sheets[(_0x1305d4(0x45d))](this[_0x1305d4(0x398)])['id'],![]);}};ConflictState=__decorate([__decorateParam(0x6,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x397)])),__decorateParam(0x7,_univerjs_core['ICommandService']),__decorateParam(0x8,_univerjs_core[_0x8dd24f(0x275)]),__decorateParam(0x9,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0xa,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x436)])),__decorateParam(0xb,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService)),__decorateParam(0xc,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],ConflictState);let OfflineState=class OfflineState extends CollaborationState{constructor(_0x440a41,_0x3e72e5,_0x379690,_0xf5fa5a,_0x414947,_0x42c7f3,_0x2c70b0,_0x47e47f,_0x987c5f,_0x589825){const _0x568a61=_0x8dd24f;super(_0x440a41,_0x3e72e5,_0x379690,_0xf5fa5a,_0x414947,_0x47e47f,_0x987c5f,_0x2c70b0,_0x589825),this[_0x568a61(0x370)]=_0x42c7f3,_defineProperty(this,_0x568a61(0x2db),_0x568a61(0x43a));}[_0x8dd24f(0x1de)](_0x4a6c73){const _0x597339=_0x8dd24f;return this[_0x597339(0x36c)][_0x597339(0x405)](_0x4a6c73),this[_0x597339(0x252)](),this;}[_0x8dd24f(0x1fd)](_0x283572){const _0x50486d=_0x8dd24f;throw new Error(_0x50486d(0x36e));}[_0x8dd24f(0x21b)](){const _0x1ca213=_0x8dd24f;throw new Error(_0x1ca213(0x1bc));}[_0x8dd24f(0x2ee)](){throw new Error('[OfflineState]:\x20received\x20rejection.');}[_0x8dd24f(0x2d6)](){return this;}[_0x8dd24f(0x461)](){return this;}[_0x8dd24f(0x464)](){const _0x45e03d=_0x8dd24f,{_injector:_0x3dd802,_pendingMutations:_0x1134f7,_awaitingChangeset:_0x5333ec,unitID:_0x42b938,_handler:_0x2f6d12,type:_0x5ce849}=this,_0x24fcbd=createOnlineState(_0x3dd802,_0x42b938,_0x5ce849,_0x5333ec,_0x1134f7,_0x2f6d12);if(_0x24fcbd instanceof PendingState)_0x24fcbd[_0x45e03d(0x472)]();else{if(_0x24fcbd instanceof AwaitingWithPendingState||_0x24fcbd instanceof AwaitingState)_0x24fcbd[_0x45e03d(0x224)]();}return _0x24fcbd;}['resend'](){const _0x443eca=_0x8dd24f;throw new Error(_0x443eca(0x369));}};OfflineState=__decorate([__decorateParam(0x5,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x6,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x7,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0x8,_univerjs_core['IUndoRedoService']),__decorateParam(0x9,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],OfflineState);let FetchingMissState=class FetchingMissState extends CollaborationState{constructor(_0x5bf86a,_0x22798b,_0x1c13be,_0x11b95c,_0x1b5ae3,_0x3402a3,_0x14270b,_0x3561a8,_0x57c51d,_0x4bc5b3,_0x16761e,_0x432055,_0x37b55a,_0x4a02ed){const _0x19c11e=_0x8dd24f;super(_0x5bf86a,_0x22798b,_0x1c13be,_0x11b95c,_0x14270b,_0x16761e,_0x432055,_0x57c51d,_0x4a02ed),this[_0x19c11e(0x41d)]=_0x1b5ae3,this[_0x19c11e(0x337)]=_0x3402a3,this[_0x19c11e(0x370)]=_0x3561a8,this[_0x19c11e(0x305)]=_0x4bc5b3,this[_0x19c11e(0x3f2)]=_0x37b55a,this[_0x19c11e(0x409)]=_0x4a02ed,_defineProperty(this,_0x19c11e(0x2db),_0x19c11e(0x259));}[_0x8dd24f(0x325)](_0x3b788e){const _0x4e7550=_0x8dd24f;try{if(this[_0x4e7550(0x280)](_0x3b788e)[_0x4e7550(0x450)])throw new Error('[FetchMissState]:\x20missing\x20changesets\x20response\x20still\x20has\x20revision\x20gaps.');if(this[_0x4e7550(0x280)]([...this['_queuedRemoteChangesets']][_0x4e7550(0x21c)]((_0x11752a,_0x473809)=>_0x11752a[_0x4e7550(0x276)]-_0x473809[_0x4e7550(0x276)]))['missingChangesets'])return this[_0x4e7550(0x337)]=[],this[_0x4e7550(0x252)](),this['_handler']['onMissingChangesets']({'from':this[_0x4e7550(0x1cc)](),'to':0x0}),this;const _0x4a426f=this['_awaitingChangeset'],_0x1b8f63=this[_0x4e7550(0x36c)];let _0x192938;if(_0x4a426f&&_0x1b8f63[_0x4e7550(0x3ec)]!==0x0)_0x192938=this[_0x4e7550(0x370)][_0x4e7550(0x439)](AwaitingWithPendingState,this[_0x4e7550(0x398)],this['type'],_0x4a426f,_0x1b8f63,this['_handler'],void 0x0);else{if(_0x4a426f&&_0x1b8f63[_0x4e7550(0x3ec)]===0x0)_0x4a426f[_0x4e7550(0x1f5)]=this[_0x4e7550(0x1cc)](),_0x192938=this[_0x4e7550(0x370)][_0x4e7550(0x439)](AwaitingState,this[_0x4e7550(0x398)],this[_0x4e7550(0x376)],_0x4a426f,this[_0x4e7550(0x28f)]);else{if(_0x1b8f63['length']!==0x0){const _0x3b59e0=this[_0x4e7550(0x370)][_0x4e7550(0x439)](PendingState,this[_0x4e7550(0x398)],this['type'],_0x1b8f63,this[_0x4e7550(0x28f)]);_0x3b59e0[_0x4e7550(0x472)](),_0x192938=_0x3b59e0;}else _0x192938=this[_0x4e7550(0x370)][_0x4e7550(0x439)](SyncedState,this[_0x4e7550(0x398)],this[_0x4e7550(0x376)],this[_0x4e7550(0x28f)]);}}return _0x192938[_0x4e7550(0x252)](),_0x192938;}catch(_0x4c672c){return this['_logService'][_0x4e7550(0x35a)](_0x4e7550(0x1d1),_0x4e7550(0x486),_0x4c672c),this[_0x4e7550(0x370)][_0x4e7550(0x439)](ConflictState,this['unitID'],this[_0x4e7550(0x376)],this[_0x4e7550(0x288)],this['_pendingMutations'],this[_0x4e7550(0x28f)],![]);}}[_0x8dd24f(0x280)](_0x55c4df){const _0x48f89a=_0x8dd24f;this[_0x48f89a(0x2e2)]();for(let _0x1acef5=0x0;_0x1acef5<_0x55c4df[_0x48f89a(0x3ec)];_0x1acef5++){const _0x1e2632=_0x55c4df[_0x1acef5],_0x3c4aad=this[_0x48f89a(0x1cc)]();if(_0x1e2632[_0x48f89a(0x276)]<=_0x3c4aad)continue;if(_0x1e2632[_0x48f89a(0x276)]>_0x3c4aad+0x1)return{'missingChangesets':!![]};if(this[_0x48f89a(0x328)](_0x1e2632)){this['_acknowledgeAwaiting']();continue;}this['_transformAndApplyRemoteChangeset'](_0x1e2632),this[_0x48f89a(0x2e2)]();}return{'missingChangesets':![]};}[_0x8dd24f(0x2f2)](_0x44764a){const _0x4b7645=_0x8dd24f;let _0xfd5e89=_0x44764a,_0x2d4e52=this[_0x4b7645(0x288)];if(_0x2d4e52){const _0x2f23f5=this['_transformService'][_0x4b7645(0x37a)]([_0x44764a],[_0x2d4e52],![]);if(!(0x0,_univerjs_pro_collaboration[_0x4b7645(0x29e)])(_0x2f23f5))throw _0x2f23f5[_0x4b7645(0x35a)];_0xfd5e89=_0x2f23f5['c1Prime'][0x0],_0x2d4e52=_0x2f23f5['c2Prime'][0x0];}let _0x150c79=this[_0x4b7645(0x36c)];if(_0x150c79[_0x4b7645(0x3ec)]){const _0x2e5961=this['_transformService']['transformMutationsWithChangeset'](_0xfd5e89,_0x150c79);if(!(0x0,_univerjs_pro_collaboration['isTransformMutationsWithChangesetSuccess'])(_0x2e5961))throw _0x2e5961[_0x4b7645(0x35a)];_0xfd5e89=_0x2e5961[_0x4b7645(0x3cf)],_0x150c79=_0x2e5961[_0x4b7645(0x28b)];}this[_0x4b7645(0x257)](_0xfd5e89);if(_0x2d4e52)_0x2d4e52['baseRev']=this[_0x4b7645(0x1cc)]();this['_awaitingChangeset']=_0x2d4e52,this[_0x4b7645(0x36c)]=_0x150c79;}[_0x8dd24f(0x2e2)](){const _0x68b999=_0x8dd24f;if(!this[_0x68b999(0x288)]||this['_acknowledgedAwaitingRevision']==null)return;const _0x2ed502=this[_0x68b999(0x1cc)]();if(this[_0x68b999(0x41d)]<=_0x2ed502)throw new Error(_0x68b999(0x27a)+this[_0x68b999(0x41d)]+'.');if(this[_0x68b999(0x41d)]===_0x2ed502+0x1)this[_0x68b999(0x256)]();}[_0x8dd24f(0x256)](){const _0x1c5582=_0x8dd24f;this[_0x1c5582(0x390)](),this[_0x1c5582(0x288)]=null,this[_0x1c5582(0x41d)]=null;}['_isEchoedAwaitingChangeset'](_0x3738ff){const _0x38a6fb=_0x8dd24f,_0x20c02c=this[_0x38a6fb(0x288)];if(!_0x20c02c)return![];if(!_0x20c02c['sid']||_0x20c02c[_0x38a6fb(0x41e)]===null||_0x20c02c['reqId']===void 0x0)return![];return _0x3738ff[_0x38a6fb(0x398)]===_0x20c02c['unitID']&&_0x3738ff[_0x38a6fb(0x413)]===_0x20c02c[_0x38a6fb(0x413)]&&_0x3738ff['reqId']===_0x20c02c[_0x38a6fb(0x41e)];}[_0x8dd24f(0x224)](){const _0x6794a0=_0x8dd24f;throw new Error(_0x6794a0(0x1af));}[_0x8dd24f(0x1de)](_0x59c380){const _0x29959d=_0x8dd24f;return this[_0x29959d(0x36c)][_0x29959d(0x405)](_0x59c380),this;}['onRemoteChangeset'](_0xd3be22){const _0x8570c2=_0x8dd24f;return this[_0x8570c2(0x337)][_0x8570c2(0x405)](_0xd3be22),this;}['onRemoteAck'](_0x4565c6){const _0x3e677e=_0x8dd24f;if(this[_0x3e677e(0x288)]){const _0x219416=this[_0x3e677e(0x1cc)]();if(_0x4565c6[_0x3e677e(0x276)]<=_0x219416)return this;else{if(_0x219416+0x1===_0x4565c6[_0x3e677e(0x276)])this[_0x3e677e(0x390)](),this[_0x3e677e(0x288)]=null,this['_acknowledgedAwaitingRevision']=null;else this[_0x3e677e(0x41d)]=_0x4565c6[_0x3e677e(0x276)];}return this;}if(_0x4565c6[_0x3e677e(0x276)]<=this['_getCurrentRevision']())return this;throw new Error(_0x3e677e(0x37d));}[_0x8dd24f(0x2ee)](_0x2af8f4){return this['_onConflict'](!!(_0x2af8f4===null||_0x2af8f4===void 0x0?void 0x0:_0x2af8f4['isPermissionRej']));}[_0x8dd24f(0x2d6)](){return this;}['toggleOffline'](){const _0xd7f191=_0x8dd24f;return this[_0xd7f191(0x370)]['createInstance'](OfflineState,this['unitID'],this[_0xd7f191(0x376)],this[_0xd7f191(0x288)],this[_0xd7f191(0x36c)],this[_0xd7f191(0x28f)]);}[_0x8dd24f(0x464)](){return this;}[_0x8dd24f(0x3e8)](_0x30f767){const _0x3b76c8=_0x8dd24f;return this[_0x3b76c8(0x370)]['createInstance'](ConflictState,this[_0x3b76c8(0x398)],this[_0x3b76c8(0x376)],this[_0x3b76c8(0x288)],this[_0x3b76c8(0x36c)],this['_handler'],_0x30f767);}};FetchingMissState=__decorate([__decorateParam(0x7,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x8,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x9,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0xa,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0xb,_univerjs_core[_0x8dd24f(0x275)]),__decorateParam(0xc,_univerjs_pro_collaboration['ITransformService']),__decorateParam(0xd,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],FetchingMissState);function createOnlineState(_0x2a0bbe,_0xe4334c,_0x373078,_0x23022e,_0x5c36cc,_0x1680f7){const _0x5e10a8=_0x8dd24f;if(_0x23022e&&_0x5c36cc[_0x5e10a8(0x3ec)])return _0x2a0bbe['createInstance'](AwaitingWithPendingState,_0xe4334c,_0x373078,_0x23022e,_0x5c36cc,_0x1680f7,void 0x0);if(_0x23022e)return _0x2a0bbe[_0x5e10a8(0x439)](AwaitingState,_0xe4334c,_0x373078,_0x23022e,_0x1680f7);if(_0x5c36cc[_0x5e10a8(0x3ec)])return _0x2a0bbe[_0x5e10a8(0x439)](PendingState,_0xe4334c,_0x373078,_0x5c36cc,_0x1680f7);return _0x2a0bbe['createInstance'](SyncedState,_0xe4334c,_0x373078,_0x1680f7);}let CollaborationEntity=class CollaborationEntity extends _univerjs_core[_0x8dd24f(0x45c)]{get[_0x8dd24f(0x1f7)](){const _0x52c7d7=_0x8dd24f;return this[_0x52c7d7(0x1e6)];}constructor(_0x1b74bd,_0x19d55e,_0x1af812,_0x40d631,_0xa105d9,_0x5ee753,_0x3dfa43,_0x14673f,_0xf9e5f3,_0x118930,_0x510924,_0x21a574,_0x49772b,_0x1feef2){const _0x2847d6=_0x8dd24f;super(),this['unitID']=_0x1b74bd,this['session']=_0x19d55e,this[_0x2847d6(0x3de)]=_0x1af812,this[_0x2847d6(0x370)]=_0x40d631,this[_0x2847d6(0x35b)]=_0xa105d9,this[_0x2847d6(0x2ac)]=_0x5ee753,this['_revisionService']=_0x3dfa43,this[_0x2847d6(0x1e0)]=_0x14673f,this['_univerInstanceService']=_0xf9e5f3,this[_0x2847d6(0x305)]=_0x118930,this[_0x2847d6(0x435)]=_0x510924,this[_0x2847d6(0x2a1)]=_0x21a574,this[_0x2847d6(0x236)]=_0x49772b,this[_0x2847d6(0x2f3)]=_0x1feef2,_defineProperty(this,_0x2847d6(0x1e3),new rxjs[(_0x2847d6(0x33f))](null)),_defineProperty(this,'state$',this[_0x2847d6(0x1e3)][_0x2847d6(0x2a8)]()),_defineProperty(this,'_state',void 0x0),_defineProperty(this,_0x2847d6(0x3fa),![]),_defineProperty(this,_0x2847d6(0x3c8),''),_defineProperty(this,'_changesetReqId',0x0),_defineProperty(this,_0x2847d6(0x48e),this[_0x2847d6(0x1f9)][_0x2847d6(0x37f)]((0x0,rxjs['map'])(_0xec0940=>{const _0xe24e7a=_0x2847d6;if(_0xec0940)return _0xec0940[_0xe24e7a(0x2db)];return _0xe24e7a(0x43a);}),(0x0,rxjs[_0x2847d6(0x267)])(0x1))),_defineProperty(this,_0x2847d6(0x47b),![]),_defineProperty(this,_0x2847d6(0x27c),[]);}async[_0x8dd24f(0x223)](){const _0xbdf557=_0x8dd24f;if(this[_0xbdf557(0x1f7)])throw new Error('[CollaborationEntity]:\x20initial\x20state\x20has\x20been\x20created\x20before.\x20You\x20should\x20not\x20call\x20\x22init\x22\x20twice.');await this[_0xbdf557(0x482)]();}[_0x8dd24f(0x3f7)](){const _0x4ea0c2=_0x8dd24f;return this[_0x4ea0c2(0x3fa)]=!![],(0x0,_univerjs_core[_0x4ea0c2(0x3d4)])(()=>{const _0x6f8e2d=_0x4ea0c2;this[_0x6f8e2d(0x3fa)]=![],this[_0x6f8e2d(0x399)]();});}[_0x8dd24f(0x412)](_0x2ba78a){this['_onLocalMutation'](_0x2ba78a);}[_0x8dd24f(0x42a)](_0x2c2e2d){const _0x16b6fc=_0x8dd24f;this[_0x16b6fc(0x1e6)]=_0x2c2e2d,this[_0x16b6fc(0x1e3)][_0x16b6fc(0x368)](_0x2c2e2d);}async['_init'](){const _0xc5608d=_0x8dd24f;this[_0xc5608d(0x42a)](await this[_0xc5608d(0x2ef)]());if(this[_0xc5608d(0x236)]){var _0x599c7c;(_0x599c7c=this[_0xc5608d(0x236)])===null||_0x599c7c===void 0x0||_0x599c7c[_0xc5608d(0x2fe)](this[_0xc5608d(0x398)]),this[_0xc5608d(0x2fb)](this[_0xc5608d(0x236)][_0xc5608d(0x2c8)](this['unitID'])[_0xc5608d(0x1e7)](_0x2ad82b=>{const _0x2c6b2c=_0xc5608d;this[_0x2c6b2c(0x305)][_0x2c6b2c(0x458)](_0x2c6b2c(0x3cc),_0x2c6b2c(0x286),_0x2ad82b),_0x2ad82b===0x1?(this[_0x2c6b2c(0x1e0)][_0x2c6b2c(0x3a3)]({'id':_0x2c6b2c(0x1eb)}),this[_0x2c6b2c(0x2a1)][_0x2c6b2c(0x1c8)](new _univerjs_sheets[(_0x2c6b2c(0x45d))](this[_0x2c6b2c(0x398)])['id'],![]),this['_permissionService']['setShowComponents'](![])):(this[_0x2c6b2c(0x2a1)][_0x2c6b2c(0x1c8)](new _univerjs_sheets[(_0x2c6b2c(0x45d))](this[_0x2c6b2c(0x398)])['id'],!![]),this[_0x2c6b2c(0x2a1)][_0x2c6b2c(0x2ce)](!![]));}));}let _0x9e225e=![];return this[_0xc5608d(0x2fb)](this[_0xc5608d(0x453)][_0xc5608d(0x222)][_0xc5608d(0x1e7)](_0x4902db=>{const _0x74078b=_0xc5608d;if(_0x4902db===0x3)this['_toggleOnline'](_0x9e225e);else _0x4902db===0x2&&(_0x9e225e=!![],this[_0x74078b(0x287)]());})),this[_0xc5608d(0x2fb)](this[_0xc5608d(0x453)][_0xc5608d(0x45e)]['subscribe'](_0x5b3637=>{const _0x5d4545=_0xc5608d;try{switch(_0x5b3637[_0x5d4545(0x468)]){case _univerjs_pro_collaboration['CollaborationEvent'][_0x5d4545(0x2b9)]:this[_0x5d4545(0x249)]((0x0,_univerjs_pro_collaboration['parseProtocolChangeset'])(_0x5b3637[_0x5d4545(0x332)]));break;case _univerjs_pro_collaboration[_0x5d4545(0x2ed)][_0x5d4545(0x30b)]:this['_onRemoteACK'](_0x5b3637[_0x5d4545(0x332)]);break;case _univerjs_pro_collaboration[_0x5d4545(0x2ed)][_0x5d4545(0x417)]:this['_onRemoteRejected']();break;case _univerjs_pro_collaboration[_0x5d4545(0x2ed)][_0x5d4545(0x2c4)]:this[_0x5d4545(0x354)](_0x5b3637[_0x5d4545(0x332)]);break;case _univerjs_pro_collaboration[_0x5d4545(0x2ed)][_0x5d4545(0x426)]:this[_0x5d4545(0x26e)](_0x5b3637[_0x5d4545(0x332)]['changesets'][_0x5d4545(0x441)](_0x441642=>(0x0,_univerjs_pro_collaboration[_0x5d4545(0x281)])(_0x441642)));break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x5d4545(0x3d6)]:this[_0x5d4545(0x38e)]({'isPermissionRej':!![]});break;case _univerjs_pro_collaboration[_0x5d4545(0x2ed)][_0x5d4545(0x264)]:break;}}catch(_0x586841){console[_0x5d4545(0x35a)](_0x5d4545(0x481),_0x586841);throw _0x586841;}})),this['_state'];}[_0x8dd24f(0x205)](){const _0x14ef1f=_0x8dd24f;this[_0x14ef1f(0x47b)]=![];}['_lockTransition'](){const _0x33f65e=_0x8dd24f;if(this[_0x33f65e(0x47b)])throw new Error(_0x33f65e(0x3fc));this[_0x33f65e(0x47b)]=!![];}['_onLocalMutation'](_0x3cc215){const _0x4815be=_0x8dd24f;this[_0x4815be(0x353)](),this[_0x4815be(0x42a)](this[_0x4815be(0x1e6)]['appendMutation'](_0x3cc215)),this[_0x4815be(0x205)]();}[_0x8dd24f(0x249)](_0x58d35d){const _0x398e18=_0x8dd24f;if(_0x58d35d[_0x398e18(0x276)]<=this[_0x398e18(0x340)][_0x398e18(0x329)](this[_0x398e18(0x398)]))return;if(this[_0x398e18(0x3fa)]){this[_0x398e18(0x27c)]['push'](_0x58d35d);return;}this['_applyRemoteChangeset'](_0x58d35d);}[_0x8dd24f(0x399)](){const _0x50495d=_0x8dd24f;this[_0x50495d(0x27c)]['forEach'](_0x11240e=>this[_0x50495d(0x2c3)](_0x11240e)),this[_0x50495d(0x27c)]=[];}[_0x8dd24f(0x2c3)](_0x3bf060){const _0x5b40f4=_0x8dd24f,_0x28ebcb=this[_0x5b40f4(0x35b)][_0x5b40f4(0x41f)]['fetchThroughInterceptors'](this[_0x5b40f4(0x35b)]['interceptor']['getInterceptPoints']()[_0x5b40f4(0x3a2)])(_0x3bf060[_0x5b40f4(0x38a)],null)||_0x3bf060['mutations'],_0xaa56e2={..._0x3bf060,'mutations':_0x28ebcb};this[_0x5b40f4(0x353)](),this['_updateState'](this['_state'][_0x5b40f4(0x1fd)](_0xaa56e2)),this[_0x5b40f4(0x205)]();}[_0x8dd24f(0x388)](_0x850a07){const _0x5c3a07=_0x8dd24f;this[_0x5c3a07(0x353)](),this[_0x5c3a07(0x42a)](this['_state'][_0x5c3a07(0x21b)](_0x850a07)),this[_0x5c3a07(0x205)]();}[_0x8dd24f(0x38e)](_0x327d69){const _0x23f84e=_0x8dd24f;this[_0x23f84e(0x353)](),this[_0x23f84e(0x42a)](this[_0x23f84e(0x1e6)][_0x23f84e(0x2ee)](_0x327d69)),this[_0x23f84e(0x205)]();}[_0x8dd24f(0x354)](_0x2e8ae2){const _0x1c4fbe=_0x8dd24f;this[_0x1c4fbe(0x353)](),this[_0x1c4fbe(0x42a)](this['_state'][_0x1c4fbe(0x2d6)](_0x2e8ae2)),this['_unlockTransition']();}['_onFetchMissResult'](_0x5c47b2){const _0x26142c=_0x8dd24f;if(!(this[_0x26142c(0x1e6)]instanceof FetchingMissState))throw new TypeError('[CollaborationEntity]:\x20cannot\x20apply\x20missing\x20results\x20on\x20other\x20states!');const _0x555438=_0x5c47b2[_0x26142c(0x441)](_0x1d0dac=>{const _0x52ec5a=_0x26142c,_0x9b9139=this['_compressMutationService'][_0x52ec5a(0x41f)]['fetchThroughInterceptors'](this[_0x52ec5a(0x35b)][_0x52ec5a(0x41f)][_0x52ec5a(0x1ba)]()[_0x52ec5a(0x3a2)])(_0x1d0dac[_0x52ec5a(0x38a)],null)||_0x1d0dac[_0x52ec5a(0x38a)];return{..._0x1d0dac,'mutations':_0x9b9139};});this[_0x26142c(0x353)](),this['_updateState'](this['_state']['onMissedChangesetFetched'](_0x555438)),this[_0x26142c(0x205)]();}[_0x8dd24f(0x287)](){const _0x340397=_0x8dd24f;this[_0x340397(0x353)](),this[_0x340397(0x42a)](this[_0x340397(0x1e6)][_0x340397(0x461)]()),this['_unlockTransition']();}[_0x8dd24f(0x242)](_0x33b7e8=![]){const _0x4e24c6=_0x8dd24f;this[_0x4e24c6(0x353)](),this[_0x4e24c6(0x42a)](this[_0x4e24c6(0x1e6)][_0x4e24c6(0x464)]()),this[_0x4e24c6(0x205)]();const _0x5d5fce=this[_0x4e24c6(0x1e6)];_0x33b7e8&&_0x5d5fce instanceof SyncedState&&(this[_0x4e24c6(0x353)](),this[_0x4e24c6(0x42a)](_0x5d5fce[_0x4e24c6(0x2a4)]()),this['_unlockTransition']());}async[_0x8dd24f(0x2ef)](){return new Promise(_0x2c3776=>{const _0x108756=_0x17f9;this[_0x108756(0x453)]['sessionStatus$'][_0x108756(0x37f)]((0x0,rxjs[_0x108756(0x43c)])(0x1))[_0x108756(0x1e7)](async _0x47a3f4=>{_0x2c3776(await this['_createInitialStateImpl'](_0x47a3f4===0x3));});});}[_0x8dd24f(0x444)](){const _0x2d10ba=this['unitID'];return{'onStateChange':(_0xf5f392,_0x5ccb19)=>{const _0x35bd45=_0x17f9;if(_0xf5f392!==this[_0x35bd45(0x1e6)])throw new Error(_0x35bd45(0x2a9)+_0xf5f392[_0x35bd45(0x2db)]+_0x35bd45(0x34f)+_0x5ccb19[_0x35bd45(0x2db)]+_0x35bd45(0x3bd)+this[_0x35bd45(0x1e6)][_0x35bd45(0x2db)]);this[_0x35bd45(0x42a)](_0x5ccb19);},'onSendChangeset':_0x2b7618=>{const _0x4a6c39=_0x17f9;!_0x2b7618[_0x4a6c39(0x413)]&&(_0x2b7618['sid']=this[_0x4a6c39(0x3c8)],_0x2b7618['reqId']=++this[_0x4a6c39(0x344)]);const _0x14c937={'eventID':_univerjs_pro_collaboration[_0x4a6c39(0x2ed)][_0x4a6c39(0x244)],'data':{'unitID':_0x2b7618['unitID'],'unitType':this[_0x4a6c39(0x3de)],'changeset':_0x2b7618,'memberID':this[_0x4a6c39(0x453)][_0x4a6c39(0x492)]()}};this[_0x4a6c39(0x453)]['send'](_0x14c937,this['unitID']);},'onMissingChangesets':({from:_0x39138b,to:_0x1bbf17})=>{const _0x211546=_0x17f9;this['_logService'][_0x211546(0x458)](_0x211546(0x3cc),_0x211546(0x47f)+_0x39138b+_0x211546(0x2f8)+_0x1bbf17);const _0x38e156={'eventID':_univerjs_pro_collaboration[_0x211546(0x2ed)][_0x211546(0x2b3)],'data':{'unitID':_0x2d10ba,'unitType':this[_0x211546(0x3de)],'from':_0x39138b,'to':_0x1bbf17}};this[_0x211546(0x453)]['send'](_0x38e156,this[_0x211546(0x398)]);}};}async[_0x8dd24f(0x391)](_0x3cfd76){const _0x48a5ad=_0x8dd24f;var _0x4e0c62,_0x28664c,_0x37a676;const _0x3e86a8=await((_0x4e0c62=this[_0x48a5ad(0x2f3)])===null||_0x4e0c62===void 0x0?void 0x0:_0x4e0c62['loadOfflineData'](this[_0x48a5ad(0x398)])),_0x6bae70=(_0x28664c=_0x3e86a8===null||_0x3e86a8===void 0x0?void 0x0:_0x3e86a8['mutations'])!==null&&_0x28664c!==void 0x0?_0x28664c:[],_0x261c6e=(_0x37a676=_0x3e86a8===null||_0x3e86a8===void 0x0?void 0x0:_0x3e86a8[_0x48a5ad(0x20f)])!==null&&_0x37a676!==void 0x0?_0x37a676:null,_0x4bfc8c=!!(_0x261c6e===null||_0x261c6e===void 0x0?void 0x0:_0x261c6e[_0x48a5ad(0x413)])&&!!(_0x261c6e===null||_0x261c6e===void 0x0?void 0x0:_0x261c6e[_0x48a5ad(0x41e)]);this[_0x48a5ad(0x3c8)]=_0x4bfc8c?_0x261c6e['sid']:(0x0,_univerjs_pro_collaboration['uuidv4'])(),this['_changesetReqId']=_0x4bfc8c?_0x261c6e[_0x48a5ad(0x41e)]:0x0;const _0x3e3bae=this[_0x48a5ad(0x398)];try{this[_0x48a5ad(0x2b6)](_0x261c6e,_0x6bae70);}catch(_0x3feb9c){this['_logService']['error'](_0x3feb9c);}const _0x480d8a=this['_createHandler']();if(_0x3cfd76){const _0x3fb363=createOnlineState(this['_injector'],_0x3e3bae,this[_0x48a5ad(0x3de)],_0x261c6e,_0x6bae70,_0x480d8a);if(_0x3fb363 instanceof PendingState)_0x3fb363[_0x48a5ad(0x472)]();else{if(_0x3fb363 instanceof AwaitingWithPendingState||_0x3fb363 instanceof AwaitingState)_0x3fb363[_0x48a5ad(0x224)]();}return _0x3fb363;}return this[_0x48a5ad(0x370)][_0x48a5ad(0x439)](OfflineState,_0x3e3bae,this[_0x48a5ad(0x3de)],_0x261c6e,_0x6bae70,_0x480d8a);}[_0x8dd24f(0x2b6)](_0x313372,_0x15e359){const _0x5992ea=_0x8dd24f;var _0x53310b,_0x26c076;const _0x471ea0=this[_0x5992ea(0x35b)][_0x5992ea(0x41f)][_0x5992ea(0x1dc)](this[_0x5992ea(0x35b)]['interceptor']['getInterceptPoints']()[_0x5992ea(0x3a2)]);(_0x53310b=_0x471ea0((_0x313372===null||_0x313372===void 0x0?void 0x0:_0x313372[_0x5992ea(0x38a)])||[],null))===null||_0x53310b===void 0x0||_0x53310b[_0x5992ea(0x1fe)](_0x496667=>this['_commandService'][_0x5992ea(0x25c)](_0x496667['id'],_0x496667[_0x5992ea(0x491)])),(_0x26c076=_0x471ea0(_0x15e359||[],null))===null||_0x26c076===void 0x0||_0x26c076[_0x5992ea(0x1fe)](_0x4aa7b8=>this['_commandService'][_0x5992ea(0x25c)](_0x4aa7b8['id'],_0x4aa7b8[_0x5992ea(0x491)]));}};CollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core['Injector'])),__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x476)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x436)])),__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationUIEventService)),__decorateParam(0x8,_univerjs_core['IUniverInstanceService']),__decorateParam(0x9,_univerjs_core['ILogService']),__decorateParam(0xa,_univerjs_core['ICommandService']),__decorateParam(0xb,_univerjs_core['IPermissionService']),__decorateParam(0xc,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ISingleActiveUnitService)),__decorateParam(0xd,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],CollaborationEntity);let DocCollaborationEntity=class DocCollaborationEntity extends CollaborationEntity{constructor(_0x1882de,_0xe98980,_0x3aa737,_0x2f893f,_0x3aca21,_0x11f497,_0x103022,_0x4b013d,_0x1ad8ab,_0x545ccf,_0x106029,_0x446cd6,_0x31485d,_0x59879a){const _0xd55542=_0x8dd24f;super(_0x1882de,_0x3aa737,_0xe98980,_0x2f893f,_0x3aca21,_0x11f497,_0x103022,_0x4b013d,_0x1ad8ab,_0x545ccf,_0x106029,_0x446cd6,_0x31485d,_0x59879a),this[_0xd55542(0x398)]=_0x1882de,this[_0xd55542(0x376)]=_0xe98980,_defineProperty(this,_0xd55542(0x282),null);}[_0x8dd24f(0x414)](_0xc8706c){const _0x147934=_0x8dd24f;this[_0x147934(0x282)]=_0xc8706c;}[_0x8dd24f(0x29f)](){const _0x33f2f0=_0x8dd24f;this['_handlerCallback']=null,super[_0x33f2f0(0x29f)]();}['_createHandler'](){const _0x7a2c90=_0x8dd24f,_0xbd7390=super[_0x7a2c90(0x444)]();return _0xbd7390[_0x7a2c90(0x258)]=_0x398de3=>{const _0xd45593=_0x7a2c90;var _0x10252b,_0x4a62e7;return(_0x10252b=this[_0xd45593(0x282)])===null||_0x10252b===void 0x0||(_0x4a62e7=_0x10252b[_0xd45593(0x258)])===null||_0x4a62e7===void 0x0?void 0x0:_0x4a62e7['call'](_0x10252b,_0x398de3);},_0xbd7390[_0x7a2c90(0x298)]=_0x52de57=>{const _0xda0e88=_0x7a2c90;var _0x342280,_0x1d3399;return(_0x342280=this[_0xda0e88(0x282)])===null||_0x342280===void 0x0||(_0x1d3399=_0x342280[_0xda0e88(0x298)])===null||_0x1d3399===void 0x0?void 0x0:_0x1d3399['call'](_0x342280,_0x52de57);},_0xbd7390[_0x7a2c90(0x1aa)]=_0x14381f=>{const _0x4e0e6c=_0x7a2c90;var _0x1eea83,_0x1e7473;return(_0x1eea83=this['_handlerCallback'])===null||_0x1eea83===void 0x0||(_0x1e7473=_0x1eea83[_0x4e0e6c(0x1aa)])===null||_0x1e7473===void 0x0?void 0x0:_0x1e7473[_0x4e0e6c(0x1e8)](_0x1eea83,_0x14381f);},_0xbd7390['onSyncEditingCollabCursor']=_0x36e7ef=>{const _0x1f8fd0=_0x7a2c90;var _0x1a7703,_0x50edf8;return(_0x1a7703=this['_handlerCallback'])===null||_0x1a7703===void 0x0||(_0x50edf8=_0x1a7703[_0x1f8fd0(0x43d)])===null||_0x50edf8===void 0x0?void 0x0:_0x50edf8[_0x1f8fd0(0x1e8)](_0x1a7703,_0x36e7ef);},_0xbd7390['onTransformRemoteChangesetByIMECache']=_0x245e75=>{const _0x3cd504=_0x7a2c90;var _0x33ff93,_0x3f05c5,_0x4bbe30;if(!((_0x33ff93=this['_handlerCallback'])===null||_0x33ff93===void 0x0?void 0x0:_0x33ff93[_0x3cd504(0x214)]))throw new Error(_0x3cd504(0x381));return(_0x3f05c5=this[_0x3cd504(0x282)])===null||_0x3f05c5===void 0x0||(_0x4bbe30=_0x3f05c5[_0x3cd504(0x214)])===null||_0x4bbe30===void 0x0?void 0x0:_0x4bbe30['call'](_0x3f05c5,_0x245e75);},_0xbd7390[_0x7a2c90(0x3dc)]=_0xe9293b=>{const _0x12fcd6=_0x7a2c90;var _0x588008,_0x53786c,_0x67ac65;if(!((_0x588008=this[_0x12fcd6(0x282)])===null||_0x588008===void 0x0?void 0x0:_0x588008[_0x12fcd6(0x3dc)]))throw new Error('onTransformRemoteChangesetByStateCache\x20callback\x20is\x20not\x20added\x20yet.');return(_0x53786c=this[_0x12fcd6(0x282)])===null||_0x53786c===void 0x0||(_0x67ac65=_0x53786c[_0x12fcd6(0x3dc)])===null||_0x67ac65===void 0x0?void 0x0:_0x67ac65[_0x12fcd6(0x1e8)](_0x53786c,_0xe9293b);},_0xbd7390;}async[_0x8dd24f(0x482)](){const _0x38cb29=_0x8dd24f,_0x40445a=await super[_0x38cb29(0x482)]();return this[_0x38cb29(0x2fb)](this[_0x38cb29(0x435)]['onMutationExecutedForCollab']((_0x4215f9,_0xdf2bc0)=>{const _0x1bc244=_0x38cb29;if(_0x4215f9[_0x1bc244(0x376)]!==_univerjs_core[_0x1bc244(0x394)][_0x1bc244(0x3ed)]||(_0xdf2bc0===null||_0xdf2bc0===void 0x0?void 0x0:_0xdf2bc0[_0x1bc244(0x478)])||(_0xdf2bc0===null||_0xdf2bc0===void 0x0?void 0x0:_0xdf2bc0[_0x1bc244(0x404)]))return;if(_0x4215f9['id']===_univerjs_docs['RichTextEditingMutation']['id'])return;const _0x536cf4=_0x4215f9[_0x1bc244(0x491)];if((_0x536cf4===null||_0x536cf4===void 0x0?void 0x0:_0x536cf4['unitId'])!==this[_0x1bc244(0x398)])return;const _0xdba3f7=_0x4215f9,_0x5a03ea=this[_0x1bc244(0x35b)][_0x1bc244(0x41f)][_0x1bc244(0x1dc)](this[_0x1bc244(0x35b)][_0x1bc244(0x41f)]['getInterceptPoints']()[_0x1bc244(0x2ca)])([_0xdba3f7],this['_univerInstanceService'])||[_0xdba3f7];this[_0x1bc244(0x37e)](_0x5a03ea[0x0]);})),_0x40445a;}};DocCollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration['CompressMutationService'])),__decorateParam(0x5,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core['LocaleService'])),__decorateParam(0x6,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationUIEventService)),__decorateParam(0x8,_univerjs_core[_0x8dd24f(0x39f)]),__decorateParam(0x9,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0xa,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0xb,_univerjs_core[_0x8dd24f(0x397)]),__decorateParam(0xc,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ISingleActiveUnitService)),__decorateParam(0xd,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],DocCollaborationEntity);let SheetCollaborationEntity=class SheetCollaborationEntity extends CollaborationEntity{constructor(_0x5a0db8,_0x5f0e99,_0x5cdf69,_0x4c8d27,_0x28554e,_0x3cf61b,_0x44c69b,_0x5f1c44,_0x5644ed,_0x568e3f,_0xd2d0fc,_0x413b34,_0x153783,_0x19aeba,_0x36f61a){const _0x29f1a8=_0x8dd24f;super(_0x5a0db8,_0x5cdf69,_0x5f0e99,_0x4c8d27,_0x28554e,_0x3cf61b,_0x44c69b,_0x5644ed,_0x568e3f,_0xd2d0fc,_0x413b34,_0x153783,_0x19aeba,_0x36f61a),this[_0x29f1a8(0x398)]=_0x5a0db8,this['type']=_0x5f0e99,this[_0x29f1a8(0x20e)]=_0x5f1c44;}[_0x8dd24f(0x444)](){const _0x3ddf27=_0x8dd24f,_0x20d9e3=super[_0x3ddf27(0x444)]();return _0x20d9e3[_0x3ddf27(0x1aa)]=_0x3e1ed5=>this[_0x3ddf27(0x20e)]['transformSelections'](_0x3e1ed5),_0x20d9e3;}async['_init'](){const _0xd2c1fc=_0x8dd24f,_0x1a04b6=await super['_init']();return this[_0xd2c1fc(0x2fb)](this[_0xd2c1fc(0x435)][_0xd2c1fc(0x48d)]((_0x215021,_0x3cef05)=>{const _0x5e2872=_0xd2c1fc;if(_0x215021['type']!==_univerjs_core['CommandType'][_0x5e2872(0x3ed)]||(_0x3cef05===null||_0x3cef05===void 0x0?void 0x0:_0x3cef05['fromCollab'])||(_0x3cef05===null||_0x3cef05===void 0x0?void 0x0:_0x3cef05[_0x5e2872(0x404)]))return;const _0x5a4831=_0x215021[_0x5e2872(0x491)];if((_0x5a4831===null||_0x5a4831===void 0x0?void 0x0:_0x5a4831[_0x5e2872(0x3b3)])!==this[_0x5e2872(0x398)])return;const _0xe2a433=_0x215021,_0x5b4ad9=this[_0x5e2872(0x35b)][_0x5e2872(0x41f)]['fetchThroughInterceptors'](this['_compressMutationService'][_0x5e2872(0x41f)][_0x5e2872(0x1ba)]()['COMPRESS_MUTATION_SEND'])([_0xe2a433],this[_0x5e2872(0x2c6)])||[_0xe2a433];this[_0x5e2872(0x37e)](_0x5b4ad9[0x0]);})),_0x1a04b6;}};SheetCollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration['CompressMutationService'])),__decorateParam(0x5,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x436)])),__decorateParam(0x6,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_pro_collaboration[_0x8dd24f(0x2b8)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x8dd24f(0x465)])(SheetTransformSelectionsService)),__decorateParam(0x8,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationUIEventService)),__decorateParam(0x9,_univerjs_core['IUniverInstanceService']),__decorateParam(0xa,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0xb,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0xc,_univerjs_core[_0x8dd24f(0x397)]),__decorateParam(0xd,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ISingleActiveUnitService)),__decorateParam(0xe,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],SheetCollaborationEntity);const INetworkConditionService=(0x0,_univerjs_core['createIdentifier'])(_0x8dd24f(0x3a7));function deserializeToCombResponse(_0x1731e0){const _0x34aff9=_0x8dd24f,_0x1fdb32=_0x1731e0[_0x34aff9(0x332)],_0x4d2afc=JSON[_0x34aff9(0x42d)](_0x1fdb32);switch(_0x4d2afc[_0x34aff9(0x357)]){case _univerjs_protocol['CombCmd'][_0x34aff9(0x31b)]:case _univerjs_protocol[_0x34aff9(0x201)]['HELLO']:{const _0x2b8c4c=_0x4d2afc['infoRsp'];return{..._0x4d2afc,'data':_0x2b8c4c,'cmd':_0x4d2afc[_0x34aff9(0x357)]};}case _univerjs_protocol[_0x34aff9(0x201)][_0x34aff9(0x2dc)]:{const _0x797fb9=_0x4d2afc[_0x34aff9(0x2fa)];return{..._0x4d2afc,'data':_0x797fb9,'cmd':_0x4d2afc[_0x34aff9(0x357)]};}case _univerjs_protocol[_0x34aff9(0x201)]['RECV']:{const _0x5b6368=_0x4d2afc['collaMsg'];switch(_0x5b6368['eventID']){case _univerjs_pro_collaboration[_0x34aff9(0x2ed)][_0x34aff9(0x3d6)]:var _0x20ca3e;return{..._0x4d2afc,'data':{..._0x5b6368,'data':(_0x20ca3e=_0x5b6368['permissionRejEvent'])===null||_0x20ca3e===void 0x0?void 0x0:_0x20ca3e['cs']},'cmd':_0x4d2afc['cmd']};case _univerjs_pro_collaboration[_0x34aff9(0x2ed)]['CHANGESET_ACK']:var _0x13fd8c;return{..._0x4d2afc,'data':{..._0x5b6368,'data':(_0x13fd8c=_0x5b6368[_0x34aff9(0x389)])===null||_0x13fd8c===void 0x0?void 0x0:_0x13fd8c['cs']},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration['CollaborationEvent'][_0x34aff9(0x2b9)]:var _0x241144;return{..._0x4d2afc,'data':{..._0x5b6368,'data':(_0x241144=_0x5b6368['newCsEvent'])===null||_0x241144===void 0x0?void 0x0:_0x241144['cs']},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration['CollaborationEvent']['CHANGESET_REJ']:var _0x224c14;return{..._0x4d2afc,'data':{..._0x5b6368,'data':(_0x224c14=_0x5b6368['csRejEvent'])===null||_0x224c14===void 0x0?void 0x0:_0x224c14['cs']},'cmd':_0x4d2afc['cmd']};case _univerjs_pro_collaboration['CollaborationEvent'][_0x34aff9(0x2c4)]:var _0x551ec5;return{..._0x4d2afc,'data':{..._0x5b6368,'data':(_0x551ec5=_0x5b6368[_0x34aff9(0x402)])===null||_0x551ec5===void 0x0?void 0x0:_0x551ec5['cs']},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration[_0x34aff9(0x2ed)]['UPDATE_CURSOR']:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368[_0x34aff9(0x3f5)]},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration['CollaborationEvent'][_0x34aff9(0x39e)]:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368['joinEvent']},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration['CollaborationEvent'][_0x34aff9(0x30c)]:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368[_0x34aff9(0x301)]},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration[_0x34aff9(0x2ed)][_0x34aff9(0x218)]:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368[_0x34aff9(0x386)]},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration[_0x34aff9(0x2ed)][_0x34aff9(0x2dd)]:case _univerjs_pro_collaboration[_0x34aff9(0x2ed)][_0x34aff9(0x46d)]:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368[_0x34aff9(0x268)]},'cmd':_0x4d2afc['cmd']};case _univerjs_pro_collaboration['CollaborationEvent']['LIVESHARE_TERMINATE']:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368['liveShareNewHost']},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration['CollaborationEvent'][_0x34aff9(0x469)]:return{..._0x4d2afc,'data':_0x5b6368,'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration[_0x34aff9(0x2ed)][_0x34aff9(0x396)]:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368['commentUpdateEvent']},'cmd':_0x4d2afc['cmd']};case _univerjs_pro_collaboration['CollaborationEvent'][_0x34aff9(0x293)]:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368[_0x34aff9(0x3e0)]},'cmd':_0x4d2afc['cmd']};case _univerjs_pro_collaboration[_0x34aff9(0x2ed)][_0x34aff9(0x1f2)]:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368['shouldCloseConn']},'cmd':_0x4d2afc[_0x34aff9(0x357)]};case _univerjs_pro_collaboration[_0x34aff9(0x2ed)]['UNISCRIPT_RUN']:return{..._0x4d2afc,'data':{..._0x5b6368,'data':_0x5b6368[_0x34aff9(0x253)]},'cmd':_0x4d2afc[_0x34aff9(0x357)]};default:return _0x4d2afc;}}default:return _0x4d2afc;}}function serializeCombRequest(_0x257543){const _0x38fbbb=_0x8dd24f;switch(_0x257543[_0x38fbbb(0x357)]){case _univerjs_protocol[_0x38fbbb(0x201)][_0x38fbbb(0x31b)]:case _univerjs_protocol[_0x38fbbb(0x201)][_0x38fbbb(0x21d)]:return JSON['stringify']({'cmd':_0x257543[_0x38fbbb(0x357)],'routeKey':_0x257543[_0x38fbbb(0x34a)]});case _univerjs_protocol[_0x38fbbb(0x201)][_0x38fbbb(0x443)]:{let _0x2b40d2;switch(_0x257543['data'][_0x38fbbb(0x468)]){case _univerjs_pro_collaboration[_0x38fbbb(0x2ed)]['UPDATE_CURSOR']:_0x2b40d2={'eventID':_univerjs_pro_collaboration['CollaborationEvent'][_0x38fbbb(0x297)],'updateCursorEvent':_0x257543[_0x38fbbb(0x332)][_0x38fbbb(0x332)]};break;case _univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x30c)]:_0x2b40d2={'eventID':_univerjs_pro_collaboration[_0x38fbbb(0x2ed)]['USERS_LEAVE'],'leaveEvent':_0x257543[_0x38fbbb(0x332)][_0x38fbbb(0x332)]};break;case _univerjs_pro_collaboration['CollaborationEvent']['USERS_ENTER']:_0x2b40d2={'eventID':_univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x39e)],'joinEvent':_0x257543['data']['data']};break;case _univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x218)]:_0x2b40d2={'eventID':_univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x218)],'liveShareNewHost':_0x257543[_0x38fbbb(0x332)]['data']};break;case _univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x46d)]:_0x2b40d2={'eventID':_univerjs_pro_collaboration['CollaborationEvent'][_0x38fbbb(0x46d)],'liveShareOperation':_0x257543[_0x38fbbb(0x332)][_0x38fbbb(0x332)]};break;case _univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x23b)]:_0x2b40d2={'eventID':_univerjs_pro_collaboration[_0x38fbbb(0x2ed)]['LIVESHARE_TERMINATE'],'liveShareTerminate':_0x257543[_0x38fbbb(0x332)]['data']};break;case _univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x1bb)]:_0x2b40d2={'eventID':_univerjs_pro_collaboration[_0x38fbbb(0x2ed)]['LIVESHARE_REQUEST_HOST'],'liveShareRequestHost':_0x257543['data'][_0x38fbbb(0x332)]};break;case _univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x2dd)]:_0x2b40d2={'eventID':_univerjs_pro_collaboration[_0x38fbbb(0x2ed)][_0x38fbbb(0x2dd)]};break;default:_0x2b40d2={'eventID':_0x257543[_0x38fbbb(0x332)][_0x38fbbb(0x468)]};}return JSON[_0x38fbbb(0x2e7)]({'cmd':_0x257543[_0x38fbbb(0x357)],'routeKey':_0x257543[_0x38fbbb(0x34a)],'collaMsg':_0x2b40d2});}case _univerjs_protocol[_0x38fbbb(0x201)][_0x38fbbb(0x2dc)]:return JSON['stringify']({'cmd':_0x257543[_0x38fbbb(0x357)],'routeKey':_0x257543[_0x38fbbb(0x34a)],'joinReq':_0x257543['data']});case _univerjs_protocol[_0x38fbbb(0x201)][_0x38fbbb(0x212)]:return JSON[_0x38fbbb(0x2e7)]({'cmd':_0x257543['cmd'],'routeKey':_0x257543['routeKey'],'leaveReq':_0x257543['data']});default:throw new Error(_0x38fbbb(0x41c));}}const ICollaborationSocketService=(0x0,_univerjs_core[_0x8dd24f(0x418)])('univer-pro.collaboration-client-socket-service');function generateSubmitChangesPath(_0x5d4cba,_0x155ff6,_0x1cff7d){const _0x2846c1=_0x8dd24f;return _0x5d4cba+'/'+_0x155ff6+'/unit/'+_0x1cff7d+_0x2846c1(0x365);}let CollaborationSocketService=class CollaborationSocketService extends _univerjs_core['Disposable']{constructor(_0x19ae45,_0x2dfd87,_0x51f8da,_0x243ab4,_0xcc91f4){const _0x23c951=_0x8dd24f;super(),this[_0x23c951(0x370)]=_0x19ae45,this[_0x23c951(0x30e)]=_0x2dfd87,this[_0x23c951(0x3a9)]=_0x51f8da,this[_0x23c951(0x305)]=_0x243ab4,this['_snapshotServerService']=_0xcc91f4;}['_doCreateSocket'](_0x513ce6){const _0x32fa2c=_0x8dd24f,_0x177b9c=this[_0x32fa2c(0x370)][_0x32fa2c(0x44e)](_univerjs_network[_0x32fa2c(0x232)]);if(!_0x177b9c)throw new Error(_0x32fa2c(0x343));const _0x1f4eb4=_0x177b9c[_0x32fa2c(0x320)](_0x513ce6);if(!_0x1f4eb4)throw new Error(_0x32fa2c(0x366));const _0x40e290=new _univerjs_core[(_0x32fa2c(0x3f4))](),_0x4171c6=new rxjs[(_0x32fa2c(0x1c9))]();_0x40e290['add'](_0x1f4eb4[_0x32fa2c(0x204)][_0x32fa2c(0x1e7)](_0x42f1fe=>_0x4171c6[_0x32fa2c(0x368)](_0x42f1fe))),_0x40e290[_0x32fa2c(0x2df)]((0x0,_univerjs_core['toDisposable'])(()=>_0x4171c6[_0x32fa2c(0x442)]()));const _0x12325c=new rxjs[(_0x32fa2c(0x1c9))]();_0x40e290['add'](_0x1f4eb4[_0x32fa2c(0x40d)][_0x32fa2c(0x1e7)](_0x24f21f=>_0x12325c[_0x32fa2c(0x368)](_0x24f21f))),_0x40e290['add']((0x0,_univerjs_core[_0x32fa2c(0x3d4)])(()=>_0x12325c[_0x32fa2c(0x442)]()));const _0x9d78d5=new rxjs[(_0x32fa2c(0x1c9))]();_0x40e290[_0x32fa2c(0x2df)](_0x1f4eb4['message$'][_0x32fa2c(0x1e7)](_0x347be0=>{const _0x100269=_0x32fa2c,_0x1d27e1=deserializeToCombResponse(_0x347be0);_0x9d78d5[_0x100269(0x368)](_0x1d27e1);})),_0x40e290[_0x32fa2c(0x2df)]((0x0,_univerjs_core[_0x32fa2c(0x3d4)])(()=>_0x9d78d5[_0x32fa2c(0x442)]()));let _0x3e4914;const _0x480118=()=>{const _0x500642=_0x32fa2c;_0x12325c[_0x500642(0x368)](new Event(_0x500642(0x3b1))),_0x4171c6[_0x500642(0x368)](new Event('connection\x20error')),_0x3e4914[_0x500642(0x40b)]();};return _0x3e4914={'memberID':'','close$':_0x4171c6[_0x32fa2c(0x2a8)](),'error$':_0x12325c[_0x32fa2c(0x2a8)](),'open$':_0x1f4eb4[_0x32fa2c(0x3bf)],'message$':_0x9d78d5['asObservable'](),'send':_0x487c99=>{const _0x49c41b=_0x32fa2c;if(_0x487c99['cmd']===_univerjs_protocol[_0x49c41b(0x201)][_0x49c41b(0x443)]){if(_0x487c99[_0x49c41b(0x332)][_0x49c41b(0x468)]===_univerjs_pro_collaboration[_0x49c41b(0x2ed)][_0x49c41b(0x244)]){this[_0x49c41b(0x1b7)](_0x3e4914,_0x487c99[_0x49c41b(0x332)])[_0x49c41b(0x2aa)](_0x124681=>{const _0x28ca9b=_0x49c41b;this[_0x28ca9b(0x305)][_0x28ca9b(0x35a)](_0x124681),_0x480118();});return;}if(_0x487c99[_0x49c41b(0x332)][_0x49c41b(0x468)]===_univerjs_pro_collaboration[_0x49c41b(0x2ed)]['FETCH_MISSING']){const _0x55365e=_0x487c99[_0x49c41b(0x332)];this[_0x49c41b(0x421)](_0x55365e)[_0x49c41b(0x314)](_0x2b8972=>{const _0x233793=_0x49c41b;_0x9d78d5[_0x233793(0x368)]({'cmd':_univerjs_protocol['CombCmd'][_0x233793(0x1f8)],'code':_univerjs_protocol[_0x233793(0x438)]['OK'],'routeKey':_0x55365e[_0x233793(0x332)]['unitID'],'routeType':'','data':{'eventID':_univerjs_pro_collaboration[_0x233793(0x2ed)][_0x233793(0x426)],'data':{'changesets':_0x2b8972}}});})[_0x49c41b(0x2aa)](_0x1e2ef0=>{const _0x558765=_0x49c41b;this[_0x558765(0x305)][_0x558765(0x35a)](_0x1e2ef0),_0x480118();});return;}}_0x1f4eb4[_0x49c41b(0x41b)](serializeCombRequest(_0x487c99));},'close':()=>{const _0x5bc8f6=_0x32fa2c;_0x1f4eb4[_0x5bc8f6(0x40b)](),_0x40e290[_0x5bc8f6(0x29f)]();}},_0x3e4914;}async[_0x8dd24f(0x1b7)](_0x4a22a7,_0x33c20e){const _0x153e47=_0x8dd24f;var _0x56248d;const {unitType:_0xa71178,unitID:_0x48cbb8,changeset:_0x5e8b51}=_0x33c20e['data'],_0x172cba={'unitID':_0x48cbb8,'memberID':_0x4a22a7['memberID'],'type':_0xa71178,'changeset':(0x0,_univerjs_pro_collaboration['parseChangesetToProtocol'])(_0x5e8b51)},_0x4c5580=this[_0x153e47(0x3a9)][_0x153e47(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x4485a3=generateSubmitChangesPath((_0x56248d=_0x4c5580===null||_0x4c5580===void 0x0?void 0x0:_0x4c5580[_0x153e47(0x32d)])!==null&&_0x56248d!==void 0x0?_0x56248d:DEFAULT_COLLAB_SUBMIT_CHANGESET_URL,_0xa71178,_0x48cbb8);try{await this[_0x153e47(0x30e)]['post'](_0x4485a3,{'body':_0x172cba});}catch(_0x26d0d4){this[_0x153e47(0x305)][_0x153e47(0x35a)](_0x153e47(0x3e6),_0x153e47(0x2d0));throw _0x26d0d4;}}async[_0x8dd24f(0x421)](_0x312d82){const _0x535a87=_0x8dd24f,{unitID:_0x29401c,from:_0x36fc4d,to:_0xd93d8d,unitType:_0x2fe026}=_0x312d82[_0x535a87(0x332)];return(await this[_0x535a87(0x1c0)][_0x535a87(0x348)]({'metadata':void 0x0},{'unitID':_0x29401c,'type':_0x2fe026,'from':_0x36fc4d,'to':_0xd93d8d}))[_0x535a87(0x378)][_0x535a87(0x441)](_0x3e304d=>{const _0x587393=_0x535a87;if(_0x3e304d[_0x587393(0x38a)]===null||_0x3e304d[_0x587393(0x38a)]===void 0x0)_0x3e304d[_0x587393(0x38a)]=[];return _0x3e304d;});}};CollaborationSocketService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_network[_0x8dd24f(0x44c)])),__decorateParam(0x2,_univerjs_core[_0x8dd24f(0x407)]),__decorateParam(0x3,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x4,_univerjs_pro_collaboration[_0x8dd24f(0x1d3)])],CollaborationSocketService);let CollaborationSessionService=class CollaborationSessionService extends _univerjs_core['Disposable']{get[_0x8dd24f(0x2b7)](){const _0x2ca5ec=_0x8dd24f;return this['_socket$'][_0x2ca5ec(0x3d1)]();}constructor(_0x47fdcb,_0x5e3782,_0x50886a,_0x41d342,_0x176e7c,_0x4cc010){const _0x538917=_0x8dd24f;super(),this[_0x538917(0x370)]=_0x47fdcb,this[_0x538917(0x305)]=_0x5e3782,this[_0x538917(0x3a9)]=_0x50886a,this[_0x538917(0x2e1)]=_0x41d342,this[_0x538917(0x334)]=_0x176e7c,this['_networkConditionService']=_0x4cc010,_defineProperty(this,'_socket$',new rxjs[(_0x538917(0x33f))](void 0x0)),_defineProperty(this,'socket$',this[_0x538917(0x1ef)][_0x538917(0x2a8)]()),_defineProperty(this,_0x538917(0x3f0),null),_defineProperty(this,_0x538917(0x26f),new Map()),_defineProperty(this,_0x538917(0x3b0),new rxjs[(_0x538917(0x33f))](0x0)),_defineProperty(this,'status$',this[_0x538917(0x3b0)]['asObservable']()),_defineProperty(this,_0x538917(0x34c),![]),_defineProperty(this,_0x538917(0x1e9),void 0x0),_defineProperty(this,_0x538917(0x1a5),0x0),_defineProperty(this,_0x538917(0x31a),void 0x0),_defineProperty(this,'_timeoutTimer',void 0x0),this[_0x538917(0x1e1)]();}[_0x8dd24f(0x1e1)](){const _0x29c7c9=_0x8dd24f;if(!this[_0x29c7c9(0x3d5)])return;this[_0x29c7c9(0x2fb)](this['_networkConditionService'][_0x29c7c9(0x3eb)][_0x29c7c9(0x1e7)](_0x2f929e=>{if(_0x2f929e&&!this['_socket'])this['reconnect']();if(!_0x2f929e)this['_onOffline']();}));}['dispose'](){const _0x5a94e5=_0x8dd24f;super[_0x5a94e5(0x29f)](),this[_0x5a94e5(0x39c)](),this[_0x5a94e5(0x1cd)](),this[_0x5a94e5(0x3d9)](),this[_0x5a94e5(0x26f)][_0x5a94e5(0x1fe)](_0x4c5b49=>_0x4c5b49[_0x5a94e5(0x29f)]()),this['_sessions']['clear'](),this[_0x5a94e5(0x3b0)]['complete']();}async['requireSession'](_0x52cd71){const _0x476efd=_0x8dd24f;if(this[_0x476efd(0x26f)][_0x476efd(0x44f)](_0x52cd71))return this[_0x476efd(0x26f)][_0x476efd(0x44e)](_0x52cd71);this['_tryEnsureSocket']();const _0x9c3adb=this[_0x476efd(0x370)][_0x476efd(0x439)](CollaborationSession,_0x52cd71,this['_socket$'][_0x476efd(0x2a8)]());return this[_0x476efd(0x26f)][_0x476efd(0x3d2)](_0x52cd71,_0x9c3adb),_0x9c3adb;}[_0x8dd24f(0x427)](_0xfcc393){const _0x28aaa6=_0x8dd24f,_0x51ba99=this['_sessions'][_0x28aaa6(0x44e)](_0xfcc393);_0x51ba99&&(this[_0x28aaa6(0x26f)][_0x28aaa6(0x430)](_0xfcc393),_0x51ba99[_0x28aaa6(0x40b)]());if(!this[_0x28aaa6(0x26f)][_0x28aaa6(0x425)]){var _0x5b86b9;(_0x5b86b9=this[_0x28aaa6(0x2b7)])===null||_0x5b86b9===void 0x0||_0x5b86b9[_0x28aaa6(0x40b)]();}}[_0x8dd24f(0x292)](){const _0x23006a=_0x8dd24f;this[_0x23006a(0x1a5)]=0x0,this[_0x23006a(0x39c)](),this[_0x23006a(0x342)]();}[_0x8dd24f(0x39c)](){const _0x1290ab=_0x8dd24f;this['_retryConnectingTimer']!=null&&(clearTimeout(this['_retryConnectingTimer']),this[_0x1290ab(0x1e9)]=null);}async[_0x8dd24f(0x2be)](){const _0x2d762a=_0x8dd24f;var _0x3a5573;const _0x57529f=this[_0x2d762a(0x3a9)][_0x2d762a(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x545236=(_0x3a5573=_0x57529f===null||_0x57529f===void 0x0?void 0x0:_0x57529f[_0x2d762a(0x247)])!==null&&_0x3a5573!==void 0x0?_0x3a5573:DEFAULT_COLLAB_WEB_SOCKET_URL,_0x530da4=await this[_0x2d762a(0x2e1)][_0x2d762a(0x320)](_0x545236);return this[_0x2d762a(0x3f0)]=_0x530da4,_0x530da4;}async['_tryEnsureSocket'](){const _0x131188=_0x8dd24f;try{var _0x1cfc07,_0x261b09;const _0x186f31=(_0x1cfc07=(_0x261b09=this[_0x131188(0x2b7)])!==null&&_0x261b09!==void 0x0?_0x261b09:this['_candidateSocket'])!==null&&_0x1cfc07!==void 0x0?_0x1cfc07:await this[_0x131188(0x2be)]();if(_0x186f31){const _0x336428=_0x186f31[_0x131188(0x41b)];_0x186f31['send']=_0xb482c1=>{const _0x2a7b45=_0x131188;if(_0xb482c1[_0x2a7b45(0x357)]!==_univerjs_protocol['CombCmd'][_0x2a7b45(0x212)])this['_rescheduleHeartbeat']();return _0x336428[_0x2a7b45(0x3ea)](_0x186f31,[_0xb482c1]);},_0x186f31[_0x131188(0x21f)]['subscribe'](_0x58b73f=>this[_0x131188(0x1b3)](_0x186f31,_0x58b73f)),_0x186f31[_0x131188(0x40d)][_0x131188(0x37f)]((0x0,rxjs_operators[_0x131188(0x43c)])(0x1))['subscribe'](_0x4ceb37=>this[_0x131188(0x305)][_0x131188(0x35a)](_0x131188(0x31c),_0x4ceb37)),_0x186f31[_0x131188(0x3bf)]['pipe']((0x0,rxjs_operators[_0x131188(0x43c)])(0x1))['subscribe'](()=>{const _0x1cc14c=_0x131188;this[_0x1cc14c(0x24d)](_0x186f31);}),_0x186f31[_0x131188(0x204)][_0x131188(0x37f)]((0x0,rxjs_operators['take'])(0x1))[_0x131188(0x1e7)](_0x17d1a3=>{const _0x22d838=_0x131188;this[_0x22d838(0x305)][_0x22d838(0x458)]('[CollaborationSessionService]',_0x22d838(0x374),_0x17d1a3),this[_0x22d838(0x3d3)]();});}}catch(_0x1c3c29){this[_0x131188(0x305)][_0x131188(0x35a)](_0x1c3c29),this[_0x131188(0x3d3)]();}}[_0x8dd24f(0x24d)](_0x1bb79c){const _0x26d0ba=_0x8dd24f;this[_0x26d0ba(0x305)][_0x26d0ba(0x458)](_0x26d0ba(0x3e4),_0x26d0ba(0x24b)),_0x1bb79c['send']({'cmd':_univerjs_protocol['CombCmd'][_0x26d0ba(0x21d)]}),this[_0x26d0ba(0x22f)]();}[_0x8dd24f(0x3fe)](){const _0x26495c=_0x8dd24f;this['_socketReady']=![],this['_candidateSocket']=null,this[_0x26495c(0x3b0)][_0x26495c(0x368)](0x2),this['_socket$'][_0x26495c(0x368)](null),this[_0x26495c(0x1cd)](),this['_clearHeartbeatTimer']();}[_0x8dd24f(0x3d3)](){const _0x28251a=_0x8dd24f;var _0x2baff1;this[_0x28251a(0x3fe)]();if(this[_0x28251a(0x1a5)]<((_0x2baff1=this[_0x28251a(0x3a9)][_0x28251a(0x3c7)](_0x28251a(0x285)))!==null&&_0x2baff1!==void 0x0?_0x2baff1:0x3))this[_0x28251a(0x334)]['emitEvent']({'id':'SOCKET_FAILED_RETRY'}),this[_0x28251a(0x342)]();else this[_0x28251a(0x334)][_0x28251a(0x3a3)]({'id':_0x28251a(0x384)});}[_0x8dd24f(0x342)](){const _0x542079=_0x8dd24f;var _0xe6a45a;const _0x465f69=this[_0x542079(0x1a5)],_0x5160de=this[_0x542079(0x3a9)][_0x542079(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x99927b=_0x465f69===0x0?0x0:((_0xe6a45a=_0x5160de===null||_0x5160de===void 0x0?void 0x0:_0x5160de[_0x542079(0x1d6)])!==null&&_0xe6a45a!==void 0x0?_0xe6a45a:DEFAULT_RETRY_CONNECTING_INTERVAL)*0x2**_0x465f69;this[_0x542079(0x1e9)]=setTimeout(()=>{const _0x11aceb=_0x542079;clearTimeout(this['_retryConnectingTimer']),this[_0x11aceb(0x1e9)]=null,this[_0x11aceb(0x467)]();},_0x99927b),this[_0x542079(0x1a5)]+=0x1;}['_onMessage'](_0x4aef09,_0x9a1af){const _0x424259=_0x8dd24f,{cmd:_0x1c84e6}=_0x9a1af;_0x1c84e6===_univerjs_protocol['CombCmd'][_0x424259(0x21d)]&&!this[_0x424259(0x34c)]&&(_0x4aef09[_0x424259(0x456)]=_0x9a1af[_0x424259(0x332)][_0x424259(0x456)],this[_0x424259(0x1ef)][_0x424259(0x368)](_0x4aef09),this[_0x424259(0x3b0)]['next'](0x3),this[_0x424259(0x34c)]=!![],this[_0x424259(0x3f0)]=null);if(_0x1c84e6===_univerjs_protocol['CombCmd']['HEARTBEAT'])this[_0x424259(0x1cd)]();this['_rescheduleHeartbeat']();}[_0x8dd24f(0x22f)](){const _0x2a810c=_0x8dd24f;var _0x15731f;this[_0x2a810c(0x3d9)](),this['_sendHeartbeatTimer']=setTimeout(()=>this[_0x2a810c(0x460)](),(_0x15731f=this[_0x2a810c(0x3a9)]['getConfig'](_0x2a810c(0x27f)))!==null&&_0x15731f!==void 0x0?_0x15731f:DEFAULT_HEARTBEAT_INTERVAL);}[_0x8dd24f(0x460)](){const _0x46ab49=_0x8dd24f;this[_0x46ab49(0x2b7)][_0x46ab49(0x41b)]({'cmd':_univerjs_protocol['CombCmd'][_0x46ab49(0x31b)]}),this['_waitForHeartbeatResponse']();}[_0x8dd24f(0x1b2)](){const _0xd2a501=_0x8dd24f;var _0x162ff9;this['_timeoutTimer']=setTimeout(()=>this[_0xd2a501(0x3d3)](),(_0x162ff9=this[_0xd2a501(0x3a9)]['getConfig'](_0xd2a501(0x360)))!==null&&_0x162ff9!==void 0x0?_0x162ff9:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x8dd24f(0x3d9)](){const _0x1735b1=_0x8dd24f;this[_0x1735b1(0x31a)]!=null&&(clearTimeout(this[_0x1735b1(0x31a)]),this[_0x1735b1(0x31a)]=null);}['_clearTimeoutTimer'](){const _0x425c35=_0x8dd24f;this[_0x425c35(0x2ec)]!=null&&(clearTimeout(this[_0x425c35(0x2ec)]),this[_0x425c35(0x2ec)]=null);}};CollaborationSessionService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x1,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x2,_univerjs_core[_0x8dd24f(0x407)]),__decorateParam(0x3,ICollaborationSocketService),__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationUIEventService)),__decorateParam(0x5,(0x0,_univerjs_core['Optional'])(INetworkConditionService))],CollaborationSessionService);let CollaborationController=class CollaborationController extends _univerjs_core[_0x8dd24f(0x45c)]{constructor(_0x9f1e0f,_0x5285a7,_0x337eb7,_0x61d3d7){const _0x14e97f=_0x8dd24f;var _0x5c0a52;super(),this[_0x14e97f(0x370)]=_0x9f1e0f,this['_collabSessionService']=_0x5285a7,this[_0x14e97f(0x3a9)]=_0x337eb7,this[_0x14e97f(0x2c6)]=_0x61d3d7,_defineProperty(this,_0x14e97f(0x270),new Map()),_defineProperty(this,_0x14e97f(0x2ea),new rxjs['Subject']()),_defineProperty(this,_0x14e97f(0x1ad),this[_0x14e97f(0x2ea)]['asObservable']());if(((_0x5c0a52=this[_0x14e97f(0x3a9)][_0x14e97f(0x3c7)](_0x14e97f(0x445)))===null||_0x5c0a52===void 0x0?void 0x0:_0x5c0a52[_0x14e97f(0x449)])!==![])this[_0x14e97f(0x482)]();}[_0x8dd24f(0x29f)](){const _0x1f25df=_0x8dd24f;super['dispose'](),this[_0x1f25df(0x270)][_0x1f25df(0x1fe)](_0x9a1b3b=>_0x9a1b3b[_0x1f25df(0x29f)]()),this['_entities'][_0x1f25df(0x431)]();}[_0x8dd24f(0x483)](_0x59bed9){const _0x59cd0b=_0x8dd24f;var _0x59c8bf;return(_0x59c8bf=this[_0x59cd0b(0x270)][_0x59cd0b(0x44e)](_0x59bed9))!==null&&_0x59c8bf!==void 0x0?_0x59c8bf:null;}[_0x8dd24f(0x487)](_0x3d9f0e){const _0x397dd6=_0x8dd24f,_0x5d78ab=this[_0x397dd6(0x483)](_0x3d9f0e);if(_0x5d78ab)return(0x0,rxjs['of'])(_0x5d78ab);return this[_0x397dd6(0x2ea)][_0x397dd6(0x37f)]((0x0,rxjs_operators[_0x397dd6(0x23a)])(_0x2be4f0=>_0x2be4f0[_0x397dd6(0x398)]===_0x3d9f0e));}['readyForCollab'](_0x14f060){const _0x36ff9b=_0x8dd24f;return(0x0,rxjs['firstValueFrom'])(this[_0x36ff9b(0x487)](_0x14f060)[_0x36ff9b(0x37f)]((0x0,rxjs_operators[_0x36ff9b(0x441)])(()=>void 0x0)));}[_0x8dd24f(0x482)](){const _0x3676fb=_0x8dd24f,_0x263583=0x10;this[_0x3676fb(0x2c6)][_0x3676fb(0x243)](_univerjs_core[_0x3676fb(0x322)][_0x3676fb(0x2b4)])[_0x3676fb(0x37f)]((0x0,rxjs['takeUntil'])(this[_0x3676fb(0x299)]),(0x0,rxjs_operators[_0x3676fb(0x3ab)])(_0x263583))[_0x3676fb(0x1e7)](async _0x52e78d=>{const _0x294504=_0x3676fb,_0x1f8f08=_0x52e78d[_0x294504(0x28a)][_0x294504(0x3ad)](),_0x352973=await this['_startCollaboration'](_0x1f8f08,_univerjs_core['UniverInstanceType']['UNIVER_SHEET']);this[_0x294504(0x270)][_0x294504(0x3d2)](_0x1f8f08,_0x352973);}),this[_0x3676fb(0x2c6)][_0x3676fb(0x243)](_univerjs_core[_0x3676fb(0x322)][_0x3676fb(0x2f9)])[_0x3676fb(0x37f)]((0x0,rxjs[_0x3676fb(0x32c)])(this[_0x3676fb(0x299)]),(0x0,rxjs_operators[_0x3676fb(0x3ab)])(_0x263583))[_0x3676fb(0x37f)]((0x0,rxjs_operators['filter'])(_0x12fbd7=>{const _0x59f299=_0x3676fb;return!_0x12fbd7[_0x59f299(0x28a)][_0x59f299(0x3ad)]()[_0x59f299(0x3db)]('__');}))[_0x3676fb(0x1e7)](async _0x4089f7=>{const _0x30f8ce=_0x3676fb,_0x18a617=_0x4089f7['unit'][_0x30f8ce(0x3ad)](),_0x29de5e=await this[_0x30f8ce(0x262)](_0x18a617,_univerjs_core[_0x30f8ce(0x322)]['UNIVER_DOC']);this[_0x30f8ce(0x270)][_0x30f8ce(0x3d2)](_0x18a617,_0x29de5e);}),(0x0,rxjs[_0x3676fb(0x2b0)])(this[_0x3676fb(0x2c6)]['getTypeOfUnitDisposed$'](_univerjs_core[_0x3676fb(0x322)][_0x3676fb(0x2b4)]),this[_0x3676fb(0x2c6)][_0x3676fb(0x372)](_univerjs_core[_0x3676fb(0x322)]['UNIVER_DOC']))[_0x3676fb(0x37f)]((0x0,rxjs[_0x3676fb(0x32c)])(this[_0x3676fb(0x299)]))['subscribe'](_0x5a50e5=>{const _0x1032b7=_0x3676fb,_0x1e7086=_0x5a50e5[_0x1032b7(0x3ad)](),_0x37ea5f=this[_0x1032b7(0x270)]['get'](_0x1e7086);_0x37ea5f&&(_0x37ea5f['dispose'](),this[_0x1032b7(0x270)][_0x1032b7(0x430)](_0x1e7086));});}async[_0x8dd24f(0x262)](_0x53161d,_0x320b68){const _0x4b8e4b=_0x8dd24f,_0x189b00=await this[_0x4b8e4b(0x1ee)]['requireSession'](_0x53161d),_0xf897cf=this[_0x4b8e4b(0x370)][_0x4b8e4b(0x439)](this['_getCtorByUniverInstanceType'](_0x320b68),_0x53161d,_0x320b68,_0x189b00);return await _0xf897cf[_0x4b8e4b(0x223)](),this[_0x4b8e4b(0x2ea)][_0x4b8e4b(0x368)](_0xf897cf),_0xf897cf;}[_0x8dd24f(0x447)](_0x58e7df){const _0x2ce53b=_0x8dd24f;switch(_0x58e7df){case _univerjs_core['UniverInstanceType'][_0x2ce53b(0x2f9)]:return DocCollaborationEntity;case _univerjs_core[_0x2ce53b(0x322)][_0x2ce53b(0x2b4)]:return SheetCollaborationEntity;default:throw new Error(_0x2ce53b(0x47a)+_0x58e7df);}}};CollaborationController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationSessionService)),__decorateParam(0x2,_univerjs_core[_0x8dd24f(0x407)]),__decorateParam(0x3,_univerjs_core[_0x8dd24f(0x39f)])],CollaborationController);var name='@univerjs-pro/collaboration-client',version=_0x8dd24f(0x316);const DEFAULT_FILE_NAME_KEY='DEFAULT_FILE_NAME',UNIVER_DEFAULT_FILE_NAME=_0x8dd24f(0x228);let FileNameController=class FileNameController extends _univerjs_core[_0x8dd24f(0x36a)]{constructor(_0x320794,_0xf363a3){const _0x527b43=_0x8dd24f;super(),this[_0x527b43(0x2c6)]=_0x320794,this['_configService']=_0xf363a3,this[_0x527b43(0x482)]();}[_0x8dd24f(0x482)](){const _0x372edc=_0x8dd24f;this[_0x372edc(0x2fb)](this[_0x372edc(0x2c6)][_0x372edc(0x313)][_0x372edc(0x1e7)](()=>{const _0x4d057a=_0x372edc;var _0x45b133;const _0x1923ba=this['_univerInstanceService']['getFocusedUnit']();let _0x34034d=(_0x45b133=this[_0x4d057a(0x3a9)][_0x4d057a(0x3c7)](_0x4d057a(0x3e1)))!==null&&_0x45b133!==void 0x0?_0x45b133:UNIVER_DEFAULT_FILE_NAME;if(_0x1923ba instanceof _univerjs_core[_0x4d057a(0x2f6)])_0x34034d=_0x1923ba[_0x4d057a(0x2d9)];document[_0x4d057a(0x377)]=_0x34034d;}));}};FileNameController=__decorate([__decorateParam(0x0,_univerjs_core[_0x8dd24f(0x39f)]),__decorateParam(0x1,_univerjs_core['IConfigService'])],FileNameController);let AuthServerService=class AuthServerService{constructor(_0x28cb88,_0x4d6bc9,_0x54adac){const _0x434988=_0x8dd24f;this[_0x434988(0x3a9)]=_0x28cb88,this[_0x434988(0x30e)]=_0x4d6bc9,this[_0x434988(0x1ca)]=_0x54adac,this[_0x434988(0x223)]();}[_0x8dd24f(0x223)](){const _0x44fb08=_0x8dd24f;this[_0x44fb08(0x30e)][_0x44fb08(0x44b)]({'priority':0x1,'interceptor':(_0x2b61a2,_0x10e886)=>{const _0x38c8c0=_0x44fb08;return _0x10e886(_0x2b61a2)[_0x38c8c0(0x37f)]((0x0,rxjs[_0x38c8c0(0x2f4)])(async _0xb86d9f=>{const _0x512bbc=_0x38c8c0,_0x5be654=_0xb86d9f;if(_0x5be654[_0x512bbc(0x2db)]===0x191){if(typeof window===_0x512bbc(0x1ae))throw new Error(_0x512bbc(0x3c4));if(window[_0x512bbc(0x1ac)](this[_0x512bbc(0x1ca)]['t'](_0x512bbc(0x3ff)))){const _0x3212f9=window[_0x512bbc(0x373)](window[_0x512bbc(0x323)][_0x512bbc(0x1c5)]);window[_0x512bbc(0x323)][_0x512bbc(0x1c5)]=this[_0x512bbc(0x291)]()+_0x512bbc(0x2ad)+_0x3212f9;}}return _0x5be654;}));}});}[_0x8dd24f(0x291)](){const _0x15076f=_0x8dd24f;var _0x10975a;const _0x5f379f=this[_0x15076f(0x3a9)][_0x15076f(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x10975a=_0x5f379f===null||_0x5f379f===void 0x0?void 0x0:_0x5f379f[_0x15076f(0x294)])!==null&&_0x10975a!==void 0x0?_0x10975a:DEFAULT_LOGIN_URL;}};AuthServerService=__decorate([__decorateParam(0x0,_univerjs_core[_0x8dd24f(0x407)]),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_network[_0x8dd24f(0x44c)])),__decorateParam(0x2,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x436)]))],AuthServerService);const DEFAULT_AUTHZ_URL_KEY$1='/universer-api/authz';let AuthzIoHttpService=class AuthzIoHttpService extends _univerjs_core[_0x8dd24f(0x36a)]{constructor(_0x4b62fe,_0x43af33){super(),this['_HTTPService']=_0x4b62fe,this['_configService']=_0x43af33,_defineProperty(this,'_cfgEnableObjInherit',![]),this['_initMergeInterceptor']();}[_0x8dd24f(0x216)](){const _0x1a2514=_0x8dd24f,_0x2c6848=this;this[_0x1a2514(0x2fb)](this['_HTTPService'][_0x1a2514(0x44b)]({'priority':0x3e7,'interceptor':(0x0,_univerjs_network[_0x1a2514(0x424)])({'isMatch'(_0x3de335){const _0x451663=_0x1a2514;var _0x249d13;if(_0x3de335['method']===_0x451663(0x2af)&&((_0x249d13=_0x3de335['requestParams'])===null||_0x249d13===void 0x0?void 0x0:_0x249d13[_0x451663(0x1d2)])){const {objectID:_0x7dbe3f,objectType:_0x4b06e3}=_0x3de335['requestParams'][_0x451663(0x1d2)]||{};if(!_0x7dbe3f||_0x4b06e3===void 0x0)return![];const _0xefd1e8=_0x2c6848[_0x451663(0x3a5)]()+'/'+_0x4b06e3+_0x451663(0x279)+_0x7dbe3f+_0x451663(0x423);if(_0x3de335['url']===_0xefd1e8)return!![];}return![];},'getParamsFromRequest'(_0x24034f){const _0x36f31f=_0x1a2514;var _0x19d08a;return(_0x19d08a=_0x24034f[_0x36f31f(0x434)])===null||_0x19d08a===void 0x0?void 0x0:_0x19d08a[_0x36f31f(0x1d2)];},'mergeParamsToRequest'(_0x55e62d,_0x1dbddf){const _0x4f1b86=_0x1a2514,_0x4ea685=_0x2c6848[_0x4f1b86(0x3a5)]()+_0x4f1b86(0x2e3),_0x234f23=_0x55e62d[_0x4f1b86(0x33d)]((_0x704be1,_0x16a1ba)=>{const _0x16229e=_0x4f1b86,{unitID:_0x495735,objectID:_0x3f51cc,objectType:_0x1887ca,actions:_0x205ede}=_0x16a1ba;if(!_0x704be1[_0x495735])_0x704be1[_0x495735]={};if(!_0x704be1[_0x495735][_0x3f51cc])_0x704be1[_0x495735][_0x3f51cc]={'objectID':_0x3f51cc,'objectType':_0x1887ca,'actions':[]};return _0x704be1[_0x495735][_0x3f51cc]['actions'][_0x16229e(0x405)](..._0x205ede),_0x704be1;},{}),_0x33a47c=[];for(const _0x25d66f in _0x234f23)for(const _0x3cee05 in _0x234f23[_0x25d66f]){const {actions:_0xd5171e,objectType:_0x2bc5f0}=_0x234f23[_0x25d66f][_0x3cee05],_0x4a9f91=[...new Set(_0xd5171e)];_0x33a47c[_0x4f1b86(0x405)]({'unitID':_0x25d66f,'objectID':_0x3cee05,'objectType':_0x2bc5f0,'actions':_0x4a9f91});}return new _univerjs_network[(_0x4f1b86(0x3b8))](_0x4f1b86(0x2af),_0x4ea685,{'headers':_0x1dbddf[_0x4f1b86(0x2eb)],'withCredentials':_0x1dbddf[_0x4f1b86(0x3f8)],'responseType':_0x1dbddf[_0x4f1b86(0x432)],'body':{'requests':_0x33a47c}});}},{'distributeResult'(_0x33d707,_0x48c63b){const _0x4c2c20=_0x1a2514,{objectActions:_0x11d9bf}=_0x33d707;return _0x48c63b[_0x4c2c20(0x441)](_0x5be293=>{const _0xb6d1d1=_0x4c2c20,{unitID:_0x24385c,objectID:_0x1cdf65,actions:_0x3096b8}=_0x5be293,_0x5210b5=_0x11d9bf['find'](_0x4ee4f3=>_0x4ee4f3[_0xb6d1d1(0x398)]===_0x24385c&&_0x4ee4f3[_0xb6d1d1(0x2b2)]===_0x1cdf65);return{'config':_0x5be293,'result':{'actions':_0x3096b8[_0xb6d1d1(0x441)](_0x13442f=>_0x5210b5===null||_0x5210b5===void 0x0?void 0x0:_0x5210b5[_0xb6d1d1(0x3d7)]['find'](_0x20bc47=>_0x20bc47[_0xb6d1d1(0x25e)]===_0x13442f))[_0xb6d1d1(0x23a)](_0x5dd230=>!!_0x5dd230),'error':_0x33d707[_0xb6d1d1(0x35a)]}};});}})}));}['_getAPIPrefixPath'](){const _0x1f4cdf=_0x8dd24f;var _0x52d9d4;const _0x59695a=this['_configService']['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x52d9d4=_0x59695a===null||_0x59695a===void 0x0?void 0x0:_0x59695a[_0x1f4cdf(0x410)])!==null&&_0x52d9d4!==void 0x0?_0x52d9d4:DEFAULT_AUTHZ_URL_KEY$1;}async[_0x8dd24f(0x238)](_0x3a8045){const _0x1fe5b3=_0x8dd24f,_0x2ea40c=this[_0x1fe5b3(0x3a5)]()+'/'+_0x3a8045[_0x1fe5b3(0x1b8)]+_0x1fe5b3(0x27b);return(await this[_0x1fe5b3(0x1cf)]['post'](_0x2ea40c,{'body':_0x3a8045}))[_0x1fe5b3(0x1d2)][_0x1fe5b3(0x2b2)]||'';}async[_0x8dd24f(0x3c1)](_0x348620){const _0x963fc7=_0x8dd24f,_0x3df591=this[_0x963fc7(0x3a5)]()+_0x963fc7(0x231);return(await this[_0x963fc7(0x1cf)]['post'](_0x3df591,{'body':_0x348620}))[_0x963fc7(0x1d2)][_0x963fc7(0x3c0)];}async['update'](_0x1d4a43){const _0x1f5ba9=_0x8dd24f;var _0x1a1aac;const _0x1683d6=this['_getAPIPrefixPath']()+'/'+_0x1d4a43[_0x1f5ba9(0x1b8)]+_0x1f5ba9(0x279)+_0x1d4a43[_0x1f5ba9(0x2b2)],_0x5cec4d=await this['_HTTPService'][_0x1f5ba9(0x1ec)](_0x1683d6,{'body':_0x1d4a43});if((_0x5cec4d===null||_0x5cec4d===void 0x0||(_0x1a1aac=_0x5cec4d[_0x1f5ba9(0x1d2)])===null||_0x1a1aac===void 0x0||(_0x1a1aac=_0x1a1aac[_0x1f5ba9(0x35a)])===null||_0x1a1aac===void 0x0?void 0x0:_0x1a1aac['code'])!==0x1)throw new Error(_0x1f5ba9(0x48a));}async[_0x8dd24f(0x317)](_0x10061d){const _0x20a472=_0x8dd24f,_0x5090a9=this[_0x20a472(0x3a5)]()+'/'+_0x10061d[_0x20a472(0x1b8)]+'/object/'+_0x10061d[_0x20a472(0x2b2)]+_0x20a472(0x423);return(await this[_0x20a472(0x1cf)]['post'](_0x5090a9,{'body':_0x10061d}))[_0x20a472(0x1d2)][_0x20a472(0x3d7)];}async['batchAllowed'](_0x410b56){const _0x4c1968=_0x8dd24f,_0x484df6=this[_0x4c1968(0x3a5)]()+'/-/object/-/batch_allowed';return(await this[_0x4c1968(0x1cf)]['post'](_0x484df6,{'body':{'requests':_0x410b56}}))[_0x4c1968(0x1d2)][_0x4c1968(0x2cf)];}async['listRoles'](_0x499f97){const _0x26c345=_0x8dd24f,_0x22eab6=this['_getAPIPrefixPath']()+'/'+_0x499f97[_0x26c345(0x1b8)]+_0x26c345(0x233),_0x20636f=await this[_0x26c345(0x1cf)]['post'](_0x22eab6,{'body':_0x499f97});return{'roles':_0x20636f[_0x26c345(0x1d2)][_0x26c345(0x240)],'actions':_0x20636f[_0x26c345(0x1d2)][_0x26c345(0x3d7)]};}async[_0x8dd24f(0x3da)](_0x1521ad){const _0xf8db1a=_0x8dd24f,_0x41766c=this[_0xf8db1a(0x3a5)]()+_0xf8db1a(0x1d0);await this[_0xf8db1a(0x1cf)][_0xf8db1a(0x430)](_0x41766c,{'params':{'collaboratorID':_0x1521ad['collaboratorID'],'objectID':_0x1521ad[_0xf8db1a(0x2b2)],'unitID':_0x1521ad[_0xf8db1a(0x398)]}});}async[_0x8dd24f(0x315)](_0x22aa06){const _0x1a1255=_0x8dd24f,_0xe921c5=this[_0x1a1255(0x3a5)]()+_0x1a1255(0x1d0);await this[_0x1a1255(0x1cf)][_0x1a1255(0x2ab)](_0xe921c5,{'body':_0x22aa06});}async[_0x8dd24f(0x307)](_0x3f6dea){const _0x3aaf84=_0x8dd24f,_0x7bbd0b=this[_0x3aaf84(0x3a5)]()+'/collaborator';await this[_0x3aaf84(0x1cf)][_0x3aaf84(0x43e)](_0x7bbd0b,{'body':_0x3f6dea});}async[_0x8dd24f(0x2e6)](_0x12b232){const _0x339337=_0x8dd24f;var _0x1b0246;const _0x37a8ec=this[_0x339337(0x3a5)]()+_0x339337(0x1d0),_0x598587=await this['_HTTPService'][_0x339337(0x44e)](_0x37a8ec,{'params':{'objectID':_0x12b232[_0x339337(0x2b2)],'unitID':_0x12b232[_0x339337(0x398)]}});return this[_0x339337(0x1cb)]((_0x1b0246=_0x598587[_0x339337(0x1d2)][_0x339337(0x1ce)])!==null&&_0x1b0246!==void 0x0?_0x1b0246:![]),_0x598587['body']['collaborators'];}async[_0x8dd24f(0x3f3)](_0x34ee06){const _0x55ec63=_0x8dd24f,_0x13fba5=this[_0x55ec63(0x3a5)]()+_0x55ec63(0x1d0);await this[_0x55ec63(0x1cf)]['put'](_0x13fba5,{'body':_0x34ee06});}['setCfgEnableObjInherit'](_0x24f784){this['_cfgEnableObjInherit']=_0x24f784;}['getCfgEnableObjInherit'](){return this['_cfgEnableObjInherit'];}};AuthzIoHttpService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_network[_0x8dd24f(0x44c)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x407)]))],AuthzIoHttpService);function base64ToBytes(_0x3f4900){const _0x30a2e2=_0x8dd24f,_0x3bfbfc=atob(_0x3f4900),_0x23d213=new Uint8Array(_0x3bfbfc[_0x30a2e2(0x3ec)]);for(let _0x11267c=0x0;_0x11267c<_0x3bfbfc['length'];_0x11267c++)_0x23d213[_0x11267c]=_0x3bfbfc[_0x30a2e2(0x48f)](_0x11267c);return _0x23d213;}function bytesToBase64(_0x417e3c){const _0x197a53=_0x8dd24f;let _0x1e9d2b='';for(let _0x5becaa=0x0;_0x5becaa<_0x417e3c[_0x197a53(0x3ec)];_0x5becaa++)_0x1e9d2b+=String['fromCharCode'](_0x417e3c[_0x5becaa]);return btoa(_0x1e9d2b);}function encrypt(_0x42568e,_0x31ebc9){const _0x1de1a6=_0x8dd24f,_0x422cec=base64ToBytes(_0x31ebc9),_0x21217e=(0x0,_noble_ciphers_utils_js['randomBytes'])(0x10);return bytesToBase64((0x0,_noble_ciphers_utils_js[_0x1de1a6(0x3c3)])(_0x21217e,(0x0,_noble_ciphers_aes_js[_0x1de1a6(0x416)])(_0x422cec,_0x21217e)[_0x1de1a6(0x266)]((0x0,_noble_ciphers_utils_js[_0x1de1a6(0x1ea)])(_0x42568e))));}function getAttachHeader(){const _0x34a0dd=_0x8dd24f,_0x450e1e=(0x0,_univerjs_pro_license[_0x34a0dd(0x277)])()['__Key__'];if(typeof window!==_0x34a0dd(0x1ae)&&typeof window[_0x34a0dd(0x323)]!==_0x34a0dd(0x1ae)&&_0x450e1e){const _0x424165={'time':Math[_0x34a0dd(0x1d7)](Date[_0x34a0dd(0x1bd)]()/0x3e8),'domain':location['hostname']};return encrypt(JSON[_0x34a0dd(0x2e7)](_0x424165),_0x450e1e);}}let DomainRequestService=class DomainRequestService{constructor(_0x52546b){const _0x286954=_0x8dd24f;this[_0x286954(0x30e)]=_0x52546b,this['_initRequestHeader']();}[_0x8dd24f(0x2a6)](){const _0x18a874=_0x8dd24f;this[_0x18a874(0x30e)][_0x18a874(0x44b)]({'interceptor':(_0x4abd45,_0x52facd)=>{const _0x13a1f6=_0x18a874,_0x264b03=getAttachHeader();if(_0x264b03)_0x4abd45[_0x13a1f6(0x2eb)][_0x13a1f6(0x3d2)](_0x13a1f6(0x479),_0x264b03);return _0x52facd(_0x4abd45);}});}};DomainRequestService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_network[_0x8dd24f(0x44c)]))],DomainRequestService);function _0x17f9(_0x5c9ca9,_0x4cd664){_0x5c9ca9=_0x5c9ca9-0x1a5;const _0x967104=_0x9671();let _0x17f949=_0x967104[_0x5c9ca9];return _0x17f949;}let DataLoaderService=class DataLoaderService extends _univerjs_core[_0x8dd24f(0x45c)]{constructor(_0x1724f9,_0x58300e,_0x5276bf){const _0x19f01b=_0x8dd24f;super(),this['_logService']=_0x1724f9,this['_snapshotService']=_0x58300e,this[_0x19f01b(0x2f3)]=_0x5276bf,_defineProperty(this,_0x19f01b(0x46e),new rxjs[(_0x19f01b(0x33f))](null)),_defineProperty(this,_0x19f01b(0x422),this[_0x19f01b(0x46e)]['asObservable']());}async[_0x8dd24f(0x31d)](_0xcb45d,_0x381b5f,_0x2e7549){const _0x486e7f=_0x8dd24f;this[_0x486e7f(0x46e)][_0x486e7f(0x368)]({'unitId':_0xcb45d,'type':_0x381b5f});let _0x14d712=null;switch(_0x381b5f){case _univerjs_core[_0x486e7f(0x322)][_0x486e7f(0x2b4)]:_0x14d712=await this[_0x486e7f(0x30a)][_0x486e7f(0x493)](_0xcb45d,_0x2e7549);break;case _univerjs_core[_0x486e7f(0x322)][_0x486e7f(0x2f9)]:_0x14d712=await this[_0x486e7f(0x30a)][_0x486e7f(0x1c2)](_0xcb45d,_0x2e7549);break;default:this[_0x486e7f(0x305)][_0x486e7f(0x35a)]('[DataLoaderService]',_0x486e7f(0x411));break;}return _0x14d712;}async[_0x8dd24f(0x3f9)](_0x505b8c,_0x27f75d,_0x44dcf1){const _0x2abeb1=_0x8dd24f;var _0x45c64e;this[_0x2abeb1(0x46e)][_0x2abeb1(0x368)]({'unitId':_0x505b8c,'type':_0x27f75d,'subUnitId':_0x44dcf1});let _0xe8d20c=0x0;const _0x44b8e4=await((_0x45c64e=this[_0x2abeb1(0x2f3)])===null||_0x45c64e===void 0x0?void 0x0:_0x45c64e[_0x2abeb1(0x383)](_0x505b8c));if(_0x44b8e4&&(_0x44b8e4[_0x2abeb1(0x20f)]||_0x44b8e4['mutations'][_0x2abeb1(0x3ec)]!==0x0))_0xe8d20c=_0x44b8e4['rev'];if(_0xe8d20c===0x0)this[_0x2abeb1(0x305)][_0x2abeb1(0x458)]('[DataLoaderService]',_0x2abeb1(0x3e9));return this[_0x2abeb1(0x31d)](_0x505b8c,_0x27f75d,_0xe8d20c);}};DataLoaderService=__decorate([__decorateParam(0x0,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration[_0x8dd24f(0x1ab)])),__decorateParam(0x2,(0x0,_univerjs_core[_0x8dd24f(0x24f)])(ILocalCacheService))],DataLoaderService);const DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY='/universer-api/stream/file/upload',DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY=_0x8dd24f(0x341);let CollaborationImageIoService=class CollaborationImageIoService{constructor(_0x31b69c,_0x30cc31,_0x12fe7c){const _0x467b14=_0x8dd24f;this[_0x467b14(0x30e)]=_0x31b69c,this[_0x467b14(0x3a9)]=_0x30cc31,this['_univerInstanceService']=_0x12fe7c,_defineProperty(this,_0x467b14(0x1a7),0x0),_defineProperty(this,_0x467b14(0x2bc),new rxjs[(_0x467b14(0x1c9))]()),_defineProperty(this,_0x467b14(0x260),this[_0x467b14(0x2bc)]),_defineProperty(this,_0x467b14(0x227),new Map());}[_0x8dd24f(0x47d)](_0xfc2356){const _0x4f7a0b=_0x8dd24f;this['_waitCount']=_0xfc2356,this['_change$'][_0x4f7a0b(0x368)](_0xfc2356);}[_0x8dd24f(0x2f7)](_0x13a370,_0x153dd6){const _0x1a8f0b=_0x8dd24f;if(_0x153dd6===_univerjs_drawing[_0x1a8f0b(0x2bd)][_0x1a8f0b(0x237)]){const _0x21d493=new Image();return _0x21d493[_0x1a8f0b(0x3fd)]=_0x13a370,_0x21d493;}return this[_0x1a8f0b(0x227)][_0x1a8f0b(0x44e)](_0x13a370);}['addImageSourceCache'](_0x1f1bd5,_0x3eaacb,_0x3f8e14){const _0x355576=_0x8dd24f;if(_0x3eaacb===_univerjs_drawing[_0x355576(0x2bd)][_0x355576(0x237)]||_0x3f8e14==null)return;this[_0x355576(0x227)][_0x355576(0x3d2)](_0x1f1bd5,_0x3f8e14);}async[_0x8dd24f(0x319)](_0x4db822){const _0x7e4573=_0x8dd24f;try{const _0x49b623=this[_0x7e4573(0x367)](this['_getSignURL'](),''+_0x4db822),_0x23c5e0=(await this[_0x7e4573(0x30e)][_0x7e4573(0x44e)](_0x49b623))[_0x7e4573(0x1d2)];if(_0x23c5e0['error']&&_0x23c5e0[_0x7e4573(0x35a)]['code']===_univerjs_protocol[_0x7e4573(0x263)]['OK']){const _0x32e653=(0x0,_univerjs_core[_0x7e4573(0x27e)])(_0x23c5e0[_0x7e4573(0x274)],this['_getDownloadEndpointURL']());return Promise[_0x7e4573(0x3ce)](_0x32e653);}return Promise[_0x7e4573(0x48b)](_0x23c5e0[_0x7e4573(0x35a)]);}catch(_0x1c678e){return Promise[_0x7e4573(0x48b)](_0x1c678e);}}async[_0x8dd24f(0x457)](_0xfd3ab4){const _0x1a2c2e=_0x8dd24f;let _0x123327='';if(!_univerjs_drawing[_0x1a2c2e(0x3be)]['includes'](_0xfd3ab4['type']))return this['_decreaseWaiting'](),Promise[_0x1a2c2e(0x48b)](new Error(_univerjs_drawing[_0x1a2c2e(0x34b)][_0x1a2c2e(0x380)]));if(_0xfd3ab4['size']>(0x0,_univerjs_drawing[_0x1a2c2e(0x24a)])())return this[_0x1a2c2e(0x47e)](),Promise[_0x1a2c2e(0x48b)](new Error(_univerjs_drawing[_0x1a2c2e(0x34b)][_0x1a2c2e(0x1b4)]));try{const _0x203482=new FormData();_0x203482[_0x1a2c2e(0x2d8)](_0x1a2c2e(0x466),_0xfd3ab4);const _0x1dfa09=this[_0x1a2c2e(0x2c6)]['getFocusedUnit'](),_0x238a4d=_0x1dfa09===null||_0x1dfa09===void 0x0?void 0x0:_0x1dfa09['getUnitId']();if(!_0x238a4d)throw new Error('unitId\x20is\x20not\x20found');const _0x5d1093=this[_0x1a2c2e(0x1b6)]()+_0x1a2c2e(0x2a5)+_0xfd3ab4[_0x1a2c2e(0x425)][_0x1a2c2e(0x40a)]()+_0x1a2c2e(0x336)+_univerjs_protocol[_0x1a2c2e(0x40e)][_0x1a2c2e(0x473)]+_0x1a2c2e(0x1a6)+encodeURIComponent(_0x238a4d),_0x715b81={'body':_0x203482},_0x5abdc8=(await this[_0x1a2c2e(0x30e)][_0x1a2c2e(0x43e)](_0x5d1093,_0x715b81))['body'];if(typeof _0x5abdc8['FileId']!=='string')return this[_0x1a2c2e(0x47e)](),Promise[_0x1a2c2e(0x48b)](new Error(_univerjs_drawing[_0x1a2c2e(0x34b)][_0x1a2c2e(0x26c)]));_0x123327=_0x5abdc8[_0x1a2c2e(0x2d4)];}catch(_0x392090){return this['_decreaseWaiting'](),Promise[_0x1a2c2e(0x48b)](new Error(_univerjs_drawing['ImageUploadStatusType'][_0x1a2c2e(0x26c)]));}return new Promise((_0x239edf,_0x40028d)=>{const _0x44dc4c=_0x1a2c2e,_0x4bc998=new FileReader();_0x4bc998['readAsDataURL'](_0xfd3ab4),_0x4bc998[_0x44dc4c(0x296)]=_0x2b0336=>{const _0x91679f=_0x44dc4c;var _0x1e23a8;const _0x48b7d5=(_0x1e23a8=_0x2b0336[_0x91679f(0x485)])===null||_0x1e23a8===void 0x0?void 0x0:_0x1e23a8[_0x91679f(0x46f)];if(_0x48b7d5==null){this[_0x91679f(0x47e)](),_0x40028d(new Error(_univerjs_drawing['ImageUploadStatusType'][_0x91679f(0x26c)]));return;}_0x239edf({'imageId':(0x0,_univerjs_core[_0x91679f(0x488)])(0x6),'imageSourceType':_univerjs_drawing['ImageSourceType'][_0x91679f(0x33e)],'source':_0x123327,'base64Cache':_0x48b7d5,'status':_univerjs_drawing['ImageUploadStatusType'][_0x91679f(0x2a7)]}),this['_decreaseWaiting']();};});}['_getUploadFileURL'](){const _0x3f5a66=_0x8dd24f;var _0x2521ba;const _0x3a7fea=this[_0x3f5a66(0x3a9)][_0x3f5a66(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x2521ba=_0x3a7fea===null||_0x3a7fea===void 0x0?void 0x0:_0x3a7fea[_0x3f5a66(0x29d)])!==null&&_0x2521ba!==void 0x0?_0x2521ba:DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY;}[_0x8dd24f(0x359)](){const _0x26ff3c=_0x8dd24f;var _0x152a8c;const _0x557e37=this[_0x26ff3c(0x3a9)][_0x26ff3c(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x152a8c=_0x557e37===null||_0x557e37===void 0x0?void 0x0:_0x557e37[_0x26ff3c(0x308)])!==null&&_0x152a8c!==void 0x0?_0x152a8c:DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY;}[_0x8dd24f(0x36b)](){const _0x5b8cc7=_0x8dd24f;var _0x4ad3e7;const _0x2b2351=this['_configService'][_0x5b8cc7(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x4ad3e7=_0x2b2351===null||_0x2b2351===void 0x0?void 0x0:_0x2b2351['downloadEndpointUrl'])!==null&&_0x4ad3e7!==void 0x0?_0x4ad3e7:location['origin'];}['_replaceFileID'](_0x5c390f,_0x45983a){const _0x11454a=_0x8dd24f;return _0x5c390f[_0x11454a(0x206)](_0x11454a(0x239),_0x45983a);}[_0x8dd24f(0x47e)](){const _0x1f02df=_0x8dd24f;this[_0x1f02df(0x1a7)]-=0x1,this[_0x1f02df(0x2bc)][_0x1f02df(0x368)](this[_0x1f02df(0x1a7)]);}};CollaborationImageIoService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_network[_0x8dd24f(0x44c)])),__decorateParam(0x1,_univerjs_core[_0x8dd24f(0x407)]),__decorateParam(0x2,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x39f)]))],CollaborationImageIoService);const DEFAULT_AUTHZ_URL_KEY='/universer-api/authz';let MentionIoHttpService=class MentionIoHttpService{constructor(_0x337c35,_0x397a71){const _0x4f7471=_0x8dd24f;this[_0x4f7471(0x3a9)]=_0x337c35,this['_HTTPService']=_0x397a71;}[_0x8dd24f(0x3a5)](){const _0x59ede3=_0x8dd24f;var _0x20bdb4;const _0x22928f=this[_0x59ede3(0x3a9)][_0x59ede3(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x20bdb4=_0x22928f===null||_0x22928f===void 0x0?void 0x0:_0x22928f[_0x59ede3(0x410)])!==null&&_0x20bdb4!==void 0x0?_0x20bdb4:DEFAULT_AUTHZ_URL_KEY;}async['list'](_0x441521){const _0x59dd12=_0x8dd24f,_0x201f69=this[_0x59dd12(0x3a5)]()+_0x59dd12(0x1d0);return{'list':[{'title':'People','mentions':(await this[_0x59dd12(0x1cf)][_0x59dd12(0x44e)](_0x201f69,{'params':{'objectID':_0x441521[_0x59dd12(0x3b3)],'unitID':_0x441521['unitId']}}))['body'][_0x59dd12(0x40f)][_0x59dd12(0x441)](_0xa1cb6f=>({'objectId':_0xa1cb6f['id'],'name':_0xa1cb6f[_0x59dd12(0x38d)][_0x59dd12(0x2d9)],'metadata':{'icon':_0xa1cb6f['subject'][_0x59dd12(0x22c)]},'label':_0xa1cb6f['subject'][_0x59dd12(0x2d9)],'objectType':_univerjs_core[_0x59dd12(0x40c)][_0x59dd12(0x3bc)]})),'metadata':{},'type':_univerjs_core[_0x59dd12(0x40c)][_0x59dd12(0x3bc)]}]};}};MentionIoHttpService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_core[_0x8dd24f(0x407)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x8dd24f(0x465)])(_univerjs_network[_0x8dd24f(0x44c)]))],MentionIoHttpService);let PermissionService=class PermissionService extends _univerjs_core[_0x8dd24f(0x45c)]{constructor(_0x3b248a,_0x537051,_0x5c5e96,_0x1437f0,_0x1d2a33){const _0x3ce71b=_0x8dd24f;super(),this[_0x3ce71b(0x370)]=_0x3b248a,this[_0x3ce71b(0x2c6)]=_0x537051,this[_0x3ce71b(0x2a1)]=_0x5c5e96,this[_0x3ce71b(0x245)]=_0x1437f0,this[_0x3ce71b(0x334)]=_0x1d2a33,this[_0x3ce71b(0x403)](),this[_0x3ce71b(0x331)]();}[_0x8dd24f(0x331)](){const _0x2cebd2=_0x8dd24f,_0x7fabc3=async _0x55a96b=>{const _0x43b301=_0x17f9;(await this['_collaborationSessionService'][_0x43b301(0x3d8)](_0x55a96b))['event$'][_0x43b301(0x37f)]((0x0,rxjs_operators[_0x43b301(0x23a)])(_0x262f8b=>_0x262f8b[_0x43b301(0x468)]===_univerjs_pro_collaboration[_0x43b301(0x2ed)][_0x43b301(0x1f2)]),(0x0,rxjs_operators[_0x43b301(0x32c)])(this[_0x43b301(0x299)]))[_0x43b301(0x1e7)](_0x2e386e=>{const _0x436954=_0x43b301,{reason:_0x2527b5}=_0x2e386e[_0x436954(0x332)];this[_0x436954(0x334)][_0x436954(0x3a3)]({'id':'CLOSE_ROOM','data':_0x2527b5}),this[_0x436954(0x2a1)][_0x436954(0x1c8)](new _univerjs_sheets[(_0x436954(0x45d))](_0x55a96b)['id'],![]),this[_0x436954(0x245)]['closeSession'](_0x55a96b);});};(0x0,rxjs['merge'])(this[_0x2cebd2(0x2c6)][_0x2cebd2(0x243)](_univerjs_core['UniverInstanceType'][_0x2cebd2(0x2b4)]),this[_0x2cebd2(0x2c6)]['getTypeOfUnitAdded$'](_univerjs_core[_0x2cebd2(0x322)][_0x2cebd2(0x2f9)]))[_0x2cebd2(0x37f)]((0x0,rxjs_operators[_0x2cebd2(0x441)])(_0x8064a8=>_0x8064a8['unit'][_0x2cebd2(0x3ad)]()),(0x0,rxjs_operators['filter'])(_0x4a17e2=>!(0x0,_univerjs_core[_0x2cebd2(0x2c5)])(_0x4a17e2)),(0x0,rxjs_operators[_0x2cebd2(0x32c)])(this[_0x2cebd2(0x299)]))[_0x2cebd2(0x1e7)](_0x24ed5a=>{_0x7fabc3(_0x24ed5a);});}[_0x8dd24f(0x403)](){const _0x540b51=_0x8dd24f,_0x1d09f2=async _0x3d481c=>{const _0x8c98f6=_0x17f9,_0x28ed6e=await this[_0x8c98f6(0x245)][_0x8c98f6(0x3d8)](_0x3d481c),_0x3644d2=this['_injector'][_0x8c98f6(0x44e)](_univerjs_sheets[_0x8c98f6(0x484)]);_0x28ed6e[_0x8c98f6(0x45e)][_0x8c98f6(0x37f)]((0x0,rxjs_operators[_0x8c98f6(0x23a)])(_0x23d223=>_0x23d223[_0x8c98f6(0x468)]===_univerjs_pro_collaboration[_0x8c98f6(0x2ed)][_0x8c98f6(0x293)]),(0x0,rxjs_operators['takeUntil'])(this[_0x8c98f6(0x299)]))[_0x8c98f6(0x1e7)](_0x2df37d=>{const _0xde09c8=_0x8c98f6,{objectId:_0x493722}=_0x2df37d[_0xde09c8(0x332)];if(_0x493722===_0x3d481c)_0x3644d2[_0xde09c8(0x2d7)](_0x3d481c);else _0x3644d2[_0xde09c8(0x2cc)](_0x3d481c,_0x493722);});};(0x0,rxjs[_0x540b51(0x2b0)])(this['_univerInstanceService'][_0x540b51(0x243)](_univerjs_core[_0x540b51(0x322)][_0x540b51(0x2b4)]))[_0x540b51(0x37f)]((0x0,rxjs_operators[_0x540b51(0x441)])(_0x4c55a9=>_0x4c55a9[_0x540b51(0x28a)][_0x540b51(0x3ad)]()),(0x0,rxjs_operators[_0x540b51(0x23a)])(_0x2a3826=>!(0x0,_univerjs_core[_0x540b51(0x2c5)])(_0x2a3826)),(0x0,rxjs_operators['takeUntil'])(this[_0x540b51(0x299)]))[_0x540b51(0x1e7)](_0x5eeb30=>{_0x1d09f2(_0x5eeb30);});}};PermissionService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x8dd24f(0x361)])),__decorateParam(0x1,_univerjs_core[_0x8dd24f(0x39f)]),__decorateParam(0x2,_univerjs_core[_0x8dd24f(0x397)]),__decorateParam(0x3,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationSessionService)),__decorateParam(0x4,(0x0,_univerjs_core[_0x8dd24f(0x465)])(CollaborationUIEventService))],PermissionService);let SnapshotServerOverHTTPService=class SnapshotServerOverHTTPService{constructor(_0x2d11b9,_0x25d957){const _0x5ab771=_0x8dd24f;this[_0x5ab771(0x3a9)]=_0x2d11b9,this['_httpService']=_0x25d957;}async['getUnitOnRev'](_0x1df306,_0xf99fe5){const _0x1b543e=_0x8dd24f;var _0x31845a;const {unitID:_0x417bbc,type:_0x2edbbd,revision:revision=0x0}=_0xf99fe5,_0xc56846=this[_0x1b543e(0x452)]()+'/'+_0x2edbbd+_0x1b543e(0x211)+_0x417bbc+_0x1b543e(0x229)+revision,_0x35eb20=(await this[_0x1b543e(0x30e)]['get'](_0xc56846))[_0x1b543e(0x1d2)],_0x463fe0=(_0x31845a=_0x35eb20[_0x1b543e(0x1df)])===null||_0x31845a===void 0x0?void 0x0:_0x31845a[_0x1b543e(0x3c5)];if(_0x463fe0){const _0x3ddfb6=_0x463fe0===null||_0x463fe0===void 0x0?void 0x0:_0x463fe0[_0x1b543e(0x46c)];_0x463fe0['originalMeta']=_univerjs_pro_collaboration[_0x1b543e(0x1e5)][_0x1b543e(0x3fb)]((0x0,_univerjs_pro_collaboration[_0x1b543e(0x400)])(_0x3ddfb6)),Object[_0x1b543e(0x1d8)](_0x463fe0[_0x1b543e(0x45f)])['forEach'](([,_0x121c62])=>{const _0x1453c4=_0x1b543e,_0x4e472b=_0x121c62[_0x1453c4(0x46c)];_0x121c62[_0x1453c4(0x46c)]=_univerjs_pro_collaboration[_0x1453c4(0x1e5)][_0x1453c4(0x3fb)]((0x0,_univerjs_pro_collaboration[_0x1453c4(0x400)])(_0x4e472b));});}return _0x35eb20;}async[_0x8dd24f(0x32a)](_0x36be83,_0x4294d7){const _0x4272ba=_0x8dd24f,{unitID:_0x123bd9,type:_0x3a7bad,blockID:_0x1ba552}=_0x4294d7,_0x46913e=this[_0x4272ba(0x28c)]()+'/'+_0x3a7bad+_0x4272ba(0x211)+_0x123bd9+'/block/'+_0x1ba552;return(await this['_httpService']['get'](_0x46913e))[_0x4272ba(0x1d2)];}async['getDeserializedSheetBlock'](_0x243f31,_0x71e65b){const _0xa9e0be=_0x8dd24f,{unitID:_0x34f05f,type:_0x44da5b,blockID:_0x3d6b5b}=_0x71e65b,_0x2dda6d=this[_0xa9e0be(0x28c)]()+_0xa9e0be(0x2a0)+_0x44da5b+_0xa9e0be(0x211)+_0x34f05f+_0xa9e0be(0x2a0)+_0x3d6b5b;return(await this[_0xa9e0be(0x30e)][_0xa9e0be(0x44e)](_0x2dda6d))[_0xa9e0be(0x1d2)];}async[_0x8dd24f(0x348)](_0x394323,_0x1ef542){const _0x4580c5=_0x8dd24f,{unitID:_0x1c7b03,type:_0x15448c,from:_0x4fbeb4,to:_0x3d5b59}=_0x1ef542,_0x135955=this[_0x4580c5(0x28c)]()+'/'+_0x15448c+_0x4580c5(0x211)+_0x1c7b03+_0x4580c5(0x22d)+_0x4fbeb4+'&to='+_0x3d5b59;return(await this[_0x4580c5(0x30e)][_0x4580c5(0x44e)](_0x135955))[_0x4580c5(0x1d2)];}[_0x8dd24f(0x452)](){const _0x35553e=_0x8dd24f;var _0x3cf2fc;return(_0x3cf2fc=this[_0x35553e(0x3a9)][_0x35553e(0x3c7)](_0x35553e(0x490)))!==null&&_0x3cf2fc!==void 0x0?_0x3cf2fc:this[_0x35553e(0x28c)]();}[_0x8dd24f(0x28c)](){const _0x21b46a=_0x8dd24f;var _0x31d0f4;const _0x51dd6e=this[_0x21b46a(0x3a9)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x31d0f4=_0x51dd6e===null||_0x51dd6e===void 0x0?void 0x0:_0x51dd6e['snapshotServerUrl'])!==null&&_0x31d0f4!==void 0x0?_0x31d0f4:DEFAULT_SNAPSHOT_SERVER_URL;}async[_0x8dd24f(0x3e5)](_0x560079,_0x405d70){const _0x41ee6e=_0x8dd24f,_0x1d34a7='/universer-api/snapshot/'+_0x405d70[_0x41ee6e(0x376)]+'/unit/'+_0x405d70[_0x41ee6e(0x398)]+_0x41ee6e(0x3b7);return(await this[_0x41ee6e(0x30e)][_0x41ee6e(0x44e)](_0x1d34a7,{'params':{'resourceId':JSON[_0x41ee6e(0x2e7)](_0x405d70[_0x41ee6e(0x2ba)])}}))[_0x41ee6e(0x1d2)];}['saveSnapshot'](){const _0x3056ef=_0x8dd24f;throw new Error(_0x3056ef(0x1a8));}[_0x8dd24f(0x35c)](){const _0x21d6a7=_0x8dd24f;throw new Error(_0x21d6a7(0x1a8));}[_0x8dd24f(0x290)](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}['saveChangeset'](){const _0x3c7d06=_0x8dd24f;throw new Error(_0x3c7d06(0x1a8));}[_0x8dd24f(0x284)](){const _0x16a782=_0x8dd24f;throw new Error(_0x16a782(0x1a8));}[_0x8dd24f(0x1a9)](){const _0x318238=_0x8dd24f;throw new Error(_0x318238(0x1a8));}};SnapshotServerOverHTTPService=__decorate([__decorateParam(0x0,_univerjs_core[_0x8dd24f(0x407)]),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_network[_0x8dd24f(0x44c)]))],SnapshotServerOverHTTPService);let CollaborativeUndoRedoService=class CollaborativeUndoRedoService extends _univerjs_core[_0x8dd24f(0x25d)]{constructor(_0x5a1a86,_0x49138e,_0x415ec9,_0x475f36,_0x4cf64a){super(_0x5a1a86,_0x49138e,_0x415ec9),this['_transformService']=_0x475f36,this['_logService']=_0x4cf64a;}[_0x8dd24f(0x455)](_0x584002,_0x371ada){const _0x553e6a=_0x8dd24f,_0x3bde86=this[_0x553e6a(0x1c3)](_0x584002);if(_0x3bde86)try{const _0x278971=this[_0x553e6a(0x2c1)](_0x3bde86,_0x371ada);this[_0x553e6a(0x433)](_0x584002,_0x278971);}catch(_0x132d2e){this[_0x553e6a(0x305)]['error'](_0x553e6a(0x1fc),_0x132d2e),this[_0x553e6a(0x459)](_0x584002);}const _0x543de9=this[_0x553e6a(0x494)](_0x584002);if(_0x543de9)try{const _0x1352e7=this[_0x553e6a(0x2c1)](_0x543de9,_0x371ada);this[_0x553e6a(0x2fc)](_0x584002,_0x1352e7);}catch(_0x3dc891){this[_0x553e6a(0x305)][_0x553e6a(0x35a)](_0x3dc891),this[_0x553e6a(0x219)](_0x584002);}}[_0x8dd24f(0x459)](_0x3cc155){const _0x87fa90=_0x8dd24f,_0x199312=this[_0x87fa90(0x1c3)](_0x3cc155);_0x199312&&(_0x199312[_0x87fa90(0x3ec)]=0x0,this[_0x87fa90(0x37c)]());}[_0x8dd24f(0x219)](_0x47f75a){const _0x48ef8c=_0x8dd24f,_0x39be05=this[_0x48ef8c(0x494)](_0x47f75a);_0x39be05&&(_0x39be05[_0x48ef8c(0x3ec)]=0x0,this[_0x48ef8c(0x37c)]());}[_0x8dd24f(0x433)](_0x1a9a76,_0xd61053){const _0x8233e2=_0x8dd24f;this[_0x8233e2(0x1f3)][_0x8233e2(0x3d2)](_0x1a9a76,_0xd61053),this[_0x8233e2(0x37c)]();}[_0x8dd24f(0x2fc)](_0x148cdf,_0x858f){this['_redoStacks']['set'](_0x148cdf,_0x858f),this['_updateStatus']();}[_0x8dd24f(0x2c1)](_0x5afdcc,_0x3f6f87){const _0x4f5641=_0x8dd24f,_0x2d5c94=[];let _0x159297=_0x3f6f87,_0x4a72e5=_0x3f6f87;for(let _0x53483b=_0x5afdcc[_0x4f5641(0x3ec)]-0x1;_0x53483b>=0x0;_0x53483b--){const {unitID:_0x1116cd,undoMutations:_0x170d64,redoMutations:_0x37eb24}=_0x5afdcc[_0x53483b],_0x2ae53e=this['_transformService']['transformMutationsWithChangeset'](_0x159297,_0x170d64),_0x5a3617=this[_0x4f5641(0x3f2)][_0x4f5641(0x335)](_0x4a72e5,_0x37eb24);if((0x0,_univerjs_pro_collaboration[_0x4f5641(0x327)])(_0x2ae53e)||(0x0,_univerjs_pro_collaboration[_0x4f5641(0x327)])(_0x5a3617)){this['_logService']['error']('[CollaborationUndoRedoService]','transformStack\x20failed!',_0x2ae53e,_0x5a3617);break;}_0x159297=_0x2ae53e[_0x4f5641(0x3cf)],_0x4a72e5=_0x5a3617[_0x4f5641(0x3cf)],_0x2d5c94['push']({'unitID':_0x1116cd,'undoMutations':_0x2ae53e['m2Prime'],'redoMutations':_0x5a3617[_0x4f5641(0x28b)]});}return _0x2d5c94[_0x4f5641(0x32e)]();}};CollaborativeUndoRedoService=__decorate([__decorateParam(0x0,_univerjs_core[_0x8dd24f(0x39f)]),__decorateParam(0x1,_univerjs_core[_0x8dd24f(0x2f5)]),__decorateParam(0x2,_univerjs_core[_0x8dd24f(0x39b)]),__decorateParam(0x3,_univerjs_pro_collaboration[_0x8dd24f(0x3a6)]),__decorateParam(0x4,_univerjs_core[_0x8dd24f(0x43f)])],CollaborativeUndoRedoService);let UniverCollaborationClientPlugin=class UniverCollaborationClientPlugin extends _univerjs_core[_0x8dd24f(0x3c9)]{constructor(_0x27ab7b={},_0x322560,_0x150cf8,_0x362ba4){const _0x2d47d0=_0x8dd24f;super(),this[_0x2d47d0(0x46b)]=_0x27ab7b,this[_0x2d47d0(0x305)]=_0x322560,this[_0x2d47d0(0x370)]=_0x150cf8,this[_0x2d47d0(0x3a9)]=_0x362ba4;const {..._0xfdb705}=(0x0,_univerjs_core['merge'])({},defaultPluginConfig,_0x27ab7b);if(!_0xfdb705[_0x2d47d0(0x1dd)])throw new Error(_0x2d47d0(0x1e2));this['_config']=_0xfdb705,this[_0x2d47d0(0x3a9)][_0x2d47d0(0x43b)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,_0xfdb705);}[_0x8dd24f(0x34e)](){const _0x78cf4f=_0x8dd24f;this[_0x78cf4f(0x333)](),this['_initDependencies']();}[_0x8dd24f(0x333)](){const _0x26b684=_0x8dd24f;var _0x25776f,_0x112f57;if(this[_0x26b684(0x370)][_0x26b684(0x44f)](_univerjs_core[_0x26b684(0x275)]))this[_0x26b684(0x305)]['error']('[UniverCollaborationClientPlugin]','you\x20should\x20override\x20\x22IUndoRedoService\x22\x20provided\x20in\x20\x22core\x22\x20package!');const _0x2514f1=(0x0,_univerjs_core[_0x26b684(0x477)])([[_univerjs_core[_0x26b684(0x275)],{'useClass':CollaborativeUndoRedoService}],[CollaborationSessionService],[MemberService],[SheetTransformSelectionsService],[AuthServerService],[DomainRequestService],[CommentService],[PermissionService],[CollaborationUIEventService],[DataLoaderService],[ICollaborationSocketService,{'useClass':this[_0x26b684(0x46b)][_0x26b684(0x1dd)]}],[_univerjs_pro_collaboration[_0x26b684(0x1d3)],{'useClass':SnapshotServerOverHTTPService}],[_univerjs_core[_0x26b684(0x42f)],{'useClass':AuthzIoHttpService}],[_univerjs_drawing['IImageIoService'],{'useClass':CollaborationImageIoService}],[_univerjs_core[_0x26b684(0x2ae)],{'useClass':MentionIoHttpService}],[CollaborationController],[FileNameController]],(_0x25776f=this[_0x26b684(0x46b)])===null||_0x25776f===void 0x0?void 0x0:_0x25776f[_0x26b684(0x363)]);if(!((_0x112f57=this[_0x26b684(0x46b)])===null||_0x112f57===void 0x0?void 0x0:_0x112f57['enableSingleActiveInstanceLock'])){const _0x2c3e4f=_0x2514f1['findIndex'](([_0x2bf14c])=>_0x2bf14c===ISingleActiveUnitService);if(_0x2c3e4f!==-0x1)_0x2514f1[_0x26b684(0x21e)](_0x2c3e4f,0x1);}(0x0,_univerjs_core[_0x26b684(0x2d2)])(this[_0x26b684(0x370)],_0x2514f1);}[_0x8dd24f(0x2f1)](){const _0x16b223=_0x8dd24f;var _0x579ad8,_0x4436c0;this[_0x16b223(0x370)][_0x16b223(0x44e)](_univerjs_network[_0x16b223(0x44c)])[_0x16b223(0x44b)]({'priority':0x14,'interceptor':(0x0,_univerjs_network['ThresholdInterceptorFactory'])({'maxParallel':0x6})});if(!((_0x579ad8=this[_0x16b223(0x46b)])===null||_0x579ad8===void 0x0?void 0x0:_0x579ad8[_0x16b223(0x28d)])){var _0x1b8b8a;(_0x1b8b8a=this[_0x16b223(0x370)][_0x16b223(0x44e)](ILocalCacheService,_univerjs_core[_0x16b223(0x2bf)]['OPTIONAL']))===null||_0x1b8b8a===void 0x0||_0x1b8b8a[_0x16b223(0x408)]();}if((_0x4436c0=this[_0x16b223(0x46b)])===null||_0x4436c0===void 0x0?void 0x0:_0x4436c0[_0x16b223(0x3ee)])(0x0,_univerjs_core[_0x16b223(0x28e)])(this[_0x16b223(0x370)],[[AuthServerService]]);(0x0,_univerjs_core['touchDependencies'])(this[_0x16b223(0x370)],[[DomainRequestService],[CollaborationController],[PermissionService]]);}};_defineProperty(UniverCollaborationClientPlugin,_0x8dd24f(0x2de),_0x8dd24f(0x209)),_defineProperty(UniverCollaborationClientPlugin,_0x8dd24f(0x30f),name),_defineProperty(UniverCollaborationClientPlugin,_0x8dd24f(0x32f),version),UniverCollaborationClientPlugin=__decorate([(0x0,_univerjs_core['DependentOn'])(_univerjs_pro_license[_0x8dd24f(0x33c)],_univerjs_pro_collaboration[_0x8dd24f(0x250)],_univerjs_network[_0x8dd24f(0x234)]),__decorateParam(0x1,_univerjs_core[_0x8dd24f(0x43f)]),__decorateParam(0x2,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x3,_univerjs_core[_0x8dd24f(0x407)])],UniverCollaborationClientPlugin),Object[_0x8dd24f(0x2bb)](exports,'AuthzIoHttpService',{'enumerable':!![],'get':function(){return AuthzIoHttpService;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x1f6),{'enumerable':!![],'get':function(){return AwaitingState;}}),Object[_0x8dd24f(0x2bb)](exports,'AwaitingWithPendingState',{'enumerable':!![],'get':function(){return AwaitingWithPendingState;}}),exports[_0x8dd24f(0x2a2)]=COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,Object['defineProperty'](exports,_0x8dd24f(0x36d),{'enumerable':!![],'get':function(){return CollaborationController;}}),Object[_0x8dd24f(0x2bb)](exports,'CollaborationEntity',{'enumerable':!![],'get':function(){return CollaborationEntity;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x3ba),{'enumerable':!![],'get':function(){return CollaborationImageIoService;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x3bb),{'enumerable':!![],'get':function(){return CollaborationSession;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x302),{'enumerable':!![],'get':function(){return CollaborationSessionService;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x37b),{'enumerable':!![],'get':function(){return CollaborationSocketService;}}),exports[_0x8dd24f(0x2e8)]=CollaborationStatus,exports[_0x8dd24f(0x2d3)]=CollaborationUIEventId,exports[_0x8dd24f(0x208)]=CollaborationUIEventService,Object['defineProperty'](exports,_0x8dd24f(0x300),{'enumerable':!![],'get':function(){return CollaborativeUndoRedoService;}}),exports[_0x8dd24f(0x1ff)]=CommentService,Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x379),{'enumerable':!![],'get':function(){return ConflictState;}}),exports[_0x8dd24f(0x310)]=DEFAULT_COLLAB_WEB_SOCKET_URL,exports[_0x8dd24f(0x3b6)]=DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,exports[_0x8dd24f(0x311)]=DEFAULT_WS_SESSION_TICKET_URL,Object['defineProperty'](exports,_0x8dd24f(0x3e2),{'enumerable':!![],'get':function(){return DataLoaderService;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x38b),{'enumerable':!![],'get':function(){return DocCollaborationEntity;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x200),{'enumerable':!![],'get':function(){return FetchingMissState;}}),exports[_0x8dd24f(0x3a1)]=HEARTBEAT_INTERVAL_KEY,exports[_0x8dd24f(0x1c1)]=HEARTBEAT_TIMEOUT_KEY,exports[_0x8dd24f(0x20b)]=ICollaborationSocketService,exports['ILocalCacheService']=ILocalCacheService,exports[_0x8dd24f(0x33b)]=INetworkConditionService,exports[_0x8dd24f(0x3ae)]=ISingleActiveUnitService,exports['LOCAL_CACHE_INTERVAL']=LOCAL_CACHE_INTERVAL,exports['LOCAL_CACHE_INTERVAL_KEY']=LOCAL_CACHE_INTERVAL_KEY,Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x221),{'enumerable':!![],'get':function(){return MemberService;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x3b4),{'enumerable':!![],'get':function(){return MentionIoHttpService;}}),Object[_0x8dd24f(0x2bb)](exports,'OfflineState',{'enumerable':!![],'get':function(){return OfflineState;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x1b0),{'enumerable':!![],'get':function(){return PendingState;}}),exports[_0x8dd24f(0x42c)]=REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,exports['RETRY_CONNECTING_MAX_COUNT_KEY']=RETRY_CONNECTING_MAX_COUNT_KEY,exports[_0x8dd24f(0x362)]=SessionStatus,Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x38f),{'enumerable':!![],'get':function(){return SheetCollaborationEntity;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x345),{'enumerable':!![],'get':function(){return SheetTransformSelectionsService;}}),Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x35e),{'enumerable':!![],'get':function(){return SnapshotServerOverHTTPService;}}),Object[_0x8dd24f(0x2bb)](exports,'SyncedState',{'enumerable':!![],'get':function(){return SyncedState;}}),exports[_0x8dd24f(0x474)]=UnitStatus,Object[_0x8dd24f(0x2bb)](exports,_0x8dd24f(0x382),{'enumerable':!![],'get':function(){return UniverCollaborationClientPlugin;}}),exports[_0x8dd24f(0x26d)]=deserializeToCombResponse,exports[_0x8dd24f(0x2fd)]=getLocalCacheKey,exports[_0x8dd24f(0x3c6)]=serializeCombRequest;function _0x9671(){const _0x4de39d=['length','MUTATION','enableAuthServer','iterator','_candidateSocket','object','_transformService','putCollaborators','DisposableCollection','updateCursorEvent','transformSelections','pauseCollaboration','withCredentials','loadUnit','_collaborationPaused','encode','[CollaborationEntity]:\x20cannot\x20lock\x20transition\x20twice!\x20This\x20is\x20an\x20implementation\x20error,\x20meaning\x20you\x20transit\x20the\x20collaboration\x20state\x20again\x20in\x20the\x20process\x20of\x20a\x20previous\x20transition.\x20This\x20should\x20never\x20happen.','src','_onOffline','auth.needGotoLoginAlert','b64DecodeUnicode','\x20-\x20','csShouldRetryEvent','_initUnitPermissionChange','onlyLocal','push','_onUserJoin','IConfigService','disableLocalCache','localCacheService','toString','close','MentionType','error$','FileSource','collaborators','authzUrl','Unknown\x20type.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.','onLocalMutation','sid','addHandlerCallback','_syncEditingCollabCursor','cbc','CHANGESET_REJ','createIdentifier','/universer-api/snapshot','4082526hSaNvZ','send','[serializeCombRequest]:\x20should\x20not\x20fall\x20into\x20default\x20branch!','_acknowledgedAwaitingRevision','reqId','interceptor','constructor','_fetchMissChangesets','unitInfo$','/allowed','MergeInterceptorFactory','size','PSEUDO_FETCH_MISSING_RESULT','closeSession','isTransformMutationsWithChangesetSuccess','_transformRemoteChangesetByStateCache','_updateState','_transformIMECache','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY','parse','_clearCollaborationTimeoutTimer','IAuthzIoService','delete','clear','responseType','_substituteUndoStack','requestParams','_commandService','LocaleService','slice','CmdRspCode','createInstance','offline','setConfig','take','onSyncEditingCollabCursor','post','ILogService','RichTextEditingMutation','map','complete','INGEST','_createHandler','collaboration-client.config','conflict','_getCtorByUniverInstanceType','_roomMembers','enableCollaboration','Cannot\x20assemble\x20a\x20changeset\x20from\x20multiple\x20mutations\x20of\x20different\x20types:\x20','registerHTTPInterceptor','HTTPService','equals','get','has','missingChangesets','onCommentUpdate','getSnapshotAPIPath','session','InsertSheetMutation','transformUndoRedo','memberID','saveImage','debug','_clearUndo','_unitID','commentUpdate$','RxDisposable','WorkbookEditablePermission','event$','sheets','_sendHeartbeat','toggleOffline','JOIN_ROOM_PERMISSION_DENIED','isPermissionRej','toggleOnline','Inject','file','_tryEnsureSocket','eventID','MSG_FOR_ERROR','_onUserLeave','_config','originalMeta','LIVESHARE_OPERATION','_unitInfo$','result','_stopTelemetryCollaborationNewChangeset','\x20in\x20_schedule.','_schedule','UnitEmbedded','UnitStatus','symbol','CompressMutationService','mergeOverrideWithDependencies','fromCollab','x-univer-host','[CollaborationController]:\x20invalid\x20univer\x20type:\x20','_transitionLocked','getRoom','setWaitCount','_decreaseWaiting','fetching\x20missing\x20changesets\x20from\x20','269213wjFsof','Error\x20on\x20receiving\x20event','_init','getCollabEntity','SheetPermissionInitController','target','failed\x20to\x20apply\x20missed\x20changesets!','getCollabEntity$','generateRandomId','setCurrentUser','Failed\x20to\x20update\x20permission\x20point','reject','6nBdmzN','onMutationExecutedForCollab','status$','charCodeAt','SNAPSHOT_URL_KEY','params','getMemberID','loadSheet','_getRedoStack','_retryCount','&assign=','_waitCount','This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!','getLatestCsReqIdBySid','onTransformSelections','SnapshotService','confirm','entityInit$','undefined','[FetchingMissState]:\x20invalid\x20calling\x20to\x20`resend`.','PendingState','CLOSE_ROOM','_waitForHeartbeatResponse','_onMessage','ERROR_EXCEED_SIZE','unknown','_getUploadFileURL','_submitChangeset','objectType','userID','getInterceptPoints','LIVESHARE_REQUEST_HOST','[OfflineState]:\x20received\x20acknowledgement.','now','_telemetryService','getTime','_snapshotServerService','HEARTBEAT_TIMEOUT_KEY','loadDoc','_getUndoStack','_sendingTimer','href','duration','_clearScheduledTask','updatePermissionPoint','Subject','localeService','setCfgEnableObjInherit','_getCurrentRevision','_clearTimeoutTimer','cfgEnableObjInherit','_HTTPService','/collaborator','[FetchMissState]','body','ISnapshotServerService','_resendTimeout','74498AExSha','retryConnectingInterval','floor','entries','JSONX','_clearLocalCache','startTime','fetchThroughInterceptors','socketService','appendMutation','snapshot','_eventService','_listenToNetworkCondition','[UniverCollaborationClientPlugin]:\x20you\x20must\x20provide\x20a\x20socketService\x20implementation\x20in\x20config!','_state$','_event$','textEncoder','_state','subscribe','call','_retryConnectingTimer','utf8ToBytes','OTHER_CLIENT_EDITING','put','getMember','_collabSessionService','_socket$','_transformUndoredo','pending','SHOULD_CLOSE_CONN','_undoStacks','OTHER_CLIENTS_EDITING','baseRev','AwaitingState','state','RECV','state$','/universer-api/uniscript','session.join-failed','[CollaborationUndoRedoService]','onRemoteChangeset','forEach','CommentService','FetchingMissState','CombCmd','JOINING','stopTime','close$','_unlockTransition','replace','awaiting','CollaborationUIEventService','UNIVER_COLLABORATION_CLIENT_PLUGIN','_telemetryInfo','ICollaborationSocketService','[PendingState]:\x20invalid\x20calling\x20to\x20`resend`.','_shouldReportTelemetry','_sheetTransformSelectionsService','awaitingChangeset','_collaborationTimeoutTimer','/unit/','LEAVE','_throwTelemetryCollaborationNewChangeset','onTransformRemoteChangesetByIMECache','deepClone','_initMergeInterceptor','prototype','LIVESHARE_NEW_HOST','_clearRedo','JOIN_ROOM_FAILED','onRemoteAck','sort','HELLO','splice','message$','NOT_COLLAB','MemberService','sessionStatus$','init','resend','_scheduleCollaborationTimeoutTimer','toPrimitive','_imageSourceCache','Univer','/rev/','code','onSendChangeset','avatar','/fetchmissing?from=','[CollaborationState]:\x20apply\x20error!','_rescheduleHeartbeat','_onJoinRoomEvent','/-/object/list','ISocketService','/role','UniverNetworkPlugin','getCurrentUser','_singleActiveUnitService','BASE64','create','{fileID}','filter','LIVESHARE_TERMINATE','[CollaborationSession]:\x20should\x20not\x20send\x20message\x20when\x20the\x20session\x20is\x20offline!','textRanges','sequenceExecute','OFFLINE','roles','_memberService','_toggleOnline','getTypeOfUnitAdded$','SUBMIT_CHANGESET','_collaborationSessionService','AWAITING','collabWebSocketUrl','selections','_onRemoteChangeset','getDrawingImageAllowSize','socket\x20open.','getUnit','_onConnectionOpen','EmptyMutationInfo','Optional','UniverCollaborationPlugin','_commentService','_updateLocalCache','uniscriptRunEvent','_emitMembers','sendChangesetTimeout','_acknowledgeAwaiting','_executeRemoteChangeset','onTransformIME','fetch_missing','getOwnPropertyDescriptor','session.room-full','executeCommand','LocalUndoRedoService','action','getWorkbookSelections','change$','ONLINE','_startCollaboration','ErrorCode','UNISCRIPT_RUN','_sender','encrypt','shareReplay','liveShareOperation','string','_onRecvEvent','onMissingChangesets','ERROR_IMAGE','deserializeToCombResponse','_onFetchMissResult','_sessions','_entities','/universer-api/oidc/authpage','SUBMIT_CHANGESET_TIMEOUT','sessionStatus','url','IUndoRedoService','revision','getGlobalObject','_commentUpdate$','/object/','[FetchingMissState]:\x20received\x20stale\x20ack\x20revision:\x20','/object','_remoteChangesetQueue','6174984VKDAIk','resolveWithBasePath','HEARTBEAT_INTERVAL','_handleRemoteChangesets','parseProtocolChangeset','_handlerCallback','synced','copyFileMeta','RETRY_CONNECTING_MAX_COUNT','editing\x20status\x20changed\x20to','_toggleOffline','_awaitingChangeset','_transformSelections','unit','m2Prime','_getAPIPrefix','enableOfflineEditing','touchDependencies','_handler','saveSheetBlock','_getLoginPath','reconnect','UPDATE_PERMISSION_OBJ','loginUrlKey','PERMISSION_DENIED','onload','UPDATE_CURSOR','onTransformState','dispose$','_checkMissing','incrementRevOfUnit','FETCH_MISS','uploadFileServerUrl','isTransformChangesetsSuccess','dispose','/block/','_permissionService','COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY','session.room-permission-denied','fetchMiss','?size=','_initRequestHeader','SUCCUSS','asObservable','[CollaborationEntity]:\x20invalid\x20state\x20transition!\x20State\x20transferred\x20from\x20is\x20not\x20the\x20current\x20state.\x0aBefore:\x20','catch','patch','_localeService','?url=','IMentionIOService','POST','merge','_undoRedoService','objectID','FETCH_MISSING','UNIVER_SHEET','isArray','_replayCachedMutations','_socket','RevisionService','NEW_CHANGESETS','resourceIDs','defineProperty','_change$','ImageSourceType','_createSocket','Quantity','_userManagerService','_transformStack','205228bwdWrG','_applyRemoteChangeset','CHANGESET_SHOULD_RETRY','isInternalEditorID','_univerInstanceService','ReplaySubject','getUnitStatus$','_joinRoom','COMPRESS_MUTATION_SEND','PENDING','refreshPermission','_getSendChangesetTimeout','setShowComponents','objectActions','submit\x20changeset\x20error!','[SyncedState]:\x20invalid\x20calling\x20to\x20`resend`.','registerDependencies','CollaborationUIEventId','FileId','_resendTimer','onRemoteRetry','initWorkbookPermissionChange','append','name','getUnitType','status','JOIN','LIVESHARE_FETCH_OPERATIONS','pluginName','add','_sessionStatus$','_socketService','_acknowledgeAwaitingIfReady','/-/object/-/batch_allowed','members$','[ConflictState]:\x20invalid\x20calling\x20to\x20`resend`.','listCollaborators','stringify','CollaborationStatus','members','_entityInit$','headers','_timeoutTimer','CollaborationEvent','onRemoteRej','_createInitialState','updateMember','_initDependencies','_transformAndApplyRemoteChangeset','_localCacheService','concatMap','ICommandService','Workbook','getImageSourceCache','\x20to\x20','UNIVER_DOC','joinRsp','disposeWithMe','_substituteRedoStack','getLocalCacheKey','editingUnit','telemetry\x20info\x20is\x20not\x20initialized','CollaborativeUndoRedoService','leaveEvent','CollaborationSessionService','48ORxkQz','univer-pro.collaboration-client.single-active-unit-service','_logService','getCurrentSelections','createCollaborator','signUrlServerUrl','SOCKET_FAILED_RETRY','_snapshotService','CHANGESET_ACK','USERS_LEAVE','_isPermissionRej','_httpService','packageName','DEFAULT_COLLAB_WEB_SOCKET_URL','DEFAULT_WS_SESSION_TICKET_URL','Tools','focused$','then','updateCollaborator','0.22.1','allowed','_startTelemetryCollaborationNewChangeset','getImage','_sendHeartbeatTimer','HEARTBEAT','[CollaborationSessionService]:\x20socket\x20error','loadUnitOfRevision','range','_scheduleCompleteTimestamp','createSocket','_disableEditing','UniverInstanceType','location','_transformStateCache','onMissedChangesetFetched','SetSelectionsOperation','isTransformMutationsWithChangesetFailure','_isEchoedAwaitingChangeset','getCurrentRevOfUnit','getSheetBlock','awaiting_with_pending','takeUntil','collabSubmitChangesetUrl','reverse','version','SYNCED','_initCloseConn','data','_registerDependencies','_collaborationUIEventService','transformMutationsWithChangeset','&source=','_queuedRemoteChangesets','/universer-api/comb','onStateChange','IDLE','INetworkConditionService','UniverLicensePlugin','reduce','UUID','BehaviorSubject','_revisionService','/universer-api/file/{fileID}/sign-url','_tryReconnect','[CollaborationSocketService]:\x20failed\x20to\x20get\x20web\x20socket\x20factory!','_changesetReqId','SheetTransformSelectionsService','every','updateOfflineData','fetchMissingChangesets','ITelemetryService','routeKey','ImageUploadStatusType','_socketReady','_members','onStarting','\x0aAfter:\x20','_maxTotalRetryTimeout','658682LWadBU','_onCombEvent','_lockTransition','_onRemoteRetry','_members$','unsubscribe','cmd','NO_OTHER_CLIENTS_EDITING','_getSignURL','error','_compressMutationService','updateSnapshot','20mKZarO','SnapshotServerOverHTTPService','JOIN_ROOM_FULL','HEARTBEAT_TIMEOUT','Injector','SessionStatus','override','mapDocumentTypeToUniverInstanceType','/new_changes','[CollaborationSocketService]:\x20failed\x20to\x20create\x20socket!','_replaceFileID','next','[OfflineState]:\x20invalid\x20calling\x20to\x20`resend`.','Disposable','_getDownloadEndpointURL','_pendingMutations','CollaborationController','[OfflineState]:\x20received\x20changeset.','removeMember','_injector','waitForRoom$','getTypeOfUnitDisposed$','encodeURIComponent','socket\x20close','_instanceService','type','title','changesets','ConflictState','transformChangesets','CollaborationSocketService','_updateStatus','[FetchingMissState]:\x20not\x20expected\x20to\x20receive\x20ack\x20when\x20`this._awaitingChangeset`\x20is\x20null!','_onLocalMutation','pipe','ERROR_IMAGE_TYPE','onTransformRemoteChangesetByIMECache\x20callback\x20is\x20not\x20added\x20yet.','UniverCollaborationClientPlugin','loadOfflineData','SOCKET_FAILED','AWAITING_WITH_PENDING','liveShareNewHost','function','_onRemoteACK','csAckEvent','mutations','DocCollaborationEntity','Rectangle','subject','_onRemoteRejected','SheetCollaborationEntity','_incrementRevisionNumber','_createInitialStateImpl','11921260NwxqwK','SheetsSelectionsService','CommandType','_resendWithTimeout','COMMENT_UPDATE','IPermissionService','unitID','_exhaustRemoteChangesetQueue','toStringTag','IContextService','_clearRetryConnectingTimer','CONFLICT','USERS_ENTER','IUniverInstanceService','values','HEARTBEAT_INTERVAL_KEY','COMPRESS_MUTATION_APPLY','emitEvent','getAllMembers','_getAPIPrefixPath','ITransformService','univer-pro.collaboration-client.network-condition.service','session.room-cnt-exceeds','_configService','save\x20fail\x20reason\x20is\x20','delay','_removeRoom','getUnitId','ISingleActiveUnitService','_socketMessageSubscription','_status$','connection\x20error','max','unitId','MentionIoHttpService','/universer-api/user/session-ticket','DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','/resources','HTTPRequest','[PendingState]:\x20received\x20rejection.','CollaborationImageIoService','CollaborationSession','PERSON','\x0aCurrent:\x20','DRAWING_IMAGE_ALLOW_IMAGE_LIST','open$','objects','list','decorate','concatBytes','[AuthServerService]:\x20you\x20should\x20provide\x20authentication\x20info\x20on\x20Node.js.','workbook','serializeCombRequest','getConfig','_changesetSessionId','Plugin','collaboration_new_changeset','UserManagerService','[CollaborationEntity]','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','resolve','c1Prime','default','getValue','set','_onConnectionFailed','toDisposable','_networkConditionService','PERMISSION_REJ','actions','requireSession','_clearHeartbeatTimer','deleteCollaborator','startsWith','onTransformRemoteChangesetByStateCache','unit-cache-','_type','_roomCreated$','updatePermissionObjEvent','DEFAULT_FILE_NAME','DataLoaderService','min','[CollaborationSessionService]','getResourcesRequest','[CollaborationSession]','collaboration-client.local-cache-service','_onConflict','fetching\x20the\x20latest\x20document\x20from\x20the\x20server.','apply','online$'];_0x9671=function(){return _0x4de39d;};return _0x9671();}