@ckeditor/ckeditor5-real-time-collaboration 48.4.0-alpha.0 → 48.4.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/translations/af.js +1 -1
  3. package/dist/translations/af.umd.js +1 -1
  4. package/dist/translations/ar.js +1 -1
  5. package/dist/translations/ar.umd.js +1 -1
  6. package/dist/translations/ast.js +1 -1
  7. package/dist/translations/ast.umd.js +1 -1
  8. package/dist/translations/az.js +1 -1
  9. package/dist/translations/az.umd.js +1 -1
  10. package/dist/translations/be.js +1 -1
  11. package/dist/translations/be.umd.js +1 -1
  12. package/dist/translations/bg.js +1 -1
  13. package/dist/translations/bg.umd.js +1 -1
  14. package/dist/translations/bn.js +1 -1
  15. package/dist/translations/bn.umd.js +1 -1
  16. package/dist/translations/bs.js +1 -1
  17. package/dist/translations/bs.umd.js +1 -1
  18. package/dist/translations/ca.js +1 -1
  19. package/dist/translations/ca.umd.js +1 -1
  20. package/dist/translations/cs.js +1 -1
  21. package/dist/translations/cs.umd.js +1 -1
  22. package/dist/translations/da.js +1 -1
  23. package/dist/translations/da.umd.js +1 -1
  24. package/dist/translations/de-ch.js +1 -1
  25. package/dist/translations/de-ch.umd.js +1 -1
  26. package/dist/translations/de.js +1 -1
  27. package/dist/translations/de.umd.js +1 -1
  28. package/dist/translations/el.js +1 -1
  29. package/dist/translations/el.umd.js +1 -1
  30. package/dist/translations/en-au.js +1 -1
  31. package/dist/translations/en-au.umd.js +1 -1
  32. package/dist/translations/en-gb.js +1 -1
  33. package/dist/translations/en-gb.umd.js +1 -1
  34. package/dist/translations/en.js +1 -1
  35. package/dist/translations/en.umd.js +1 -1
  36. package/dist/translations/eo.js +1 -1
  37. package/dist/translations/eo.umd.js +1 -1
  38. package/dist/translations/es-co.js +1 -1
  39. package/dist/translations/es-co.umd.js +1 -1
  40. package/dist/translations/es.js +1 -1
  41. package/dist/translations/es.umd.js +1 -1
  42. package/dist/translations/et.js +1 -1
  43. package/dist/translations/et.umd.js +1 -1
  44. package/dist/translations/eu.js +1 -1
  45. package/dist/translations/eu.umd.js +1 -1
  46. package/dist/translations/fa.js +1 -1
  47. package/dist/translations/fa.umd.js +1 -1
  48. package/dist/translations/fi.js +1 -1
  49. package/dist/translations/fi.umd.js +1 -1
  50. package/dist/translations/fr.js +1 -1
  51. package/dist/translations/fr.umd.js +1 -1
  52. package/dist/translations/gl.js +1 -1
  53. package/dist/translations/gl.umd.js +1 -1
  54. package/dist/translations/gu.js +1 -1
  55. package/dist/translations/gu.umd.js +1 -1
  56. package/dist/translations/he.js +1 -1
  57. package/dist/translations/he.umd.js +1 -1
  58. package/dist/translations/hi.js +1 -1
  59. package/dist/translations/hi.umd.js +1 -1
  60. package/dist/translations/hr.js +1 -1
  61. package/dist/translations/hr.umd.js +1 -1
  62. package/dist/translations/hu.js +1 -1
  63. package/dist/translations/hu.umd.js +1 -1
  64. package/dist/translations/hy.js +1 -1
  65. package/dist/translations/hy.umd.js +1 -1
  66. package/dist/translations/id.js +1 -1
  67. package/dist/translations/id.umd.js +1 -1
  68. package/dist/translations/it.js +1 -1
  69. package/dist/translations/it.umd.js +1 -1
  70. package/dist/translations/ja.js +1 -1
  71. package/dist/translations/ja.umd.js +1 -1
  72. package/dist/translations/jv.js +1 -1
  73. package/dist/translations/jv.umd.js +1 -1
  74. package/dist/translations/kk.js +1 -1
  75. package/dist/translations/kk.umd.js +1 -1
  76. package/dist/translations/km.js +1 -1
  77. package/dist/translations/km.umd.js +1 -1
  78. package/dist/translations/kn.js +1 -1
  79. package/dist/translations/kn.umd.js +1 -1
  80. package/dist/translations/ko.js +1 -1
  81. package/dist/translations/ko.umd.js +1 -1
  82. package/dist/translations/ku.js +1 -1
  83. package/dist/translations/ku.umd.js +1 -1
  84. package/dist/translations/lt.js +1 -1
  85. package/dist/translations/lt.umd.js +1 -1
  86. package/dist/translations/lv.js +1 -1
  87. package/dist/translations/lv.umd.js +1 -1
  88. package/dist/translations/ms.js +1 -1
  89. package/dist/translations/ms.umd.js +1 -1
  90. package/dist/translations/nb.js +1 -1
  91. package/dist/translations/nb.umd.js +1 -1
  92. package/dist/translations/ne.js +1 -1
  93. package/dist/translations/ne.umd.js +1 -1
  94. package/dist/translations/nl.js +1 -1
  95. package/dist/translations/nl.umd.js +1 -1
  96. package/dist/translations/no.js +1 -1
  97. package/dist/translations/no.umd.js +1 -1
  98. package/dist/translations/oc.js +1 -1
  99. package/dist/translations/oc.umd.js +1 -1
  100. package/dist/translations/pl.js +1 -1
  101. package/dist/translations/pl.umd.js +1 -1
  102. package/dist/translations/pt-br.js +1 -1
  103. package/dist/translations/pt-br.umd.js +1 -1
  104. package/dist/translations/pt.js +1 -1
  105. package/dist/translations/pt.umd.js +1 -1
  106. package/dist/translations/ro.js +1 -1
  107. package/dist/translations/ro.umd.js +1 -1
  108. package/dist/translations/ru.js +1 -1
  109. package/dist/translations/ru.umd.js +1 -1
  110. package/dist/translations/si.js +1 -1
  111. package/dist/translations/si.umd.js +1 -1
  112. package/dist/translations/sk.js +1 -1
  113. package/dist/translations/sk.umd.js +1 -1
  114. package/dist/translations/sl.js +1 -1
  115. package/dist/translations/sl.umd.js +1 -1
  116. package/dist/translations/sq.js +1 -1
  117. package/dist/translations/sq.umd.js +1 -1
  118. package/dist/translations/sr-latn.js +1 -1
  119. package/dist/translations/sr-latn.umd.js +1 -1
  120. package/dist/translations/sr.js +1 -1
  121. package/dist/translations/sr.umd.js +1 -1
  122. package/dist/translations/sv.js +1 -1
  123. package/dist/translations/sv.umd.js +1 -1
  124. package/dist/translations/th.js +1 -1
  125. package/dist/translations/th.umd.js +1 -1
  126. package/dist/translations/ti.js +1 -1
  127. package/dist/translations/ti.umd.js +1 -1
  128. package/dist/translations/tk.js +1 -1
  129. package/dist/translations/tk.umd.js +1 -1
  130. package/dist/translations/tr.js +1 -1
  131. package/dist/translations/tr.umd.js +1 -1
  132. package/dist/translations/tt.js +1 -1
  133. package/dist/translations/tt.umd.js +1 -1
  134. package/dist/translations/ug.js +1 -1
  135. package/dist/translations/ug.umd.js +1 -1
  136. package/dist/translations/uk.js +1 -1
  137. package/dist/translations/uk.umd.js +1 -1
  138. package/dist/translations/ur.js +1 -1
  139. package/dist/translations/ur.umd.js +1 -1
  140. package/dist/translations/uz.js +1 -1
  141. package/dist/translations/uz.umd.js +1 -1
  142. package/dist/translations/vi.js +1 -1
  143. package/dist/translations/vi.umd.js +1 -1
  144. package/dist/translations/zh-cn.js +1 -1
  145. package/dist/translations/zh-cn.umd.js +1 -1
  146. package/dist/translations/zh.js +1 -1
  147. package/dist/translations/zh.umd.js +1 -1
  148. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Context as _0x46d979,ContextPlugin as _0x4b84ca,PendingActions as _0x59ef5c,Plugin as _0x4a73e6}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x370faa,Collection as _0x1cc682,DomEmitterMixin as _0x43bed2,KeystrokeHandler as _0x273b95,global as _0x1f52c4,uid as _0x131976,version as _0x1469c5}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x1ce97b,BodyCollection as _0x1affd0,LabelView as _0x62ed26,ListItemView as _0x13c790,ListView as _0x2600a0,Notification as _0x4a8d3c,View as _0x2cd5dd,clickOutsideHandler as _0x2d8d74}from'@ckeditor/ckeditor5-ui';import{History as _0x47a40c,InsertOperation as _0x23d695,MarkerOperation as _0x5d55fd,ModelLiveRange as _0x1338ff,NoOperation as _0x37d8fe,OperationFactory as _0x3fa583,RootAttributeOperation as _0x1d2c96,transformOperationSets as _0x3ac6dc}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0xfd22db}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x3ad7c2,CommentsService as _0x646c78,EditorService as _0x5b6d29,RevisionHistoryService as _0x59cd19,TrackChangesService as _0x254a7f,User as _0x5ca612,WEB_SOCKET_GATEWAY_STATES as _0x590631,WebSocketGateway as _0x39b97a}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x3e61f8,Users as _0x226ed0}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x588a9a}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x974558,TrackChangesEditing as _0x366e3c}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0xe4ccc3,CommentsEditing as _0x3eb236,CommentsRepository as _0x50e12d}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x5ed346}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x44576b}from'es-toolkit/compat';var z=class WebSocketGateway extends _0x4b84ca{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
- ((()=>_0x39b97a)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0xfd22db,_0x4a8d3c];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x337d50){super(_0x337d50),this['set']('state',_0x590631['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x43bed2())();}init(){const _0x2a4f92=this['context'],_0x1e9c20=_0x2a4f92['plugins']['get'](_0xfd22db),_0x52f9a0=_0x2a4f92['plugins']['get'](_0x4a8d3c);if(!_0x1e9c20['token'])throw new _0x370faa('websocketgateway-missing-token',this);if(!_0x1e9c20['webSocketUrl'])throw new _0x370faa('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),WebSocketGateway['WebSocketGateway']['connect'](_0x1e9c20['token'],_0x1e9c20['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3bab0d=>{if(this['connection']=_0x3bab0d,this['bind']('state')['to'](_0x3bab0d,'state',this,'_isBrowserOffline',(_0x41be20,_0x4d3dfc)=>('connected'!==_0x41be20&&(this['_shouldPluginsReconnect']=!0x0),_0x4d3dfc||_0x41be20!==_0x590631['CONNECTED']?_0x590631['DISCONNECTED']:this['state']==_0x590631['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x590631['CONNECTING']):_0x590631['CONNECTED'])),this['connection']['on']('error',(_0x1c3a63,_0x568dc9)=>{if('limitExceeded'!==_0x568dc9['code'])throw console['error'](_0x568dc9),new _0x370faa('cloudservices-init',null,{'originalError':_0x568dc9});_0x52f9a0['showWarning']('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':'real-time-collaboration'});}),!_0x3bab0d['me'])return new Promise(_0x16d0de=>_0x3bab0d['on']('change:me',_0x16d0de));})['catch'](_0x419b6c=>{throw console['error'](_0x419b6c),new _0x370faa('cloudservices-init',null,{'originalError':_0x419b6c});});}addToReconnectionStack(_0x5b19d1){if('function'!=typeof _0x5b19d1['reconnect'])throw new _0x370faa('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5b19d1))throw new _0x370faa('websocketgateway-plugin-already-registered',this,{'name':_0x5b19d1['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5b19d1);}removeFromReconnectionStack(_0x466ec6){this['_reconnectionStack']['delete'](_0x466ec6);}isInReconnectionStack(_0x4a5f62){return this['_reconnectionStack']['has'](_0x4a5f62);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1c1e39=>_0x1c1e39['reconnect']())))['then'](()=>this['state']=_0x590631['CONNECTED'])['catch'](_0x40f436=>{throw console['error'](_0x40f436),new _0x370faa('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x590631['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},Y=class extends _0x4b84ca{['channelSessions'];channelConnectedUsers;allConnectedUsers;_registeredSessions;_uniqueUsersCount;['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[z,_0x226ed0];}constructor(_0x4211ff){super(_0x4211ff),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1cc682(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x226ed0);}init(){const _0x2239c6=this['context']['plugins']['get'](z);this['listenTo'](_0x2239c6,'change:state',(_0x10824d,_0x5a608a,_0xc494db)=>{if('connected'!==_0xc494db)this['channelSessions']['forEach'](_0x45d008=>_0x45d008['clear']()),this['channelConnectedUsers']['forEach'](_0x2cf9ca=>_0x2cf9ca['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x12c012,_0x5bc67e]of this['_registeredSessions'])for(const _0x4db1f5 of _0x5bc67e)this['_handleSessionAdd'](_0x12c012,_0x4db1f5);}}),this['_createUser'](_0x2239c6['connection']['me'],!0x0);}register(_0x2d759a,_0x40d0be){if(this['_registeredSessions']['has'](_0x2d759a))throw new _0x370faa('sessions-register-already-registered',null,{'channelId':_0x2d759a});this['_registeredSessions']['set'](_0x2d759a,_0x40d0be),this['channelSessions']['set'](_0x2d759a,new _0x1cc682()),this['channelConnectedUsers']['set'](_0x2d759a,new _0x1cc682()),this['listenTo'](_0x40d0be,'add',(_0x30b6df,_0x5bd110)=>this['_handleSessionAdd'](_0x2d759a,_0x5bd110)),this['listenTo'](_0x40d0be,'remove',(_0x50c644,_0x2f84a1)=>this['_handleSessionRemove'](_0x2d759a,_0x2f84a1));for(const _0x4a6a41 of _0x40d0be)this['_handleSessionAdd'](_0x2d759a,_0x4a6a41);}unregister(_0x3aaf5e){if(!this['_registeredSessions']['has'](_0x3aaf5e))throw new _0x370faa('sessions-unregister-not-exist',null,{'channelId':_0x3aaf5e});const _0x3f3465=this['_registeredSessions']['get'](_0x3aaf5e);this['stopListening'](_0x3f3465);for(const _0x1ed076 of _0x3f3465)'connected'===this['context']['plugins']['get'](z)['state']&&this['_handleSessionRemove'](_0x3aaf5e,_0x1ed076);this['_registeredSessions']['delete'](_0x3aaf5e),this['channelSessions']['delete'](_0x3aaf5e),this['channelConnectedUsers']['delete'](_0x3aaf5e);}get['mySessionId'](){return this['context']['plugins']['get'](z)['connection']['sessionId'];}getUserBySessionId(_0x31811c){for(const _0x445dda of this['channelSessions']['values']())for(const _0x5bcf1a of _0x445dda)if(_0x5bcf1a['id']===_0x31811c)return _0x5bcf1a['user'];}getUserSessions(_0x239000,_0x3da7ef){const _0xcae07f=_0x3da7ef?[this['channelSessions']['get'](_0x3da7ef)]:this['channelSessions']['values'](),_0x2bcf71=new Set();for(const _0xaf448b of _0xcae07f)for(const _0x54de6d of _0xaf448b)_0x54de6d['user']['id']===_0x239000['id']&&_0x2bcf71['add'](_0x54de6d['id']);return _0x2bcf71;}getUserRole(_0x2d2fef){for(const _0x4090b8 of this['channelSessions']['values']())for(const _0x4470a1 of _0x4090b8)if(_0x4470a1['user']===_0x2d2fef)return _0x4470a1['role'];}['_handleSessionAdd'](_0x12951a,_0x3822a3){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x1ad64a=_0x3822a3['user'],_0x463f02=this['_users']['getUser'](_0x1ad64a['id'])||this['_createUser'](_0x1ad64a),_0x171619=Object['assign']({},_0x3822a3,{'user':_0x463f02});if(this['channelSessions']['get'](_0x12951a)['add'](_0x171619),!_0x1ad64a['hiddenInPresenceList']){const _0x28b803=this['channelConnectedUsers']['get'](_0x12951a);_0x28b803['has'](_0x463f02['id'])||_0x28b803['add'](_0x463f02),this['allConnectedUsers']['has'](_0x463f02['id'])||_0x1ad64a['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x463f02,_0x463f02['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x12951a,{'channelId':_0x12951a,'session':_0x171619});}['_handleSessionRemove'](_0x8894a3,_0x2fcf3f){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x1e7787=this['channelConnectedUsers']['get'](_0x8894a3),_0x44607c=_0x2fcf3f['user'];_0x44607c['id']&&(this['channelSessions']['get'](_0x8894a3)['remove'](_0x2fcf3f['id']),_0x1e7787['has'](_0x44607c['id'])&&!this['getUserSessions'](_0x44607c,_0x8894a3)['size']&&_0x1e7787['remove'](_0x44607c['id']),this['allConnectedUsers']['get'](_0x44607c['id'])&&!this['getUserSessions'](_0x44607c)['size']&&this['allConnectedUsers']['remove'](_0x44607c['id']));}_createUser(_0x4724d2,_0xdd06c4){const _0x435978=this['_users']['addUser'](_0x4724d2);return _0xdd06c4&&this['_users']['defineMe'](_0x4724d2['id']),_0x435978['orderNumber']=this['_uniqueUsersCount']++,_0x435978;}},K=class extends _0x4a73e6{_domEmitter=new(_0x43bed2())();static get requires(){return[Y];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x562f9a=this['editor'],_0xeb50b9=_0x562f9a['plugins']['get'](Y);_0x562f9a['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x1c0a9a,{writer:_0x2d6cda})=>function(_0x338d88,_0x14d5c1,_0x4b9006,_0x16ddc6){const _0x27486c=_0x338d88['markerName']['split'](':')[0x2],_0x1f83c2=_0x4b9006['getUserBySessionId'](_0x27486c);if(!_0x1f83c2||_0x27486c===_0x4b9006['mySessionId'])return;if(!_0x16ddc6['model']['schema']['checkChild'](_0x338d88['markerRange']['start'],'$text'))return;const _0x3d0db4={'class':'ck-user__marker\x20'+_0x1f83c2['color']['getMarkerClass'](),'style':Q(_0x1f83c2),'data-name':_0x1f83c2['name'],'data-session-id':_0x27486c},_0x73b185=_0x16ddc6['model']['markers']['get'](_0x338d88['markerName'])['getStart'](),_0x246538=_0x73b185['nodeAfter'],_0xd036a1=_0x16ddc6['model']['schema'];if(_0x246538&&_0xd036a1['isObject'](_0x246538)&&_0xd036a1['isInline'](_0x246538)&&!_0x16ddc6['model']['markers']['get']('user:range:'+_0x27486c)['getRange']()['isCollapsed'])return;const _0x2e3022=_0x73b185['parent'];return _0x16ddc6['model']['schema']['isLimit'](_0x2e3022)&&!_0x16ddc6['model']['hasContent'](_0x2e3022)&&(_0x3d0db4['contenteditable']=!0x1),function(_0x534d4f,_0x3dc511,_0x3b0d3e){const _0x526397=_0x534d4f['createUIElement']('span',_0x3dc511);return _0x534d4f['setCustomProperty']('userPositionMarker',!0x0,_0x526397),_0x526397['render']=function(_0x754603){const _0xb5c059=this['toDomElement'](_0x754603),_0x5ebd42=document['createElement']('span');return _0x5ebd42['classList']['add']('ck-user__marker-tooltip'),_0x5ebd42['setAttribute']('contenteditable','false'),_0x5ebd42['setAttribute']('spellcheck','false'),_0x5ebd42['textContent']=_0x3b0d3e['name'],_0xb5c059['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x5ebd42['outerHTML']+'⁠',_0xb5c059['addEventListener']('mouseenter',()=>{_0xb5c059['classList']['add']('ck-user__marker_hovered');}),_0xb5c059['addEventListener']('mouseleave',()=>{_0xb5c059['classList']['remove']('ck-user__marker_hovered');}),_0xb5c059;},_0x526397['isSimilar']=function(_0xacb5a0){return!(!this['getCustomProperty']('userPositionMarker')||!_0xacb5a0['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xacb5a0['getAttribute']('data-session-id'));},_0x526397;}(_0x14d5c1,_0x3d0db4,_0x1f83c2);}(_0x1c0a9a,_0x2d6cda,_0xeb50b9,_0x562f9a)}),_0x562f9a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x2cb1b8=>function(_0xeb25b8,_0x1207fd){const _0x3e53db=_0xeb25b8['markerName']['split'](':')[0x2];if(_0x3e53db===_0x1207fd['mySessionId'])return null;const _0x6462e5=_0x1207fd['getUserBySessionId'](_0x3e53db);return _0x6462e5?{'id':_0x3e53db,'classes':['ck-user__selection',_0x6462e5['color']['getSelectionClass']()],'attributes':{'style':Q(_0x6462e5),'data-session-id':_0x3e53db},'priority':0x7d0+_0x6462e5['orderNumber']}:{'id':_0x3e53db,'classes':[]};}(_0x2cb1b8,_0xeb50b9)}),function(_0x16e863){const _0x49a732=_0x16e863['model'],_0x232239=new Map(),_0x505567=_0x16e863['plugins']['get'](Y);_0x49a732['markers']['on']('update:user:range',(_0x55cd3d,_0x5b9ea0,_0x135f71,_0x161d20)=>{if(!_0x161d20&&_0x232239['get'](_0x5b9ea0['name']))return _0x232239['get'](_0x5b9ea0['name'])['detach'](),void _0x232239['delete'](_0x5b9ea0['name']);const _0xbcdfef=_0x5b9ea0['name']['split'](':')[0x2];if(_0xbcdfef===_0x505567['mySessionId'])return;const _0x1d5d6e='user:position:'+_0xbcdfef;_0x49a732['markers']['has'](_0x1d5d6e)&&_0x16e863['editing']['reconvertMarker'](_0x1d5d6e),_0x5b9ea0['on']('change:range',(_0x11d92a,_0x345cf5,_0x598d16)=>{if('$graveyard'!=_0x345cf5['root']['rootName']&&'$graveyard'==_0x5b9ea0['getRange']()['root']['rootName']&&!_0x232239['has'](_0x5b9ea0['name'])){const _0x3d39e6=_0x49a732['schema']['getNearestSelectionRange'](_0x598d16['deletionPosition']);if(_0x3d39e6){const _0x48fdbc=_0x1338ff['fromRange'](_0x3d39e6);_0x232239['set'](_0x5b9ea0['name'],_0x48fdbc),_0x48fdbc['on']('change:range',(_0x4b580c,_0x1038ca,_0x327b72)=>{if('$graveyard'==_0x48fdbc['root']['rootName']){const _0x30a571=_0x49a732['schema']['getNearestSelectionRange'](_0x327b72['deletionPosition']);_0x30a571?(_0x48fdbc['start']=_0x30a571['start'],_0x48fdbc['end']=_0x30a571['end']):(_0x232239['delete'](_0x5b9ea0['name']),_0x48fdbc['detach']());}});}}});}),_0x49a732['document']['on']('change',()=>{_0x232239['size']>0x0&&_0x49a732['enqueueChange']({'isUndoable':!0x1},_0x134799=>{for(const [_0x3316e2,_0x103c3a]of _0x232239)'$graveyard'==_0x49a732['markers']['get'](_0x3316e2)['getRange']()['root']['rootName']&&(J(_0x3316e2['split'](':')[0x2],_0x103c3a['toRange'](),_0x49a732,_0x134799),_0x103c3a['detach']());_0x232239['clear']();});});}(_0x562f9a),this['_domEmitter']['listenTo'](_0x1f52c4['document'],'keydown',(_0x2d0709,{key:_0x15733a})=>{'Escape'===_0x15733a&&function(_0xec93e2){_0xec93e2['editing']['view']['change'](_0x1c93d1=>{for(const _0x59a622 of _0xec93e2['model']['markers']){if(!_0x59a622['name']['startsWith']('user:position'))continue;const _0x5955cd=_0xec93e2['editing']['mapper']['markerNameToElements'](_0x59a622['name']);if(_0x5955cd){for(const _0x4863c5 of _0x5955cd)_0x1c93d1['removeClass']('ck-user__marker_hovered',_0x4863c5);}}});}(_0x562f9a);},{'useCapture':!0x0});}afterInit(){const _0xc2aae9=this['editor'],_0x23bf6f=_0xc2aae9['commands']['get']('undo');_0x23bf6f&&_0xc2aae9['model']['on']('applyOperation',(_0x3bf599,_0x12b9fa)=>{const _0x2b78fe=_0x12b9fa[0x0];if(!_0x2b78fe['isDocumentOperation'])return;if('marker'!=_0x2b78fe['type']||!_0x2b78fe['name']['startsWith']('user:'))return;const _0xa7d408=_0x2b78fe['batch'];_0x23bf6f['_createdBatches']['has'](_0xa7d408)&&(_0x2b78fe['newRange']=_0x2b78fe['oldRange']?_0xc2aae9['model']['createRange'](_0x2b78fe['oldRange']['start'],_0x2b78fe['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x8e2537=this['editor'],_0x2eab49=_0x8e2537['model']['document'],_0x509c12=_0x8e2537['plugins']['get'](Y);_0x8e2537['model']['enqueueChange']({'isUndoable':!0x1},_0x18cf69=>{const _0xb842f2='user:range:'+_0x509c12['mySessionId'],_0x183823='user:position:'+_0x509c12['mySessionId'],_0x5d31ad=_0x8e2537['model']['markers']['has'](_0xb842f2);_0x8e2537['editing']['view']['hasDomSelection']?J(_0x509c12['mySessionId'],_0x2eab49['selection']['getFirstRange'](),_0x8e2537['model'],_0x18cf69):_0x5d31ad&&(_0x18cf69['removeMarker'](_0xb842f2),_0x18cf69['removeMarker'](_0x183823));});}};function J(_0xac97ea,_0x13e1ca,_0x58c3ba,_0x1fbed1){const _0x2af372='user:range:'+_0xac97ea,_0x33433b='user:position:'+_0xac97ea,_0x35796d=_0x13e1ca['getContainedElement']();let _0x23d6ea=_0x13e1ca['start'];if(_0x35796d&&_0x35796d['is']('element','tableCell')){const _0x19cd33=function(_0x9af3d5,_0x8b9f9d){for(const _0x58861b of _0x9af3d5['getPositions']())if(_0x8b9f9d['schema']['checkChild'](_0x58861b,'$text'))return _0x58861b;}(_0x13e1ca,_0x58c3ba);_0x19cd33&&(_0x23d6ea=_0x19cd33,_0x13e1ca=_0x1fbed1['createRange'](_0x23d6ea));}const _0x2373ea=_0x1fbed1['createRange'](_0x23d6ea);_0x58c3ba['markers']['has'](_0x2af372)?(_0x1fbed1['updateMarker'](_0x2af372,{'range':_0x13e1ca}),_0x1fbed1['updateMarker'](_0x33433b,{'range':_0x2373ea})):(_0x1fbed1['addMarker'](_0x2af372,{'range':_0x13e1ca,'usingOperation':!0x0}),_0x1fbed1['addMarker'](_0x33433b,{'range':_0x2373ea,'usingOperation':!0x0}));}function Q(_0x4bf139){return'--ck-user-color:'+_0x4bf139['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x4bf139['color']['getColorAlphaVariable']()+';';}function X(_0x4c04ec,_0x577866,_0x486b6d){const _0x5e271e=_0x4c04ec['t'],t=_0x4c04ec['t'];switch(_0x577866){case'PENDING_ACTION_SENDING_DATA':return t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'});case'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'Synchronization\x20issue':return t('Synchronization\x20issue');case'Connected\x20users\x20list\x20dropdown\x20menu':return t('Connected\x20users\x20list\x20dropdown\x20menu');case'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':return t('Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)');case'Connected\x20users\x20list':return t('Connected\x20users\x20list');case'PENDING_ACTION_REVISION_HISTORY':return _0x5e271e({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'CONNECTED_USERS':return t({'string':'1\x20connected\x20user\x20(me)','plural':'%0\x20connected\x20users','id':'CONNECTED_USERS'},_0x486b6d);default:return'';}}let Z=0x1;var tt=class RealTimeCollaborationClient extends _0x4a73e6{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
- ((()=>_0x3ad7c2)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[z,Y,K,_0x59ef5c,_0x226ed0,_0x4a8d3c];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get cloudDocumentVersion(){return this['_lastServerVersion']+this['_offset'];}get _lastServerVersion(){return this['serverHistory']['version']-this['_offset'];}get lastSyncVersion(){const _0x134538=this['serverHistory']['getOperations']();for(let _0x4d74eb=_0x134538['length']-0x1;_0x4d74eb>=0x0;_0x4d74eb--){const _0xcd105c=_0x134538[_0x4d74eb];if(!this['_disconnectionOperations']['has'](_0xcd105c))return _0xcd105c['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x11b684){if(super(_0x11b684),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x47a40c(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x370faa('collaboration-missing-channelid',this);const _0x3da9fc=_0x11b684['config']['get']('cloudServices.bundleVersion')||_0x1469c5;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x3da9fc,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x588a9a(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new it(this['_disconnectionOperations']);}init(){const _0x27bab5=this['editor'],_0x36ce5e=_0x27bab5['plugins']['get'](_0x226ed0),_0x522072=_0x27bab5['plugins']['get'](z);this['listenTo'](_0x36ce5e,'getOperationAuthor',(_0x4734f2,_0x21263e)=>{const _0x40021c=_0x21263e[0x0];_0x40021c['_authorId']&&(_0x4734f2['return']=_0x36ce5e['getUser'](_0x40021c['_authorId']),_0x4734f2['stop']()),null===_0x40021c['_authorId']&&(_0x4734f2['return']=null,_0x4734f2['stop']());},{'priority':'high'}),this['listenTo'](_0x27bab5['model']['document']['selection'],'change:range',(_0x4bfef1,_0x41a74d)=>{_0x41a74d['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x27bab5['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x27bab5['model']['on']('applyOperation',(_0x2c931f,_0xd4a3ac)=>{const _0x4bfd5d=_0xd4a3ac[0x0];_0x4bfd5d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4bfd5d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x522072,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x3eec19,_0x1beccb,_0x22c5a8)=>'connected'===_0x3eec19&&!_0x1beccb&&!_0x22c5a8),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x27bab5['disableReadOnlyMode']('rtc-offline'):_0x27bab5['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x27bab5['disableReadOnlyMode']('rtc-offline'):_0x27bab5['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x488d0f=this['editor']['plugins']['get'](Y),_0x547be3=this['editor']['plugins']['get'](z);try{this['_isPendingUpdate']=!0x0,_0x488d0f['unregister'](this['_channelId']);const _0x44011e=await this['_service']['reconnect'](_0x547be3['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x44011e)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x117611=await this['_service']['getConnectedSessions']();_0x488d0f['register'](this['_channelId'],_0x117611),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x32f4fa){if(function(_0x253a63){return'404'===_0x253a63['code'];}(_0x32f4fa)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x327e0f){return'409'===_0x327e0f['code'];}(_0x32f4fa)){const _0x425e1f=X(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x425e1f);}else{if(!(_0x32f4fa instanceof et))throw _0x32f4fa;this['_handleReconnectionError']();}}}}destroy(){const _0x15a3e5=this['editor']['plugins']['get'](z),_0x225808=this['editor']['plugins']['get'](Y);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x225808['channelSessions']['has'](this['_channelId'])&&_0x225808['unregister'](this['_channelId']),_0x15a3e5['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x515946){if(this['sessionId']!==_0x515946['sessionId']&&this['_lastSyncedOperationId']!==_0x515946['lastOperationId'])throw new et();return this['sessionId']=_0x515946['sessionId'],this['_handleServerResponse']([],{..._0x515946,'wereChangesApplied':!0x1,'data':_0x515946['data']},'reconnect');}async _connectService(_0xf9cf3e,_0x7746a5=!0x1){const {connection:_0x42eeed}=this['editor']['plugins']['get'](z);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x42eeed,this['_channelId'])['then'](_0x419a4b=>this['_initSessionsHandling'](_0x419a4b))['catch'](_0x1fa717=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1fa717);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x10a335,_0x1c61a5)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1c61a5);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x208223=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xf9cf3e);this['_isPendingUpdate']=!0x0;const _0x52a383=await this['_service']['connect'](_0x42eeed,this['_compressOperations'](_0xf9cf3e),_0x208223);if(this['sessionId']=_0x52a383['sessionId'],_0x7746a5){if(!_0x52a383['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x52a383['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0xf9cf3e,_0x52a383,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x52a383,_0xf9cf3e);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x4ae183=this['editor']['plugins']['get'](Y),_0x19e50c=this['editor']['plugins']['get'](K),_0x24cae6=_0x4ae183['channelSessions']['get'](this['_channelId']);_0x24cae6&&_0x24cae6['length']>0x1?_0x19e50c['createUserMarkerOperations']():this['listenTo'](_0x4ae183,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4ae183['channelSessions']['get'](this['_channelId'])['length']&&_0x19e50c['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x2c7c22,_0x5e97d3,_0x26a4d9,_0x40d43f){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x5e97d3){const _0x50ae44=this['_decompressOperations'](_0x26a4d9,_0x40d43f);await this['_fetchMissingUsers'](_0x50ae44),this['_handleExternalOperations'](_0x50ae44,_0x5e97d3,_0x26a4d9['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x49b0d1}=this['editor'];let _0x1ef147;try{_0x1ef147=await this['_service']['getDocumentDetails']();}catch{const _0x41780a=X(_0x49b0d1,'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x41780a);}const _0x1b18c0=_0x1ef147['currentDocumentSession']||_0x1ef147['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x1b18c0['lastOperationId']){const _0x3f761a=X(_0x49b0d1,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x3f761a);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x7abe4e=this['editor']['plugins']['get'](z);if(this['_isConnected']=!0x1,!_0x7abe4e['connection']||'connected'!==_0x7abe4e['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x548dcf=this['editor']['plugins']['get'](Y);_0x548dcf['channelSessions']['has'](this['_channelId'])&&_0x548dcf['unregister'](this['_channelId']),_0x7abe4e['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x12fa84){const _0xc691a5=this['editor']['plugins']['get'](Y);this['listenTo'](_0xc691a5,'sessionAdd:'+this['_channelId'],(_0x1c627f,{session:_0x40a973})=>{if(_0x40a973['id']===_0xc691a5['mySessionId']){_0x1c627f['off']();const _0x5c3132=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x27acbd=_0x40a973['permissions'];_0x5c3132&&_0x5c3132['isEnabled']&&(_0x27acbd=_0x27acbd['filter'](_0x278900=>'document:write'!==_0x278900)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x27acbd,this['_channelId']);}}),_0xc691a5['register'](this['_channelId'],_0x12fa84);}_initThrowingOnDataSet(){const _0x7b3faf=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x31dec2)=>{if(!_0x31dec2[_0x31dec2['length']-0x1]['suppressErrorInCollaboration'])throw new _0x370faa('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x7b3faf['apply'](this['editor']['data'],_0x31dec2);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x434088,[_0x3d9b26])=>{if(this['_document']['version'])throw new _0x370faa('realtimecollaborationclient-init-document-already-initialized',this);_0x434088['stop'](),this['_setPendingAction']();const _0x5dc8b6=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x562ca1])=>!_0x562ca1['lazyLoad'])['map'](([_0xa0fa9e,_0x16ff85])=>[_0xa0fa9e,_0x16ff85['modelAttributes']||{}])),_0x4a0475=this['_getOperationsFromInitData'](_0x3d9b26,_0x5dc8b6);0x0==_0x4a0475['length']&&_0x4a0475['push'](new _0x37d8fe(0x0)),_0x434088['return']=this['_connectService'](_0x4a0475)['then'](()=>{this['editor']['plugins']['get'](z)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3e6dbf=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3e6dbf))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x967ea9,[_0xd28b0d,_0xff1d3e])=>{_0x967ea9['stop']();const _0x1ee88a=this['editor']['model']['document']['getRoot'](_0xd28b0d);if(!this['_knownRootNames']['has'](_0xd28b0d)){const _0x50569c=_0xff1d3e&&_0xff1d3e['data']?_0xff1d3e['data']:'',_0x2eee39=_0xff1d3e&&_0xff1d3e['attributes']?_0xff1d3e['attributes']:{};await this['_loadRoot'](_0xd28b0d,_0x50569c,_0x2eee39);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x1ee88a['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x1ee88a);});},{'priority':'high'});}async _fetchMissingUsers(_0x218f50){const _0x1bef47=this['editor']['plugins']['get'](_0x226ed0),{connection:_0x31966b}=this['editor']['plugins']['get'](z),_0x488a94=new Set();for(const _0x4171bf of _0x218f50){const _0x1fc5fc=_0x4171bf['_authorId'];_0x1fc5fc&&!_0x1bef47['getUser'](_0x1fc5fc)&&_0x488a94['add'](_0x1fc5fc);}if(0x0===_0x488a94['size'])return;const _0x40169d=await _0x5ca612['getMany'](_0x31966b,Array['from'](_0x488a94));for(const _0x5ba843 of _0x40169d)_0x1bef47['getUser'](_0x5ba843['id'])||_0x1bef47['addUser'](_0x5ba843);}_getOperationsFromInitData(_0x437481,_0x47c042={}){const _0x2243a8=this['editor']['model'],_0x533bac=[];let _0x3e2b71=0x0;const _0x11014c='string'==typeof _0x437481?{'main':_0x437481}:_0x437481;for(const _0x5f068d of Object['keys'](_0x11014c)){if(!this['_document']['roots']['has'](_0x5f068d))throw new _0x370faa('realtimecollaborationclient-init-non-existent-root',this);const _0xdd48b5=this['_document']['getRoot'](_0x5f068d),_0x1e165d=this['editor']['data']['parse'](_0x11014c[_0x5f068d],_0xdd48b5),_0x59d372=new _0x23d695(_0x2243a8['createPositionAt'](_0xdd48b5,0x0),_0x1e165d,_0x3e2b71++);_0x533bac['push'](_0x59d372);for(const [_0x1578b0,_0x4d7673]of _0x1e165d['markers']){const _0x4f7310=new _0x5d55fd(_0x1578b0,null,_0x2243a8['createRange'](_0x2243a8['createPositionFromPath'](_0xdd48b5,_0x4d7673['start']['path']['slice']()),_0x2243a8['createPositionFromPath'](_0xdd48b5,_0x4d7673['end']['path']['slice']())),_0x2243a8['markers'],!0x0,_0x3e2b71++);_0x533bac['push'](_0x4f7310);}}if(_0x47c042)for(const [_0x544926,_0x89051f]of Object['entries'](_0x47c042)){const _0x850257=_0x2243a8['document']['getRoot'](_0x544926);if(!_0x850257)throw new _0x370faa('multi-root-editor-root-attributes-no-root',null);for(const [_0x4d1e7b,_0x4c5ecb]of Object['entries'](_0x89051f))if(null!==_0x4c5ecb){const _0x54acd4=new _0x1d2c96(_0x850257,_0x4d1e7b,null,_0x4c5ecb,_0x3e2b71++);_0x533bac['push'](_0x54acd4);}}return _0x533bac;}async _loadRoot(_0x2f9c33,_0x20a58e,_0x487a2a){this['_getOperationsFromInitData']({[_0x2f9c33]:_0x20a58e},{[_0x2f9c33]:_0x487a2a})['forEach']((_0x5e90d7,_0x394fe6)=>{_0x5e90d7['baseVersion']=this['_document']['version']+_0x394fe6,_0x5e90d7['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x5e90d7);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x1c9ed3,_0x528833){let _0x38b1dc;this['_offset']=_0x1c9ed3['offset'];const _0xec00e5=_0x1c9ed3['wereChangesApplied']&&!_0x1c9ed3['initData'],_0x25553a=_0xec00e5?0x0:_0x1c9ed3['data']['baseVersion'];if(_0x528833['forEach'](_0x2cafe0=>{_0x2cafe0['_isInit']=!0x0,_0x2cafe0['createdAt']=_0x1c9ed3['sessionCreatedAt'],_0x2cafe0['_authorId']=null;}),_0xec00e5)_0x38b1dc=_0x528833,this['_applyOperationsSet'](_0x38b1dc,_0xec00e5);else{if(_0x1c9ed3['initData']){const _0x17b40c=this['_getOperationsFromInitData'](_0x1c9ed3['initData']);this['_document']['history']['version']=-_0x17b40c['length'],_0x17b40c['forEach'](_0x55e026=>{_0x55e026['baseVersion']-=_0x17b40c['length'],_0x55e026['createdAt']=_0x1c9ed3['sessionCreatedAt'],_0x55e026['_isInit']=!0x0,_0x55e026['_authorId']=null;}),this['_applyOperationsSet'](_0x17b40c,!0x0),this['serverHistory']['version']=-_0x17b40c['length']+this['_offset'],this['_updateServerHistory'](_0x17b40c);}this['_document']['history']['version']=_0x25553a,_0x38b1dc=this['_decompressOperations'](_0x1c9ed3['data'],_0x1c9ed3['metadata']),await this['_fetchMissingUsers'](_0x38b1dc),this['_applyOperationsSet'](_0x38b1dc,_0xec00e5);}_0x1c9ed3['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x38b1dc,_0x1c9ed3['lastOperationId']),this['_lastSyncedOperationId']=_0x1c9ed3['lastOperationId']),this['serverHistory']['version']=_0x25553a+this['_offset'],this['_updateServerHistory'](_0x38b1dc),_0x528833['filter'](_0x3cd4d1=>{const _0x5eee82=this['_getAffectedRoot'](_0x3cd4d1);return _0x5eee82&&!this['_knownRootNames']['has'](_0x5eee82);})['forEach']((_0x2db49b,_0x38a031)=>{_0x2db49b['baseVersion']=this['_document']['version']+_0x38a031,this['_saveOperationInBuffer'](_0x2db49b);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x38bcaf,_0x4b19dc){const _0x4a8444=_0x4b19dc&&_0x4b19dc['message'];if(_0x4a8444&&_0x4a8444['startsWith']('realtimecollaborationclient'))throw _0x4b19dc;const _0x4e5ea8=this['editor']['plugins']['get'](z);throw this['_isPendingUpdate']=!0x0,_0x4e5ea8['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x370faa(_0x38bcaf,this['editor'],_0x4a8444?{'originalError':_0x4a8444}:void 0x0);}_saveOperationInBuffer(_0x23749c){this['_knownOperations']['has'](_0x23749c)||(this['_knownOperations']['add'](_0x23749c),this['_bufferedOperations']['push'](_0x23749c),this['_pendingAction']||'marker'==_0x23749c['type']&&!_0x23749c['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x52163a=!0x1){!_0x52163a&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x111ad7=>{_0x111ad7&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3cc151=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x466df5){return _0x466df5['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x466df5['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x466df5['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3cc151)||this['_crash'](_0x3cc151['message'],_0x3cc151);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x1bfee8=>{this['on']('change:_isPendingUpdate',()=>{_0x1bfee8();});});}async _sendBufferedOperations(){const _0x318af5=this['editor']['plugins']['get'](K);if(this['_shouldSendSelectionUpdate']()&&(_0x318af5['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5a6b02=[...this['_bufferedOperations']];for(const _0x3f6584 of _0x5a6b02)_0x3f6584['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3f6584);const _0x36a2e3=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5a6b02),_0xc4ba00=Z++,_0x45805f=this['_compressOperations'](_0x5a6b02),_0x19e066=await this['_service']['sendOperations'](_0x45805f,_0x45805f['baseVersion'],_0x36a2e3);try{return await this['_handleServerResponse'](_0x5a6b02,_0x19e066,_0xc4ba00);}catch(_0xfba959){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0xfba959);}}async['_handleServerResponse'](_0x4e1223,_0xbf042c,_0x3a3540){if('error'in _0xbf042c)throw _0xbf042c['error'];let _0x19d756;if(_0xbf042c['wereChangesApplied']){_0xbf042c['lastOperationId']&&(this['_lastSyncedOperationId']=_0xbf042c['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x25a324=>!_0x4e1223['includes'](_0x25a324));for(const _0x4a2bd4 of _0x4e1223)_0x4a2bd4['createdAt']='lastOperationAcceptedAt'in _0xbf042c&&_0xbf042c['lastOperationAcceptedAt']||void 0x0;st(_0x4e1223,_0xbf042c['version']-_0x4e1223['length']),this['_updateServerHistory'](_0x4e1223);const _0x4aff41=_0x4e1223['filter'](_0x181fe9=>{if(!_0x181fe9['_isInit'])return!0x1;const _0x52ef65=this['_getAffectedRoot'](_0x181fe9);return _0x52ef65&&!this['_knownRootNames']['has'](_0x52ef65);});st(_0x4aff41,this['_document']['version']),this['_applyOperationsSet'](_0x4aff41),_0x19d756=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xaf7ea7=this['_decompressOperations'](_0xbf042c['data'],_0xbf042c['metadata'])['filter'](_0x46c3fe=>_0x46c3fe['baseVersion']>=this['_lastServerVersion']);_0xaf7ea7['forEach'](_0x95083c=>this['_addKnownRoot'](_0x95083c)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x41933e=>!_0x41933e['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x41933e))),this['_bufferedOperations']['length']&&st(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xaf7ea7),_0x19d756=this['_handleExternalOperations'](_0xaf7ea7,_0xbf042c['version'],_0xbf042c['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x19d756?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x43c7e8,_0x40d7c1,_0x3f9516){try{const _0x21bb91={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x435c8f,operationsB:_0x2527f2,originalOperations:_0x1b6e8a}=_0x3ac6dc(_0x43c7e8,this['_bufferedOperations'],_0x21bb91);st(_0x435c8f,this['_document']['version']),st(_0x2527f2,_0x40d7c1);for(const _0x46d4dc of _0x435c8f){const _0x39c1b8=_0x1b6e8a['get'](_0x46d4dc);_0x39c1b8?(_0x46d4dc['_authorId']=_0x39c1b8['_authorId'],'noop'!==_0x46d4dc['type']&&(_0x46d4dc['_aiSource']=_0x39c1b8['_aiSource'])):_0x46d4dc['_authorId']=null;}for(const _0x3163e7 of _0x2527f2)'noop'!==_0x3163e7['type']&&(_0x3163e7['_aiSource']=_0x1b6e8a['get'](_0x3163e7)?.['_aiSource']);_0x3f9516&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x43c7e8,_0x3f9516),this['_lastSyncedOperationId']=_0x3f9516),this['_bufferedOperations']=[..._0x2527f2],this['_applyOperationsSet'](_0x435c8f),this['_updateServerHistory'](_0x43c7e8);}catch(_0x113397){return console['error'](_0x113397),!0x1;}return!0x0;}_applyOperationsSet(_0x269f45,_0x4f9b51=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x566b68=>{for(const _0x4a9250 of _0x269f45)this['_knownOperations']['add'](_0x4a9250),this['_addKnownRoot'](_0x4a9250),_0x566b68['batch']['addOperation'](_0x4a9250),this['editor']['model']['applyOperation'](_0x4a9250);});}_addKnownRoot(_0x4ade3c){const _0x18c478=this['_getAffectedRoot'](_0x4ade3c);_0x18c478&&this['_knownRootNames']['add'](_0x18c478);}_getAffectedRoot(_0x584641){let _0x3e0bbb,_0x2740d8;switch(_0x584641['type']){case'insert':_0x3e0bbb=_0x584641['position']['root'];break;case'marker':if(_0x2740d8=_0x584641['newRange'],!_0x2740d8)return null;_0x3e0bbb=_0x2740d8['root'];break;case'addRootAttribute':_0x3e0bbb=_0x584641['root'];break;case'addRoot':_0x3e0bbb=_0x584641['affectedSelectable'];break;case'move':_0x3e0bbb=_0x584641['targetPosition']['root'];break;default:return null;}return _0x3e0bbb['rootName'];}_updateServerHistory(_0x5779c7){_0x5779c7['forEach'](_0x41f298=>{const _0x5e0695=_0x41f298['clone']();_0x5e0695['_authorId']=_0x41f298['_authorId'],_0x5e0695['_isInit']=!!_0x41f298['_isInit'],_0x5e0695['_aiSource']=_0x41f298['_aiSource'],_0x5e0695['createdAt']=_0x41f298['createdAt'],_0x5e0695['baseVersion']+=this['_offset'],_0x41f298['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5e0695),this['serverHistory']['addOperation'](_0x5e0695);});}_handleReconnectionError(_0x1a4d8a){const _0x2f9971=this['editor']['plugins']['get']('Notification'),_0x3a0dfa=this['editor']['locale'];_0x1a4d8a||(_0x1a4d8a=X(_0x3a0dfa,'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.')),_0x2f9971['showWarning'](_0x1a4d8a,{'title':X(_0x3a0dfa,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](z)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x59ef5c)['add'](X(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x59ef5c)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x450dd){const _0x5c905e=_0x450dd['map'](_0x3289f7=>_0x3289f7['toJSON']());return this['_compressor']['compress'](_0x5c905e);}_decompressOperations(_0x37c276,_0x22f6d4){return this['_compressor']['decompress'](_0x37c276)['map']((_0x25b718,_0x388f19)=>{const _0x37aebb='init'==_0x22f6d4[_0x388f19]['type'];if('InsertOperation'==_0x25b718['__className']){const _0x2b5dbe=_0x25b718['position']['root'];!this['_document']['getRoot'](_0x2b5dbe)&&(this['_document']['createRoot']('$unknown',_0x2b5dbe)['_isAttached']=!0x1);}else{if('RootOperation'==_0x25b718['__className']){const _0x46102c=this['_document']['getRoot'](_0x25b718['rootName']);_0x46102c&&'$unknown'==_0x46102c['name']&&_0x25b718['elementName']!=_0x46102c['name']&&(_0x46102c['name']=_0x25b718['elementName']);}}const _0x29f6ac=_0x3fa583['fromJSON'](_0x25b718,this['_document']);return _0x29f6ac['wasUndone']=_0x25b718['wasUndone'],_0x29f6ac['_isInit']=_0x37aebb,_0x29f6ac['_authorId']=_0x37aebb?null:_0x22f6d4[_0x388f19]['userId'],_0x29f6ac['_isDisconnection']='cs:removeUser'===_0x22f6d4[_0x388f19]['type'],_0x29f6ac['_aiSource']=_0x25b718['_aiSource']||void 0x0,_0x29f6ac['createdAt']=_0x22f6d4[_0x388f19]['createdAt'],_0x29f6ac;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x777bdc=this['editor']['plugins']['get'](Y)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x777bdc&&_0x777bdc['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},et=class extends Error{};function st(_0x2e565c,_0x22d80a){for(const _0x54bf5a of _0x2e565c)_0x54bf5a['baseVersion']=_0x22d80a++;}var it=class{_ignoredOperations;_operationToId;constructor(_0x3da9df){this['_ignoredOperations']=_0x3da9df,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x27e3ea){let _0x2fa7e3=_0x27e3ea['length'];for(;_0x2fa7e3--;){const _0x4891c5=_0x27e3ea[_0x2fa7e3];if(!this['_ignoredOperations']['has'](_0x4891c5)){if(!this['_operationToId']['has'](_0x4891c5)){const _0x26c241=_0x131976()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4891c5,_0x26c241);}return this['_operationToId']['get'](_0x4891c5);}}}setIdForTheLastOperation(_0x47c1dc,_0xf2e7c){if(!_0xf2e7c)return;let _0x22eb09=_0x47c1dc['length'];for(;_0x22eb09--;){const _0x20ec50=_0x47c1dc[_0x22eb09];this['_ignoredOperations']['has'](_0x20ec50)||this['_operationToId']['set'](_0x20ec50,_0xf2e7c);}}},nt=class extends _0x4a73e6{static get requires(){return[tt];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ot=class CloudServicesCommentsAdapter extends _0x4b84ca{static CommentsService=/* #__PURE__ -- @preserve */
26
- ((()=>_0x646c78)());['_services'];static get requires(){return[z,_0x50e12d,Y,_0x226ed0];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e0c94){super(_0x1e0c94),this['_services']=new Map();}async init(){const _0x4d857a=this['context'],_0x2cfbc1=_0x4d857a['plugins']['get'](_0x50e12d);if(_0x4d857a['plugins']['get'](z)['addToReconnectionStack'](this),_0x2cfbc1['adapter']={'addCommentThread':async({channelId:_0x3fd079,threadId:_0x1ab194,comments:_0x43fe66,resolvedAt:_0x232c22,resolvedBy:_0x2219d5,context:_0x5f1cad,attributes:_0x50549b})=>{const _0x383612=await this['_getService'](_0x3fd079)['addCommentThread']({'commentThreadId':_0x1ab194,'comments':_0x43fe66['map'](_0x448ff7=>function(_0x569332,_0x385a51,_0x3593e2){return{'commentThreadId':_0x3593e2,'commentId':_0x569332['commentId'],'userId':_0x569332['authorId'],'content':_0x569332['content'],'documentId':_0x385a51,'createdAt':_0x569332['createdAt'],'attributes':_0x569332['attributes']||{}};}(_0x448ff7,_0x3fd079,_0x1ab194)),'resolvedAt':_0x232c22,'resolvedBy':_0x2219d5,'context':_0x5f1cad,'attributes':_0x50549b})['catch'](ct);return{'threadId':_0x383612['commentThreadId'],'comments':_0x383612['comments']};},'getCommentThread':async({channelId:_0x4b5af0,threadId:_0x1c3e78})=>{const _0x471032=await this['_getService'](_0x4b5af0)['getCommentThread'](_0x1c3e78)['catch'](rt)['catch'](ct);return _0x471032?_0x471032['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x471032]),{'threadId':_0x471032['commentThreadId'],'comments':_0x471032['comments']['map'](at),'context':_0x471032['context'],'resolvedAt':_0x471032['resolvedAt'],'resolvedBy':_0x471032['resolvedBy'],'attributes':_0x471032['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x7b69a9,threadId:_0x21d418,context:_0x27abb7,unlinkedAt:_0x3467b2,attributes:_0x540b93})=>this['_getService'](_0x7b69a9)['updateCommentThread']({'commentThreadId':_0x21d418,'context':_0x27abb7,'attributes':_0x540b93,'unlinkedAt':_0x3467b2})['catch'](rt)['catch'](ct),'resolveCommentThread':async({channelId:_0x48bcc1,threadId:_0x12cda6})=>{const _0x2b483e=await this['_getService'](_0x48bcc1)['resolveCommentThread'](_0x12cda6)['catch'](rt)['catch'](ct);return{'threadId':_0x2b483e['commentThreadId'],'resolvedAt':_0x2b483e['resolvedAt'],'resolvedBy':_0x2b483e['resolvedBy']};},'reopenCommentThread':async({channelId:_0x36b62d,threadId:_0xe03e22})=>this['_getService'](_0x36b62d)['reopenCommentThread'](_0xe03e22)['catch'](rt)['catch'](ct),'removeCommentThread':({channelId:_0x3baaa9,threadId:_0x22b3c5})=>this['_getService'](_0x3baaa9)['removeCommentThread'](_0x22b3c5)['catch'](rt)['catch'](ct),'addComment':({channelId:_0xe6e33b,threadId:_0x53546f,commentId:_0x58989d,content:_0x17b32d,attributes:_0x4068bd})=>this['_getService'](_0xe6e33b)['addComment'](_0x53546f,_0x58989d,_0x17b32d,_0x4068bd)['catch'](ct),'updateComment':({channelId:_0xdece2d,threadId:_0x5779e6,commentId:_0x2d4385,content:_0x547755,attributes:_0xafc48e})=>this['_getService'](_0xdece2d)['updateComment'](_0x5779e6,_0x2d4385,_0x547755,_0xafc48e)['catch'](rt)['catch'](ct),'removeComment':({channelId:_0x45ff2a,threadId:_0x51c901,commentId:_0x151b3c})=>this['_getService'](_0x45ff2a)['removeComment'](_0x51c901,_0x151b3c)['catch'](rt)['catch'](ct)},_0x4d857a instanceof _0x46d979){const _0x243a48=_0x4d857a['config']['get']('collaboration.channelId'),_0x13f2fc=_0x4d857a['plugins']['get'](Y);await this['_setUpService'](_0x243a48);const _0x360913=await this['_services']['get'](_0x243a48)['getConnectedSessions']();this['listenTo'](_0x13f2fc,'sessionAdd:'+_0x243a48,(_0x3a3637,{session:_0x2952fa})=>{_0x2952fa['id']===_0x13f2fc['mySessionId']&&(_0x3a3637['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2952fa['permissions'],_0x243a48));}),_0x13f2fc['register'](_0x243a48,_0x360913);}}async _setUpService(_0x130b75){if(this['_services']['has'](_0x130b75))throw new _0x370faa('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x130b75});const _0x3261c3=this['context']['plugins']['get'](_0x50e12d),_0x1afdf1=new CloudServicesCommentsAdapter['CommentsService'](_0x130b75);this['_services']['set'](_0x130b75,_0x1afdf1),this['listenTo'](_0x1afdf1,'commentThreadAdded',(_0x1230cd,_0x11252c)=>{const {commentThreadId:_0x3e68dc,documentId:_0x42674b,context:_0x16d78c,attributes:_0x37e252,resolvedAt:_0x3122e9,resolvedBy:_0x4fd2cc,comments:_0x2f7e19}=_0x11252c;_0x3261c3['getCommentThread'](_0x3e68dc)||_0x3261c3['addCommentThread']({'threadId':_0x3e68dc,'channelId':_0x42674b,'comments':_0x2f7e19?_0x2f7e19['map'](at):[],'context':_0x16d78c,'attributes':_0x37e252,'resolvedAt':_0x3122e9,'resolvedBy':_0x4fd2cc,'isFromAdapter':!0x0});}),this['listenTo'](_0x1afdf1,'commentThreadUpdated',(_0xf666bd,{commentThreadId:_0x2572d3,documentId:_0x223729,context:_0x57c06c,unlinkedAt:_0x3150bd,attributes:_0x1ccc5f})=>{_0x3261c3['getCommentThread'](_0x2572d3)&&_0x3261c3['updateCommentThread']({'threadId':_0x2572d3,'channelId':_0x223729,'context':_0x57c06c,'unlinkedAt':_0x3150bd,'attributes':_0x1ccc5f,'isFromAdapter':!0x0});}),this['listenTo'](_0x1afdf1,'commentThreadResolved',(_0x3c7979,{commentThreadId:_0x1bd677,resolvedBy:_0x4cc711,resolvedAt:_0x59ba40})=>{const _0x329920=_0x3261c3['getCommentThread'](_0x1bd677);_0x329920&&_0x329920['resolve']({'resolvedBy':_0x4cc711,'resolvedAt':_0x59ba40,'isFromAdapter':!0x0});}),this['listenTo'](_0x1afdf1,'commentThreadReopened',(_0x26d020,{commentThreadId:_0x3170c3})=>{const _0x745e8d=_0x3261c3['getCommentThread'](_0x3170c3);_0x745e8d&&_0x745e8d['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1afdf1,'commentThreadRemoved',(_0x40352c,{commentThreadId:_0x225adf})=>{const _0x3feb2e=_0x3261c3['getCommentThread'](_0x225adf);_0x3feb2e&&_0x3feb2e['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1afdf1,'commentAdded',(_0x122087,_0x3de23b)=>{const _0x275a88=_0x3de23b['commentThreadId'],_0x3e78a8=_0x3261c3['getCommentThread'](_0x275a88);_0x3e78a8&&_0x3e78a8['addComment']({...at(_0x3de23b),'isFromAdapter':!0x0});}),this['listenTo'](_0x1afdf1,'commentUpdated',(_0x27f77b,{commentThreadId:_0x8e79ed,commentId:_0x2e9003,content:_0x592497,attributes:_0x3ab9cc})=>{const _0x1f95f0=_0x3261c3['getCommentThread'](_0x8e79ed);if(_0x1f95f0){const _0x32957c=_0x1f95f0['getComment'](_0x2e9003);_0x32957c&&_0x32957c['update']({'content':_0x592497,'attributes':_0x3ab9cc,'isFromAdapter':!0x0});}}),this['listenTo'](_0x1afdf1,'commentRemoved',(_0x2cf894,{commentThreadId:_0x5c2596,commentId:_0x16f558})=>{const _0x359f68=_0x3261c3['getCommentThread'](_0x5c2596);if(_0x359f68){const _0x5996c5=_0x359f68['getComment'](_0x16f558);_0x5996c5&&_0x5996c5['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x1afdf1,'disconnected',()=>{'connected'===this['context']['plugins']['get'](z)['connection']?.['state']&&(this['_services']['delete'](_0x130b75),this['stopListening'](_0x1afdf1));}),await this['_connectService'](_0x130b75);}destroy(){if(this['context']instanceof _0x46d979){const _0x197ea5=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x197ea5)&&this['_terminateService'](_0x197ea5);}}_terminateService(_0x1cc3b2){if(!this['_services']['has'](_0x1cc3b2))throw new _0x370faa('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1cc3b2});this['_getService'](_0x1cc3b2)['disconnect'](),this['_services']['delete'](_0x1cc3b2);}async reconnect(){for(const _0x1a6a15 of this['_services']['keys']())await this['_connectService'](_0x1a6a15);if(this['context']instanceof _0x46d979){const _0x2ccb57=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x2ccb57)){const _0x2af9dc=this['context']['plugins']['get'](Y);_0x2af9dc['unregister'](_0x2ccb57);const _0x46881b=await this['_services']['get'](_0x2ccb57)['getConnectedSessions']();_0x2af9dc['register'](_0x2ccb57,_0x46881b);}}}async _connectService(_0x41e464){const {connection:_0x328e66}=this['context']['plugins']['get'](z),_0x2e1bf4=this['context']['plugins']['get'](_0x50e12d),_0x22c9fa=await this['_services']['get'](_0x41e464)['connect'](_0x328e66);await this['_fetchMissingUsersForThreads'](_0x22c9fa);const _0x4dfd9e=new Set(Array['from'](_0x2e1bf4['getCommentThreads']({'channelId':_0x41e464}),_0x24807a=>_0x24807a['id']));for(const _0x13020a of _0x22c9fa)_0x13020a['deletedAt']||_0x4dfd9e['delete'](_0x13020a['commentThreadId']);for(const _0x54b0f0 of _0x4dfd9e)_0x2e1bf4['getCommentThread'](_0x54b0f0)['remove']({'isFromAdapter':!0x0});for(const _0x4504b8 of _0x22c9fa){let _0x4c80e0=_0x2e1bf4['getCommentThread'](_0x4504b8['commentThreadId']);const {commentThreadId:_0x39483,context:_0x4d3e57,attributes:_0x4706b3,resolvedBy:_0x462131,resolvedAt:_0x14dafe,unlinkedAt:_0x2df850,deletedAt:_0x5625d7}=_0x4504b8;if(_0x5625d7)continue;_0x4c80e0||(_0x4c80e0=_0x2e1bf4['addCommentThread']({'channelId':_0x41e464,'threadId':_0x39483,'context':_0x4d3e57,'attributes':_0x4706b3||{},'resolvedBy':_0x462131,'resolvedAt':_0x14dafe,'unlinkedAt':_0x2df850,'isFromAdapter':!0x0}));const _0x212117=new Set(Array['from'](_0x4c80e0['comments'],_0x52348f=>_0x52348f['id']));for(const _0x3e7d5d of _0x4504b8['comments'])_0x212117['delete'](_0x3e7d5d['commentId']);for(const _0x28816d of _0x212117)_0x4c80e0['getComment'](_0x28816d)['remove']({'isFromAdapter':!0x0});for(const _0x4b71a1 of _0x4504b8['comments']){const _0x3e29c0=_0x4c80e0['getComment'](_0x4b71a1['commentId']);_0x3e29c0?_0x3e29c0['content']!==_0x4b71a1['content']&&_0x3e29c0['update']({'content':_0x4b71a1['content'],'isFromAdapter':!0x0}):_0x4c80e0['addComment'](Object['assign'](at(_0x4b71a1),{'isFromAdapter':!0x0}));}}}_getService(_0x57a232){if(!this['_services']['has'](_0x57a232))throw new _0x370faa('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x57a232});return this['_services']['get'](_0x57a232);}async _fetchMissingUsersForThreads(_0x50b13f){const _0x568b6e=this['context']['plugins']['get'](_0x226ed0),{connection:_0x3e99aa}=this['context']['plugins']['get'](z),_0x2c468c=new Set();for(const {resolvedBy:_0x166388,comments:_0x34705d}of _0x50b13f){_0x166388&&!_0x568b6e['getUser'](_0x166388)&&_0x2c468c['add'](_0x166388);for(const {userId:_0x53f1b4}of _0x34705d)_0x568b6e['getUser'](_0x53f1b4)||_0x2c468c['add'](_0x53f1b4);}if(0x0===_0x2c468c['size'])return;const _0x31ec77=await _0x5ca612['getMany'](_0x3e99aa,Array['from'](_0x2c468c));for(const _0x65ede8 of _0x31ec77)_0x568b6e['getUser'](_0x65ede8['id'])||_0x568b6e['addUser'](_0x65ede8);}};async function rt(_0x2ef579){if('404'!==_0x2ef579['code'])throw _0x2ef579;}function ct(_0x53e2f4){if((_0x2dd28e=_0x53e2f4)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2dd28e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2dd28e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2dd28e;throw _0x53e2f4;}function at(_0x18912b){return{'threadId':_0x18912b['commentThreadId'],'commentId':_0x18912b['commentId'],'content':_0x18912b['content'],'createdAt':_0x18912b['createdAt'],'authorId':_0x18912b['userId'],'attributes':_0x18912b['attributes']||{}};}var ht=class CloudServicesTrackChangesAdapter extends _0x4a73e6{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>_0x254a7f)());_bufferedRequests;_trackChangesService;static get requires(){return[ot,_0x366e3c,z];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4e8c30){super(_0x4e8c30);const _0x28e60a=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x28e60a);}init(){const _0xc9f5fa=this['editor']['plugins']['get'](z),_0x119109=this['editor']['plugins']['get'](_0x366e3c);return _0x119109['adapter']={'getSuggestion':async _0x1e0844=>{await this['_waitForServiceReady']();const _0x260cbd=await this['_trackChangesService']['get'](_0x1e0844)['catch'](lt);return await this['_fetchMissingUsersForThreads']([_0x260cbd]),_0x260cbd;},'addSuggestion':async({id:_0x55c107,type:_0x515e91,data:_0x59311b,originalSuggestionId:_0x3eb55b,attributes:_0x2b41e1})=>{await this['_waitForServiceReady']();const _0x500c10={'id':_0x55c107,'type':_0x515e91,'data':_0x59311b,'originalSuggestionId':_0x3eb55b,'attributes':_0x2b41e1},_0x1f592d=await this['_trackChangesService']['add'](_0x55c107,_0x515e91,_0x59311b,_0x3eb55b,_0x2b41e1)['catch'](_0x3c5a50=>{if(dt(_0x3c5a50))return new Promise(_0x25e149=>{this['_bufferedRequests']['set'](_0x55c107,{'resolve':_0x25e149,'suggestionData':_0x500c10});});throw _0x3c5a50;});return this['_bufferedRequests']['delete'](_0x55c107),_0x1f592d;},'updateSuggestion':async(_0x431c0f,_0x15bbcc)=>{if(await this['_waitForServiceReady'](),'open'!==_0x15bbcc['state'])return this['_trackChangesService']['update'](_0x431c0f,_0x15bbcc)['catch'](lt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x34c11a,_0x5cc5fa)=>{_0x119109['hasSuggestion'](_0x5cc5fa['id'])&&(_0x119109['getSuggestion'](_0x5cc5fa['id'])['attributes']=_0x5cc5fa['attributes']);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0xc9f5fa['connection']?.['state']&&(_0xc9f5fa['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));}),this['_trackChangesService']['connect'](_0xc9f5fa['connection'])['then'](_0xf7221c=>(_0xc9f5fa['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0xf7221c)['then'](()=>{for(const _0x1f8bc4 of _0xf7221c){_0x119109['addSuggestionData'](_0x1f8bc4)['_saved']=!0x0;}})));}async reconnect(){const _0x4c2af6=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1b768c}=this['editor']['plugins']['get'](z),_0x215086=await this['_trackChangesService']['connect'](_0x1b768c);await this['_fetchMissingUsersForThreads'](_0x215086);for(const {suggestionData:_0x4d1b8b,resolve:_0x36b186}of this['_bufferedRequests']['values']()){let _0x4a342c=_0x215086['find'](_0xbf5a98=>_0xbf5a98['id']===_0x4d1b8b['id']);_0x4a342c||(_0x4a342c=await this['_trackChangesService']['add'](_0x4d1b8b['id'],_0x4d1b8b['type'],_0x4d1b8b['data'],_0x4d1b8b['originalSuggestionId'])),_0x36b186(_0x4a342c);}for(const _0x479d0c of _0x215086)_0x4c2af6['hasSuggestion'](_0x479d0c['id'])||_0x4c2af6['addSuggestionData'](_0x479d0c);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x3bb338=>{this['listenTo'](this['_trackChangesService'],'connected',_0x33b8ac=>{_0x33b8ac['off'](),_0x3bb338();});});}async _fetchMissingUsersForThreads(_0x2db06f){const _0x13efd6=this['editor']['plugins']['get'](_0x226ed0),{connection:_0x2cd15e}=this['editor']['plugins']['get'](z),_0x208c00=new Set();for(const {authorId:_0x1dc8a4}of _0x2db06f)_0x13efd6['getUser'](_0x1dc8a4)||_0x208c00['add'](_0x1dc8a4);if(0x0===_0x208c00['size'])return;const _0x375dd1=await _0x5ca612['getMany'](_0x2cd15e,Array['from'](_0x208c00));for(const _0xb765ad of _0x375dd1)_0x13efd6['getUser'](_0xb765ad['id'])||_0x13efd6['addUser'](_0xb765ad);}};function lt(_0x2dc979){if(dt(_0x2dc979))return new Promise(()=>{});throw _0x2dc979;}function dt(_0x20ae67){return _0x20ae67['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x20ae67['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var ut=class extends _0x4a73e6{static get requires(){return[_0xe4ccc3,ot,nt,z];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x2c2bbb=this['editor']['plugins']['get'](z),_0x8a8cac=this['editor']['plugins']['get'](_0x3eb236),_0x3f9fca=this['editor']['plugins']['get'](ot);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2c2bbb,'change:state',(_0x46e12c,_0x52f4a0,_0x5e1bb3)=>{_0x8a8cac['isThreadsLoadingPaused']='connected'!==_0x5e1bb3;});}),this['listenTo'](_0x2c2bbb,'change:state',(_0x4e6d04,_0x5864d4,_0x189214)=>{this['editor']['plugins']['get'](_0x50e12d)['switchReadOnly']('connected'!==_0x189214);}),_0x3f9fca['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}destroy(){const _0x322120=this['editor']['plugins']['get'](ot),_0x4c1174=this['editor']['config']['get']('collaboration.channelId');_0x322120['_services']['has'](_0x4c1174)&&_0x322120['_terminateService'](_0x4c1174),super['destroy']();}},ft=class extends _0x4a73e6{static get requires(){return[ut,ht,_0x974558];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},mt=class CloudServicesRevisionHistoryAdapter extends _0x4a73e6{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
- ((()=>_0x59cd19)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;static get requires(){return[z,tt,_0x5ed346,Y,_0x226ed0];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3320e1){super(_0x3320e1);const _0x2741a4=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x2741a4);}async init(){const _0x45af01=this['editor']['plugins']['get'](tt),_0x3901a5=_0x45af01['serverHistory'],_0x28180e=this['editor']['plugins']['get'](z);this['_revisionTracker']['setSource']({'history':_0x3901a5,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x45af01['sessionId']});const _0x5f1c0b=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x1469c5,_0x500293=await _0x5b6d29['isBundleUploaded'](_0x28180e['connection'],_0x5f1c0b);this['editor']['plugins']['get'](_0x5ed346)['adapter']={'getRevision':async({revisionId:_0x4cf971})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4cf971)),'updateRevisions':async _0x41d7ca=>{await this['_waitForServiceReady']();const _0x5b392f=this['_revisionTracker']['currentRevision'];if(_0x500293&&0x1===_0x41d7ca['length']&&_0x41d7ca[0x0]['id']===_0x5b392f['id'])return _0x41d7ca;for(const _0x3b40ac of _0x41d7ca)_0x3b40ac['id']===_0x5b392f['id']&&(_0x3b40ac['isEmptyCurrent']=_0x3b40ac['fromVersion']===_0x3b40ac['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x41d7ca,this['_lastRequestId'])['then'](_0x57739e=>(this['_lastRequestId']=_0x57739e,_0x41d7ca))['catch'](_0x4b9c01=>{if(pt(_0x4b9c01)||'400'===_0x4b9c01['code']&&void 0x0!==_0x4b9c01['data']['wrongRequestId']){for(const _0xcdc8f of _0x41d7ca)this['_revisionTracker']['repository']['getRevision'](_0xcdc8f['id'])&&this['_revisionTracker']['_bufferUpdate'](_0xcdc8f['id'],_0xcdc8f,!0x1);if(pt(_0x4b9c01)&&'destroyed'!==this['editor']['state'])throw _0x4b9c01;return _0x41d7ca;}throw _0x4b9c01;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x8a49ab,{revisionsData:_0x537a14,requestId:_0x2bd530})=>{Math['max'](..._0x537a14['map'](_0x5d4a64=>_0x5d4a64['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x537a14,_0x2bd530);}):this['_handleRevisionsUpdate'](_0x537a14,_0x2bd530);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x28180e['connection']?.['state']&&(_0x28180e['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x4d2231,requestId:_0x4bc400}=await this['_revisionHistoryService']['connect'](_0x28180e['connection']);_0x28180e['addToReconnectionStack'](this),this['_lastRequestId']=_0x4bc400,await this['_fetchMissingUsers'](_0x4d2231);for(const _0x48c948 of _0x4d2231)this['_revisionTracker']['addRevisionData'](_0x48c948);this['listenTo'](_0x45af01,'change:_isConnected',(_0x511092,_0x51ea95,_0x10f981)=>{_0x10f981&&(this['_oldOffset']=_0x45af01['_offset'],_0x511092['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async reconnect(){const _0x4c9e6d=this['editor']['plugins']['get'](z),_0x559aef=this['editor']['plugins']['get'](tt),_0x443dff=async()=>{const _0x49d0d5=this['_revisionTracker']['currentRevision'],_0x14b96b=_0x49d0d5['id'],_0x45ece2=_0x14b96b!==_0x559aef['sessionId'];if(_0x45ece2){const _0x57845a=_0x559aef['_offset']-this['_oldOffset'],_0x49bda0=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x49d0d5['toVersion']+_0x57845a!==_0x49bda0){const _0x1a0f87=_0x49d0d5['fromVersion']+_0x57845a,_0x53ec77=this['editor']['plugins']['get'](_0x226ed0),_0x47b505=this['_revisionTracker']['buildRevisionData']({'revision':_0x49d0d5,'from':_0x1a0f87,'to':_0x49bda0});_0x47b505['id']=_0x49d0d5['id'];const _0x15f80e=_0x47b505['authorsIds']['map'](_0x1def8d=>_0x53ec77['getUser'](_0x1def8d));_0x49d0d5['_update']({..._0x47b505,'authors':_0x15f80e},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x49d0d5['id'],_0x47b505,!0x0);}this['_revisionTracker']['_startingVersion']=_0x49bda0,_0x49d0d5['toVersion']!==_0x49d0d5['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x14b96b)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x14b96b),this['_revisionTracker']['_createCurrentRevision'](_0x49bda0);}const {revisions:_0x505fe9,requestId:_0x137e11}=await this['_revisionHistoryService']['reconnect'](_0x4c9e6d['connection'],this['_lastRequestId']);_0x45ece2&&_0x505fe9['length']>0x0?_0x559aef['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x505fe9),this['_handleRevisionsUpdate'](_0x505fe9,_0x137e11),this['_revisionTracker']['sendBufferedUpdates']());};return _0x559aef['_isConnected']?_0x443dff():new Promise((_0x46cb61,_0x410055)=>{_0x559aef['once']('change:_isConnected',()=>{_0x443dff()['then'](_0x46cb61)['catch'](_0x410055);});});}destroy(){super['destroy']();}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x321462=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x13dc07=>{_0x13dc07['off'](),_0x321462();});});}_getLatestVersionFromServerOperations(){const _0x160ec7=this['editor']['plugins']['get'](tt)['serverHistory']['getOperations']()['reverse']();for(const _0x22b464 of _0x160ec7)if('marker'!==_0x22b464['type']||_0x22b464['affectsData'])return _0x22b464['baseVersion']+0x1;}_getLatestVersion(){const _0x357ecf=this['editor']['plugins']['get'](tt);return new Promise(_0x41b1bf=>{_0x357ecf['_isPendingUpdate']?_0x357ecf['once']('change:_isPendingUpdate',()=>{_0x41b1bf(this['_getLatestVersionFromServerOperations']());}):_0x41b1bf(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x19709f,_0x144bf8){const _0x560a17=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x144bf8;for(const _0x3a060c of _0x19709f){const _0x58194d=_0x560a17['getRevision'](_0x3a060c['id']);if(_0x58194d){if((_0x3a060c['fromVersion']||_0x3a060c['toVersion'])&&(_0x3a060c['diffData']=null),_0x58194d===this['_revisionTracker']['currentRevision']){const _0x1e5cad=Math['max'](_0x58194d['toVersion'],_0x3a060c['toVersion']),_0x4071d5=Math['max'](_0x58194d['fromVersion'],_0x3a060c['fromVersion']);let _0x3c337c;_0x58194d['toVersion']===_0x3a060c['toVersion']&&_0x58194d['fromVersion']===_0x3a060c['fromVersion']?(_0x3c337c=!0x0,this['_preventResendingRevisionData'](_0x3a060c)):_0x3a060c['toVersion']===_0x1e5cad&&_0x3a060c['fromVersion']===_0x4071d5?_0x3c337c=!0x1:(_0x58194d['toVersion']===_0x1e5cad&&_0x58194d['fromVersion']===_0x4071d5||this['_fixRevision']({'revision':_0x58194d,'from':_0x4071d5,'to':_0x1e5cad}),_0x3c337c=!0x0),_0x3c337c&&(delete _0x3a060c['fromVersion'],delete _0x3a060c['toVersion'],delete _0x3a060c['diffData'],delete _0x3a060c['createdAt'],delete _0x3a060c['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3a060c),this['_preventResendingRevisionData'](_0x3a060c);}else this['_revisionTracker']['addRevisionData'](_0x3a060c);}const _0x2568c7=_0x560a17['getRevisions']();_0x2568c7['reverse']();for(let _0x1055fc=0x0;_0x1055fc<_0x2568c7['length']-0x1;_0x1055fc++){const _0x416924=_0x2568c7[_0x1055fc],_0x5c5649=_0x2568c7[_0x1055fc+0x1];if(_0x416924['fromVersion']<_0x5c5649['toVersion']){const _0x41213e=_0x5c5649['toVersion'],_0x39db2d=Math['max'](_0x41213e,_0x416924['toVersion']);this['_fixRevision']({'revision':_0x416924,'from':_0x41213e,'to':_0x39db2d});}}}['_fixRevision']({revision:_0x187732,from:_0x36fa8c,to:_0x2473d5}={}){const _0x2fa748=this['editor']['plugins']['get'](_0x226ed0),_0x5a72f8=this['_revisionTracker']['buildRevisionData']({'revision':_0x187732,'from':_0x36fa8c,'to':_0x2473d5});_0x5a72f8['authors']=_0x5a72f8['authorsIds']['map'](_0x2b980c=>_0x2fa748['getUser'](_0x2b980c)),_0x187732['_update'](_0x5a72f8);}_preventResendingRevisionData(_0x2033d8){const _0x562951={};_0x562951['id']=_0x2033d8['id'];for(const _0x35d12c of Object['keys'](_0x2033d8))'id'!==_0x35d12c&&(_0x562951[_0x35d12c]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x562951['id'],_0x562951,!0x0);}async _fetchMissingUsers(_0x3b0f28){const _0x25f286=this['editor']['plugins']['get'](_0x226ed0),{connection:_0x428822}=this['editor']['plugins']['get'](z),_0x5e2aa7=new Set();for(const _0x1db93f of _0x3b0f28){for(const _0x1f44f6 of _0x1db93f['authorsIds'])_0x3d9d44(_0x1f44f6);_0x1db93f['creatorId']&&_0x3d9d44(_0x1db93f['creatorId']);}if(0x0===_0x5e2aa7['size'])return;const _0x4496fe=await _0x5ca612['getMany'](_0x428822,Array['from'](_0x5e2aa7));for(const _0x87e85a of _0x4496fe)_0x25f286['getUser'](_0x87e85a['id'])||_0x25f286['addUser'](_0x87e85a);function _0x3d9d44(_0x2e2946){_0x25f286['getUser'](_0x2e2946)||_0x5e2aa7['add'](_0x2e2946);}}};function pt(_0x5985f7){return _0x5985f7['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5985f7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5985f7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var gt=class extends _0x4a73e6{static get requires(){return[_0x5ed346,mt,nt];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class extends _0x2cd5dd{_collapseAt;constructor(_0x29ec55,_0x854615=0x6){super(_0x29ec55);const _0x9837ee=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x854615,this['bind']('isHidden')['to'](this,'usersCount',_0x426b84=>_0x426b84<_0x854615),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x9837ee['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x9837ee['to']('usersCount',_0x34489d=>'+'+(_0x34489d-this['_collapseAt']+0x2)['toString']())}]}]}]});}},vt=class extends _0x2cd5dd{items;keystrokes;constructor(_0x18e7cd){super(_0x18e7cd);const _0x5bf539=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x273b95(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5bf539['if']('hasPopup'),'aria-expanded':_0x5bf539['to']('isExpanded',_0x5eeae2=>this['hasPopup']&&String(_0x5eeae2)),'aria-label':_0x5bf539['to']('hasPopup',_0x4fa848=>X(_0x18e7cd,_0x4fa848?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5bf539['to']('hasPopup',_0x2eb012=>!!_0x2eb012&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x5bf539['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x5bf539['to'](_0x5c74fa=>{const _0x364198=_0x5c74fa,_0x4aad0f=document['querySelector']('.ck-presence-list__dropdown-list'),_0x422c52=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4aad0f?.['contains'](_0x364198['relatedTarget'])||_0x422c52?.['contains'](_0x364198['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x385f10,_0x26dd65,_0x788a77)=>{this['element']&&(_0x788a77?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}},_t=class extends _0x2cd5dd{counterView;inlineListView;constructor(_0x8f0f9d,_0x3198ff=0x6){super(_0x8f0f9d);const _0x52bd2b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new wt(this['locale'],_0x3198ff),this['inlineListView']=new vt(_0x8f0f9d),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3495df of this['inlineListView']['items'])_0x3495df['tooltipPosition']='s';this['inlineListView']['items']['first']&&(this['inlineListView']['items']['first']['tooltipPosition']='se');}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list','ck-reset','ck-rounded-corners',_0x52bd2b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},yt=class extends _0x2cd5dd{listWrapperView;constructor(_0x4e9ea1,_0x174fde){super(_0x4e9ea1);const _0x469090=this['bindTemplate'];this['listWrapperView']=new bt(_0x4e9ea1,_0x174fde),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':X(_0x4e9ea1,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x469090['to'](_0x17f5f2=>{const _0x68dbd6=_0x17f5f2,_0x1079d2=document['querySelector']('.ck-presence-list__list'),_0x3bd88c=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1079d2?.['contains'](_0x68dbd6['relatedTarget'])||_0x3bd88c?.['contains'](_0x68dbd6['relatedTarget'])||this['fire']('presencelist:hide');})}});}},bt=class extends _0x2600a0{constructor(_0x25dad6,_0x4209ff){super(_0x25dad6);const _0x4f94bf=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4209ff?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x4f94bf['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x4f94bf['to']('role'),'aria-label':_0x4f94bf['to']('ariaLabel'),'aria-labelledby':_0x4f94bf['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1f52c4['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x29fbf9=this['element'];_0x29fbf9&&(this['_isScrollable']=Math['max'](_0x29fbf9['scrollHeight'],_0x29fbf9['clientHeight'])>0.8*window['innerHeight']);}},kt=class extends _0x13c790{['userView'];constructor(_0x1a3370,_0x56c2ff,_0x1fc403){super(_0x1a3370);const _0x287ec4=this['bindTemplate'];this['userView']=new _0x3e61f8(_0x1a3370,_0x56c2ff);const _0xd8a35b={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x56c2ff['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x56c2ff['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x56c2ff['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x56c2ff['color']['getColorVariable'](),'--ck-user-color-alpha':_0x56c2ff['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x1fc403&&(_0xd8a35b['tag']='button',_0xd8a35b['on']={'click':_0x287ec4['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xd8a35b);}['focus'](){this['element']['focus']();}},It=class extends _0x2cd5dd{['userView'];['markerView'];constructor(_0x49c0d2,_0x11eb43,_0x34559e){super(_0x49c0d2);const _0x4c269a=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x3e61f8(_0x49c0d2,_0x11eb43),this['markerView']=new St(_0x49c0d2,_0x11eb43);const _0x1be053=new _0x62ed26(_0x49c0d2);_0x1be053['template']['tag']='span',_0x1be053['text']=_0x11eb43['name'];const _0x1cb64a={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x4c269a['to']('isFocusable',_0xd238e9=>!!_0xd238e9&&0x0),'aria-labelledby':_0x1be053['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x4c269a['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x4c269a['to']('hasTooltip',_0xd7f031=>!_0xd7f031),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1be053]};_0x34559e&&(_0x1cb64a['tag']='button',_0x1cb64a['on']={'click':_0x4c269a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1cb64a);}},St=class extends _0x2cd5dd{constructor(_0x25f802,_0x5700e0){super(_0x25f802),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5700e0['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x5700e0['color']['getColorVariable'](),'--ck-user-color-alpha':_0x5700e0['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Tt={'collapseAt':0x6,'displayMe':!0x0};var Ct=class extends _0x4b84ca{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_bodyCollection=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x287df3){super(_0x287df3),this['context']['config']['define']('presenceList',Tt);const _0x2b105f=_0x287df3['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2b105f)throw new _0x370faa('presencelist-collapseat-invalid-format',this);if(_0x2b105f<0x1)throw new _0x370faa('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Y)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1cc682(),this['balloonPanelView']=new _0x1ce97b(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[Y];}init(){for(const _0x1f27ab of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1f27ab);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1bc759,_0x1dcfb6)=>{this['_handleUserAdd'](_0x1dcfb6);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x194ae4,_0x5cc631)=>{this['_handleUserRemove'](_0x5cc631);});}_createView(){const _0x26d0f1=this['context'],_0x379209=new _t(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xdad45a=this['balloonPanelView'];if(!_0x44576b(_0x26d0f1['config']['get']('presenceList.container')))throw new _0x370faa('presencelist-missing-container',this);return _0x379209['counterView']['bind']('usersCount')['to'](this),_0x379209['bind']('isCollapsed')['to'](this,'usersCount',_0x16410d=>{const {collapseAt:_0x7676b6}=_0x26d0f1['config']['get']('presenceList'),_0x515a82=_0x16410d>=_0x7676b6;if(_0x515a82&&!_0x379209['inlineListView']['items']['find'](_0x3c8a96=>_0x3c8a96 instanceof wt)){const _0x5c73d2=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5c73d2&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x379209['inlineListView']['items']['add'](_0x379209['counterView']);}return _0x515a82||this['hideDropdown'](),_0x515a82;}),_0x379209['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x7fe347=>{const _0x4ee6fd=_0x26d0f1['config']['get']('presenceList'),_0x45ea34=new It(_0x26d0f1['locale'],_0x7fe347,!!_0x4ee6fd['onClick']);return _0x45ea34['bind']('hasTooltip')['to'](_0x379209,'isCollapsed',_0x119d7e=>!_0x119d7e),_0x45ea34['bind']('isFocusable')['to'](_0x379209,'isCollapsed',_0x487628=>!_0x487628),_0x4ee6fd['onClick']&&this['listenTo'](_0x45ea34,'execute',()=>{this['view']['isCollapsed']||_0x4ee6fd['onClick'](_0x7fe347,_0x45ea34['element']);}),_0x45ea34;}),this['listenTo'](_0x379209['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x379209['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x379209['inlineListView']['keystrokes']['set']('Enter',(_0x4e4cc8,_0x2dc2aa)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2dc2aa());}),_0x379209['render'](),_0xdad45a['render'](),_0x2d8d74({'emitter':_0x379209,'activator':()=>_0xdad45a['isVisible'],'contextElements':[_0xdad45a['element'],_0x379209['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x26d0f1['config']['get']('presenceList.container')['appendChild'](_0x379209['element']),this['_bodyCollection']=new _0x1affd0(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x379209;}['_handleUserAdd'](_0x35e7d9){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x35e7d9['isMe'])return;const _0x3a3515=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x3a3515-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x363810=_0x35e7d9['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x35e7d9,_0x363810);}['_handleUserRemove'](_0x1f0065){this['usersCount']--;const {collapseAt:_0x206f2f}=this['context']['config']['get']('presenceList'),_0x3c8ab7=this['usersCount']>=_0x206f2f;if(this['currentDisplayedUsers']['get'](_0x1f0065['id']))this['currentDisplayedUsers']['remove'](_0x1f0065['id']);else{if(_0x3c8ab7&&this['currentDisplayedUsers']['length']+0x1===_0x206f2f-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x3c8ab7?0x1:0x0)<this['usersCount']){for(const _0x20d9b7 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x20d9b7['id'])&&(this['currentDisplayedUsers']['add'](_0x20d9b7,Math['min'](this['currentDisplayedUsers']['length']-(_0x3c8ab7?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x3c8ab7?0x1:0x0)===_0x206f2f-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x493e1c=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new yt(this['context']['locale'],!!_0x493e1c['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0xbb5db4}=this['presenceDropdownView'];_0xbb5db4['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3f2dac=>{if(!_0x493e1c['displayMe']&&_0x3f2dac['isMe'])return null;const _0x2ae2f5=new kt(this['context']['locale'],_0x3f2dac,!!_0x493e1c['onClick']);return _0x493e1c['onClick']&&this['listenTo'](_0x2ae2f5,'execute',()=>{_0x493e1c['onClick'](_0x3f2dac,_0x2ae2f5['element']);}),_0x2ae2f5;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0xbb5db4['focus'](),_0xbb5db4['checkIfScrollable']();const _0x57009a=(_0x5dd1c0,_0x10b103)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x10b103();};_0xbb5db4['keystrokes']['set']('Esc',_0x57009a),_0xbb5db4['keystrokes']['set']('Shift+Tab',_0x57009a),_0xbb5db4['keystrokes']['set']('Tab',(_0x2ba4f9,_0x30b37f)=>{!function(_0x3605f5){const _0x516a8b=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x9c465e=>_0x9c465e+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xce5f82=[...document['body']['querySelectorAll'](_0x516a8b)]['filter'](_0xbcfa9e=>_0xbcfa9e===document['activeElement']||_0xbcfa9e['offsetWidth']+_0xbcfa9e['offsetHeight']>0x0)['sort']((_0x264f84,_0x4eaf99)=>(_0x264f84['tabIndex']||0x0)-(_0x4eaf99['tabIndex']||0x0)),_0x174537=_0xce5f82[(_0xce5f82['indexOf'](_0x3605f5)+0x1)%_0xce5f82['length']];_0x174537&&_0x174537['focus']();}(this['view']['element']),this['hideDropdown'](),_0x30b37f();}),_0xbb5db4['focusTracker']['add'](this['view']['element']),_0xbb5db4['focusTracker']['on']('change:isFocused',(_0x1ca204,_0x49c7f4,_0x46dd1f)=>{_0x46dd1f||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}},At=class extends _0x4b84ca{static get requires(){return[Y,Ct];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ot as CloudServicesCommentsAdapter,mt as CloudServicesRevisionHistoryAdapter,ht as CloudServicesTrackChangesAdapter,At as PresenceList,Ct as PresenceListUI,tt as RealTimeCollaborationClient,ut as RealTimeCollaborativeComments,nt as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,Y as Sessions,z as WebSocketGateway};
23
+ import{Context as _0x40150f,ContextPlugin as _0x1b8d8d,PendingActions as _0x308caf,Plugin as _0x198537}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x470142,Collection as _0x19921a,DomEmitterMixin as _0x188623,KeystrokeHandler as _0x2be03b,global as _0x1a9e1f,uid as _0x4ff846,version as _0x6ba88b}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x5157c9,BodyCollection as _0x5cfc09,LabelView as _0x305df9,ListItemView as _0x216f28,ListView as _0x3bbda9,Notification as _0x4b7247,View as _0x3c9057,clickOutsideHandler as _0x258569}from'@ckeditor/ckeditor5-ui';import{History as _0x402f9e,InsertOperation as _0x17d254,MarkerOperation as _0x573d35,ModelLiveRange as _0x267371,NoOperation as _0x1bd6a0,OperationFactory as _0x565114,RootAttributeOperation as _0x3ea597,transformOperationSets as _0x117acd}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x1297af}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x5a4319,CommentsService as _0x26b101,EditorService as _0x360e87,RevisionHistoryService as _0x4f20e5,TrackChangesService as _0x3c1634,User as _0xfaa43,WEB_SOCKET_GATEWAY_STATES as _0x3d94fb,WebSocketGateway as _0x9624bb}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x484af1,Users as _0x452795}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x1daf1d}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x165a37,TrackChangesEditing as _0x39fbf8}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x19436d,CommentsEditing as _0x520bc4,CommentsRepository as _0x2d3c83}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x22abf6}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x4afda6}from'es-toolkit/compat';var z=class WebSocketGateway extends _0x1b8d8d{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
+ ((()=>_0x9624bb)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x1297af,_0x4b7247];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x411921){super(_0x411921),this['set']('state',_0x3d94fb['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x188623())();}init(){const _0x282393=this['context'],_0x57d2c9=_0x282393['plugins']['get'](_0x1297af),_0xc91f3e=_0x282393['plugins']['get'](_0x4b7247);if(!_0x57d2c9['token'])throw new _0x470142('websocketgateway-missing-token',this);if(!_0x57d2c9['webSocketUrl'])throw new _0x470142('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),WebSocketGateway['WebSocketGateway']['connect'](_0x57d2c9['token'],_0x57d2c9['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x53de42=>{if(this['connection']=_0x53de42,this['bind']('state')['to'](_0x53de42,'state',this,'_isBrowserOffline',(_0x15c130,_0x1c6972)=>('connected'!==_0x15c130&&(this['_shouldPluginsReconnect']=!0x0),_0x1c6972||_0x15c130!==_0x3d94fb['CONNECTED']?_0x3d94fb['DISCONNECTED']:this['state']==_0x3d94fb['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3d94fb['CONNECTING']):_0x3d94fb['CONNECTED'])),this['connection']['on']('error',(_0x2880b7,_0x52ee63)=>{if('limitExceeded'!==_0x52ee63['code'])throw console['error'](_0x52ee63),new _0x470142('cloudservices-init',null,{'originalError':_0x52ee63});_0xc91f3e['showWarning']('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':'real-time-collaboration'});}),!_0x53de42['me'])return new Promise(_0x16e768=>_0x53de42['on']('change:me',_0x16e768));})['catch'](_0x4c5454=>{throw console['error'](_0x4c5454),new _0x470142('cloudservices-init',null,{'originalError':_0x4c5454});});}addToReconnectionStack(_0x3454db){if('function'!=typeof _0x3454db['reconnect'])throw new _0x470142('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3454db))throw new _0x470142('websocketgateway-plugin-already-registered',this,{'name':_0x3454db['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3454db);}removeFromReconnectionStack(_0x19337f){this['_reconnectionStack']['delete'](_0x19337f);}isInReconnectionStack(_0x3b3f41){return this['_reconnectionStack']['has'](_0x3b3f41);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x59fd78=>_0x59fd78['reconnect']())))['then'](()=>this['state']=_0x3d94fb['CONNECTED'])['catch'](_0x17c282=>{throw console['error'](_0x17c282),new _0x470142('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3d94fb['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},Y=class extends _0x1b8d8d{['channelSessions'];channelConnectedUsers;allConnectedUsers;_registeredSessions;_uniqueUsersCount;['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[z,_0x452795];}constructor(_0x56cccf){super(_0x56cccf),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x19921a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x452795);}init(){const _0x1a9a8c=this['context']['plugins']['get'](z);this['listenTo'](_0x1a9a8c,'change:state',(_0x119633,_0x5d9f94,_0x392e53)=>{if('connected'!==_0x392e53)this['channelSessions']['forEach'](_0x4cf1c7=>_0x4cf1c7['clear']()),this['channelConnectedUsers']['forEach'](_0x56800f=>_0x56800f['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x4a361b,_0x567846]of this['_registeredSessions'])for(const _0x1f1cee of _0x567846)this['_handleSessionAdd'](_0x4a361b,_0x1f1cee);}}),this['_createUser'](_0x1a9a8c['connection']['me'],!0x0);}register(_0x1b99b6,_0x4ee935){if(this['_registeredSessions']['has'](_0x1b99b6))throw new _0x470142('sessions-register-already-registered',null,{'channelId':_0x1b99b6});this['_registeredSessions']['set'](_0x1b99b6,_0x4ee935),this['channelSessions']['set'](_0x1b99b6,new _0x19921a()),this['channelConnectedUsers']['set'](_0x1b99b6,new _0x19921a()),this['listenTo'](_0x4ee935,'add',(_0x30078d,_0x1d22b0)=>this['_handleSessionAdd'](_0x1b99b6,_0x1d22b0)),this['listenTo'](_0x4ee935,'remove',(_0x1820ee,_0x23c2fd)=>this['_handleSessionRemove'](_0x1b99b6,_0x23c2fd));for(const _0x4032aa of _0x4ee935)this['_handleSessionAdd'](_0x1b99b6,_0x4032aa);}unregister(_0x4eba44){if(!this['_registeredSessions']['has'](_0x4eba44))throw new _0x470142('sessions-unregister-not-exist',null,{'channelId':_0x4eba44});const _0x54af09=this['_registeredSessions']['get'](_0x4eba44);this['stopListening'](_0x54af09);for(const _0x26a3bd of _0x54af09)'connected'===this['context']['plugins']['get'](z)['state']&&this['_handleSessionRemove'](_0x4eba44,_0x26a3bd);this['_registeredSessions']['delete'](_0x4eba44),this['channelSessions']['delete'](_0x4eba44),this['channelConnectedUsers']['delete'](_0x4eba44);}get['mySessionId'](){return this['context']['plugins']['get'](z)['connection']['sessionId'];}getUserBySessionId(_0x2545c1){for(const _0x293257 of this['channelSessions']['values']())for(const _0x1a9ce8 of _0x293257)if(_0x1a9ce8['id']===_0x2545c1)return _0x1a9ce8['user'];}getUserSessions(_0x18a958,_0x22f590){const _0x148c68=_0x22f590?[this['channelSessions']['get'](_0x22f590)]:this['channelSessions']['values'](),_0x205af5=new Set();for(const _0x4050fd of _0x148c68)for(const _0x383649 of _0x4050fd)_0x383649['user']['id']===_0x18a958['id']&&_0x205af5['add'](_0x383649['id']);return _0x205af5;}getUserRole(_0x1d8a2a){for(const _0x2423fa of this['channelSessions']['values']())for(const _0x1da008 of _0x2423fa)if(_0x1da008['user']===_0x1d8a2a)return _0x1da008['role'];}['_handleSessionAdd'](_0x2c4070,_0x57560a){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x5e787b=_0x57560a['user'],_0x17a59b=this['_users']['getUser'](_0x5e787b['id'])||this['_createUser'](_0x5e787b),_0x17de86=Object['assign']({},_0x57560a,{'user':_0x17a59b});if(this['channelSessions']['get'](_0x2c4070)['add'](_0x17de86),!_0x5e787b['hiddenInPresenceList']){const _0x319936=this['channelConnectedUsers']['get'](_0x2c4070);_0x319936['has'](_0x17a59b['id'])||_0x319936['add'](_0x17a59b),this['allConnectedUsers']['has'](_0x17a59b['id'])||_0x5e787b['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x17a59b,_0x17a59b['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x2c4070,{'channelId':_0x2c4070,'session':_0x17de86});}['_handleSessionRemove'](_0x3d92bd,_0x5d6200){if('connected'!==this['context']['plugins']['get'](z)['state'])return;const _0x45a67a=this['channelConnectedUsers']['get'](_0x3d92bd),_0xb03e4d=_0x5d6200['user'];_0xb03e4d['id']&&(this['channelSessions']['get'](_0x3d92bd)['remove'](_0x5d6200['id']),_0x45a67a['has'](_0xb03e4d['id'])&&!this['getUserSessions'](_0xb03e4d,_0x3d92bd)['size']&&_0x45a67a['remove'](_0xb03e4d['id']),this['allConnectedUsers']['get'](_0xb03e4d['id'])&&!this['getUserSessions'](_0xb03e4d)['size']&&this['allConnectedUsers']['remove'](_0xb03e4d['id']));}_createUser(_0x42b80e,_0x4d2204){const _0xc3b74a=this['_users']['addUser'](_0x42b80e);return _0x4d2204&&this['_users']['defineMe'](_0x42b80e['id']),_0xc3b74a['orderNumber']=this['_uniqueUsersCount']++,_0xc3b74a;}},K=class extends _0x198537{_domEmitter=new(_0x188623())();static get requires(){return[Y];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x3f82e2=this['editor'],_0x2313db=_0x3f82e2['plugins']['get'](Y);_0x3f82e2['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x257ba9,{writer:_0x284b19})=>function(_0x4e4207,_0xd2e64b,_0x281b78,_0x464a6e){const _0x1a062e=_0x4e4207['markerName']['split'](':')[0x2],_0xb8afa0=_0x281b78['getUserBySessionId'](_0x1a062e);if(!_0xb8afa0||_0x1a062e===_0x281b78['mySessionId'])return;if(!_0x464a6e['model']['schema']['checkChild'](_0x4e4207['markerRange']['start'],'$text'))return;const _0x16ac52={'class':'ck-user__marker\x20'+_0xb8afa0['color']['getMarkerClass'](),'style':Q(_0xb8afa0),'data-name':_0xb8afa0['name'],'data-session-id':_0x1a062e},_0x2c3765=_0x464a6e['model']['markers']['get'](_0x4e4207['markerName'])['getStart'](),_0x350715=_0x2c3765['nodeAfter'],_0x14b7f9=_0x464a6e['model']['schema'];if(_0x350715&&_0x14b7f9['isObject'](_0x350715)&&_0x14b7f9['isInline'](_0x350715)&&!_0x464a6e['model']['markers']['get']('user:range:'+_0x1a062e)['getRange']()['isCollapsed'])return;const _0x2b151d=_0x2c3765['parent'];return _0x464a6e['model']['schema']['isLimit'](_0x2b151d)&&!_0x464a6e['model']['hasContent'](_0x2b151d)&&(_0x16ac52['contenteditable']=!0x1),function(_0x32a942,_0x5d9c25,_0x26a6fc){const _0x2cde49=_0x32a942['createUIElement']('span',_0x5d9c25);return _0x32a942['setCustomProperty']('userPositionMarker',!0x0,_0x2cde49),_0x2cde49['render']=function(_0x201d89){const _0x183a46=this['toDomElement'](_0x201d89),_0x37599d=document['createElement']('span');return _0x37599d['classList']['add']('ck-user__marker-tooltip'),_0x37599d['setAttribute']('contenteditable','false'),_0x37599d['setAttribute']('spellcheck','false'),_0x37599d['textContent']=_0x26a6fc['name'],_0x183a46['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x37599d['outerHTML']+'⁠',_0x183a46['addEventListener']('mouseenter',()=>{_0x183a46['classList']['add']('ck-user__marker_hovered');}),_0x183a46['addEventListener']('mouseleave',()=>{_0x183a46['classList']['remove']('ck-user__marker_hovered');}),_0x183a46;},_0x2cde49['isSimilar']=function(_0xab327){return!(!this['getCustomProperty']('userPositionMarker')||!_0xab327['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xab327['getAttribute']('data-session-id'));},_0x2cde49;}(_0xd2e64b,_0x16ac52,_0xb8afa0);}(_0x257ba9,_0x284b19,_0x2313db,_0x3f82e2)}),_0x3f82e2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3cd5d2=>function(_0x54b663,_0x1c961d){const _0xf18cf8=_0x54b663['markerName']['split'](':')[0x2];if(_0xf18cf8===_0x1c961d['mySessionId'])return null;const _0x4db49f=_0x1c961d['getUserBySessionId'](_0xf18cf8);return _0x4db49f?{'id':_0xf18cf8,'classes':['ck-user__selection',_0x4db49f['color']['getSelectionClass']()],'attributes':{'style':Q(_0x4db49f),'data-session-id':_0xf18cf8},'priority':0x7d0+_0x4db49f['orderNumber']}:{'id':_0xf18cf8,'classes':[]};}(_0x3cd5d2,_0x2313db)}),function(_0x87b138){const _0x2c8b22=_0x87b138['model'],_0x5403b8=new Map(),_0x4906c4=_0x87b138['plugins']['get'](Y);_0x2c8b22['markers']['on']('update:user:range',(_0x329b03,_0x299f18,_0x4fc0ad,_0x260025)=>{if(!_0x260025&&_0x5403b8['get'](_0x299f18['name']))return _0x5403b8['get'](_0x299f18['name'])['detach'](),void _0x5403b8['delete'](_0x299f18['name']);const _0x25a5f0=_0x299f18['name']['split'](':')[0x2];if(_0x25a5f0===_0x4906c4['mySessionId'])return;const _0x393258='user:position:'+_0x25a5f0;_0x2c8b22['markers']['has'](_0x393258)&&_0x87b138['editing']['reconvertMarker'](_0x393258),_0x299f18['on']('change:range',(_0x1efb3a,_0x109d88,_0x3a1b34)=>{if('$graveyard'!=_0x109d88['root']['rootName']&&'$graveyard'==_0x299f18['getRange']()['root']['rootName']&&!_0x5403b8['has'](_0x299f18['name'])){const _0x283fac=_0x2c8b22['schema']['getNearestSelectionRange'](_0x3a1b34['deletionPosition']);if(_0x283fac){const _0x46e623=_0x267371['fromRange'](_0x283fac);_0x5403b8['set'](_0x299f18['name'],_0x46e623),_0x46e623['on']('change:range',(_0x3e027a,_0x12adea,_0xfa73d6)=>{if('$graveyard'==_0x46e623['root']['rootName']){const _0x4b769d=_0x2c8b22['schema']['getNearestSelectionRange'](_0xfa73d6['deletionPosition']);_0x4b769d?(_0x46e623['start']=_0x4b769d['start'],_0x46e623['end']=_0x4b769d['end']):(_0x5403b8['delete'](_0x299f18['name']),_0x46e623['detach']());}});}}});}),_0x2c8b22['document']['on']('change',()=>{_0x5403b8['size']>0x0&&_0x2c8b22['enqueueChange']({'isUndoable':!0x1},_0x432149=>{for(const [_0x154e77,_0x20dc0f]of _0x5403b8)'$graveyard'==_0x2c8b22['markers']['get'](_0x154e77)['getRange']()['root']['rootName']&&(J(_0x154e77['split'](':')[0x2],_0x20dc0f['toRange'](),_0x2c8b22,_0x432149),_0x20dc0f['detach']());_0x5403b8['clear']();});});}(_0x3f82e2),this['_domEmitter']['listenTo'](_0x1a9e1f['document'],'keydown',(_0x472df1,{key:_0x5581d8})=>{'Escape'===_0x5581d8&&function(_0x4f5b6d){_0x4f5b6d['editing']['view']['change'](_0x49cf70=>{for(const _0x58857c of _0x4f5b6d['model']['markers']){if(!_0x58857c['name']['startsWith']('user:position'))continue;const _0x19b667=_0x4f5b6d['editing']['mapper']['markerNameToElements'](_0x58857c['name']);if(_0x19b667){for(const _0x578607 of _0x19b667)_0x49cf70['removeClass']('ck-user__marker_hovered',_0x578607);}}});}(_0x3f82e2);},{'useCapture':!0x0});}afterInit(){const _0x2af7e9=this['editor'],_0x92d534=_0x2af7e9['commands']['get']('undo');_0x92d534&&_0x2af7e9['model']['on']('applyOperation',(_0x4f53ba,_0x594479)=>{const _0x2c865f=_0x594479[0x0];if(!_0x2c865f['isDocumentOperation'])return;if('marker'!=_0x2c865f['type']||!_0x2c865f['name']['startsWith']('user:'))return;const _0x1c7df9=_0x2c865f['batch'];_0x92d534['_createdBatches']['has'](_0x1c7df9)&&(_0x2c865f['newRange']=_0x2c865f['oldRange']?_0x2af7e9['model']['createRange'](_0x2c865f['oldRange']['start'],_0x2c865f['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x49260f=this['editor'],_0x2f561c=_0x49260f['model']['document'],_0x5b1729=_0x49260f['plugins']['get'](Y);_0x49260f['model']['enqueueChange']({'isUndoable':!0x1},_0x3bb41b=>{const _0x249f24='user:range:'+_0x5b1729['mySessionId'],_0x2e8a33='user:position:'+_0x5b1729['mySessionId'],_0x2a30da=_0x49260f['model']['markers']['has'](_0x249f24);_0x49260f['editing']['view']['hasDomSelection']?J(_0x5b1729['mySessionId'],_0x2f561c['selection']['getFirstRange'](),_0x49260f['model'],_0x3bb41b):_0x2a30da&&(_0x3bb41b['removeMarker'](_0x249f24),_0x3bb41b['removeMarker'](_0x2e8a33));});}};function J(_0x54be85,_0x2b99b9,_0x49a06d,_0x1437eb){const _0x46b1d9='user:range:'+_0x54be85,_0x10fa7f='user:position:'+_0x54be85,_0x63c989=_0x2b99b9['getContainedElement']();let _0x2c11a9=_0x2b99b9['start'];if(_0x63c989&&_0x63c989['is']('element','tableCell')){const _0x9858e9=function(_0x4bcda8,_0x1a4d5e){for(const _0x45a928 of _0x4bcda8['getPositions']())if(_0x1a4d5e['schema']['checkChild'](_0x45a928,'$text'))return _0x45a928;}(_0x2b99b9,_0x49a06d);_0x9858e9&&(_0x2c11a9=_0x9858e9,_0x2b99b9=_0x1437eb['createRange'](_0x2c11a9));}const _0x4e4772=_0x1437eb['createRange'](_0x2c11a9);_0x49a06d['markers']['has'](_0x46b1d9)?(_0x1437eb['updateMarker'](_0x46b1d9,{'range':_0x2b99b9}),_0x1437eb['updateMarker'](_0x10fa7f,{'range':_0x4e4772})):(_0x1437eb['addMarker'](_0x46b1d9,{'range':_0x2b99b9,'usingOperation':!0x0}),_0x1437eb['addMarker'](_0x10fa7f,{'range':_0x4e4772,'usingOperation':!0x0}));}function Q(_0x55f5a9){return'--ck-user-color:'+_0x55f5a9['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x55f5a9['color']['getColorAlphaVariable']()+';';}function X(_0x2279ed,_0x12691b,_0x55d121){const _0xa846d6=_0x2279ed['t'],t=_0x2279ed['t'];switch(_0x12691b){case'PENDING_ACTION_SENDING_DATA':return t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'});case'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'Synchronization\x20issue':return t('Synchronization\x20issue');case'Connected\x20users\x20list\x20dropdown\x20menu':return t('Connected\x20users\x20list\x20dropdown\x20menu');case'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':return t('Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)');case'Connected\x20users\x20list':return t('Connected\x20users\x20list');case'PENDING_ACTION_REVISION_HISTORY':return _0xa846d6({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'CONNECTED_USERS':return t({'string':'1\x20connected\x20user\x20(me)','plural':'%0\x20connected\x20users','id':'CONNECTED_USERS'},_0x55d121);default:return'';}}let Z=0x1;var tt=class RealTimeCollaborationClient extends _0x198537{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x5a4319)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[z,Y,K,_0x308caf,_0x452795,_0x4b7247];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get cloudDocumentVersion(){return this['_lastServerVersion']+this['_offset'];}get _lastServerVersion(){return this['serverHistory']['version']-this['_offset'];}get lastSyncVersion(){const _0x77e21=this['serverHistory']['getOperations']();for(let _0x6ceb=_0x77e21['length']-0x1;_0x6ceb>=0x0;_0x6ceb--){const _0x3ff8e9=_0x77e21[_0x6ceb];if(!this['_disconnectionOperations']['has'](_0x3ff8e9))return _0x3ff8e9['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x20d785){if(super(_0x20d785),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x402f9e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x470142('collaboration-missing-channelid',this);const _0x358eea=_0x20d785['config']['get']('cloudServices.bundleVersion')||_0x6ba88b;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x358eea,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1daf1d(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new it(this['_disconnectionOperations']);}init(){const _0x495810=this['editor'],_0x1ea7cc=_0x495810['plugins']['get'](_0x452795),_0x4eef19=_0x495810['plugins']['get'](z);this['listenTo'](_0x1ea7cc,'getOperationAuthor',(_0x5ef32f,_0x59bfdf)=>{const _0x2e5daa=_0x59bfdf[0x0];_0x2e5daa['_authorId']&&(_0x5ef32f['return']=_0x1ea7cc['getUser'](_0x2e5daa['_authorId']),_0x5ef32f['stop']()),null===_0x2e5daa['_authorId']&&(_0x5ef32f['return']=null,_0x5ef32f['stop']());},{'priority':'high'}),this['listenTo'](_0x495810['model']['document']['selection'],'change:range',(_0x25ca7d,_0x25fb22)=>{_0x25fb22['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x495810['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x495810['model']['on']('applyOperation',(_0x623177,_0x21688d)=>{const _0x1972ea=_0x21688d[0x0];_0x1972ea['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1972ea),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x4eef19,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x33aefb,_0x377f92,_0x4c76ee)=>'connected'===_0x33aefb&&!_0x377f92&&!_0x4c76ee),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x495810['disableReadOnlyMode']('rtc-offline'):_0x495810['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x495810['disableReadOnlyMode']('rtc-offline'):_0x495810['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x1e5c84=this['editor']['plugins']['get'](Y),_0x4e7299=this['editor']['plugins']['get'](z);try{this['_isPendingUpdate']=!0x0,_0x1e5c84['unregister'](this['_channelId']);const _0x9d9cbc=await this['_service']['reconnect'](_0x4e7299['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x9d9cbc)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x185817=await this['_service']['getConnectedSessions']();_0x1e5c84['register'](this['_channelId'],_0x185817),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x23fc99){if(function(_0x2fc85d){return'404'===_0x2fc85d['code'];}(_0x23fc99)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4890d0){return'409'===_0x4890d0['code'];}(_0x23fc99)){const _0x50ab3b=X(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x50ab3b);}else{if(!(_0x23fc99 instanceof et))throw _0x23fc99;this['_handleReconnectionError']();}}}}destroy(){const _0x5984e1=this['editor']['plugins']['get'](z),_0xb44e9b=this['editor']['plugins']['get'](Y);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0xb44e9b['channelSessions']['has'](this['_channelId'])&&_0xb44e9b['unregister'](this['_channelId']),_0x5984e1['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x1be2ba){if(this['sessionId']!==_0x1be2ba['sessionId']&&this['_lastSyncedOperationId']!==_0x1be2ba['lastOperationId'])throw new et();return this['sessionId']=_0x1be2ba['sessionId'],this['_handleServerResponse']([],{..._0x1be2ba,'wereChangesApplied':!0x1,'data':_0x1be2ba['data']},'reconnect');}async _connectService(_0x41ae68,_0x9f7629=!0x1){const {connection:_0x115742}=this['editor']['plugins']['get'](z);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x115742,this['_channelId'])['then'](_0x2d0132=>this['_initSessionsHandling'](_0x2d0132))['catch'](_0x14e8f2=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x14e8f2);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4ae159,_0x382875)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x382875);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x5b0f87=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x41ae68);this['_isPendingUpdate']=!0x0;const _0x50fbb6=await this['_service']['connect'](_0x115742,this['_compressOperations'](_0x41ae68),_0x5b0f87);if(this['sessionId']=_0x50fbb6['sessionId'],_0x9f7629){if(!_0x50fbb6['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x50fbb6['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x41ae68,_0x50fbb6,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x50fbb6,_0x41ae68);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x302b53=this['editor']['plugins']['get'](Y),_0x2dc07b=this['editor']['plugins']['get'](K),_0x5e958a=_0x302b53['channelSessions']['get'](this['_channelId']);_0x5e958a&&_0x5e958a['length']>0x1?_0x2dc07b['createUserMarkerOperations']():this['listenTo'](_0x302b53,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x302b53['channelSessions']['get'](this['_channelId'])['length']&&_0x2dc07b['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x1383ad,_0x4b6ab4,_0x543cf9,_0x18f7ae){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x4b6ab4){const _0x355bc9=this['_decompressOperations'](_0x543cf9,_0x18f7ae);await this['_fetchMissingUsers'](_0x355bc9),this['_handleExternalOperations'](_0x355bc9,_0x4b6ab4,_0x543cf9['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x456bcf}=this['editor'];let _0x41c5f2;try{_0x41c5f2=await this['_service']['getDocumentDetails']();}catch{const _0x562f51=X(_0x456bcf,'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x562f51);}const _0x205d02=_0x41c5f2['currentDocumentSession']||_0x41c5f2['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x205d02['lastOperationId']){const _0x50c1a9=X(_0x456bcf,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x50c1a9);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x654fe0=this['editor']['plugins']['get'](z);if(this['_isConnected']=!0x1,!_0x654fe0['connection']||'connected'!==_0x654fe0['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x18513e=this['editor']['plugins']['get'](Y);_0x18513e['channelSessions']['has'](this['_channelId'])&&_0x18513e['unregister'](this['_channelId']),_0x654fe0['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x336fdf){const _0x459c7b=this['editor']['plugins']['get'](Y);this['listenTo'](_0x459c7b,'sessionAdd:'+this['_channelId'],(_0x13a09b,{session:_0x546e32})=>{if(_0x546e32['id']===_0x459c7b['mySessionId']){_0x13a09b['off']();const _0x81a745=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x566750=_0x546e32['permissions'];_0x81a745&&_0x81a745['isEnabled']&&(_0x566750=_0x566750['filter'](_0x3de608=>'document:write'!==_0x3de608)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x566750,this['_channelId']);}}),_0x459c7b['register'](this['_channelId'],_0x336fdf);}_initThrowingOnDataSet(){const _0x3b82b2=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x54d093)=>{if(!_0x54d093[_0x54d093['length']-0x1]['suppressErrorInCollaboration'])throw new _0x470142('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3b82b2['apply'](this['editor']['data'],_0x54d093);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x1efa00,[_0x5f55ac])=>{if(this['_document']['version'])throw new _0x470142('realtimecollaborationclient-init-document-already-initialized',this);_0x1efa00['stop'](),this['_setPendingAction']();const _0x876517=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x9b32aa])=>!_0x9b32aa['lazyLoad'])['map'](([_0x13ebba,_0x480e6c])=>[_0x13ebba,_0x480e6c['modelAttributes']||{}])),_0x433885=this['_getOperationsFromInitData'](_0x5f55ac,_0x876517);0x0==_0x433885['length']&&_0x433885['push'](new _0x1bd6a0(0x0)),_0x1efa00['return']=this['_connectService'](_0x433885)['then'](()=>{this['editor']['plugins']['get'](z)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x43138a=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x43138a))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x4ab2e8,[_0x309a19,_0x525bc4])=>{_0x4ab2e8['stop']();const _0x1f95e0=this['editor']['model']['document']['getRoot'](_0x309a19);if(!this['_knownRootNames']['has'](_0x309a19)){const _0x118ef7=_0x525bc4&&_0x525bc4['data']?_0x525bc4['data']:'',_0x4efbb1=_0x525bc4&&_0x525bc4['attributes']?_0x525bc4['attributes']:{};await this['_loadRoot'](_0x309a19,_0x118ef7,_0x4efbb1);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x1f95e0['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x1f95e0);});},{'priority':'high'});}async _fetchMissingUsers(_0x258f3d){const _0x24d2e0=this['editor']['plugins']['get'](_0x452795),{connection:_0x2373b7}=this['editor']['plugins']['get'](z),_0x34ba5c=new Set();for(const _0x1d7841 of _0x258f3d){const _0xab4911=_0x1d7841['_authorId'];_0xab4911&&!_0x24d2e0['getUser'](_0xab4911)&&_0x34ba5c['add'](_0xab4911);}if(0x0===_0x34ba5c['size'])return;const _0x5d618e=await _0xfaa43['getMany'](_0x2373b7,Array['from'](_0x34ba5c));for(const _0x224baf of _0x5d618e)_0x24d2e0['getUser'](_0x224baf['id'])||_0x24d2e0['addUser'](_0x224baf);}_getOperationsFromInitData(_0x6892a4,_0x28993d={}){const _0x127706=this['editor']['model'],_0x1af921=[];let _0x5da225=0x0;const _0x172ac0='string'==typeof _0x6892a4?{'main':_0x6892a4}:_0x6892a4;for(const _0x73bcc4 of Object['keys'](_0x172ac0)){if(!this['_document']['roots']['has'](_0x73bcc4))throw new _0x470142('realtimecollaborationclient-init-non-existent-root',this);const _0x410b81=this['_document']['getRoot'](_0x73bcc4),_0x1f4efd=this['editor']['data']['parse'](_0x172ac0[_0x73bcc4],_0x410b81),_0x34c5bc=new _0x17d254(_0x127706['createPositionAt'](_0x410b81,0x0),_0x1f4efd,_0x5da225++);_0x1af921['push'](_0x34c5bc);for(const [_0x59cbe3,_0x511bd1]of _0x1f4efd['markers']){const _0x381781=new _0x573d35(_0x59cbe3,null,_0x127706['createRange'](_0x127706['createPositionFromPath'](_0x410b81,_0x511bd1['start']['path']['slice']()),_0x127706['createPositionFromPath'](_0x410b81,_0x511bd1['end']['path']['slice']())),_0x127706['markers'],!0x0,_0x5da225++);_0x1af921['push'](_0x381781);}}if(_0x28993d)for(const [_0x2e4de4,_0x58d9d7]of Object['entries'](_0x28993d)){const _0x1018f3=_0x127706['document']['getRoot'](_0x2e4de4);if(!_0x1018f3)throw new _0x470142('multi-root-editor-root-attributes-no-root',null);for(const [_0x6a8a2,_0x5229f1]of Object['entries'](_0x58d9d7))if(null!==_0x5229f1){const _0x3feea3=new _0x3ea597(_0x1018f3,_0x6a8a2,null,_0x5229f1,_0x5da225++);_0x1af921['push'](_0x3feea3);}}return _0x1af921;}async _loadRoot(_0xbd37da,_0x2f7f12,_0xd1ecbe){this['_getOperationsFromInitData']({[_0xbd37da]:_0x2f7f12},{[_0xbd37da]:_0xd1ecbe})['forEach']((_0x544424,_0x2836f6)=>{_0x544424['baseVersion']=this['_document']['version']+_0x2836f6,_0x544424['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x544424);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x2c9ccf,_0x7bce73){let _0x2b10cf;this['_offset']=_0x2c9ccf['offset'];const _0x5a0423=_0x2c9ccf['wereChangesApplied']&&!_0x2c9ccf['initData'],_0x5f1379=_0x5a0423?0x0:_0x2c9ccf['data']['baseVersion'];if(_0x7bce73['forEach'](_0x2b19c3=>{_0x2b19c3['_isInit']=!0x0,_0x2b19c3['createdAt']=_0x2c9ccf['sessionCreatedAt'],_0x2b19c3['_authorId']=null;}),_0x5a0423)_0x2b10cf=_0x7bce73,this['_applyOperationsSet'](_0x2b10cf,_0x5a0423);else{if(_0x2c9ccf['initData']){const _0x241554=this['_getOperationsFromInitData'](_0x2c9ccf['initData']);this['_document']['history']['version']=-_0x241554['length'],_0x241554['forEach'](_0x5de4c6=>{_0x5de4c6['baseVersion']-=_0x241554['length'],_0x5de4c6['createdAt']=_0x2c9ccf['sessionCreatedAt'],_0x5de4c6['_isInit']=!0x0,_0x5de4c6['_authorId']=null;}),this['_applyOperationsSet'](_0x241554,!0x0),this['serverHistory']['version']=-_0x241554['length']+this['_offset'],this['_updateServerHistory'](_0x241554);}this['_document']['history']['version']=_0x5f1379,_0x2b10cf=this['_decompressOperations'](_0x2c9ccf['data'],_0x2c9ccf['metadata']),await this['_fetchMissingUsers'](_0x2b10cf),this['_applyOperationsSet'](_0x2b10cf,_0x5a0423);}_0x2c9ccf['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2b10cf,_0x2c9ccf['lastOperationId']),this['_lastSyncedOperationId']=_0x2c9ccf['lastOperationId']),this['serverHistory']['version']=_0x5f1379+this['_offset'],this['_updateServerHistory'](_0x2b10cf),_0x7bce73['filter'](_0x211316=>{const _0x5ae195=this['_getAffectedRoot'](_0x211316);return _0x5ae195&&!this['_knownRootNames']['has'](_0x5ae195);})['forEach']((_0x244c6b,_0x5c402b)=>{_0x244c6b['baseVersion']=this['_document']['version']+_0x5c402b,this['_saveOperationInBuffer'](_0x244c6b);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x285357,_0x269eb2){const _0x527b32=_0x269eb2&&_0x269eb2['message'];if(_0x527b32&&_0x527b32['startsWith']('realtimecollaborationclient'))throw _0x269eb2;const _0xb32b7d=this['editor']['plugins']['get'](z);throw this['_isPendingUpdate']=!0x0,_0xb32b7d['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x470142(_0x285357,this['editor'],_0x527b32?{'originalError':_0x527b32}:void 0x0);}_saveOperationInBuffer(_0x2ded21){this['_knownOperations']['has'](_0x2ded21)||(this['_knownOperations']['add'](_0x2ded21),this['_bufferedOperations']['push'](_0x2ded21),this['_pendingAction']||'marker'==_0x2ded21['type']&&!_0x2ded21['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x2b80db=!0x1){!_0x2b80db&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x483b20=>{_0x483b20&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x8c5463=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x16581d){return _0x16581d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x16581d['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x16581d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x8c5463)||this['_crash'](_0x8c5463['message'],_0x8c5463);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x435ddc=>{this['on']('change:_isPendingUpdate',()=>{_0x435ddc();});});}async _sendBufferedOperations(){const _0x1dcf23=this['editor']['plugins']['get'](K);if(this['_shouldSendSelectionUpdate']()&&(_0x1dcf23['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1279fd=[...this['_bufferedOperations']];for(const _0x90faf2 of _0x1279fd)_0x90faf2['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x90faf2);const _0x2805a0=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1279fd),_0x3638ad=Z++,_0xeec778=this['_compressOperations'](_0x1279fd),_0x32d539=await this['_service']['sendOperations'](_0xeec778,_0xeec778['baseVersion'],_0x2805a0);try{return await this['_handleServerResponse'](_0x1279fd,_0x32d539,_0x3638ad);}catch(_0x5e89a5){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x5e89a5);}}async['_handleServerResponse'](_0x20d489,_0x3eb623,_0x42c323){if('error'in _0x3eb623)throw _0x3eb623['error'];let _0xfa7918;if(_0x3eb623['wereChangesApplied']){_0x3eb623['lastOperationId']&&(this['_lastSyncedOperationId']=_0x3eb623['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x47673c=>!_0x20d489['includes'](_0x47673c));for(const _0x15de43 of _0x20d489)_0x15de43['createdAt']='lastOperationAcceptedAt'in _0x3eb623&&_0x3eb623['lastOperationAcceptedAt']||void 0x0;st(_0x20d489,_0x3eb623['version']-_0x20d489['length']),this['_updateServerHistory'](_0x20d489);const _0x52a969=_0x20d489['filter'](_0x483e0b=>{if(!_0x483e0b['_isInit'])return!0x1;const _0x57689b=this['_getAffectedRoot'](_0x483e0b);return _0x57689b&&!this['_knownRootNames']['has'](_0x57689b);});st(_0x52a969,this['_document']['version']),this['_applyOperationsSet'](_0x52a969),_0xfa7918=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x23e454=this['_decompressOperations'](_0x3eb623['data'],_0x3eb623['metadata'])['filter'](_0x3bee07=>_0x3bee07['baseVersion']>=this['_lastServerVersion']);_0x23e454['forEach'](_0x281112=>this['_addKnownRoot'](_0x281112)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x557ff2=>!_0x557ff2['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x557ff2))),this['_bufferedOperations']['length']&&st(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x23e454),_0xfa7918=this['_handleExternalOperations'](_0x23e454,_0x3eb623['version'],_0x3eb623['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0xfa7918?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x28b526,_0x525763,_0x1e5694){try{const _0x3a22a2={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4ef4c6,operationsB:_0x11f9f4,originalOperations:_0x626dae}=_0x117acd(_0x28b526,this['_bufferedOperations'],_0x3a22a2);st(_0x4ef4c6,this['_document']['version']),st(_0x11f9f4,_0x525763);for(const _0x33b400 of _0x4ef4c6){const _0x1a68a9=_0x626dae['get'](_0x33b400);_0x1a68a9?(_0x33b400['_authorId']=_0x1a68a9['_authorId'],'noop'!==_0x33b400['type']&&(_0x33b400['_aiSource']=_0x1a68a9['_aiSource'])):_0x33b400['_authorId']=null;}for(const _0x456382 of _0x11f9f4)'noop'!==_0x456382['type']&&(_0x456382['_aiSource']=_0x626dae['get'](_0x456382)?.['_aiSource']);_0x1e5694&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x28b526,_0x1e5694),this['_lastSyncedOperationId']=_0x1e5694),this['_bufferedOperations']=[..._0x11f9f4],this['_applyOperationsSet'](_0x4ef4c6),this['_updateServerHistory'](_0x28b526);}catch(_0x55fa7a){return console['error'](_0x55fa7a),!0x1;}return!0x0;}_applyOperationsSet(_0x117ecf,_0x27a616=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x26f565=>{for(const _0x535f0f of _0x117ecf)this['_knownOperations']['add'](_0x535f0f),this['_addKnownRoot'](_0x535f0f),_0x26f565['batch']['addOperation'](_0x535f0f),this['editor']['model']['applyOperation'](_0x535f0f);});}_addKnownRoot(_0x1bb9f7){const _0x47bc75=this['_getAffectedRoot'](_0x1bb9f7);_0x47bc75&&this['_knownRootNames']['add'](_0x47bc75);}_getAffectedRoot(_0x1085db){let _0x39f005,_0x3fad81;switch(_0x1085db['type']){case'insert':_0x39f005=_0x1085db['position']['root'];break;case'marker':if(_0x3fad81=_0x1085db['newRange'],!_0x3fad81)return null;_0x39f005=_0x3fad81['root'];break;case'addRootAttribute':_0x39f005=_0x1085db['root'];break;case'addRoot':_0x39f005=_0x1085db['affectedSelectable'];break;case'move':_0x39f005=_0x1085db['targetPosition']['root'];break;default:return null;}return _0x39f005['rootName'];}_updateServerHistory(_0x243c88){_0x243c88['forEach'](_0x64bc59=>{const _0x323101=_0x64bc59['clone']();_0x323101['_authorId']=_0x64bc59['_authorId'],_0x323101['_isInit']=!!_0x64bc59['_isInit'],_0x323101['_aiSource']=_0x64bc59['_aiSource'],_0x323101['createdAt']=_0x64bc59['createdAt'],_0x323101['baseVersion']+=this['_offset'],_0x64bc59['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x323101),this['serverHistory']['addOperation'](_0x323101);});}_handleReconnectionError(_0x49d88f){const _0x51a21f=this['editor']['plugins']['get']('Notification'),_0x3c1d00=this['editor']['locale'];_0x49d88f||(_0x49d88f=X(_0x3c1d00,'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.')),_0x51a21f['showWarning'](_0x49d88f,{'title':X(_0x3c1d00,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](z)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x308caf)['add'](X(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x308caf)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x135ab6){const _0x53aff0=_0x135ab6['map'](_0x12064d=>_0x12064d['toJSON']());return this['_compressor']['compress'](_0x53aff0);}_decompressOperations(_0x55bbb1,_0x164f09){return this['_compressor']['decompress'](_0x55bbb1)['map']((_0x53ba4c,_0x44b95d)=>{const _0x18a8a4='init'==_0x164f09[_0x44b95d]['type'];if('InsertOperation'==_0x53ba4c['__className']){const _0x4e067c=_0x53ba4c['position']['root'];!this['_document']['getRoot'](_0x4e067c)&&(this['_document']['createRoot']('$unknown',_0x4e067c)['_isAttached']=!0x1);}else{if('RootOperation'==_0x53ba4c['__className']){const _0x258ecf=this['_document']['getRoot'](_0x53ba4c['rootName']);_0x258ecf&&'$unknown'==_0x258ecf['name']&&_0x53ba4c['elementName']!=_0x258ecf['name']&&(_0x258ecf['name']=_0x53ba4c['elementName']);}}const _0x5c72f6=_0x565114['fromJSON'](_0x53ba4c,this['_document']);return _0x5c72f6['wasUndone']=_0x53ba4c['wasUndone'],_0x5c72f6['_isInit']=_0x18a8a4,_0x5c72f6['_authorId']=_0x18a8a4?null:_0x164f09[_0x44b95d]['userId'],_0x5c72f6['_isDisconnection']='cs:removeUser'===_0x164f09[_0x44b95d]['type'],_0x5c72f6['_aiSource']=_0x53ba4c['_aiSource']||void 0x0,_0x5c72f6['createdAt']=_0x164f09[_0x44b95d]['createdAt'],_0x5c72f6;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x18901f=this['editor']['plugins']['get'](Y)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x18901f&&_0x18901f['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},et=class extends Error{};function st(_0x106ae6,_0x19591c){for(const _0x11d29a of _0x106ae6)_0x11d29a['baseVersion']=_0x19591c++;}var it=class{_ignoredOperations;_operationToId;constructor(_0x54e693){this['_ignoredOperations']=_0x54e693,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x288a58){let _0x16cb5c=_0x288a58['length'];for(;_0x16cb5c--;){const _0x18b24b=_0x288a58[_0x16cb5c];if(!this['_ignoredOperations']['has'](_0x18b24b)){if(!this['_operationToId']['has'](_0x18b24b)){const _0x1e9175=_0x4ff846()['slice'](0x1,0x12);this['_operationToId']['set'](_0x18b24b,_0x1e9175);}return this['_operationToId']['get'](_0x18b24b);}}}setIdForTheLastOperation(_0x184bfc,_0x535ee1){if(!_0x535ee1)return;let _0x5e74f7=_0x184bfc['length'];for(;_0x5e74f7--;){const _0x211481=_0x184bfc[_0x5e74f7];this['_ignoredOperations']['has'](_0x211481)||this['_operationToId']['set'](_0x211481,_0x535ee1);}}},nt=class extends _0x198537{static get requires(){return[tt];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ot=class CloudServicesCommentsAdapter extends _0x1b8d8d{static CommentsService=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x26b101)());['_services'];static get requires(){return[z,_0x2d3c83,Y,_0x452795];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e0544){super(_0x1e0544),this['_services']=new Map();}async init(){const _0x56240e=this['context'],_0x2b2e0f=_0x56240e['plugins']['get'](_0x2d3c83);if(_0x56240e['plugins']['get'](z)['addToReconnectionStack'](this),_0x2b2e0f['adapter']={'addCommentThread':async({channelId:_0x5eb518,threadId:_0x3bdfae,comments:_0x50f719,resolvedAt:_0x26ac4f,resolvedBy:_0x7b6fcf,context:_0x10103c,attributes:_0x21494d})=>{const _0xc58438=await this['_getService'](_0x5eb518)['addCommentThread']({'commentThreadId':_0x3bdfae,'comments':_0x50f719['map'](_0x4a5705=>function(_0x59170f,_0x10a6e3,_0x52d8fc){return{'commentThreadId':_0x52d8fc,'commentId':_0x59170f['commentId'],'userId':_0x59170f['authorId'],'content':_0x59170f['content'],'documentId':_0x10a6e3,'createdAt':_0x59170f['createdAt'],'attributes':_0x59170f['attributes']||{}};}(_0x4a5705,_0x5eb518,_0x3bdfae)),'resolvedAt':_0x26ac4f,'resolvedBy':_0x7b6fcf,'context':_0x10103c,'attributes':_0x21494d})['catch'](ct);return{'threadId':_0xc58438['commentThreadId'],'comments':_0xc58438['comments']};},'getCommentThread':async({channelId:_0x86bff,threadId:_0x2b5f98})=>{const _0x3c7304=await this['_getService'](_0x86bff)['getCommentThread'](_0x2b5f98)['catch'](rt)['catch'](ct);return _0x3c7304?_0x3c7304['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x3c7304]),{'threadId':_0x3c7304['commentThreadId'],'comments':_0x3c7304['comments']['map'](at),'context':_0x3c7304['context'],'resolvedAt':_0x3c7304['resolvedAt'],'resolvedBy':_0x3c7304['resolvedBy'],'attributes':_0x3c7304['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x4c7fbf,threadId:_0x521a66,context:_0x2c8dad,unlinkedAt:_0x47333b,attributes:_0x1aa0e2})=>this['_getService'](_0x4c7fbf)['updateCommentThread']({'commentThreadId':_0x521a66,'context':_0x2c8dad,'attributes':_0x1aa0e2,'unlinkedAt':_0x47333b})['catch'](rt)['catch'](ct),'resolveCommentThread':async({channelId:_0x51116a,threadId:_0x2e51a8})=>{const _0x40b74f=await this['_getService'](_0x51116a)['resolveCommentThread'](_0x2e51a8)['catch'](rt)['catch'](ct);return{'threadId':_0x40b74f['commentThreadId'],'resolvedAt':_0x40b74f['resolvedAt'],'resolvedBy':_0x40b74f['resolvedBy']};},'reopenCommentThread':async({channelId:_0x560a07,threadId:_0x555d88})=>this['_getService'](_0x560a07)['reopenCommentThread'](_0x555d88)['catch'](rt)['catch'](ct),'removeCommentThread':({channelId:_0x42efc8,threadId:_0x4fc6b2})=>this['_getService'](_0x42efc8)['removeCommentThread'](_0x4fc6b2)['catch'](rt)['catch'](ct),'addComment':({channelId:_0x20f71c,threadId:_0x79691,commentId:_0x374713,content:_0x2887d3,attributes:_0x7fe738})=>this['_getService'](_0x20f71c)['addComment'](_0x79691,_0x374713,_0x2887d3,_0x7fe738)['catch'](ct),'updateComment':({channelId:_0x4f6374,threadId:_0x5bf46c,commentId:_0x5c36e4,content:_0x5f045d,attributes:_0x16c7c0})=>this['_getService'](_0x4f6374)['updateComment'](_0x5bf46c,_0x5c36e4,_0x5f045d,_0x16c7c0)['catch'](rt)['catch'](ct),'removeComment':({channelId:_0xad690a,threadId:_0x407053,commentId:_0x59d30d})=>this['_getService'](_0xad690a)['removeComment'](_0x407053,_0x59d30d)['catch'](rt)['catch'](ct)},_0x56240e instanceof _0x40150f){const _0x31d301=_0x56240e['config']['get']('collaboration.channelId'),_0x10b045=_0x56240e['plugins']['get'](Y);await this['_setUpService'](_0x31d301);const _0x4f29d6=await this['_services']['get'](_0x31d301)['getConnectedSessions']();this['listenTo'](_0x10b045,'sessionAdd:'+_0x31d301,(_0x50b302,{session:_0x2c1fc4})=>{_0x2c1fc4['id']===_0x10b045['mySessionId']&&(_0x50b302['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2c1fc4['permissions'],_0x31d301));}),_0x10b045['register'](_0x31d301,_0x4f29d6);}}async _setUpService(_0x59c3c4){if(this['_services']['has'](_0x59c3c4))throw new _0x470142('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x59c3c4});const _0x2335f4=this['context']['plugins']['get'](_0x2d3c83),_0x4b2dfa=new CloudServicesCommentsAdapter['CommentsService'](_0x59c3c4);this['_services']['set'](_0x59c3c4,_0x4b2dfa),this['listenTo'](_0x4b2dfa,'commentThreadAdded',(_0x1ad2c1,_0x400a21)=>{const {commentThreadId:_0x1e421d,documentId:_0x19c2bd,context:_0x12da12,attributes:_0x1cea7a,resolvedAt:_0x5881f5,resolvedBy:_0x102d9f,comments:_0x32e517}=_0x400a21;_0x2335f4['getCommentThread'](_0x1e421d)||_0x2335f4['addCommentThread']({'threadId':_0x1e421d,'channelId':_0x19c2bd,'comments':_0x32e517?_0x32e517['map'](at):[],'context':_0x12da12,'attributes':_0x1cea7a,'resolvedAt':_0x5881f5,'resolvedBy':_0x102d9f,'isFromAdapter':!0x0});}),this['listenTo'](_0x4b2dfa,'commentThreadUpdated',(_0x4564ba,{commentThreadId:_0x590b41,documentId:_0x18b7a4,context:_0x5aaafb,unlinkedAt:_0x158df5,attributes:_0xe6980d})=>{_0x2335f4['getCommentThread'](_0x590b41)&&_0x2335f4['updateCommentThread']({'threadId':_0x590b41,'channelId':_0x18b7a4,'context':_0x5aaafb,'unlinkedAt':_0x158df5,'attributes':_0xe6980d,'isFromAdapter':!0x0});}),this['listenTo'](_0x4b2dfa,'commentThreadResolved',(_0x594cc3,{commentThreadId:_0x1406a1,resolvedBy:_0xcd9bb0,resolvedAt:_0x2b551f})=>{const _0x483647=_0x2335f4['getCommentThread'](_0x1406a1);_0x483647&&_0x483647['resolve']({'resolvedBy':_0xcd9bb0,'resolvedAt':_0x2b551f,'isFromAdapter':!0x0});}),this['listenTo'](_0x4b2dfa,'commentThreadReopened',(_0x1e8736,{commentThreadId:_0x282938})=>{const _0x3047fa=_0x2335f4['getCommentThread'](_0x282938);_0x3047fa&&_0x3047fa['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4b2dfa,'commentThreadRemoved',(_0x52d2e3,{commentThreadId:_0x54f725})=>{const _0x5574f0=_0x2335f4['getCommentThread'](_0x54f725);_0x5574f0&&_0x5574f0['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4b2dfa,'commentAdded',(_0x531ee4,_0x5e2059)=>{const _0x2cced8=_0x5e2059['commentThreadId'],_0x10f1c9=_0x2335f4['getCommentThread'](_0x2cced8);_0x10f1c9&&_0x10f1c9['addComment']({...at(_0x5e2059),'isFromAdapter':!0x0});}),this['listenTo'](_0x4b2dfa,'commentUpdated',(_0x4c401c,{commentThreadId:_0x5325ad,commentId:_0x5728a5,content:_0xeebf3c,attributes:_0x581679})=>{const _0x56afec=_0x2335f4['getCommentThread'](_0x5325ad);if(_0x56afec){const _0x118825=_0x56afec['getComment'](_0x5728a5);_0x118825&&_0x118825['update']({'content':_0xeebf3c,'attributes':_0x581679,'isFromAdapter':!0x0});}}),this['listenTo'](_0x4b2dfa,'commentRemoved',(_0x46196f,{commentThreadId:_0x6afe30,commentId:_0x752b3f})=>{const _0x3a1a77=_0x2335f4['getCommentThread'](_0x6afe30);if(_0x3a1a77){const _0x1dd763=_0x3a1a77['getComment'](_0x752b3f);_0x1dd763&&_0x1dd763['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x4b2dfa,'disconnected',()=>{'connected'===this['context']['plugins']['get'](z)['connection']?.['state']&&(this['_services']['delete'](_0x59c3c4),this['stopListening'](_0x4b2dfa));}),await this['_connectService'](_0x59c3c4);}destroy(){if(this['context']instanceof _0x40150f){const _0x4c080f=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x4c080f)&&this['_terminateService'](_0x4c080f);}}_terminateService(_0x6dd3a6){if(!this['_services']['has'](_0x6dd3a6))throw new _0x470142('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x6dd3a6});this['_getService'](_0x6dd3a6)['disconnect'](),this['_services']['delete'](_0x6dd3a6);}async reconnect(){for(const _0x36024e of this['_services']['keys']())await this['_connectService'](_0x36024e);if(this['context']instanceof _0x40150f){const _0x3b4f19=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x3b4f19)){const _0x5e7a7e=this['context']['plugins']['get'](Y);_0x5e7a7e['unregister'](_0x3b4f19);const _0x11e0a8=await this['_services']['get'](_0x3b4f19)['getConnectedSessions']();_0x5e7a7e['register'](_0x3b4f19,_0x11e0a8);}}}async _connectService(_0x35bd5c){const {connection:_0x589bab}=this['context']['plugins']['get'](z),_0xaabd99=this['context']['plugins']['get'](_0x2d3c83),_0x8e4fc7=await this['_services']['get'](_0x35bd5c)['connect'](_0x589bab);await this['_fetchMissingUsersForThreads'](_0x8e4fc7);const _0x586960=new Set(Array['from'](_0xaabd99['getCommentThreads']({'channelId':_0x35bd5c}),_0x2ea22d=>_0x2ea22d['id']));for(const _0x23e827 of _0x8e4fc7)_0x23e827['deletedAt']||_0x586960['delete'](_0x23e827['commentThreadId']);for(const _0x57f17a of _0x586960)_0xaabd99['getCommentThread'](_0x57f17a)['remove']({'isFromAdapter':!0x0});for(const _0x5c5147 of _0x8e4fc7){let _0x15eee6=_0xaabd99['getCommentThread'](_0x5c5147['commentThreadId']);const {commentThreadId:_0xadcd1a,context:_0x52c434,attributes:_0x247aab,resolvedBy:_0x1a305d,resolvedAt:_0xda1d79,unlinkedAt:_0x286c5b,deletedAt:_0x53d5eb}=_0x5c5147;if(_0x53d5eb)continue;_0x15eee6||(_0x15eee6=_0xaabd99['addCommentThread']({'channelId':_0x35bd5c,'threadId':_0xadcd1a,'context':_0x52c434,'attributes':_0x247aab||{},'resolvedBy':_0x1a305d,'resolvedAt':_0xda1d79,'unlinkedAt':_0x286c5b,'isFromAdapter':!0x0}));const _0x15b674=new Set(Array['from'](_0x15eee6['comments'],_0x2660e6=>_0x2660e6['id']));for(const _0x4176a5 of _0x5c5147['comments'])_0x15b674['delete'](_0x4176a5['commentId']);for(const _0x49197e of _0x15b674)_0x15eee6['getComment'](_0x49197e)['remove']({'isFromAdapter':!0x0});for(const _0x3e2d2e of _0x5c5147['comments']){const _0x4722d4=_0x15eee6['getComment'](_0x3e2d2e['commentId']);_0x4722d4?_0x4722d4['content']!==_0x3e2d2e['content']&&_0x4722d4['update']({'content':_0x3e2d2e['content'],'isFromAdapter':!0x0}):_0x15eee6['addComment'](Object['assign'](at(_0x3e2d2e),{'isFromAdapter':!0x0}));}}}_getService(_0x6a6253){if(!this['_services']['has'](_0x6a6253))throw new _0x470142('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x6a6253});return this['_services']['get'](_0x6a6253);}async _fetchMissingUsersForThreads(_0x247a8a){const _0x594a51=this['context']['plugins']['get'](_0x452795),{connection:_0x348409}=this['context']['plugins']['get'](z),_0x285e1a=new Set();for(const {resolvedBy:_0x344d80,comments:_0x3483b3}of _0x247a8a){_0x344d80&&!_0x594a51['getUser'](_0x344d80)&&_0x285e1a['add'](_0x344d80);for(const {userId:_0x37a667}of _0x3483b3)_0x594a51['getUser'](_0x37a667)||_0x285e1a['add'](_0x37a667);}if(0x0===_0x285e1a['size'])return;const _0x58bc2b=await _0xfaa43['getMany'](_0x348409,Array['from'](_0x285e1a));for(const _0x3f42d2 of _0x58bc2b)_0x594a51['getUser'](_0x3f42d2['id'])||_0x594a51['addUser'](_0x3f42d2);}};async function rt(_0x5834e0){if('404'!==_0x5834e0['code'])throw _0x5834e0;}function ct(_0xeae318){if((_0x3ebb38=_0xeae318)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x3ebb38['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3ebb38['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x3ebb38;throw _0xeae318;}function at(_0x493bb3){return{'threadId':_0x493bb3['commentThreadId'],'commentId':_0x493bb3['commentId'],'content':_0x493bb3['content'],'createdAt':_0x493bb3['createdAt'],'authorId':_0x493bb3['userId'],'attributes':_0x493bb3['attributes']||{}};}var ht=class CloudServicesTrackChangesAdapter extends _0x198537{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x3c1634)());_bufferedRequests;_trackChangesService;static get requires(){return[ot,_0x39fbf8,z];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x407009){super(_0x407009);const _0x184e93=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x184e93);}init(){const _0x105b65=this['editor']['plugins']['get'](z),_0x48b03b=this['editor']['plugins']['get'](_0x39fbf8);return _0x48b03b['adapter']={'getSuggestion':async _0x5d217d=>{await this['_waitForServiceReady']();const _0x16a485=await this['_trackChangesService']['get'](_0x5d217d)['catch'](lt);return await this['_fetchMissingUsersForThreads']([_0x16a485]),_0x16a485;},'addSuggestion':async({id:_0x4f7fad,type:_0x42d45c,data:_0x26fc4d,originalSuggestionId:_0x3ee4fa,attributes:_0x4feb83})=>{await this['_waitForServiceReady']();const _0x5650e9={'id':_0x4f7fad,'type':_0x42d45c,'data':_0x26fc4d,'originalSuggestionId':_0x3ee4fa,'attributes':_0x4feb83},_0x30b0fb=await this['_trackChangesService']['add'](_0x4f7fad,_0x42d45c,_0x26fc4d,_0x3ee4fa,_0x4feb83)['catch'](_0x4c75f3=>{if(dt(_0x4c75f3))return new Promise(_0x2e9415=>{this['_bufferedRequests']['set'](_0x4f7fad,{'resolve':_0x2e9415,'suggestionData':_0x5650e9});});throw _0x4c75f3;});return this['_bufferedRequests']['delete'](_0x4f7fad),_0x30b0fb;},'updateSuggestion':async(_0x1f6ba7,_0x2e10f1)=>{if(await this['_waitForServiceReady'](),'open'!==_0x2e10f1['state'])return this['_trackChangesService']['update'](_0x1f6ba7,_0x2e10f1)['catch'](lt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x22e851,_0x25586d)=>{_0x48b03b['hasSuggestion'](_0x25586d['id'])&&(_0x48b03b['getSuggestion'](_0x25586d['id'])['attributes']=_0x25586d['attributes']);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x105b65['connection']?.['state']&&(_0x105b65['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));}),this['_trackChangesService']['connect'](_0x105b65['connection'])['then'](_0x59f694=>(_0x105b65['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x59f694)['then'](()=>{for(const _0x5243b0 of _0x59f694){_0x48b03b['addSuggestionData'](_0x5243b0)['_saved']=!0x0;}})));}async reconnect(){const _0x46fb3e=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x394a0e}=this['editor']['plugins']['get'](z),_0x289930=await this['_trackChangesService']['connect'](_0x394a0e);await this['_fetchMissingUsersForThreads'](_0x289930);for(const {suggestionData:_0x36c3be,resolve:_0xa1d685}of this['_bufferedRequests']['values']()){let _0x14c16a=_0x289930['find'](_0x33a521=>_0x33a521['id']===_0x36c3be['id']);_0x14c16a||(_0x14c16a=await this['_trackChangesService']['add'](_0x36c3be['id'],_0x36c3be['type'],_0x36c3be['data'],_0x36c3be['originalSuggestionId'])),_0xa1d685(_0x14c16a);}for(const _0x490e48 of _0x289930)_0x46fb3e['hasSuggestion'](_0x490e48['id'])||_0x46fb3e['addSuggestionData'](_0x490e48);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x2689df=>{this['listenTo'](this['_trackChangesService'],'connected',_0x2c64a8=>{_0x2c64a8['off'](),_0x2689df();});});}async _fetchMissingUsersForThreads(_0x50f86d){const _0x1e3a93=this['editor']['plugins']['get'](_0x452795),{connection:_0x4ba0fa}=this['editor']['plugins']['get'](z),_0x1d567d=new Set();for(const {authorId:_0x1a2e36}of _0x50f86d)_0x1e3a93['getUser'](_0x1a2e36)||_0x1d567d['add'](_0x1a2e36);if(0x0===_0x1d567d['size'])return;const _0x55c804=await _0xfaa43['getMany'](_0x4ba0fa,Array['from'](_0x1d567d));for(const _0x4c7307 of _0x55c804)_0x1e3a93['getUser'](_0x4c7307['id'])||_0x1e3a93['addUser'](_0x4c7307);}};function lt(_0x1c15b3){if(dt(_0x1c15b3))return new Promise(()=>{});throw _0x1c15b3;}function dt(_0x4c66e5){return _0x4c66e5['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4c66e5['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var ut=class extends _0x198537{static get requires(){return[_0x19436d,ot,nt,z];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x55e768=this['editor']['plugins']['get'](z),_0x46d47e=this['editor']['plugins']['get'](_0x520bc4),_0x4b74b1=this['editor']['plugins']['get'](ot);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x55e768,'change:state',(_0xda5c19,_0x42736d,_0xc24faf)=>{_0x46d47e['isThreadsLoadingPaused']='connected'!==_0xc24faf;});}),this['listenTo'](_0x55e768,'change:state',(_0x552d9e,_0x406b9c,_0x6ef03c)=>{this['editor']['plugins']['get'](_0x2d3c83)['switchReadOnly']('connected'!==_0x6ef03c);}),_0x4b74b1['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}destroy(){const _0x3497f6=this['editor']['plugins']['get'](ot),_0x2f37c0=this['editor']['config']['get']('collaboration.channelId');_0x3497f6['_services']['has'](_0x2f37c0)&&_0x3497f6['_terminateService'](_0x2f37c0),super['destroy']();}},ft=class extends _0x198537{static get requires(){return[ut,ht,_0x165a37];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},mt=class CloudServicesRevisionHistoryAdapter extends _0x198537{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x4f20e5)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;static get requires(){return[z,tt,_0x22abf6,Y,_0x452795];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5a10a5){super(_0x5a10a5);const _0x2e54e9=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x2e54e9);}async init(){const _0x4614f4=this['editor']['plugins']['get'](tt),_0x543652=_0x4614f4['serverHistory'],_0x13e42f=this['editor']['plugins']['get'](z);this['_revisionTracker']['setSource']({'history':_0x543652,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4614f4['sessionId']});const _0x16a722=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x6ba88b,_0x6e0204=await _0x360e87['isBundleUploaded'](_0x13e42f['connection'],_0x16a722);this['editor']['plugins']['get'](_0x22abf6)['adapter']={'getRevision':async({revisionId:_0x419925})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x419925)),'updateRevisions':async _0x13864f=>{await this['_waitForServiceReady']();const _0x411d94=this['_revisionTracker']['currentRevision'];if(_0x6e0204&&0x1===_0x13864f['length']&&_0x13864f[0x0]['id']===_0x411d94['id'])return _0x13864f;for(const _0x5c07ff of _0x13864f)_0x5c07ff['id']===_0x411d94['id']&&(_0x5c07ff['isEmptyCurrent']=_0x5c07ff['fromVersion']===_0x5c07ff['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x13864f,this['_lastRequestId'])['then'](_0x1f6b41=>(this['_lastRequestId']=_0x1f6b41,_0x13864f))['catch'](_0x20f70b=>{if(pt(_0x20f70b)||'400'===_0x20f70b['code']&&void 0x0!==_0x20f70b['data']['wrongRequestId']){for(const _0x1754e6 of _0x13864f)this['_revisionTracker']['repository']['getRevision'](_0x1754e6['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x1754e6['id'],_0x1754e6,!0x1);if(pt(_0x20f70b)&&'destroyed'!==this['editor']['state'])throw _0x20f70b;return _0x13864f;}throw _0x20f70b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xbcde78,{revisionsData:_0xbd4b20,requestId:_0x48710c})=>{Math['max'](..._0xbd4b20['map'](_0x4e7c63=>_0x4e7c63['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0xbd4b20,_0x48710c);}):this['_handleRevisionsUpdate'](_0xbd4b20,_0x48710c);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x13e42f['connection']?.['state']&&(_0x13e42f['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x38c9f6,requestId:_0x5104aa}=await this['_revisionHistoryService']['connect'](_0x13e42f['connection']);_0x13e42f['addToReconnectionStack'](this),this['_lastRequestId']=_0x5104aa,await this['_fetchMissingUsers'](_0x38c9f6);for(const _0x504f40 of _0x38c9f6)this['_revisionTracker']['addRevisionData'](_0x504f40);this['listenTo'](_0x4614f4,'change:_isConnected',(_0xa69f28,_0x459749,_0x587dd5)=>{_0x587dd5&&(this['_oldOffset']=_0x4614f4['_offset'],_0xa69f28['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async reconnect(){const _0x1ee30f=this['editor']['plugins']['get'](z),_0x3b8e7a=this['editor']['plugins']['get'](tt),_0x2d5613=async()=>{const _0x249e62=this['_revisionTracker']['currentRevision'],_0x4ff2c3=_0x249e62['id'],_0x41f9ae=_0x4ff2c3!==_0x3b8e7a['sessionId'];if(_0x41f9ae){const _0x163d27=_0x3b8e7a['_offset']-this['_oldOffset'],_0xc43df5=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x249e62['toVersion']+_0x163d27!==_0xc43df5){const _0x403ab0=_0x249e62['fromVersion']+_0x163d27,_0xb56998=this['editor']['plugins']['get'](_0x452795),_0x4595b2=this['_revisionTracker']['buildRevisionData']({'revision':_0x249e62,'from':_0x403ab0,'to':_0xc43df5});_0x4595b2['id']=_0x249e62['id'];const _0x300bcc=_0x4595b2['authorsIds']['map'](_0x59fd6c=>_0xb56998['getUser'](_0x59fd6c));_0x249e62['_update']({..._0x4595b2,'authors':_0x300bcc},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x249e62['id'],_0x4595b2,!0x0);}this['_revisionTracker']['_startingVersion']=_0xc43df5,_0x249e62['toVersion']!==_0x249e62['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x4ff2c3)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x4ff2c3),this['_revisionTracker']['_createCurrentRevision'](_0xc43df5);}const {revisions:_0x3136f2,requestId:_0x3c28df}=await this['_revisionHistoryService']['reconnect'](_0x1ee30f['connection'],this['_lastRequestId']);_0x41f9ae&&_0x3136f2['length']>0x0?_0x3b8e7a['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3136f2),this['_handleRevisionsUpdate'](_0x3136f2,_0x3c28df),this['_revisionTracker']['sendBufferedUpdates']());};return _0x3b8e7a['_isConnected']?_0x2d5613():new Promise((_0x5a5134,_0x3fbcb9)=>{_0x3b8e7a['once']('change:_isConnected',()=>{_0x2d5613()['then'](_0x5a5134)['catch'](_0x3fbcb9);});});}destroy(){super['destroy']();}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x324f7a=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x276599=>{_0x276599['off'](),_0x324f7a();});});}_getLatestVersionFromServerOperations(){const _0x2fd075=this['editor']['plugins']['get'](tt)['serverHistory']['getOperations']()['reverse']();for(const _0x1f5a42 of _0x2fd075)if('marker'!==_0x1f5a42['type']||_0x1f5a42['affectsData'])return _0x1f5a42['baseVersion']+0x1;}_getLatestVersion(){const _0x21ea9e=this['editor']['plugins']['get'](tt);return new Promise(_0x29a28e=>{_0x21ea9e['_isPendingUpdate']?_0x21ea9e['once']('change:_isPendingUpdate',()=>{_0x29a28e(this['_getLatestVersionFromServerOperations']());}):_0x29a28e(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x2bf055,_0x3ddbea){const _0x5049db=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3ddbea;for(const _0x50f3ee of _0x2bf055){const _0x1b2b6b=_0x5049db['getRevision'](_0x50f3ee['id']);if(_0x1b2b6b){if((_0x50f3ee['fromVersion']||_0x50f3ee['toVersion'])&&(_0x50f3ee['diffData']=null),_0x1b2b6b===this['_revisionTracker']['currentRevision']){const _0x3f2669=Math['max'](_0x1b2b6b['toVersion'],_0x50f3ee['toVersion']),_0x3fd495=Math['max'](_0x1b2b6b['fromVersion'],_0x50f3ee['fromVersion']);let _0x56934f;_0x1b2b6b['toVersion']===_0x50f3ee['toVersion']&&_0x1b2b6b['fromVersion']===_0x50f3ee['fromVersion']?(_0x56934f=!0x0,this['_preventResendingRevisionData'](_0x50f3ee)):_0x50f3ee['toVersion']===_0x3f2669&&_0x50f3ee['fromVersion']===_0x3fd495?_0x56934f=!0x1:(_0x1b2b6b['toVersion']===_0x3f2669&&_0x1b2b6b['fromVersion']===_0x3fd495||this['_fixRevision']({'revision':_0x1b2b6b,'from':_0x3fd495,'to':_0x3f2669}),_0x56934f=!0x0),_0x56934f&&(delete _0x50f3ee['fromVersion'],delete _0x50f3ee['toVersion'],delete _0x50f3ee['diffData'],delete _0x50f3ee['createdAt'],delete _0x50f3ee['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x50f3ee),this['_preventResendingRevisionData'](_0x50f3ee);}else this['_revisionTracker']['addRevisionData'](_0x50f3ee);}const _0x370b62=_0x5049db['getRevisions']();_0x370b62['reverse']();for(let _0x50cf44=0x0;_0x50cf44<_0x370b62['length']-0x1;_0x50cf44++){const _0x4d2091=_0x370b62[_0x50cf44],_0x250569=_0x370b62[_0x50cf44+0x1];if(_0x4d2091['fromVersion']<_0x250569['toVersion']){const _0x1a6917=_0x250569['toVersion'],_0x3a6f5b=Math['max'](_0x1a6917,_0x4d2091['toVersion']);this['_fixRevision']({'revision':_0x4d2091,'from':_0x1a6917,'to':_0x3a6f5b});}}}['_fixRevision']({revision:_0x5b3aa4,from:_0x22a66a,to:_0xdfd202}={}){const _0x9b5529=this['editor']['plugins']['get'](_0x452795),_0x4916f0=this['_revisionTracker']['buildRevisionData']({'revision':_0x5b3aa4,'from':_0x22a66a,'to':_0xdfd202});_0x4916f0['authors']=_0x4916f0['authorsIds']['map'](_0xe2e261=>_0x9b5529['getUser'](_0xe2e261)),_0x5b3aa4['_update'](_0x4916f0);}_preventResendingRevisionData(_0x3bfd84){const _0xdcc12c={};_0xdcc12c['id']=_0x3bfd84['id'];for(const _0x4300ec of Object['keys'](_0x3bfd84))'id'!==_0x4300ec&&(_0xdcc12c[_0x4300ec]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xdcc12c['id'],_0xdcc12c,!0x0);}async _fetchMissingUsers(_0x522c41){const _0x32d6f6=this['editor']['plugins']['get'](_0x452795),{connection:_0x505569}=this['editor']['plugins']['get'](z),_0x3e3885=new Set();for(const _0x52991f of _0x522c41){for(const _0x3a955a of _0x52991f['authorsIds'])_0x56ad91(_0x3a955a);_0x52991f['creatorId']&&_0x56ad91(_0x52991f['creatorId']);}if(0x0===_0x3e3885['size'])return;const _0x71ee40=await _0xfaa43['getMany'](_0x505569,Array['from'](_0x3e3885));for(const _0x1476f3 of _0x71ee40)_0x32d6f6['getUser'](_0x1476f3['id'])||_0x32d6f6['addUser'](_0x1476f3);function _0x56ad91(_0x14ae86){_0x32d6f6['getUser'](_0x14ae86)||_0x3e3885['add'](_0x14ae86);}}};function pt(_0x104c27){return _0x104c27['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x104c27['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x104c27['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var gt=class extends _0x198537{static get requires(){return[_0x22abf6,mt,nt];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class extends _0x3c9057{_collapseAt;constructor(_0x3c83f2,_0x25257a=0x6){super(_0x3c83f2);const _0x5bb02c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x25257a,this['bind']('isHidden')['to'](this,'usersCount',_0x592e3b=>_0x592e3b<_0x25257a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x5bb02c['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x5bb02c['to']('usersCount',_0x4efed2=>'+'+(_0x4efed2-this['_collapseAt']+0x2)['toString']())}]}]}]});}},vt=class extends _0x3c9057{items;keystrokes;constructor(_0x31b40f){super(_0x31b40f);const _0x599f82=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2be03b(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x599f82['if']('hasPopup'),'aria-expanded':_0x599f82['to']('isExpanded',_0x2bf298=>this['hasPopup']&&String(_0x2bf298)),'aria-label':_0x599f82['to']('hasPopup',_0x266109=>X(_0x31b40f,_0x266109?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x599f82['to']('hasPopup',_0x3c6ba2=>!!_0x3c6ba2&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x599f82['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x599f82['to'](_0x51762a=>{const _0x7fefab=_0x51762a,_0xe69af4=document['querySelector']('.ck-presence-list__dropdown-list'),_0x17be96=document['querySelector']('.ck-balloon-panel_with-arrow');_0xe69af4?.['contains'](_0x7fefab['relatedTarget'])||_0x17be96?.['contains'](_0x7fefab['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x4ffb48,_0x3dd177,_0xb380fa)=>{this['element']&&(_0xb380fa?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}},_t=class extends _0x3c9057{counterView;inlineListView;constructor(_0x54c444,_0x22311e=0x6){super(_0x54c444);const _0x180265=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new wt(this['locale'],_0x22311e),this['inlineListView']=new vt(_0x54c444),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4cb357 of this['inlineListView']['items'])_0x4cb357['tooltipPosition']='s';this['inlineListView']['items']['first']&&(this['inlineListView']['items']['first']['tooltipPosition']='se');}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list','ck-reset','ck-rounded-corners',_0x180265['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},yt=class extends _0x3c9057{listWrapperView;constructor(_0x83227a,_0x2447b1){super(_0x83227a);const _0x144a88=this['bindTemplate'];this['listWrapperView']=new bt(_0x83227a,_0x2447b1),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':X(_0x83227a,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x144a88['to'](_0x51cce9=>{const _0x4d5992=_0x51cce9,_0x3549ea=document['querySelector']('.ck-presence-list__list'),_0x2292ad=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3549ea?.['contains'](_0x4d5992['relatedTarget'])||_0x2292ad?.['contains'](_0x4d5992['relatedTarget'])||this['fire']('presencelist:hide');})}});}},bt=class extends _0x3bbda9{constructor(_0x5da2d3,_0x8d9a96){super(_0x5da2d3);const _0x2d01b9=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x8d9a96?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x2d01b9['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x2d01b9['to']('role'),'aria-label':_0x2d01b9['to']('ariaLabel'),'aria-labelledby':_0x2d01b9['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1a9e1f['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xb76255=this['element'];_0xb76255&&(this['_isScrollable']=Math['max'](_0xb76255['scrollHeight'],_0xb76255['clientHeight'])>0.8*window['innerHeight']);}},kt=class extends _0x216f28{['userView'];constructor(_0x388419,_0x4fad95,_0x395328){super(_0x388419);const _0x180a1f=this['bindTemplate'];this['userView']=new _0x484af1(_0x388419,_0x4fad95);const _0x2c55ab={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4fad95['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4fad95['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4fad95['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x4fad95['color']['getColorVariable'](),'--ck-user-color-alpha':_0x4fad95['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x395328&&(_0x2c55ab['tag']='button',_0x2c55ab['on']={'click':_0x180a1f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2c55ab);}['focus'](){this['element']['focus']();}},It=class extends _0x3c9057{['userView'];['markerView'];constructor(_0x398d46,_0x313367,_0x471d6d){super(_0x398d46);const _0x5bb0a4=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x484af1(_0x398d46,_0x313367),this['markerView']=new St(_0x398d46,_0x313367);const _0x204f06=new _0x305df9(_0x398d46);_0x204f06['template']['tag']='span',_0x204f06['text']=_0x313367['name'];const _0x4707b9={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5bb0a4['to']('isFocusable',_0x2a4da3=>!!_0x2a4da3&&0x0),'aria-labelledby':_0x204f06['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5bb0a4['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5bb0a4['to']('hasTooltip',_0xcc1a5f=>!_0xcc1a5f),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x204f06]};_0x471d6d&&(_0x4707b9['tag']='button',_0x4707b9['on']={'click':_0x5bb0a4['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4707b9);}},St=class extends _0x3c9057{constructor(_0x4402bf,_0x585ef0){super(_0x4402bf),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x585ef0['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x585ef0['color']['getColorVariable'](),'--ck-user-color-alpha':_0x585ef0['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Tt={'collapseAt':0x6,'displayMe':!0x0};var Ct=class extends _0x1b8d8d{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_bodyCollection=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e616e){super(_0x3e616e),this['context']['config']['define']('presenceList',Tt);const _0x50223f=_0x3e616e['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x50223f)throw new _0x470142('presencelist-collapseat-invalid-format',this);if(_0x50223f<0x1)throw new _0x470142('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Y)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x19921a(),this['balloonPanelView']=new _0x5157c9(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[Y];}init(){for(const _0x25b926 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x25b926);this['listenTo'](this['_allConnectedUsers'],'add',(_0x36a2f4,_0x31c5a1)=>{this['_handleUserAdd'](_0x31c5a1);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5a4c28,_0xa60737)=>{this['_handleUserRemove'](_0xa60737);});}_createView(){const _0x5acfcd=this['context'],_0x3cb595=new _t(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x2723ed=this['balloonPanelView'];if(!_0x4afda6(_0x5acfcd['config']['get']('presenceList.container')))throw new _0x470142('presencelist-missing-container',this);return _0x3cb595['counterView']['bind']('usersCount')['to'](this),_0x3cb595['bind']('isCollapsed')['to'](this,'usersCount',_0x208219=>{const {collapseAt:_0x2db2f5}=_0x5acfcd['config']['get']('presenceList'),_0x5489e8=_0x208219>=_0x2db2f5;if(_0x5489e8&&!_0x3cb595['inlineListView']['items']['find'](_0x32ed4f=>_0x32ed4f instanceof wt)){const _0x39d36b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x39d36b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3cb595['inlineListView']['items']['add'](_0x3cb595['counterView']);}return _0x5489e8||this['hideDropdown'](),_0x5489e8;}),_0x3cb595['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x4fff1d=>{const _0x141dc2=_0x5acfcd['config']['get']('presenceList'),_0x129695=new It(_0x5acfcd['locale'],_0x4fff1d,!!_0x141dc2['onClick']);return _0x129695['bind']('hasTooltip')['to'](_0x3cb595,'isCollapsed',_0x147663=>!_0x147663),_0x129695['bind']('isFocusable')['to'](_0x3cb595,'isCollapsed',_0x195fca=>!_0x195fca),_0x141dc2['onClick']&&this['listenTo'](_0x129695,'execute',()=>{this['view']['isCollapsed']||_0x141dc2['onClick'](_0x4fff1d,_0x129695['element']);}),_0x129695;}),this['listenTo'](_0x3cb595['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3cb595['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3cb595['inlineListView']['keystrokes']['set']('Enter',(_0x56c8ef,_0x25fee7)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x25fee7());}),_0x3cb595['render'](),_0x2723ed['render'](),_0x258569({'emitter':_0x3cb595,'activator':()=>_0x2723ed['isVisible'],'contextElements':[_0x2723ed['element'],_0x3cb595['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x5acfcd['config']['get']('presenceList.container')['appendChild'](_0x3cb595['element']),this['_bodyCollection']=new _0x5cfc09(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3cb595;}['_handleUserAdd'](_0x45caef){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x45caef['isMe'])return;const _0x379b6f=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x379b6f-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x5e01f5=_0x45caef['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x45caef,_0x5e01f5);}['_handleUserRemove'](_0x44284d){this['usersCount']--;const {collapseAt:_0x149f1f}=this['context']['config']['get']('presenceList'),_0x54d3ed=this['usersCount']>=_0x149f1f;if(this['currentDisplayedUsers']['get'](_0x44284d['id']))this['currentDisplayedUsers']['remove'](_0x44284d['id']);else{if(_0x54d3ed&&this['currentDisplayedUsers']['length']+0x1===_0x149f1f-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x54d3ed?0x1:0x0)<this['usersCount']){for(const _0x2dee28 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x2dee28['id'])&&(this['currentDisplayedUsers']['add'](_0x2dee28,Math['min'](this['currentDisplayedUsers']['length']-(_0x54d3ed?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x54d3ed?0x1:0x0)===_0x149f1f-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1e746c=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new yt(this['context']['locale'],!!_0x1e746c['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x58b7ca}=this['presenceDropdownView'];_0x58b7ca['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4f7049=>{if(!_0x1e746c['displayMe']&&_0x4f7049['isMe'])return null;const _0x3ccd6c=new kt(this['context']['locale'],_0x4f7049,!!_0x1e746c['onClick']);return _0x1e746c['onClick']&&this['listenTo'](_0x3ccd6c,'execute',()=>{_0x1e746c['onClick'](_0x4f7049,_0x3ccd6c['element']);}),_0x3ccd6c;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x58b7ca['focus'](),_0x58b7ca['checkIfScrollable']();const _0x2f800d=(_0x78914c,_0x14f5ba)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x14f5ba();};_0x58b7ca['keystrokes']['set']('Esc',_0x2f800d),_0x58b7ca['keystrokes']['set']('Shift+Tab',_0x2f800d),_0x58b7ca['keystrokes']['set']('Tab',(_0x2e55ff,_0x53bf63)=>{!function(_0x5bc260){const _0x52df99=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x9381cf=>_0x9381cf+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xd4d14d=[...document['body']['querySelectorAll'](_0x52df99)]['filter'](_0x223227=>_0x223227===document['activeElement']||_0x223227['offsetWidth']+_0x223227['offsetHeight']>0x0)['sort']((_0x506900,_0x45378f)=>(_0x506900['tabIndex']||0x0)-(_0x45378f['tabIndex']||0x0)),_0xbf4f10=_0xd4d14d[(_0xd4d14d['indexOf'](_0x5bc260)+0x1)%_0xd4d14d['length']];_0xbf4f10&&_0xbf4f10['focus']();}(this['view']['element']),this['hideDropdown'](),_0x53bf63();}),_0x58b7ca['focusTracker']['add'](this['view']['element']),_0x58b7ca['focusTracker']['on']('change:isFocused',(_0x2d174d,_0x3d1387,_0x48d6e4)=>{_0x48d6e4||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}},At=class extends _0x1b8d8d{static get requires(){return[Y,Ct];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ot as CloudServicesCommentsAdapter,mt as CloudServicesRevisionHistoryAdapter,ht as CloudServicesTrackChangesAdapter,At as PresenceList,Ct as PresenceListUI,tt as RealTimeCollaborationClient,ut as RealTimeCollaborativeComments,nt as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,Y as Sessions,z as WebSocketGateway};