@ckeditor/ckeditor5-real-time-collaboration 49.1.0-alpha.1 → 49.1.0-alpha.2

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 (75) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/translations/af.umd.js +1 -1
  3. package/dist/translations/ar.umd.js +1 -1
  4. package/dist/translations/ast.umd.js +1 -1
  5. package/dist/translations/az.umd.js +1 -1
  6. package/dist/translations/be.umd.js +1 -1
  7. package/dist/translations/bg.umd.js +1 -1
  8. package/dist/translations/bn.umd.js +1 -1
  9. package/dist/translations/bs.umd.js +1 -1
  10. package/dist/translations/ca.umd.js +1 -1
  11. package/dist/translations/cs.umd.js +1 -1
  12. package/dist/translations/da.umd.js +1 -1
  13. package/dist/translations/de-ch.umd.js +1 -1
  14. package/dist/translations/de.umd.js +1 -1
  15. package/dist/translations/el.umd.js +1 -1
  16. package/dist/translations/en-au.umd.js +1 -1
  17. package/dist/translations/en-gb.umd.js +1 -1
  18. package/dist/translations/en.umd.js +1 -1
  19. package/dist/translations/eo.umd.js +1 -1
  20. package/dist/translations/es-co.umd.js +1 -1
  21. package/dist/translations/es.umd.js +1 -1
  22. package/dist/translations/et.umd.js +1 -1
  23. package/dist/translations/eu.umd.js +1 -1
  24. package/dist/translations/fa.umd.js +1 -1
  25. package/dist/translations/fi.umd.js +1 -1
  26. package/dist/translations/fr.umd.js +1 -1
  27. package/dist/translations/gl.umd.js +1 -1
  28. package/dist/translations/gu.umd.js +1 -1
  29. package/dist/translations/he.umd.js +1 -1
  30. package/dist/translations/hi.umd.js +1 -1
  31. package/dist/translations/hr.umd.js +1 -1
  32. package/dist/translations/hu.umd.js +1 -1
  33. package/dist/translations/hy.umd.js +1 -1
  34. package/dist/translations/id.umd.js +1 -1
  35. package/dist/translations/it.umd.js +1 -1
  36. package/dist/translations/ja.umd.js +1 -1
  37. package/dist/translations/jv.umd.js +1 -1
  38. package/dist/translations/kk.umd.js +1 -1
  39. package/dist/translations/km.umd.js +1 -1
  40. package/dist/translations/kn.umd.js +1 -1
  41. package/dist/translations/ko.umd.js +1 -1
  42. package/dist/translations/ku.umd.js +1 -1
  43. package/dist/translations/lt.umd.js +1 -1
  44. package/dist/translations/lv.umd.js +1 -1
  45. package/dist/translations/ms.umd.js +1 -1
  46. package/dist/translations/nb.umd.js +1 -1
  47. package/dist/translations/ne.umd.js +1 -1
  48. package/dist/translations/nl.umd.js +1 -1
  49. package/dist/translations/no.umd.js +1 -1
  50. package/dist/translations/oc.umd.js +1 -1
  51. package/dist/translations/pl.umd.js +1 -1
  52. package/dist/translations/pt-br.umd.js +1 -1
  53. package/dist/translations/pt.umd.js +1 -1
  54. package/dist/translations/ro.umd.js +1 -1
  55. package/dist/translations/ru.umd.js +1 -1
  56. package/dist/translations/si.umd.js +1 -1
  57. package/dist/translations/sk.umd.js +1 -1
  58. package/dist/translations/sl.umd.js +1 -1
  59. package/dist/translations/sq.umd.js +1 -1
  60. package/dist/translations/sr-latn.umd.js +1 -1
  61. package/dist/translations/sr.umd.js +1 -1
  62. package/dist/translations/sv.umd.js +1 -1
  63. package/dist/translations/th.umd.js +1 -1
  64. package/dist/translations/ti.umd.js +1 -1
  65. package/dist/translations/tk.umd.js +1 -1
  66. package/dist/translations/tr.umd.js +1 -1
  67. package/dist/translations/tt.umd.js +1 -1
  68. package/dist/translations/ug.umd.js +1 -1
  69. package/dist/translations/uk.umd.js +1 -1
  70. package/dist/translations/ur.umd.js +1 -1
  71. package/dist/translations/uz.umd.js +1 -1
  72. package/dist/translations/vi.umd.js +1 -1
  73. package/dist/translations/zh-cn.umd.js +1 -1
  74. package/dist/translations/zh.umd.js +1 -1
  75. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Context as _0xe30d69,ContextPlugin as _0x34db9e,PendingActions as _0x380194,Plugin as _0x5a0766}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0xa544f3,Collection as _0x4bf7d9,DomEmitterMixin as _0x1257ca,KeystrokeHandler as _0x18ab48,getOverlayMountRoot as _0x54d91d,global as _0x118a7c,trustedHtml as _0x17fded,uid as _0x1d6e1f,version as _0x327011}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x209ede,LabelView as _0x3b29d3,ListItemView as _0x4ee9d3,ListView as _0xb0ce8e,Notification as _0xcd9aa8,OverlayHost as _0x14106a,View as _0x31bb91,clickOutsideHandler as _0x3e7234}from'@ckeditor/ckeditor5-ui';import{History as _0x37eae0,InsertOperation as _0x22676a,MarkerOperation as _0x2e10d5,ModelLiveRange as _0x5798ad,NoOperation as _0x143a76,OperationFactory as _0x196d95,RootAttributeOperation as _0xa4fad7,transformOperationSets as _0x363af8}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x35b1ac}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x4181ea,CommentsService as _0x2d917c,EditorService as _0x3f4ccb,RevisionHistoryService as _0x18141b,TrackChangesService as _0x44e6d9,User as _0x162564,WEB_SOCKET_GATEWAY_STATES as _0x54e3bd,WebSocketGateway as _0x2b0d5d}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x4bcce3,Users as _0x5cfa5a,isPointerStillOver as _0x3578f4}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x39a19d}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x1287db,TrackChangesEditing as _0x3db8ee}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x3fd57a,CommentsEditing as _0x510b45,CommentsRepository as _0x42d3f0}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x2fad27}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x36b27a}from'es-toolkit/compat';var K=class WebSocketGateway extends _0x34db9e{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
- ((()=>_0x2b0d5d)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x35b1ac,_0xcd9aa8];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x128052){super(_0x128052),this['set']('state',_0x54e3bd['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x1257ca())();}init(){const _0x14c830=this['context'],_0x2d2ba1=_0x14c830['plugins']['get'](_0x35b1ac),_0x5b3f4f=_0x14c830['plugins']['get'](_0xcd9aa8);if(!_0x2d2ba1['token'])throw new _0xa544f3('websocketgateway-missing-token',this);if(!_0x2d2ba1['webSocketUrl'])throw new _0xa544f3('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'](_0x2d2ba1['token'],_0x2d2ba1['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2a4ca1=>{if(this['connection']=_0x2a4ca1,this['bind']('state')['to'](_0x2a4ca1,'state',this,'_isBrowserOffline',(_0x5b050a,_0x188540)=>('connected'!==_0x5b050a&&(this['_shouldPluginsReconnect']=!0x0),_0x188540||_0x5b050a!==_0x54e3bd['CONNECTED']?_0x54e3bd['DISCONNECTED']:this['state']==_0x54e3bd['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x54e3bd['CONNECTING']):_0x54e3bd['CONNECTED'])),this['connection']['on']('error',(_0x4972bd,_0x3ed831)=>{if('limitExceeded'!==_0x3ed831['code'])throw console['error'](_0x3ed831),new _0xa544f3('cloudservices-init',null,{'originalError':_0x3ed831});_0x5b3f4f['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'});}),!_0x2a4ca1['me'])return new Promise(_0xa3e3fd=>_0x2a4ca1['on']('change:me',_0xa3e3fd));})['catch'](_0x409a13=>{throw console['error'](_0x409a13),new _0xa544f3('cloudservices-init',null,{'originalError':_0x409a13});});}addToReconnectionStack(_0x5e940d){if('function'!=typeof _0x5e940d['reconnect'])throw new _0xa544f3('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5e940d))throw new _0xa544f3('websocketgateway-plugin-already-registered',this,{'name':_0x5e940d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5e940d);}removeFromReconnectionStack(_0x54bea8){this['_reconnectionStack']['delete'](_0x54bea8);}isInReconnectionStack(_0x354ed7){return this['_reconnectionStack']['has'](_0x354ed7);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x35ba82=>_0x35ba82['reconnect']())))['then'](()=>this['state']=_0x54e3bd['CONNECTED'])['catch'](_0x2fe25f=>{throw console['error'](_0x2fe25f),new _0xa544f3('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x54e3bd['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},J=class extends _0x34db9e{['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[K,_0x5cfa5a];}constructor(_0xf751){super(_0xf751),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x4bf7d9(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5cfa5a);}init(){const _0xa06c24=this['context']['plugins']['get'](K);this['listenTo'](_0xa06c24,'change:state',(_0x1085b5,_0x3928e4,_0xfc9f6e)=>{if('connected'!==_0xfc9f6e)this['channelSessions']['forEach'](_0x52b1f7=>_0x52b1f7['clear']()),this['channelConnectedUsers']['forEach'](_0x3ded37=>_0x3ded37['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x26bde9,_0x299242]of this['_registeredSessions'])for(const _0x5bcb43 of _0x299242)this['_handleSessionAdd'](_0x26bde9,_0x5bcb43);}}),this['_createUser'](_0xa06c24['connection']['me'],!0x0);}register(_0x381cbf,_0x2da9e3){if(this['_registeredSessions']['has'](_0x381cbf))throw new _0xa544f3('sessions-register-already-registered',null,{'channelId':_0x381cbf});this['_registeredSessions']['set'](_0x381cbf,_0x2da9e3),this['channelSessions']['set'](_0x381cbf,new _0x4bf7d9()),this['channelConnectedUsers']['set'](_0x381cbf,new _0x4bf7d9()),this['listenTo'](_0x2da9e3,'add',(_0x419a8f,_0x4b9bd5)=>this['_handleSessionAdd'](_0x381cbf,_0x4b9bd5)),this['listenTo'](_0x2da9e3,'remove',(_0x56f3c8,_0x788076)=>this['_handleSessionRemove'](_0x381cbf,_0x788076));for(const _0x2890e6 of _0x2da9e3)this['_handleSessionAdd'](_0x381cbf,_0x2890e6);}unregister(_0x24ed92){if(!this['_registeredSessions']['has'](_0x24ed92))throw new _0xa544f3('sessions-unregister-not-exist',null,{'channelId':_0x24ed92});const _0x3c06b5=this['_registeredSessions']['get'](_0x24ed92);this['stopListening'](_0x3c06b5);for(const _0x5c13b4 of _0x3c06b5)'connected'===this['context']['plugins']['get'](K)['state']&&this['_handleSessionRemove'](_0x24ed92,_0x5c13b4);this['_registeredSessions']['delete'](_0x24ed92),this['channelSessions']['delete'](_0x24ed92),this['channelConnectedUsers']['delete'](_0x24ed92);}get['mySessionId'](){return this['context']['plugins']['get'](K)['connection']['sessionId'];}getUserBySessionId(_0x1ea02d){for(const _0xe61865 of this['channelSessions']['values']())for(const _0x1ba616 of _0xe61865)if(_0x1ba616['id']===_0x1ea02d)return _0x1ba616['user'];}getUserSessions(_0x263527,_0x25c965){const _0x24c052=_0x25c965?[this['channelSessions']['get'](_0x25c965)]:this['channelSessions']['values'](),_0x1b4a86=new Set();for(const _0x11f741 of _0x24c052)for(const _0x5a0296 of _0x11f741)_0x5a0296['user']['id']===_0x263527['id']&&_0x1b4a86['add'](_0x5a0296['id']);return _0x1b4a86;}getUserRole(_0x12e033){for(const _0x159405 of this['channelSessions']['values']())for(const _0x4fbead of _0x159405)if(_0x4fbead['user']===_0x12e033)return _0x4fbead['role'];}['_handleSessionAdd'](_0x1a7f59,_0x37fe78){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x28eaca=_0x37fe78['user'],_0xd130f9=this['_users']['getUser'](_0x28eaca['id'])||this['_createUser'](_0x28eaca),_0x590fd4=Object['assign']({},_0x37fe78,{'user':_0xd130f9});if(this['channelSessions']['get'](_0x1a7f59)['add'](_0x590fd4),!_0x28eaca['hiddenInPresenceList']){const _0x320c0a=this['channelConnectedUsers']['get'](_0x1a7f59);_0x320c0a['has'](_0xd130f9['id'])||_0x320c0a['add'](_0xd130f9),this['allConnectedUsers']['has'](_0xd130f9['id'])||_0x28eaca['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xd130f9,_0xd130f9['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x1a7f59,{'channelId':_0x1a7f59,'session':_0x590fd4});}['_handleSessionRemove'](_0x2b6c03,_0x696e7c){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x3ea4d2=this['channelConnectedUsers']['get'](_0x2b6c03),_0x29d50c=_0x696e7c['user'];_0x29d50c['id']&&(this['channelSessions']['get'](_0x2b6c03)['remove'](_0x696e7c['id']),_0x3ea4d2['has'](_0x29d50c['id'])&&!this['getUserSessions'](_0x29d50c,_0x2b6c03)['size']&&_0x3ea4d2['remove'](_0x29d50c['id']),this['allConnectedUsers']['get'](_0x29d50c['id'])&&!this['getUserSessions'](_0x29d50c)['size']&&this['allConnectedUsers']['remove'](_0x29d50c['id']));}_createUser(_0x845e47,_0x304c16){const _0x23d100=this['_users']['addUser'](_0x845e47);return _0x304c16&&this['_users']['defineMe'](_0x845e47['id']),_0x23d100['orderNumber']=this['_uniqueUsersCount']++,_0x23d100;}},X=class extends _0x5a0766{_domEmitter=new(_0x1257ca())();static get requires(){return[J];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x44c0fe=this['editor'],_0x3e48ed=_0x44c0fe['plugins']['get'](J);_0x44c0fe['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x4741d6,{writer:_0x5976bd})=>function(_0x5b4ac5,_0x57b245,_0x435c86,_0x5af436){const _0x152055=_0x5b4ac5['markerName']['split'](':')[0x2],_0x343991=_0x435c86['getUserBySessionId'](_0x152055);if(!_0x343991||_0x152055===_0x435c86['mySessionId'])return;if(!_0x5af436['model']['schema']['checkChild'](_0x5b4ac5['markerRange']['start'],'$text'))return;const _0xf0bc54={'class':'ck-user__marker\x20'+_0x343991['color']['getMarkerClass'](),'style':tt(_0x343991),'data-name':_0x343991['name'],'data-session-id':_0x152055},_0x30a063=_0x5af436['model']['markers']['get'](_0x5b4ac5['markerName'])['getStart'](),_0x154e51=_0x30a063['nodeAfter'],_0x45cef2=_0x5af436['model']['schema'];if(_0x154e51&&_0x45cef2['isObject'](_0x154e51)&&_0x45cef2['isInline'](_0x154e51)&&!_0x5af436['model']['markers']['get']('user:range:'+_0x152055)['getRange']()['isCollapsed'])return;const _0x4e90b7=_0x30a063['parent'];return _0x5af436['model']['schema']['isLimit'](_0x4e90b7)&&!_0x5af436['model']['hasContent'](_0x4e90b7)&&(_0xf0bc54['contenteditable']=!0x1),function(_0x288f6d,_0x5c1919,_0x34d560){const _0x4a1d37=_0x288f6d['createUIElement']('span',_0x5c1919);return _0x288f6d['setCustomProperty']('userPositionMarker',!0x0,_0x4a1d37),_0x4a1d37['render']=function(_0x5ffcb8){const _0x5f07d1=this['toDomElement'](_0x5ffcb8),_0x17d803=document['createElement']('span');return _0x17d803['classList']['add']('ck-user__marker-tooltip'),_0x17d803['setAttribute']('contenteditable','false'),_0x17d803['setAttribute']('spellcheck','false'),_0x17d803['textContent']=_0x34d560['name'],_0x5f07d1['innerHTML']=_0x17fded('⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x17d803['outerHTML']+'⁠'),_0x5f07d1['addEventListener']('mouseenter',()=>{_0x5f07d1['classList']['add']('ck-user__marker_hovered');}),_0x5f07d1['addEventListener']('mouseleave',()=>{_0x5f07d1['classList']['remove']('ck-user__marker_hovered');}),_0x5f07d1;},_0x4a1d37['isSimilar']=function(_0x4d0085){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4d0085['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4d0085['getAttribute']('data-session-id'));},_0x4a1d37;}(_0x57b245,_0xf0bc54,_0x343991);}(_0x4741d6,_0x5976bd,_0x3e48ed,_0x44c0fe)}),_0x44c0fe['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1c4eb8=>function(_0x1bce78,_0x12cf7d){const _0x173fbb=_0x1bce78['markerName']['split'](':')[0x2];if(_0x173fbb===_0x12cf7d['mySessionId'])return null;const _0x2ddfb1=_0x12cf7d['getUserBySessionId'](_0x173fbb);return _0x2ddfb1?{'id':_0x173fbb,'classes':['ck-user__selection',_0x2ddfb1['color']['getSelectionClass']()],'attributes':{'style':tt(_0x2ddfb1),'data-session-id':_0x173fbb},'priority':0x7d0+_0x2ddfb1['orderNumber']}:{'id':_0x173fbb,'classes':[]};}(_0x1c4eb8,_0x3e48ed)}),function(_0x3f620b){const _0x3bc9e8=_0x3f620b['model'],_0x26584d=new Map(),_0x57c880=_0x3f620b['plugins']['get'](J);_0x3bc9e8['markers']['on']('update:user:range',(_0x3ce477,_0x2b517c,_0x3f5eba,_0x634c1d)=>{if(!_0x634c1d&&_0x26584d['get'](_0x2b517c['name']))return _0x26584d['get'](_0x2b517c['name'])['detach'](),void _0x26584d['delete'](_0x2b517c['name']);const _0x2e6800=_0x2b517c['name']['split'](':')[0x2];if(_0x2e6800===_0x57c880['mySessionId'])return;const _0x4dd670='user:position:'+_0x2e6800;_0x3bc9e8['markers']['has'](_0x4dd670)&&_0x3f620b['editing']['reconvertMarker'](_0x4dd670),_0x2b517c['on']('change:range',(_0x4da178,_0x55dd7c,_0x597238)=>{if('$graveyard'!=_0x55dd7c['root']['rootName']&&'$graveyard'==_0x2b517c['getRange']()['root']['rootName']&&!_0x26584d['has'](_0x2b517c['name'])){const _0x212a30=_0x3bc9e8['schema']['getNearestSelectionRange'](_0x597238['deletionPosition']);if(_0x212a30){const _0x33d543=_0x5798ad['fromRange'](_0x212a30);_0x26584d['set'](_0x2b517c['name'],_0x33d543),_0x33d543['on']('change:range',(_0x16fde5,_0x47a1e5,_0x582e15)=>{if('$graveyard'==_0x33d543['root']['rootName']){const _0x5a4d09=_0x3bc9e8['schema']['getNearestSelectionRange'](_0x582e15['deletionPosition']);_0x5a4d09?(_0x33d543['start']=_0x5a4d09['start'],_0x33d543['end']=_0x5a4d09['end']):(_0x26584d['delete'](_0x2b517c['name']),_0x33d543['detach']());}});}}});}),_0x3bc9e8['document']['on']('change',()=>{_0x26584d['size']>0x0&&_0x3bc9e8['enqueueChange']({'isUndoable':!0x1},_0x5b236d=>{for(const [_0x49138c,_0x595494]of _0x26584d)'$graveyard'==_0x3bc9e8['markers']['get'](_0x49138c)['getRange']()['root']['rootName']&&(Z(_0x49138c['split'](':')[0x2],_0x595494['toRange'](),_0x3bc9e8,_0x5b236d),_0x595494['detach']());_0x26584d['clear']();});});}(_0x44c0fe),this['_domEmitter']['listenTo'](_0x118a7c['document'],'keydown',(_0x24c7d,{key:_0x343b46})=>{'Escape'===_0x343b46&&function(_0x1c8ba5){_0x1c8ba5['editing']['view']['change'](_0x49df79=>{for(const _0x402c7b of _0x1c8ba5['model']['markers']){if(!_0x402c7b['name']['startsWith']('user:position'))continue;const _0x1fc2a5=_0x1c8ba5['editing']['mapper']['markerNameToElements'](_0x402c7b['name']);if(_0x1fc2a5){for(const _0x5946ca of _0x1fc2a5)_0x49df79['removeClass']('ck-user__marker_hovered',_0x5946ca);}}});}(_0x44c0fe);},{'useCapture':!0x0});}afterInit(){const _0x244cc7=this['editor'],_0x164e95=_0x244cc7['commands']['get']('undo');_0x164e95&&_0x244cc7['model']['on']('applyOperation',(_0x3a6fe8,_0x238ff6)=>{const _0x1a2b70=_0x238ff6[0x0];if(!_0x1a2b70['isDocumentOperation'])return;if('marker'!=_0x1a2b70['type']||!_0x1a2b70['name']['startsWith']('user:'))return;const _0x45fb7d=_0x1a2b70['batch'];_0x164e95['_createdBatches']['has'](_0x45fb7d)&&(_0x1a2b70['newRange']=_0x1a2b70['oldRange']?_0x244cc7['model']['createRange'](_0x1a2b70['oldRange']['start'],_0x1a2b70['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x4381e6=this['editor'],_0x3ff732=_0x4381e6['model']['document'],_0x1f5663=_0x4381e6['plugins']['get'](J);_0x4381e6['model']['enqueueChange']({'isUndoable':!0x1},_0x3b494c=>{const _0x138c06='user:range:'+_0x1f5663['mySessionId'],_0x3e1487='user:position:'+_0x1f5663['mySessionId'],_0xcf55ab=_0x4381e6['model']['markers']['has'](_0x138c06);_0x4381e6['editing']['view']['hasDomSelection']?Z(_0x1f5663['mySessionId'],_0x3ff732['selection']['getFirstRange'](),_0x4381e6['model'],_0x3b494c):_0xcf55ab&&(_0x3b494c['removeMarker'](_0x138c06),_0x3b494c['removeMarker'](_0x3e1487));});}};function Z(_0x2ab2e1,_0x2e2fc4,_0x534910,_0x3fa436){const _0xeb379='user:range:'+_0x2ab2e1,_0x5dd486='user:position:'+_0x2ab2e1,_0x4b0b27=_0x2e2fc4['getContainedElement']();let _0x2b3f9d=_0x2e2fc4['start'];if(_0x4b0b27&&_0x4b0b27['is']('element','tableCell')){const _0x53c1ee=function(_0x2e64a2,_0x45fb29){for(const _0x159a3e of _0x2e64a2['getPositions']())if(_0x45fb29['schema']['checkChild'](_0x159a3e,'$text'))return _0x159a3e;}(_0x2e2fc4,_0x534910);_0x53c1ee&&(_0x2b3f9d=_0x53c1ee,_0x2e2fc4=_0x3fa436['createRange'](_0x2b3f9d));}const _0x43ace8=_0x3fa436['createRange'](_0x2b3f9d);_0x534910['markers']['has'](_0xeb379)?(_0x3fa436['updateMarker'](_0xeb379,{'range':_0x2e2fc4}),_0x3fa436['updateMarker'](_0x5dd486,{'range':_0x43ace8})):(_0x3fa436['addMarker'](_0xeb379,{'range':_0x2e2fc4,'usingOperation':!0x0}),_0x3fa436['addMarker'](_0x5dd486,{'range':_0x43ace8,'usingOperation':!0x0}));}function tt(_0x58cd93){return'--ck-user-color:'+_0x58cd93['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x58cd93['color']['getColorAlphaVariable']()+';';}function et(_0x689446,_0xf665e2,_0x1febd6){const _0x46f6f7=_0x689446['t'],t=_0x689446['t'];switch(_0xf665e2){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 _0x46f6f7({'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'},_0x1febd6);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x5a0766{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
- ((()=>_0x4181ea)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[K,J,X,_0x380194,_0x5cfa5a,_0xcd9aa8];}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 _0x58479f=this['serverHistory']['getOperations']();for(let _0x4e282f=_0x58479f['length']-0x1;_0x4e282f>=0x0;_0x4e282f--){const _0xfc3fe=_0x58479f[_0x4e282f];if(!this['_disconnectionOperations']['has'](_0xfc3fe))return _0xfc3fe['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x19c2a1){if(super(_0x19c2a1),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x37eae0(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0xa544f3('collaboration-missing-channelid',this);const _0x5726ae=_0x19c2a1['config']['get']('cloudServices.bundleVersion')||_0x327011;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x5726ae,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x39a19d(),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 ot(this['_disconnectionOperations']);}init(){const _0x4a1860=this['editor'],_0x28ee63=_0x4a1860['plugins']['get'](_0x5cfa5a),_0x2aeaa4=_0x4a1860['plugins']['get'](K);this['listenTo'](_0x28ee63,'getOperationAuthor',(_0x38701e,_0x321026)=>{const _0x4d5a27=_0x321026[0x0];_0x4d5a27['_authorId']&&(_0x38701e['return']=_0x28ee63['getUser'](_0x4d5a27['_authorId']),_0x38701e['stop']()),null===_0x4d5a27['_authorId']&&(_0x38701e['return']=null,_0x38701e['stop']());},{'priority':'high'}),this['listenTo'](_0x4a1860['model']['document']['selection'],'change:range',(_0x2b70f9,_0x4c2aa4)=>{_0x4c2aa4['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4a1860['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4a1860['model']['on']('applyOperation',(_0x3f85e7,_0xd76c71)=>{const _0x5770b4=_0xd76c71[0x0];_0x5770b4['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x5770b4),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x2aeaa4,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x1f04f9,_0xabedcb,_0x198987)=>'connected'===_0x1f04f9&&!_0xabedcb&&!_0x198987),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4a1860['disableReadOnlyMode']('rtc-offline'):_0x4a1860['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4a1860['disableReadOnlyMode']('rtc-offline'):_0x4a1860['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x29a3a0=this['editor']['plugins']['get'](J),_0x5383a5=this['editor']['plugins']['get'](K);try{this['_isPendingUpdate']=!0x0,_0x29a3a0['unregister'](this['_channelId']);const _0x55e5cf=await this['_service']['reconnect'](_0x5383a5['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x55e5cf)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x5cb2a0=await this['_service']['getConnectedSessions']();_0x29a3a0['register'](this['_channelId'],_0x5cb2a0),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4e474e){if(function(_0x5b4fe9){return'404'===_0x5b4fe9['code'];}(_0x4e474e)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x29e5a2){return'409'===_0x29e5a2['code'];}(_0x4e474e)){const _0x5c1dd6=et(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'](_0x5c1dd6);}else{if(!(_0x4e474e instanceof nt))throw _0x4e474e;this['_handleReconnectionError']();}}}}destroy(){const _0x5d7f4d=this['editor']['plugins']['get'](K),_0x2af893=this['editor']['plugins']['get'](J);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2af893['channelSessions']['has'](this['_channelId'])&&_0x2af893['unregister'](this['_channelId']),_0x5d7f4d['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x59b478){if(this['sessionId']!==_0x59b478['sessionId']&&this['_lastSyncedOperationId']!==_0x59b478['lastOperationId'])throw new nt();return this['sessionId']=_0x59b478['sessionId'],this['_handleServerResponse']([],{..._0x59b478,'wereChangesApplied':!0x1,'data':_0x59b478['data']},'reconnect');}async _connectService(_0x2021ea,_0x430889=!0x1){const {connection:_0x5c2fcd}=this['editor']['plugins']['get'](K);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x5c2fcd,this['_channelId'])['then'](_0x43e143=>this['_initSessionsHandling'](_0x43e143))['catch'](_0xcf009a=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0xcf009a);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x5dd82c,_0x508659)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x508659);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x32a982=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2021ea);this['_isPendingUpdate']=!0x0;const _0x31edab=await this['_service']['connect'](_0x5c2fcd,this['_compressOperations'](_0x2021ea),_0x32a982);if(this['sessionId']=_0x31edab['sessionId'],_0x430889){if(!_0x31edab['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x31edab['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2021ea,_0x31edab,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x31edab,_0x2021ea);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x1d9717=this['editor']['plugins']['get'](J),_0x4eaf4a=this['editor']['plugins']['get'](X),_0xdc3fce=_0x1d9717['channelSessions']['get'](this['_channelId']);_0xdc3fce&&_0xdc3fce['length']>0x1?_0x4eaf4a['createUserMarkerOperations']():this['listenTo'](_0x1d9717,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1d9717['channelSessions']['get'](this['_channelId'])['length']&&_0x4eaf4a['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x1d40d9,_0x3f0cff,_0x3ccd19,_0x53903c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3f0cff){const _0x52d742=this['_decompressOperations'](_0x3ccd19,_0x53903c);await this['_fetchMissingUsers'](_0x52d742),this['_handleExternalOperations'](_0x52d742,_0x3f0cff,_0x3ccd19['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x21f1db}=this['editor'];let _0x224735;try{_0x224735=await this['_service']['getDocumentDetails']();}catch{const _0x406e5d=et(_0x21f1db,'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'](_0x406e5d);}const _0x292d56=_0x224735['currentDocumentSession']||_0x224735['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x292d56['lastOperationId']){const _0x31895c=et(_0x21f1db,'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'](_0x31895c);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x4f858b=this['editor']['plugins']['get'](K);if(this['_isConnected']=!0x1,!_0x4f858b['connection']||'connected'!==_0x4f858b['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x5e9877=this['editor']['plugins']['get'](J);_0x5e9877['channelSessions']['has'](this['_channelId'])&&_0x5e9877['unregister'](this['_channelId']),_0x4f858b['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x14eca2){const _0x303d10=this['editor']['plugins']['get'](J);this['listenTo'](_0x303d10,'sessionAdd:'+this['_channelId'],(_0x4938fc,{session:_0x1e9c07})=>{if(_0x1e9c07['id']===_0x303d10['mySessionId']){_0x4938fc['off']();const _0x180c0f=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x17939e=_0x1e9c07['permissions'];_0x180c0f&&_0x180c0f['isEnabled']&&(_0x17939e=_0x17939e['filter'](_0x20d2ac=>'document:write'!==_0x20d2ac)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x17939e,this['_channelId']);}}),_0x303d10['register'](this['_channelId'],_0x14eca2);}_initThrowingOnDataSet(){const _0x488b7d=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x541bde)=>{if(!_0x541bde[_0x541bde['length']-0x1]['suppressErrorInCollaboration'])throw new _0xa544f3('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x488b7d['apply'](this['editor']['data'],_0x541bde);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x481086,[_0x41f547])=>{if(this['_document']['version'])throw new _0xa544f3('realtimecollaborationclient-init-document-already-initialized',this);_0x481086['stop'](),this['_setPendingAction']();const _0x546930=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x178843])=>!_0x178843['lazyLoad'])['map'](([_0x196a0c,_0x32c588])=>[_0x196a0c,_0x32c588['modelAttributes']||{}])),_0x4b542c=this['_getOperationsFromInitData'](_0x41f547,_0x546930);0x0==_0x4b542c['length']&&_0x4b542c['push'](new _0x143a76(0x0)),_0x481086['return']=this['_connectService'](_0x4b542c)['then'](()=>{this['editor']['plugins']['get'](K)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x50a6b8=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x50a6b8))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1003ce,[_0x57aea7,_0x38d0da])=>{_0x1003ce['stop']();const _0x23e645=this['editor']['model']['document']['getRoot'](_0x57aea7);if(!this['_knownRootNames']['has'](_0x57aea7)){const _0x3c9d14=_0x38d0da&&_0x38d0da['data']?_0x38d0da['data']:'',_0x2809c8=_0x38d0da&&_0x38d0da['attributes']?_0x38d0da['attributes']:{};await this['_loadRoot'](_0x57aea7,_0x3c9d14,_0x2809c8);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x23e645['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x23e645);});},{'priority':'high'});}async _fetchMissingUsers(_0x28c550){const _0x28a198=this['editor']['plugins']['get'](_0x5cfa5a),{connection:_0x39dc3a}=this['editor']['plugins']['get'](K),_0x19c613=new Set();for(const _0x4a336b of _0x28c550){const _0x3d5d65=_0x4a336b['_authorId'];_0x3d5d65&&!_0x28a198['getUser'](_0x3d5d65)&&_0x19c613['add'](_0x3d5d65);}if(0x0===_0x19c613['size'])return;const _0x2d9c65=await _0x162564['getMany'](_0x39dc3a,Array['from'](_0x19c613));for(const _0x4fd2b2 of _0x2d9c65)_0x28a198['getUser'](_0x4fd2b2['id'])||_0x28a198['addUser'](_0x4fd2b2);}_getOperationsFromInitData(_0x3c6bae,_0x14ce93={}){const _0x4af39c=this['editor']['model'],_0x5b69e3=[];let _0x1cd153=0x0;const _0x2240d5='string'==typeof _0x3c6bae?{'main':_0x3c6bae}:_0x3c6bae;for(const _0x44ee84 of Object['keys'](_0x2240d5)){if(!this['_document']['roots']['has'](_0x44ee84))throw new _0xa544f3('realtimecollaborationclient-init-non-existent-root',this);const _0x521a31=this['_document']['getRoot'](_0x44ee84),_0x532e70=this['editor']['data']['parse'](_0x2240d5[_0x44ee84],_0x521a31),_0x560ebe=new _0x22676a(_0x4af39c['createPositionAt'](_0x521a31,0x0),_0x532e70,_0x1cd153++);_0x5b69e3['push'](_0x560ebe);for(const [_0x1ef3f1,_0x2edea3]of _0x532e70['markers']){const _0x5251db=_0x4af39c['createRange'](_0x4af39c['createPositionFromPath'](_0x521a31,_0x2edea3['start']['path']['slice']()),_0x4af39c['createPositionFromPath'](_0x521a31,_0x2edea3['end']['path']['slice']())),_0x3eb6ae=new _0x2e10d5(_0x1ef3f1,null,_0x5251db,_0x4af39c['markers'],!0x0,_0x1cd153++);_0x5b69e3['push'](_0x3eb6ae);}}if(_0x14ce93)for(const [_0x437e8c,_0x3d5d6c]of Object['entries'](_0x14ce93)){const _0x5e27e9=_0x4af39c['document']['getRoot'](_0x437e8c);if(!_0x5e27e9)throw new _0xa544f3('multi-root-editor-root-attributes-no-root',null);for(const [_0xfc3ded,_0x9f58b5]of Object['entries'](_0x3d5d6c))if(null!==_0x9f58b5){const _0x12ad85=new _0xa4fad7(_0x5e27e9,_0xfc3ded,null,_0x9f58b5,_0x1cd153++);_0x5b69e3['push'](_0x12ad85);}}return _0x5b69e3;}async _loadRoot(_0x4b21cb,_0x40cbc4,_0x52c245){this['_getOperationsFromInitData']({[_0x4b21cb]:_0x40cbc4},{[_0x4b21cb]:_0x52c245})['forEach']((_0x363c97,_0x19a172)=>{_0x363c97['baseVersion']=this['_document']['version']+_0x19a172,_0x363c97['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x363c97);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x4afa24,_0x31e6ba){let _0x3e98cb;this['_offset']=_0x4afa24['offset'];const _0x1c6d5d=_0x4afa24['wereChangesApplied']&&!_0x4afa24['initData'],_0x33586c=_0x1c6d5d?0x0:_0x4afa24['data']['baseVersion'];if(_0x31e6ba['forEach'](_0x21afcb=>{_0x21afcb['_isInit']=!0x0,_0x21afcb['createdAt']=_0x4afa24['sessionCreatedAt'],_0x21afcb['_authorId']=null;}),_0x1c6d5d)_0x3e98cb=_0x31e6ba,this['_applyOperationsSet'](_0x3e98cb,_0x1c6d5d);else{if(_0x4afa24['initData']){const _0x3b9c6c=this['_getOperationsFromInitData'](_0x4afa24['initData']);this['_document']['history']['version']=-_0x3b9c6c['length'],_0x3b9c6c['forEach'](_0x11d34a=>{_0x11d34a['baseVersion']-=_0x3b9c6c['length'],_0x11d34a['createdAt']=_0x4afa24['sessionCreatedAt'],_0x11d34a['_isInit']=!0x0,_0x11d34a['_authorId']=null;}),this['_applyOperationsSet'](_0x3b9c6c,!0x0),this['serverHistory']['version']=-_0x3b9c6c['length']+this['_offset'],this['_updateServerHistory'](_0x3b9c6c);}this['_document']['history']['version']=_0x33586c,_0x3e98cb=this['_decompressOperations'](_0x4afa24['data'],_0x4afa24['metadata']),await this['_fetchMissingUsers'](_0x3e98cb),this['_applyOperationsSet'](_0x3e98cb,_0x1c6d5d);}_0x4afa24['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3e98cb,_0x4afa24['lastOperationId']),this['_lastSyncedOperationId']=_0x4afa24['lastOperationId']),this['serverHistory']['version']=_0x33586c+this['_offset'],this['_updateServerHistory'](_0x3e98cb),_0x31e6ba['filter'](_0x18b3c9=>{const _0x489abc=this['_getAffectedRoot'](_0x18b3c9);return _0x489abc&&!this['_knownRootNames']['has'](_0x489abc);})['forEach']((_0x3b90d7,_0x64568f)=>{_0x3b90d7['baseVersion']=this['_document']['version']+_0x64568f,this['_saveOperationInBuffer'](_0x3b90d7);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x3f4f32,_0x355239){const _0x2f3649=_0x355239&&_0x355239['message'];if(_0x2f3649&&_0x2f3649['startsWith']('realtimecollaborationclient'))throw _0x355239;const _0x122dd1=this['editor']['plugins']['get'](K);throw this['_isPendingUpdate']=!0x0,_0x122dd1['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0xa544f3(_0x3f4f32,this['editor'],_0x2f3649?{'originalError':_0x2f3649}:void 0x0);}_saveOperationInBuffer(_0x5948d7){this['_knownOperations']['has'](_0x5948d7)||(this['_knownOperations']['add'](_0x5948d7),this['_bufferedOperations']['push'](_0x5948d7),this['_pendingAction']||'marker'==_0x5948d7['type']&&!_0x5948d7['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x30d5ed=!0x1){!_0x30d5ed&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2a9177=>{_0x2a9177&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x4e8ec5=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x45d089){return _0x45d089['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x45d089['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x45d089['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x4e8ec5)||this['_crash'](_0x4e8ec5['message'],_0x4e8ec5);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x447800=>{this['on']('change:_isPendingUpdate',()=>{_0x447800();});});}async _sendBufferedOperations(){const _0x42377f=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x42377f['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x10e26e=[...this['_bufferedOperations']];for(const _0x3fdf65 of _0x10e26e)_0x3fdf65['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3fdf65);const _0x20fce8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x10e26e),_0x250232=st++,_0x50de97=this['_compressOperations'](_0x10e26e),_0x3fb055=await this['_service']['sendOperations'](_0x50de97,_0x50de97['baseVersion'],_0x20fce8);try{return await this['_handleServerResponse'](_0x10e26e,_0x3fb055,_0x250232);}catch(_0xf5adb0){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0xf5adb0);}}async['_handleServerResponse'](_0x266a31,_0x1b7ee4,_0x4ab6fe){if('error'in _0x1b7ee4)throw _0x1b7ee4['error'];let _0x1f93dd;if(_0x1b7ee4['wereChangesApplied']){_0x1b7ee4['lastOperationId']&&(this['_lastSyncedOperationId']=_0x1b7ee4['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1e67b0=>!_0x266a31['includes'](_0x1e67b0));for(const _0x5c58d1 of _0x266a31)_0x5c58d1['createdAt']='lastOperationAcceptedAt'in _0x1b7ee4&&_0x1b7ee4['lastOperationAcceptedAt']||void 0x0;rt(_0x266a31,_0x1b7ee4['version']-_0x266a31['length']),this['_updateServerHistory'](_0x266a31);const _0xdbfe1f=_0x266a31['filter'](_0x9b7f58=>{if(!_0x9b7f58['_isInit'])return!0x1;const _0x15059f=this['_getAffectedRoot'](_0x9b7f58);return _0x15059f&&!this['_knownRootNames']['has'](_0x15059f);});rt(_0xdbfe1f,this['_document']['version']),this['_applyOperationsSet'](_0xdbfe1f),_0x1f93dd=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5765b8=this['_decompressOperations'](_0x1b7ee4['data'],_0x1b7ee4['metadata'])['filter'](_0x54c6b8=>_0x54c6b8['baseVersion']>=this['_lastServerVersion']);_0x5765b8['forEach'](_0x467597=>this['_addKnownRoot'](_0x467597)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x159c0a=>!_0x159c0a['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x159c0a))),this['_bufferedOperations']['length']&&rt(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5765b8),_0x1f93dd=this['_handleExternalOperations'](_0x5765b8,_0x1b7ee4['version'],_0x1b7ee4['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1f93dd?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x2afcb4,_0x1acd24,_0x2a98ff){try{const _0x15027d={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x61bf61,operationsB:_0x4ff1b8,originalOperations:_0xefd99c}=_0x363af8(_0x2afcb4,this['_bufferedOperations'],_0x15027d);rt(_0x61bf61,this['_document']['version']),rt(_0x4ff1b8,_0x1acd24);for(const _0x56daba of _0x61bf61){const _0x5453e8=_0xefd99c['get'](_0x56daba);_0x5453e8?(_0x56daba['_authorId']=_0x5453e8['_authorId'],'noop'!==_0x56daba['type']&&(_0x56daba['_aiSource']=_0x5453e8['_aiSource'])):_0x56daba['_authorId']=null;}for(const _0x9c046e of _0x4ff1b8)'noop'!==_0x9c046e['type']&&(_0x9c046e['_aiSource']=_0xefd99c['get'](_0x9c046e)?.['_aiSource']);_0x2a98ff&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2afcb4,_0x2a98ff),this['_lastSyncedOperationId']=_0x2a98ff),this['_bufferedOperations']=[..._0x4ff1b8],this['_applyOperationsSet'](_0x61bf61),this['_updateServerHistory'](_0x2afcb4);}catch(_0x5d08fa){return console['error'](_0x5d08fa),!0x1;}return!0x0;}_applyOperationsSet(_0x37f049,_0x2bd3b9=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x321287=>{for(const _0x54f069 of _0x37f049)this['_knownOperations']['add'](_0x54f069),this['_addKnownRoot'](_0x54f069),_0x321287['batch']['addOperation'](_0x54f069),this['editor']['model']['applyOperation'](_0x54f069);});}_addKnownRoot(_0x30fdf6){const _0x21e3ed=this['_getAffectedRoot'](_0x30fdf6);_0x21e3ed&&this['_knownRootNames']['add'](_0x21e3ed);}_getAffectedRoot(_0x325a63){let _0x42a2b2,_0x57832d;switch(_0x325a63['type']){case'insert':_0x42a2b2=_0x325a63['position']['root'];break;case'marker':if(_0x57832d=_0x325a63['newRange'],!_0x57832d)return null;_0x42a2b2=_0x57832d['root'];break;case'addRootAttribute':_0x42a2b2=_0x325a63['root'];break;case'addRoot':_0x42a2b2=_0x325a63['affectedSelectable'];break;case'move':_0x42a2b2=_0x325a63['targetPosition']['root'];break;default:return null;}return _0x42a2b2['rootName'];}_updateServerHistory(_0x46c7cf){_0x46c7cf['forEach'](_0x280e69=>{const _0x4db226=_0x280e69['clone']();_0x4db226['_authorId']=_0x280e69['_authorId'],_0x4db226['_isInit']=!!_0x280e69['_isInit'],_0x4db226['_aiSource']=_0x280e69['_aiSource'],_0x4db226['createdAt']=_0x280e69['createdAt'],_0x4db226['baseVersion']+=this['_offset'],_0x280e69['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4db226),this['serverHistory']['addOperation'](_0x4db226);});}_handleReconnectionError(_0x3d544d){const _0x590d84=this['editor']['plugins']['get']('Notification'),_0xc191fb=this['editor']['locale'];_0x3d544d||(_0x3d544d=et(_0xc191fb,'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.')),_0x590d84['showWarning'](_0x3d544d,{'title':et(_0xc191fb,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](K)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x380194)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x380194)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x4e7da5){const _0x50138b=_0x4e7da5['map'](_0x15cf32=>_0x15cf32['toJSON']());return this['_compressor']['compress'](_0x50138b);}_decompressOperations(_0x354319,_0x1009ce){return this['_compressor']['decompress'](_0x354319)['map']((_0x5e76cd,_0x4bae03)=>{const _0x2048e7='init'==_0x1009ce[_0x4bae03]['type'];if('InsertOperation'==_0x5e76cd['__className']){const _0x1569e5=_0x5e76cd['position']['root'];!this['_document']['getRoot'](_0x1569e5)&&(this['_document']['createRoot']('$unknown',_0x1569e5)['_isAttached']=!0x1);}else{if('RootOperation'==_0x5e76cd['__className']){const _0x37051d=this['_document']['getRoot'](_0x5e76cd['rootName']);_0x37051d&&'$unknown'==_0x37051d['name']&&_0x5e76cd['elementName']!=_0x37051d['name']&&(_0x37051d['name']=_0x5e76cd['elementName']);}}const _0x4e7f42=_0x196d95['fromJSON'](_0x5e76cd,this['_document']);return _0x4e7f42['wasUndone']=_0x5e76cd['wasUndone'],_0x4e7f42['_isInit']=_0x2048e7,_0x4e7f42['_authorId']=_0x2048e7?null:_0x1009ce[_0x4bae03]['userId'],_0x4e7f42['_isDisconnection']='cs:removeUser'===_0x1009ce[_0x4bae03]['type'],_0x4e7f42['_aiSource']=_0x5e76cd['_aiSource']||void 0x0,_0x4e7f42['createdAt']=_0x1009ce[_0x4bae03]['createdAt'],_0x4e7f42;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x35a0ce=this['editor']['plugins']['get'](J)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x35a0ce&&_0x35a0ce['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function rt(_0x1e0bca,_0x5d15e5){for(const _0x2192ce of _0x1e0bca)_0x2192ce['baseVersion']=_0x5d15e5++;}var ot=class{_ignoredOperations;_operationToId;constructor(_0xf76bc3){this['_ignoredOperations']=_0xf76bc3,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x134983){let _0x407b4b=_0x134983['length'];for(;_0x407b4b--;){const _0x22ed11=_0x134983[_0x407b4b];if(!this['_ignoredOperations']['has'](_0x22ed11)){if(!this['_operationToId']['has'](_0x22ed11)){const _0x12d634=_0x1d6e1f()['slice'](0x1,0x12);this['_operationToId']['set'](_0x22ed11,_0x12d634);}return this['_operationToId']['get'](_0x22ed11);}}}setIdForTheLastOperation(_0x349b26,_0x134c69){if(!_0x134c69)return;let _0x3137c9=_0x349b26['length'];for(;_0x3137c9--;){const _0x37d5e0=_0x349b26[_0x3137c9];this['_ignoredOperations']['has'](_0x37d5e0)||this['_operationToId']['set'](_0x37d5e0,_0x134c69);}}},ct=class extends _0x5a0766{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class extends _0x5a0766{['_sources']=new Map();_data=null;_hasStarted=!0x1;static get requires(){return[K,J,_0x5cfa5a];}static get['pluginName'](){return'RealTimeContentFetcher';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_register(_0x3a516b,_0x20bc42){if(this['_hasStarted'])throw new _0xa544f3('realtimecontentfetcher-register-after-init',null,{'name':_0x3a516b});if(this['_sources']['has'](_0x3a516b))throw new _0xa544f3('realtimecontentfetcher-register-duplicate',null,{'name':_0x3a516b});this['_sources']['set'](_0x3a516b,_0x20bc42);}_takeInitialData(_0x340398){if(!this['_data'])throw new _0xa544f3('realtimecontentfetcher-data-not-ready',null,{'name':_0x340398});if(!this['_data']['has'](_0x340398))throw new _0xa544f3('realtimecontentfetcher-data-not-available',null,{'name':_0x340398});const _0x1674fd=this['_data']['get'](_0x340398);return this['_data']['delete'](_0x340398),_0x1674fd;}async init(){this['_hasStarted']=!0x0;const _0x4d69d1=Array['from'](this['_sources']),_0x2695d3=await Promise['all'](_0x4d69d1['map'](([,_0x28f87f])=>_0x28f87f['fetch']()));await this['_fetchMissingUsers'](_0x4d69d1['map'](([,_0x4c09be],_0x59451c)=>_0x4c09be['getUserIds'](_0x2695d3[_0x59451c]))),this['_data']=new Map(_0x4d69d1['map'](([_0x44ab78],_0x2935ab)=>[_0x44ab78,_0x2695d3[_0x2935ab]]));}async _fetchMissingUsers(_0x361b47){const _0x399b4a=this['editor']['plugins']['get'](_0x5cfa5a),_0xd1eee0=new Set();for(const _0x531ad6 of _0x361b47)for(const _0x3e47cd of _0x531ad6)_0x399b4a['getUser'](_0x3e47cd)||_0xd1eee0['add'](_0x3e47cd);if(0x0===_0xd1eee0['size'])return;const {connection:_0x491502}=this['editor']['plugins']['get'](K),_0x3a233f=await _0x162564['getMany'](_0x491502,Array['from'](_0xd1eee0));for(const _0x166355 of _0x3a233f)_0x399b4a['getUser'](_0x166355['id'])||_0x399b4a['addUser'](_0x166355);}};function ht(_0x55cd9e){const _0x3a5148=new Set();for(const {resolvedBy:_0x11d373,comments:_0x4c36b6}of _0x55cd9e){_0x11d373&&_0x3a5148['add'](_0x11d373);for(const {userId:_0x449632}of _0x4c36b6)_0x3a5148['add'](_0x449632);}return _0x3a5148;}var lt=class CloudServicesCommentsAdapter extends _0x34db9e{static CommentsService=/* #__PURE__ -- @preserve */
26
- ((()=>_0x2d917c)());['_services'];_pendingServiceEvents=new Map();_channelsAwaitingInitialData=new Set();static get requires(){return[K,_0x42d3f0,J,_0x5cfa5a];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5e88dc){super(_0x5e88dc),this['_services']=new Map();}async init(){const _0x532118=this['context'],_0x329c99=_0x532118['plugins']['get'](_0x42d3f0);if(_0x532118['plugins']['get'](K)['addToReconnectionStack'](this),_0x329c99['adapter']={'addCommentThread':async({channelId:_0x5f4900,threadId:_0x484446,comments:_0x1b2d64,resolvedAt:_0x4c5404,resolvedBy:_0x4f89dd,context:_0x32a5be,attributes:_0x3c6d6f})=>{const _0x22d387=await this['_getService'](_0x5f4900)['addCommentThread']({'commentThreadId':_0x484446,'comments':_0x1b2d64['map'](_0x2fea21=>function(_0x5c0d0b,_0x3bccfd,_0x706f1a){return{'commentThreadId':_0x706f1a,'commentId':_0x5c0d0b['commentId'],'userId':_0x5c0d0b['authorId'],'content':_0x5c0d0b['content'],'documentId':_0x3bccfd,'createdAt':_0x5c0d0b['createdAt'],'attributes':_0x5c0d0b['attributes']||{}};}(_0x2fea21,_0x5f4900,_0x484446)),'resolvedAt':_0x4c5404,'resolvedBy':_0x4f89dd,'context':_0x32a5be,'attributes':_0x3c6d6f})['catch'](ut);return{'threadId':_0x22d387['commentThreadId'],'comments':_0x22d387['comments']};},'getCommentThread':async({channelId:_0x30538f,threadId:_0x131557})=>{const _0x54e7b3=await this['_getService'](_0x30538f)['getCommentThread'](_0x131557)['catch'](dt)['catch'](ut);return _0x54e7b3?_0x54e7b3['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x54e7b3]),{'threadId':_0x54e7b3['commentThreadId'],'comments':_0x54e7b3['comments']['map'](ft),'context':_0x54e7b3['context'],'resolvedAt':_0x54e7b3['resolvedAt'],'resolvedBy':_0x54e7b3['resolvedBy'],'attributes':_0x54e7b3['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x209362,threadId:_0x4af6e5,context:_0x1c774e,unlinkedAt:_0x24365d,attributes:_0x5ef93c})=>this['_getService'](_0x209362)['updateCommentThread']({'commentThreadId':_0x4af6e5,'context':_0x1c774e,'attributes':_0x5ef93c,'unlinkedAt':_0x24365d})['catch'](dt)['catch'](ut),'resolveCommentThread':async({channelId:_0x5194ab,threadId:_0x35c3fe})=>{const _0x1db91d=await this['_getService'](_0x5194ab)['resolveCommentThread'](_0x35c3fe)['catch'](dt)['catch'](ut);return{'threadId':_0x1db91d['commentThreadId'],'resolvedAt':_0x1db91d['resolvedAt'],'resolvedBy':_0x1db91d['resolvedBy']};},'reopenCommentThread':async({channelId:_0x8758ab,threadId:_0x17ce5e})=>this['_getService'](_0x8758ab)['reopenCommentThread'](_0x17ce5e)['catch'](dt)['catch'](ut),'removeCommentThread':({channelId:_0xa9baba,threadId:_0x24d348})=>this['_getService'](_0xa9baba)['removeCommentThread'](_0x24d348)['catch'](dt)['catch'](ut),'addComment':({channelId:_0x1c0de8,threadId:_0x1936b4,commentId:_0x2fc3ef,content:_0x1bd930,attributes:_0x396c0b})=>this['_getService'](_0x1c0de8)['addComment'](_0x1936b4,_0x2fc3ef,_0x1bd930,_0x396c0b)['catch'](ut),'updateComment':({channelId:_0x117a86,threadId:_0x2fc386,commentId:_0x45bc2a,content:_0x4110a0,attributes:_0x13413a})=>this['_getService'](_0x117a86)['updateComment'](_0x2fc386,_0x45bc2a,_0x4110a0,_0x13413a)['catch'](dt)['catch'](ut),'removeComment':({channelId:_0x3705c0,threadId:_0x6d1636,commentId:_0x1ddc3e})=>this['_getService'](_0x3705c0)['removeComment'](_0x6d1636,_0x1ddc3e)['catch'](dt)['catch'](ut)},_0x532118 instanceof _0xe30d69){const _0x540eac=_0x532118['config']['get']('collaboration.channelId'),_0x360021=_0x532118['plugins']['get'](J);await this['_setUpService'](_0x540eac);const _0xf861cb=await this['_services']['get'](_0x540eac)['getConnectedSessions']();this['listenTo'](_0x360021,'sessionAdd:'+_0x540eac,(_0x41095e,{session:_0x1098d3})=>{_0x1098d3['id']===_0x360021['mySessionId']&&(_0x41095e['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x1098d3['permissions'],_0x540eac));}),_0x360021['register'](_0x540eac,_0xf861cb);}}async _setUpService(_0xa1ff14){this['_createService'](_0xa1ff14),await this['_connectService'](_0xa1ff14);}_createService(_0x4e5cd5){if(this['_services']['has'](_0x4e5cd5))throw new _0xa544f3('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4e5cd5});const _0xda76ac=this['context']['plugins']['get'](_0x42d3f0),_0x546ba9=new CloudServicesCommentsAdapter['CommentsService'](_0x4e5cd5);this['_services']['set'](_0x4e5cd5,_0x546ba9),this['listenTo'](_0x546ba9,'commentThreadAdded',(_0x54a19e,_0x53ee25)=>{const {commentThreadId:_0x335f06,documentId:_0x824f6b,context:_0x429257,attributes:_0x2e8537,resolvedAt:_0x23613e,resolvedBy:_0x28ec23,comments:_0xe549e9}=_0x53ee25,_0x50db5f=_0xe549e9?_0xe549e9['map'](({userId:_0x2753f0})=>_0x2753f0):[];_0x28ec23&&_0x50db5f['push'](_0x28ec23),this['_handleOrQueueServiceEvent'](_0x4e5cd5,_0x50db5f,()=>{_0xda76ac['getCommentThread'](_0x335f06)||_0xda76ac['addCommentThread']({'threadId':_0x335f06,'channelId':_0x824f6b,'comments':_0xe549e9?_0xe549e9['map'](ft):[],'context':_0x429257,'attributes':_0x2e8537,'resolvedAt':_0x23613e,'resolvedBy':_0x28ec23,'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'commentThreadUpdated',(_0x55d1e7,{commentThreadId:_0x564730,documentId:_0x9b5ae2,context:_0x5522b,unlinkedAt:_0xf6d884,attributes:_0x2ff595})=>{this['_handleOrQueueServiceEvent'](_0x4e5cd5,[],()=>{_0xda76ac['getCommentThread'](_0x564730)&&_0xda76ac['updateCommentThread']({'threadId':_0x564730,'channelId':_0x9b5ae2,'context':_0x5522b,'unlinkedAt':_0xf6d884,'attributes':_0x2ff595,'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'commentThreadResolved',(_0x45ef55,{commentThreadId:_0x531d69,resolvedBy:_0xdc586a,resolvedAt:_0x228e54})=>{this['_handleOrQueueServiceEvent'](_0x4e5cd5,[_0xdc586a],()=>{const _0x339cda=_0xda76ac['getCommentThread'](_0x531d69);_0x339cda&&!_0x339cda['isResolved']&&_0x339cda['resolve']({'resolvedBy':_0xdc586a,'resolvedAt':_0x228e54,'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'commentThreadReopened',(_0x36143c,{commentThreadId:_0x2c149f})=>{this['_handleOrQueueServiceEvent'](_0x4e5cd5,[],()=>{const _0x216c03=_0xda76ac['getCommentThread'](_0x2c149f);_0x216c03&&_0x216c03['isResolved']&&_0x216c03['reopen']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'commentThreadRemoved',(_0x2a175b,{commentThreadId:_0x5cda47})=>{this['_handleOrQueueServiceEvent'](_0x4e5cd5,[],()=>{const _0x2e358b=_0xda76ac['getCommentThread'](_0x5cda47);_0x2e358b&&_0x2e358b['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'commentAdded',(_0x385464,_0x21d1f1)=>{this['_handleOrQueueServiceEvent'](_0x4e5cd5,[_0x21d1f1['userId']],()=>{const _0x89b673=_0xda76ac['getCommentThread'](_0x21d1f1['commentThreadId']);_0x89b673&&!_0x89b673['getComment'](_0x21d1f1['commentId'])&&_0x89b673['addComment']({...ft(_0x21d1f1),'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'commentUpdated',(_0x2d8069,{commentThreadId:_0x15c443,commentId:_0x46192c,content:_0x236952,attributes:_0x5bc79b})=>{this['_handleOrQueueServiceEvent'](_0x4e5cd5,[],()=>{const _0x1c476f=_0xda76ac['getCommentThread'](_0x15c443)?.['getComment'](_0x46192c);_0x1c476f&&_0x1c476f['update']({'content':_0x236952,'attributes':_0x5bc79b,'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'commentRemoved',(_0x4f47a7,{commentThreadId:_0x242c42,commentId:_0x30fa19})=>{this['_handleOrQueueServiceEvent'](_0x4e5cd5,[],()=>{const _0xc12edc=_0xda76ac['getCommentThread'](_0x242c42)?.['getComment'](_0x30fa19);_0xc12edc&&_0xc12edc['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x546ba9,'disconnected',()=>{'connected'===this['context']['plugins']['get'](K)['connection']?.['state']&&(this['_services']['delete'](_0x4e5cd5),this['_pendingServiceEvents']['delete'](_0x4e5cd5),this['stopListening'](_0x546ba9));});}destroy(){if(this['context']instanceof _0xe30d69){const _0x17881f=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x17881f)&&this['_terminateService'](_0x17881f);}}_terminateService(_0x5e4e49){if(!this['_services']['has'](_0x5e4e49))throw new _0xa544f3('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x5e4e49});this['_getService'](_0x5e4e49)['disconnect'](),this['_services']['delete'](_0x5e4e49);}async reconnect(){for(const _0x42d4f1 of this['_services']['keys']())await this['_connectService'](_0x42d4f1);if(this['context']instanceof _0xe30d69){const _0x4a697a=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x4a697a)){const _0x1bc56e=this['context']['plugins']['get'](J);_0x1bc56e['unregister'](_0x4a697a);const _0x4eb76a=await this['_services']['get'](_0x4a697a)['getConnectedSessions']();_0x1bc56e['register'](_0x4a697a,_0x4eb76a);}}}_fetchInitialChannelData(_0x2fc4b7){return this['_channelsAwaitingInitialData']['add'](_0x2fc4b7),this['_fetchChannelData'](_0x2fc4b7);}async _applyInitialChannelData(_0x35c374,_0x26c2e3){this['_channelsAwaitingInitialData']['delete'](_0x35c374)&&await this['_applyChannelData'](_0x35c374,_0x26c2e3);}async _fetchChannelData(_0x41c902){const {connection:_0x11deff}=this['context']['plugins']['get'](K);return this['_pendingServiceEvents']['set'](_0x41c902,[]),await this['_services']['get'](_0x41c902)['connect'](_0x11deff);}async _applyChannelData(_0x34023f,_0x597f0f){const _0x1fa916=this['context']['plugins']['get'](_0x42d3f0),_0x1a9956=new Set(Array['from'](_0x1fa916['getCommentThreads']({'channelId':_0x34023f}),_0x261346=>_0x261346['id']));for(const _0x2e4913 of _0x597f0f)_0x2e4913['deletedAt']||_0x1a9956['delete'](_0x2e4913['commentThreadId']);for(const _0x35cf4c of _0x1a9956)_0x1fa916['getCommentThread'](_0x35cf4c)['remove']({'isFromAdapter':!0x0});for(const _0x3060a2 of _0x597f0f){let _0xec5c7f=_0x1fa916['getCommentThread'](_0x3060a2['commentThreadId']);const {commentThreadId:_0x4bd00b,context:_0x238307,attributes:_0x38dc5,resolvedBy:_0x17eb14,resolvedAt:_0x3933a6,unlinkedAt:_0x4f4ef9,deletedAt:_0x6cc40}=_0x3060a2;if(_0x6cc40)continue;_0xec5c7f||(_0xec5c7f=_0x1fa916['addCommentThread']({'channelId':_0x34023f,'threadId':_0x4bd00b,'context':_0x238307,'attributes':_0x38dc5||{},'resolvedBy':_0x17eb14,'resolvedAt':_0x3933a6,'unlinkedAt':_0x4f4ef9,'isFromAdapter':!0x0}));const _0x36dd7b=new Set(Array['from'](_0xec5c7f['comments'],_0x3f18f5=>_0x3f18f5['id']));for(const _0xeda772 of _0x3060a2['comments'])_0x36dd7b['delete'](_0xeda772['commentId']);for(const _0x5cf8cb of _0x36dd7b)_0xec5c7f['getComment'](_0x5cf8cb)['remove']({'isFromAdapter':!0x0});for(const _0x2980d3 of _0x3060a2['comments']){const _0x42f575=_0xec5c7f['getComment'](_0x2980d3['commentId']);_0x42f575?_0x42f575['content']!==_0x2980d3['content']&&_0x42f575['update']({'content':_0x2980d3['content'],'isFromAdapter':!0x0}):_0xec5c7f['addComment'](Object['assign'](ft(_0x2980d3),{'isFromAdapter':!0x0}));}}await this['_applyPendingServiceEvents'](_0x34023f);}_handleOrQueueServiceEvent(_0x12c91f,_0x56fbf8,_0x58732e){const _0x38605a=this['_pendingServiceEvents']['get'](_0x12c91f);_0x38605a?_0x38605a['push']({'userIds':_0x56fbf8,'apply':_0x58732e}):_0x58732e();}async _applyPendingServiceEvents(_0x486959){const _0x5304a7=this['_pendingServiceEvents']['get'](_0x486959)||[];for(;_0x5304a7['length'];){const _0x4af68d=_0x5304a7['splice'](0x0);await this['_fetchMissingUsers'](_0x4af68d['flatMap'](({userIds:_0x307067})=>_0x307067));for(const {apply:_0x30b463}of _0x4af68d)_0x30b463();}this['_discardPendingServiceEvents'](_0x486959,_0x5304a7);}_discardPendingServiceEvents(_0xd42b56,_0x1b4f22){this['_pendingServiceEvents']['get'](_0xd42b56)===_0x1b4f22&&this['_pendingServiceEvents']['delete'](_0xd42b56);}async _connectService(_0x4766ad){const _0x26dfbc=this['_channelsAwaitingInitialData']['delete'](_0x4766ad),_0x1285d5=this['_fetchChannelData'](_0x4766ad),_0x55788e=this['_pendingServiceEvents']['get'](_0x4766ad);let _0x534ada=!0x1;try{const _0x118000=await _0x1285d5;_0x534ada=!0x0,await this['_fetchMissingUsersForThreads'](_0x118000),await this['_applyChannelData'](_0x4766ad,_0x118000);}catch(_0x4adf67){throw this['_discardPendingServiceEvents'](_0x4766ad,_0x55788e),_0x26dfbc&&!_0x534ada&&this['_channelsAwaitingInitialData']['add'](_0x4766ad),_0x4adf67;}}_getService(_0xe48573){if(!this['_services']['has'](_0xe48573))throw new _0xa544f3('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xe48573});return this['_services']['get'](_0xe48573);}async _fetchMissingUsersForThreads(_0x2765fe){return this['_fetchMissingUsers'](ht(_0x2765fe));}async _fetchMissingUsers(_0x2af050){const _0x225667=this['context']['plugins']['get'](_0x5cfa5a),{connection:_0xee0dde}=this['context']['plugins']['get'](K),_0x347d4d=Array['from'](new Set(_0x2af050))['filter'](_0x180c41=>!_0x225667['getUser'](_0x180c41));if(0x0===_0x347d4d['length'])return;const _0x59b23a=await _0x162564['getMany'](_0xee0dde,_0x347d4d);for(const _0x50ceda of _0x59b23a)_0x225667['getUser'](_0x50ceda['id'])||_0x225667['addUser'](_0x50ceda);}};async function dt(_0x108d81){if('404'!==_0x108d81['code'])throw _0x108d81;}function ut(_0x17dacf){if((_0x1a430f=_0x17dacf)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1a430f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1a430f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1a430f;throw _0x17dacf;}function ft(_0x25195b){return{'threadId':_0x25195b['commentThreadId'],'commentId':_0x25195b['commentId'],'content':_0x25195b['content'],'createdAt':_0x25195b['createdAt'],'authorId':_0x25195b['userId'],'attributes':_0x25195b['attributes']||{}};}var mt=class CloudServicesTrackChangesAdapter extends _0x5a0766{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>_0x44e6d9)());_bufferedRequests;_trackChangesService;['_isChannelFlushed']=!0x1;_pendingSuggestionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[lt,_0x3db8ee,K,at];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x394a2d){super(_0x394a2d);const _0x3ab8ae=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x3ab8ae),_0x394a2d['plugins']['get'](at)['_register']('trackChanges',{'fetch':()=>this['_fetchInitialSuggestions'](),'getUserIds':_0x13c6be=>_0x13c6be['map'](({authorId:_0x12e10b})=>_0x12e10b)});}init(){const _0x523878=this['editor']['plugins']['get'](_0x3db8ee);_0x523878['adapter']={'getSuggestion':async _0x418089=>{await this['_waitForServiceReady']();const _0x328e4b=await this['_trackChangesService']['get'](_0x418089)['catch'](pt);return await this['_fetchMissingUsersForThreads']([_0x328e4b]),_0x328e4b;},'addSuggestion':async({id:_0x63efbe,type:_0x43d441,data:_0x51fbde,originalSuggestionId:_0x20e7e8,attributes:_0x2606d3})=>{await this['_waitForServiceReady']();const _0x166aac={'id':_0x63efbe,'type':_0x43d441,'data':_0x51fbde,'originalSuggestionId':_0x20e7e8,'attributes':_0x2606d3},_0x3e28ac=await this['_trackChangesService']['add'](_0x63efbe,_0x43d441,_0x51fbde,_0x20e7e8,_0x2606d3)['catch'](_0x130cf1=>{if(gt(_0x130cf1))return new Promise(_0x24de62=>{this['_bufferedRequests']['set'](_0x63efbe,{'resolve':_0x24de62,'suggestionData':_0x166aac});});throw _0x130cf1;});return this['_bufferedRequests']['delete'](_0x63efbe),_0x3e28ac;},'updateSuggestion':async(_0x40cc65,_0x180469)=>{if(await this['_waitForServiceReady'](),'open'!==_0x180469['state'])return this['_trackChangesService']['update'](_0x40cc65,_0x180469)['catch'](pt);}};const _0x4c1ca4=this['editor']['plugins']['get'](at)['_takeInitialData']('trackChanges');for(const _0x28416a of _0x4c1ca4){_0x523878['addSuggestionData'](_0x28416a)['_saved']=!0x0;}for(const {id:_0x3b43f2,attributes:_0x29dfd8}of this['_pendingSuggestionsUpdates'])this['_handleSuggestionUpdate'](_0x3b43f2,_0x29dfd8);this['_pendingSuggestionsUpdates']=null,this['_setReadyForReconnect']();}async _fetchInitialSuggestions(){const _0x25dfb5=this['editor']['plugins']['get'](K);this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x2df803,{id:_0x5b1d92,attributes:_0x53aa56})=>{this['_pendingSuggestionsUpdates']?this['_pendingSuggestionsUpdates']['push']({'id':_0x5b1d92,'attributes':_0x53aa56}):this['_handleSuggestionUpdate'](_0x5b1d92,_0x53aa56);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x25dfb5['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x25dfb5['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));});const _0x5d37b8=await this['_trackChangesService']['connect'](_0x25dfb5['connection']);return this['_isChannelFlushed']||_0x25dfb5['addToReconnectionStack'](this),_0x5d37b8;}_handleSuggestionUpdate(_0x478fb9,_0x1b61f2){const _0x5342a5=this['editor']['plugins']['get'](_0x3db8ee);_0x5342a5['hasSuggestion'](_0x478fb9)&&(_0x5342a5['getSuggestion'](_0x478fb9)['attributes']=_0x1b61f2);}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x31bfef=>console['error'](_0x31bfef)));}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x57bd6b=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x404322}=this['editor']['plugins']['get'](K),_0x5359bf=await this['_trackChangesService']['connect'](_0x404322);await this['_fetchMissingUsersForThreads'](_0x5359bf);for(const {suggestionData:_0x1aeac9,resolve:_0x1ee874}of this['_bufferedRequests']['values']()){let _0x10bdb1=_0x5359bf['find'](_0x2faeba=>_0x2faeba['id']===_0x1aeac9['id']);_0x10bdb1||(_0x10bdb1=await this['_trackChangesService']['add'](_0x1aeac9['id'],_0x1aeac9['type'],_0x1aeac9['data'],_0x1aeac9['originalSuggestionId'])),_0x1ee874(_0x10bdb1);}for(const _0x436275 of _0x5359bf)_0x57bd6b['hasSuggestion'](_0x436275['id'])||_0x57bd6b['addSuggestionData'](_0x436275);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x3c3b52=>{this['listenTo'](this['_trackChangesService'],'connected',_0x418b20=>{_0x418b20['off'](),_0x3c3b52();});});}async _fetchMissingUsersForThreads(_0x18d8ca){const _0x2432bc=this['editor']['plugins']['get'](_0x5cfa5a),{connection:_0x2dd501}=this['editor']['plugins']['get'](K),_0x129ead=new Set();for(const {authorId:_0x2122b8}of _0x18d8ca)_0x2432bc['getUser'](_0x2122b8)||_0x129ead['add'](_0x2122b8);if(0x0===_0x129ead['size'])return;const _0x1fdbc2=await _0x162564['getMany'](_0x2dd501,Array['from'](_0x129ead));for(const _0x3103d6 of _0x1fdbc2)_0x2432bc['getUser'](_0x3103d6['id'])||_0x2432bc['addUser'](_0x3103d6);}};function pt(_0x31c360){if(gt(_0x31c360))return new Promise(()=>{});throw _0x31c360;}function gt(_0x6bd5ca){return _0x6bd5ca['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x6bd5ca['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var wt=class extends _0x5a0766{static get requires(){return[_0x3fd57a,lt,ct,K,at];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x15d659){super(_0x15d659);const _0x16ec9f=_0x15d659['plugins']['get'](lt),_0x1a0a77=_0x15d659['config']['get']('collaboration.channelId');_0x15d659['plugins']['get'](at)['_register']('comments',{'fetch':()=>(_0x16ec9f['_createService'](_0x1a0a77),_0x16ec9f['_fetchInitialChannelData'](_0x1a0a77)),'getUserIds':ht});}init(){const _0x55d0a7=this['editor']['plugins']['get'](K),_0x307ddd=this['editor']['plugins']['get'](_0x510b45),_0x501f35=this['editor']['plugins']['get'](lt);this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x55d0a7,'change:state',(_0x55a6bd,_0x7a00de,_0x278783)=>{_0x307ddd['isThreadsLoadingPaused']='connected'!==_0x278783;});}),this['listenTo'](_0x55d0a7,'change:state',(_0x2f4ac0,_0x1cd283,_0x5c3430)=>{this['editor']['plugins']['get'](_0x42d3f0)['switchReadOnly']('connected'!==_0x5c3430);});const _0x4b8465=this['editor']['config']['get']('collaboration.channelId'),_0x540540=this['editor']['plugins']['get'](at)['_takeInitialData']('comments');return _0x501f35['_applyInitialChannelData'](_0x4b8465,_0x540540);}destroy(){const _0x6ba41f=this['editor']['plugins']['get'](lt),_0x2520ea=this['editor']['config']['get']('collaboration.channelId');_0x6ba41f['_services']['has'](_0x2520ea)&&_0x6ba41f['_terminateService'](_0x2520ea),super['destroy']();}},vt=class extends _0x5a0766{static get requires(){return[wt,mt,_0x1287db];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},_t=class CloudServicesRevisionHistoryAdapter extends _0x5a0766{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
- ((()=>_0x18141b)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;['_isChannelFlushed']=!0x1;_newestRevisionPrefetch=null;_pendingRevisionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[K,it,_0x2fad27,J,_0x5cfa5a,at];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x493a7b){super(_0x493a7b);const _0x54bbde=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x54bbde),this['set']('_isServiceConnected',!0x1),_0x493a7b['plugins']['get'](at)['_register']('revisionHistory',{'fetch':()=>this['_fetchInitialData'](),'getUserIds':({revisions:_0x4625d9})=>_0x4625d9['flatMap'](({authorsIds:_0x315b2a,creatorId:_0x30b67c})=>_0x30b67c?[..._0x315b2a,_0x30b67c]:_0x315b2a)});}async init(){const _0x18f09b=this['editor']['plugins']['get'](it),{hasEditorBundle:_0xa89ce6,revisions:_0x10cc2b}=this['editor']['plugins']['get'](at)['_takeInitialData']('revisionHistory');this['listenTo'](this['editor']['data'],'ready',()=>{this['_setReadyForReconnect'](),this['_newestRevisionPrefetch']=null;}),this['editor']['plugins']['get'](_0x2fad27)['adapter']={'getRevision':async({revisionId:_0x551726})=>{const _0x2b0d2f=this['_newestRevisionPrefetch'];return _0x2b0d2f&&_0x2b0d2f['revisionId']===_0x551726?(this['_newestRevisionPrefetch']=null,_0x2b0d2f['promise']):(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x551726));},'updateRevisions':async _0x5acb5f=>{await this['_waitForServiceReady']();const _0x1f8c4d=this['_revisionTracker']['currentRevision'];if(_0xa89ce6&&0x1===_0x5acb5f['length']&&_0x5acb5f[0x0]['id']===_0x1f8c4d['id'])return _0x5acb5f;for(const _0x30a537 of _0x5acb5f)_0x30a537['id']===_0x1f8c4d['id']&&(_0x30a537['isEmptyCurrent']=_0x30a537['fromVersion']===_0x30a537['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x5acb5f,this['_lastRequestId'])['then'](_0x25d28c=>(this['_lastRequestId']=_0x25d28c,_0x5acb5f))['catch'](_0x46ef3b=>{if(yt(_0x46ef3b)||'400'===_0x46ef3b['code']&&void 0x0!==_0x46ef3b['data']['wrongRequestId']){for(const _0x3ac1cb of _0x5acb5f)this['_revisionTracker']['repository']['getRevision'](_0x3ac1cb['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x3ac1cb['id'],_0x3ac1cb,!0x1);if(yt(_0x46ef3b)&&'destroyed'!==this['editor']['state'])throw _0x46ef3b;return _0x5acb5f;}throw _0x46ef3b;});}};for(const _0x7af456 of _0x10cc2b)this['_revisionTracker']['addRevisionData'](_0x7af456);this['listenTo'](_0x18f09b,'change:_isConnected',(_0x45e8cb,_0x1f0119,_0x5c8993)=>{_0x5c8993&&(this['_oldOffset']=_0x18f09b['_offset'],_0x45e8cb['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected'),await this['_applyPendingRevisionsUpdates']();}async _fetchInitialData(){const _0x2d77f8=this['editor']['plugins']['get'](it),_0x52e5aa=this['editor']['plugins']['get'](K),_0x50608c=_0x2d77f8['serverHistory'];this['_revisionTracker']['setSource']({'history':_0x50608c,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x2d77f8['sessionId']}),this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x55474b,{revisionsData:_0x59b438,requestId:_0x57a135})=>{_0x59b438['some'](({id:_0x45c932})=>_0x45c932===this['_newestRevisionPrefetch']?.['revisionId'])&&(this['_newestRevisionPrefetch']=null),Math['max'](..._0x59b438['map'](_0x36e346=>_0x36e346['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleOrQueueRevisionsUpdate'](_0x59b438,_0x57a135);}):this['_handleOrQueueRevisionsUpdate'](_0x59b438,_0x57a135);}),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x52e5aa['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x52e5aa['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const _0xf17479=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x327011,[_0x1af732,_0x4c8954]=await Promise['all']([_0x3f4ccb['isBundleUploaded'](_0x52e5aa['connection'],_0xf17479),this['_revisionHistoryService']['connect'](_0x52e5aa['connection'])['then'](_0x31eb15=>(this['_lastRequestId']=_0x31eb15['requestId'],this['_isChannelFlushed']||_0x52e5aa['addToReconnectionStack'](this),this['_prefetchNewestRevision'](_0x31eb15['revisions']),_0x31eb15['revisions']))]);return{'hasEditorBundle':_0x1af732,'revisions':_0x4c8954};}_handleOrQueueRevisionsUpdate(_0x35a8de,_0x549982){this['_pendingRevisionsUpdates']?this['_pendingRevisionsUpdates']['push']({'revisionsData':_0x35a8de,'requestId':_0x549982}):this['_handleRevisionsUpdate'](_0x35a8de,_0x549982);}async _applyPendingRevisionsUpdates(){for(;this['_pendingRevisionsUpdates']['length'];){const _0x3dc35f=this['_pendingRevisionsUpdates']['splice'](0x0);await this['_fetchMissingUsers'](_0x3dc35f['flatMap'](({revisionsData:_0x1fc8ae})=>_0x1fc8ae));for(const {revisionsData:_0x54db27,requestId:_0x1ede27}of _0x3dc35f)this['_handleRevisionsUpdate'](_0x54db27,_0x1ede27);}this['_pendingRevisionsUpdates']=null;}_prefetchNewestRevision(_0x1fc92e){const _0x338b4e=_0x1fc92e['reduce']((_0x5e2ea3,_0x35f555)=>_0x5e2ea3?(_0x35f555['toVersion']-_0x5e2ea3['toVersion']||_0x35f555['fromVersion']-_0x5e2ea3['fromVersion'])>0x0?_0x35f555:_0x5e2ea3:_0x35f555,null);if(!_0x338b4e||_0x338b4e['diffData'])return;const _0x1b547b=this['_revisionHistoryService']['getRevision'](_0x338b4e['id']);_0x1b547b['catch'](()=>{}),this['_newestRevisionPrefetch']={'revisionId':_0x338b4e['id'],'promise':_0x1b547b};}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x18f1d4=this['editor']['plugins']['get'](K),_0x55d4bc=this['editor']['plugins']['get'](it),_0x4d8245=async()=>{const _0x3a0b11=this['_revisionTracker']['currentRevision'],_0x5dd1ab=_0x3a0b11['id'],_0x11dfe0=_0x5dd1ab!==_0x55d4bc['sessionId'];if(_0x11dfe0){const _0x21fffd=_0x55d4bc['_offset']-this['_oldOffset'],_0x2f03c4=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x3a0b11['toVersion']+_0x21fffd!==_0x2f03c4){const _0x36db27=_0x3a0b11['fromVersion']+_0x21fffd,_0x27a958=this['editor']['plugins']['get'](_0x5cfa5a),_0x703ccd=this['_revisionTracker']['buildRevisionData']({'revision':_0x3a0b11,'from':_0x36db27,'to':_0x2f03c4});_0x703ccd['id']=_0x3a0b11['id'];const _0x342805=_0x703ccd['authorsIds']['map'](_0x121229=>_0x27a958['getUser'](_0x121229));_0x3a0b11['_update']({..._0x703ccd,'authors':_0x342805},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x3a0b11['id'],_0x703ccd,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2f03c4,_0x3a0b11['toVersion']!==_0x3a0b11['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x5dd1ab)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x5dd1ab),this['_revisionTracker']['_createCurrentRevision'](_0x2f03c4);}const {revisions:_0xdf20e1,requestId:_0x451b59}=await this['_revisionHistoryService']['reconnect'](_0x18f1d4['connection'],this['_lastRequestId']);_0x11dfe0&&_0xdf20e1['length']>0x0?_0x55d4bc['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0xdf20e1),this['_handleRevisionsUpdate'](_0xdf20e1,_0x451b59),this['_revisionTracker']['sendBufferedUpdates']());};return _0x55d4bc['_isConnected']?_0x4d8245():new Promise((_0x4a0031,_0x1dccd8)=>{_0x55d4bc['once']('change:_isConnected',()=>{_0x4d8245()['then'](_0x4a0031)['catch'](_0x1dccd8);});});}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x2526f8=>console['error'](_0x2526f8)));}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x128635=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0xd986c5=>{_0xd986c5['off'](),_0x128635();});});}_getLatestVersionFromServerOperations(){const _0x3872fa=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x5887a4 of _0x3872fa)if('marker'!==_0x5887a4['type']||_0x5887a4['affectsData'])return _0x5887a4['baseVersion']+0x1;}_getLatestVersion(){const _0x453731=this['editor']['plugins']['get'](it);return new Promise(_0x4b3c64=>{_0x453731['_isPendingUpdate']?_0x453731['once']('change:_isPendingUpdate',()=>{_0x4b3c64(this['_getLatestVersionFromServerOperations']());}):_0x4b3c64(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x32ccc7,_0x5b12bf){const _0x5d5e8a=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5b12bf;for(const _0x3c5698 of _0x32ccc7){const _0x49d198=_0x5d5e8a['getRevision'](_0x3c5698['id']);if(_0x49d198){if((_0x3c5698['fromVersion']||_0x3c5698['toVersion'])&&(_0x3c5698['diffData']=null),_0x49d198===this['_revisionTracker']['currentRevision']){const _0x3dad67=Math['max'](_0x49d198['toVersion'],_0x3c5698['toVersion']),_0x25dae5=Math['max'](_0x49d198['fromVersion'],_0x3c5698['fromVersion']);let _0x4ec7b0;_0x49d198['toVersion']===_0x3c5698['toVersion']&&_0x49d198['fromVersion']===_0x3c5698['fromVersion']?(_0x4ec7b0=!0x0,this['_preventResendingRevisionData'](_0x3c5698)):_0x3c5698['toVersion']===_0x3dad67&&_0x3c5698['fromVersion']===_0x25dae5?_0x4ec7b0=!0x1:(_0x49d198['toVersion']===_0x3dad67&&_0x49d198['fromVersion']===_0x25dae5||this['_fixRevision']({'revision':_0x49d198,'from':_0x25dae5,'to':_0x3dad67}),_0x4ec7b0=!0x0),_0x4ec7b0&&(delete _0x3c5698['fromVersion'],delete _0x3c5698['toVersion'],delete _0x3c5698['diffData'],delete _0x3c5698['createdAt'],delete _0x3c5698['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3c5698),this['_preventResendingRevisionData'](_0x3c5698);}else this['_revisionTracker']['addRevisionData'](_0x3c5698);}const _0x307c09=_0x5d5e8a['getRevisions']();_0x307c09['reverse']();for(let _0x43b4dc=0x0;_0x43b4dc<_0x307c09['length']-0x1;_0x43b4dc++){const _0x1221bf=_0x307c09[_0x43b4dc],_0x35b502=_0x307c09[_0x43b4dc+0x1];if(_0x1221bf['fromVersion']<_0x35b502['toVersion']){const _0x567b59=_0x35b502['toVersion'],_0x11f4e4=Math['max'](_0x567b59,_0x1221bf['toVersion']);this['_fixRevision']({'revision':_0x1221bf,'from':_0x567b59,'to':_0x11f4e4});}}}['_fixRevision']({revision:_0x19e1f4,from:_0x4d6713,to:_0x239d8f}={}){const _0x258779=this['editor']['plugins']['get'](_0x5cfa5a),_0x1f76e1=this['_revisionTracker']['buildRevisionData']({'revision':_0x19e1f4,'from':_0x4d6713,'to':_0x239d8f});_0x1f76e1['authors']=_0x1f76e1['authorsIds']['map'](_0x4660d2=>_0x258779['getUser'](_0x4660d2)),_0x19e1f4['_update'](_0x1f76e1);}_preventResendingRevisionData(_0x48adda){const _0x21341e={};_0x21341e['id']=_0x48adda['id'];for(const _0x3963a8 of Object['keys'](_0x48adda))'id'!==_0x3963a8&&(_0x21341e[_0x3963a8]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x21341e['id'],_0x21341e,!0x0);}async _fetchMissingUsers(_0x582b5a){const _0x3ecd97=this['editor']['plugins']['get'](_0x5cfa5a),{connection:_0x400c84}=this['editor']['plugins']['get'](K),_0x56fef3=new Set();for(const _0x2178f8 of _0x582b5a){for(const _0x31720f of _0x2178f8['authorsIds']||[])_0x59f232(_0x31720f);_0x2178f8['creatorId']&&_0x59f232(_0x2178f8['creatorId']);}if(0x0===_0x56fef3['size'])return;const _0x44a502=await _0x162564['getMany'](_0x400c84,Array['from'](_0x56fef3));for(const _0x2ad891 of _0x44a502)_0x3ecd97['getUser'](_0x2ad891['id'])||_0x3ecd97['addUser'](_0x2ad891);function _0x59f232(_0x350c18){_0x3ecd97['getUser'](_0x350c18)||_0x56fef3['add'](_0x350c18);}}};function yt(_0x4ebc78){return _0x4ebc78['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4ebc78['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4ebc78['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var bt=class extends _0x5a0766{static get requires(){return[_0x2fad27,_t,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},kt=class extends _0x31bb91{_collapseAt;constructor(_0x3c665b,_0x3c0d41=0x6){super(_0x3c665b);const _0x3b4971=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x3c0d41,this['bind']('isHidden')['to'](this,'usersCount',_0x4884a5=>_0x4884a5<_0x3c0d41),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3b4971['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':_0x3b4971['to']('usersCount',_0x23fa6a=>'+'+(_0x23fa6a-this['_collapseAt']+0x2)['toString']())}]}]}]});}},It=class extends _0x31bb91{items;keystrokes;constructor(_0x371b20){super(_0x371b20);const _0x55840d=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x18ab48(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x55840d['if']('hasPopup'),'aria-expanded':_0x55840d['to']('isExpanded',_0x19f270=>this['hasPopup']&&String(_0x19f270)),'aria-label':_0x55840d['to']('hasPopup',_0x5acb24=>et(_0x371b20,_0x5acb24?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x55840d['to']('hasPopup',_0x42a292=>!!_0x42a292&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0x3dcc1d,_0x49acaf,_0x212237)=>{this['element']&&(_0x212237?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']);}},St=class extends _0x31bb91{counterView;inlineListView;constructor(_0x434f65,_0x5c4be9=0x6){super(_0x434f65);const _0x2a67fb=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new kt(this['locale'],_0x5c4be9),this['inlineListView']=new It(_0x434f65),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4877fb of this['inlineListView']['items'])_0x4877fb['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',_0x2a67fb['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},Ct=class extends _0x31bb91{listWrapperView;constructor(_0x52d529,_0x90cbe5){super(_0x52d529),this['listWrapperView']=new Tt(_0x52d529,_0x90cbe5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0x52d529,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},Tt=class extends _0xb0ce8e{constructor(_0x23a464,_0x4de8e9){super(_0x23a464);const _0x374b74=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4de8e9?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x374b74['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x374b74['to']('role'),'aria-label':_0x374b74['to']('ariaLabel'),'aria-labelledby':_0x374b74['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x118a7c['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x184655=this['element'];_0x184655&&(this['_isScrollable']=Math['max'](_0x184655['scrollHeight'],_0x184655['clientHeight'])>0.8*window['innerHeight']);}},At=class extends _0x4ee9d3{['userView'];constructor(_0x425257,_0x997d9e,_0x887463){super(_0x425257);const _0x2b6b02=this['bindTemplate'];this['userView']=new _0x4bcce3(_0x425257,_0x997d9e);const _0x30aee7={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x997d9e['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x997d9e['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x997d9e['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x997d9e['color']['getColorVariable'](),'--ck-user-color-alpha':_0x997d9e['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x887463&&(_0x30aee7['tag']='button',_0x30aee7['on']={'click':_0x2b6b02['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x30aee7);}['focus'](){this['element']['focus']();}},Pt=class extends _0x31bb91{['userView'];['markerView'];constructor(_0x3bd975,_0x54d16d,_0x49a0a1){super(_0x3bd975);const _0x1cdede=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x4bcce3(_0x3bd975,_0x54d16d),this['markerView']=new Rt(_0x3bd975,_0x54d16d);const _0x1ff30d=new _0x3b29d3(_0x3bd975);_0x1ff30d['template']['tag']='span',_0x1ff30d['text']=_0x54d16d['name'];const _0x587e60={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1cdede['to']('isFocusable',_0x2800e7=>_0x2800e7?0x0:-0x1),'aria-labelledby':_0x1ff30d['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1cdede['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1cdede['to']('hasTooltip',_0x51b7da=>!_0x51b7da),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1ff30d]};_0x49a0a1&&(_0x587e60['tag']='button',_0x587e60['on']={'click':_0x1cdede['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x587e60);}},Rt=class extends _0x31bb91{constructor(_0xf8b2e7,_0x40f0b7){super(_0xf8b2e7),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x40f0b7['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x40f0b7['color']['getColorVariable'](),'--ck-user-color-alpha':_0x40f0b7['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Ot={'collapseAt':0x6,'displayMe':!0x0};var xt=class extends _0x34db9e{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30b944){super(_0x30b944),this['context']['config']['define']('presenceList',Ot);const _0x13dba1=_0x30b944['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x13dba1)throw new _0xa544f3('presencelist-collapseat-invalid-format',this);if(_0x13dba1<0x1)throw new _0xa544f3('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](J)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x4bf7d9(),this['balloonPanelView']=new _0x209ede(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[J];}init(){for(const _0xc02ef9 of this['_allConnectedUsers'])this['_handleUserAdd'](_0xc02ef9);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5a19ef,_0x3f6b62)=>{this['_handleUserAdd'](_0x3f6b62);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1e3fdf,_0x446737)=>{this['_handleUserRemove'](_0x446737);});}_createView(){const _0x17354e=this['context'],_0x3750ff=new St(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4c5fd8=this['balloonPanelView'];if(!_0x36b27a(_0x17354e['config']['get']('presenceList.container')))throw new _0xa544f3('presencelist-missing-container',this);_0x3750ff['counterView']['bind']('usersCount')['to'](this),_0x3750ff['bind']('isCollapsed')['to'](this,'usersCount',_0x2150f0=>{const {collapseAt:_0x11c5c5}=_0x17354e['config']['get']('presenceList'),_0x3203ee=_0x2150f0>=_0x11c5c5;if(_0x3203ee&&!_0x3750ff['inlineListView']['items']['find'](_0xbf4210=>_0xbf4210 instanceof kt)){const _0x21df12=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x21df12&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3750ff['inlineListView']['items']['add'](_0x3750ff['counterView']);}return _0x3203ee||this['hideDropdown'](),_0x3203ee;}),_0x3750ff['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x312de4=>{const _0x33d89d=_0x17354e['config']['get']('presenceList'),_0x55fa5f=new Pt(_0x17354e['locale'],_0x312de4,!!_0x33d89d['onClick']);return _0x55fa5f['bind']('hasTooltip')['to'](_0x3750ff,'isCollapsed',_0x2242d9=>!_0x2242d9),_0x55fa5f['bind']('isFocusable')['to'](_0x3750ff,'isCollapsed',_0x3f48fb=>!_0x3f48fb),_0x33d89d['onClick']&&this['listenTo'](_0x55fa5f,'execute',()=>{this['view']['isCollapsed']||_0x33d89d['onClick'](_0x312de4,_0x55fa5f['element']);}),_0x55fa5f;}),_0x3750ff['inlineListView']['keystrokes']['set']('Enter',(_0x551bbe,_0x245567)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0x245567());}),_0x3750ff['render'](),_0x4c5fd8['render'](),_0x3750ff['listenTo'](_0x3750ff['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x3d35ec=(_0x209067,_0xff16a1)=>{this['_hideDropdownUnlessPointerInside'](_0xff16a1);};return _0x3750ff['listenTo'](_0x3750ff['inlineListView']['element'],'mouseleave',_0x3d35ec),_0x3750ff['listenTo'](_0x4c5fd8['element'],'mouseleave',_0x3d35ec),_0x3e7234({'emitter':_0x3750ff,'activator':()=>_0x4c5fd8['isVisible'],'contextElements':[_0x4c5fd8['element'],_0x3750ff['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x17354e['config']['get']('presenceList.container')['appendChild'](_0x3750ff['element']),this['_overlayHost']=new _0x14106a(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x3750ff;}_resolveOverlayTarget(){const _0x15d774=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x15d774)return _0x15d774;const _0x505c3c=this['context']['config']['get']('presenceList.container');return _0x505c3c?_0x54d91d(_0x505c3c):null;}['_handleUserAdd'](_0x6d3aa){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x6d3aa['isMe'])return;const _0x2ef33b=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2ef33b-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x1ddd9a=_0x6d3aa['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x6d3aa,_0x1ddd9a);}['_handleUserRemove'](_0x23bad6){this['usersCount']--;const {collapseAt:_0x154782}=this['context']['config']['get']('presenceList'),_0x4bc9ea=this['usersCount']>=_0x154782;if(this['currentDisplayedUsers']['get'](_0x23bad6['id']))this['currentDisplayedUsers']['remove'](_0x23bad6['id']);else{if(_0x4bc9ea&&this['currentDisplayedUsers']['length']+0x1===_0x154782-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x4bc9ea?0x1:0x0)<this['usersCount']){for(const _0x4eeae4 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4eeae4['id'])&&(this['currentDisplayedUsers']['add'](_0x4eeae4,Math['min'](this['currentDisplayedUsers']['length']-(_0x4bc9ea?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x4bc9ea?0x1:0x0)===_0x154782-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x36084f=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new Ct(this['context']['locale'],!!_0x36084f['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x444bc4}=this['presenceDropdownView'];_0x444bc4['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x2a08a7=>{if(!_0x36084f['displayMe']&&_0x2a08a7['isMe'])return null;const _0x321723=new At(this['context']['locale'],_0x2a08a7,!!_0x36084f['onClick']);return _0x36084f['onClick']&&this['listenTo'](_0x321723,'execute',()=>{_0x36084f['onClick'](_0x2a08a7,_0x321723['element']);}),_0x321723;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']);const _0x5f1f00=_0x209ede['generatePositions']({'heightOffset':0x3,'config':{'withArrow':!0x1}});this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element'],'positions':[_0x5f1f00['southArrowNorth'],_0x5f1f00['southArrowNorthMiddleWest'],_0x5f1f00['southArrowNorthMiddleEast'],_0x5f1f00['southArrowNorthWest'],_0x5f1f00['southArrowNorthEast'],_0x5f1f00['northArrowSouth'],_0x5f1f00['northArrowSouthMiddleWest'],_0x5f1f00['northArrowSouthMiddleEast'],_0x5f1f00['northArrowSouthWest'],_0x5f1f00['northArrowSouthEast'],_0x5f1f00['viewportStickyNorth']]}),_0x444bc4['focus'](),_0x444bc4['checkIfScrollable']();const _0xf771b1=(_0x44b6f1,_0x58ddad)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x58ddad();};_0x444bc4['keystrokes']['set']('Esc',_0xf771b1),_0x444bc4['keystrokes']['set']('Shift+Tab',_0xf771b1),_0x444bc4['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0x444bc4['focusTracker']['add'](this['view']['element']),_0x444bc4['focusTracker']['on']('change:isFocused',(_0x2118dc,_0x540857,_0x421636)=>{_0x421636||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);}_hideDropdownUnlessPointerInside(_0x359271){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x41218a=>_0x3578f4(_0x41218a,_0x359271))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},Nt=class extends _0x34db9e{static get requires(){return[J,xt];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{lt as CloudServicesCommentsAdapter,_t as CloudServicesRevisionHistoryAdapter,mt as CloudServicesTrackChangesAdapter,Nt as PresenceList,xt as PresenceListUI,it as RealTimeCollaborationClient,wt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,bt as RealTimeCollaborativeRevisionHistory,vt as RealTimeCollaborativeTrackChanges,at as RealTimeContentFetcher,J as Sessions,K as WebSocketGateway};
23
+ import{Context as _0x1166e8,ContextPlugin as _0x577128,PendingActions as _0x319a38,Plugin as _0x472486}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x36a0fd,Collection as _0x47fd78,DomEmitterMixin as _0x1f66f9,KeystrokeHandler as _0x1f078d,getOverlayMountRoot as _0x43c097,global as _0x159ccb,trustedHtml as _0x41647d,uid as _0x48203e,version as _0xfc9d30}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x47e65b,LabelView as _0xc52327,ListItemView as _0x48f5c5,ListView as _0x5f2d1d,Notification as _0xe3af1,OverlayHost as _0x3cfe8b,View as _0x1307de,clickOutsideHandler as _0x544ee6}from'@ckeditor/ckeditor5-ui';import{History as _0x467c44,InsertOperation as _0xaf13f4,MarkerOperation as _0x3438ad,ModelLiveRange as _0x583030,NoOperation as _0x552d80,OperationFactory as _0x5197a1,RootAttributeOperation as _0x56bf88,transformOperationSets as _0x25bfc3}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x2c32e7}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x33b0db,CommentsService as _0x22c092,EditorService as _0xbaacb4,RevisionHistoryService as _0x288311,TrackChangesService as _0x1c471b,User as _0x3d6f90,WEB_SOCKET_GATEWAY_STATES as _0x21e980,WebSocketGateway as _0x1892ca}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x193e58,Users as _0x1d1b46,isPointerStillOver as _0x595b6c}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x38dc71}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x49569c,TrackChangesEditing as _0x3beba8}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x19f1c8,CommentsEditing as _0x4a4ce5,CommentsRepository as _0x3b7eba}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x310da3}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x13562f}from'es-toolkit/compat';var K=class WebSocketGateway extends _0x577128{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
+ ((()=>_0x1892ca)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x2c32e7,_0xe3af1];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24a1a1){super(_0x24a1a1),this['set']('state',_0x21e980['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x1f66f9())();}init(){const _0x35282c=this['context'],_0x4439d3=_0x35282c['plugins']['get'](_0x2c32e7),_0x173f67=_0x35282c['plugins']['get'](_0xe3af1);if(!_0x4439d3['token'])throw new _0x36a0fd('websocketgateway-missing-token',this);if(!_0x4439d3['webSocketUrl'])throw new _0x36a0fd('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'](_0x4439d3['token'],_0x4439d3['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x47d845=>{if(this['connection']=_0x47d845,this['bind']('state')['to'](_0x47d845,'state',this,'_isBrowserOffline',(_0x28f6e5,_0x36f894)=>('connected'!==_0x28f6e5&&(this['_shouldPluginsReconnect']=!0x0),_0x36f894||_0x28f6e5!==_0x21e980['CONNECTED']?_0x21e980['DISCONNECTED']:this['state']==_0x21e980['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x21e980['CONNECTING']):_0x21e980['CONNECTED'])),this['connection']['on']('error',(_0x1a0afe,_0x19f536)=>{if('limitExceeded'!==_0x19f536['code'])throw console['error'](_0x19f536),new _0x36a0fd('cloudservices-init',null,{'originalError':_0x19f536});_0x173f67['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'});}),!_0x47d845['me'])return new Promise(_0x1c475f=>_0x47d845['on']('change:me',_0x1c475f));})['catch'](_0x1e793a=>{throw console['error'](_0x1e793a),new _0x36a0fd('cloudservices-init',null,{'originalError':_0x1e793a});});}addToReconnectionStack(_0x10e6a2){if('function'!=typeof _0x10e6a2['reconnect'])throw new _0x36a0fd('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x10e6a2))throw new _0x36a0fd('websocketgateway-plugin-already-registered',this,{'name':_0x10e6a2['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x10e6a2);}removeFromReconnectionStack(_0x902b75){this['_reconnectionStack']['delete'](_0x902b75);}isInReconnectionStack(_0x6f96be){return this['_reconnectionStack']['has'](_0x6f96be);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x3b4831=>_0x3b4831['reconnect']())))['then'](()=>this['state']=_0x21e980['CONNECTED'])['catch'](_0xa9f68a=>{throw console['error'](_0xa9f68a),new _0x36a0fd('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x21e980['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},J=class extends _0x577128{['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[K,_0x1d1b46];}constructor(_0x1aca5f){super(_0x1aca5f),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x47fd78(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d1b46);}init(){const _0x5d8076=this['context']['plugins']['get'](K);this['listenTo'](_0x5d8076,'change:state',(_0x51dba0,_0x3ad9d2,_0x266d82)=>{if('connected'!==_0x266d82)this['channelSessions']['forEach'](_0x344cf2=>_0x344cf2['clear']()),this['channelConnectedUsers']['forEach'](_0x57cb76=>_0x57cb76['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x1bfdba,_0x29dd0f]of this['_registeredSessions'])for(const _0x1ffa84 of _0x29dd0f)this['_handleSessionAdd'](_0x1bfdba,_0x1ffa84);}}),this['_createUser'](_0x5d8076['connection']['me'],!0x0);}register(_0x8feb6,_0x105098){if(this['_registeredSessions']['has'](_0x8feb6))throw new _0x36a0fd('sessions-register-already-registered',null,{'channelId':_0x8feb6});this['_registeredSessions']['set'](_0x8feb6,_0x105098),this['channelSessions']['set'](_0x8feb6,new _0x47fd78()),this['channelConnectedUsers']['set'](_0x8feb6,new _0x47fd78()),this['listenTo'](_0x105098,'add',(_0x2dd170,_0x4d3f90)=>this['_handleSessionAdd'](_0x8feb6,_0x4d3f90)),this['listenTo'](_0x105098,'remove',(_0x3b1260,_0x1c1342)=>this['_handleSessionRemove'](_0x8feb6,_0x1c1342));for(const _0x2d82d6 of _0x105098)this['_handleSessionAdd'](_0x8feb6,_0x2d82d6);}unregister(_0x4eefa3){if(!this['_registeredSessions']['has'](_0x4eefa3))throw new _0x36a0fd('sessions-unregister-not-exist',null,{'channelId':_0x4eefa3});const _0x1ede04=this['_registeredSessions']['get'](_0x4eefa3);this['stopListening'](_0x1ede04);for(const _0xd12e49 of _0x1ede04)'connected'===this['context']['plugins']['get'](K)['state']&&this['_handleSessionRemove'](_0x4eefa3,_0xd12e49);this['_registeredSessions']['delete'](_0x4eefa3),this['channelSessions']['delete'](_0x4eefa3),this['channelConnectedUsers']['delete'](_0x4eefa3);}get['mySessionId'](){return this['context']['plugins']['get'](K)['connection']['sessionId'];}getUserBySessionId(_0x17e973){for(const _0x4d8042 of this['channelSessions']['values']())for(const _0x1e83a0 of _0x4d8042)if(_0x1e83a0['id']===_0x17e973)return _0x1e83a0['user'];}getUserSessions(_0x3fe373,_0x1c7666){const _0x4abdef=_0x1c7666?[this['channelSessions']['get'](_0x1c7666)]:this['channelSessions']['values'](),_0x51cc27=new Set();for(const _0x2b96a0 of _0x4abdef)for(const _0x528cb1 of _0x2b96a0)_0x528cb1['user']['id']===_0x3fe373['id']&&_0x51cc27['add'](_0x528cb1['id']);return _0x51cc27;}getUserRole(_0x24b771){for(const _0x52bcc7 of this['channelSessions']['values']())for(const _0x30b06c of _0x52bcc7)if(_0x30b06c['user']===_0x24b771)return _0x30b06c['role'];}['_handleSessionAdd'](_0x3e2fb4,_0x3eb9f7){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x5040c7=_0x3eb9f7['user'],_0x23b402=this['_users']['getUser'](_0x5040c7['id'])||this['_createUser'](_0x5040c7),_0x2d5890=Object['assign']({},_0x3eb9f7,{'user':_0x23b402});if(this['channelSessions']['get'](_0x3e2fb4)['add'](_0x2d5890),!_0x5040c7['hiddenInPresenceList']){const _0x35c40d=this['channelConnectedUsers']['get'](_0x3e2fb4);_0x35c40d['has'](_0x23b402['id'])||_0x35c40d['add'](_0x23b402),this['allConnectedUsers']['has'](_0x23b402['id'])||_0x5040c7['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x23b402,_0x23b402['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x3e2fb4,{'channelId':_0x3e2fb4,'session':_0x2d5890});}['_handleSessionRemove'](_0x24a4c1,_0x5768ca){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x100ce2=this['channelConnectedUsers']['get'](_0x24a4c1),_0x5b4078=_0x5768ca['user'];_0x5b4078['id']&&(this['channelSessions']['get'](_0x24a4c1)['remove'](_0x5768ca['id']),_0x100ce2['has'](_0x5b4078['id'])&&!this['getUserSessions'](_0x5b4078,_0x24a4c1)['size']&&_0x100ce2['remove'](_0x5b4078['id']),this['allConnectedUsers']['get'](_0x5b4078['id'])&&!this['getUserSessions'](_0x5b4078)['size']&&this['allConnectedUsers']['remove'](_0x5b4078['id']));}_createUser(_0x539c8c,_0x43d1da){const _0x5a317b=this['_users']['addUser'](_0x539c8c);return _0x43d1da&&this['_users']['defineMe'](_0x539c8c['id']),_0x5a317b['orderNumber']=this['_uniqueUsersCount']++,_0x5a317b;}},X=class extends _0x472486{_domEmitter=new(_0x1f66f9())();static get requires(){return[J];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x313df9=this['editor'],_0x24a989=_0x313df9['plugins']['get'](J);_0x313df9['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x59f629,{writer:_0x2be27e})=>function(_0x1bb425,_0x44ba66,_0x558e1d,_0x464753){const _0xa69fe4=_0x1bb425['markerName']['split'](':')[0x2],_0x4aec49=_0x558e1d['getUserBySessionId'](_0xa69fe4);if(!_0x4aec49||_0xa69fe4===_0x558e1d['mySessionId'])return;if(!_0x464753['model']['schema']['checkChild'](_0x1bb425['markerRange']['start'],'$text'))return;const _0xe6e4f3={'class':'ck-user__marker\x20'+_0x4aec49['color']['getMarkerClass'](),'style':tt(_0x4aec49),'data-name':_0x4aec49['name'],'data-session-id':_0xa69fe4},_0x5a5b85=_0x464753['model']['markers']['get'](_0x1bb425['markerName'])['getStart'](),_0x1d215e=_0x5a5b85['nodeAfter'],_0xb1322=_0x464753['model']['schema'];if(_0x1d215e&&_0xb1322['isObject'](_0x1d215e)&&_0xb1322['isInline'](_0x1d215e)&&!_0x464753['model']['markers']['get']('user:range:'+_0xa69fe4)['getRange']()['isCollapsed'])return;const _0x53eef0=_0x5a5b85['parent'];return _0x464753['model']['schema']['isLimit'](_0x53eef0)&&!_0x464753['model']['hasContent'](_0x53eef0)&&(_0xe6e4f3['contenteditable']=!0x1),function(_0x409a02,_0x1f39d7,_0x29c0ef){const _0x50f44c=_0x409a02['createUIElement']('span',_0x1f39d7);return _0x409a02['setCustomProperty']('userPositionMarker',!0x0,_0x50f44c),_0x50f44c['render']=function(_0x1a24f2){const _0x4dc58a=this['toDomElement'](_0x1a24f2),_0xfd2ba6=document['createElement']('span');return _0xfd2ba6['classList']['add']('ck-user__marker-tooltip'),_0xfd2ba6['setAttribute']('contenteditable','false'),_0xfd2ba6['setAttribute']('spellcheck','false'),_0xfd2ba6['textContent']=_0x29c0ef['name'],_0x4dc58a['innerHTML']=_0x41647d('⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0xfd2ba6['outerHTML']+'⁠'),_0x4dc58a['addEventListener']('mouseenter',()=>{_0x4dc58a['classList']['add']('ck-user__marker_hovered');}),_0x4dc58a['addEventListener']('mouseleave',()=>{_0x4dc58a['classList']['remove']('ck-user__marker_hovered');}),_0x4dc58a;},_0x50f44c['isSimilar']=function(_0xc020e4){return!(!this['getCustomProperty']('userPositionMarker')||!_0xc020e4['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xc020e4['getAttribute']('data-session-id'));},_0x50f44c;}(_0x44ba66,_0xe6e4f3,_0x4aec49);}(_0x59f629,_0x2be27e,_0x24a989,_0x313df9)}),_0x313df9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1a1478=>function(_0x4d4b55,_0xd66823){const _0xc4d980=_0x4d4b55['markerName']['split'](':')[0x2];if(_0xc4d980===_0xd66823['mySessionId'])return null;const _0x12b4fd=_0xd66823['getUserBySessionId'](_0xc4d980);return _0x12b4fd?{'id':_0xc4d980,'classes':['ck-user__selection',_0x12b4fd['color']['getSelectionClass']()],'attributes':{'style':tt(_0x12b4fd),'data-session-id':_0xc4d980},'priority':0x7d0+_0x12b4fd['orderNumber']}:{'id':_0xc4d980,'classes':[]};}(_0x1a1478,_0x24a989)}),function(_0x4c3f9a){const _0x134588=_0x4c3f9a['model'],_0x2c536e=new Map(),_0xcff005=_0x4c3f9a['plugins']['get'](J);_0x134588['markers']['on']('update:user:range',(_0x4aa625,_0x47bab0,_0x348a88,_0x34477d)=>{if(!_0x34477d&&_0x2c536e['get'](_0x47bab0['name']))return _0x2c536e['get'](_0x47bab0['name'])['detach'](),void _0x2c536e['delete'](_0x47bab0['name']);const _0x1faf91=_0x47bab0['name']['split'](':')[0x2];if(_0x1faf91===_0xcff005['mySessionId'])return;const _0x3b5b52='user:position:'+_0x1faf91;_0x134588['markers']['has'](_0x3b5b52)&&_0x4c3f9a['editing']['reconvertMarker'](_0x3b5b52),_0x47bab0['on']('change:range',(_0x3c8848,_0x3c804f,_0x2855ab)=>{if('$graveyard'!=_0x3c804f['root']['rootName']&&'$graveyard'==_0x47bab0['getRange']()['root']['rootName']&&!_0x2c536e['has'](_0x47bab0['name'])){const _0x57f1fb=_0x134588['schema']['getNearestSelectionRange'](_0x2855ab['deletionPosition']);if(_0x57f1fb){const _0x29e641=_0x583030['fromRange'](_0x57f1fb);_0x2c536e['set'](_0x47bab0['name'],_0x29e641),_0x29e641['on']('change:range',(_0x4b5a18,_0x1fd539,_0x1ca71b)=>{if('$graveyard'==_0x29e641['root']['rootName']){const _0x2302bc=_0x134588['schema']['getNearestSelectionRange'](_0x1ca71b['deletionPosition']);_0x2302bc?(_0x29e641['start']=_0x2302bc['start'],_0x29e641['end']=_0x2302bc['end']):(_0x2c536e['delete'](_0x47bab0['name']),_0x29e641['detach']());}});}}});}),_0x134588['document']['on']('change',()=>{_0x2c536e['size']>0x0&&_0x134588['enqueueChange']({'isUndoable':!0x1},_0x2e7097=>{for(const [_0x438a03,_0x2b39e0]of _0x2c536e)'$graveyard'==_0x134588['markers']['get'](_0x438a03)['getRange']()['root']['rootName']&&(Z(_0x438a03['split'](':')[0x2],_0x2b39e0['toRange'](),_0x134588,_0x2e7097),_0x2b39e0['detach']());_0x2c536e['clear']();});});}(_0x313df9),this['_domEmitter']['listenTo'](_0x159ccb['document'],'keydown',(_0x1a4b28,{key:_0x9d299c})=>{'Escape'===_0x9d299c&&function(_0x4fa1d1){_0x4fa1d1['editing']['view']['change'](_0xc9969a=>{for(const _0x336d95 of _0x4fa1d1['model']['markers']){if(!_0x336d95['name']['startsWith']('user:position'))continue;const _0x336748=_0x4fa1d1['editing']['mapper']['markerNameToElements'](_0x336d95['name']);if(_0x336748){for(const _0x43ea7a of _0x336748)_0xc9969a['removeClass']('ck-user__marker_hovered',_0x43ea7a);}}});}(_0x313df9);},{'useCapture':!0x0});}afterInit(){const _0x2d6bae=this['editor'],_0x28c5ae=_0x2d6bae['commands']['get']('undo');_0x28c5ae&&_0x2d6bae['model']['on']('applyOperation',(_0x548031,_0x1db5bd)=>{const _0x35c614=_0x1db5bd[0x0];if(!_0x35c614['isDocumentOperation'])return;if('marker'!=_0x35c614['type']||!_0x35c614['name']['startsWith']('user:'))return;const _0x1d3f6c=_0x35c614['batch'];_0x28c5ae['_createdBatches']['has'](_0x1d3f6c)&&(_0x35c614['newRange']=_0x35c614['oldRange']?_0x2d6bae['model']['createRange'](_0x35c614['oldRange']['start'],_0x35c614['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x3c4a94=this['editor'],_0x27bf3d=_0x3c4a94['model']['document'],_0x24ed48=_0x3c4a94['plugins']['get'](J);_0x3c4a94['model']['enqueueChange']({'isUndoable':!0x1},_0x400058=>{const _0x254d0b='user:range:'+_0x24ed48['mySessionId'],_0x2be37='user:position:'+_0x24ed48['mySessionId'],_0x21023e=_0x3c4a94['model']['markers']['has'](_0x254d0b);_0x3c4a94['editing']['view']['hasDomSelection']?Z(_0x24ed48['mySessionId'],_0x27bf3d['selection']['getFirstRange'](),_0x3c4a94['model'],_0x400058):_0x21023e&&(_0x400058['removeMarker'](_0x254d0b),_0x400058['removeMarker'](_0x2be37));});}};function Z(_0x57f3eb,_0x1849db,_0x58f5fa,_0x4b5039){const _0x4cf6fa='user:range:'+_0x57f3eb,_0x5b7950='user:position:'+_0x57f3eb,_0x53ea7e=_0x1849db['getContainedElement']();let _0x46e100=_0x1849db['start'];if(_0x53ea7e&&_0x53ea7e['is']('element','tableCell')){const _0x479fea=function(_0x4d35a1,_0x327809){for(const _0x46a149 of _0x4d35a1['getPositions']())if(_0x327809['schema']['checkChild'](_0x46a149,'$text'))return _0x46a149;}(_0x1849db,_0x58f5fa);_0x479fea&&(_0x46e100=_0x479fea,_0x1849db=_0x4b5039['createRange'](_0x46e100));}const _0x345b30=_0x4b5039['createRange'](_0x46e100);_0x58f5fa['markers']['has'](_0x4cf6fa)?(_0x4b5039['updateMarker'](_0x4cf6fa,{'range':_0x1849db}),_0x4b5039['updateMarker'](_0x5b7950,{'range':_0x345b30})):(_0x4b5039['addMarker'](_0x4cf6fa,{'range':_0x1849db,'usingOperation':!0x0}),_0x4b5039['addMarker'](_0x5b7950,{'range':_0x345b30,'usingOperation':!0x0}));}function tt(_0x40eeeb){return'--ck-user-color:'+_0x40eeeb['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x40eeeb['color']['getColorAlphaVariable']()+';';}function et(_0x3276ff,_0x2ce1c4,_0x26af51){const _0xcb03f3=_0x3276ff['t'],t=_0x3276ff['t'];switch(_0x2ce1c4){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 _0xcb03f3({'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'},_0x26af51);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x472486{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x33b0db)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[K,J,X,_0x319a38,_0x1d1b46,_0xe3af1];}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 _0x4fa83b=this['serverHistory']['getOperations']();for(let _0x58c0ba=_0x4fa83b['length']-0x1;_0x58c0ba>=0x0;_0x58c0ba--){const _0x181c11=_0x4fa83b[_0x58c0ba];if(!this['_disconnectionOperations']['has'](_0x181c11))return _0x181c11['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x165d1f){if(super(_0x165d1f),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x467c44(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x36a0fd('collaboration-missing-channelid',this);const _0x3cce54=_0x165d1f['config']['get']('cloudServices.bundleVersion')||_0xfc9d30;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x3cce54,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x38dc71(),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 ot(this['_disconnectionOperations']);}init(){const _0x35097d=this['editor'],_0x1cc193=_0x35097d['plugins']['get'](_0x1d1b46),_0x89f280=_0x35097d['plugins']['get'](K);this['listenTo'](_0x1cc193,'getOperationAuthor',(_0x55cfe4,_0x103249)=>{const _0x4b0fa7=_0x103249[0x0];_0x4b0fa7['_authorId']&&(_0x55cfe4['return']=_0x1cc193['getUser'](_0x4b0fa7['_authorId']),_0x55cfe4['stop']()),null===_0x4b0fa7['_authorId']&&(_0x55cfe4['return']=null,_0x55cfe4['stop']());},{'priority':'high'}),this['listenTo'](_0x35097d['model']['document']['selection'],'change:range',(_0x4043a7,_0x22d16d)=>{_0x22d16d['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x35097d['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x35097d['model']['on']('applyOperation',(_0x35a6be,_0x342c44)=>{const _0x388313=_0x342c44[0x0];_0x388313['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x388313),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x89f280,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x438ee9,_0x56c351,_0x39f55b)=>'connected'===_0x438ee9&&!_0x56c351&&!_0x39f55b),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x35097d['disableReadOnlyMode']('rtc-offline'):_0x35097d['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x35097d['disableReadOnlyMode']('rtc-offline'):_0x35097d['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x5b9fc3=this['editor']['plugins']['get'](J),_0x4d2af9=this['editor']['plugins']['get'](K);try{this['_isPendingUpdate']=!0x0,_0x5b9fc3['unregister'](this['_channelId']);const _0x90df6a=await this['_service']['reconnect'](_0x4d2af9['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x90df6a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1f71d2=await this['_service']['getConnectedSessions']();_0x5b9fc3['register'](this['_channelId'],_0x1f71d2),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2b089d){if(function(_0x462eb8){return'404'===_0x462eb8['code'];}(_0x2b089d)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x510482){return'409'===_0x510482['code'];}(_0x2b089d)){const _0xcbe635=et(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'](_0xcbe635);}else{if(!(_0x2b089d instanceof nt))throw _0x2b089d;this['_handleReconnectionError']();}}}}destroy(){const _0x55f569=this['editor']['plugins']['get'](K),_0x5760b7=this['editor']['plugins']['get'](J);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x5760b7['channelSessions']['has'](this['_channelId'])&&_0x5760b7['unregister'](this['_channelId']),_0x55f569['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x407dba){if(this['sessionId']!==_0x407dba['sessionId']&&this['_lastSyncedOperationId']!==_0x407dba['lastOperationId'])throw new nt();return this['sessionId']=_0x407dba['sessionId'],this['_handleServerResponse']([],{..._0x407dba,'wereChangesApplied':!0x1,'data':_0x407dba['data']},'reconnect');}async _connectService(_0x26263c,_0x3d6013=!0x1){const {connection:_0x3cb18b}=this['editor']['plugins']['get'](K);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x3cb18b,this['_channelId'])['then'](_0x540b11=>this['_initSessionsHandling'](_0x540b11))['catch'](_0x41d0df=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x41d0df);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x440c28,_0x534e96)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x534e96);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x204d49=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x26263c);this['_isPendingUpdate']=!0x0;const _0xbdbd7a=await this['_service']['connect'](_0x3cb18b,this['_compressOperations'](_0x26263c),_0x204d49);if(this['sessionId']=_0xbdbd7a['sessionId'],_0x3d6013){if(!_0xbdbd7a['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xbdbd7a['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x26263c,_0xbdbd7a,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xbdbd7a,_0x26263c);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0xebf011=this['editor']['plugins']['get'](J),_0x1b64aa=this['editor']['plugins']['get'](X),_0x237d1c=_0xebf011['channelSessions']['get'](this['_channelId']);_0x237d1c&&_0x237d1c['length']>0x1?_0x1b64aa['createUserMarkerOperations']():this['listenTo'](_0xebf011,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xebf011['channelSessions']['get'](this['_channelId'])['length']&&_0x1b64aa['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x5456a1,_0x2f4cf8,_0x40a472,_0x3fae4c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2f4cf8){const _0x169cf6=this['_decompressOperations'](_0x40a472,_0x3fae4c);await this['_fetchMissingUsers'](_0x169cf6),this['_handleExternalOperations'](_0x169cf6,_0x2f4cf8,_0x40a472['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x4965fa}=this['editor'];let _0x3681f9;try{_0x3681f9=await this['_service']['getDocumentDetails']();}catch{const _0x22ea50=et(_0x4965fa,'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'](_0x22ea50);}const _0xa599e0=_0x3681f9['currentDocumentSession']||_0x3681f9['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0xa599e0['lastOperationId']){const _0x48e823=et(_0x4965fa,'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'](_0x48e823);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x168090=this['editor']['plugins']['get'](K);if(this['_isConnected']=!0x1,!_0x168090['connection']||'connected'!==_0x168090['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x1bf6eb=this['editor']['plugins']['get'](J);_0x1bf6eb['channelSessions']['has'](this['_channelId'])&&_0x1bf6eb['unregister'](this['_channelId']),_0x168090['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x5718f6){const _0x6c44d6=this['editor']['plugins']['get'](J);this['listenTo'](_0x6c44d6,'sessionAdd:'+this['_channelId'],(_0x323811,{session:_0x31161c})=>{if(_0x31161c['id']===_0x6c44d6['mySessionId']){_0x323811['off']();const _0xb6f85f=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x28faeb=_0x31161c['permissions'];_0xb6f85f&&_0xb6f85f['isEnabled']&&(_0x28faeb=_0x28faeb['filter'](_0x50dd91=>'document:write'!==_0x50dd91)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x28faeb,this['_channelId']);}}),_0x6c44d6['register'](this['_channelId'],_0x5718f6);}_initThrowingOnDataSet(){const _0x3ca04f=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1ee542)=>{if(!_0x1ee542[_0x1ee542['length']-0x1]['suppressErrorInCollaboration'])throw new _0x36a0fd('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3ca04f['apply'](this['editor']['data'],_0x1ee542);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x1de8e5,[_0x199bca])=>{if(this['_document']['version'])throw new _0x36a0fd('realtimecollaborationclient-init-document-already-initialized',this);_0x1de8e5['stop'](),this['_setPendingAction']();const _0x1441bf=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x2f89e6])=>!_0x2f89e6['lazyLoad'])['map'](([_0x2455dc,_0x5ea829])=>[_0x2455dc,_0x5ea829['modelAttributes']||{}])),_0x122bc6=this['_getOperationsFromInitData'](_0x199bca,_0x1441bf);0x0==_0x122bc6['length']&&_0x122bc6['push'](new _0x552d80(0x0)),_0x1de8e5['return']=this['_connectService'](_0x122bc6)['then'](()=>{this['editor']['plugins']['get'](K)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x516bbc=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x516bbc))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x24d0b6,[_0x311081,_0x50cc84])=>{_0x24d0b6['stop']();const _0x54b51e=this['editor']['model']['document']['getRoot'](_0x311081);if(!this['_knownRootNames']['has'](_0x311081)){const _0x33a076=_0x50cc84&&_0x50cc84['data']?_0x50cc84['data']:'',_0xe66c0=_0x50cc84&&_0x50cc84['attributes']?_0x50cc84['attributes']:{};await this['_loadRoot'](_0x311081,_0x33a076,_0xe66c0);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x54b51e['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x54b51e);});},{'priority':'high'});}async _fetchMissingUsers(_0x46e4f4){const _0xe81691=this['editor']['plugins']['get'](_0x1d1b46),{connection:_0x536b84}=this['editor']['plugins']['get'](K),_0x49e2e1=new Set();for(const _0x283158 of _0x46e4f4){const _0x590845=_0x283158['_authorId'];_0x590845&&!_0xe81691['getUser'](_0x590845)&&_0x49e2e1['add'](_0x590845);}if(0x0===_0x49e2e1['size'])return;const _0x1273cc=await _0x3d6f90['getMany'](_0x536b84,Array['from'](_0x49e2e1));for(const _0x1a1c49 of _0x1273cc)_0xe81691['getUser'](_0x1a1c49['id'])||_0xe81691['addUser'](_0x1a1c49);}_getOperationsFromInitData(_0x2c36d0,_0x1b05b5={}){const _0xb376bb=this['editor']['model'],_0x5dfba2=[];let _0x507ac9=0x0;const _0x3b823f='string'==typeof _0x2c36d0?{'main':_0x2c36d0}:_0x2c36d0;for(const _0x2856ff of Object['keys'](_0x3b823f)){if(!this['_document']['roots']['has'](_0x2856ff))throw new _0x36a0fd('realtimecollaborationclient-init-non-existent-root',this);const _0x568ba3=this['_document']['getRoot'](_0x2856ff),_0x2fb6ff=this['editor']['data']['parse'](_0x3b823f[_0x2856ff],_0x568ba3),_0x1a5303=new _0xaf13f4(_0xb376bb['createPositionAt'](_0x568ba3,0x0),_0x2fb6ff,_0x507ac9++);_0x5dfba2['push'](_0x1a5303);for(const [_0x4eee7a,_0x2d391f]of _0x2fb6ff['markers']){const _0x495383=_0xb376bb['createRange'](_0xb376bb['createPositionFromPath'](_0x568ba3,_0x2d391f['start']['path']['slice']()),_0xb376bb['createPositionFromPath'](_0x568ba3,_0x2d391f['end']['path']['slice']())),_0x277288=new _0x3438ad(_0x4eee7a,null,_0x495383,_0xb376bb['markers'],!0x0,_0x507ac9++);_0x5dfba2['push'](_0x277288);}}if(_0x1b05b5)for(const [_0x2fb089,_0x28048f]of Object['entries'](_0x1b05b5)){const _0x312a0e=_0xb376bb['document']['getRoot'](_0x2fb089);if(!_0x312a0e)throw new _0x36a0fd('multi-root-editor-root-attributes-no-root',null);for(const [_0x29256d,_0x1a6760]of Object['entries'](_0x28048f))if(null!==_0x1a6760){const _0x1efd60=new _0x56bf88(_0x312a0e,_0x29256d,null,_0x1a6760,_0x507ac9++);_0x5dfba2['push'](_0x1efd60);}}return _0x5dfba2;}async _loadRoot(_0x5f4a54,_0x2b3b98,_0x4b108d){this['_getOperationsFromInitData']({[_0x5f4a54]:_0x2b3b98},{[_0x5f4a54]:_0x4b108d})['forEach']((_0x24ac93,_0x3727f8)=>{_0x24ac93['baseVersion']=this['_document']['version']+_0x3727f8,_0x24ac93['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x24ac93);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x446280,_0x14c366){let _0x38a106;this['_offset']=_0x446280['offset'];const _0x11e838=_0x446280['wereChangesApplied']&&!_0x446280['initData'],_0x4dc97d=_0x11e838?0x0:_0x446280['data']['baseVersion'];if(_0x14c366['forEach'](_0x1c6cbf=>{_0x1c6cbf['_isInit']=!0x0,_0x1c6cbf['createdAt']=_0x446280['sessionCreatedAt'],_0x1c6cbf['_authorId']=null;}),_0x11e838)_0x38a106=_0x14c366,this['_applyOperationsSet'](_0x38a106,_0x11e838);else{if(_0x446280['initData']){const _0xb7314f=this['_getOperationsFromInitData'](_0x446280['initData']);this['_document']['history']['version']=-_0xb7314f['length'],_0xb7314f['forEach'](_0x5958a8=>{_0x5958a8['baseVersion']-=_0xb7314f['length'],_0x5958a8['createdAt']=_0x446280['sessionCreatedAt'],_0x5958a8['_isInit']=!0x0,_0x5958a8['_authorId']=null;}),this['_applyOperationsSet'](_0xb7314f,!0x0),this['serverHistory']['version']=-_0xb7314f['length']+this['_offset'],this['_updateServerHistory'](_0xb7314f);}this['_document']['history']['version']=_0x4dc97d,_0x38a106=this['_decompressOperations'](_0x446280['data'],_0x446280['metadata']),await this['_fetchMissingUsers'](_0x38a106),this['_applyOperationsSet'](_0x38a106,_0x11e838);}_0x446280['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x38a106,_0x446280['lastOperationId']),this['_lastSyncedOperationId']=_0x446280['lastOperationId']),this['serverHistory']['version']=_0x4dc97d+this['_offset'],this['_updateServerHistory'](_0x38a106),_0x14c366['filter'](_0x3f6a28=>{const _0x47b6a5=this['_getAffectedRoot'](_0x3f6a28);return _0x47b6a5&&!this['_knownRootNames']['has'](_0x47b6a5);})['forEach']((_0x14a14f,_0x1bcc2d)=>{_0x14a14f['baseVersion']=this['_document']['version']+_0x1bcc2d,this['_saveOperationInBuffer'](_0x14a14f);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x59aa50,_0x93e657){const _0x280b79=_0x93e657&&_0x93e657['message'];if(_0x280b79&&_0x280b79['startsWith']('realtimecollaborationclient'))throw _0x93e657;const _0x3cf63e=this['editor']['plugins']['get'](K);throw this['_isPendingUpdate']=!0x0,_0x3cf63e['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x36a0fd(_0x59aa50,this['editor'],_0x280b79?{'originalError':_0x280b79}:void 0x0);}_saveOperationInBuffer(_0x2b77b5){this['_knownOperations']['has'](_0x2b77b5)||(this['_knownOperations']['add'](_0x2b77b5),this['_bufferedOperations']['push'](_0x2b77b5),this['_pendingAction']||'marker'==_0x2b77b5['type']&&!_0x2b77b5['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x2e2637=!0x1){!_0x2e2637&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x591a37=>{_0x591a37&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2252fe=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x4a293c){return _0x4a293c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4a293c['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x4a293c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2252fe)||this['_crash'](_0x2252fe['message'],_0x2252fe);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x5dd12d=>{this['on']('change:_isPendingUpdate',()=>{_0x5dd12d();});});}async _sendBufferedOperations(){const _0x290d23=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x290d23['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x6717aa=[...this['_bufferedOperations']];for(const _0x3db95e of _0x6717aa)_0x3db95e['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3db95e);const _0x156e51=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x6717aa),_0x33783f=st++,_0x2cb039=this['_compressOperations'](_0x6717aa),_0x17462e=await this['_service']['sendOperations'](_0x2cb039,_0x2cb039['baseVersion'],_0x156e51);try{return await this['_handleServerResponse'](_0x6717aa,_0x17462e,_0x33783f);}catch(_0x251661){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x251661);}}async['_handleServerResponse'](_0x5e6d62,_0x13df1c,_0x9aee73){if('error'in _0x13df1c)throw _0x13df1c['error'];let _0x5af193;if(_0x13df1c['wereChangesApplied']){_0x13df1c['lastOperationId']&&(this['_lastSyncedOperationId']=_0x13df1c['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1b9e3e=>!_0x5e6d62['includes'](_0x1b9e3e));for(const _0x5a139d of _0x5e6d62)_0x5a139d['createdAt']='lastOperationAcceptedAt'in _0x13df1c&&_0x13df1c['lastOperationAcceptedAt']||void 0x0;rt(_0x5e6d62,_0x13df1c['version']-_0x5e6d62['length']),this['_updateServerHistory'](_0x5e6d62);const _0x53efed=_0x5e6d62['filter'](_0x1ad669=>{if(!_0x1ad669['_isInit'])return!0x1;const _0x2612bd=this['_getAffectedRoot'](_0x1ad669);return _0x2612bd&&!this['_knownRootNames']['has'](_0x2612bd);});rt(_0x53efed,this['_document']['version']),this['_applyOperationsSet'](_0x53efed),_0x5af193=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x48d998=this['_decompressOperations'](_0x13df1c['data'],_0x13df1c['metadata'])['filter'](_0x4b51b7=>_0x4b51b7['baseVersion']>=this['_lastServerVersion']);_0x48d998['forEach'](_0x59d773=>this['_addKnownRoot'](_0x59d773)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1c2dc3=>!_0x1c2dc3['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1c2dc3))),this['_bufferedOperations']['length']&&rt(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x48d998),_0x5af193=this['_handleExternalOperations'](_0x48d998,_0x13df1c['version'],_0x13df1c['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5af193?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x2a8ad2,_0x1a9c18,_0x1790ce){try{const _0x2ef4d4={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1e316d,operationsB:_0x83c399,originalOperations:_0x23babb}=_0x25bfc3(_0x2a8ad2,this['_bufferedOperations'],_0x2ef4d4);rt(_0x1e316d,this['_document']['version']),rt(_0x83c399,_0x1a9c18);for(const _0xcef920 of _0x1e316d){const _0x584314=_0x23babb['get'](_0xcef920);_0x584314?(_0xcef920['_authorId']=_0x584314['_authorId'],'noop'!==_0xcef920['type']&&(_0xcef920['_aiSource']=_0x584314['_aiSource'])):_0xcef920['_authorId']=null;}for(const _0xa08c6a of _0x83c399)'noop'!==_0xa08c6a['type']&&(_0xa08c6a['_aiSource']=_0x23babb['get'](_0xa08c6a)?.['_aiSource']);_0x1790ce&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2a8ad2,_0x1790ce),this['_lastSyncedOperationId']=_0x1790ce),this['_bufferedOperations']=[..._0x83c399],this['_applyOperationsSet'](_0x1e316d),this['_updateServerHistory'](_0x2a8ad2);}catch(_0x51095e){return console['error'](_0x51095e),!0x1;}return!0x0;}_applyOperationsSet(_0x1c133e,_0x5d83b4=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x15a15e=>{for(const _0x559a6c of _0x1c133e)this['_knownOperations']['add'](_0x559a6c),this['_addKnownRoot'](_0x559a6c),_0x15a15e['batch']['addOperation'](_0x559a6c),this['editor']['model']['applyOperation'](_0x559a6c);});}_addKnownRoot(_0x155ef8){const _0xc04f6f=this['_getAffectedRoot'](_0x155ef8);_0xc04f6f&&this['_knownRootNames']['add'](_0xc04f6f);}_getAffectedRoot(_0x5a39a1){let _0x5a4c87,_0x21709e;switch(_0x5a39a1['type']){case'insert':_0x5a4c87=_0x5a39a1['position']['root'];break;case'marker':if(_0x21709e=_0x5a39a1['newRange'],!_0x21709e)return null;_0x5a4c87=_0x21709e['root'];break;case'addRootAttribute':_0x5a4c87=_0x5a39a1['root'];break;case'addRoot':_0x5a4c87=_0x5a39a1['affectedSelectable'];break;case'move':_0x5a4c87=_0x5a39a1['targetPosition']['root'];break;default:return null;}return _0x5a4c87['rootName'];}_updateServerHistory(_0x44ea76){_0x44ea76['forEach'](_0x3f2e01=>{const _0x56daf2=_0x3f2e01['clone']();_0x56daf2['_authorId']=_0x3f2e01['_authorId'],_0x56daf2['_isInit']=!!_0x3f2e01['_isInit'],_0x56daf2['_aiSource']=_0x3f2e01['_aiSource'],_0x56daf2['createdAt']=_0x3f2e01['createdAt'],_0x56daf2['baseVersion']+=this['_offset'],_0x3f2e01['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x56daf2),this['serverHistory']['addOperation'](_0x56daf2);});}_handleReconnectionError(_0x36ac99){const _0x27bb4e=this['editor']['plugins']['get']('Notification'),_0x3a5ad3=this['editor']['locale'];_0x36ac99||(_0x36ac99=et(_0x3a5ad3,'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.')),_0x27bb4e['showWarning'](_0x36ac99,{'title':et(_0x3a5ad3,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](K)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x319a38)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x319a38)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x2361be){const _0x38f8f3=_0x2361be['map'](_0x2f868a=>_0x2f868a['toJSON']());return this['_compressor']['compress'](_0x38f8f3);}_decompressOperations(_0x50375d,_0x26107f){return this['_compressor']['decompress'](_0x50375d)['map']((_0x4cb146,_0x4053f5)=>{const _0xfca0fd='init'==_0x26107f[_0x4053f5]['type'];if('InsertOperation'==_0x4cb146['__className']){const _0x2bed94=_0x4cb146['position']['root'];!this['_document']['getRoot'](_0x2bed94)&&(this['_document']['createRoot']('$unknown',_0x2bed94)['_isAttached']=!0x1);}else{if('RootOperation'==_0x4cb146['__className']){const _0x116191=this['_document']['getRoot'](_0x4cb146['rootName']);_0x116191&&'$unknown'==_0x116191['name']&&_0x4cb146['elementName']!=_0x116191['name']&&(_0x116191['name']=_0x4cb146['elementName']);}}const _0x583473=_0x5197a1['fromJSON'](_0x4cb146,this['_document']);return _0x583473['wasUndone']=_0x4cb146['wasUndone'],_0x583473['_isInit']=_0xfca0fd,_0x583473['_authorId']=_0xfca0fd?null:_0x26107f[_0x4053f5]['userId'],_0x583473['_isDisconnection']='cs:removeUser'===_0x26107f[_0x4053f5]['type'],_0x583473['_aiSource']=_0x4cb146['_aiSource']||void 0x0,_0x583473['createdAt']=_0x26107f[_0x4053f5]['createdAt'],_0x583473;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0xa2f922=this['editor']['plugins']['get'](J)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0xa2f922&&_0xa2f922['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function rt(_0x36731d,_0x55e5ac){for(const _0x4d65f4 of _0x36731d)_0x4d65f4['baseVersion']=_0x55e5ac++;}var ot=class{_ignoredOperations;_operationToId;constructor(_0x3d6a0d){this['_ignoredOperations']=_0x3d6a0d,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x1fde0f){let _0x1fe7d7=_0x1fde0f['length'];for(;_0x1fe7d7--;){const _0x591c22=_0x1fde0f[_0x1fe7d7];if(!this['_ignoredOperations']['has'](_0x591c22)){if(!this['_operationToId']['has'](_0x591c22)){const _0x415eec=_0x48203e()['slice'](0x1,0x12);this['_operationToId']['set'](_0x591c22,_0x415eec);}return this['_operationToId']['get'](_0x591c22);}}}setIdForTheLastOperation(_0x2a08d1,_0x17d85c){if(!_0x17d85c)return;let _0x358a7e=_0x2a08d1['length'];for(;_0x358a7e--;){const _0x59d58c=_0x2a08d1[_0x358a7e];this['_ignoredOperations']['has'](_0x59d58c)||this['_operationToId']['set'](_0x59d58c,_0x17d85c);}}},ct=class extends _0x472486{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class extends _0x472486{['_sources']=new Map();_data=null;_hasStarted=!0x1;static get requires(){return[K,J,_0x1d1b46];}static get['pluginName'](){return'RealTimeContentFetcher';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_register(_0x1357f2,_0x279e20){if(this['_hasStarted'])throw new _0x36a0fd('realtimecontentfetcher-register-after-init',null,{'name':_0x1357f2});if(this['_sources']['has'](_0x1357f2))throw new _0x36a0fd('realtimecontentfetcher-register-duplicate',null,{'name':_0x1357f2});this['_sources']['set'](_0x1357f2,_0x279e20);}_takeInitialData(_0x480aa9){if(!this['_data'])throw new _0x36a0fd('realtimecontentfetcher-data-not-ready',null,{'name':_0x480aa9});if(!this['_data']['has'](_0x480aa9))throw new _0x36a0fd('realtimecontentfetcher-data-not-available',null,{'name':_0x480aa9});const _0x330493=this['_data']['get'](_0x480aa9);return this['_data']['delete'](_0x480aa9),_0x330493;}async init(){this['_hasStarted']=!0x0;const _0x44cc28=Array['from'](this['_sources']),_0x3d8c4d=await Promise['all'](_0x44cc28['map'](([,_0x495bdb])=>_0x495bdb['fetch']()));await this['_fetchMissingUsers'](_0x44cc28['map'](([,_0x107c5e],_0x2386f4)=>_0x107c5e['getUserIds'](_0x3d8c4d[_0x2386f4]))),this['_data']=new Map(_0x44cc28['map'](([_0x3f9352],_0x3c9a43)=>[_0x3f9352,_0x3d8c4d[_0x3c9a43]]));}async _fetchMissingUsers(_0x1a0d90){const _0x2ae786=this['editor']['plugins']['get'](_0x1d1b46),_0x209be4=new Set();for(const _0x102fc3 of _0x1a0d90)for(const _0x552acb of _0x102fc3)_0x2ae786['getUser'](_0x552acb)||_0x209be4['add'](_0x552acb);if(0x0===_0x209be4['size'])return;const {connection:_0x67cb4}=this['editor']['plugins']['get'](K),_0x351077=await _0x3d6f90['getMany'](_0x67cb4,Array['from'](_0x209be4));for(const _0xb130e5 of _0x351077)_0x2ae786['getUser'](_0xb130e5['id'])||_0x2ae786['addUser'](_0xb130e5);}};function ht(_0xdf48d1){const _0x566f2c=new Set();for(const {resolvedBy:_0x5623fb,comments:_0x2060d9}of _0xdf48d1){_0x5623fb&&_0x566f2c['add'](_0x5623fb);for(const {userId:_0x295cd9}of _0x2060d9)_0x566f2c['add'](_0x295cd9);}return _0x566f2c;}var lt=class CloudServicesCommentsAdapter extends _0x577128{static CommentsService=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x22c092)());['_services'];_pendingServiceEvents=new Map();_channelsAwaitingInitialData=new Set();static get requires(){return[K,_0x3b7eba,J,_0x1d1b46];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14e7bf){super(_0x14e7bf),this['_services']=new Map();}async init(){const _0x19473a=this['context'],_0x1ad104=_0x19473a['plugins']['get'](_0x3b7eba);if(_0x19473a['plugins']['get'](K)['addToReconnectionStack'](this),_0x1ad104['adapter']={'addCommentThread':async({channelId:_0x44ce47,threadId:_0x59154d,comments:_0x4a02bc,resolvedAt:_0x5e3ea9,resolvedBy:_0x33cd35,context:_0xf71422,attributes:_0x58d1db})=>{const _0x1a27b4=await this['_getService'](_0x44ce47)['addCommentThread']({'commentThreadId':_0x59154d,'comments':_0x4a02bc['map'](_0x300a48=>function(_0x8ee1e0,_0x269897,_0x5535a9){return{'commentThreadId':_0x5535a9,'commentId':_0x8ee1e0['commentId'],'userId':_0x8ee1e0['authorId'],'content':_0x8ee1e0['content'],'documentId':_0x269897,'createdAt':_0x8ee1e0['createdAt'],'attributes':_0x8ee1e0['attributes']||{}};}(_0x300a48,_0x44ce47,_0x59154d)),'resolvedAt':_0x5e3ea9,'resolvedBy':_0x33cd35,'context':_0xf71422,'attributes':_0x58d1db})['catch'](ut);return{'threadId':_0x1a27b4['commentThreadId'],'comments':_0x1a27b4['comments']};},'getCommentThread':async({channelId:_0x1a966e,threadId:_0x484405})=>{const _0x6cb662=await this['_getService'](_0x1a966e)['getCommentThread'](_0x484405)['catch'](dt)['catch'](ut);return _0x6cb662?_0x6cb662['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x6cb662]),{'threadId':_0x6cb662['commentThreadId'],'comments':_0x6cb662['comments']['map'](ft),'context':_0x6cb662['context'],'resolvedAt':_0x6cb662['resolvedAt'],'resolvedBy':_0x6cb662['resolvedBy'],'attributes':_0x6cb662['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x268f1c,threadId:_0x15862b,context:_0x20e6f4,unlinkedAt:_0x59028e,attributes:_0xcf0690})=>this['_getService'](_0x268f1c)['updateCommentThread']({'commentThreadId':_0x15862b,'context':_0x20e6f4,'attributes':_0xcf0690,'unlinkedAt':_0x59028e})['catch'](dt)['catch'](ut),'resolveCommentThread':async({channelId:_0x47e567,threadId:_0x130c34})=>{const _0x3507c5=await this['_getService'](_0x47e567)['resolveCommentThread'](_0x130c34)['catch'](dt)['catch'](ut);return{'threadId':_0x3507c5['commentThreadId'],'resolvedAt':_0x3507c5['resolvedAt'],'resolvedBy':_0x3507c5['resolvedBy']};},'reopenCommentThread':async({channelId:_0x109b96,threadId:_0x5633f7})=>this['_getService'](_0x109b96)['reopenCommentThread'](_0x5633f7)['catch'](dt)['catch'](ut),'removeCommentThread':({channelId:_0x1c0769,threadId:_0x1eccfc})=>this['_getService'](_0x1c0769)['removeCommentThread'](_0x1eccfc)['catch'](dt)['catch'](ut),'addComment':({channelId:_0x3a66e8,threadId:_0x3b195a,commentId:_0x3eea41,content:_0x1df09e,attributes:_0x26e6d3})=>this['_getService'](_0x3a66e8)['addComment'](_0x3b195a,_0x3eea41,_0x1df09e,_0x26e6d3)['catch'](ut),'updateComment':({channelId:_0x4dad17,threadId:_0x5b1ac5,commentId:_0x82f523,content:_0x515c03,attributes:_0x111452})=>this['_getService'](_0x4dad17)['updateComment'](_0x5b1ac5,_0x82f523,_0x515c03,_0x111452)['catch'](dt)['catch'](ut),'removeComment':({channelId:_0x2b8946,threadId:_0x25d6e3,commentId:_0x1d19d8})=>this['_getService'](_0x2b8946)['removeComment'](_0x25d6e3,_0x1d19d8)['catch'](dt)['catch'](ut)},_0x19473a instanceof _0x1166e8){const _0x53a2e2=_0x19473a['config']['get']('collaboration.channelId'),_0x363b5f=_0x19473a['plugins']['get'](J);await this['_setUpService'](_0x53a2e2);const _0x2382b4=await this['_services']['get'](_0x53a2e2)['getConnectedSessions']();this['listenTo'](_0x363b5f,'sessionAdd:'+_0x53a2e2,(_0x5502dc,{session:_0x410855})=>{_0x410855['id']===_0x363b5f['mySessionId']&&(_0x5502dc['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x410855['permissions'],_0x53a2e2));}),_0x363b5f['register'](_0x53a2e2,_0x2382b4);}}async _setUpService(_0x2642ee){this['_createService'](_0x2642ee),await this['_connectService'](_0x2642ee);}_createService(_0x141837){if(this['_services']['has'](_0x141837))throw new _0x36a0fd('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x141837});const _0x2c3774=this['context']['plugins']['get'](_0x3b7eba),_0x62480e=new CloudServicesCommentsAdapter['CommentsService'](_0x141837);this['_services']['set'](_0x141837,_0x62480e),this['listenTo'](_0x62480e,'commentThreadAdded',(_0x20e3a3,_0x480ad2)=>{const {commentThreadId:_0xcb506c,documentId:_0x3f757b,context:_0x2de15b,attributes:_0x445589,resolvedAt:_0x5522a2,resolvedBy:_0x504014,comments:_0x1e1548}=_0x480ad2,_0x14b5c3=_0x1e1548?_0x1e1548['map'](({userId:_0x4a4bf8})=>_0x4a4bf8):[];_0x504014&&_0x14b5c3['push'](_0x504014),this['_handleOrQueueServiceEvent'](_0x141837,_0x14b5c3,()=>{_0x2c3774['getCommentThread'](_0xcb506c)||_0x2c3774['addCommentThread']({'threadId':_0xcb506c,'channelId':_0x3f757b,'comments':_0x1e1548?_0x1e1548['map'](ft):[],'context':_0x2de15b,'attributes':_0x445589,'resolvedAt':_0x5522a2,'resolvedBy':_0x504014,'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'commentThreadUpdated',(_0x3b223a,{commentThreadId:_0x12d5c5,documentId:_0x4f3696,context:_0x550b98,unlinkedAt:_0x560c92,attributes:_0x4325fa})=>{this['_handleOrQueueServiceEvent'](_0x141837,[],()=>{_0x2c3774['getCommentThread'](_0x12d5c5)&&_0x2c3774['updateCommentThread']({'threadId':_0x12d5c5,'channelId':_0x4f3696,'context':_0x550b98,'unlinkedAt':_0x560c92,'attributes':_0x4325fa,'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'commentThreadResolved',(_0x352ddb,{commentThreadId:_0x52b873,resolvedBy:_0x9b3f7,resolvedAt:_0x227b43})=>{this['_handleOrQueueServiceEvent'](_0x141837,[_0x9b3f7],()=>{const _0x145553=_0x2c3774['getCommentThread'](_0x52b873);_0x145553&&!_0x145553['isResolved']&&_0x145553['resolve']({'resolvedBy':_0x9b3f7,'resolvedAt':_0x227b43,'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'commentThreadReopened',(_0x595ffe,{commentThreadId:_0x3a37be})=>{this['_handleOrQueueServiceEvent'](_0x141837,[],()=>{const _0x288191=_0x2c3774['getCommentThread'](_0x3a37be);_0x288191&&_0x288191['isResolved']&&_0x288191['reopen']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'commentThreadRemoved',(_0x25039d,{commentThreadId:_0x242c3f})=>{this['_handleOrQueueServiceEvent'](_0x141837,[],()=>{const _0x49f99b=_0x2c3774['getCommentThread'](_0x242c3f);_0x49f99b&&_0x49f99b['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'commentAdded',(_0x370b81,_0x3cd258)=>{this['_handleOrQueueServiceEvent'](_0x141837,[_0x3cd258['userId']],()=>{const _0x25a731=_0x2c3774['getCommentThread'](_0x3cd258['commentThreadId']);_0x25a731&&!_0x25a731['getComment'](_0x3cd258['commentId'])&&_0x25a731['addComment']({...ft(_0x3cd258),'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'commentUpdated',(_0x42d236,{commentThreadId:_0x5a6b21,commentId:_0x961abf,content:_0xef5d25,attributes:_0x2f8627})=>{this['_handleOrQueueServiceEvent'](_0x141837,[],()=>{const _0x3c0a5b=_0x2c3774['getCommentThread'](_0x5a6b21)?.['getComment'](_0x961abf);_0x3c0a5b&&_0x3c0a5b['update']({'content':_0xef5d25,'attributes':_0x2f8627,'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'commentRemoved',(_0x2f6757,{commentThreadId:_0x3bed7a,commentId:_0x3db451})=>{this['_handleOrQueueServiceEvent'](_0x141837,[],()=>{const _0x2c4cad=_0x2c3774['getCommentThread'](_0x3bed7a)?.['getComment'](_0x3db451);_0x2c4cad&&_0x2c4cad['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x62480e,'disconnected',()=>{'connected'===this['context']['plugins']['get'](K)['connection']?.['state']&&(this['_services']['delete'](_0x141837),this['_pendingServiceEvents']['delete'](_0x141837),this['stopListening'](_0x62480e));});}destroy(){if(this['context']instanceof _0x1166e8){const _0x153291=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x153291)&&this['_terminateService'](_0x153291);}}_terminateService(_0x135e85){if(!this['_services']['has'](_0x135e85))throw new _0x36a0fd('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x135e85});this['_getService'](_0x135e85)['disconnect'](),this['_services']['delete'](_0x135e85);}async reconnect(){for(const _0x2a6cdc of this['_services']['keys']())await this['_connectService'](_0x2a6cdc);if(this['context']instanceof _0x1166e8){const _0x3de7b9=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x3de7b9)){const _0x1bc01e=this['context']['plugins']['get'](J);_0x1bc01e['unregister'](_0x3de7b9);const _0x25678f=await this['_services']['get'](_0x3de7b9)['getConnectedSessions']();_0x1bc01e['register'](_0x3de7b9,_0x25678f);}}}_fetchInitialChannelData(_0x47dd49){return this['_channelsAwaitingInitialData']['add'](_0x47dd49),this['_fetchChannelData'](_0x47dd49);}async _applyInitialChannelData(_0x3fc605,_0x1bfa56){this['_channelsAwaitingInitialData']['delete'](_0x3fc605)&&await this['_applyChannelData'](_0x3fc605,_0x1bfa56);}async _fetchChannelData(_0x133260){const {connection:_0xa78bc7}=this['context']['plugins']['get'](K);return this['_pendingServiceEvents']['set'](_0x133260,[]),await this['_services']['get'](_0x133260)['connect'](_0xa78bc7);}async _applyChannelData(_0x2348b0,_0x4739ea){const _0x58d0e2=this['context']['plugins']['get'](_0x3b7eba),_0x313d31=new Set(Array['from'](_0x58d0e2['getCommentThreads']({'channelId':_0x2348b0}),_0x1487b7=>_0x1487b7['id']));for(const _0x325e56 of _0x4739ea)_0x325e56['deletedAt']||_0x313d31['delete'](_0x325e56['commentThreadId']);for(const _0x49145f of _0x313d31)_0x58d0e2['getCommentThread'](_0x49145f)['remove']({'isFromAdapter':!0x0});for(const _0x1663a9 of _0x4739ea){let _0xdf5076=_0x58d0e2['getCommentThread'](_0x1663a9['commentThreadId']);const {commentThreadId:_0x25d04a,context:_0x2b7993,attributes:_0x5ce2e7,resolvedBy:_0x55a094,resolvedAt:_0xfc37be,unlinkedAt:_0x179886,deletedAt:_0x3d5b57}=_0x1663a9;if(_0x3d5b57)continue;_0xdf5076||(_0xdf5076=_0x58d0e2['addCommentThread']({'channelId':_0x2348b0,'threadId':_0x25d04a,'context':_0x2b7993,'attributes':_0x5ce2e7||{},'resolvedBy':_0x55a094,'resolvedAt':_0xfc37be,'unlinkedAt':_0x179886,'isFromAdapter':!0x0}));const _0x22fc9f=new Set(Array['from'](_0xdf5076['comments'],_0x41e2a5=>_0x41e2a5['id']));for(const _0x1e20e8 of _0x1663a9['comments'])_0x22fc9f['delete'](_0x1e20e8['commentId']);for(const _0x4ed58a of _0x22fc9f)_0xdf5076['getComment'](_0x4ed58a)['remove']({'isFromAdapter':!0x0});for(const _0x544a7d of _0x1663a9['comments']){const _0x2c0aa1=_0xdf5076['getComment'](_0x544a7d['commentId']);_0x2c0aa1?_0x2c0aa1['content']!==_0x544a7d['content']&&_0x2c0aa1['update']({'content':_0x544a7d['content'],'isFromAdapter':!0x0}):_0xdf5076['addComment'](Object['assign'](ft(_0x544a7d),{'isFromAdapter':!0x0}));}}await this['_applyPendingServiceEvents'](_0x2348b0);}_handleOrQueueServiceEvent(_0x5f23a1,_0x50ade6,_0x23ec0c){const _0xf220fd=this['_pendingServiceEvents']['get'](_0x5f23a1);_0xf220fd?_0xf220fd['push']({'userIds':_0x50ade6,'apply':_0x23ec0c}):_0x23ec0c();}async _applyPendingServiceEvents(_0x25074f){const _0xf2ab24=this['_pendingServiceEvents']['get'](_0x25074f)||[];for(;_0xf2ab24['length'];){const _0x408405=_0xf2ab24['splice'](0x0);await this['_fetchMissingUsers'](_0x408405['flatMap'](({userIds:_0x3289fd})=>_0x3289fd));for(const {apply:_0x354477}of _0x408405)_0x354477();}this['_discardPendingServiceEvents'](_0x25074f,_0xf2ab24);}_discardPendingServiceEvents(_0x3c49da,_0x342130){this['_pendingServiceEvents']['get'](_0x3c49da)===_0x342130&&this['_pendingServiceEvents']['delete'](_0x3c49da);}async _connectService(_0x267596){const _0x3e29ce=this['_channelsAwaitingInitialData']['delete'](_0x267596),_0x2fc675=this['_fetchChannelData'](_0x267596),_0x30564e=this['_pendingServiceEvents']['get'](_0x267596);let _0x249bbf=!0x1;try{const _0x1c5365=await _0x2fc675;_0x249bbf=!0x0,await this['_fetchMissingUsersForThreads'](_0x1c5365),await this['_applyChannelData'](_0x267596,_0x1c5365);}catch(_0x5c8579){throw this['_discardPendingServiceEvents'](_0x267596,_0x30564e),_0x3e29ce&&!_0x249bbf&&this['_channelsAwaitingInitialData']['add'](_0x267596),_0x5c8579;}}_getService(_0x2bd029){if(!this['_services']['has'](_0x2bd029))throw new _0x36a0fd('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x2bd029});return this['_services']['get'](_0x2bd029);}async _fetchMissingUsersForThreads(_0x4e8055){return this['_fetchMissingUsers'](ht(_0x4e8055));}async _fetchMissingUsers(_0x7aea90){const _0x33217a=this['context']['plugins']['get'](_0x1d1b46),{connection:_0x2095a1}=this['context']['plugins']['get'](K),_0x1dae6f=Array['from'](new Set(_0x7aea90))['filter'](_0x2b290c=>!_0x33217a['getUser'](_0x2b290c));if(0x0===_0x1dae6f['length'])return;const _0x21e632=await _0x3d6f90['getMany'](_0x2095a1,_0x1dae6f);for(const _0x33ff1a of _0x21e632)_0x33217a['getUser'](_0x33ff1a['id'])||_0x33217a['addUser'](_0x33ff1a);}};async function dt(_0x8844d){if('404'!==_0x8844d['code'])throw _0x8844d;}function ut(_0xdee73d){if((_0x488ef9=_0xdee73d)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x488ef9['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x488ef9['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x488ef9;throw _0xdee73d;}function ft(_0x580b99){return{'threadId':_0x580b99['commentThreadId'],'commentId':_0x580b99['commentId'],'content':_0x580b99['content'],'createdAt':_0x580b99['createdAt'],'authorId':_0x580b99['userId'],'attributes':_0x580b99['attributes']||{}};}var mt=class CloudServicesTrackChangesAdapter extends _0x472486{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x1c471b)());_bufferedRequests;_trackChangesService;['_isChannelFlushed']=!0x1;_pendingSuggestionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[lt,_0x3beba8,K,at];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ff81e){super(_0x3ff81e);const _0x17dd34=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x17dd34),_0x3ff81e['plugins']['get'](at)['_register']('trackChanges',{'fetch':()=>this['_fetchInitialSuggestions'](),'getUserIds':_0x2d71b6=>_0x2d71b6['map'](({authorId:_0x4cb6ba})=>_0x4cb6ba)});}init(){const _0xfe3532=this['editor']['plugins']['get'](_0x3beba8);_0xfe3532['adapter']={'getSuggestion':async _0x1fdb4b=>{await this['_waitForServiceReady']();const _0x1285ba=await this['_trackChangesService']['get'](_0x1fdb4b)['catch'](pt);return await this['_fetchMissingUsersForThreads']([_0x1285ba]),_0x1285ba;},'addSuggestion':async({id:_0x597ad7,type:_0x5ae9d8,data:_0x39ac1d,originalSuggestionId:_0x11bdcf,attributes:_0x59c475})=>{await this['_waitForServiceReady']();const _0x5ef5e4={'id':_0x597ad7,'type':_0x5ae9d8,'data':_0x39ac1d,'originalSuggestionId':_0x11bdcf,'attributes':_0x59c475},_0x4fd928=await this['_trackChangesService']['add'](_0x597ad7,_0x5ae9d8,_0x39ac1d,_0x11bdcf,_0x59c475)['catch'](_0x3bbcef=>{if(gt(_0x3bbcef))return new Promise(_0x22cdc1=>{this['_bufferedRequests']['set'](_0x597ad7,{'resolve':_0x22cdc1,'suggestionData':_0x5ef5e4});});throw _0x3bbcef;});return this['_bufferedRequests']['delete'](_0x597ad7),_0x4fd928;},'updateSuggestion':async(_0x37cbfe,_0x19152a)=>{if(await this['_waitForServiceReady'](),'open'!==_0x19152a['state'])return this['_trackChangesService']['update'](_0x37cbfe,_0x19152a)['catch'](pt);}};const _0x28b611=this['editor']['plugins']['get'](at)['_takeInitialData']('trackChanges');for(const _0x4ac175 of _0x28b611){_0xfe3532['addSuggestionData'](_0x4ac175)['_saved']=!0x0;}for(const {id:_0x20e0df,attributes:_0x45f363}of this['_pendingSuggestionsUpdates'])this['_handleSuggestionUpdate'](_0x20e0df,_0x45f363);this['_pendingSuggestionsUpdates']=null,this['_setReadyForReconnect']();}async _fetchInitialSuggestions(){const _0x377d31=this['editor']['plugins']['get'](K);this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x37921d,{id:_0x50411e,attributes:_0x31317a})=>{this['_pendingSuggestionsUpdates']?this['_pendingSuggestionsUpdates']['push']({'id':_0x50411e,'attributes':_0x31317a}):this['_handleSuggestionUpdate'](_0x50411e,_0x31317a);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x377d31['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x377d31['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));});const _0x1682f0=await this['_trackChangesService']['connect'](_0x377d31['connection']);return this['_isChannelFlushed']||_0x377d31['addToReconnectionStack'](this),_0x1682f0;}_handleSuggestionUpdate(_0x38a59e,_0x5247ae){const _0x445612=this['editor']['plugins']['get'](_0x3beba8);_0x445612['hasSuggestion'](_0x38a59e)&&(_0x445612['getSuggestion'](_0x38a59e)['attributes']=_0x5247ae);}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x5a427a=>console['error'](_0x5a427a)));}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x5d8cd9=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x32684c}=this['editor']['plugins']['get'](K),_0xd98cdf=await this['_trackChangesService']['connect'](_0x32684c);await this['_fetchMissingUsersForThreads'](_0xd98cdf);for(const {suggestionData:_0x4282c8,resolve:_0xbe12f5}of this['_bufferedRequests']['values']()){let _0x10c822=_0xd98cdf['find'](_0x358be4=>_0x358be4['id']===_0x4282c8['id']);_0x10c822||(_0x10c822=await this['_trackChangesService']['add'](_0x4282c8['id'],_0x4282c8['type'],_0x4282c8['data'],_0x4282c8['originalSuggestionId'])),_0xbe12f5(_0x10c822);}for(const _0x4b325b of _0xd98cdf)_0x5d8cd9['hasSuggestion'](_0x4b325b['id'])||_0x5d8cd9['addSuggestionData'](_0x4b325b);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x1a7a59=>{this['listenTo'](this['_trackChangesService'],'connected',_0x4b8918=>{_0x4b8918['off'](),_0x1a7a59();});});}async _fetchMissingUsersForThreads(_0x789f86){const _0x2f09dd=this['editor']['plugins']['get'](_0x1d1b46),{connection:_0x5439b0}=this['editor']['plugins']['get'](K),_0x105be7=new Set();for(const {authorId:_0x3558ad}of _0x789f86)_0x2f09dd['getUser'](_0x3558ad)||_0x105be7['add'](_0x3558ad);if(0x0===_0x105be7['size'])return;const _0x221788=await _0x3d6f90['getMany'](_0x5439b0,Array['from'](_0x105be7));for(const _0x6522fd of _0x221788)_0x2f09dd['getUser'](_0x6522fd['id'])||_0x2f09dd['addUser'](_0x6522fd);}};function pt(_0xcf8e26){if(gt(_0xcf8e26))return new Promise(()=>{});throw _0xcf8e26;}function gt(_0x348792){return _0x348792['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x348792['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var wt=class extends _0x472486{static get requires(){return[_0x19f1c8,lt,ct,K,at];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2f6724){super(_0x2f6724);const _0x2ef75f=_0x2f6724['plugins']['get'](lt),_0x4a792d=_0x2f6724['config']['get']('collaboration.channelId');_0x2f6724['plugins']['get'](at)['_register']('comments',{'fetch':()=>(_0x2ef75f['_createService'](_0x4a792d),_0x2ef75f['_fetchInitialChannelData'](_0x4a792d)),'getUserIds':ht});}init(){const _0x5df020=this['editor']['plugins']['get'](K),_0x5d1ea3=this['editor']['plugins']['get'](_0x4a4ce5),_0x333dd5=this['editor']['plugins']['get'](lt);this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x5df020,'change:state',(_0x91501c,_0x5370a7,_0x59836f)=>{_0x5d1ea3['isThreadsLoadingPaused']='connected'!==_0x59836f;});}),this['listenTo'](_0x5df020,'change:state',(_0x427b8c,_0xd264f,_0x37cee3)=>{this['editor']['plugins']['get'](_0x3b7eba)['switchReadOnly']('connected'!==_0x37cee3);});const _0x1652e1=this['editor']['config']['get']('collaboration.channelId'),_0x4424eb=this['editor']['plugins']['get'](at)['_takeInitialData']('comments');return _0x333dd5['_applyInitialChannelData'](_0x1652e1,_0x4424eb);}destroy(){const _0x43c373=this['editor']['plugins']['get'](lt),_0xbbd4fc=this['editor']['config']['get']('collaboration.channelId');_0x43c373['_services']['has'](_0xbbd4fc)&&_0x43c373['_terminateService'](_0xbbd4fc),super['destroy']();}},vt=class extends _0x472486{static get requires(){return[wt,mt,_0x49569c];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},_t=class CloudServicesRevisionHistoryAdapter extends _0x472486{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x288311)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;['_isChannelFlushed']=!0x1;_newestRevisionPrefetch=null;_pendingRevisionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[K,it,_0x310da3,J,_0x1d1b46,at];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b2c63){super(_0x4b2c63);const _0x5c9bb5=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x5c9bb5),this['set']('_isServiceConnected',!0x1),_0x4b2c63['plugins']['get'](at)['_register']('revisionHistory',{'fetch':()=>this['_fetchInitialData'](),'getUserIds':({revisions:_0x1cfe01})=>_0x1cfe01['flatMap'](({authorsIds:_0x1bd0c2,creatorId:_0x2206a0})=>_0x2206a0?[..._0x1bd0c2,_0x2206a0]:_0x1bd0c2)});}async init(){const _0x50fed4=this['editor']['plugins']['get'](it),{hasEditorBundle:_0x2df63f,revisions:_0x570659}=this['editor']['plugins']['get'](at)['_takeInitialData']('revisionHistory');this['listenTo'](this['editor']['data'],'ready',()=>{this['_setReadyForReconnect'](),this['_newestRevisionPrefetch']=null;}),this['editor']['plugins']['get'](_0x310da3)['adapter']={'getRevision':async({revisionId:_0x2589ef})=>{const _0x1afecc=this['_newestRevisionPrefetch'];return _0x1afecc&&_0x1afecc['revisionId']===_0x2589ef?(this['_newestRevisionPrefetch']=null,_0x1afecc['promise']):(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x2589ef));},'updateRevisions':async _0x7290=>{await this['_waitForServiceReady']();const _0x3843c4=this['_revisionTracker']['currentRevision'];if(_0x2df63f&&0x1===_0x7290['length']&&_0x7290[0x0]['id']===_0x3843c4['id'])return _0x7290;for(const _0x566543 of _0x7290)_0x566543['id']===_0x3843c4['id']&&(_0x566543['isEmptyCurrent']=_0x566543['fromVersion']===_0x566543['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x7290,this['_lastRequestId'])['then'](_0x5a8902=>(this['_lastRequestId']=_0x5a8902,_0x7290))['catch'](_0x86b03=>{if(yt(_0x86b03)||'400'===_0x86b03['code']&&void 0x0!==_0x86b03['data']['wrongRequestId']){for(const _0x3cc916 of _0x7290)this['_revisionTracker']['repository']['getRevision'](_0x3cc916['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x3cc916['id'],_0x3cc916,!0x1);if(yt(_0x86b03)&&'destroyed'!==this['editor']['state'])throw _0x86b03;return _0x7290;}throw _0x86b03;});}};for(const _0x45e9ef of _0x570659)this['_revisionTracker']['addRevisionData'](_0x45e9ef);this['listenTo'](_0x50fed4,'change:_isConnected',(_0x1943df,_0xa0e465,_0x5d1562)=>{_0x5d1562&&(this['_oldOffset']=_0x50fed4['_offset'],_0x1943df['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected'),await this['_applyPendingRevisionsUpdates']();}async _fetchInitialData(){const _0x1816e7=this['editor']['plugins']['get'](it),_0x2114af=this['editor']['plugins']['get'](K),_0x55595f=_0x1816e7['serverHistory'];this['_revisionTracker']['setSource']({'history':_0x55595f,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x1816e7['sessionId']}),this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x2eb949,{revisionsData:_0x33430a,requestId:_0x389f27})=>{_0x33430a['some'](({id:_0xc73b59})=>_0xc73b59===this['_newestRevisionPrefetch']?.['revisionId'])&&(this['_newestRevisionPrefetch']=null),Math['max'](..._0x33430a['map'](_0x233815=>_0x233815['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleOrQueueRevisionsUpdate'](_0x33430a,_0x389f27);}):this['_handleOrQueueRevisionsUpdate'](_0x33430a,_0x389f27);}),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x2114af['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x2114af['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const _0xe39574=this['editor']['config']['get']('cloudServices.bundleVersion')||_0xfc9d30,[_0x27ddfd,_0x496493]=await Promise['all']([_0xbaacb4['isBundleUploaded'](_0x2114af['connection'],_0xe39574),this['_revisionHistoryService']['connect'](_0x2114af['connection'])['then'](_0x1358bb=>(this['_lastRequestId']=_0x1358bb['requestId'],this['_isChannelFlushed']||_0x2114af['addToReconnectionStack'](this),this['_prefetchNewestRevision'](_0x1358bb['revisions']),_0x1358bb['revisions']))]);return{'hasEditorBundle':_0x27ddfd,'revisions':_0x496493};}_handleOrQueueRevisionsUpdate(_0x4bcdd9,_0x32e01f){this['_pendingRevisionsUpdates']?this['_pendingRevisionsUpdates']['push']({'revisionsData':_0x4bcdd9,'requestId':_0x32e01f}):this['_handleRevisionsUpdate'](_0x4bcdd9,_0x32e01f);}async _applyPendingRevisionsUpdates(){for(;this['_pendingRevisionsUpdates']['length'];){const _0x3ac48c=this['_pendingRevisionsUpdates']['splice'](0x0);await this['_fetchMissingUsers'](_0x3ac48c['flatMap'](({revisionsData:_0x3f2011})=>_0x3f2011));for(const {revisionsData:_0x9eddae,requestId:_0x21eb53}of _0x3ac48c)this['_handleRevisionsUpdate'](_0x9eddae,_0x21eb53);}this['_pendingRevisionsUpdates']=null;}_prefetchNewestRevision(_0x5f18b9){const _0x31c537=_0x5f18b9['reduce']((_0x8c0941,_0x3a5e2e)=>_0x8c0941?(_0x3a5e2e['toVersion']-_0x8c0941['toVersion']||_0x3a5e2e['fromVersion']-_0x8c0941['fromVersion'])>0x0?_0x3a5e2e:_0x8c0941:_0x3a5e2e,null);if(!_0x31c537||_0x31c537['diffData'])return;const _0x43b69d=this['_revisionHistoryService']['getRevision'](_0x31c537['id']);_0x43b69d['catch'](()=>{}),this['_newestRevisionPrefetch']={'revisionId':_0x31c537['id'],'promise':_0x43b69d};}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x272586=this['editor']['plugins']['get'](K),_0x18fd29=this['editor']['plugins']['get'](it),_0x35682d=async()=>{const _0x139a1d=this['_revisionTracker']['currentRevision'],_0x4d7a3e=_0x139a1d['id'],_0x1a1297=_0x4d7a3e!==_0x18fd29['sessionId'];if(_0x1a1297){const _0x39ccbc=_0x18fd29['_offset']-this['_oldOffset'],_0x151c28=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x139a1d['toVersion']+_0x39ccbc!==_0x151c28){const _0x2841e2=_0x139a1d['fromVersion']+_0x39ccbc,_0x5e99ab=this['editor']['plugins']['get'](_0x1d1b46),_0x435a34=this['_revisionTracker']['buildRevisionData']({'revision':_0x139a1d,'from':_0x2841e2,'to':_0x151c28});_0x435a34['id']=_0x139a1d['id'];const _0x462b0c=_0x435a34['authorsIds']['map'](_0x51660f=>_0x5e99ab['getUser'](_0x51660f));_0x139a1d['_update']({..._0x435a34,'authors':_0x462b0c},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x139a1d['id'],_0x435a34,!0x0);}this['_revisionTracker']['_startingVersion']=_0x151c28,_0x139a1d['toVersion']!==_0x139a1d['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x4d7a3e)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x4d7a3e),this['_revisionTracker']['_createCurrentRevision'](_0x151c28);}const {revisions:_0x16d4f9,requestId:_0x31d7ce}=await this['_revisionHistoryService']['reconnect'](_0x272586['connection'],this['_lastRequestId']);_0x1a1297&&_0x16d4f9['length']>0x0?_0x18fd29['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x16d4f9),this['_handleRevisionsUpdate'](_0x16d4f9,_0x31d7ce),this['_revisionTracker']['sendBufferedUpdates']());};return _0x18fd29['_isConnected']?_0x35682d():new Promise((_0x5d382c,_0x5c4dda)=>{_0x18fd29['once']('change:_isConnected',()=>{_0x35682d()['then'](_0x5d382c)['catch'](_0x5c4dda);});});}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x51c210=>console['error'](_0x51c210)));}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x410fa5=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x10a542=>{_0x10a542['off'](),_0x410fa5();});});}_getLatestVersionFromServerOperations(){const _0x4e7c30=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x128584 of _0x4e7c30)if('marker'!==_0x128584['type']||_0x128584['affectsData'])return _0x128584['baseVersion']+0x1;}_getLatestVersion(){const _0x1a17dc=this['editor']['plugins']['get'](it);return new Promise(_0x4ad8f5=>{_0x1a17dc['_isPendingUpdate']?_0x1a17dc['once']('change:_isPendingUpdate',()=>{_0x4ad8f5(this['_getLatestVersionFromServerOperations']());}):_0x4ad8f5(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x3e2096,_0x291f64){const _0x39d070=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x291f64;for(const _0x590632 of _0x3e2096){const _0x49ba39=_0x39d070['getRevision'](_0x590632['id']);if(_0x49ba39){if((_0x590632['fromVersion']||_0x590632['toVersion'])&&(_0x590632['diffData']=null),_0x49ba39===this['_revisionTracker']['currentRevision']){const _0x242fd7=Math['max'](_0x49ba39['toVersion'],_0x590632['toVersion']),_0x190466=Math['max'](_0x49ba39['fromVersion'],_0x590632['fromVersion']);let _0x11b46f;_0x49ba39['toVersion']===_0x590632['toVersion']&&_0x49ba39['fromVersion']===_0x590632['fromVersion']?(_0x11b46f=!0x0,this['_preventResendingRevisionData'](_0x590632)):_0x590632['toVersion']===_0x242fd7&&_0x590632['fromVersion']===_0x190466?_0x11b46f=!0x1:(_0x49ba39['toVersion']===_0x242fd7&&_0x49ba39['fromVersion']===_0x190466||this['_fixRevision']({'revision':_0x49ba39,'from':_0x190466,'to':_0x242fd7}),_0x11b46f=!0x0),_0x11b46f&&(delete _0x590632['fromVersion'],delete _0x590632['toVersion'],delete _0x590632['diffData'],delete _0x590632['createdAt'],delete _0x590632['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x590632),this['_preventResendingRevisionData'](_0x590632);}else this['_revisionTracker']['addRevisionData'](_0x590632);}const _0x563645=_0x39d070['getRevisions']();_0x563645['reverse']();for(let _0x29139e=0x0;_0x29139e<_0x563645['length']-0x1;_0x29139e++){const _0x4d9711=_0x563645[_0x29139e],_0x252ab5=_0x563645[_0x29139e+0x1];if(_0x4d9711['fromVersion']<_0x252ab5['toVersion']){const _0x28dd59=_0x252ab5['toVersion'],_0xb2e7f0=Math['max'](_0x28dd59,_0x4d9711['toVersion']);this['_fixRevision']({'revision':_0x4d9711,'from':_0x28dd59,'to':_0xb2e7f0});}}}['_fixRevision']({revision:_0x45e7f7,from:_0x5af780,to:_0x5b52ff}={}){const _0x5aba8b=this['editor']['plugins']['get'](_0x1d1b46),_0x2de176=this['_revisionTracker']['buildRevisionData']({'revision':_0x45e7f7,'from':_0x5af780,'to':_0x5b52ff});_0x2de176['authors']=_0x2de176['authorsIds']['map'](_0x74d076=>_0x5aba8b['getUser'](_0x74d076)),_0x45e7f7['_update'](_0x2de176);}_preventResendingRevisionData(_0x4f0ce6){const _0x18223e={};_0x18223e['id']=_0x4f0ce6['id'];for(const _0x36add2 of Object['keys'](_0x4f0ce6))'id'!==_0x36add2&&(_0x18223e[_0x36add2]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x18223e['id'],_0x18223e,!0x0);}async _fetchMissingUsers(_0x2b5282){const _0x22e2e1=this['editor']['plugins']['get'](_0x1d1b46),{connection:_0x462769}=this['editor']['plugins']['get'](K),_0x448874=new Set();for(const _0x5d4c7c of _0x2b5282){for(const _0x48fb0f of _0x5d4c7c['authorsIds']||[])_0x5d006b(_0x48fb0f);_0x5d4c7c['creatorId']&&_0x5d006b(_0x5d4c7c['creatorId']);}if(0x0===_0x448874['size'])return;const _0x410d91=await _0x3d6f90['getMany'](_0x462769,Array['from'](_0x448874));for(const _0x4e25bb of _0x410d91)_0x22e2e1['getUser'](_0x4e25bb['id'])||_0x22e2e1['addUser'](_0x4e25bb);function _0x5d006b(_0x463153){_0x22e2e1['getUser'](_0x463153)||_0x448874['add'](_0x463153);}}};function yt(_0x257e2b){return _0x257e2b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x257e2b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x257e2b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var bt=class extends _0x472486{static get requires(){return[_0x310da3,_t,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},kt=class extends _0x1307de{_collapseAt;constructor(_0x2bd0e3,_0x44b777=0x6){super(_0x2bd0e3);const _0x58dae1=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x44b777,this['bind']('isHidden')['to'](this,'usersCount',_0x4115b0=>_0x4115b0<_0x44b777),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x58dae1['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':_0x58dae1['to']('usersCount',_0x2feb3e=>'+'+(_0x2feb3e-this['_collapseAt']+0x2)['toString']())}]}]}]});}},It=class extends _0x1307de{items;keystrokes;constructor(_0x377914){super(_0x377914);const _0x1cea61=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x1f078d(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1cea61['if']('hasPopup'),'aria-expanded':_0x1cea61['to']('isExpanded',_0x5bf8fb=>this['hasPopup']&&String(_0x5bf8fb)),'aria-label':_0x1cea61['to']('hasPopup',_0x5c9dc5=>et(_0x377914,_0x5c9dc5?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1cea61['to']('hasPopup',_0x5ed517=>!!_0x5ed517&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0x262b70,_0x245350,_0x333943)=>{this['element']&&(_0x333943?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']);}},St=class extends _0x1307de{counterView;inlineListView;constructor(_0x22f544,_0x67dffb=0x6){super(_0x22f544);const _0x29612e=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new kt(this['locale'],_0x67dffb),this['inlineListView']=new It(_0x22f544),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5684bd of this['inlineListView']['items'])_0x5684bd['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',_0x29612e['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},Ct=class extends _0x1307de{listWrapperView;constructor(_0x25b5d7,_0x4542ba){super(_0x25b5d7),this['listWrapperView']=new Tt(_0x25b5d7,_0x4542ba),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0x25b5d7,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},Tt=class extends _0x5f2d1d{constructor(_0x2f16f4,_0x511e9b){super(_0x2f16f4);const _0x415955=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x511e9b?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x415955['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x415955['to']('role'),'aria-label':_0x415955['to']('ariaLabel'),'aria-labelledby':_0x415955['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x159ccb['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1f9936=this['element'];_0x1f9936&&(this['_isScrollable']=Math['max'](_0x1f9936['scrollHeight'],_0x1f9936['clientHeight'])>0.8*window['innerHeight']);}},At=class extends _0x48f5c5{['userView'];constructor(_0x229b59,_0x300339,_0x5d91a1){super(_0x229b59);const _0x505321=this['bindTemplate'];this['userView']=new _0x193e58(_0x229b59,_0x300339);const _0x432177={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x300339['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x300339['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x300339['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x300339['color']['getColorVariable'](),'--ck-user-color-alpha':_0x300339['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x5d91a1&&(_0x432177['tag']='button',_0x432177['on']={'click':_0x505321['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x432177);}['focus'](){this['element']['focus']();}},Pt=class extends _0x1307de{['userView'];['markerView'];constructor(_0x253a5f,_0x394760,_0x16fbd3){super(_0x253a5f);const _0x13c998=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x193e58(_0x253a5f,_0x394760),this['markerView']=new Rt(_0x253a5f,_0x394760);const _0x58b7dd=new _0xc52327(_0x253a5f);_0x58b7dd['template']['tag']='span',_0x58b7dd['text']=_0x394760['name'];const _0x5e7b1d={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x13c998['to']('isFocusable',_0x4aa2a6=>_0x4aa2a6?0x0:-0x1),'aria-labelledby':_0x58b7dd['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x13c998['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x13c998['to']('hasTooltip',_0x17bcae=>!_0x17bcae),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x58b7dd]};_0x16fbd3&&(_0x5e7b1d['tag']='button',_0x5e7b1d['on']={'click':_0x13c998['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5e7b1d);}},Rt=class extends _0x1307de{constructor(_0x36b05d,_0x1c62d7){super(_0x36b05d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1c62d7['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x1c62d7['color']['getColorVariable'](),'--ck-user-color-alpha':_0x1c62d7['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Ot={'collapseAt':0x6,'displayMe':!0x0};var xt=class extends _0x577128{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58eb3d){super(_0x58eb3d),this['context']['config']['define']('presenceList',Ot);const _0x43ef50=_0x58eb3d['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x43ef50)throw new _0x36a0fd('presencelist-collapseat-invalid-format',this);if(_0x43ef50<0x1)throw new _0x36a0fd('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](J)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x47fd78(),this['balloonPanelView']=new _0x47e65b(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[J];}init(){for(const _0x565e5f of this['_allConnectedUsers'])this['_handleUserAdd'](_0x565e5f);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4daaf4,_0x3f857b)=>{this['_handleUserAdd'](_0x3f857b);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x192b91,_0x18f4f8)=>{this['_handleUserRemove'](_0x18f4f8);});}_createView(){const _0x3ad621=this['context'],_0x383d74=new St(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x296dcb=this['balloonPanelView'];if(!_0x13562f(_0x3ad621['config']['get']('presenceList.container')))throw new _0x36a0fd('presencelist-missing-container',this);_0x383d74['counterView']['bind']('usersCount')['to'](this),_0x383d74['bind']('isCollapsed')['to'](this,'usersCount',_0xc83f7a=>{const {collapseAt:_0x62c4fd}=_0x3ad621['config']['get']('presenceList'),_0x43b6ee=_0xc83f7a>=_0x62c4fd;if(_0x43b6ee&&!_0x383d74['inlineListView']['items']['find'](_0x273fac=>_0x273fac instanceof kt)){const _0x29b02c=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x29b02c&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x383d74['inlineListView']['items']['add'](_0x383d74['counterView']);}return _0x43b6ee||this['hideDropdown'](),_0x43b6ee;}),_0x383d74['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x4de833=>{const _0x53ff80=_0x3ad621['config']['get']('presenceList'),_0x7c0119=new Pt(_0x3ad621['locale'],_0x4de833,!!_0x53ff80['onClick']);return _0x7c0119['bind']('hasTooltip')['to'](_0x383d74,'isCollapsed',_0x1ede0d=>!_0x1ede0d),_0x7c0119['bind']('isFocusable')['to'](_0x383d74,'isCollapsed',_0x4c9ad5=>!_0x4c9ad5),_0x53ff80['onClick']&&this['listenTo'](_0x7c0119,'execute',()=>{this['view']['isCollapsed']||_0x53ff80['onClick'](_0x4de833,_0x7c0119['element']);}),_0x7c0119;}),_0x383d74['inlineListView']['keystrokes']['set']('Enter',(_0x2f27d1,_0x2c90ef)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0x2c90ef());}),_0x383d74['render'](),_0x296dcb['render'](),_0x383d74['listenTo'](_0x383d74['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x5e24d5=(_0x405e9a,_0x4a6020)=>{this['_hideDropdownUnlessPointerInside'](_0x4a6020);};return _0x383d74['listenTo'](_0x383d74['inlineListView']['element'],'mouseleave',_0x5e24d5),_0x383d74['listenTo'](_0x296dcb['element'],'mouseleave',_0x5e24d5),_0x544ee6({'emitter':_0x383d74,'activator':()=>_0x296dcb['isVisible'],'contextElements':[_0x296dcb['element'],_0x383d74['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x3ad621['config']['get']('presenceList.container')['appendChild'](_0x383d74['element']),this['_overlayHost']=new _0x3cfe8b(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x383d74;}_resolveOverlayTarget(){const _0x111b72=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x111b72)return _0x111b72;const _0x4e6608=this['context']['config']['get']('presenceList.container');return _0x4e6608?_0x43c097(_0x4e6608):null;}['_handleUserAdd'](_0x34ee51){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x34ee51['isMe'])return;const _0x519e75=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x519e75-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x20d850=_0x34ee51['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x34ee51,_0x20d850);}['_handleUserRemove'](_0x2a018c){this['usersCount']--;const {collapseAt:_0x33f7ad}=this['context']['config']['get']('presenceList'),_0x3cfd3a=this['usersCount']>=_0x33f7ad;if(this['currentDisplayedUsers']['get'](_0x2a018c['id']))this['currentDisplayedUsers']['remove'](_0x2a018c['id']);else{if(_0x3cfd3a&&this['currentDisplayedUsers']['length']+0x1===_0x33f7ad-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x3cfd3a?0x1:0x0)<this['usersCount']){for(const _0x35a1d3 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x35a1d3['id'])&&(this['currentDisplayedUsers']['add'](_0x35a1d3,Math['min'](this['currentDisplayedUsers']['length']-(_0x3cfd3a?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x3cfd3a?0x1:0x0)===_0x33f7ad-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x34f71a=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new Ct(this['context']['locale'],!!_0x34f71a['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x44721d}=this['presenceDropdownView'];_0x44721d['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x46c332=>{if(!_0x34f71a['displayMe']&&_0x46c332['isMe'])return null;const _0x870fbe=new At(this['context']['locale'],_0x46c332,!!_0x34f71a['onClick']);return _0x34f71a['onClick']&&this['listenTo'](_0x870fbe,'execute',()=>{_0x34f71a['onClick'](_0x46c332,_0x870fbe['element']);}),_0x870fbe;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']);const _0x10bc91=_0x47e65b['generatePositions']({'heightOffset':0x3,'config':{'withArrow':!0x1}});this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element'],'positions':[_0x10bc91['southArrowNorth'],_0x10bc91['southArrowNorthMiddleWest'],_0x10bc91['southArrowNorthMiddleEast'],_0x10bc91['southArrowNorthWest'],_0x10bc91['southArrowNorthEast'],_0x10bc91['northArrowSouth'],_0x10bc91['northArrowSouthMiddleWest'],_0x10bc91['northArrowSouthMiddleEast'],_0x10bc91['northArrowSouthWest'],_0x10bc91['northArrowSouthEast'],_0x10bc91['viewportStickyNorth']]}),_0x44721d['focus'](),_0x44721d['checkIfScrollable']();const _0x4b9f4d=(_0x23e6c9,_0x4178a1)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x4178a1();};_0x44721d['keystrokes']['set']('Esc',_0x4b9f4d),_0x44721d['keystrokes']['set']('Shift+Tab',_0x4b9f4d),_0x44721d['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0x44721d['focusTracker']['add'](this['view']['element']),_0x44721d['focusTracker']['on']('change:isFocused',(_0xc806a1,_0x254f01,_0x807886)=>{_0x807886||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);}_hideDropdownUnlessPointerInside(_0x4b354e){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x23a6d5=>_0x595b6c(_0x23a6d5,_0x4b354e))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},Nt=class extends _0x577128{static get requires(){return[J,xt];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{lt as CloudServicesCommentsAdapter,_t as CloudServicesRevisionHistoryAdapter,mt as CloudServicesTrackChangesAdapter,Nt as PresenceList,xt as PresenceListUI,it as RealTimeCollaborationClient,wt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,bt as RealTimeCollaborativeRevisionHistory,vt as RealTimeCollaborativeTrackChanges,at as RealTimeContentFetcher,J as Sessions,K as WebSocketGateway};