@univerjs-pro/collaboration-client 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +28 -7
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ca-ES.js +1 -1
  5. package/lib/cjs/locale/en-US.js +1 -1
  6. package/lib/cjs/locale/es-ES.js +1 -1
  7. package/lib/cjs/locale/fa-IR.js +1 -1
  8. package/lib/cjs/locale/fr-FR.js +1 -1
  9. package/lib/cjs/locale/ja-JP.js +1 -1
  10. package/lib/cjs/locale/ko-KR.js +1 -1
  11. package/lib/cjs/locale/ru-RU.js +1 -1
  12. package/lib/cjs/locale/sk-SK.js +1 -1
  13. package/lib/cjs/locale/vi-VN.js +1 -1
  14. package/lib/cjs/locale/zh-CN.js +1 -1
  15. package/lib/cjs/locale/zh-TW.js +1 -1
  16. package/lib/es/facade.js +1 -1
  17. package/lib/es/index.js +1 -1
  18. package/lib/es/locale/ca-ES.js +1 -1
  19. package/lib/es/locale/en-US.js +1 -1
  20. package/lib/es/locale/es-ES.js +1 -1
  21. package/lib/es/locale/fa-IR.js +1 -1
  22. package/lib/es/locale/fr-FR.js +1 -1
  23. package/lib/es/locale/ja-JP.js +1 -1
  24. package/lib/es/locale/ko-KR.js +1 -1
  25. package/lib/es/locale/ru-RU.js +1 -1
  26. package/lib/es/locale/sk-SK.js +1 -1
  27. package/lib/es/locale/vi-VN.js +1 -1
  28. package/lib/es/locale/zh-CN.js +1 -1
  29. package/lib/es/locale/zh-TW.js +1 -1
  30. package/lib/facade.js +1 -1
  31. package/lib/index.js +1 -1
  32. package/lib/locale/ca-ES.js +1 -1
  33. package/lib/locale/en-US.js +1 -1
  34. package/lib/locale/es-ES.js +1 -1
  35. package/lib/locale/fa-IR.js +1 -1
  36. package/lib/locale/fr-FR.js +1 -1
  37. package/lib/locale/ja-JP.js +1 -1
  38. package/lib/locale/ko-KR.js +1 -1
  39. package/lib/locale/ru-RU.js +1 -1
  40. package/lib/locale/sk-SK.js +1 -1
  41. package/lib/locale/vi-VN.js +1 -1
  42. package/lib/locale/zh-CN.js +1 -1
  43. package/lib/locale/zh-TW.js +1 -1
  44. package/lib/types/controllers/collaboration/collaboration-state.d.ts +17 -12
  45. package/lib/types/services/image-remote/image-io.service.d.ts +0 -1
  46. package/lib/umd/facade.js +1 -1
  47. package/lib/umd/index.js +1 -1
  48. package/lib/umd/locale/ca-ES.js +1 -1
  49. package/lib/umd/locale/en-US.js +1 -1
  50. package/lib/umd/locale/es-ES.js +1 -1
  51. package/lib/umd/locale/fa-IR.js +1 -1
  52. package/lib/umd/locale/fr-FR.js +1 -1
  53. package/lib/umd/locale/ja-JP.js +1 -1
  54. package/lib/umd/locale/ko-KR.js +1 -1
  55. package/lib/umd/locale/ru-RU.js +1 -1
  56. package/lib/umd/locale/sk-SK.js +1 -1
  57. package/lib/umd/locale/vi-VN.js +1 -1
  58. package/lib/umd/locale/zh-CN.js +1 -1
  59. package/lib/umd/locale/zh-TW.js +1 -1
  60. package/package.json +20 -14
package/lib/cjs/index.js CHANGED
@@ -1 +1 @@
1
- const _0x54582d=_0x598e;(function(_0x5cb07d,_0x17865f){const _0x205cea=_0x598e,_0x4880e2=_0x5cb07d();while(!![]){try{const _0x24e8cc=-parseInt(_0x205cea(0x376))/0x1*(-parseInt(_0x205cea(0x1a8))/0x2)+-parseInt(_0x205cea(0x213))/0x3*(-parseInt(_0x205cea(0x295))/0x4)+-parseInt(_0x205cea(0x2bc))/0x5*(parseInt(_0x205cea(0x3e5))/0x6)+parseInt(_0x205cea(0x19b))/0x7*(-parseInt(_0x205cea(0x1e9))/0x8)+-parseInt(_0x205cea(0x29f))/0x9+-parseInt(_0x205cea(0x23b))/0xa+parseInt(_0x205cea(0x2fc))/0xb;if(_0x24e8cc===_0x17865f)break;else _0x4880e2['push'](_0x4880e2['shift']());}catch(_0xa8b755){_0x4880e2['push'](_0x4880e2['shift']());}}}(_0x1fa5,0x76997),Object[_0x54582d(0x2c9)](exports,Symbol[_0x54582d(0x1e6)],{'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='/universer-api/snapshot',SNAPSHOT_URL_KEY='SNAPSHOT_URL_KEY',DEFAULT_SEND_CHANGESET_TIMEOUT=0x7d0,DEFAULT_COLLAB_WEB_SOCKET_URL=_0x54582d(0x27c),DEFAULT_WS_SESSION_TICKET_URL='/universer-api/user/session-ticket',HEARTBEAT_INTERVAL_KEY=_0x54582d(0x20e),DEFAULT_HEARTBEAT_INTERVAL=0x7530,HEARTBEAT_TIMEOUT_KEY=_0x54582d(0x47b),DEFAULT_HEARTBEAT_TIMEOUT=0x4e20,DEFAULT_RETRY_CONNECTING_INTERVAL=0x4e20,RETRY_CONNECTING_MAX_COUNT_KEY=_0x54582d(0x1ba),LOCAL_CACHE_INTERVAL_KEY=_0x54582d(0x28c),LOCAL_CACHE_INTERVAL=0x3e8,DEFAULT_COLLAB_SUBMIT_CHANGESET_URL=_0x54582d(0x256),DEFAULT_LOGIN_URL='/universer-api/oidc/authpage',REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY=_0x54582d(0x229),DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT='/universer-api/uniscript',TELEMETRY_COLLABORATION_NEW_CHANGESET=_0x54582d(0x2fe);function summaryChangesetSize(_0x33f7ef){const _0x2f8fc2=_0x54582d;return JSON[_0x2f8fc2(0x276)](_0x33f7ef)[_0x2f8fc2(0x473)];}function _typeof(_0x1403b4){'@babel/helpers - typeof';const _0x44e3a3=_0x54582d;return _typeof=_0x44e3a3(0x470)==typeof Symbol&&'symbol'==typeof Symbol['iterator']?function(_0x4af1e6){return typeof _0x4af1e6;}:function(_0x15cb16){const _0x18f6b0=_0x44e3a3;return _0x15cb16&&_0x18f6b0(0x470)==typeof Symbol&&_0x15cb16['constructor']===Symbol&&_0x15cb16!==Symbol['prototype']?_0x18f6b0(0x31f):typeof _0x15cb16;},_typeof(_0x1403b4);}function toPrimitive(_0x40cec6,_0x4e6f8f){const _0x401b63=_0x54582d;if(_0x401b63(0x1d4)!=_typeof(_0x40cec6)||!_0x40cec6)return _0x40cec6;var _0x55245b=_0x40cec6[Symbol['toPrimitive']];if(void 0x0!==_0x55245b){var _0x2db3bd=_0x55245b[_0x401b63(0x46d)](_0x40cec6,_0x4e6f8f||_0x401b63(0x445));if(_0x401b63(0x1d4)!=_typeof(_0x2db3bd))return _0x2db3bd;throw new TypeError(_0x401b63(0x37e));}return(_0x401b63(0x293)===_0x4e6f8f?String:Number)(_0x40cec6);}function toPropertyKey(_0x2dd114){const _0x531859=_0x54582d;var _0x17c510=toPrimitive(_0x2dd114,_0x531859(0x293));return _0x531859(0x31f)==_typeof(_0x17c510)?_0x17c510:_0x17c510+'';}function _defineProperty(_0x3312b7,_0x146c96,_0x1222df){const _0x27b413=_0x54582d;return(_0x146c96=toPropertyKey(_0x146c96))in _0x3312b7?Object[_0x27b413(0x2c9)](_0x3312b7,_0x146c96,{'value':_0x1222df,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x3312b7[_0x146c96]=_0x1222df,_0x3312b7;}let CollaborationUIEventId=function(_0x44d568){const _0x42186a=_0x54582d;return _0x44d568[_0x42186a(0x2ac)]=_0x42186a(0x2ac),_0x44d568['PERMISSION_DENIED']=_0x42186a(0x19e),_0x44d568[_0x42186a(0x397)]=_0x42186a(0x397),_0x44d568[_0x42186a(0x317)]=_0x42186a(0x317),_0x44d568[_0x42186a(0x233)]=_0x42186a(0x233),_0x44d568['SOCKET_FAILED_RETRY']=_0x42186a(0x237),_0x44d568['SOCKET_FAILED']='SOCKET_FAILED',_0x44d568[_0x42186a(0x270)]=_0x42186a(0x270),_0x44d568;}({});var CollaborationUIEventService=class{constructor(){const _0x52f679=_0x54582d;_defineProperty(this,_0x52f679(0x3bf),new rxjs[(_0x52f679(0x263))]()),_defineProperty(this,_0x52f679(0x2f4),this[_0x52f679(0x3bf)]['asObservable']());}[_0x54582d(0x19d)](_0x5d1dd2){const _0x5129c3=_0x54582d;this[_0x5129c3(0x3bf)][_0x5129c3(0x22a)](_0x5d1dd2);}},CommentService=class{constructor(){const _0x9ab014=_0x54582d;_defineProperty(this,_0x9ab014(0x285),new rxjs['Subject']()),_defineProperty(this,_0x9ab014(0x351),this[_0x9ab014(0x285)]['asObservable']());}[_0x54582d(0x2a0)](_0xf31938){const _0x333ee3=_0x54582d;this[_0x333ee3(0x285)][_0x333ee3(0x22a)](_0xf31938);}};function __decorateParam(_0x545c09,_0x5e45b4){return function(_0x49b08b,_0x33cc18){_0x5e45b4(_0x49b08b,_0x33cc18,_0x545c09);};}function __decorate(_0xc3fffb,_0x5e23fb,_0x296f13,_0x570764){const _0x1e26a9=_0x54582d;var _0x5a4c0a=arguments[_0x1e26a9(0x473)],_0x11dc0e=_0x5a4c0a<0x3?_0x5e23fb:_0x570764===null?_0x570764=Object[_0x1e26a9(0x2d3)](_0x5e23fb,_0x296f13):_0x570764,_0x2f74ec;if(typeof Reflect==='object'&&typeof Reflect[_0x1e26a9(0x24b)]===_0x1e26a9(0x470))_0x11dc0e=Reflect[_0x1e26a9(0x24b)](_0xc3fffb,_0x5e23fb,_0x296f13,_0x570764);else{for(var _0x51862c=_0xc3fffb[_0x1e26a9(0x473)]-0x1;_0x51862c>=0x0;_0x51862c--)if(_0x2f74ec=_0xc3fffb[_0x51862c])_0x11dc0e=(_0x5a4c0a<0x3?_0x2f74ec(_0x11dc0e):_0x5a4c0a>0x3?_0x2f74ec(_0x5e23fb,_0x296f13,_0x11dc0e):_0x2f74ec(_0x5e23fb,_0x296f13))||_0x11dc0e;}return _0x5a4c0a>0x3&&_0x11dc0e&&Object[_0x1e26a9(0x2c9)](_0x5e23fb,_0x296f13,_0x11dc0e),_0x11dc0e;}let MemberService=class MemberService extends _univerjs_core[_0x54582d(0x412)]{constructor(_0x1cfd54,_0x5bb2b5){const _0x1d4b22=_0x54582d;super(),this[_0x1d4b22(0x46c)]=_0x1cfd54,this['_userManagerService']=_0x5bb2b5,_defineProperty(this,_0x1d4b22(0x3b8),new Map()),_defineProperty(this,_0x1d4b22(0x238),new rxjs[(_0x1d4b22(0x263))]()),this[_0x1d4b22(0x47f)]((0x0,rxjs['merge'])(this['_univerInstanceService']['getTypeOfUnitDisposed$'](_univerjs_core['UniverInstanceType'][_0x1d4b22(0x1f9)])[_0x1d4b22(0x197)]((0x0,rxjs_operators['map'])(_0x492fcc=>_0x492fcc[_0x1d4b22(0x27f)]())),this['_univerInstanceService'][_0x1d4b22(0x1ed)](_univerjs_core[_0x1d4b22(0x2fd)][_0x1d4b22(0x2e6)])[_0x1d4b22(0x197)]((0x0,rxjs_operators[_0x1d4b22(0x2b9)])(_0x534858=>_0x534858[_0x1d4b22(0x27f)]())))[_0x1d4b22(0x1c3)](_0x5e85fb=>this['_removeRoom'](_0x5e85fb)));}[_0x54582d(0x3d5)](_0x479c39){const _0xc0b45d=_0x54582d;if(this[_0xc0b45d(0x3b8)]['has'](_0x479c39))return(0x0,rxjs['of'])(this[_0xc0b45d(0x3b8)][_0xc0b45d(0x2c8)](_0x479c39));return this[_0xc0b45d(0x238)][_0xc0b45d(0x197)]((0x0,rxjs_operators[_0xc0b45d(0x2b9)])(_0x1de0e7=>{const _0x5675c6=_0xc0b45d;if(_0x1de0e7===_0x479c39)return this[_0x5675c6(0x3b8)][_0x5675c6(0x2c8)](_0x1de0e7);}));}[_0x54582d(0x3e7)](_0x4a4bf4){const _0xa511f7=_0x54582d;this['_userManagerService'][_0xa511f7(0x3e7)](_0x4a4bf4);}['getCurrentUser'](){return this['_userManagerService']['getCurrentUser']();}[_0x54582d(0x2bd)](_0x222488,_0x4b2085){const _0x2dcf35=_0x54582d;let _0x23f6b3=this['_roomMembers'][_0x2dcf35(0x2c8)](_0x222488);!_0x23f6b3&&(_0x23f6b3=new RoomMember(),this[_0x2dcf35(0x3b8)]['set'](_0x222488,_0x23f6b3),this[_0x2dcf35(0x238)][_0x2dcf35(0x22a)](_0x222488)),_0x23f6b3[_0x2dcf35(0x2bd)](_0x4b2085);}[_0x54582d(0x3a5)](_0x24376c,_0x6f08cc){const _0x40ddb9=_0x54582d,_0x188749=this[_0x40ddb9(0x3b8)][_0x40ddb9(0x2c8)](_0x24376c);if(_0x188749)_0x188749[_0x40ddb9(0x3a5)](_0x6f08cc);}['getRoom'](_0x3db307){const _0xeaa05e=_0x54582d;return this[_0xeaa05e(0x3b8)]['get'](_0x3db307);}['getMember'](_0x40606a,_0x411b35){const _0x2f4526=_0x54582d,_0x27b158=this[_0x2f4526(0x3b8)]['get'](_0x40606a);if(_0x27b158)return _0x27b158[_0x2f4526(0x449)](_0x411b35);}[_0x54582d(0x338)](_0x3d4a20){const _0x2d1a1a=_0x54582d,_0x36cf2e=this[_0x2d1a1a(0x3b8)][_0x2d1a1a(0x2c8)](_0x3d4a20);_0x36cf2e&&(_0x36cf2e['dispose'](),this[_0x2d1a1a(0x3b8)][_0x2d1a1a(0x43a)](_0x3d4a20));}[_0x54582d(0x27d)](){const _0x5444cb=_0x54582d;this['_roomMembers']['forEach'](_0x3f8fcf=>_0x3f8fcf[_0x5444cb(0x27d)]()),this[_0x5444cb(0x3b8)][_0x5444cb(0x2c0)](),this[_0x5444cb(0x238)][_0x5444cb(0x3e4)]();}};MemberService=__decorate([__decorateParam(0x0,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_core['UserManagerService']))],MemberService);var RoomMember=class extends _univerjs_core[_0x54582d(0x412)]{constructor(..._0x581af6){const _0x4920e0=_0x54582d;super(..._0x581af6),_defineProperty(this,_0x4920e0(0x3cf),new Map()),_defineProperty(this,'_members$',new rxjs['BehaviorSubject'](this[_0x4920e0(0x3cf)])),_defineProperty(this,_0x4920e0(0x2fa),this[_0x4920e0(0x228)][_0x4920e0(0x2a1)]());}['dispose'](){const _0x2a036a=_0x54582d;this[_0x2a036a(0x3cf)][_0x2a036a(0x2c0)](),this[_0x2a036a(0x228)]['complete']();}['updateMember'](_0x416033){const _0x5072c8=_0x54582d;this[_0x5072c8(0x3cf)][_0x5072c8(0x298)](_0x416033[_0x5072c8(0x46b)],_0x416033),this['_emitMembers']();}[_0x54582d(0x3a5)](_0x4cae26){const _0x5af025=_0x54582d;this[_0x5af025(0x3cf)][_0x5af025(0x43a)](_0x4cae26),this[_0x5af025(0x222)]();}[_0x54582d(0x449)](_0x3f8c5b){const _0x4878de=_0x54582d;return this[_0x4878de(0x3cf)][_0x4878de(0x2c8)](_0x3f8c5b);}[_0x54582d(0x415)](){const _0x363143=_0x54582d;return Array[_0x363143(0x262)](this[_0x363143(0x3cf)][_0x363143(0x3f2)]());}[_0x54582d(0x222)](){const _0x124d35=_0x54582d;this['_members$'][_0x124d35(0x22a)](this[_0x124d35(0x3cf)]);}};let SessionStatus=function(_0x47312e){const _0x123b2d=_0x54582d;return _0x47312e[_0x47312e['IDLE']=0x0]=_0x123b2d(0x1a2),_0x47312e[_0x47312e[_0x123b2d(0x3cd)]=0x1]=_0x123b2d(0x3cd),_0x47312e[_0x47312e[_0x123b2d(0x391)]=0x2]=_0x123b2d(0x391),_0x47312e[_0x47312e[_0x123b2d(0x2bb)]=0x3]='ONLINE',_0x47312e;}({});const FailedReason={[_univerjs_protocol[_0x54582d(0x411)][_0x54582d(0x1e0)]]:_0x54582d(0x396),[_univerjs_protocol[_0x54582d(0x411)][_0x54582d(0x3fb)]]:'session.room-full',[_univerjs_protocol[_0x54582d(0x411)][_0x54582d(0x2d0)]]:_0x54582d(0x272),[_univerjs_protocol[_0x54582d(0x411)]['JOIN_ROOM_PERMISSION_DENIED']]:_0x54582d(0x394),[_univerjs_protocol[_0x54582d(0x411)][_0x54582d(0x3f6)]]:_0x54582d(0x2e5)};let CollaborationSession=class CollaborationSession extends _univerjs_core[_0x54582d(0x21c)]{get[_0x54582d(0x1b8)](){const _0x3e3131=_0x54582d;return this[_0x3e3131(0x3ce)]['getValue']();}constructor(_0x4274e4,_0x498440,_0x23b78b,_0x154c12,_0xce7422,_0x22e4bc,_0x438d2c,_0x2e0b2a){const _0x38eb47=_0x54582d;super(),this[_0x38eb47(0x434)]=_0x4274e4,this[_0x38eb47(0x469)]=_0x23b78b,this[_0x38eb47(0x345)]=_0x154c12,this[_0x38eb47(0x24a)]=_0xce7422,this['_commentService']=_0x22e4bc,this[_0x38eb47(0x350)]=_0x438d2c,this[_0x38eb47(0x335)]=_0x2e0b2a,_defineProperty(this,_0x38eb47(0x3ce),new rxjs[(_0x38eb47(0x3c7))](SessionStatus['IDLE'])),_defineProperty(this,'sessionStatus$',this[_0x38eb47(0x3ce)][_0x38eb47(0x2a1)]()),_defineProperty(this,_0x38eb47(0x3bf),new rxjs['Subject']()),_defineProperty(this,_0x38eb47(0x2f4),this[_0x38eb47(0x3bf)]['asObservable']()),_defineProperty(this,_0x38eb47(0x21f),void 0x0),_defineProperty(this,_0x38eb47(0x30a),void 0x0),_defineProperty(this,_0x38eb47(0x365),void 0x0),_defineProperty(this,_0x38eb47(0x3bc),![]),_defineProperty(this,_0x38eb47(0x458),null),this[_0x38eb47(0x3bc)]=!!this[_0x38eb47(0x335)],_0x498440[_0x38eb47(0x197)]((0x0,rxjs[_0x38eb47(0x324)])(this[_0x38eb47(0x3d9)]))[_0x38eb47(0x1c3)](_0x5d7fcd=>{const _0xe14fdd=_0x38eb47;if(typeof _0x5d7fcd===_0xe14fdd(0x2bf))return;this[_0xe14fdd(0x21f)]=_0x5d7fcd;if(_0x5d7fcd)this[_0xe14fdd(0x40e)](_0x5d7fcd),this[_0xe14fdd(0x30a)]=_0x5d7fcd[_0xe14fdd(0x432)][_0xe14fdd(0x1c3)](_0x2fc8d2=>{const _0x227265=_0xe14fdd;if(_0x2fc8d2[_0x227265(0x246)]!==this[_0x227265(0x434)])return;this[_0x227265(0x39b)](_0x2fc8d2);});else{var _0x3e4306;this[_0xe14fdd(0x3e8)](),this['_sessionStatus$'][_0xe14fdd(0x22a)](SessionStatus[_0xe14fdd(0x391)]),(_0x3e4306=this[_0xe14fdd(0x30a)])===null||_0x3e4306===void 0x0||_0x3e4306['unsubscribe'](),this['_socketMessageSubscription']=null;}});}[_0x54582d(0x1ad)](){const _0x1e88fa=_0x54582d;var _0x232355,_0x4bd826;return(_0x232355=(_0x4bd826=this[_0x1e88fa(0x21f)])===null||_0x4bd826===void 0x0?void 0x0:_0x4bd826[_0x1e88fa(0x46b)])!==null&&_0x232355!==void 0x0?_0x232355:null;}[_0x54582d(0x27d)](){const _0x3eb33a=_0x54582d;super[_0x3eb33a(0x27d)](),this[_0x3eb33a(0x37b)](),this['dispose$'][_0x3eb33a(0x22a)](),this[_0x3eb33a(0x3d9)][_0x3eb33a(0x3e4)]();}[_0x54582d(0x37b)](){const _0xb78bc=_0x54582d;var _0x4a857f,_0x4ce7fd;this[_0xb78bc(0x3e8)](),(_0x4a857f=this[_0xb78bc(0x21f)])===null||_0x4a857f===void 0x0||_0x4a857f[_0xb78bc(0x476)]({'cmd':_univerjs_protocol['CombCmd'][_0xb78bc(0x31b)],'data':{'roomID':this['_unitID']}}),(_0x4ce7fd=this[_0xb78bc(0x21f)])===null||_0x4ce7fd===void 0x0||_0x4ce7fd['close'](),this[_0xb78bc(0x3bf)][_0xb78bc(0x3e4)](),this[_0xb78bc(0x3ce)][_0xb78bc(0x3e4)]();}['_onCombEvent'](_0x2e9ea4){const _0x2a1046=_0x54582d;if(_0x2e9ea4[_0x2a1046(0x435)]===_univerjs_protocol[_0x2a1046(0x36f)][_0x2a1046(0x303)])this[_0x2a1046(0x30f)](_0x2e9ea4);else{if(_0x2e9ea4[_0x2a1046(0x435)]===_univerjs_protocol[_0x2a1046(0x36f)][_0x2a1046(0x464)])this[_0x2a1046(0x3c9)](_0x2e9ea4);}}[_0x54582d(0x40e)](_0x130142){const _0x51f228=_0x54582d;this['_sessionStatus$'][_0x51f228(0x22a)](SessionStatus['JOINING']),_0x130142['send']({'cmd':_univerjs_protocol[_0x51f228(0x36f)][_0x51f228(0x303)],'routeKey':this[_0x51f228(0x434)],'routeType':'','data':{'rooms':[{'roomID':this[_0x51f228(0x434)]}]}});}[_0x54582d(0x30f)](_0x10e60a){const _0x4c4351=_0x54582d;var _0x3c729a;if(_0x10e60a[_0x4c4351(0x1bf)]in FailedReason){this[_0x4c4351(0x350)][_0x4c4351(0x19d)]({'id':CollaborationUIEventId[_0x4c4351(0x233)],'data':FailedReason[_0x10e60a['code']]}),this['_sessionStatus$'][_0x4c4351(0x22a)](SessionStatus['OFFLINE']);return;}this['_sessionStatus$']['next'](SessionStatus[_0x4c4351(0x2bb)]);const _0x439064=(_0x3c729a=_0x10e60a['data'][_0x4c4351(0x20d)][this[_0x4c4351(0x434)]])===null||_0x3c729a===void 0x0?void 0x0:_0x3c729a[_0x4c4351(0x3ea)];if(_0x439064)_0x439064[_0x4c4351(0x333)](_0x292dd9=>this[_0x4c4351(0x24a)]['updateMember'](this[_0x4c4351(0x434)],_0x292dd9));}[_0x54582d(0x3c9)](_0x141e4a){const _0x616b3b=_0x54582d;try{const _0x4cda1d=_0x141e4a[_0x616b3b(0x341)];switch(_0x4cda1d[_0x616b3b(0x206)]){case _univerjs_pro_collaboration['CollaborationEvent'][_0x616b3b(0x3ac)]:this['_onUserJoin'](_0x4cda1d),this[_0x616b3b(0x3bf)][_0x616b3b(0x22a)](_0x4cda1d);break;case _univerjs_pro_collaboration[_0x616b3b(0x439)][_0x616b3b(0x25e)]:this['_onUserLeave'](_0x4cda1d),this[_0x616b3b(0x3bf)]['next'](_0x4cda1d);break;case _univerjs_pro_collaboration[_0x616b3b(0x439)][_0x616b3b(0x408)]:case _univerjs_pro_collaboration['CollaborationEvent'][_0x616b3b(0x2e3)]:this[_0x616b3b(0x440)](),this[_0x616b3b(0x337)](),this['_event$'][_0x616b3b(0x22a)](_0x4cda1d);break;case _univerjs_pro_collaboration['CollaborationEvent']['MSG_FOR_ERROR']:this['_logService'][_0x616b3b(0x3e0)](_0x616b3b(0x3c6)+JSON[_0x616b3b(0x276)](_0x4cda1d)),this['_event$'][_0x616b3b(0x22a)](_0x4cda1d);break;case _univerjs_pro_collaboration[_0x616b3b(0x439)]['COMMENT_UPDATE']:this[_0x616b3b(0x1f3)]['onCommentUpdate'](_0x4cda1d[_0x616b3b(0x341)]),this[_0x616b3b(0x3bf)][_0x616b3b(0x22a)](_0x4cda1d);break;default:this['_event$'][_0x616b3b(0x22a)](_0x4cda1d);}}catch(_0xfd3d79){this[_0x616b3b(0x469)][_0x616b3b(0x3e0)](_0xfd3d79,_0x141e4a);}}[_0x54582d(0x390)](_0x275636){this['_memberService']['updateMember'](this['_unitID'],_0x275636['data']);}[_0x54582d(0x22b)](_0x22d055){const _0x2d885b=_0x54582d;this[_0x2d885b(0x24a)][_0x2d885b(0x3a5)](this[_0x2d885b(0x434)],_0x22d055[_0x2d885b(0x341)][_0x2d885b(0x46b)]);}async[_0x54582d(0x476)](_0x561ed5,_0x58945d){const _0x1cd318=_0x54582d;if(this[_0x1cd318(0x1b8)]!==SessionStatus[_0x1cd318(0x2bb)]||!this['_socket'])throw new Error(_0x1cd318(0x250));try{_0x561ed5[_0x1cd318(0x206)]===_univerjs_pro_collaboration[_0x1cd318(0x439)][_0x1cd318(0x452)]&&(this['_scheduleCollaborationTimeoutTimer'](),this['_startTelemetryCollaborationNewChangeset'](_0x561ed5)),this['_socket'][_0x1cd318(0x476)]({'cmd':_univerjs_protocol['CombCmd'][_0x1cd318(0x3c8)],'routeKey':_0x58945d,'routeType':'','data':_0x561ed5});}catch(_0x474aa5){this[_0x1cd318(0x469)]['error'](_0x474aa5);}}[_0x54582d(0x427)](){const _0x25e46e=_0x54582d;var _0x3fe913;this['_collaborationTimeoutTimer']=setTimeout(()=>{const _0x219309=_0x598e;this[_0x219309(0x365)]=null,this[_0x219309(0x350)][_0x219309(0x19d)]({'id':CollaborationUIEventId[_0x219309(0x270)]});},(_0x3fe913=this['_configService'][_0x25e46e(0x3de)](_0x25e46e(0x47b)))!==null&&_0x3fe913!==void 0x0?_0x3fe913:DEFAULT_HEARTBEAT_TIMEOUT);}['_clearCollaborationTimeoutTimer'](){const _0x59a229=_0x54582d;this['_collaborationTimeoutTimer']&&(clearTimeout(this[_0x59a229(0x365)]),this['_collaborationTimeoutTimer']=null);}[_0x54582d(0x331)](_0x2dbc35){const _0x1b85c7=_0x54582d;if(!this['_shouldReportTelemetry'])return;const {data:_0x111084}=_0x2dbc35,{unitID:_0x3a4811,changeset:_0x7e485}=_0x111084,{mutations:_0x2adbb7,type:_0x5549e4}=_0x7e485;this['_telemetryInfo']={'unitId':_0x3a4811,'type':_0x5549e4,'startTime':performance[_0x1b85c7(0x37d)](),'stopTime':0x0,'duration':0x0,'size':summaryChangesetSize(_0x2adbb7)};}['_stopTelemetryCollaborationNewChangeset'](){const _0x72e6a=_0x54582d;if(!this[_0x72e6a(0x3bc)])return;if(!this[_0x72e6a(0x458)]){this[_0x72e6a(0x469)][_0x72e6a(0x3e0)](_0x72e6a(0x2d4),_0x72e6a(0x35b));return;}this[_0x72e6a(0x458)][_0x72e6a(0x288)]=performance[_0x72e6a(0x37d)](),this[_0x72e6a(0x458)][_0x72e6a(0x3ee)]=this['_telemetryInfo'][_0x72e6a(0x288)]-this[_0x72e6a(0x458)][_0x72e6a(0x3f0)],this[_0x72e6a(0x335)][_0x72e6a(0x410)](TELEMETRY_COLLABORATION_NEW_CHANGESET,this[_0x72e6a(0x458)]),this[_0x72e6a(0x458)]=null;}[_0x54582d(0x3e8)](){this['_telemetryInfo']=null;}};CollaborationSession=__decorate([__decorateParam(0x2,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0x3,_univerjs_core[_0x54582d(0x29e)]),__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(MemberService)),__decorateParam(0x5,(0x0,_univerjs_core[_0x54582d(0x205)])(CommentService)),__decorateParam(0x6,(0x0,_univerjs_core[_0x54582d(0x205)])(CollaborationUIEventService)),__decorateParam(0x7,(0x0,_univerjs_core['Optional'])(_univerjs_telemetry[_0x54582d(0x34a)]))],CollaborationSession);const ILocalCacheService=(0x0,_univerjs_core[_0x54582d(0x1e1)])(_0x54582d(0x30e));function getLocalCacheKey(_0x49ebd8){const _0x5e8f5d=_0x54582d;return _0x5e8f5d(0x3e1)+_0x49ebd8;}function extractTargetFromFirstChangeset(_0x3ef1ae){const _0x254605=_0x54582d,{unitID:_0x11b3cd,mutations:_0x15795e}=_0x3ef1ae;return{'unitId':_0x11b3cd,'subUnitId':_0x15795e[_0x254605(0x473)]>0x0?_0x15795e[0x0][_0x254605(0x1c6)][_0x254605(0x1aa)]:null};}let SheetTransformSelectionsService=class SheetTransformSelectionsService{constructor(_0x595bbe,_0x40e88b,_0x145d79){const _0x716b1a=_0x54582d;this[_0x716b1a(0x42a)]=_0x595bbe,this['_transformService']=_0x40e88b,this[_0x716b1a(0x1c2)]=_0x145d79;}['transformSelections'](_0x51921f){const _0x9f9086=_0x54582d;var _0x122bc8,_0x2e71b4;const _0x49b5b2=this[_0x9f9086(0x42a)][_0x9f9086(0x2c8)](_univerjs_sheets[_0x9f9086(0x27e)]),{unitId:_0x3253e7,subUnitId:_0xb208e4}=extractTargetFromFirstChangeset(_0x51921f),_0x623daf=_0x49b5b2===null||_0x49b5b2===void 0x0?void 0x0:_0x49b5b2['getWorkbookSelections'](_0x3253e7)[_0x9f9086(0x1cd)](),_0x28e5ac=(_0x122bc8=this[_0x9f9086(0x1c2)]['getUnit'](_0x3253e7))===null||_0x122bc8===void 0x0||(_0x122bc8=_0x122bc8[_0x9f9086(0x3aa)]())===null||_0x122bc8===void 0x0?void 0x0:_0x122bc8[_0x9f9086(0x35f)]();if(_0x623daf['length']===0x0||!_0x3253e7||!_0xb208e4)return;const _0x35870e=[{'id':_univerjs_sheets[_0x9f9086(0x336)]['id'],'params':{'unitId':_0x3253e7,'subUnitId':_0x28e5ac,'selections':_univerjs_core[_0x9f9086(0x2b1)][_0x9f9086(0x346)](_0x623daf)}}],_0x2934b0=this[_0x9f9086(0x448)][_0x9f9086(0x24e)](_0x51921f,_0x35870e);if(!(0x0,_univerjs_pro_collaboration[_0x9f9086(0x219)])(_0x2934b0))throw _0x2934b0[_0x9f9086(0x3e0)];const _0x170e20=(_0x2e71b4=_0x2934b0[_0x9f9086(0x379)][0x0])===null||_0x2e71b4===void 0x0||(_0x2e71b4=_0x2e71b4[_0x9f9086(0x1c6)])===null||_0x2e71b4===void 0x0?void 0x0:_0x2e71b4[_0x9f9086(0x3f5)];if(Array[_0x9f9086(0x209)](_0x170e20)&&_0x170e20[_0x9f9086(0x473)]){if(_0x170e20['length']===_0x35870e[0x0][_0x9f9086(0x1c6)][_0x9f9086(0x3f5)][_0x9f9086(0x473)]&&_0x170e20['every']((_0x132a8e,_0x2b1e04)=>_univerjs_core[_0x9f9086(0x2cc)][_0x9f9086(0x255)](_0x132a8e[_0x9f9086(0x22f)],_0x35870e[0x0][_0x9f9086(0x1c6)][_0x9f9086(0x3f5)][_0x2b1e04][_0x9f9086(0x22f)])))return;this['_injector'][_0x9f9086(0x2c8)](_univerjs_core[_0x9f9086(0x1a6)])[_0x9f9086(0x224)](_univerjs_sheets[_0x9f9086(0x336)]['id'],{'unitId':_0x3253e7,'subUnitId':_0x28e5ac,'selections':_0x170e20});}}};SheetTransformSelectionsService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x1,_univerjs_pro_collaboration[_0x54582d(0x1af)]),__decorateParam(0x2,_univerjs_core[_0x54582d(0x3f4)])],SheetTransformSelectionsService);const ISingleActiveUnitService=(0x0,_univerjs_core[_0x54582d(0x1e1)])('univer-pro.collaboration-client.single-active-unit-service');let UnitStatus=function(_0x40abcf){const _0x3a2b75=_0x54582d;return _0x40abcf[_0x40abcf[_0x3a2b75(0x455)]=0x0]='NO_OTHER_CLIENTS_EDITING',_0x40abcf[_0x40abcf[_0x3a2b75(0x22d)]=0x1]=_0x3a2b75(0x22d),_0x40abcf;}({});const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY=_0x54582d(0x1e3),configSymbol=Symbol(COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};function isSplitChunkMutation(_0x1279f1){const _0x5f5910=_0x54582d;var _0x296453;return!!((_0x296453=_0x1279f1[_0x5f5910(0x1c6)])===null||_0x296453===void 0x0?void 0x0:_0x296453['__splitChunk__']);}const SINGLE_CHANGESET_MUTATIONS=new Set([_univerjs_sheets[_0x54582d(0x26a)]['id']]);function assembleSheetChangeset(_0xe1c8f8,_0x4169ca,_0x508f3b,_0x2ca448,_0x377d29){const _0x32c42a=_0x54582d;var _0x33c2af,_0x9cd28,_0x2f97e2,_0xf28d6f;const _0x46a666=[];for(const _0x2dc860 of _0xe1c8f8){if(SINGLE_CHANGESET_MUTATIONS['has'](_0x2dc860['id'])){if(_0x46a666[_0x32c42a(0x473)]>0x0)break;_0x46a666[_0x32c42a(0x35d)](_0x2dc860);break;}if(isSplitChunkMutation(_0x2dc860)){if(_0x46a666[_0x32c42a(0x473)]>0x0)break;_0x46a666[_0x32c42a(0x35d)](_0x2dc860);break;}_0x46a666['push'](_0x2dc860);}const _0x846c0b=(_0x33c2af=(_0x9cd28=_0x377d29[_0x32c42a(0x38a)]())===null||_0x9cd28===void 0x0?void 0x0:_0x9cd28[_0x32c42a(0x202)])!==null&&_0x33c2af!==void 0x0?_0x33c2af:'unknown',_0xf6e616=(_0x2f97e2=(_0xf28d6f=_0x377d29[_0x32c42a(0x38a)]())===null||_0xf28d6f===void 0x0?void 0x0:_0xf28d6f['memberID'])!==null&&_0x2f97e2!==void 0x0?_0x2f97e2:'unknown';return{'changeset':{'unitID':_0x4169ca,'type':(0x0,_univerjs_pro_collaboration[_0x32c42a(0x426)])(_0x508f3b['getUnitType'](_0x4169ca)),'baseRev':_0x2ca448['getCurrentRevOfUnit'](_0x4169ca),'revision':0x0,'userID':_0x846c0b,'memberID':_0xf6e616,'mutations':_0x46a666},'pendingMutations':_0xe1c8f8[_0x32c42a(0x377)](_0x46a666[_0x32c42a(0x473)])};}function assembleDocChangeset(_0x5529d3,_0x311e12,_0x83b166,_0x3a1ddc,_0xc48a75){const _0x1d7ffe=_0x54582d;var _0x42eab2,_0x306960,_0x141ad6,_0x1d9684;const _0x55d643=[_0x5529d3[_0x1d7ffe(0x322)]((_0x5d153c,_0x1d680c)=>{const _0x2ac2d0=_0x1d7ffe;var _0x5b2dc5;const {id:_0x3c48ab}=_0x5d153c,{id:_0x3cea,type:_0x1eaeac}=_0x1d680c,_0x7d08c2=(_0x5b2dc5=_0x5d153c[_0x2ac2d0(0x1c6)])!==null&&_0x5b2dc5!==void 0x0?_0x5b2dc5:{'actions':null},_0xc4ec94=_0x1d680c[_0x2ac2d0(0x1c6)];if(_0x3c48ab&&_0x3c48ab!==_0x3cea)throw new Error(_0x2ac2d0(0x1d8)+_0x3c48ab+_0x2ac2d0(0x327)+_0x3cea+'.');return{..._0x5d153c,'id':_0x3cea,'type':_0x1eaeac,'params':{'unitId':_0xc4ec94['unitId'],'textRanges':_0xc4ec94[_0x2ac2d0(0x1c8)],'actions':_univerjs_core[_0x2ac2d0(0x19a)][_0x2ac2d0(0x45d)](_0x7d08c2[_0x2ac2d0(0x1b3)],_0xc4ec94[_0x2ac2d0(0x1b3)])}};},{})],_0x2ae809=(_0x42eab2=(_0x306960=_0xc48a75[_0x1d7ffe(0x38a)]())===null||_0x306960===void 0x0?void 0x0:_0x306960[_0x1d7ffe(0x202)])!==null&&_0x42eab2!==void 0x0?_0x42eab2:_0x1d7ffe(0x21b),_0x5e277a=(_0x141ad6=(_0x1d9684=_0xc48a75[_0x1d7ffe(0x38a)]())===null||_0x1d9684===void 0x0?void 0x0:_0x1d9684[_0x1d7ffe(0x46b)])!==null&&_0x141ad6!==void 0x0?_0x141ad6:_0x1d7ffe(0x21b);return{'changeset':{'unitID':_0x311e12,'type':(0x0,_univerjs_pro_collaboration[_0x1d7ffe(0x426)])(_0x83b166[_0x1d7ffe(0x398)](_0x311e12)),'baseRev':_0x3a1ddc[_0x1d7ffe(0x340)](_0x311e12),'revision':0x0,'userID':_0x2ae809,'memberID':_0x5e277a,'mutations':_0x55d643},'pendingMutations':[]};}function createTimerObservable$(_0x3fd86c,_0x2618d2){const _0x2e9ceb=_0x54582d,_0x2620bf=new rxjs[(_0x2e9ceb(0x199))](0x1);return setTimeout(()=>_0x2620bf[_0x2e9ceb(0x22a)](_0x2618d2),_0x3fd86c),_0x2620bf[_0x2e9ceb(0x2a1)]()[_0x2e9ceb(0x197)]((0x0,rxjs[_0x2e9ceb(0x1db)])(0x1));}var _PendingState,_AwaitingState,_AwaitingWithPendingState;let CollaborationStatus=function(_0x1862c4){const _0xc3768d=_0x54582d;return _0x1862c4[_0xc3768d(0x216)]=_0xc3768d(0x381),_0x1862c4[_0xc3768d(0x291)]=_0xc3768d(0x1ce),_0x1862c4['PENDING']='pending',_0x1862c4[_0xc3768d(0x3bd)]=_0xc3768d(0x2d1),_0x1862c4[_0xc3768d(0x1a3)]=_0xc3768d(0x3a4),_0x1862c4[_0xc3768d(0x220)]=_0xc3768d(0x3ba),_0x1862c4[_0xc3768d(0x397)]='conflict',_0x1862c4[_0xc3768d(0x391)]=_0xc3768d(0x357),_0x1862c4;}({});const MAX_RETRY_TIMEOUT=0x4e20,MAX_RETRY_TOTAL_TIMEOUT=0x2bf20;var CollaborationState=class{constructor(_0x239a31,_0x5d8925,_0x1e0a40,_0x47fddb,_0x432193,_0x22b93b,_0x5c7054,_0xdb202a,_0x9a37ae){const _0x14eb60=_0x54582d;this[_0x14eb60(0x481)]=_0x239a31,this['type']=_0x5d8925,this[_0x14eb60(0x2de)]=_0x432193,this[_0x14eb60(0x1b1)]=_0x22b93b,this[_0x14eb60(0x223)]=_0x5c7054,this[_0x14eb60(0x36a)]=_0xdb202a,this[_0x14eb60(0x310)]=_0x9a37ae,_defineProperty(this,_0x14eb60(0x42b),null),_defineProperty(this,_0x14eb60(0x1c4),[]),this[_0x14eb60(0x42b)]=_0x1e0a40,this[_0x14eb60(0x1c4)]=_0x47fddb;}[_0x54582d(0x461)](_0x19b2d9){const _0x237843=_0x54582d,_0x4e0624=this['_revisionService'][_0x237843(0x340)](this[_0x237843(0x481)]);if(_0x19b2d9['revision']>_0x4e0624+0x1)return this[_0x237843(0x2de)][_0x237843(0x312)]({'from':_0x4e0624,'to':_0x19b2d9[_0x237843(0x442)]-0x1}),!![];return![];}['_transformUndoredo'](_0x5cebc7){const _0xdf9214=_0x54582d;this[_0xdf9214(0x223)][_0xdf9214(0x3a6)](this[_0xdf9214(0x481)],_0x5cebc7);}[_0x54582d(0x1b4)](_0x3fd926){const _0xd35d09=_0x54582d;var _0x455d72,_0x2c054b;(_0x455d72=(_0x2c054b=this[_0xd35d09(0x2de)])['onTransformSelections'])===null||_0x455d72===void 0x0||_0x455d72[_0xd35d09(0x46d)](_0x2c054b,_0x3fd926);}['_transformIMECache'](_0x2b81e3){const _0x3086ff=_0x54582d;var _0x1281f5,_0x53dbaf;return(_0x1281f5=(_0x53dbaf=this[_0x3086ff(0x2de)])[_0x3086ff(0x208)])===null||_0x1281f5===void 0x0?void 0x0:_0x1281f5[_0x3086ff(0x46d)](_0x53dbaf,_0x2b81e3);}[_0x54582d(0x42d)](_0x2d8e5a){const _0x4b07b6=_0x54582d;var _0x238182,_0xe41d3f;return(_0x238182=(_0xe41d3f=this[_0x4b07b6(0x2de)])[_0x4b07b6(0x45b)])===null||_0x238182===void 0x0?void 0x0:_0x238182['call'](_0xe41d3f,_0x2d8e5a);}['_transformRemoteChangesetByIMECache'](_0x4be173){const _0x3b013d=_0x54582d;var _0x2cb4be,_0x48a3c2,_0x21e035;return(_0x2cb4be=(_0x48a3c2=(_0x21e035=this[_0x3b013d(0x2de)])[_0x3b013d(0x46a)])===null||_0x48a3c2===void 0x0?void 0x0:_0x48a3c2[_0x3b013d(0x46d)](_0x21e035,_0x4be173))!==null&&_0x2cb4be!==void 0x0?_0x2cb4be:_0x4be173;}[_0x54582d(0x3c0)](_0x78fd75){const _0x1e8894=_0x54582d;var _0x51775e,_0x4d667d,_0x3c6cac;return(_0x51775e=(_0x4d667d=(_0x3c6cac=this[_0x1e8894(0x2de)])['onTransformRemoteChangesetByStateCache'])===null||_0x4d667d===void 0x0?void 0x0:_0x4d667d[_0x1e8894(0x46d)](_0x3c6cac,_0x78fd75))!==null&&_0x51775e!==void 0x0?_0x51775e:_0x78fd75;}[_0x54582d(0x3f7)](_0x5db2d0){const _0x48721e=_0x54582d;if(this['type']===_univerjs_core[_0x48721e(0x2fd)]['UNIVER_DOC']){const {unitID:_0x2e93ed,mutations:_0x52c794,memberID:_0x5ad75a}=_0x5db2d0,_0x57736f=_0x52c794['length']>0x0?_0x52c794[0x0][_0x48721e(0x1c6)][_0x48721e(0x1c8)]:[];if(Array[_0x48721e(0x209)](_0x57736f)&&_0x57736f[_0x48721e(0x473)]>0x0){var _0xdc735c,_0x4b7883;(_0xdc735c=(_0x4b7883=this[_0x48721e(0x2de)])[_0x48721e(0x243)])===null||_0xdc735c===void 0x0||_0xdc735c[_0x48721e(0x46d)](_0x4b7883,{'unitID':_0x2e93ed,'memberID':_0x5ad75a,'textRanges':_0x57736f});}}}[_0x54582d(0x479)](){const _0x4c1ec5=_0x54582d;var _0x345872;(_0x345872=this[_0x4c1ec5(0x310)])===null||_0x345872===void 0x0||_0x345872[_0x4c1ec5(0x404)](this[_0x4c1ec5(0x481)],this[_0x4c1ec5(0x343)],this[_0x4c1ec5(0x42b)],this[_0x4c1ec5(0x1c4)]);}[_0x54582d(0x39d)](){const _0x31512b=_0x54582d;return this[_0x31512b(0x36a)][_0x31512b(0x340)](this[_0x31512b(0x481)]);}[_0x54582d(0x403)](){const _0x235bcf=_0x54582d;this[_0x235bcf(0x36a)][_0x235bcf(0x257)](this[_0x235bcf(0x481)]);}[_0x54582d(0x33c)](_0x230a05){const _0x20dd89=_0x54582d;let _0x53158a=this['_transformRemoteChangesetByIMECache'](_0x230a05);_0x53158a=this[_0x20dd89(0x3c0)](_0x53158a);const _0x23ff2d=(0x0,_univerjs_core['sequenceExecute'])(_0x53158a[_0x20dd89(0x334)],this['_commandService'],{'fromCollab':!![]});if(!_0x23ff2d['result']){var _0xe2fc4d;if(_0x23ff2d[_0x20dd89(0x3e0)]instanceof Error)throw _0x23ff2d[_0x20dd89(0x3e0)];throw new Error((_0xe2fc4d=_0x23ff2d[_0x20dd89(0x3e0)])!==null&&_0xe2fc4d!==void 0x0?_0xe2fc4d:_0x20dd89(0x2e0));}this[_0x20dd89(0x36b)](_0x53158a),this['_transformStateCache'](_0x53158a),this['_transformUndoredo'](_0x230a05),this[_0x20dd89(0x1b4)](_0x53158a),this[_0x20dd89(0x3f7)](_0x53158a),this['_incrementRevisionNumber']();}};let SyncedState=class SyncedState extends CollaborationState{constructor(_0x50ce0c,_0x17f3e7,_0x451430,_0x1aa229,_0x1a8a2d,_0x54ed19,_0x448f43,_0x3c7e25,_0x5357ff,_0x446d46){const _0x1d49ab=_0x54582d;super(_0x50ce0c,_0x17f3e7,null,[],_0x451430,_0x448f43,_0x54ed19,_0x1aa229,_0x446d46),this['_injector']=_0x1a8a2d,this[_0x1d49ab(0x469)]=_0x3c7e25,this[_0x1d49ab(0x448)]=_0x5357ff,this[_0x1d49ab(0x286)]=_0x446d46,_defineProperty(this,_0x1d49ab(0x21e),CollaborationStatus[_0x1d49ab(0x291)]);}[_0x54582d(0x326)](_0x4f5e58){const _0x39c8d6=_0x54582d,_0x31493c=this[_0x39c8d6(0x42a)][_0x39c8d6(0x40f)](PendingState,this[_0x39c8d6(0x481)],this[_0x39c8d6(0x343)],[_0x4f5e58],this[_0x39c8d6(0x2de)]);return _0x31493c[_0x39c8d6(0x23f)](),_0x31493c['_updateLocalCache'](),_0x31493c;}[_0x54582d(0x41f)](_0x457700){const _0x4395c8=_0x54582d;if(this[_0x4395c8(0x461)](_0x457700))return this[_0x4395c8(0x42a)][_0x4395c8(0x40f)](FetchingMissState,this[_0x4395c8(0x481)],this[_0x4395c8(0x343)],null,[],null,[_0x457700],this[_0x4395c8(0x2de)]);try{const _0x1964da=this['_transformService'][_0x4395c8(0x24e)](_0x457700,[_univerjs_pro_collaboration[_0x4395c8(0x456)]]);if((0x0,_univerjs_pro_collaboration['isTransformMutationsWithChangesetSuccess'])(_0x1964da)){const {c1Prime:_0x2a434f}=_0x1964da;return this['_executeRemoteChangeset'](_0x2a434f),this;}throw _0x1964da[_0x4395c8(0x3e0)];}catch(_0x1b8284){return this[_0x4395c8(0x469)][_0x4395c8(0x3e0)](_0x1b8284),this[_0x4395c8(0x290)](![]);}}['_onConflict'](_0x2acf7e){const _0x507dac=_0x54582d;return this[_0x507dac(0x42a)][_0x507dac(0x40f)](ConflictState,this[_0x507dac(0x481)],this['type'],null,[],this['_handler'],_0x2acf7e);}[_0x54582d(0x296)](){const _0x466beb=_0x54582d;throw new Error(_0x466beb(0x33a));}[_0x54582d(0x33d)](){const _0x33a590=_0x54582d;throw new Error(_0x33a590(0x19f));}[_0x54582d(0x301)](){return this;}[_0x54582d(0x1ab)](){const _0x3a7707=_0x54582d;return this[_0x3a7707(0x42a)]['createInstance'](OfflineState,this[_0x3a7707(0x481)],this['type'],null,[],this[_0x3a7707(0x2de)]);}[_0x54582d(0x211)](){return this;}[_0x54582d(0x2df)](){throw new Error('[SyncedState]:\x20invalid\x20calling\x20to\x20`resend`.');}['fetchMiss'](){const _0x3f3b02=_0x54582d,_0x11b5a5=this[_0x3f3b02(0x36a)][_0x3f3b02(0x340)](this[_0x3f3b02(0x481)]);return this[_0x3f3b02(0x2de)]['onMissingChangesets']({'from':_0x11b5a5,'to':0x0}),this[_0x3f3b02(0x42a)]['createInstance'](FetchingMissState,this[_0x3f3b02(0x481)],this[_0x3f3b02(0x343)],null,[],null,[],this[_0x3f3b02(0x2de)]);}};SyncedState=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x5,_univerjs_core['IUndoRedoService']),__decorateParam(0x6,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0x7,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0x8,_univerjs_pro_collaboration['ITransformService']),__decorateParam(0x9,(0x0,_univerjs_core[_0x54582d(0x23d)])(ILocalCacheService))],SyncedState);let PendingState=_PendingState=class PendingState extends CollaborationState{constructor(_0x31d56b,_0x5a1e0d,_0x2cff07,_0x2c513a,_0x3956ef,_0x201095,_0x2e2469,_0x500747,_0x2364e8,_0x22b18d,_0x2c1c82,_0x45c51f,_0x582fc9,_0x114eaf){const _0x1d604a=_0x54582d;super(_0x31d56b,_0x5a1e0d,null,_0x2cff07,_0x2c513a,_0x2364e8,_0x582fc9,_0x201095,_0x114eaf),this[_0x1d604a(0x42a)]=_0x3956ef,this[_0x1d604a(0x24a)]=_0x2e2469,this[_0x1d604a(0x469)]=_0x500747,this[_0x1d604a(0x345)]=_0x22b18d,this[_0x1d604a(0x448)]=_0x2c1c82,this[_0x1d604a(0x46c)]=_0x45c51f,_defineProperty(this,_0x1d604a(0x21e),CollaborationStatus[_0x1d604a(0x1bd)]),_defineProperty(this,'_scheduleCompleteTimestamp',null),_defineProperty(this,_0x1d604a(0x1ef),null);}[_0x54582d(0x326)](_0xac23b9){const _0x53413f=_0x54582d;return this[_0x53413f(0x1c4)][_0x53413f(0x35d)](_0xac23b9),this[_0x53413f(0x479)](),this;}[_0x54582d(0x41f)](_0x4e1ea7){const _0x12ed9b=_0x54582d;if(this['_checkMissing'](_0x4e1ea7))return this['_clearScheduledTask'](),this[_0x12ed9b(0x42a)]['createInstance'](FetchingMissState,this[_0x12ed9b(0x481)],this[_0x12ed9b(0x343)],null,this['_pendingMutations'],null,[_0x4e1ea7],this[_0x12ed9b(0x2de)]);try{const _0x731a74=this[_0x12ed9b(0x448)]['transformMutationsWithChangeset'](_0x4e1ea7,this['_pendingMutations']);if((0x0,_univerjs_pro_collaboration[_0x12ed9b(0x219)])(_0x731a74)){const {c1Prime:_0x4fc0fd,m2Prime:_0x43afca}=_0x731a74;this[_0x12ed9b(0x33c)](_0x4fc0fd);const _0x26c1ac=this[_0x12ed9b(0x42a)][_0x12ed9b(0x40f)](_PendingState,this[_0x12ed9b(0x481)],this[_0x12ed9b(0x343)],_0x43afca,this['_handler']);this[_0x12ed9b(0x1eb)]();const _0x4bd795=new Date()[_0x12ed9b(0x3b2)](),_0xa98a80=this[_0x12ed9b(0x42c)]?Math['max'](this[_0x12ed9b(0x42c)]-_0x4bd795,0x0):this[_0x12ed9b(0x2aa)]();return _0x26c1ac[_0x12ed9b(0x23f)](_0xa98a80),_0x26c1ac;}throw _0x731a74[_0x12ed9b(0x3e0)];}catch(_0x2757b3){return this[_0x12ed9b(0x469)][_0x12ed9b(0x3e0)](_0x2757b3),this['_onConflict'](![]);}}[_0x54582d(0x296)](){const _0x1ac0a4=_0x54582d;throw new Error(_0x1ac0a4(0x1ac));}[_0x54582d(0x33d)](){const _0x263cbf=_0x54582d;throw new Error(_0x263cbf(0x1df));}[_0x54582d(0x301)](){return this;}[_0x54582d(0x1ab)](){const _0x150039=_0x54582d;return this[_0x150039(0x1eb)](),this[_0x150039(0x42a)][_0x150039(0x40f)](OfflineState,this[_0x150039(0x481)],this[_0x150039(0x343)],null,this['_pendingMutations'],this[_0x150039(0x2de)]);}[_0x54582d(0x211)](){return this;}[_0x54582d(0x23f)](_0x14fb84){const _0x2cd0f7=_0x54582d,_0x2cb1e5=_0x14fb84!==null&&_0x14fb84!==void 0x0?_0x14fb84:this['_getSendChangesetTimeout']();this[_0x2cd0f7(0x42c)]=new Date()[_0x2cd0f7(0x3b2)]()+_0x2cb1e5,this['_sendingTimer']=setTimeout(()=>{const _0x2bffb3=_0x2cd0f7;this['_clearScheduledTask']();let _0x1f9d21=null;switch(this[_0x2bffb3(0x343)]){case _univerjs_core[_0x2bffb3(0x2fd)][_0x2bffb3(0x1f9)]:_0x1f9d21=assembleSheetChangeset(this[_0x2bffb3(0x1c4)],this[_0x2bffb3(0x481)],this['_univerInstanceService'],this['_revisionService'],this['_memberService']);break;case _univerjs_core[_0x2bffb3(0x2fd)][_0x2bffb3(0x2e6)]:if(this['_pendingMutations'][_0x2bffb3(0x2e1)](_0x4f961c=>_0x4f961c['id']===_univerjs_docs[_0x2bffb3(0x37c)]['id']))_0x1f9d21=assembleDocChangeset(this['_pendingMutations'],this[_0x2bffb3(0x481)],this[_0x2bffb3(0x46c)],this['_revisionService'],this[_0x2bffb3(0x24a)]);else _0x1f9d21=assembleSheetChangeset(this[_0x2bffb3(0x1c4)],this['unitID'],this['_univerInstanceService'],this[_0x2bffb3(0x36a)],this[_0x2bffb3(0x24a)]);break;default:throw new Error(_0x2bffb3(0x2a4)+this[_0x2bffb3(0x343)]+_0x2bffb3(0x2ef));}const {changeset:_0x4a69f5,pendingMutations:_0x32e7be}=_0x1f9d21;this['_handler'][_0x2bffb3(0x2d6)](_0x4a69f5);const _0x2fba2e=_0x32e7be[_0x2bffb3(0x473)]?this['_injector'][_0x2bffb3(0x40f)](AwaitingWithPendingState,this[_0x2bffb3(0x481)],this['type'],_0x4a69f5,_0x32e7be,this[_0x2bffb3(0x2de)],void 0x0):this[_0x2bffb3(0x42a)][_0x2bffb3(0x40f)](AwaitingState,this[_0x2bffb3(0x481)],this[_0x2bffb3(0x343)],_0x4a69f5,this[_0x2bffb3(0x2de)]);_0x2fba2e[_0x2bffb3(0x479)](),this['_handler'][_0x2bffb3(0x200)](this,_0x2fba2e);},_0x2cb1e5);}[_0x54582d(0x2aa)](){const _0x3c1cac=_0x54582d;var _0xe4aac0;const _0x50184c=this['_configService'][_0x3c1cac(0x3de)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0xe4aac0=_0x50184c===null||_0x50184c===void 0x0?void 0x0:_0x50184c[_0x3c1cac(0x363)])!==null&&_0xe4aac0!==void 0x0?_0xe4aac0:DEFAULT_SEND_CHANGESET_TIMEOUT;}[_0x54582d(0x2df)](){const _0xfa1aed=_0x54582d;throw new Error(_0xfa1aed(0x1b9));}['_clearScheduledTask'](){const _0x467826=_0x54582d;this['_sendingTimer']!=null&&(clearTimeout(this[_0x467826(0x1ef)]),this['_sendingTimer']=null);}['_onConflict'](_0x3f1fd4){const _0x5d1f2e=_0x54582d;return this[_0x5d1f2e(0x1eb)](),this[_0x5d1f2e(0x42a)][_0x5d1f2e(0x40f)](ConflictState,this[_0x5d1f2e(0x481)],this['type'],null,this[_0x5d1f2e(0x1c4)],this[_0x5d1f2e(0x2de)],_0x3f1fd4);}};PendingState=_PendingState=__decorate([__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0x6,(0x0,_univerjs_core[_0x54582d(0x205)])(MemberService)),__decorateParam(0x7,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0x8,_univerjs_core['ICommandService']),__decorateParam(0x9,_univerjs_core['IConfigService']),__decorateParam(0xa,_univerjs_pro_collaboration[_0x54582d(0x1af)]),__decorateParam(0xb,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0xc,_univerjs_core[_0x54582d(0x2eb)]),__decorateParam(0xd,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],PendingState);let AwaitingState=_AwaitingState=class AwaitingState extends CollaborationState{constructor(_0x41125e,_0x2322db,_0x2b44b1,_0x3bd2cd,_0x38c5e8,_0x49f928,_0x444ed7,_0xb44b7d,_0x962fa4,_0x1ae74f,_0x160888){const _0x4a53a5=_0x54582d;super(_0x41125e,_0x2322db,_0x2b44b1,[],_0x3bd2cd,_0x444ed7,_0x1ae74f,_0x49f928,_0x160888),this['_injector']=_0x38c5e8,this[_0x4a53a5(0x469)]=_0xb44b7d,this[_0x4a53a5(0x448)]=_0x962fa4,_defineProperty(this,_0x4a53a5(0x21e),CollaborationStatus[_0x4a53a5(0x3bd)]),_defineProperty(this,'_resendTimeout',0x0),_defineProperty(this,'_maxTotalRetryTimeout',0x0),_defineProperty(this,_0x4a53a5(0x215),void 0x0),_defineProperty(this,_0x4a53a5(0x32a),void 0x0);}[_0x54582d(0x326)](_0x49dbf0){const _0x58d603=_0x54582d;this[_0x58d603(0x1eb)]();const _0x4df2bb=this['_injector'][_0x58d603(0x40f)](AwaitingWithPendingState,this[_0x58d603(0x481)],this['type'],this[_0x58d603(0x42b)],[_0x49dbf0],this['_handler'],this[_0x58d603(0x215)]);return _0x4df2bb[_0x58d603(0x479)](),_0x4df2bb;}['onRemoteChangeset'](_0x340bf9){const _0x4cbcd3=_0x54582d;if(this[_0x4cbcd3(0x461)](_0x340bf9))return this[_0x4cbcd3(0x1eb)](),this['_injector'][_0x4cbcd3(0x40f)](FetchingMissState,this[_0x4cbcd3(0x481)],this[_0x4cbcd3(0x343)],this[_0x4cbcd3(0x42b)],[],null,[_0x340bf9],this[_0x4cbcd3(0x2de)]);try{const _0x476b4f=this['_transformService'][_0x4cbcd3(0x3af)]([_0x340bf9],[this[_0x4cbcd3(0x42b)]],![]);if((0x0,_univerjs_pro_collaboration[_0x4cbcd3(0x3f9)])(_0x476b4f)){const {c1Prime:_0xfbc06c,c2Prime:_0x1b84c1}=_0x476b4f;this['_executeRemoteChangeset'](_0xfbc06c[0x0]),_0x1b84c1[0x0][_0x4cbcd3(0x20b)]=this['_getCurrentRevision'](),this[_0x4cbcd3(0x1eb)]();const _0x1e1751=this[_0x4cbcd3(0x42a)]['createInstance'](_AwaitingState,this[_0x4cbcd3(0x481)],this[_0x4cbcd3(0x343)],_0x1b84c1[0x0],this[_0x4cbcd3(0x2de)]);return _0x1e1751[_0x4cbcd3(0x479)](),_0x1e1751;}return this['_onConflict'](![]);}catch(_0x551ce6){return this[_0x4cbcd3(0x469)][_0x4cbcd3(0x3e0)](_0x551ce6),this[_0x4cbcd3(0x290)](![]);}}['onRemoteAck'](_0x5781c8){const _0x56029=_0x54582d;this[_0x56029(0x1eb)]();const _0x2926da=this[_0x56029(0x36a)][_0x56029(0x340)](this['unitID']);if(_0x5781c8[_0x56029(0x442)]<_0x2926da-0x1)return this;if(this[_0x56029(0x461)](_0x5781c8))return this['_injector'][_0x56029(0x40f)](FetchingMissState,this[_0x56029(0x481)],this[_0x56029(0x343)],null,[],this[_0x56029(0x42b)],[],this[_0x56029(0x2de)]);this['_incrementRevisionNumber']();const _0x1495d2=this['_injector']['createInstance'](SyncedState,this[_0x56029(0x481)],this[_0x56029(0x343)],this[_0x56029(0x2de)]);return _0x1495d2[_0x56029(0x479)](),_0x1495d2;}['onRemoteRej'](_0x1d9467){const _0x3b312c=_0x54582d;return this[_0x3b312c(0x290)](!!(_0x1d9467===null||_0x1d9467===void 0x0?void 0x0:_0x1d9467[_0x3b312c(0x402)]));}[_0x54582d(0x301)](_0x803ee0){const _0x1c4fcb=_0x54582d;if(this[_0x1c4fcb(0x3ef)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x1c4fcb(0x1ab)]();return this[_0x1c4fcb(0x215)]=createTimerObservable$(this[_0x1c4fcb(0x3b4)],{'timeout':this[_0x1c4fcb(0x3b4)],'reqId':_0x803ee0['reqId']}),this[_0x1c4fcb(0x32a)]=this[_0x1c4fcb(0x215)][_0x1c4fcb(0x1c3)](({reqId:_0x5e81cd,timeout:_0x380513})=>{const _0x37cca5=_0x1c4fcb;this[_0x37cca5(0x240)](_0x5e81cd,_0x380513);}),this;}[_0x54582d(0x1ab)](){const _0x411ac7=_0x54582d;return this['_clearScheduledTask'](),this['_injector']['createInstance'](OfflineState,this[_0x411ac7(0x481)],this['type'],this[_0x411ac7(0x42b)],[],this['_handler']);}[_0x54582d(0x211)](){return this;}['resend'](){const _0x2f7806=_0x54582d;this[_0x2f7806(0x2de)][_0x2f7806(0x2d6)](this[_0x2f7806(0x42b)]);}[_0x54582d(0x290)](_0x407a0d){const _0x2a6fb5=_0x54582d;return this[_0x2a6fb5(0x1eb)](),this[_0x2a6fb5(0x42a)][_0x2a6fb5(0x40f)](ConflictState,this['unitID'],this[_0x2a6fb5(0x343)],this['_awaitingChangeset'],[],this['_handler'],_0x407a0d);}['_resendWithTimeout'](_0x580f12,_0x527433){const _0x43caa6=_0x54582d;var _0x2af423;_0x580f12===((_0x2af423=this[_0x43caa6(0x42b)])===null||_0x2af423===void 0x0?void 0x0:_0x2af423[_0x43caa6(0x2ca)])&&(this[_0x43caa6(0x2df)](),this[_0x43caa6(0x3b4)]=_0x527433===0x0?0x3e8:Math[_0x43caa6(0x1d1)](_0x527433*0x2,MAX_RETRY_TIMEOUT),this[_0x43caa6(0x3ef)]+=this[_0x43caa6(0x3b4)]);}[_0x54582d(0x1eb)](){const _0x1d6c62=_0x54582d;var _0x59e451;(_0x59e451=this[_0x1d6c62(0x32a)])===null||_0x59e451===void 0x0||_0x59e451[_0x1d6c62(0x196)](),this[_0x1d6c62(0x3b4)]=0x0,this[_0x1d6c62(0x3ef)]=0x0;}};AwaitingState=_AwaitingState=__decorate([__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0x6,_univerjs_core['ICommandService']),__decorateParam(0x7,_univerjs_core['ILogService']),__decorateParam(0x8,_univerjs_pro_collaboration[_0x54582d(0x1af)]),__decorateParam(0x9,_univerjs_core[_0x54582d(0x2eb)]),__decorateParam(0xa,(0x0,_univerjs_core[_0x54582d(0x23d)])(ILocalCacheService))],AwaitingState);let AwaitingWithPendingState=_AwaitingWithPendingState=class AwaitingWithPendingState extends CollaborationState{constructor(_0x4461db,_0x4d23ed,_0x4f1b1b,_0xa3fd,_0x4dd878,_0x3abbc9,_0x1def03,_0x110433,_0x551b31,_0x254efa,_0xe914d8,_0x5371c7,_0x5d3217){const _0x546c2f=_0x54582d;super(_0x4461db,_0x4d23ed,_0x4f1b1b,_0xa3fd,_0x4dd878,_0x551b31,_0x5371c7,_0x110433,_0x5d3217),this[_0x546c2f(0x42a)]=_0x1def03,this['_logService']=_0x254efa,this[_0x546c2f(0x448)]=_0xe914d8,this[_0x546c2f(0x286)]=_0x5d3217,_defineProperty(this,_0x546c2f(0x21e),CollaborationStatus[_0x546c2f(0x1a3)]),_defineProperty(this,'_resendTimeout',0x0),_defineProperty(this,_0x546c2f(0x3ef),0x0),_defineProperty(this,_0x546c2f(0x215),void 0x0),_defineProperty(this,'_sender',void 0x0),_0x3abbc9&&(this[_0x546c2f(0x215)]=_0x3abbc9,this['_sender']=this[_0x546c2f(0x215)][_0x546c2f(0x1c3)](({reqId:_0x8c956e,timeout:_0x34b7ef})=>{this['_resendWithTimeout'](_0x8c956e,_0x34b7ef);}));}[_0x54582d(0x326)](_0x5d523f){const _0x20858b=_0x54582d;return this[_0x20858b(0x1c4)][_0x20858b(0x35d)](_0x5d523f),this;}[_0x54582d(0x41f)](_0x5f3edd){const _0x1ed074=_0x54582d;if(this[_0x1ed074(0x461)](_0x5f3edd))return this['_clearScheduledTask'](),this[_0x1ed074(0x42a)]['createInstance'](FetchingMissState,this['unitID'],this['type'],this['_awaitingChangeset'],this[_0x1ed074(0x1c4)],null,[_0x5f3edd],this[_0x1ed074(0x2de)]);try{const _0x5e818f=this[_0x1ed074(0x448)][_0x1ed074(0x3af)]([_0x5f3edd],[this[_0x1ed074(0x42b)]],![]);if((0x0,_univerjs_pro_collaboration[_0x1ed074(0x3f9)])(_0x5e818f)){const {c1Prime:_0x26ed9a,c2Prime:_0x1c0733}=_0x5e818f,_0x1d1c80=this[_0x1ed074(0x448)][_0x1ed074(0x24e)](_0x26ed9a[0x0],this[_0x1ed074(0x1c4)]);if((0x0,_univerjs_pro_collaboration[_0x1ed074(0x219)])(_0x1d1c80)){const {c1Prime:_0x39f5ff,m2Prime:_0x39fdf0}=_0x1d1c80;return this[_0x1ed074(0x33c)](_0x39f5ff),_0x1c0733[0x0][_0x1ed074(0x20b)]=this[_0x1ed074(0x39d)](),this[_0x1ed074(0x1eb)](),this[_0x1ed074(0x42a)]['createInstance'](_AwaitingWithPendingState,this[_0x1ed074(0x481)],this[_0x1ed074(0x343)],_0x1c0733[0x0],_0x39fdf0,this[_0x1ed074(0x2de)],void 0x0);}throw _0x1d1c80[_0x1ed074(0x3e0)];}throw _0x5e818f[_0x1ed074(0x3e0)];}catch(_0x43eed1){return this[_0x1ed074(0x469)][_0x1ed074(0x3e0)](_0x43eed1),this[_0x1ed074(0x290)](![]);}}[_0x54582d(0x296)](_0x365d9d){const _0x37779b=_0x54582d;this[_0x37779b(0x1eb)]();if(this['_checkMissing'](_0x365d9d))return this[_0x37779b(0x42a)][_0x37779b(0x40f)](FetchingMissState,this[_0x37779b(0x481)],this[_0x37779b(0x343)],null,this['_pendingMutations'],this[_0x37779b(0x42b)],[],this[_0x37779b(0x2de)]);this[_0x37779b(0x403)]();const _0x3d742f=this[_0x37779b(0x42a)][_0x37779b(0x40f)](PendingState,this[_0x37779b(0x481)],this[_0x37779b(0x343)],this[_0x37779b(0x1c4)],this['_handler']);return _0x3d742f['_schedule'](),_0x3d742f[_0x37779b(0x479)](),_0x3d742f;}['onRemoteRej'](_0xbac638){const _0x15d36a=_0x54582d;return this[_0x15d36a(0x290)](!!(_0xbac638===null||_0xbac638===void 0x0?void 0x0:_0xbac638[_0x15d36a(0x402)]));}['onRemoteRetry'](_0x39e152){const _0x3e388b=_0x54582d;if(this[_0x3e388b(0x3ef)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x3e388b(0x1ab)]();return this['_resendTimer']=createTimerObservable$(this[_0x3e388b(0x3b4)],{'timeout':this['_resendTimeout'],'reqId':_0x39e152[_0x3e388b(0x2ca)]}),this['_sender']=this[_0x3e388b(0x215)]['subscribe'](({reqId:_0x56c79b,timeout:_0x104273})=>{const _0x21e550=_0x3e388b;this[_0x21e550(0x240)](_0x56c79b,_0x104273);}),this;}[_0x54582d(0x1ab)](){const _0xe95d6e=_0x54582d;return this[_0xe95d6e(0x1eb)](),this['_injector'][_0xe95d6e(0x40f)](OfflineState,this['unitID'],this[_0xe95d6e(0x343)],this['_awaitingChangeset'],this['_pendingMutations'],this[_0xe95d6e(0x2de)]);}[_0x54582d(0x211)](){return this;}[_0x54582d(0x2df)](){const _0x112286=_0x54582d;this[_0x112286(0x2de)][_0x112286(0x2d6)](this[_0x112286(0x42b)]);}[_0x54582d(0x290)](_0xefe32c){const _0x3b875d=_0x54582d;return this[_0x3b875d(0x1eb)](),this[_0x3b875d(0x42a)][_0x3b875d(0x40f)](ConflictState,this[_0x3b875d(0x481)],this[_0x3b875d(0x343)],null,this[_0x3b875d(0x1c4)],this[_0x3b875d(0x2de)],_0xefe32c);}[_0x54582d(0x240)](_0x58195a,_0x47b3c9){const _0x2777e4=_0x54582d;var _0x1a1d2d;_0x58195a===((_0x1a1d2d=this[_0x2777e4(0x42b)])===null||_0x1a1d2d===void 0x0?void 0x0:_0x1a1d2d[_0x2777e4(0x2ca)])&&(this[_0x2777e4(0x2df)](),this[_0x2777e4(0x3b4)]=_0x47b3c9===0x0?0x3e8:Math[_0x2777e4(0x1d1)](_0x47b3c9*0x2,MAX_RETRY_TIMEOUT),this[_0x2777e4(0x3ef)]+=this[_0x2777e4(0x3b4)]);}[_0x54582d(0x1eb)](){const _0x549a47=_0x54582d;var _0x58d051;(_0x58d051=this['_sender'])===null||_0x58d051===void 0x0||_0x58d051[_0x549a47(0x196)](),this[_0x549a47(0x3b4)]=0x0,this[_0x549a47(0x3ef)]=0x0;}};AwaitingWithPendingState=_AwaitingWithPendingState=__decorate([__decorateParam(0x6,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration['RevisionService'])),__decorateParam(0x8,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0x9,_univerjs_core['ILogService']),__decorateParam(0xa,_univerjs_pro_collaboration[_0x54582d(0x1af)]),__decorateParam(0xb,_univerjs_core[_0x54582d(0x2eb)]),__decorateParam(0xc,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],AwaitingWithPendingState);function _0x598e(_0x41d2c1,_0x5a144b){_0x41d2c1=_0x41d2c1-0x196;const _0x1fa5ef=_0x1fa5();let _0x598ede=_0x1fa5ef[_0x41d2c1];return _0x598ede;}let ConflictState=class ConflictState extends CollaborationState{constructor(_0x2af552,_0x2611d2,_0x325ac2,_0x4428df,_0x1f49a2,_0x27bd6b=![],_0x3a4afc,_0x136e5b,_0x1224e2,_0x58c569,_0xa432f9,_0x1e044e,_0x97a239){const _0x169d2e=_0x54582d;super(_0x2af552,_0x2611d2,_0x325ac2,_0x4428df,_0x1f49a2,_0x136e5b,_0x1224e2,_0x58c569,_0x97a239),this[_0x169d2e(0x329)]=_0x27bd6b,this['_permissionService']=_0x3a4afc,this['_localeService']=_0xa432f9,this['_collaborationUIEventService']=_0x1e044e,this['localCacheService']=_0x97a239,_defineProperty(this,_0x169d2e(0x21e),CollaborationStatus[_0x169d2e(0x397)]),this[_0x169d2e(0x30c)](),this[_0x169d2e(0x45a)](),this['_disableEditing']();}[_0x54582d(0x326)](){return this;}[_0x54582d(0x41f)](){return this;}[_0x54582d(0x296)](){return this;}[_0x54582d(0x33d)](){return this;}['onRemoteRetry'](){return this;}[_0x54582d(0x1ab)](){return this;}[_0x54582d(0x211)](){return this;}['resend'](){throw new Error('[ConflictState]:\x20invalid\x20calling\x20to\x20`resend`.');}[_0x54582d(0x45a)](){const _0x49d566=_0x54582d;var _0x2b0cbe;(_0x2b0cbe=this[_0x49d566(0x310)])===null||_0x2b0cbe===void 0x0||_0x2b0cbe['updateOfflineData'](this[_0x49d566(0x481)],this[_0x49d566(0x343)],null,[]);}[_0x54582d(0x30c)](){const _0x2775b8=_0x54582d;if(this['_isPermissionRej'])this[_0x2775b8(0x350)][_0x2775b8(0x19d)]({'id':CollaborationUIEventId[_0x2775b8(0x19e)]});else this[_0x2775b8(0x350)][_0x2775b8(0x19d)]({'id':CollaborationUIEventId[_0x2775b8(0x397)]});}['_disableEditing'](){const _0x1852e0=_0x54582d;this[_0x1852e0(0x39a)]['updatePermissionPoint'](new _univerjs_sheets['WorkbookEditablePermission'](this[_0x1852e0(0x481)])['id'],![]);}};ConflictState=__decorate([__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x54582d(0x247)])),__decorateParam(0x7,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0x8,_univerjs_core[_0x54582d(0x2eb)]),__decorateParam(0x9,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0xa,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x443)])),__decorateParam(0xb,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService)),__decorateParam(0xc,(0x0,_univerjs_core[_0x54582d(0x23d)])(ILocalCacheService))],ConflictState);let OfflineState=class OfflineState extends CollaborationState{constructor(_0x5b5543,_0x3b46c5,_0x500c15,_0x24557d,_0x12a0f2,_0x2189a1,_0x3dadf2,_0x10b71f,_0x3decb1,_0x2fb67f){const _0x186492=_0x54582d;super(_0x5b5543,_0x3b46c5,_0x500c15,_0x24557d,_0x12a0f2,_0x10b71f,_0x3decb1,_0x3dadf2,_0x2fb67f),this[_0x186492(0x42a)]=_0x2189a1,_defineProperty(this,_0x186492(0x21e),CollaborationStatus['OFFLINE']);}[_0x54582d(0x326)](_0x198be5){const _0x5cf572=_0x54582d;return this['_pendingMutations'][_0x5cf572(0x35d)](_0x198be5),this[_0x5cf572(0x479)](),this;}['onRemoteChangeset'](_0x47cfdd){const _0x225117=_0x54582d;throw new Error(_0x225117(0x1ca));}['onRemoteAck'](){throw new Error('[OfflineState]:\x20received\x20acknowledgement.');}[_0x54582d(0x33d)](){const _0x3028c7=_0x54582d;throw new Error(_0x3028c7(0x2e2));}['onRemoteRetry'](){return this;}[_0x54582d(0x1ab)](){return this;}[_0x54582d(0x211)](){const _0xfca854=_0x54582d,{_injector:_0x3595c2,_pendingMutations:_0x4f3566,_awaitingChangeset:_0x51f0f0,unitID:_0x266620,_handler:_0x369410,type:_0x1405d3}=this,_0x5778dc=createOnlineState(_0x3595c2,_0x266620,_0x1405d3,_0x51f0f0,_0x4f3566,_0x369410);if(_0x5778dc instanceof PendingState)_0x5778dc['_schedule']();else{if(_0x5778dc instanceof AwaitingWithPendingState||_0x5778dc instanceof AwaitingState)_0x5778dc[_0xfca854(0x2df)]();}return _0x5778dc;}[_0x54582d(0x2df)](){const _0x5f028a=_0x54582d;throw new Error(_0x5f028a(0x355));}};OfflineState=__decorate([__decorateParam(0x5,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x6,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration['RevisionService'])),__decorateParam(0x7,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0x8,_univerjs_core[_0x54582d(0x2eb)]),__decorateParam(0x9,(0x0,_univerjs_core[_0x54582d(0x23d)])(ILocalCacheService))],OfflineState);let FetchingMissState=class FetchingMissState extends CollaborationState{constructor(_0x2f94e4,_0x30ea12,_0x25155d,_0x4be84d,_0x36de83,_0x5bac8d,_0x18d5c2,_0x559776,_0x11f792,_0x443ff2,_0x37a3d5,_0x3235fd,_0x4469dd,_0x119898){const _0x59d24e=_0x54582d;super(_0x2f94e4,_0x30ea12,_0x25155d,_0x4be84d,_0x18d5c2,_0x37a3d5,_0x3235fd,_0x11f792,_0x119898),this[_0x59d24e(0x2cf)]=_0x36de83,this[_0x59d24e(0x378)]=_0x5bac8d,this[_0x59d24e(0x42a)]=_0x559776,this[_0x59d24e(0x469)]=_0x443ff2,this['_transformService']=_0x4469dd,this[_0x59d24e(0x286)]=_0x119898,_defineProperty(this,_0x59d24e(0x21e),CollaborationStatus[_0x59d24e(0x220)]);}[_0x54582d(0x3e3)](_0x4c0596){const _0x2f22d6=_0x54582d;try{const _0x1ba401=[..._0x4c0596,...this[_0x2f22d6(0x378)]],_0x327153=[this[_0x2f22d6(0x42b)]||this['_acknowledgedAwaitingChangeset']]['filter'](_0xcfd780=>!!_0xcfd780);let _0x36d5ec,_0xa3b1e8;if(_0x327153['length']){const _0x36d40b=this[_0x2f22d6(0x448)][_0x2f22d6(0x3af)](_0x1ba401,_0x327153,![]);if(!(0x0,_univerjs_pro_collaboration[_0x2f22d6(0x3f9)])(_0x36d40b))throw _0x36d40b['error'];_0x36d5ec=_0x36d40b[_0x2f22d6(0x28e)],_0xa3b1e8=_0x36d40b[_0x2f22d6(0x453)];}else _0x36d5ec=_0x1ba401,_0xa3b1e8=[];let _0x2ca615=this[_0x2f22d6(0x1c4)];_0x36d5ec[_0x2f22d6(0x333)](_0x2c0484=>{const _0x161882=_0x2f22d6;let _0x3f32d2;if(_0x2ca615[_0x161882(0x473)]){const _0x5ad814=this[_0x161882(0x448)]['transformMutationsWithChangeset'](_0x2c0484,_0x2ca615);if(!(0x0,_univerjs_pro_collaboration[_0x161882(0x219)])(_0x5ad814))throw _0x5ad814['error'];_0x3f32d2=_0x5ad814[_0x161882(0x28e)],_0x2ca615=_0x5ad814[_0x161882(0x379)];}else _0x3f32d2=_0x2c0484;this[_0x161882(0x33c)](_0x3f32d2);});if(this[_0x2f22d6(0x2cf)])this[_0x2f22d6(0x403)]();if(this[_0x2f22d6(0x42b)]&&_0xa3b1e8[_0x2f22d6(0x473)])_0xa3b1e8[0x0][_0x2f22d6(0x20b)]=this[_0x2f22d6(0x39d)]();let _0x3599a9;if(this[_0x2f22d6(0x42b)]&&_0x2ca615[_0x2f22d6(0x473)]!==0x0)_0x3599a9=this[_0x2f22d6(0x42a)][_0x2f22d6(0x40f)](AwaitingWithPendingState,this[_0x2f22d6(0x481)],this[_0x2f22d6(0x343)],_0xa3b1e8[0x0],_0x2ca615,this[_0x2f22d6(0x2de)],void 0x0);else{if(this['_awaitingChangeset']&&_0x2ca615[_0x2f22d6(0x473)]===0x0)_0xa3b1e8[0x0][_0x2f22d6(0x20b)]=this[_0x2f22d6(0x39d)](),_0x3599a9=this[_0x2f22d6(0x42a)][_0x2f22d6(0x40f)](AwaitingState,this[_0x2f22d6(0x481)],this[_0x2f22d6(0x343)],_0xa3b1e8[0x0],this['_handler']);else{if(_0x2ca615[_0x2f22d6(0x473)]!==0x0){const _0x1f79d1=this['_injector'][_0x2f22d6(0x40f)](PendingState,this[_0x2f22d6(0x481)],this[_0x2f22d6(0x343)],_0x2ca615,this[_0x2f22d6(0x2de)]);_0x1f79d1[_0x2f22d6(0x23f)](),_0x3599a9=_0x1f79d1;}else _0x3599a9=this[_0x2f22d6(0x42a)]['createInstance'](SyncedState,this[_0x2f22d6(0x481)],this[_0x2f22d6(0x343)],this[_0x2f22d6(0x2de)]);}}return _0x3599a9[_0x2f22d6(0x479)](),_0x3599a9;}catch(_0x1fc672){return this[_0x2f22d6(0x469)][_0x2f22d6(0x3e0)](_0x2f22d6(0x389),_0x2f22d6(0x268),_0x1fc672),this[_0x2f22d6(0x42a)]['createInstance'](ConflictState,this[_0x2f22d6(0x481)],this[_0x2f22d6(0x343)],this['_awaitingChangeset'],this[_0x2f22d6(0x1c4)],this[_0x2f22d6(0x2de)],![]);}}['resend'](){const _0x13dac3=_0x54582d;throw new Error(_0x13dac3(0x1c0));}[_0x54582d(0x326)](_0x15ae12){const _0x3df290=_0x54582d;return this[_0x3df290(0x1c4)][_0x3df290(0x35d)](_0x15ae12),this;}['onRemoteChangeset'](_0x632cbb){const _0x294254=_0x54582d;return this[_0x294254(0x378)]['push'](_0x632cbb),this;}['onRemoteAck'](_0x1e65c8){const _0x18ec7d=_0x54582d;if(this[_0x18ec7d(0x42b)])return this[_0x18ec7d(0x2cf)]=this[_0x18ec7d(0x42b)],this[_0x18ec7d(0x42b)]=null,this;throw new Error(_0x18ec7d(0x385));}[_0x54582d(0x33d)](_0x4fccf4){const _0x50aedf=_0x54582d;return this[_0x50aedf(0x290)](!!(_0x4fccf4===null||_0x4fccf4===void 0x0?void 0x0:_0x4fccf4['isPermissionRej']));}[_0x54582d(0x301)](){return this;}['toggleOffline'](){const _0x33b9b3=_0x54582d;return this[_0x33b9b3(0x42a)]['createInstance'](OfflineState,this[_0x33b9b3(0x481)],this[_0x33b9b3(0x343)],this[_0x33b9b3(0x42b)],this[_0x33b9b3(0x1c4)],this[_0x33b9b3(0x2de)]);}[_0x54582d(0x211)](){return this;}[_0x54582d(0x290)](_0x3a156d){const _0x29c48e=_0x54582d;return this['_injector'][_0x29c48e(0x40f)](ConflictState,this[_0x29c48e(0x481)],this['type'],this[_0x29c48e(0x42b)],this[_0x29c48e(0x1c4)],this['_handler'],_0x3a156d);}};FetchingMissState=__decorate([__decorateParam(0x7,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x8,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0x9,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0xa,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0xb,_univerjs_core[_0x54582d(0x2eb)]),__decorateParam(0xc,_univerjs_pro_collaboration[_0x54582d(0x1af)]),__decorateParam(0xd,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],FetchingMissState);function createOnlineState(_0x1dae5,_0x17f800,_0x3083c5,_0x56d1c0,_0x44dea3,_0x4c5417){const _0x42fe2c=_0x54582d;if(_0x56d1c0&&_0x44dea3[_0x42fe2c(0x473)])return _0x1dae5[_0x42fe2c(0x40f)](AwaitingWithPendingState,_0x17f800,_0x3083c5,_0x56d1c0,_0x44dea3,_0x4c5417,void 0x0);if(_0x56d1c0)return _0x1dae5[_0x42fe2c(0x40f)](AwaitingState,_0x17f800,_0x3083c5,_0x56d1c0,_0x4c5417);if(_0x44dea3[_0x42fe2c(0x473)])return _0x1dae5[_0x42fe2c(0x40f)](PendingState,_0x17f800,_0x3083c5,_0x44dea3,_0x4c5417);return _0x1dae5[_0x42fe2c(0x40f)](SyncedState,_0x17f800,_0x3083c5,_0x4c5417);}let CollaborationEntity=class CollaborationEntity extends _univerjs_core[_0x54582d(0x21c)]{get[_0x54582d(0x368)](){return this['_state'];}constructor(_0x407587,_0x43da9f,_0x1b8c9b,_0x58d5c5,_0x3c574f,_0x2495fe,_0x38f76,_0xb816d0,_0x356680,_0x31ac56,_0x4a8068,_0x9ad0f0,_0x3bba76,_0x4642c0){const _0x393e94=_0x54582d;super(),this[_0x393e94(0x481)]=_0x407587,this['session']=_0x43da9f,this[_0x393e94(0x2da)]=_0x1b8c9b,this['_injector']=_0x58d5c5,this[_0x393e94(0x2b3)]=_0x3c574f,this[_0x393e94(0x287)]=_0x2495fe,this['_revisionService']=_0x38f76,this[_0x393e94(0x1d7)]=_0xb816d0,this['_univerInstanceService']=_0x356680,this['_logService']=_0x31ac56,this[_0x393e94(0x1b1)]=_0x4a8068,this[_0x393e94(0x39a)]=_0x9ad0f0,this[_0x393e94(0x3dd)]=_0x3bba76,this[_0x393e94(0x310)]=_0x4642c0,_defineProperty(this,_0x393e94(0x32b),new rxjs['BehaviorSubject'](null)),_defineProperty(this,_0x393e94(0x2a7),this[_0x393e94(0x32b)][_0x393e94(0x2a1)]()),_defineProperty(this,_0x393e94(0x358),void 0x0),_defineProperty(this,_0x393e94(0x2d5),![]),_defineProperty(this,'_changesetSessionId',''),_defineProperty(this,_0x393e94(0x297),0x0),_defineProperty(this,_0x393e94(0x3a1),this['state$']['pipe']((0x0,rxjs[_0x393e94(0x2b9)])(_0x11c4da=>{if(_0x11c4da)return _0x11c4da['status'];return CollaborationStatus['OFFLINE'];}),(0x0,rxjs[_0x393e94(0x2f5)])(0x1))),_defineProperty(this,_0x393e94(0x2af),![]),_defineProperty(this,'_remoteChangesetQueue',[]);}async['init'](){const _0x27b157=_0x54582d;if(this[_0x27b157(0x368)])throw new Error(_0x27b157(0x3b6));await this['_init']();}[_0x54582d(0x349)](){const _0x3959e9=_0x54582d;return this[_0x3959e9(0x2d5)]=!![],(0x0,_univerjs_core[_0x3959e9(0x2b4)])(()=>{const _0x717abb=_0x3959e9;this[_0x717abb(0x2d5)]=![],this[_0x717abb(0x203)]();});}['onLocalMutation'](_0x5ea133){const _0x2a389=_0x54582d;this[_0x2a389(0x1ee)](_0x5ea133);}[_0x54582d(0x29c)](_0x5296d5){const _0x3c61f1=_0x54582d;this['_state']=_0x5296d5,this[_0x3c61f1(0x32b)][_0x3c61f1(0x22a)](_0x5296d5);}async[_0x54582d(0x2a8)](){const _0x9d15b0=_0x54582d;this[_0x9d15b0(0x29c)](await this[_0x9d15b0(0x1d9)]());if(this[_0x9d15b0(0x3dd)]){var _0x94ed29;(_0x94ed29=this['_singleActiveUnitService'])===null||_0x94ed29===void 0x0||_0x94ed29[_0x9d15b0(0x38d)](this[_0x9d15b0(0x481)]),this['disposeWithMe'](this[_0x9d15b0(0x3dd)][_0x9d15b0(0x21a)](this[_0x9d15b0(0x481)])[_0x9d15b0(0x1c3)](_0x5daa14=>{const _0x2d39d0=_0x9d15b0;this['_logService'][_0x2d39d0(0x3e6)](_0x2d39d0(0x3f3),_0x2d39d0(0x438),_0x5daa14),_0x5daa14===UnitStatus[_0x2d39d0(0x22d)]?(this[_0x2d39d0(0x1d7)][_0x2d39d0(0x19d)]({'id':CollaborationUIEventId[_0x2d39d0(0x2ac)]}),this[_0x2d39d0(0x39a)][_0x2d39d0(0x252)](new _univerjs_sheets[(_0x2d39d0(0x20f))](this[_0x2d39d0(0x481)])['id'],![]),this[_0x2d39d0(0x39a)][_0x2d39d0(0x444)](![])):(this['_permissionService'][_0x2d39d0(0x252)](new _univerjs_sheets[(_0x2d39d0(0x20f))](this[_0x2d39d0(0x481)])['id'],!![]),this['_permissionService'][_0x2d39d0(0x444)](!![]));}));}let _0x2a2102=![];return this[_0x9d15b0(0x47f)](this[_0x9d15b0(0x308)][_0x9d15b0(0x225)][_0x9d15b0(0x1c3)](_0x5971a=>{const _0x23b9bf=_0x9d15b0;if(_0x5971a===SessionStatus[_0x23b9bf(0x2bb)])this[_0x23b9bf(0x43f)](_0x2a2102);else _0x5971a===SessionStatus[_0x23b9bf(0x391)]&&(_0x2a2102=!![],this[_0x23b9bf(0x409)]());})),this[_0x9d15b0(0x47f)](this[_0x9d15b0(0x308)]['event$']['subscribe'](_0x387bc8=>{const _0x50028b=_0x9d15b0;try{switch(_0x387bc8['eventID']){case _univerjs_pro_collaboration[_0x50028b(0x439)]['NEW_CHANGESETS']:this[_0x50028b(0x2dd)]((0x0,_univerjs_pro_collaboration['parseProtocolChangeset'])(_0x387bc8[_0x50028b(0x341)]));break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x50028b(0x408)]:this[_0x50028b(0x3ca)](_0x387bc8[_0x50028b(0x341)]);break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x50028b(0x292)]:this['_onRemoteRejected']();break;case _univerjs_pro_collaboration[_0x50028b(0x439)][_0x50028b(0x2e3)]:this[_0x50028b(0x1e4)](_0x387bc8[_0x50028b(0x341)]);break;case _univerjs_pro_collaboration[_0x50028b(0x439)]['PSEUDO_FETCH_MISSING_RESULT']:this[_0x50028b(0x1de)](_0x387bc8['data'][_0x50028b(0x261)][_0x50028b(0x2b9)](_0x22f947=>(0x0,_univerjs_pro_collaboration['parseProtocolChangeset'])(_0x22f947)));break;case _univerjs_pro_collaboration[_0x50028b(0x439)]['PERMISSION_REJ']:this[_0x50028b(0x474)]({'isPermissionRej':!![]});break;case _univerjs_pro_collaboration[_0x50028b(0x439)][_0x50028b(0x31c)]:break;}}catch(_0x31462d){console[_0x50028b(0x3e0)](_0x50028b(0x26c),_0x31462d);throw _0x31462d;}})),this[_0x9d15b0(0x358)];}[_0x54582d(0x321)](){const _0x105c33=_0x54582d;this[_0x105c33(0x2af)]=![];}[_0x54582d(0x33f)](){const _0x445ac3=_0x54582d;if(this[_0x445ac3(0x2af)])throw new Error(_0x445ac3(0x3c3));this['_transitionLocked']=!![];}['_onLocalMutation'](_0x204f85){const _0xa15081=_0x54582d;this[_0xa15081(0x33f)](),this[_0xa15081(0x29c)](this['_state'][_0xa15081(0x326)](_0x204f85)),this[_0xa15081(0x321)]();}[_0x54582d(0x2dd)](_0x37e60f){const _0x2fc4a9=_0x54582d;if(_0x37e60f[_0x2fc4a9(0x442)]<=this[_0x2fc4a9(0x36a)][_0x2fc4a9(0x340)](this[_0x2fc4a9(0x481)]))return;if(this['_collaborationPaused']){this['_remoteChangesetQueue']['push'](_0x37e60f);return;}this[_0x2fc4a9(0x2f3)](_0x37e60f);}[_0x54582d(0x203)](){const _0x31df92=_0x54582d;this['_remoteChangesetQueue'][_0x31df92(0x333)](_0x47477a=>this['_applyRemoteChangeset'](_0x47477a)),this[_0x31df92(0x446)]=[];}[_0x54582d(0x2f3)](_0x5402f4){const _0x567f6e=_0x54582d,_0x5bab8=this[_0x567f6e(0x2b3)][_0x567f6e(0x362)][_0x567f6e(0x1d6)](this[_0x567f6e(0x2b3)][_0x567f6e(0x362)][_0x567f6e(0x207)]()['COMPRESS_MUTATION_APPLY'])(_0x5402f4[_0x567f6e(0x334)],null)||_0x5402f4[_0x567f6e(0x334)],_0x5a0c92={..._0x5402f4,'mutations':_0x5bab8};this['_lockTransition'](),this[_0x567f6e(0x29c)](this['_state']['onRemoteChangeset'](_0x5a0c92)),this['_unlockTransition']();}[_0x54582d(0x3ca)](_0x5a3110){const _0x26392d=_0x54582d;this[_0x26392d(0x33f)](),this[_0x26392d(0x29c)](this[_0x26392d(0x358)][_0x26392d(0x296)](_0x5a3110)),this[_0x26392d(0x321)]();}['_onRemoteRejected'](_0x2f0fc0){const _0x238d13=_0x54582d;this[_0x238d13(0x33f)](),this[_0x238d13(0x29c)](this[_0x238d13(0x358)][_0x238d13(0x33d)](_0x2f0fc0)),this[_0x238d13(0x321)]();}['_onRemoteRetry'](_0x3d3435){const _0x145ca1=_0x54582d;this['_lockTransition'](),this[_0x145ca1(0x29c)](this[_0x145ca1(0x358)][_0x145ca1(0x301)](_0x3d3435)),this[_0x145ca1(0x321)]();}[_0x54582d(0x1de)](_0x32d150){const _0x52c7a0=_0x54582d;if(!(this[_0x52c7a0(0x358)]instanceof FetchingMissState))throw new TypeError(_0x52c7a0(0x1fa));const _0x4d3100=_0x32d150[_0x52c7a0(0x2b9)](_0x473186=>{const _0x531e32=_0x52c7a0,_0x226786=this[_0x531e32(0x2b3)]['interceptor'][_0x531e32(0x1d6)](this[_0x531e32(0x2b3)][_0x531e32(0x362)][_0x531e32(0x207)]()['COMPRESS_MUTATION_APPLY'])(_0x473186['mutations'],null)||_0x473186['mutations'];return{..._0x473186,'mutations':_0x226786};});this[_0x52c7a0(0x33f)](),this['_updateState'](this['_state'][_0x52c7a0(0x3e3)](_0x4d3100)),this[_0x52c7a0(0x321)]();}['_toggleOffline'](){const _0x3d4888=_0x54582d;this[_0x3d4888(0x33f)](),this['_updateState'](this[_0x3d4888(0x358)][_0x3d4888(0x1ab)]()),this['_unlockTransition']();}[_0x54582d(0x43f)](_0x2506dc=![]){const _0x57365d=_0x54582d;this[_0x57365d(0x33f)](),this[_0x57365d(0x29c)](this[_0x57365d(0x358)][_0x57365d(0x211)]()),this[_0x57365d(0x321)]();const _0x16ff04=this[_0x57365d(0x358)];_0x2506dc&&_0x16ff04 instanceof SyncedState&&(this['_lockTransition'](),this['_updateState'](_0x16ff04[_0x57365d(0x3a8)]()),this[_0x57365d(0x321)]());}async[_0x54582d(0x1d9)](){return new Promise(_0x129239=>{const _0x43fd9e=_0x598e;this[_0x43fd9e(0x308)][_0x43fd9e(0x225)]['pipe']((0x0,rxjs[_0x43fd9e(0x1db)])(0x1))[_0x43fd9e(0x1c3)](async _0x2bef1a=>{const _0x2729c7=_0x43fd9e;_0x129239(await this[_0x2729c7(0x330)](_0x2bef1a===SessionStatus[_0x2729c7(0x2bb)]));});});}[_0x54582d(0x2e8)](){const _0x8227a4=_0x54582d,_0x5a407c=this[_0x8227a4(0x481)];return{'onStateChange':(_0x59d829,_0x550631)=>{const _0x20e1e0=_0x8227a4;if(_0x59d829!==this[_0x20e1e0(0x358)])throw new Error('[CollaborationEntity]:\x20invalid\x20state\x20transition!\x20State\x20transferred\x20from\x20is\x20not\x20the\x20current\x20state.\x0aBefore:\x20'+_0x59d829[_0x20e1e0(0x21e)]+_0x20e1e0(0x1d2)+_0x550631['status']+_0x20e1e0(0x2e7)+this[_0x20e1e0(0x358)][_0x20e1e0(0x21e)]);this['_updateState'](_0x550631);},'onSendChangeset':_0x18cfc8=>{const _0x237e7a=_0x8227a4;!_0x18cfc8[_0x237e7a(0x416)]&&(_0x18cfc8[_0x237e7a(0x416)]=this[_0x237e7a(0x1c9)],_0x18cfc8['reqId']=++this[_0x237e7a(0x297)]);const _0x1e189d={'eventID':_univerjs_pro_collaboration[_0x237e7a(0x439)][_0x237e7a(0x452)],'data':{'unitID':_0x18cfc8['unitID'],'unitType':this[_0x237e7a(0x2da)],'changeset':_0x18cfc8,'memberID':this[_0x237e7a(0x308)][_0x237e7a(0x1ad)]()}};this[_0x237e7a(0x308)][_0x237e7a(0x476)](_0x1e189d,this[_0x237e7a(0x481)]);},'onMissingChangesets':({from:_0xecee4,to:_0x4c2d4e})=>{const _0x40a9b6=_0x8227a4;this[_0x40a9b6(0x469)][_0x40a9b6(0x3e6)](_0x40a9b6(0x3f3),_0x40a9b6(0x2cb)+_0xecee4+'\x20to\x20'+_0x4c2d4e);const _0x553436={'eventID':_univerjs_pro_collaboration[_0x40a9b6(0x439)][_0x40a9b6(0x1cc)],'data':{'unitID':_0x5a407c,'unitType':this[_0x40a9b6(0x2da)],'from':_0xecee4,'to':_0x4c2d4e}};this['session'][_0x40a9b6(0x476)](_0x553436,this[_0x40a9b6(0x481)]);}};}async[_0x54582d(0x330)](_0x4dcda7){const _0x13dda4=_0x54582d;var _0x53b3ae,_0x538927,_0x4311e7;const _0x3957fb=await((_0x53b3ae=this[_0x13dda4(0x310)])===null||_0x53b3ae===void 0x0?void 0x0:_0x53b3ae[_0x13dda4(0x253)](this[_0x13dda4(0x481)])),_0x2405d1=(_0x538927=_0x3957fb===null||_0x3957fb===void 0x0?void 0x0:_0x3957fb[_0x13dda4(0x334)])!==null&&_0x538927!==void 0x0?_0x538927:[],_0x16bcb0=(_0x4311e7=_0x3957fb===null||_0x3957fb===void 0x0?void 0x0:_0x3957fb['awaitingChangeset'])!==null&&_0x4311e7!==void 0x0?_0x4311e7:null,_0x32b87a=!!(_0x16bcb0===null||_0x16bcb0===void 0x0?void 0x0:_0x16bcb0[_0x13dda4(0x416)])&&!!(_0x16bcb0===null||_0x16bcb0===void 0x0?void 0x0:_0x16bcb0[_0x13dda4(0x2ca)]);this[_0x13dda4(0x1c9)]=_0x32b87a?_0x16bcb0['sid']:(0x0,_univerjs_pro_collaboration[_0x13dda4(0x1dc)])(),this[_0x13dda4(0x297)]=_0x32b87a?_0x16bcb0[_0x13dda4(0x2ca)]:0x0;const _0x13db70=this[_0x13dda4(0x481)];try{this['_replayCachedMutations'](_0x16bcb0,_0x2405d1);}catch(_0x705e79){this[_0x13dda4(0x469)]['error'](_0x705e79);}const _0x348f47=this['_createHandler']();if(_0x4dcda7){const _0x57f9f5=createOnlineState(this[_0x13dda4(0x42a)],_0x13db70,this['_type'],_0x16bcb0,_0x2405d1,_0x348f47);if(_0x57f9f5 instanceof PendingState)_0x57f9f5[_0x13dda4(0x23f)]();else{if(_0x57f9f5 instanceof AwaitingWithPendingState||_0x57f9f5 instanceof AwaitingState)_0x57f9f5[_0x13dda4(0x2df)]();}return _0x57f9f5;}return this[_0x13dda4(0x42a)][_0x13dda4(0x40f)](OfflineState,_0x13db70,this[_0x13dda4(0x2da)],_0x16bcb0,_0x2405d1,_0x348f47);}[_0x54582d(0x2ba)](_0x3e454b,_0x1eafa9){const _0x492644=_0x54582d;var _0x341ae3,_0x2ded76;const _0x8aa6c6=this['_compressMutationService'][_0x492644(0x362)]['fetchThroughInterceptors'](this[_0x492644(0x2b3)]['interceptor'][_0x492644(0x207)]()[_0x492644(0x45e)]);(_0x341ae3=_0x8aa6c6((_0x3e454b===null||_0x3e454b===void 0x0?void 0x0:_0x3e454b[_0x492644(0x334)])||[],null))===null||_0x341ae3===void 0x0||_0x341ae3['forEach'](_0x13bfc8=>this[_0x492644(0x1b1)]['executeCommand'](_0x13bfc8['id'],_0x13bfc8['params'])),(_0x2ded76=_0x8aa6c6(_0x1eafa9||[],null))===null||_0x2ded76===void 0x0||_0x2ded76[_0x492644(0x333)](_0x26fb68=>this[_0x492644(0x1b1)][_0x492644(0x224)](_0x26fb68['id'],_0x26fb68[_0x492644(0x1c6)]));}};CollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core['Injector'])),__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration[_0x54582d(0x472)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x443)])),__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x54582d(0x205)])(CollaborationUIEventService)),__decorateParam(0x8,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0x9,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0xa,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0xb,_univerjs_core[_0x54582d(0x247)]),__decorateParam(0xc,(0x0,_univerjs_core[_0x54582d(0x23d)])(ISingleActiveUnitService)),__decorateParam(0xd,(0x0,_univerjs_core[_0x54582d(0x23d)])(ILocalCacheService))],CollaborationEntity);let DocCollaborationEntity=class DocCollaborationEntity extends CollaborationEntity{constructor(_0x1435d1,_0x45d210,_0x1fd16d,_0x5de1ae,_0x150b7c,_0x28e2e2,_0x589bca,_0x14f1bf,_0x44ae60,_0x11458d,_0x343614,_0x220e04,_0x4e90a3,_0x223812){const _0x36831c=_0x54582d;super(_0x1435d1,_0x1fd16d,_0x45d210,_0x5de1ae,_0x150b7c,_0x28e2e2,_0x589bca,_0x14f1bf,_0x44ae60,_0x11458d,_0x343614,_0x220e04,_0x4e90a3,_0x223812),this[_0x36831c(0x481)]=_0x1435d1,this['type']=_0x45d210,_defineProperty(this,'_handlerCallback',null);}[_0x54582d(0x2d2)](_0x38d97a){const _0x4acc5d=_0x54582d;this[_0x4acc5d(0x34b)]=_0x38d97a;}[_0x54582d(0x27d)](){const _0x3478b7=_0x54582d;this[_0x3478b7(0x34b)]=null,super[_0x3478b7(0x27d)]();}[_0x54582d(0x2e8)](){const _0x34df73=_0x54582d,_0x547d3a=super['_createHandler']();return _0x547d3a[_0x34df73(0x208)]=_0x2e00e3=>{const _0xe4fece=_0x34df73;var _0x4c106d,_0x4506c3;return(_0x4c106d=this[_0xe4fece(0x34b)])===null||_0x4c106d===void 0x0||(_0x4506c3=_0x4c106d['onTransformIME'])===null||_0x4506c3===void 0x0?void 0x0:_0x4506c3[_0xe4fece(0x46d)](_0x4c106d,_0x2e00e3);},_0x547d3a['onTransformState']=_0x1371ec=>{const _0x41d16f=_0x34df73;var _0x406e94,_0x56fc84;return(_0x406e94=this[_0x41d16f(0x34b)])===null||_0x406e94===void 0x0||(_0x56fc84=_0x406e94['onTransformState'])===null||_0x56fc84===void 0x0?void 0x0:_0x56fc84[_0x41d16f(0x46d)](_0x406e94,_0x1371ec);},_0x547d3a[_0x34df73(0x422)]=_0x58f0d7=>{const _0x491ebd=_0x34df73;var _0x22fca8,_0x59e3ca;return(_0x22fca8=this[_0x491ebd(0x34b)])===null||_0x22fca8===void 0x0||(_0x59e3ca=_0x22fca8[_0x491ebd(0x422)])===null||_0x59e3ca===void 0x0?void 0x0:_0x59e3ca[_0x491ebd(0x46d)](_0x22fca8,_0x58f0d7);},_0x547d3a[_0x34df73(0x243)]=_0x18cdf7=>{const _0x596289=_0x34df73;var _0x29bfd0,_0x268d9a;return(_0x29bfd0=this[_0x596289(0x34b)])===null||_0x29bfd0===void 0x0||(_0x268d9a=_0x29bfd0[_0x596289(0x243)])===null||_0x268d9a===void 0x0?void 0x0:_0x268d9a[_0x596289(0x46d)](_0x29bfd0,_0x18cdf7);},_0x547d3a[_0x34df73(0x46a)]=_0x99cfdd=>{const _0x4c9c74=_0x34df73;var _0x199734,_0x9db343,_0x47885b;if(!((_0x199734=this[_0x4c9c74(0x34b)])===null||_0x199734===void 0x0?void 0x0:_0x199734[_0x4c9c74(0x46a)]))throw new Error(_0x4c9c74(0x267));return(_0x9db343=this[_0x4c9c74(0x34b)])===null||_0x9db343===void 0x0||(_0x47885b=_0x9db343['onTransformRemoteChangesetByIMECache'])===null||_0x47885b===void 0x0?void 0x0:_0x47885b['call'](_0x9db343,_0x99cfdd);},_0x547d3a[_0x34df73(0x3be)]=_0x565422=>{const _0x14b068=_0x34df73;var _0x388eae,_0x55b7dd,_0x238c44;if(!((_0x388eae=this['_handlerCallback'])===null||_0x388eae===void 0x0?void 0x0:_0x388eae['onTransformRemoteChangesetByStateCache']))throw new Error(_0x14b068(0x23e));return(_0x55b7dd=this['_handlerCallback'])===null||_0x55b7dd===void 0x0||(_0x238c44=_0x55b7dd['onTransformRemoteChangesetByStateCache'])===null||_0x238c44===void 0x0?void 0x0:_0x238c44[_0x14b068(0x46d)](_0x55b7dd,_0x565422);},_0x547d3a;}async[_0x54582d(0x2a8)](){const _0x4c2afc=_0x54582d,_0x515e16=await super['_init']();return this[_0x4c2afc(0x47f)](this[_0x4c2afc(0x1b1)]['onMutationExecutedForCollab']((_0x185fdc,_0x4a7a67)=>{const _0x16e15a=_0x4c2afc;if(_0x185fdc[_0x16e15a(0x343)]!==_univerjs_core['CommandType']['MUTATION']||(_0x4a7a67===null||_0x4a7a67===void 0x0?void 0x0:_0x4a7a67[_0x16e15a(0x20c)])||(_0x4a7a67===null||_0x4a7a67===void 0x0?void 0x0:_0x4a7a67[_0x16e15a(0x387)]))return;if(_0x185fdc['id']===_univerjs_docs['RichTextEditingMutation']['id'])return;const _0x581f71=_0x185fdc['params'];if((_0x581f71===null||_0x581f71===void 0x0?void 0x0:_0x581f71[_0x16e15a(0x313)])!==this[_0x16e15a(0x481)])return;const _0x302bc8=_0x185fdc,_0x2bfafb=this['_compressMutationService'][_0x16e15a(0x362)][_0x16e15a(0x1d6)](this[_0x16e15a(0x2b3)]['interceptor'][_0x16e15a(0x207)]()[_0x16e15a(0x36e)])([_0x302bc8],this[_0x16e15a(0x46c)])||[_0x302bc8];this[_0x16e15a(0x1ee)](_0x2bfafb[0x0]);})),_0x515e16;}};DocCollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core['Injector'])),__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration[_0x54582d(0x472)])),__decorateParam(0x5,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x443)])),__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x54582d(0x205)])(CollaborationUIEventService)),__decorateParam(0x8,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0x9,_univerjs_core['ILogService']),__decorateParam(0xa,_univerjs_core['ICommandService']),__decorateParam(0xb,_univerjs_core[_0x54582d(0x247)]),__decorateParam(0xc,(0x0,_univerjs_core[_0x54582d(0x23d)])(ISingleActiveUnitService)),__decorateParam(0xd,(0x0,_univerjs_core['Optional'])(ILocalCacheService))],DocCollaborationEntity);let SheetCollaborationEntity=class SheetCollaborationEntity extends CollaborationEntity{constructor(_0x424fe2,_0x265eff,_0x1ee9ce,_0x5dc947,_0x171ce9,_0x254979,_0x11461b,_0x1a7a6a,_0x18d93e,_0x3f0ae2,_0x277bd6,_0x2464e6,_0x329cb0,_0x49616b,_0x49eb82){const _0xcb0e4b=_0x54582d;super(_0x424fe2,_0x1ee9ce,_0x265eff,_0x5dc947,_0x171ce9,_0x254979,_0x11461b,_0x18d93e,_0x3f0ae2,_0x277bd6,_0x2464e6,_0x329cb0,_0x49616b,_0x49eb82),this[_0xcb0e4b(0x481)]=_0x424fe2,this['type']=_0x265eff,this['_sheetTransformSelectionsService']=_0x1a7a6a;}['_createHandler'](){const _0x2db64c=_0x54582d,_0x2ae3df=super[_0x2db64c(0x2e8)]();return _0x2ae3df[_0x2db64c(0x422)]=_0x28bbba=>this['_sheetTransformSelectionsService'][_0x2db64c(0x198)](_0x28bbba),_0x2ae3df;}async[_0x54582d(0x2a8)](){const _0x25bb10=_0x54582d,_0x421a12=await super[_0x25bb10(0x2a8)]();return this[_0x25bb10(0x47f)](this[_0x25bb10(0x1b1)]['onMutationExecutedForCollab']((_0x57c855,_0x1a17b9)=>{const _0x212920=_0x25bb10;if(_0x57c855[_0x212920(0x343)]!==_univerjs_core[_0x212920(0x2f9)][_0x212920(0x275)]||(_0x1a17b9===null||_0x1a17b9===void 0x0?void 0x0:_0x1a17b9[_0x212920(0x20c)])||(_0x1a17b9===null||_0x1a17b9===void 0x0?void 0x0:_0x1a17b9[_0x212920(0x387)]))return;const _0xbbfbaa=_0x57c855[_0x212920(0x1c6)];if((_0xbbfbaa===null||_0xbbfbaa===void 0x0?void 0x0:_0xbbfbaa['unitId'])!==this[_0x212920(0x481)])return;const _0x55d60b=_0x57c855,_0x5ebc94=this[_0x212920(0x2b3)][_0x212920(0x362)]['fetchThroughInterceptors'](this[_0x212920(0x2b3)][_0x212920(0x362)][_0x212920(0x207)]()[_0x212920(0x36e)])([_0x55d60b],this[_0x212920(0x46c)])||[_0x55d60b];this[_0x212920(0x1ee)](_0x5ebc94[0x0]);})),_0x421a12;}};SheetCollaborationEntity=__decorate([__decorateParam(0x3,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration['CompressMutationService'])),__decorateParam(0x5,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x54582d(0x443)])),__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(_univerjs_pro_collaboration[_0x54582d(0x40c)])),__decorateParam(0x7,(0x0,_univerjs_core[_0x54582d(0x205)])(SheetTransformSelectionsService)),__decorateParam(0x8,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService)),__decorateParam(0x9,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0xa,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0xb,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0xc,_univerjs_core['IPermissionService']),__decorateParam(0xd,(0x0,_univerjs_core['Optional'])(ISingleActiveUnitService)),__decorateParam(0xe,(0x0,_univerjs_core[_0x54582d(0x23d)])(ILocalCacheService))],SheetCollaborationEntity);const INetworkConditionService=(0x0,_univerjs_core[_0x54582d(0x1e1)])(_0x54582d(0x1b6));function _0x1fa5(){const _0x992868=['_initMergeInterceptor','COMPRESS_MUTATION_SEND','CombCmd','_undoStacks','&source=','snapshot','_snapshotService','connection\x20error','_candidateSocket','13474kZFGZh','slice','_queuedRemoteChangesets','m2Prime','FileId','close','RichTextEditingMutation','now','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','resourceIDs','post','not_collab','put','[DataLoaderService]','CollaborationSession','[FetchingMissState]:\x20not\x20expected\x20to\x20receive\x20ack\x20when\x20`this._awaitingChangeset`\x20is\x20null!','updatePermissionObjEvent','onlyLocal','getResourcesRequest','[FetchMissState]','getCurrentUser','SheetPermissionInitController','CollaborativeUndoRedoService','editingUnit','[serializeCombRequest]:\x20should\x20not\x20fall\x20into\x20default\x20branch!','_status$','_onUserJoin','OFFLINE','_httpService','/object','session.room-permission-denied','image/gif','session.join-failed','CONFLICT','getUnitType','originalMeta','_permissionService','_onCombEvent','[UniverCollaborationClientPlugin]:\x20you\x20must\x20provide\x20a\x20socketService\x20implementation\x20in\x20config!','_getCurrentRevision','deleteCollaborator','_imageSourceCache','saveChangeset','status$','splice','MemberService','awaiting_with_pending','removeMember','transformUndoRedo','Quantity','fetchMiss','withCredentials','getActiveSheet','file','USERS_ENTER','updateSnapshot','deserializeToCombResponse','transformChangesets','_clearUndo','getSnapshotAPIPath','getTime','_getRedoStack','_resendTimeout','isInternalEditorID','[CollaborationEntity]:\x20initial\x20state\x20has\x20been\x20created\x20before.\x20You\x20should\x20not\x20call\x20\x22init\x22\x20twice.','UniverCollaborationPlugin','_roomMembers','signUrlServerUrl','fetch_missing','closeSession','_shouldReportTelemetry','AWAITING','onTransformRemoteChangesetByStateCache','_event$','_transformRemoteChangesetByStateCache','_transformStack','_registerDependencies','[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.','/-/object/-/batch_allowed','packageName','save\x20fail\x20reason\x20is\x20','BehaviorSubject','INGEST','_onRecvEvent','_onRemoteACK','UniverNetworkPlugin','OPTIONAL','JOINING','_sessionStatus$','_members','_getUndoStack','_retryCount','href','enableCollaboration','_cfgEnableObjInherit','waitForRoom$','result','onStarting','getImage','dispose$','SNAPSHOT_URL_KEY','/fetchmissing?from=','_rescheduleHeartbeat','_singleActiveUnitService','getConfig','collaborators','error','unit-cache-','univer-pro.collaboration-client-socket-service','onMissedChangesetFetched','complete','30eWDQmv','debug','setCurrentUser','_throwTelemetryCollaborationNewChangeset','awaitingChangeset','members','_updateStatus','MSG_FOR_ERROR','SheetCollaborationEntity','duration','_maxTotalRetryTimeout','startTime','CollaborationImageIoService','values','[CollaborationEntity]','IUniverInstanceService','selections','GLOBAL_ROOMS_CNT_EXCEEDS','_syncEditingCollabCursor','patch','isTransformChangesetsSuccess','generateRandomId','JOIN_ROOM_FULL','location','_timeoutTimer','IImageIoService','loginUrlKey','getCollabEntity','_entities','isPermissionRej','_incrementRevisionNumber','updateOfflineData','[CollaborationUndoRedoService]','IMentionIOService','ERROR_EXCEED_SIZE','CHANGESET_ACK','_toggleOffline','AwaitingWithPendingState','_redoStacks','RevisionService','_getDownloadEndpointURL','_joinRoom','createInstance','capture','CmdRspCode','Disposable','startsWith','listCollaborators','getAllMembers','sid','headers','&to=','DataLoaderService','HEARTBEAT','SheetTransformSelectionsService','CollaborationUIEventId','_fetchMissChangesets','submit\x20changeset\x20error!','onRemoteChangeset','image/jpg','focused$','onTransformSelections','sheets','_snapshotServerService','UnitEmbedded','mapDocumentTypeToUniverInstanceType','_scheduleCollaborationTimeoutTimer','subject','localeService','_injector','_awaitingChangeset','_scheduleCompleteTimestamp','_transformStateCache','BASE64','version','updateCollaborator','allowed','message$','CollaborationController','_unitID','cmd','onload','_listenToNetworkCondition','editing\x20status\x20changed\x20to','CollaborationEvent','delete','workbook','_onMessage','UUID','ISnapshotServerService','_toggleOnline','_stopTelemetryCollaborationNewChangeset','image/png','revision','LocaleService','setShowComponents','default','_remoteChangesetQueue','LocalUndoRedoService','_transformService','getMember','_retryConnectingTimer','method','permissionRejEvent','you\x20should\x20override\x20\x22IUndoRedoService\x22\x20provided\x20in\x20\x22core\x22\x20package!','textEncoder','IContextService','DisposableCollection','collabWebSocketUrl','SUBMIT_CHANGESET','c2Prime','ICollaborationSocketService','NO_OTHER_CLIENTS_EDITING','EmptyMutationInfo','/universer-api/stream/file/upload','_telemetryInfo','cbc','_clearLocalCache','onTransformState','refreshPermission','compose','COMPRESS_MUTATION_APPLY','b64DecodeUnicode','SnapshotServerOverHTTPService','_checkMissing','0.21.1','UPDATE_CURSOR','RECV','_change$','DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','getFocusedUnit','_socketService','_logService','onTransformRemoteChangesetByIMECache','memberID','_univerInstanceService','call','encodeURIComponent','createSocket','function','then','CompressMutationService','length','_onRemoteRejected','collaboratorID','send','getValue','firstValueFrom','_updateLocalCache','action','HEARTBEAT_TIMEOUT','getTypeOfUnitAdded$','SUCCUSS','uniscriptRunEvent','disposeWithMe','/allowed','unitID','UniverCollaborationClientPlugin','?url=','DEFAULT_WS_SESSION_TICKET_URL','unsubscribe','pipe','transformSelections','ReplaySubject','JSONX','339808nOaAhl','serializeCombRequest','emitEvent','PERMISSION_DENIED','[SyncedState]:\x20received\x20rejection.','parse','merge','IDLE','AWAITING_WITH_PENDING','includes','ERROR_IMAGE','ICommandService','_submitChangeset','34pfQMIQ','filter','subUnitId','toggleOffline','[PendingState]:\x20received\x20acknowledgement.','getMemberID','reject','ITransformService','_getCtorByUniverInstanceType','_commandService','list','actions','_transformSelections','UniverLicensePlugin','univer-pro.collaboration-client.network-condition.service','has','sessionStatus','[PendingState]:\x20invalid\x20calling\x20to\x20`resend`.','RETRY_CONNECTING_MAX_COUNT','open$','objectType','PENDING','DEFAULT_COLLAB_WEB_SOCKET_URL','code','[FetchingMissState]:\x20invalid\x20calling\x20to\x20`resend`.','[CollaborationController]:\x20invalid\x20univer\x20type:\x20','_instanceService','subscribe','_pendingMutations','entityInit$','params','requestParams','textRanges','_changesetSessionId','[OfflineState]:\x20received\x20changeset.','_collabSessionService','FETCH_MISSING','getCurrentSelections','synced','RETRY_CONNECTING_MAX_COUNT_KEY','delay','min','\x0aAfter:\x20','encrypt','object','readyForCollab','fetchThroughInterceptors','_eventService','Cannot\x20assemble\x20a\x20changeset\x20from\x20multiple\x20mutations\x20of\x20different\x20types:\x20','_createInitialState','_networkConditionService','take','uuidv4','[CollaborationSessionService]','_onFetchMissResult','[PendingState]:\x20received\x20rejection.','FAIL','createIdentifier','@univerjs-pro/collaboration-client','collaboration-client.config','_onRemoteRetry','_getAPIPrefixPath','toStringTag','uploadFileServerUrl','initWorkbookPermissionChange','96chQPJa','leaveEvent','_clearScheduledTask','charCodeAt','getTypeOfUnitDisposed$','_onLocalMutation','_sendingTimer','_onOffline','This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!','csRejEvent','_commentService','getImageSourceCache','concatBytes','append','add','_clearRedo','UNIVER_SHEET','[CollaborationEntity]:\x20cannot\x20apply\x20missing\x20results\x20on\x20other\x20states!','batchAllowed','shouldCloseConn','joinRsp','src','confirm','onStateChange','loadUnit','userID','_exhaustRemoteChangesetQueue','cfgEnableObjInherit','Inject','eventID','getInterceptPoints','onTransformIME','isArray','ISocketService','baseRev','fromCollab','roomInfos','HEARTBEAT_INTERVAL','WorkbookEditablePermission','CollaborationEntity','toggleOnline','_onConnectionOpen','915639vpyGTw','OfflineState','_resendTimer','NOT_COLLAB','[UniverCollaborationClientPlugin]','HEARTBEAT_TIMEOUT_KEY','isTransformMutationsWithChangesetSuccess','getUnitStatus$','unknown','RxDisposable','HEARTBEAT_INTERVAL_KEY','status','_socket','FETCH_MISS','/universer-api/authz','_emitMembers','_undoRedoService','executeCommand','sessionStatus$','objects','_collaborationSessionService','_members$','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','next','_onUserLeave','error$','OTHER_CLIENTS_EDITING','AwaitingState','range','_initDependencies','/block/','HELLO','JOIN_ROOM_FAILED','_tryReconnect','override','_createSocket','SOCKET_FAILED_RETRY','_roomCreated$','size','_substituteUndoStack','6426260jTGheh','DEFAULT_FILE_NAME','Optional','onTransformRemoteChangesetByStateCache\x20callback\x20is\x20not\x20added\x20yet.','_schedule','_resendWithTimeout','ErrorCode','MentionIoHttpService','onSyncEditingCollabCursor','loadDoc','LIVESHARE_FETCH_OPERATIONS','routeKey','IPermissionService','PendingState','_clearRetryConnectingTimer','_memberService','decorate','/role','csShouldRetryEvent','transformMutationsWithChangeset','INetworkConditionService','[CollaborationSession]:\x20should\x20not\x20send\x20message\x20when\x20the\x20session\x20is\x20offline!','/resources','updatePermissionPoint','loadOfflineData','getCollabEntity$','equals','/universer-api/comb','incrementRevOfUnit','auth.needGotoLoginAlert','create','_sendHeartbeat','replace','_socketReady','resolve','USERS_LEAVE','requireSession','_socket$','changesets','from','Subject','LIVESHARE_TERMINATE','_initRequestHeader','_getLoginPath','onTransformRemoteChangesetByIMECache\x20callback\x20is\x20not\x20added\x20yet.','failed\x20to\x20apply\x20missed\x20changesets!','_getSignURL','InsertSheetMutation','enableSingleActiveInstanceLock','Error\x20on\x20receiving\x20event','responseType','downloadEndpointUrl','saveSnapshot','SUBMIT_CHANGESET_TIMEOUT','FetchingMissState','session.room-not-exists','apply','change$','MUTATION','stringify','init','update','People','PERSON','getLocalCacheKey','ws://127.0.0.1:8000/universer-api/comb/connect','dispose','SheetsSelectionsService','getUnitId','_initUnitPermissionChange','[CollaborationSocketService]:\x20failed\x20to\x20get\x20web\x20socket\x20factory!','fetchMissingChangesets','AuthzIoHttpService','/-/object/list','_commentUpdate$','localCacheService','_localeService','stopTime','fetching\x20the\x20latest\x20document\x20from\x20the\x20server.','?size=','ConflictState','LOCAL_CACHE_INTERVAL','_entityInit$','c1Prime','Injector','_onConflict','SYNCED','CHANGESET_REJ','string','socket\x20close','4iSxDIa','onRemoteAck','_changesetReqId','set','_clearTimeoutTimer','SyncedState','randomBytes','_updateState','/new_changes','IConfigService','3501396rZBYPk','onCommentUpdate','asObservable','CommentService','roles','[PendingState]:\x20unhandled\x20univer\x20type:\x20','_getAPIPrefix','PSEUDO_FETCH_MISSING_RESULT','state$','_init','LIVESHARE_OPERATION','_getSendChangesetTimeout','liveShareNewHost','OTHER_CLIENT_EDITING','ImageUploadStatusType','getSheetBlock','_transitionLocked','liveShareOperation','Tools','CollaborationUIEventService','_compressMutationService','toDisposable','putCollaborators','/collaborator','_tryEnsureSocket','hostname','map','_replayCachedMutations','ONLINE','101755XvxrSp','updateMember','commentUpdateEvent','undefined','clear','Univer','_decreaseWaiting','utf8ToBytes','UPDATE_PERMISSION_OBJ','[CollaborationSessionService]:\x20socket\x20error','SHOULD_CLOSE_CONN','registerHTTPInterceptor','get','defineProperty','reqId','fetching\x20missing\x20changesets\x20from\x20','Rectangle','getDeserializedSheetBlock','parseChangesetToProtocol','_acknowledgedAwaitingChangeset','JOIN_ROOM_NOT_EXISTS','awaiting','addHandlerCallback','getOwnPropertyDescriptor','[CollaborationSession]','_collaborationPaused','onSendChangeset','/universer-api/snapshot/','getUnitOnRev','_substituteRedoStack','_type','fromCharCode','touchDependencies','_onRemoteChangeset','_handler','resend','[CollaborationState]:\x20apply\x20error!','every','[OfflineState]:\x20received\x20rejection.','CHANGESET_SHOULD_RETRY','_doCreateSocket','session.room-cnt-exceeds','UNIVER_DOC','\x0aCurrent:\x20','_createHandler','socketService','_config','IUndoRedoService','_sessions','setConfig','_waitCount','\x20in\x20_schedule.','createCollaborator','socket$','MentionType','_applyRemoteChangeset','event$','shareReplay','/unit/','setCfgEnableObjInherit','enableOfflineEditing','CommandType','members$','isTransformMutationsWithChangesetFailure','18342115ELtsIr','UniverInstanceType','collaboration_new_changeset','body','HTTPService','onRemoteRetry','url','JOIN','getGlobalObject','LIVESHARE_NEW_HOST','/object/','_HTTPService','session','resolveWithBasePath','_socketMessageSubscription','COMMENT_UPDATE','_showConflictNotification','catch','collaboration-client.local-cache-service','_onJoinRoomEvent','_localCacheService','_clearHeartbeatTimer','onMissingChangesets','unitId','getLatestCsReqIdBySid','target','_startCollaboration','CLOSE_ROOM','reconnect','{fileID}','_onConnectionFailed','LEAVE','UNISCRIPT_RUN','HTTPRequest','ILogService','symbol','findIndex','_unlockTransition','reduce','disableLocalCache','takeUntil','Unknown\x20type.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.','appendMutation','\x20-\x20','_unitInfo$','_isPermissionRej','_sender','_state$','transformStack\x20failed!','COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY','_waitForHeartbeatResponse','toString','_createInitialStateImpl','_startTelemetryCollaborationNewChangeset','DependentOn','forEach','mutations','_telemetryService','SetSelectionsOperation','_clearCollaborationTimeoutTimer','_removeRoom','Workbook','[SyncedState]:\x20received\x20acknowledgement.','close$','_executeRemoteChangeset','onRemoteRej','ImageSourceType','_lockTransition','getCurrentRevOfUnit','data','FileSource','type','_initCloseConn','_configService','deepClone','POST','_getUploadFileURL','pauseCollaboration','ITelemetryService','_handlerCallback','find','objectID','IAuthzIoService','PERMISSION_REJ','_collaborationUIEventService','commentUpdate$','getCfgEnableObjInherit','_replaceFileID','reverse','[OfflineState]:\x20invalid\x20calling\x20to\x20`resend`.','DocCollaborationEntity','offline','_state','_sendHeartbeatTimer','name','telemetry\x20info\x20is\x20not\x20initialized','loadUnitOfRevision','push','unit','getSheetId','encode','UNIVER_COLLABORATION_CLIENT_PLUGIN','interceptor','sendChangesetTimeout','addImageSourceCache','_collaborationTimeoutTimer','LIVESHARE_REQUEST_HOST','snapshotServerUrl','state','copyFileMeta','_revisionService','_transformIMECache','updateCursorEvent'];_0x1fa5=function(){return _0x992868;};return _0x1fa5();}function deserializeToCombResponse(_0x2d076d){const _0x375155=_0x54582d,_0x48df0f=_0x2d076d[_0x375155(0x341)],_0x258c80=JSON[_0x375155(0x1a0)](_0x48df0f);switch(_0x258c80[_0x375155(0x435)]){case _univerjs_protocol[_0x375155(0x36f)][_0x375155(0x41a)]:case _univerjs_protocol[_0x375155(0x36f)]['HELLO']:{const _0x5a15ab=_0x258c80['infoRsp'];return{..._0x258c80,'data':_0x5a15ab,'cmd':_0x258c80['cmd']};}case _univerjs_protocol['CombCmd'][_0x375155(0x303)]:{const _0x23f267=_0x258c80[_0x375155(0x1fd)];return{..._0x258c80,'data':_0x23f267,'cmd':_0x258c80[_0x375155(0x435)]};}case _univerjs_protocol[_0x375155(0x36f)][_0x375155(0x464)]:{const _0xd00cc5=_0x258c80['collaMsg'];switch(_0xd00cc5[_0x375155(0x206)]){case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x34f)]:var _0x194b05;return{..._0x258c80,'data':{..._0xd00cc5,'data':(_0x194b05=_0xd00cc5[_0x375155(0x44c)])===null||_0x194b05===void 0x0?void 0x0:_0x194b05['cs']},'cmd':_0x258c80['cmd']};case _univerjs_pro_collaboration[_0x375155(0x439)]['CHANGESET_ACK']:var _0x236103;return{..._0x258c80,'data':{..._0xd00cc5,'data':(_0x236103=_0xd00cc5['csAckEvent'])===null||_0x236103===void 0x0?void 0x0:_0x236103['cs']},'cmd':_0x258c80['cmd']};case _univerjs_pro_collaboration[_0x375155(0x439)]['NEW_CHANGESETS']:var _0x2218ff;return{..._0x258c80,'data':{..._0xd00cc5,'data':(_0x2218ff=_0xd00cc5['newCsEvent'])===null||_0x2218ff===void 0x0?void 0x0:_0x2218ff['cs']},'cmd':_0x258c80['cmd']};case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x292)]:var _0x1a730b;return{..._0x258c80,'data':{..._0xd00cc5,'data':(_0x1a730b=_0xd00cc5[_0x375155(0x1f2)])===null||_0x1a730b===void 0x0?void 0x0:_0x1a730b['cs']},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x2e3)]:var _0x472648;return{..._0x258c80,'data':{..._0xd00cc5,'data':(_0x472648=_0xd00cc5[_0x375155(0x24d)])===null||_0x472648===void 0x0?void 0x0:_0x472648['cs']},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration['CollaborationEvent'][_0x375155(0x463)]:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x36c)]},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)]['USERS_ENTER']:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5['joinEvent']},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration['CollaborationEvent'][_0x375155(0x25e)]:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x1ea)]},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration['CollaborationEvent'][_0x375155(0x305)]:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x2ab)]},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x245)]:case _univerjs_pro_collaboration[_0x375155(0x439)]['LIVESHARE_OPERATION']:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x2b0)]},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)]['LIVESHARE_TERMINATE']:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5['liveShareNewHost']},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x3ec)]:return{..._0x258c80,'data':_0xd00cc5,'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x30b)]:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x2be)]},'cmd':_0x258c80['cmd']};case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x2c4)]:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x386)]},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)][_0x375155(0x2c6)]:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x1fc)]},'cmd':_0x258c80[_0x375155(0x435)]};case _univerjs_pro_collaboration[_0x375155(0x439)]['UNISCRIPT_RUN']:return{..._0x258c80,'data':{..._0xd00cc5,'data':_0xd00cc5[_0x375155(0x47e)]},'cmd':_0x258c80[_0x375155(0x435)]};default:return _0x258c80;}}default:return _0x258c80;}}function serializeCombRequest(_0xfbe623){const _0x4b902e=_0x54582d;switch(_0xfbe623[_0x4b902e(0x435)]){case _univerjs_protocol[_0x4b902e(0x36f)][_0x4b902e(0x41a)]:case _univerjs_protocol['CombCmd'][_0x4b902e(0x232)]:return JSON[_0x4b902e(0x276)]({'cmd':_0xfbe623[_0x4b902e(0x435)],'routeKey':_0xfbe623[_0x4b902e(0x246)]});case _univerjs_protocol[_0x4b902e(0x36f)][_0x4b902e(0x3c8)]:{let _0x267a78;switch(_0xfbe623[_0x4b902e(0x341)]['eventID']){case _univerjs_pro_collaboration[_0x4b902e(0x439)][_0x4b902e(0x463)]:_0x267a78={'eventID':_univerjs_pro_collaboration[_0x4b902e(0x439)][_0x4b902e(0x463)],'updateCursorEvent':_0xfbe623[_0x4b902e(0x341)]['data']};break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x4b902e(0x25e)]:_0x267a78={'eventID':_univerjs_pro_collaboration['CollaborationEvent'][_0x4b902e(0x25e)],'leaveEvent':_0xfbe623[_0x4b902e(0x341)][_0x4b902e(0x341)]};break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x4b902e(0x3ac)]:_0x267a78={'eventID':_univerjs_pro_collaboration[_0x4b902e(0x439)][_0x4b902e(0x3ac)],'joinEvent':_0xfbe623[_0x4b902e(0x341)]['data']};break;case _univerjs_pro_collaboration[_0x4b902e(0x439)]['LIVESHARE_NEW_HOST']:_0x267a78={'eventID':_univerjs_pro_collaboration['CollaborationEvent']['LIVESHARE_NEW_HOST'],'liveShareNewHost':_0xfbe623[_0x4b902e(0x341)]['data']};break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x4b902e(0x2a9)]:_0x267a78={'eventID':_univerjs_pro_collaboration[_0x4b902e(0x439)]['LIVESHARE_OPERATION'],'liveShareOperation':_0xfbe623[_0x4b902e(0x341)][_0x4b902e(0x341)]};break;case _univerjs_pro_collaboration[_0x4b902e(0x439)][_0x4b902e(0x264)]:_0x267a78={'eventID':_univerjs_pro_collaboration[_0x4b902e(0x439)]['LIVESHARE_TERMINATE'],'liveShareTerminate':_0xfbe623[_0x4b902e(0x341)][_0x4b902e(0x341)]};break;case _univerjs_pro_collaboration['CollaborationEvent'][_0x4b902e(0x366)]:_0x267a78={'eventID':_univerjs_pro_collaboration['CollaborationEvent'][_0x4b902e(0x366)],'liveShareRequestHost':_0xfbe623[_0x4b902e(0x341)]['data']};break;case _univerjs_pro_collaboration[_0x4b902e(0x439)][_0x4b902e(0x245)]:_0x267a78={'eventID':_univerjs_pro_collaboration['CollaborationEvent'][_0x4b902e(0x245)]};break;default:_0x267a78={'eventID':_0xfbe623['data'][_0x4b902e(0x206)]};}return JSON[_0x4b902e(0x276)]({'cmd':_0xfbe623[_0x4b902e(0x435)],'routeKey':_0xfbe623[_0x4b902e(0x246)],'collaMsg':_0x267a78});}case _univerjs_protocol[_0x4b902e(0x36f)][_0x4b902e(0x303)]:return JSON[_0x4b902e(0x276)]({'cmd':_0xfbe623[_0x4b902e(0x435)],'routeKey':_0xfbe623[_0x4b902e(0x246)],'joinReq':_0xfbe623[_0x4b902e(0x341)]});case _univerjs_protocol[_0x4b902e(0x36f)][_0x4b902e(0x31b)]:return JSON[_0x4b902e(0x276)]({'cmd':_0xfbe623[_0x4b902e(0x435)],'routeKey':_0xfbe623['routeKey'],'leaveReq':_0xfbe623[_0x4b902e(0x341)]});default:throw new Error(_0x4b902e(0x38e));}}const ICollaborationSocketService=(0x0,_univerjs_core[_0x54582d(0x1e1)])(_0x54582d(0x3e2));function generateSubmitChangesPath(_0x1ce5de,_0x43366d,_0x42f86a){const _0x5784f5=_0x54582d;return _0x1ce5de+'/'+_0x43366d+_0x5784f5(0x2f6)+_0x42f86a+_0x5784f5(0x29d);}let CollaborationSocketService=class CollaborationSocketService extends _univerjs_core[_0x54582d(0x412)]{constructor(_0x382770,_0x2fbfef,_0x3957db,_0x2bf5e9,_0xe6b10f){const _0x3cf455=_0x54582d;super(),this[_0x3cf455(0x42a)]=_0x382770,this[_0x3cf455(0x392)]=_0x2fbfef,this[_0x3cf455(0x345)]=_0x3957db,this[_0x3cf455(0x469)]=_0x2bf5e9,this[_0x3cf455(0x424)]=_0xe6b10f;}[_0x54582d(0x2e4)](_0x4eac08){const _0x14e6f6=_0x54582d,_0x4d9c9a=this[_0x14e6f6(0x42a)][_0x14e6f6(0x2c8)](_univerjs_network[_0x14e6f6(0x20a)]);if(!_0x4d9c9a)throw new Error(_0x14e6f6(0x281));const _0x5acb03=_0x4d9c9a[_0x14e6f6(0x46f)](_0x4eac08);if(!_0x5acb03)throw new Error('[CollaborationSocketService]:\x20failed\x20to\x20create\x20socket!');const _0x521095=new _univerjs_core[(_0x14e6f6(0x450))](),_0x34a51c=new rxjs['Subject']();_0x521095[_0x14e6f6(0x1f7)](_0x5acb03[_0x14e6f6(0x33b)][_0x14e6f6(0x1c3)](_0x7e5f4=>_0x34a51c['next'](_0x7e5f4))),_0x521095[_0x14e6f6(0x1f7)]((0x0,_univerjs_core[_0x14e6f6(0x2b4)])(()=>_0x34a51c[_0x14e6f6(0x3e4)]()));const _0x370f66=new rxjs[(_0x14e6f6(0x263))]();_0x521095['add'](_0x5acb03[_0x14e6f6(0x22c)][_0x14e6f6(0x1c3)](_0x440e23=>_0x370f66[_0x14e6f6(0x22a)](_0x440e23))),_0x521095[_0x14e6f6(0x1f7)]((0x0,_univerjs_core[_0x14e6f6(0x2b4)])(()=>_0x370f66[_0x14e6f6(0x3e4)]()));const _0x485b1e=new rxjs[(_0x14e6f6(0x263))]();_0x521095[_0x14e6f6(0x1f7)](_0x5acb03[_0x14e6f6(0x432)][_0x14e6f6(0x1c3)](_0x1f9493=>{const _0x2fe3f0=_0x14e6f6,_0x4861fa=deserializeToCombResponse(_0x1f9493);_0x485b1e[_0x2fe3f0(0x22a)](_0x4861fa);})),_0x521095[_0x14e6f6(0x1f7)]((0x0,_univerjs_core[_0x14e6f6(0x2b4)])(()=>_0x485b1e[_0x14e6f6(0x3e4)]()));let _0x35b9aa;const _0x36037d=()=>{const _0x303f8d=_0x14e6f6;_0x370f66[_0x303f8d(0x22a)](new Event(_0x303f8d(0x374))),_0x34a51c[_0x303f8d(0x22a)](new Event(_0x303f8d(0x374))),_0x35b9aa[_0x303f8d(0x37b)]();};return _0x35b9aa={'memberID':'','close$':_0x34a51c['asObservable'](),'error$':_0x370f66[_0x14e6f6(0x2a1)](),'open$':_0x5acb03[_0x14e6f6(0x1bb)],'message$':_0x485b1e[_0x14e6f6(0x2a1)](),'send':_0x73a26f=>{const _0x6ba8a9=_0x14e6f6;if(_0x73a26f[_0x6ba8a9(0x435)]===_univerjs_protocol[_0x6ba8a9(0x36f)][_0x6ba8a9(0x3c8)]){if(_0x73a26f[_0x6ba8a9(0x341)][_0x6ba8a9(0x206)]===_univerjs_pro_collaboration[_0x6ba8a9(0x439)][_0x6ba8a9(0x452)]){this[_0x6ba8a9(0x1a7)](_0x35b9aa,_0x73a26f[_0x6ba8a9(0x341)])[_0x6ba8a9(0x30d)](_0x4bca9f=>{const _0x182d41=_0x6ba8a9;this[_0x182d41(0x469)]['error'](_0x4bca9f),_0x36037d();});return;}if(_0x73a26f[_0x6ba8a9(0x341)]['eventID']===_univerjs_pro_collaboration[_0x6ba8a9(0x439)][_0x6ba8a9(0x1cc)]){const _0x364524=_0x73a26f['data'];this['_fetchMissChangesets'](_0x364524)[_0x6ba8a9(0x471)](_0x12b468=>{const _0x3fabc9=_0x6ba8a9;_0x485b1e['next']({'cmd':_univerjs_protocol['CombCmd'][_0x3fabc9(0x464)],'code':_univerjs_protocol[_0x3fabc9(0x411)]['OK'],'routeKey':_0x364524[_0x3fabc9(0x341)][_0x3fabc9(0x481)],'routeType':'','data':{'eventID':_univerjs_pro_collaboration[_0x3fabc9(0x439)][_0x3fabc9(0x2a6)],'data':{'changesets':_0x12b468}}});})[_0x6ba8a9(0x30d)](_0x23a633=>{const _0x5332d5=_0x6ba8a9;this[_0x5332d5(0x469)][_0x5332d5(0x3e0)](_0x23a633),_0x36037d();});return;}}_0x5acb03[_0x6ba8a9(0x476)](serializeCombRequest(_0x73a26f));},'close':()=>{const _0x1d6827=_0x14e6f6;_0x5acb03[_0x1d6827(0x37b)](),_0x521095[_0x1d6827(0x27d)]();}},_0x35b9aa;}async[_0x54582d(0x1a7)](_0x30104d,_0x4894d3){const _0x1a96b7=_0x54582d;var _0x4b603e;const {unitType:_0x5c2773,unitID:_0x3942d4,changeset:_0x3082fb}=_0x4894d3['data'],_0x4bfa93={'unitID':_0x3942d4,'memberID':_0x30104d['memberID'],'type':_0x5c2773,'changeset':(0x0,_univerjs_pro_collaboration[_0x1a96b7(0x2ce)])(_0x3082fb)},_0x321ec9=this[_0x1a96b7(0x345)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x5c5753=generateSubmitChangesPath((_0x4b603e=_0x321ec9===null||_0x321ec9===void 0x0?void 0x0:_0x321ec9['collabSubmitChangesetUrl'])!==null&&_0x4b603e!==void 0x0?_0x4b603e:DEFAULT_COLLAB_SUBMIT_CHANGESET_URL,_0x5c2773,_0x3942d4);try{await this[_0x1a96b7(0x392)][_0x1a96b7(0x380)](_0x5c5753,{'body':_0x4bfa93});}catch(_0x2efa6){this[_0x1a96b7(0x469)][_0x1a96b7(0x3e0)](_0x1a96b7(0x2d4),_0x1a96b7(0x41e));throw _0x2efa6;}}async[_0x54582d(0x41d)](_0x579b4b){const _0x8d4121=_0x54582d,{unitID:_0x5a52f0,from:_0xbab5ee,to:_0x29b852,unitType:_0x25607f}=_0x579b4b[_0x8d4121(0x341)];return(await this[_0x8d4121(0x424)][_0x8d4121(0x282)]({'metadata':void 0x0},{'unitID':_0x5a52f0,'type':_0x25607f,'from':_0xbab5ee,'to':_0x29b852}))[_0x8d4121(0x261)][_0x8d4121(0x2b9)](_0x79ef02=>{const _0xabfa6b=_0x8d4121;if(_0x79ef02[_0xabfa6b(0x334)]===null||_0x79ef02[_0xabfa6b(0x334)]===void 0x0)_0x79ef02[_0xabfa6b(0x334)]=[];return _0x79ef02;});}};CollaborationSocketService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_network[_0x54582d(0x300)])),__decorateParam(0x2,_univerjs_core[_0x54582d(0x29e)]),__decorateParam(0x3,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0x4,_univerjs_pro_collaboration[_0x54582d(0x43e)])],CollaborationSocketService);let CollaborationSessionService=class CollaborationSessionService extends _univerjs_core['Disposable']{get[_0x54582d(0x21f)](){const _0x3b910c=_0x54582d;return this[_0x3b910c(0x260)][_0x3b910c(0x477)]();}constructor(_0x4df983,_0x2eb41e,_0x3ee59c,_0x1e8b5b,_0x5d10b4,_0x44b28e){const _0x1a9851=_0x54582d;super(),this[_0x1a9851(0x42a)]=_0x4df983,this[_0x1a9851(0x469)]=_0x2eb41e,this['_configService']=_0x3ee59c,this[_0x1a9851(0x468)]=_0x1e8b5b,this['_collaborationUIEventService']=_0x5d10b4,this[_0x1a9851(0x1da)]=_0x44b28e,_defineProperty(this,'_socket$',new rxjs[(_0x1a9851(0x3c7))](void 0x0)),_defineProperty(this,_0x1a9851(0x2f1),this[_0x1a9851(0x260)][_0x1a9851(0x2a1)]()),_defineProperty(this,_0x1a9851(0x375),null),_defineProperty(this,_0x1a9851(0x2ec),new Map()),_defineProperty(this,_0x1a9851(0x38f),new rxjs[(_0x1a9851(0x3c7))](SessionStatus['IDLE'])),_defineProperty(this,'status$',this[_0x1a9851(0x38f)][_0x1a9851(0x2a1)]()),_defineProperty(this,'_socketReady',![]),_defineProperty(this,_0x1a9851(0x44a),void 0x0),_defineProperty(this,_0x1a9851(0x3d1),0x0),_defineProperty(this,_0x1a9851(0x359),void 0x0),_defineProperty(this,_0x1a9851(0x3fd),void 0x0),this[_0x1a9851(0x437)]();}['_listenToNetworkCondition'](){const _0x2c0282=_0x54582d;if(!this['_networkConditionService'])return;this[_0x2c0282(0x47f)](this[_0x2c0282(0x1da)]['online$'][_0x2c0282(0x1c3)](_0x50d537=>{const _0x409f69=_0x2c0282;if(_0x50d537&&!this['_socket'])this[_0x409f69(0x318)]();if(!_0x50d537)this[_0x409f69(0x1f0)]();}));}[_0x54582d(0x27d)](){const _0x3cbf35=_0x54582d;super[_0x3cbf35(0x27d)](),this[_0x3cbf35(0x249)](),this[_0x3cbf35(0x299)](),this[_0x3cbf35(0x311)](),this['_sessions'][_0x3cbf35(0x333)](_0x1b13a4=>_0x1b13a4[_0x3cbf35(0x27d)]()),this['_sessions']['clear'](),this[_0x3cbf35(0x38f)][_0x3cbf35(0x3e4)]();}async['requireSession'](_0x5d6ed5){const _0x2b3f01=_0x54582d;if(this[_0x2b3f01(0x2ec)][_0x2b3f01(0x1b7)](_0x5d6ed5))return this[_0x2b3f01(0x2ec)]['get'](_0x5d6ed5);this[_0x2b3f01(0x2b7)]();const _0x158ff7=this[_0x2b3f01(0x42a)]['createInstance'](CollaborationSession,_0x5d6ed5,this[_0x2b3f01(0x260)][_0x2b3f01(0x2a1)]());return this[_0x2b3f01(0x2ec)][_0x2b3f01(0x298)](_0x5d6ed5,_0x158ff7),_0x158ff7;}[_0x54582d(0x3bb)](_0x54d25c){const _0xc90a8d=_0x54582d,_0xcdecff=this[_0xc90a8d(0x2ec)][_0xc90a8d(0x2c8)](_0x54d25c);_0xcdecff&&(this[_0xc90a8d(0x2ec)]['delete'](_0x54d25c),_0xcdecff[_0xc90a8d(0x37b)]());if(!this[_0xc90a8d(0x2ec)][_0xc90a8d(0x239)]){var _0x6a52b7;(_0x6a52b7=this[_0xc90a8d(0x21f)])===null||_0x6a52b7===void 0x0||_0x6a52b7[_0xc90a8d(0x37b)]();}}['reconnect'](){const _0x57868c=_0x54582d;this['_retryCount']=0x0,this['_clearRetryConnectingTimer'](),this[_0x57868c(0x234)]();}[_0x54582d(0x249)](){const _0x1a932d=_0x54582d;this[_0x1a932d(0x44a)]!=null&&(clearTimeout(this[_0x1a932d(0x44a)]),this[_0x1a932d(0x44a)]=null);}async[_0x54582d(0x236)](){const _0x280635=_0x54582d;var _0x4fe2ff;const _0x5817ba=this[_0x280635(0x345)][_0x280635(0x3de)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x1fa1fe=(_0x4fe2ff=_0x5817ba===null||_0x5817ba===void 0x0?void 0x0:_0x5817ba[_0x280635(0x451)])!==null&&_0x4fe2ff!==void 0x0?_0x4fe2ff:DEFAULT_COLLAB_WEB_SOCKET_URL,_0x198a8c=await this[_0x280635(0x468)]['createSocket'](_0x1fa1fe);return this[_0x280635(0x375)]=_0x198a8c,_0x198a8c;}async[_0x54582d(0x2b7)](){const _0x362e2d=_0x54582d;try{var _0x7adbae,_0x1bd9b9;const _0xf80750=(_0x7adbae=(_0x1bd9b9=this[_0x362e2d(0x21f)])!==null&&_0x1bd9b9!==void 0x0?_0x1bd9b9:this[_0x362e2d(0x375)])!==null&&_0x7adbae!==void 0x0?_0x7adbae:await this['_createSocket']();if(_0xf80750){const _0x29bb66=_0xf80750['send'];_0xf80750['send']=_0x2bdc09=>{const _0x56ae9a=_0x362e2d;if(_0x2bdc09['cmd']!==_univerjs_protocol['CombCmd']['LEAVE'])this[_0x56ae9a(0x3dc)]();return _0x29bb66[_0x56ae9a(0x273)](_0xf80750,[_0x2bdc09]);},_0xf80750[_0x362e2d(0x432)][_0x362e2d(0x1c3)](_0x330193=>this[_0x362e2d(0x43c)](_0xf80750,_0x330193)),_0xf80750[_0x362e2d(0x22c)][_0x362e2d(0x197)]((0x0,rxjs_operators['take'])(0x1))[_0x362e2d(0x1c3)](_0x201088=>this['_logService'][_0x362e2d(0x3e0)](_0x362e2d(0x2c5),_0x201088)),_0xf80750[_0x362e2d(0x1bb)][_0x362e2d(0x197)]((0x0,rxjs_operators['take'])(0x1))[_0x362e2d(0x1c3)](()=>{const _0xd1f56d=_0x362e2d;this[_0xd1f56d(0x212)](_0xf80750);}),_0xf80750[_0x362e2d(0x33b)]['pipe']((0x0,rxjs_operators[_0x362e2d(0x1db)])(0x1))[_0x362e2d(0x1c3)](_0x293099=>{const _0x410199=_0x362e2d;this[_0x410199(0x469)][_0x410199(0x3e6)](_0x410199(0x1dd),_0x410199(0x294),_0x293099),this[_0x410199(0x31a)]();});}}catch(_0x32538e){this[_0x362e2d(0x469)][_0x362e2d(0x3e0)](_0x32538e),this[_0x362e2d(0x31a)]();}}['_onConnectionOpen'](_0x10bd9a){const _0x5752e7=_0x54582d;this['_logService'][_0x5752e7(0x3e6)](_0x5752e7(0x1dd),'socket\x20open.'),_0x10bd9a['send']({'cmd':_univerjs_protocol[_0x5752e7(0x36f)][_0x5752e7(0x232)]}),this[_0x5752e7(0x3dc)]();}['_onOffline'](){const _0x3f66ea=_0x54582d;this['_socketReady']=![],this[_0x3f66ea(0x375)]=null,this[_0x3f66ea(0x38f)][_0x3f66ea(0x22a)](SessionStatus[_0x3f66ea(0x391)]),this['_socket$']['next'](null),this['_clearTimeoutTimer'](),this[_0x3f66ea(0x311)]();}[_0x54582d(0x31a)](){const _0x45110b=_0x54582d;var _0x379593;this[_0x45110b(0x1f0)]();if(this['_retryCount']<((_0x379593=this[_0x45110b(0x345)][_0x45110b(0x3de)](_0x45110b(0x1ba)))!==null&&_0x379593!==void 0x0?_0x379593:0x3))this[_0x45110b(0x350)][_0x45110b(0x19d)]({'id':CollaborationUIEventId[_0x45110b(0x237)]}),this['_tryReconnect']();else this['_collaborationUIEventService'][_0x45110b(0x19d)]({'id':CollaborationUIEventId['SOCKET_FAILED']});}[_0x54582d(0x234)](){const _0x5bb9b0=_0x54582d;var _0x2226a4;const _0x1e8046=this[_0x5bb9b0(0x3d1)],_0x38ed92=this['_configService']['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x1fbb66=_0x1e8046===0x0?0x0:((_0x2226a4=_0x38ed92===null||_0x38ed92===void 0x0?void 0x0:_0x38ed92['retryConnectingInterval'])!==null&&_0x2226a4!==void 0x0?_0x2226a4:DEFAULT_RETRY_CONNECTING_INTERVAL)*0x2**_0x1e8046;this[_0x5bb9b0(0x44a)]=setTimeout(()=>{const _0x2a7e0e=_0x5bb9b0;clearTimeout(this[_0x2a7e0e(0x44a)]),this[_0x2a7e0e(0x44a)]=null,this[_0x2a7e0e(0x2b7)]();},_0x1fbb66),this[_0x5bb9b0(0x3d1)]+=0x1;}['_onMessage'](_0x2f541c,_0x2f9a3a){const _0x3defb0=_0x54582d,{cmd:_0x574e54}=_0x2f9a3a;_0x574e54===_univerjs_protocol[_0x3defb0(0x36f)][_0x3defb0(0x232)]&&!this[_0x3defb0(0x25c)]&&(_0x2f541c['memberID']=_0x2f9a3a[_0x3defb0(0x341)][_0x3defb0(0x46b)],this['_socket$'][_0x3defb0(0x22a)](_0x2f541c),this[_0x3defb0(0x38f)][_0x3defb0(0x22a)](SessionStatus[_0x3defb0(0x2bb)]),this['_socketReady']=!![],this[_0x3defb0(0x375)]=null);if(_0x574e54===_univerjs_protocol['CombCmd'][_0x3defb0(0x41a)])this[_0x3defb0(0x299)]();this[_0x3defb0(0x3dc)]();}['_rescheduleHeartbeat'](){const _0x4552ae=_0x54582d;var _0x38e103;this[_0x4552ae(0x311)](),this[_0x4552ae(0x359)]=setTimeout(()=>this[_0x4552ae(0x25a)](),(_0x38e103=this['_configService'][_0x4552ae(0x3de)](_0x4552ae(0x20e)))!==null&&_0x38e103!==void 0x0?_0x38e103:DEFAULT_HEARTBEAT_INTERVAL);}[_0x54582d(0x25a)](){const _0x49d9da=_0x54582d;this[_0x49d9da(0x21f)][_0x49d9da(0x476)]({'cmd':_univerjs_protocol[_0x49d9da(0x36f)]['HEARTBEAT']}),this[_0x49d9da(0x32e)]();}[_0x54582d(0x32e)](){const _0x58e59a=_0x54582d;var _0x354fd0;this[_0x58e59a(0x3fd)]=setTimeout(()=>this[_0x58e59a(0x31a)](),(_0x354fd0=this[_0x58e59a(0x345)]['getConfig'](_0x58e59a(0x47b)))!==null&&_0x354fd0!==void 0x0?_0x354fd0:DEFAULT_HEARTBEAT_TIMEOUT);}['_clearHeartbeatTimer'](){const _0x354d71=_0x54582d;this[_0x354d71(0x359)]!=null&&(clearTimeout(this[_0x354d71(0x359)]),this[_0x354d71(0x359)]=null);}[_0x54582d(0x299)](){const _0x37fc89=_0x54582d;this[_0x37fc89(0x3fd)]!=null&&(clearTimeout(this[_0x37fc89(0x3fd)]),this['_timeoutTimer']=null);}};CollaborationSessionService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x1,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0x2,_univerjs_core[_0x54582d(0x29e)]),__decorateParam(0x3,ICollaborationSocketService),__decorateParam(0x4,(0x0,_univerjs_core[_0x54582d(0x205)])(CollaborationUIEventService)),__decorateParam(0x5,(0x0,_univerjs_core['Optional'])(INetworkConditionService))],CollaborationSessionService);let CollaborationController=class CollaborationController extends _univerjs_core[_0x54582d(0x21c)]{constructor(_0x4b2242,_0xaf6582,_0x41a9a7,_0x4e487a){const _0x2972cb=_0x54582d;var _0x5e419f;super(),this['_injector']=_0x4b2242,this[_0x2972cb(0x1cb)]=_0xaf6582,this[_0x2972cb(0x345)]=_0x41a9a7,this[_0x2972cb(0x46c)]=_0x4e487a,_defineProperty(this,_0x2972cb(0x401),new Map()),_defineProperty(this,'_entityInit$',new rxjs[(_0x2972cb(0x263))]()),_defineProperty(this,_0x2972cb(0x1c5),this[_0x2972cb(0x28d)][_0x2972cb(0x2a1)]());if(((_0x5e419f=this['_configService'][_0x2972cb(0x3de)](_0x2972cb(0x1e3)))===null||_0x5e419f===void 0x0?void 0x0:_0x5e419f[_0x2972cb(0x3d3)])!==![])this[_0x2972cb(0x2a8)]();}[_0x54582d(0x27d)](){const _0x20ffb0=_0x54582d;super[_0x20ffb0(0x27d)](),this['_entities'][_0x20ffb0(0x333)](_0x916608=>_0x916608[_0x20ffb0(0x27d)]()),this[_0x20ffb0(0x401)][_0x20ffb0(0x2c0)]();}[_0x54582d(0x400)](_0x1fc321){var _0x2644c5;return(_0x2644c5=this['_entities']['get'](_0x1fc321))!==null&&_0x2644c5!==void 0x0?_0x2644c5:null;}[_0x54582d(0x254)](_0x1efaf4){const _0x49f550=_0x54582d,_0x155d2c=this[_0x49f550(0x400)](_0x1efaf4);if(_0x155d2c)return(0x0,rxjs['of'])(_0x155d2c);return this[_0x49f550(0x28d)][_0x49f550(0x197)]((0x0,rxjs_operators[_0x49f550(0x1a9)])(_0x5d7389=>_0x5d7389[_0x49f550(0x481)]===_0x1efaf4));}[_0x54582d(0x1d5)](_0x5a09dd){const _0x5ee9aa=_0x54582d;return(0x0,rxjs[_0x5ee9aa(0x478)])(this[_0x5ee9aa(0x254)](_0x5a09dd)[_0x5ee9aa(0x197)]((0x0,rxjs_operators['map'])(()=>void 0x0)));}['_init'](){const _0x21ff06=_0x54582d,_0xbdfce4=0x10;this[_0x21ff06(0x46c)][_0x21ff06(0x47c)](_univerjs_core[_0x21ff06(0x2fd)][_0x21ff06(0x1f9)])[_0x21ff06(0x197)]((0x0,rxjs['takeUntil'])(this[_0x21ff06(0x3d9)]),(0x0,rxjs_operators[_0x21ff06(0x1d0)])(_0xbdfce4))[_0x21ff06(0x1c3)](async _0x447e39=>{const _0x417eee=_0x21ff06,_0x495294=_0x447e39['unit'][_0x417eee(0x27f)](),_0xd5b26c=await this[_0x417eee(0x316)](_0x495294,_univerjs_core[_0x417eee(0x2fd)][_0x417eee(0x1f9)]);this[_0x417eee(0x401)][_0x417eee(0x298)](_0x495294,_0xd5b26c);}),this[_0x21ff06(0x46c)][_0x21ff06(0x47c)](_univerjs_core[_0x21ff06(0x2fd)][_0x21ff06(0x2e6)])['pipe']((0x0,rxjs[_0x21ff06(0x324)])(this[_0x21ff06(0x3d9)]),(0x0,rxjs_operators['delay'])(_0xbdfce4))[_0x21ff06(0x197)]((0x0,rxjs_operators[_0x21ff06(0x1a9)])(_0x5aca16=>{const _0x3fa6d3=_0x21ff06;return!_0x5aca16[_0x3fa6d3(0x35e)][_0x3fa6d3(0x27f)]()[_0x3fa6d3(0x413)]('__');}))['subscribe'](async _0x3d47a1=>{const _0x3466c8=_0x21ff06,_0x5275d3=_0x3d47a1[_0x3466c8(0x35e)]['getUnitId'](),_0x20b2fe=await this[_0x3466c8(0x316)](_0x5275d3,_univerjs_core[_0x3466c8(0x2fd)][_0x3466c8(0x2e6)]);this[_0x3466c8(0x401)][_0x3466c8(0x298)](_0x5275d3,_0x20b2fe);}),(0x0,rxjs['merge'])(this[_0x21ff06(0x46c)]['getTypeOfUnitDisposed$'](_univerjs_core[_0x21ff06(0x2fd)][_0x21ff06(0x1f9)]),this[_0x21ff06(0x46c)][_0x21ff06(0x1ed)](_univerjs_core[_0x21ff06(0x2fd)][_0x21ff06(0x2e6)]))[_0x21ff06(0x197)]((0x0,rxjs[_0x21ff06(0x324)])(this[_0x21ff06(0x3d9)]))['subscribe'](_0x428f99=>{const _0x16f6a6=_0x21ff06,_0x246981=_0x428f99[_0x16f6a6(0x27f)](),_0x3339d5=this[_0x16f6a6(0x401)][_0x16f6a6(0x2c8)](_0x246981);_0x3339d5&&(_0x3339d5[_0x16f6a6(0x27d)](),this[_0x16f6a6(0x401)][_0x16f6a6(0x43a)](_0x246981));});}async[_0x54582d(0x316)](_0x316ff7,_0x4e960a){const _0x294b1b=_0x54582d,_0x2ac2ef=await this['_collabSessionService'][_0x294b1b(0x25f)](_0x316ff7),_0x577aa2=this[_0x294b1b(0x42a)][_0x294b1b(0x40f)](this[_0x294b1b(0x1b0)](_0x4e960a),_0x316ff7,_0x4e960a,_0x2ac2ef);return await _0x577aa2[_0x294b1b(0x277)](),this['_entityInit$'][_0x294b1b(0x22a)](_0x577aa2),_0x577aa2;}[_0x54582d(0x1b0)](_0x53649f){const _0x52ea91=_0x54582d;switch(_0x53649f){case _univerjs_core['UniverInstanceType'][_0x52ea91(0x2e6)]:return DocCollaborationEntity;case _univerjs_core[_0x52ea91(0x2fd)][_0x52ea91(0x1f9)]:return SheetCollaborationEntity;default:throw new Error(_0x52ea91(0x1c1)+_0x53649f);}}};CollaborationController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x54582d(0x205)])(CollaborationSessionService)),__decorateParam(0x2,_univerjs_core[_0x54582d(0x29e)]),__decorateParam(0x3,_univerjs_core['IUniverInstanceService'])],CollaborationController);var name=_0x54582d(0x1e2),version=_0x54582d(0x462);const DEFAULT_FILE_NAME_KEY='DEFAULT_FILE_NAME',UNIVER_DEFAULT_FILE_NAME=_0x54582d(0x2c1);let FileNameController=class FileNameController extends _univerjs_core[_0x54582d(0x412)]{constructor(_0x3d4404,_0x12031a){const _0x50b39a=_0x54582d;super(),this[_0x50b39a(0x46c)]=_0x3d4404,this[_0x50b39a(0x345)]=_0x12031a,this[_0x50b39a(0x2a8)]();}[_0x54582d(0x2a8)](){const _0x5b3ca6=_0x54582d;this[_0x5b3ca6(0x47f)](this[_0x5b3ca6(0x46c)][_0x5b3ca6(0x421)][_0x5b3ca6(0x1c3)](()=>{const _0x49d0af=_0x5b3ca6;var _0x223fba;const _0x4e2228=this['_univerInstanceService'][_0x49d0af(0x467)]();let _0x43d120=(_0x223fba=this[_0x49d0af(0x345)][_0x49d0af(0x3de)](_0x49d0af(0x23c)))!==null&&_0x223fba!==void 0x0?_0x223fba:UNIVER_DEFAULT_FILE_NAME;if(_0x4e2228 instanceof _univerjs_core[_0x49d0af(0x339)])_0x43d120=_0x4e2228[_0x49d0af(0x35a)];document['title']=_0x43d120;}));}};FileNameController=__decorate([__decorateParam(0x0,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0x1,_univerjs_core['IConfigService'])],FileNameController);let AuthServerService=class AuthServerService{constructor(_0x2102e0,_0x331aa9,_0x33b62e){const _0x61742b=_0x54582d;this[_0x61742b(0x345)]=_0x2102e0,this[_0x61742b(0x392)]=_0x331aa9,this[_0x61742b(0x429)]=_0x33b62e,this[_0x61742b(0x277)]();}[_0x54582d(0x277)](){const _0x4efdf2=_0x54582d;this[_0x4efdf2(0x392)][_0x4efdf2(0x2c7)]({'priority':0x1,'interceptor':(_0x41e389,_0x19f616)=>{return _0x19f616(_0x41e389)['pipe']((0x0,rxjs['concatMap'])(async _0x4aba92=>{const _0x4ea0df=_0x598e,_0x39e711=_0x4aba92;if(_0x39e711['status']===0x191){if(typeof window===_0x4ea0df(0x2bf))throw new Error('[AuthServerService]:\x20you\x20should\x20provide\x20authentication\x20info\x20on\x20Node.js.');if(window[_0x4ea0df(0x1ff)](this['localeService']['t'](_0x4ea0df(0x258)))){const _0x14c920=window[_0x4ea0df(0x46e)](window['location'][_0x4ea0df(0x3d2)]);window[_0x4ea0df(0x3fc)][_0x4ea0df(0x3d2)]=this[_0x4ea0df(0x266)]()+_0x4ea0df(0x483)+_0x14c920;}}return _0x39e711;}));}});}['_getLoginPath'](){const _0x3041f7=_0x54582d;var _0x485ef4;const _0x4d4ed9=this[_0x3041f7(0x345)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x485ef4=_0x4d4ed9===null||_0x4d4ed9===void 0x0?void 0x0:_0x4d4ed9[_0x3041f7(0x3ff)])!==null&&_0x485ef4!==void 0x0?_0x485ef4:DEFAULT_LOGIN_URL;}};AuthServerService=__decorate([__decorateParam(0x0,_univerjs_core['IConfigService']),__decorateParam(0x1,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_network['HTTPService'])),__decorateParam(0x2,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core['LocaleService']))],AuthServerService);const DEFAULT_AUTHZ_URL_KEY$1=_0x54582d(0x221);let AuthzIoHttpService=class AuthzIoHttpService extends _univerjs_core[_0x54582d(0x412)]{constructor(_0x4a5a52,_0x35fc87){const _0x3802e6=_0x54582d;super(),this['_HTTPService']=_0x4a5a52,this[_0x3802e6(0x345)]=_0x35fc87,_defineProperty(this,_0x3802e6(0x3d4),![]),this[_0x3802e6(0x36d)]();}[_0x54582d(0x36d)](){const _0x185718=_0x54582d,_0x4ff62e=this;this['disposeWithMe'](this[_0x185718(0x307)]['registerHTTPInterceptor']({'priority':0x3e7,'interceptor':(0x0,_univerjs_network['MergeInterceptorFactory'])({'isMatch'(_0x451e1e){const _0x3f9070=_0x185718;var _0x42be90;if(_0x451e1e[_0x3f9070(0x44b)]===_0x3f9070(0x347)&&((_0x42be90=_0x451e1e[_0x3f9070(0x1c7)])===null||_0x42be90===void 0x0?void 0x0:_0x42be90[_0x3f9070(0x2ff)])){const {objectID:_0x35bb75,objectType:_0x3e1715}=_0x451e1e['requestParams'][_0x3f9070(0x2ff)]||{};if(!_0x35bb75||_0x3e1715===void 0x0)return![];const _0x1a5d5c=_0x4ff62e[_0x3f9070(0x1e5)]()+'/'+_0x3e1715+_0x3f9070(0x306)+_0x35bb75+_0x3f9070(0x480);if(_0x451e1e['url']===_0x1a5d5c)return!![];}return![];},'getParamsFromRequest'(_0x5402f8){var _0x59ab94;return(_0x59ab94=_0x5402f8['requestParams'])===null||_0x59ab94===void 0x0?void 0x0:_0x59ab94['body'];},'mergeParamsToRequest'(_0x37ed4a,_0x3dc6fe){const _0x6bf42d=_0x185718,_0x12e8b7=_0x4ff62e[_0x6bf42d(0x1e5)]()+_0x6bf42d(0x3c4),_0x48dfd3=_0x37ed4a[_0x6bf42d(0x322)]((_0x1745fb,_0x3eba91)=>{const _0x46afb9=_0x6bf42d,{unitID:_0x5bcd4a,objectID:_0x15f8d1,objectType:_0x2963ed,actions:_0x4a9acb}=_0x3eba91;if(!_0x1745fb[_0x5bcd4a])_0x1745fb[_0x5bcd4a]={};if(!_0x1745fb[_0x5bcd4a][_0x15f8d1])_0x1745fb[_0x5bcd4a][_0x15f8d1]={'objectID':_0x15f8d1,'objectType':_0x2963ed,'actions':[]};return _0x1745fb[_0x5bcd4a][_0x15f8d1][_0x46afb9(0x1b3)][_0x46afb9(0x35d)](..._0x4a9acb),_0x1745fb;},{}),_0xec4400=[];for(const _0x1bd064 in _0x48dfd3)for(const _0x36dd82 in _0x48dfd3[_0x1bd064]){const {actions:_0x577fe8,objectType:_0x358fc8}=_0x48dfd3[_0x1bd064][_0x36dd82],_0x3a953d=[...new Set(_0x577fe8)];_0xec4400[_0x6bf42d(0x35d)]({'unitID':_0x1bd064,'objectID':_0x36dd82,'objectType':_0x358fc8,'actions':_0x3a953d});}return new _univerjs_network[(_0x6bf42d(0x31d))]('POST',_0x12e8b7,{'headers':_0x3dc6fe[_0x6bf42d(0x417)],'withCredentials':_0x3dc6fe[_0x6bf42d(0x3a9)],'responseType':_0x3dc6fe[_0x6bf42d(0x26d)],'body':{'requests':_0xec4400}});}},{'distributeResult'(_0x10b820,_0x198d40){const _0x287212=_0x185718,{objectActions:_0x34cc99}=_0x10b820;return _0x198d40[_0x287212(0x2b9)](_0x3fcb19=>{const _0xcc0966=_0x287212,{unitID:_0x330cea,objectID:_0x267a64,actions:_0x24f616}=_0x3fcb19,_0x3f695e=_0x34cc99['find'](_0x2e895e=>_0x2e895e[_0xcc0966(0x481)]===_0x330cea&&_0x2e895e['objectID']===_0x267a64);return{'config':_0x3fcb19,'result':{'actions':_0x24f616[_0xcc0966(0x2b9)](_0x5190f3=>_0x3f695e===null||_0x3f695e===void 0x0?void 0x0:_0x3f695e[_0xcc0966(0x1b3)][_0xcc0966(0x34c)](_0x2a73bb=>_0x2a73bb[_0xcc0966(0x47a)]===_0x5190f3))[_0xcc0966(0x1a9)](_0x27245d=>!!_0x27245d),'error':_0x10b820[_0xcc0966(0x3e0)]}};});}})}));}[_0x54582d(0x1e5)](){const _0x2013b9=_0x54582d;var _0x29f034;const _0x777de1=this[_0x2013b9(0x345)][_0x2013b9(0x3de)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x29f034=_0x777de1===null||_0x777de1===void 0x0?void 0x0:_0x777de1['authzUrl'])!==null&&_0x29f034!==void 0x0?_0x29f034:DEFAULT_AUTHZ_URL_KEY$1;}async[_0x54582d(0x259)](_0x3bfccd){const _0x29214a=_0x54582d,_0x15c2c=this['_getAPIPrefixPath']()+'/'+_0x3bfccd['objectType']+_0x29214a(0x393);return(await this[_0x29214a(0x307)][_0x29214a(0x380)](_0x15c2c,{'body':_0x3bfccd}))[_0x29214a(0x2ff)][_0x29214a(0x34d)]||'';}async[_0x54582d(0x1b2)](_0xf68048){const _0x33f0b7=_0x54582d,_0xcd578c=this[_0x33f0b7(0x1e5)]()+_0x33f0b7(0x284);return(await this[_0x33f0b7(0x307)][_0x33f0b7(0x380)](_0xcd578c,{'body':_0xf68048}))['body'][_0x33f0b7(0x226)];}async[_0x54582d(0x278)](_0x5c3aa1){const _0x40f202=_0x54582d;var _0x44a9c2;const _0x2a83a5=this[_0x40f202(0x1e5)]()+'/'+_0x5c3aa1[_0x40f202(0x1bc)]+_0x40f202(0x306)+_0x5c3aa1[_0x40f202(0x34d)],_0x55c0ed=await this[_0x40f202(0x307)]['put'](_0x2a83a5,{'body':_0x5c3aa1});if((_0x55c0ed===null||_0x55c0ed===void 0x0||(_0x44a9c2=_0x55c0ed[_0x40f202(0x2ff)])===null||_0x44a9c2===void 0x0||(_0x44a9c2=_0x44a9c2[_0x40f202(0x3e0)])===null||_0x44a9c2===void 0x0?void 0x0:_0x44a9c2['code'])!==0x1)throw new Error('Failed\x20to\x20update\x20permission\x20point');}async[_0x54582d(0x431)](_0x383d46){const _0x21c118=_0x54582d,_0x2d717e=this['_getAPIPrefixPath']()+'/'+_0x383d46['objectType']+_0x21c118(0x306)+_0x383d46[_0x21c118(0x34d)]+_0x21c118(0x480);return(await this[_0x21c118(0x307)][_0x21c118(0x380)](_0x2d717e,{'body':_0x383d46}))[_0x21c118(0x2ff)][_0x21c118(0x1b3)];}async[_0x54582d(0x1fb)](_0x23bd09){const _0x4b22fc=_0x54582d,_0x5dbcb8=this[_0x4b22fc(0x1e5)]()+_0x4b22fc(0x3c4);return(await this[_0x4b22fc(0x307)][_0x4b22fc(0x380)](_0x5dbcb8,{'body':{'requests':_0x23bd09}}))[_0x4b22fc(0x2ff)]['objectActions'];}async['listRoles'](_0x1ac417){const _0x5ade9e=_0x54582d,_0x335204=this[_0x5ade9e(0x1e5)]()+'/'+_0x1ac417[_0x5ade9e(0x1bc)]+_0x5ade9e(0x24c),_0x3cd9da=await this['_HTTPService'][_0x5ade9e(0x380)](_0x335204,{'body':_0x1ac417});return{'roles':_0x3cd9da[_0x5ade9e(0x2ff)][_0x5ade9e(0x2a3)],'actions':_0x3cd9da[_0x5ade9e(0x2ff)][_0x5ade9e(0x1b3)]};}async[_0x54582d(0x39e)](_0x1a13f8){const _0x57fc22=_0x54582d,_0x2d51b7=this['_getAPIPrefixPath']()+'/collaborator';await this[_0x57fc22(0x307)]['delete'](_0x2d51b7,{'params':{'collaboratorID':_0x1a13f8[_0x57fc22(0x475)],'objectID':_0x1a13f8[_0x57fc22(0x34d)],'unitID':_0x1a13f8[_0x57fc22(0x481)]}});}async[_0x54582d(0x430)](_0x1fcbef){const _0x1aec9b=_0x54582d,_0x54ce98=this[_0x1aec9b(0x1e5)]()+_0x1aec9b(0x2b6);await this[_0x1aec9b(0x307)][_0x1aec9b(0x3f8)](_0x54ce98,{'body':_0x1fcbef});}async[_0x54582d(0x2f0)](_0x3cd904){const _0x1abbef=_0x54582d,_0x452f7b=this[_0x1abbef(0x1e5)]()+'/collaborator';await this[_0x1abbef(0x307)][_0x1abbef(0x380)](_0x452f7b,{'body':_0x3cd904});}async[_0x54582d(0x414)](_0x106ca9){const _0x15f8ff=_0x54582d;var _0x10bae5;const _0xf1f481=this['_getAPIPrefixPath']()+_0x15f8ff(0x2b6),_0x70c306=await this[_0x15f8ff(0x307)][_0x15f8ff(0x2c8)](_0xf1f481,{'params':{'objectID':_0x106ca9[_0x15f8ff(0x34d)],'unitID':_0x106ca9[_0x15f8ff(0x481)]}});return this['setCfgEnableObjInherit']((_0x10bae5=_0x70c306[_0x15f8ff(0x2ff)][_0x15f8ff(0x204)])!==null&&_0x10bae5!==void 0x0?_0x10bae5:![]),_0x70c306[_0x15f8ff(0x2ff)][_0x15f8ff(0x3df)];}async[_0x54582d(0x2b5)](_0x1a9366){const _0x50db4e=_0x54582d,_0xd9c395=this['_getAPIPrefixPath']()+'/collaborator';await this[_0x50db4e(0x307)][_0x50db4e(0x382)](_0xd9c395,{'body':_0x1a9366});}[_0x54582d(0x2f7)](_0x418bb1){const _0x33abd5=_0x54582d;this[_0x33abd5(0x3d4)]=_0x418bb1;}[_0x54582d(0x352)](){const _0x498c7c=_0x54582d;return this[_0x498c7c(0x3d4)];}};AuthzIoHttpService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_network[_0x54582d(0x300)])),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x54582d(0x29e)]))],AuthzIoHttpService);function base64ToBytes(_0x39992c){const _0x4d8e66=_0x54582d,_0x15d884=atob(_0x39992c),_0x2d031d=new Uint8Array(_0x15d884[_0x4d8e66(0x473)]);for(let _0x5d99df=0x0;_0x5d99df<_0x15d884[_0x4d8e66(0x473)];_0x5d99df++)_0x2d031d[_0x5d99df]=_0x15d884[_0x4d8e66(0x1ec)](_0x5d99df);return _0x2d031d;}function bytesToBase64(_0x22e2b0){const _0x2e42d2=_0x54582d;let _0x142a1f='';for(let _0x38bc0a=0x0;_0x38bc0a<_0x22e2b0[_0x2e42d2(0x473)];_0x38bc0a++)_0x142a1f+=String[_0x2e42d2(0x2db)](_0x22e2b0[_0x38bc0a]);return btoa(_0x142a1f);}function encrypt(_0xf1f3da,_0x5380c3){const _0xba0ecb=_0x54582d,_0x14485b=base64ToBytes(_0x5380c3),_0x155008=(0x0,_noble_ciphers_utils_js[_0xba0ecb(0x29b)])(0x10);return bytesToBase64((0x0,_noble_ciphers_utils_js[_0xba0ecb(0x1f5)])(_0x155008,(0x0,_noble_ciphers_aes_js[_0xba0ecb(0x459)])(_0x14485b,_0x155008)[_0xba0ecb(0x1d3)]((0x0,_noble_ciphers_utils_js[_0xba0ecb(0x2c3)])(_0xf1f3da))));}function getAttachHeader(){const _0x4481c2=_0x54582d,_0x2637ed=(0x0,_univerjs_pro_license[_0x4481c2(0x304)])()['__Key__'];if(typeof window!=='undefined'&&typeof window[_0x4481c2(0x3fc)]!==_0x4481c2(0x2bf)&&_0x2637ed){const _0x5c0d05={'time':Math['floor'](Date[_0x4481c2(0x37d)]()/0x3e8),'domain':location[_0x4481c2(0x2b8)]};return encrypt(JSON[_0x4481c2(0x276)](_0x5c0d05),_0x2637ed);}}let DomainRequestService=class DomainRequestService{constructor(_0x51f870){const _0x8d4c63=_0x54582d;this[_0x8d4c63(0x392)]=_0x51f870,this[_0x8d4c63(0x265)]();}[_0x54582d(0x265)](){const _0x4e0fe0=_0x54582d;this[_0x4e0fe0(0x392)][_0x4e0fe0(0x2c7)]({'interceptor':(_0x577088,_0x5511c0)=>{const _0x5728c6=_0x4e0fe0,_0x4880b7=getAttachHeader();if(_0x4880b7)_0x577088[_0x5728c6(0x417)][_0x5728c6(0x298)]('x-univer-host',_0x4880b7);return _0x5511c0(_0x577088);}});}};DomainRequestService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_network[_0x54582d(0x300)]))],DomainRequestService);let DataLoaderService=class DataLoaderService extends _univerjs_core[_0x54582d(0x21c)]{constructor(_0x1d6f46,_0x962928,_0x2c6081){const _0x3dcc37=_0x54582d;super(),this[_0x3dcc37(0x469)]=_0x1d6f46,this[_0x3dcc37(0x373)]=_0x962928,this[_0x3dcc37(0x310)]=_0x2c6081,_defineProperty(this,_0x3dcc37(0x328),new rxjs[(_0x3dcc37(0x3c7))](null)),_defineProperty(this,'unitInfo$',this[_0x3dcc37(0x328)][_0x3dcc37(0x2a1)]());}async[_0x54582d(0x35c)](_0xb919b3,_0x22ae83,_0x5324ef){const _0x35a0d2=_0x54582d;this[_0x35a0d2(0x328)][_0x35a0d2(0x22a)]({'unitId':_0xb919b3,'type':_0x22ae83});let _0x32eac1=null;switch(_0x22ae83){case _univerjs_core[_0x35a0d2(0x2fd)]['UNIVER_SHEET']:_0x32eac1=await this[_0x35a0d2(0x373)]['loadSheet'](_0xb919b3,_0x5324ef);break;case _univerjs_core['UniverInstanceType'][_0x35a0d2(0x2e6)]:_0x32eac1=await this[_0x35a0d2(0x373)][_0x35a0d2(0x244)](_0xb919b3,_0x5324ef);break;default:this[_0x35a0d2(0x469)]['error'](_0x35a0d2(0x383),_0x35a0d2(0x325));break;}return _0x32eac1;}async[_0x54582d(0x201)](_0x16a3fb,_0x487a46,_0x2f40a3){const _0x577ceb=_0x54582d;var _0x4ada1c;this[_0x577ceb(0x328)][_0x577ceb(0x22a)]({'unitId':_0x16a3fb,'type':_0x487a46,'subUnitId':_0x2f40a3});let _0x5e2af1=0x0;const _0x3b969a=await((_0x4ada1c=this['_localCacheService'])===null||_0x4ada1c===void 0x0?void 0x0:_0x4ada1c['loadOfflineData'](_0x16a3fb));if(_0x3b969a&&(_0x3b969a[_0x577ceb(0x3e9)]||_0x3b969a[_0x577ceb(0x334)][_0x577ceb(0x473)]!==0x0))_0x5e2af1=_0x3b969a['rev'];if(_0x5e2af1===0x0)this[_0x577ceb(0x469)]['debug'](_0x577ceb(0x383),_0x577ceb(0x289));return this[_0x577ceb(0x35c)](_0x16a3fb,_0x487a46,_0x5e2af1);}};DataLoaderService=__decorate([__decorateParam(0x0,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0x1,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_pro_collaboration['SnapshotService'])),__decorateParam(0x2,(0x0,_univerjs_core[_0x54582d(0x23d)])(ILocalCacheService))],DataLoaderService);const ALLOW_IMAGE_LIST=[_0x54582d(0x441),'image/jpeg',_0x54582d(0x420),_0x54582d(0x395),'image/bmp'],ALLOW_IMAGE_SIZE=0x5*0x400*0x400,DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY=_0x54582d(0x457),DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY='/universer-api/file/{fileID}/sign-url';let CollaborationImageIoService=class CollaborationImageIoService{constructor(_0x10ebaa,_0x42ad21,_0x530569){const _0x20bb41=_0x54582d;this[_0x20bb41(0x392)]=_0x10ebaa,this['_configService']=_0x42ad21,this['_univerInstanceService']=_0x530569,_defineProperty(this,_0x20bb41(0x2ee),0x0),_defineProperty(this,_0x20bb41(0x465),new rxjs[(_0x20bb41(0x263))]()),_defineProperty(this,_0x20bb41(0x274),this[_0x20bb41(0x465)]),_defineProperty(this,_0x20bb41(0x39f),new Map());}['setWaitCount'](_0x5cb744){const _0x4c705d=_0x54582d;this[_0x4c705d(0x2ee)]=_0x5cb744,this[_0x4c705d(0x465)][_0x4c705d(0x22a)](_0x5cb744);}[_0x54582d(0x1f4)](_0x3c61bb,_0x3f0fb4){const _0x1310d6=_0x54582d;if(_0x3f0fb4===_univerjs_drawing[_0x1310d6(0x33e)][_0x1310d6(0x42e)]){const _0x3246d2=new Image();return _0x3246d2[_0x1310d6(0x1fe)]=_0x3c61bb,_0x3246d2;}return this[_0x1310d6(0x39f)]['get'](_0x3c61bb);}[_0x54582d(0x364)](_0x2b6710,_0x361c53,_0x1421fd){const _0x3d442a=_0x54582d;if(_0x361c53===_univerjs_drawing[_0x3d442a(0x33e)][_0x3d442a(0x42e)]||_0x1421fd==null)return;this[_0x3d442a(0x39f)][_0x3d442a(0x298)](_0x2b6710,_0x1421fd);}async[_0x54582d(0x3d8)](_0x31aeda){const _0x4936a0=_0x54582d;try{const _0x5b72d2=this[_0x4936a0(0x353)](this[_0x4936a0(0x269)](),''+_0x31aeda),_0x51086b=(await this['_httpService'][_0x4936a0(0x2c8)](_0x5b72d2))['body'];if(_0x51086b[_0x4936a0(0x3e0)]&&_0x51086b[_0x4936a0(0x3e0)][_0x4936a0(0x1bf)]===_univerjs_protocol[_0x4936a0(0x241)]['OK']){const _0x51463e=(0x0,_univerjs_core[_0x4936a0(0x309)])(_0x51086b[_0x4936a0(0x302)],this[_0x4936a0(0x40d)]());return Promise[_0x4936a0(0x25d)](_0x51463e);}return Promise[_0x4936a0(0x1ae)](_0x51086b['error']);}catch(_0x3d3679){return Promise[_0x4936a0(0x1ae)](_0x3d3679);}}async['saveImage'](_0x41395a){const _0x5f0380=_0x54582d;let _0x4d55b3='';if(!ALLOW_IMAGE_LIST[_0x5f0380(0x1a4)](_0x41395a[_0x5f0380(0x343)]))return this[_0x5f0380(0x2c2)](),Promise[_0x5f0380(0x1ae)](new Error(_univerjs_drawing[_0x5f0380(0x2ad)]['ERROR_IMAGE_TYPE']));if(_0x41395a[_0x5f0380(0x239)]>ALLOW_IMAGE_SIZE)return this['_decreaseWaiting'](),Promise[_0x5f0380(0x1ae)](new Error(_univerjs_drawing[_0x5f0380(0x2ad)][_0x5f0380(0x407)]));try{const _0xc25ae9=new FormData();_0xc25ae9[_0x5f0380(0x1f6)](_0x5f0380(0x3ab),_0x41395a);const _0x12b21b=this[_0x5f0380(0x46c)]['getFocusedUnit'](),_0x3f609d=_0x12b21b===null||_0x12b21b===void 0x0?void 0x0:_0x12b21b[_0x5f0380(0x27f)]();if(!_0x3f609d)throw new Error('unitId\x20is\x20not\x20found');const _0xc744eb=this[_0x5f0380(0x348)]()+_0x5f0380(0x28a)+_0x41395a[_0x5f0380(0x239)][_0x5f0380(0x32f)]()+_0x5f0380(0x371)+_univerjs_protocol[_0x5f0380(0x342)][_0x5f0380(0x425)]+'&assign='+encodeURIComponent(_0x3f609d),_0x3d64b7={'body':_0xc25ae9},_0x5cd65f=(await this['_httpService'][_0x5f0380(0x380)](_0xc744eb,_0x3d64b7))[_0x5f0380(0x2ff)];if(typeof _0x5cd65f[_0x5f0380(0x37a)]!=='string')return this[_0x5f0380(0x2c2)](),Promise['reject'](new Error(_univerjs_drawing[_0x5f0380(0x2ad)][_0x5f0380(0x1a5)]));_0x4d55b3=_0x5cd65f['FileId'];}catch(_0x450c3b){return this['_decreaseWaiting'](),Promise[_0x5f0380(0x1ae)](new Error(_univerjs_drawing[_0x5f0380(0x2ad)][_0x5f0380(0x1a5)]));}return new Promise((_0x7f370b,_0x9f6f35)=>{const _0x2ef248=_0x5f0380,_0x4b758f=new FileReader();_0x4b758f['readAsDataURL'](_0x41395a),_0x4b758f[_0x2ef248(0x436)]=_0x549b2e=>{const _0x319adb=_0x2ef248;var _0x114692;const _0x1e8184=(_0x114692=_0x549b2e[_0x319adb(0x315)])===null||_0x114692===void 0x0?void 0x0:_0x114692[_0x319adb(0x3d6)];if(_0x1e8184==null){this[_0x319adb(0x2c2)](),_0x9f6f35(new Error(_univerjs_drawing[_0x319adb(0x2ad)]['ERROR_IMAGE']));return;}_0x7f370b({'imageId':(0x0,_univerjs_core[_0x319adb(0x3fa)])(0x6),'imageSourceType':_univerjs_drawing['ImageSourceType'][_0x319adb(0x43d)],'source':_0x4d55b3,'base64Cache':_0x1e8184,'status':_univerjs_drawing[_0x319adb(0x2ad)][_0x319adb(0x47d)]}),this[_0x319adb(0x2c2)]();};});}[_0x54582d(0x348)](){const _0x1dccb8=_0x54582d;var _0x17646a;const _0x3b7136=this[_0x1dccb8(0x345)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x17646a=_0x3b7136===null||_0x3b7136===void 0x0?void 0x0:_0x3b7136[_0x1dccb8(0x1e7)])!==null&&_0x17646a!==void 0x0?_0x17646a:DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY;}[_0x54582d(0x269)](){const _0x3d29a2=_0x54582d;var _0x2becd5;const _0x54f8fa=this[_0x3d29a2(0x345)][_0x3d29a2(0x3de)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x2becd5=_0x54f8fa===null||_0x54f8fa===void 0x0?void 0x0:_0x54f8fa[_0x3d29a2(0x3b9)])!==null&&_0x2becd5!==void 0x0?_0x2becd5:DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY;}['_getDownloadEndpointURL'](){const _0xaf0aec=_0x54582d;var _0x469082;const _0x2ca210=this['_configService'][_0xaf0aec(0x3de)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x469082=_0x2ca210===null||_0x2ca210===void 0x0?void 0x0:_0x2ca210[_0xaf0aec(0x26e)])!==null&&_0x469082!==void 0x0?_0x469082:location['origin'];}['_replaceFileID'](_0x414cfa,_0x1799f0){const _0x25f8ad=_0x54582d;return _0x414cfa[_0x25f8ad(0x25b)](_0x25f8ad(0x319),_0x1799f0);}[_0x54582d(0x2c2)](){const _0x52f00c=_0x54582d;this['_waitCount']-=0x1,this[_0x52f00c(0x465)][_0x52f00c(0x22a)](this[_0x52f00c(0x2ee)]);}};CollaborationImageIoService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_network[_0x54582d(0x300)])),__decorateParam(0x1,_univerjs_core['IConfigService']),__decorateParam(0x2,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x3f4)]))],CollaborationImageIoService);const DEFAULT_AUTHZ_URL_KEY=_0x54582d(0x221);let MentionIoHttpService=class MentionIoHttpService{constructor(_0x115c86,_0x55d3aa){const _0x5860c5=_0x54582d;this[_0x5860c5(0x345)]=_0x115c86,this[_0x5860c5(0x307)]=_0x55d3aa;}[_0x54582d(0x1e5)](){const _0x5b80ba=_0x54582d;var _0x48ef50;const _0x4c74ff=this[_0x5b80ba(0x345)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x48ef50=_0x4c74ff===null||_0x4c74ff===void 0x0?void 0x0:_0x4c74ff['authzUrl'])!==null&&_0x48ef50!==void 0x0?_0x48ef50:DEFAULT_AUTHZ_URL_KEY;}async['list'](_0x3016ca){const _0x40cd7d=_0x54582d,_0x4912c1=this['_getAPIPrefixPath']()+'/collaborator';return{'list':[{'title':_0x40cd7d(0x279),'mentions':(await this[_0x40cd7d(0x307)][_0x40cd7d(0x2c8)](_0x4912c1,{'params':{'objectID':_0x3016ca[_0x40cd7d(0x313)],'unitID':_0x3016ca[_0x40cd7d(0x313)]}}))['body'][_0x40cd7d(0x3df)]['map'](_0x45acdc=>({'objectId':_0x45acdc['id'],'name':_0x45acdc[_0x40cd7d(0x428)][_0x40cd7d(0x35a)],'metadata':{'icon':_0x45acdc[_0x40cd7d(0x428)]['avatar']},'label':_0x45acdc[_0x40cd7d(0x428)]['name'],'objectType':_univerjs_core['MentionType'][_0x40cd7d(0x27a)]})),'metadata':{},'type':_univerjs_core[_0x40cd7d(0x2f2)][_0x40cd7d(0x27a)]}]};}};MentionIoHttpService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x29e)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_network[_0x54582d(0x300)]))],MentionIoHttpService);let PermissionService=class PermissionService extends _univerjs_core[_0x54582d(0x21c)]{constructor(_0x239b14,_0x4662bf,_0x3aac5a,_0x37e70b,_0x1ecc85){const _0x51f038=_0x54582d;super(),this[_0x51f038(0x42a)]=_0x239b14,this[_0x51f038(0x46c)]=_0x4662bf,this[_0x51f038(0x39a)]=_0x3aac5a,this[_0x51f038(0x227)]=_0x37e70b,this['_collaborationUIEventService']=_0x1ecc85,this[_0x51f038(0x280)](),this['_initCloseConn']();}[_0x54582d(0x344)](){const _0x125812=_0x54582d,_0x5f029a=async _0x350cc4=>{const _0x5f492a=_0x598e;(await this[_0x5f492a(0x227)][_0x5f492a(0x25f)](_0x350cc4))[_0x5f492a(0x2f4)][_0x5f492a(0x197)]((0x0,rxjs_operators[_0x5f492a(0x1a9)])(_0x1fb438=>_0x1fb438[_0x5f492a(0x206)]===_univerjs_pro_collaboration[_0x5f492a(0x439)][_0x5f492a(0x2c6)]),(0x0,rxjs_operators[_0x5f492a(0x324)])(this['dispose$']))[_0x5f492a(0x1c3)](_0x5d39a6=>{const _0x2c6905=_0x5f492a,{reason:_0x1a5daf}=_0x5d39a6[_0x2c6905(0x341)];this[_0x2c6905(0x350)]['emitEvent']({'id':CollaborationUIEventId[_0x2c6905(0x317)],'data':_0x1a5daf}),this[_0x2c6905(0x39a)][_0x2c6905(0x252)](new _univerjs_sheets[(_0x2c6905(0x20f))](_0x350cc4)['id'],![]),this[_0x2c6905(0x227)][_0x2c6905(0x3bb)](_0x350cc4);});};(0x0,rxjs[_0x125812(0x1a1)])(this[_0x125812(0x46c)][_0x125812(0x47c)](_univerjs_core[_0x125812(0x2fd)][_0x125812(0x1f9)]),this[_0x125812(0x46c)][_0x125812(0x47c)](_univerjs_core[_0x125812(0x2fd)][_0x125812(0x2e6)]))['pipe']((0x0,rxjs_operators['map'])(_0x34206e=>_0x34206e[_0x125812(0x35e)][_0x125812(0x27f)]()),(0x0,rxjs_operators[_0x125812(0x1a9)])(_0x43ba88=>!(0x0,_univerjs_core[_0x125812(0x3b5)])(_0x43ba88)),(0x0,rxjs_operators[_0x125812(0x324)])(this[_0x125812(0x3d9)]))[_0x125812(0x1c3)](_0x1c1931=>{_0x5f029a(_0x1c1931);});}[_0x54582d(0x280)](){const _0x2ab2de=_0x54582d,_0x368224=async _0x3d3ef0=>{const _0x5d1f8b=_0x598e,_0x1eaba5=await this[_0x5d1f8b(0x227)][_0x5d1f8b(0x25f)](_0x3d3ef0),_0x38ff8a=this[_0x5d1f8b(0x42a)][_0x5d1f8b(0x2c8)](_univerjs_sheets[_0x5d1f8b(0x38b)]);_0x1eaba5[_0x5d1f8b(0x2f4)][_0x5d1f8b(0x197)]((0x0,rxjs_operators[_0x5d1f8b(0x1a9)])(_0x1e2777=>_0x1e2777[_0x5d1f8b(0x206)]===_univerjs_pro_collaboration[_0x5d1f8b(0x439)]['UPDATE_PERMISSION_OBJ']),(0x0,rxjs_operators[_0x5d1f8b(0x324)])(this[_0x5d1f8b(0x3d9)]))[_0x5d1f8b(0x1c3)](_0x41c452=>{const _0x35a860=_0x5d1f8b,{objectId:_0x30f3cf}=_0x41c452[_0x35a860(0x341)];if(_0x30f3cf===_0x3d3ef0)_0x38ff8a[_0x35a860(0x1e8)](_0x3d3ef0);else _0x38ff8a[_0x35a860(0x45c)](_0x3d3ef0,_0x30f3cf);});};(0x0,rxjs[_0x2ab2de(0x1a1)])(this[_0x2ab2de(0x46c)]['getTypeOfUnitAdded$'](_univerjs_core[_0x2ab2de(0x2fd)][_0x2ab2de(0x1f9)]))[_0x2ab2de(0x197)]((0x0,rxjs_operators[_0x2ab2de(0x2b9)])(_0x417cda=>_0x417cda[_0x2ab2de(0x35e)][_0x2ab2de(0x27f)]()),(0x0,rxjs_operators[_0x2ab2de(0x1a9)])(_0x337570=>!(0x0,_univerjs_core['isInternalEditorID'])(_0x337570)),(0x0,rxjs_operators[_0x2ab2de(0x324)])(this[_0x2ab2de(0x3d9)]))[_0x2ab2de(0x1c3)](_0x1546b5=>{_0x368224(_0x1546b5);});}};PermissionService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x1,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0x2,_univerjs_core[_0x54582d(0x247)]),__decorateParam(0x3,(0x0,_univerjs_core[_0x54582d(0x205)])(CollaborationSessionService)),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(CollaborationUIEventService))],PermissionService);let SnapshotServerOverHTTPService=class SnapshotServerOverHTTPService{constructor(_0x54ba07,_0x26b1c4){const _0x44d1ae=_0x54582d;this[_0x44d1ae(0x345)]=_0x54ba07,this[_0x44d1ae(0x392)]=_0x26b1c4;}async[_0x54582d(0x2d8)](_0x1f0fe2,_0x8bafd8){const _0x379529=_0x54582d;var _0x2582a5;const {unitID:_0x460d6c,type:_0x10ba83,revision:revision=0x0}=_0x8bafd8,_0x26b9a1=this[_0x379529(0x3b1)]()+'/'+_0x10ba83+'/unit/'+_0x460d6c+'/rev/'+revision,_0x40d024=(await this[_0x379529(0x392)][_0x379529(0x2c8)](_0x26b9a1))[_0x379529(0x2ff)],_0x33192c=(_0x2582a5=_0x40d024[_0x379529(0x372)])===null||_0x2582a5===void 0x0?void 0x0:_0x2582a5[_0x379529(0x43b)];if(_0x33192c){const _0x20ef06=_0x33192c===null||_0x33192c===void 0x0?void 0x0:_0x33192c[_0x379529(0x399)];_0x33192c[_0x379529(0x399)]=_univerjs_pro_collaboration[_0x379529(0x44e)]['encode']((0x0,_univerjs_pro_collaboration['b64DecodeUnicode'])(_0x20ef06)),Object['entries'](_0x33192c[_0x379529(0x423)])[_0x379529(0x333)](([,_0x72ccc4])=>{const _0x3dc095=_0x379529,_0x54e6b3=_0x72ccc4[_0x3dc095(0x399)];_0x72ccc4[_0x3dc095(0x399)]=_univerjs_pro_collaboration[_0x3dc095(0x44e)][_0x3dc095(0x360)]((0x0,_univerjs_pro_collaboration[_0x3dc095(0x45f)])(_0x54e6b3));});}return _0x40d024;}async[_0x54582d(0x2ae)](_0x59f653,_0x3e4d75){const _0x2b12e6=_0x54582d,{unitID:_0x2f1484,type:_0x3fd254,blockID:_0x5cb73a}=_0x3e4d75,_0x564033=this[_0x2b12e6(0x2a5)]()+'/'+_0x3fd254+_0x2b12e6(0x2f6)+_0x2f1484+_0x2b12e6(0x231)+_0x5cb73a;return(await this[_0x2b12e6(0x392)][_0x2b12e6(0x2c8)](_0x564033))[_0x2b12e6(0x2ff)];}async[_0x54582d(0x2cd)](_0x579dfe,_0x2fbc7a){const _0x26b33c=_0x54582d,{unitID:_0x1cb4b6,type:_0x5c4dfb,blockID:_0x319cb1}=_0x2fbc7a,_0x452aef=this['_getAPIPrefix']()+_0x26b33c(0x231)+_0x5c4dfb+'/unit/'+_0x1cb4b6+_0x26b33c(0x231)+_0x319cb1;return(await this[_0x26b33c(0x392)][_0x26b33c(0x2c8)](_0x452aef))[_0x26b33c(0x2ff)];}async['fetchMissingChangesets'](_0x108dd4,_0x2230b7){const _0x28d96f=_0x54582d,{unitID:_0x562d84,type:_0x11028a,from:_0xfc3b9d,to:_0x38bf36}=_0x2230b7,_0xd4d54=this[_0x28d96f(0x2a5)]()+'/'+_0x11028a+_0x28d96f(0x2f6)+_0x562d84+_0x28d96f(0x3db)+_0xfc3b9d+_0x28d96f(0x418)+_0x38bf36;return(await this[_0x28d96f(0x392)][_0x28d96f(0x2c8)](_0xd4d54))['body'];}[_0x54582d(0x3b1)](){const _0x1742d9=_0x54582d;var _0xe6a6c;return(_0xe6a6c=this[_0x1742d9(0x345)][_0x1742d9(0x3de)](_0x1742d9(0x3da)))!==null&&_0xe6a6c!==void 0x0?_0xe6a6c:this[_0x1742d9(0x2a5)]();}['_getAPIPrefix'](){const _0x47f3ce=_0x54582d;var _0x37f289;const _0xa8d33c=this['_configService'][_0x47f3ce(0x3de)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x37f289=_0xa8d33c===null||_0xa8d33c===void 0x0?void 0x0:_0xa8d33c[_0x47f3ce(0x367)])!==null&&_0x37f289!==void 0x0?_0x37f289:DEFAULT_SNAPSHOT_SERVER_URL;}async[_0x54582d(0x388)](_0x5f38b1,_0x37828d){const _0x194f7c=_0x54582d,_0x16e0fc=_0x194f7c(0x2d7)+_0x37828d[_0x194f7c(0x343)]+_0x194f7c(0x2f6)+_0x37828d[_0x194f7c(0x481)]+_0x194f7c(0x251);return(await this[_0x194f7c(0x392)][_0x194f7c(0x2c8)](_0x16e0fc,{'params':{'resourceId':JSON['stringify'](_0x37828d[_0x194f7c(0x37f)])}}))[_0x194f7c(0x2ff)];}[_0x54582d(0x26f)](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}[_0x54582d(0x3ad)](){const _0x45317d=_0x54582d;throw new Error(_0x45317d(0x1f1));}['saveSheetBlock'](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}[_0x54582d(0x3a0)](){const _0x52f257=_0x54582d;throw new Error(_0x52f257(0x1f1));}[_0x54582d(0x369)](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}[_0x54582d(0x314)](){const _0x483c90=_0x54582d;throw new Error(_0x483c90(0x1f1));}};SnapshotServerOverHTTPService=__decorate([__decorateParam(0x0,_univerjs_core['IConfigService']),__decorateParam(0x1,(0x0,_univerjs_core[_0x54582d(0x205)])(_univerjs_network[_0x54582d(0x300)]))],SnapshotServerOverHTTPService);let CollaborativeUndoRedoService=class CollaborativeUndoRedoService extends _univerjs_core[_0x54582d(0x447)]{constructor(_0x3269a2,_0x16187e,_0x3debce,_0x442f82,_0x4a35c6){const _0xd6cf01=_0x54582d;super(_0x3269a2,_0x16187e,_0x3debce),this[_0xd6cf01(0x448)]=_0x442f82,this[_0xd6cf01(0x469)]=_0x4a35c6;}[_0x54582d(0x3a6)](_0x1f290b,_0x340dcb){const _0x2ff4a3=_0x54582d,_0x1b9181=this[_0x2ff4a3(0x3d0)](_0x1f290b);if(_0x1b9181)try{const _0x252a1d=this[_0x2ff4a3(0x3c1)](_0x1b9181,_0x340dcb);this[_0x2ff4a3(0x23a)](_0x1f290b,_0x252a1d);}catch(_0x58a666){this[_0x2ff4a3(0x469)][_0x2ff4a3(0x3e0)](_0x2ff4a3(0x405),_0x58a666),this[_0x2ff4a3(0x3b0)](_0x1f290b);}const _0x3adfca=this[_0x2ff4a3(0x3b3)](_0x1f290b);if(_0x3adfca)try{const _0x10c5a4=this[_0x2ff4a3(0x3c1)](_0x3adfca,_0x340dcb);this[_0x2ff4a3(0x2d9)](_0x1f290b,_0x10c5a4);}catch(_0x32cadb){this['_logService']['error'](_0x32cadb),this[_0x2ff4a3(0x1f8)](_0x1f290b);}}['_clearUndo'](_0x544a3d){const _0x3668ae=this['_getUndoStack'](_0x544a3d);_0x3668ae&&(_0x3668ae['length']=0x0,this['_updateStatus']());}[_0x54582d(0x1f8)](_0x553992){const _0x41d005=_0x54582d,_0x502797=this[_0x41d005(0x3b3)](_0x553992);_0x502797&&(_0x502797[_0x41d005(0x473)]=0x0,this[_0x41d005(0x3eb)]());}[_0x54582d(0x23a)](_0x56271f,_0x1072eb){const _0x271374=_0x54582d;this[_0x271374(0x370)]['set'](_0x56271f,_0x1072eb),this['_updateStatus']();}[_0x54582d(0x2d9)](_0x163c7a,_0x28798f){const _0x1c9b41=_0x54582d;this[_0x1c9b41(0x40b)][_0x1c9b41(0x298)](_0x163c7a,_0x28798f),this[_0x1c9b41(0x3eb)]();}[_0x54582d(0x3c1)](_0x3930af,_0x29d734){const _0x140500=_0x54582d,_0x3f7fca=[];let _0x1bd6f9=_0x29d734,_0x36e200=_0x29d734;for(let _0x430c98=_0x3930af[_0x140500(0x473)]-0x1;_0x430c98>=0x0;_0x430c98--){const {unitID:_0x47e1e7,undoMutations:_0x5783e2,redoMutations:_0x19dd53}=_0x3930af[_0x430c98],_0x34d3fe=this[_0x140500(0x448)][_0x140500(0x24e)](_0x1bd6f9,_0x5783e2),_0xe0bf42=this[_0x140500(0x448)][_0x140500(0x24e)](_0x36e200,_0x19dd53);if((0x0,_univerjs_pro_collaboration['isTransformMutationsWithChangesetFailure'])(_0x34d3fe)||(0x0,_univerjs_pro_collaboration[_0x140500(0x2fb)])(_0xe0bf42)){this[_0x140500(0x469)][_0x140500(0x3e0)](_0x140500(0x405),_0x140500(0x32c),_0x34d3fe,_0xe0bf42);break;}_0x1bd6f9=_0x34d3fe[_0x140500(0x28e)],_0x36e200=_0xe0bf42[_0x140500(0x28e)],_0x3f7fca[_0x140500(0x35d)]({'unitID':_0x47e1e7,'undoMutations':_0x34d3fe[_0x140500(0x379)],'redoMutations':_0xe0bf42[_0x140500(0x379)]});}return _0x3f7fca[_0x140500(0x354)]();}};CollaborativeUndoRedoService=__decorate([__decorateParam(0x0,_univerjs_core[_0x54582d(0x3f4)]),__decorateParam(0x1,_univerjs_core[_0x54582d(0x1a6)]),__decorateParam(0x2,_univerjs_core[_0x54582d(0x44f)]),__decorateParam(0x3,_univerjs_pro_collaboration['ITransformService']),__decorateParam(0x4,_univerjs_core[_0x54582d(0x31e)])],CollaborativeUndoRedoService);let UniverCollaborationClientPlugin=class UniverCollaborationClientPlugin extends _univerjs_core['Plugin']{constructor(_0x44c192={},_0x2d66c4,_0x25fb10,_0x2298e0){const _0x9dc909=_0x54582d;super(),this[_0x9dc909(0x2ea)]=_0x44c192,this['_logService']=_0x2d66c4,this[_0x9dc909(0x42a)]=_0x25fb10,this[_0x9dc909(0x345)]=_0x2298e0;const {..._0x3960ac}=(0x0,_univerjs_core[_0x9dc909(0x1a1)])({},defaultPluginConfig,_0x44c192);if(!_0x3960ac[_0x9dc909(0x2e9)])throw new Error(_0x9dc909(0x39c));this['_config']=_0x3960ac,this[_0x9dc909(0x345)][_0x9dc909(0x2ed)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,_0x3960ac);}[_0x54582d(0x3d7)](){const _0x47ab8e=_0x54582d;this[_0x47ab8e(0x3c2)](),this[_0x47ab8e(0x230)]();}[_0x54582d(0x3c2)](){const _0x4338d3=_0x54582d;var _0x160f7f,_0x27a202;if(this[_0x4338d3(0x42a)][_0x4338d3(0x1b7)](_univerjs_core[_0x4338d3(0x2eb)]))this[_0x4338d3(0x469)]['error'](_0x4338d3(0x217),_0x4338d3(0x44d));const _0x359891=(0x0,_univerjs_core['mergeOverrideWithDependencies'])([[_univerjs_core['IUndoRedoService'],{'useClass':CollaborativeUndoRedoService}],[CollaborationSessionService],[MemberService],[SheetTransformSelectionsService],[AuthServerService],[DomainRequestService],[CommentService],[PermissionService],[CollaborationUIEventService],[DataLoaderService],[ICollaborationSocketService,{'useClass':this['_config'][_0x4338d3(0x2e9)]}],[_univerjs_pro_collaboration[_0x4338d3(0x43e)],{'useClass':SnapshotServerOverHTTPService}],[_univerjs_core[_0x4338d3(0x34e)],{'useClass':AuthzIoHttpService}],[_univerjs_drawing[_0x4338d3(0x3fe)],{'useClass':CollaborationImageIoService}],[_univerjs_core[_0x4338d3(0x406)],{'useClass':MentionIoHttpService}],[CollaborationController],[FileNameController]],(_0x160f7f=this[_0x4338d3(0x2ea)])===null||_0x160f7f===void 0x0?void 0x0:_0x160f7f[_0x4338d3(0x235)]);if(!((_0x27a202=this['_config'])===null||_0x27a202===void 0x0?void 0x0:_0x27a202[_0x4338d3(0x26b)])){const _0x1e316d=_0x359891[_0x4338d3(0x320)](([_0x117f16])=>_0x117f16===ISingleActiveUnitService);if(_0x1e316d!==-0x1)_0x359891[_0x4338d3(0x3a2)](_0x1e316d,0x1);}(0x0,_univerjs_core['registerDependencies'])(this[_0x4338d3(0x42a)],_0x359891);}[_0x54582d(0x230)](){const _0x50447c=_0x54582d;var _0x22dd3d,_0x3bbe19;this[_0x50447c(0x42a)][_0x50447c(0x2c8)](_univerjs_network[_0x50447c(0x300)])[_0x50447c(0x2c7)]({'priority':0x14,'interceptor':(0x0,_univerjs_network['ThresholdInterceptorFactory'])({'maxParallel':0x6})});if(!((_0x22dd3d=this['_config'])===null||_0x22dd3d===void 0x0?void 0x0:_0x22dd3d[_0x50447c(0x2f8)])){var _0x8b7489;(_0x8b7489=this[_0x50447c(0x42a)][_0x50447c(0x2c8)](ILocalCacheService,_univerjs_core[_0x50447c(0x3a7)][_0x50447c(0x3cc)]))===null||_0x8b7489===void 0x0||_0x8b7489[_0x50447c(0x323)]();}if((_0x3bbe19=this['_config'])===null||_0x3bbe19===void 0x0?void 0x0:_0x3bbe19['enableAuthServer'])(0x0,_univerjs_core[_0x50447c(0x2dc)])(this[_0x50447c(0x42a)],[[AuthServerService]]);(0x0,_univerjs_core[_0x50447c(0x2dc)])(this[_0x50447c(0x42a)],[[DomainRequestService],[CollaborationController],[PermissionService]]);}};_defineProperty(UniverCollaborationClientPlugin,'pluginName',_0x54582d(0x361)),_defineProperty(UniverCollaborationClientPlugin,_0x54582d(0x3c5),name),_defineProperty(UniverCollaborationClientPlugin,_0x54582d(0x42f),version),UniverCollaborationClientPlugin=__decorate([(0x0,_univerjs_core[_0x54582d(0x332)])(_univerjs_pro_license[_0x54582d(0x1b5)],_univerjs_pro_collaboration[_0x54582d(0x3b7)],_univerjs_network[_0x54582d(0x3cb)]),__decorateParam(0x1,_univerjs_core[_0x54582d(0x31e)]),__decorateParam(0x2,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x54582d(0x28f)])),__decorateParam(0x3,_univerjs_core['IConfigService'])],UniverCollaborationClientPlugin),Object['defineProperty'](exports,_0x54582d(0x283),{'enumerable':!![],'get':function(){return AuthzIoHttpService;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x22e),{'enumerable':!![],'get':function(){return AwaitingState;}}),Object['defineProperty'](exports,_0x54582d(0x40a),{'enumerable':!![],'get':function(){return AwaitingWithPendingState;}}),exports[_0x54582d(0x32d)]=COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,Object[_0x54582d(0x2c9)](exports,_0x54582d(0x433),{'enumerable':!![],'get':function(){return CollaborationController;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x210),{'enumerable':!![],'get':function(){return CollaborationEntity;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x3f1),{'enumerable':!![],'get':function(){return CollaborationImageIoService;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x384),{'enumerable':!![],'get':function(){return CollaborationSession;}}),Object[_0x54582d(0x2c9)](exports,'CollaborationSessionService',{'enumerable':!![],'get':function(){return CollaborationSessionService;}}),Object['defineProperty'](exports,'CollaborationSocketService',{'enumerable':!![],'get':function(){return CollaborationSocketService;}}),exports['CollaborationStatus']=CollaborationStatus,exports[_0x54582d(0x41c)]=CollaborationUIEventId,exports[_0x54582d(0x2b2)]=CollaborationUIEventService,Object[_0x54582d(0x2c9)](exports,_0x54582d(0x38c),{'enumerable':!![],'get':function(){return CollaborativeUndoRedoService;}}),exports[_0x54582d(0x2a2)]=CommentService,Object[_0x54582d(0x2c9)](exports,_0x54582d(0x28b),{'enumerable':!![],'get':function(){return ConflictState;}}),exports[_0x54582d(0x1be)]=DEFAULT_COLLAB_WEB_SOCKET_URL,exports[_0x54582d(0x466)]=DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,exports[_0x54582d(0x484)]=DEFAULT_WS_SESSION_TICKET_URL,Object['defineProperty'](exports,_0x54582d(0x419),{'enumerable':!![],'get':function(){return DataLoaderService;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x356),{'enumerable':!![],'get':function(){return DocCollaborationEntity;}}),Object['defineProperty'](exports,_0x54582d(0x271),{'enumerable':!![],'get':function(){return FetchingMissState;}}),exports[_0x54582d(0x21d)]=HEARTBEAT_INTERVAL_KEY,exports[_0x54582d(0x218)]=HEARTBEAT_TIMEOUT_KEY,exports[_0x54582d(0x454)]=ICollaborationSocketService,exports['ILocalCacheService']=ILocalCacheService,exports[_0x54582d(0x24f)]=INetworkConditionService,exports['ISingleActiveUnitService']=ISingleActiveUnitService,exports['LOCAL_CACHE_INTERVAL']=LOCAL_CACHE_INTERVAL,exports['LOCAL_CACHE_INTERVAL_KEY']=LOCAL_CACHE_INTERVAL_KEY,Object[_0x54582d(0x2c9)](exports,_0x54582d(0x3a3),{'enumerable':!![],'get':function(){return MemberService;}}),Object['defineProperty'](exports,_0x54582d(0x242),{'enumerable':!![],'get':function(){return MentionIoHttpService;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x214),{'enumerable':!![],'get':function(){return OfflineState;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x248),{'enumerable':!![],'get':function(){return PendingState;}}),exports['REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY']=REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,exports[_0x54582d(0x1cf)]=RETRY_CONNECTING_MAX_COUNT_KEY,exports['SessionStatus']=SessionStatus,Object[_0x54582d(0x2c9)](exports,_0x54582d(0x3ed),{'enumerable':!![],'get':function(){return SheetCollaborationEntity;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x41b),{'enumerable':!![],'get':function(){return SheetTransformSelectionsService;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x460),{'enumerable':!![],'get':function(){return SnapshotServerOverHTTPService;}}),Object[_0x54582d(0x2c9)](exports,_0x54582d(0x29a),{'enumerable':!![],'get':function(){return SyncedState;}}),exports['UnitStatus']=UnitStatus,Object[_0x54582d(0x2c9)](exports,_0x54582d(0x482),{'enumerable':!![],'get':function(){return UniverCollaborationClientPlugin;}}),exports[_0x54582d(0x3ae)]=deserializeToCombResponse,exports[_0x54582d(0x27b)]=getLocalCacheKey,exports[_0x54582d(0x19c)]=serializeCombRequest;
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;