@ckeditor/ckeditor5-real-time-collaboration 46.0.1-alpha.12 → 46.0.1-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0xa0a9ec,Plugin as _0x4edcf1,PendingActions as _0x46588f,Context as _0x167299}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x340059,CKEditorError as _0x21fa12,Collection as _0x2c863a,global as _0x274993,version as nt,uid as _0xa6257d,KeystrokeHandler as _0x4c3498}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3cff3d,View as _0x50a2fd,ListView as _0x47392b,ListItemView as et,LabelView as it,BalloonPanelView as _0x5b36ff,clickOutsideHandler as _0x2723a3,BodyCollection as _0x5a4715}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x9f50e9,History as _0x191b51,NoOperation as _0x1217d9,InsertOperation as _0x5d5652,MarkerOperation as _0x2c727b,RootAttributeOperation as _0x208e95,transformOperationSets as _0x45e26d,OperationFactory as _0x88c11e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x25a895,CollaborativeEditingService as _0x467e77,User as ct,CommentsService as _0x360dc4,TrackChangesService as tt,RevisionHistoryService as _0x3326f7,EditorService as _0x5a159d}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x5926ab,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x3e0e91}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1e73ad}from'es-toolkit/compat';class n extends _0xa0a9ec{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3cff3d];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1d16de){super(_0x1d16de),this['set']('state',_0x25a895['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x340059())();}['init'](){const _0x2b6f9b=this['context'],_0x4acdda=_0x2b6f9b['plugins']['get']('CloudServices'),_0x5a5faf=_0x2b6f9b['plugins']['get'](_0x3cff3d);if(!_0x4acdda['token'])throw new _0x21fa12('websocketgateway-missing-token',this);if(!_0x4acdda['webSocketUrl'])throw new _0x21fa12('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),n['WebSocketGateway']['connect'](_0x4acdda['token'],_0x4acdda['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x331ac4=>{if(this['connection']=_0x331ac4,this['bind']('state')['to'](_0x331ac4,'state',this,'_isBrowserOffline',(_0x3f46e6,_0x499eda)=>('connected'!==_0x3f46e6&&(this['_shouldPluginsReconnect']=!0x0),_0x499eda||_0x3f46e6!==_0x25a895['CONNECTED']?_0x25a895['DISCONNECTED']:this['state']==_0x25a895['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x25a895['CONNECTING']):_0x25a895['CONNECTED'])),this['connection']['on']('error',(_0x4d07e0,_0xcbb12b)=>{if('limitExceeded'!==_0xcbb12b['code'])throw console['error'](_0xcbb12b),new _0x21fa12('cloudservices-init',null,{'originalError':_0xcbb12b});_0x5a5faf['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'});}),!_0x331ac4['me'])return new Promise(_0x4c7a73=>_0x331ac4['on']('change:me',_0x4c7a73));})['catch'](_0x999689=>{throw console['error'](_0x999689),new _0x21fa12('cloudservices-init',null,{'originalError':_0x999689});});}['addToReconnectionStack'](_0x1ab457){if('function'!=typeof _0x1ab457['reconnect'])throw new _0x21fa12('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1ab457))throw new _0x21fa12('websocketgateway-plugin-already-registered',this,{'name':_0x1ab457['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1ab457);}['removeFromReconnectionStack'](_0x26249e){this['_reconnectionStack']['delete'](_0x26249e);}['isInReconnectionStack'](_0xba818c){return this['_reconnectionStack']['has'](_0xba818c);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x4a7366=>_0x4a7366['reconnect']())))['then'](()=>this['state']=_0x25a895['CONNECTED'])['catch'](_0x8f1586=>{throw console['error'](_0x8f1586),new _0x21fa12('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x25a895['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0xa0a9ec{['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[n,_0x5926ab];}constructor(_0x7db9dd){super(_0x7db9dd),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2c863a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5926ab);}['init'](){const _0x27243f=this['context']['plugins']['get'](n);this['listenTo'](_0x27243f,'change:state',(_0x2c71e7,_0x592bb9,_0x2df524)=>{if('connected'!==_0x2df524)this['channelSessions']['forEach'](_0x24873d=>_0x24873d['clear']()),this['channelConnectedUsers']['forEach'](_0xaf5617=>_0xaf5617['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x42061d,_0x291a76]of this['_registeredSessions'])for(const _0x48f048 of _0x291a76)this['_handleSessionAdd'](_0x42061d,_0x48f048);}}),this['_createUser'](_0x27243f['connection']['me'],!0x0);}['register'](_0x54ca66,_0x1c7271){if(this['_registeredSessions']['has'](_0x54ca66))throw new _0x21fa12('sessions-register-already-registered',null,{'channelId':_0x54ca66});this['_registeredSessions']['set'](_0x54ca66,_0x1c7271),this['channelSessions']['set'](_0x54ca66,new _0x2c863a()),this['channelConnectedUsers']['set'](_0x54ca66,new _0x2c863a()),this['listenTo'](_0x1c7271,'add',(_0x32a6d8,_0x257ae9)=>this['_handleSessionAdd'](_0x54ca66,_0x257ae9)),this['listenTo'](_0x1c7271,'remove',(_0x17b8e0,_0x4103a3)=>this['_handleSessionRemove'](_0x54ca66,_0x4103a3));for(const _0x321115 of _0x1c7271)this['_handleSessionAdd'](_0x54ca66,_0x321115);}['unregister'](_0x2b17f0){if(!this['_registeredSessions']['has'](_0x2b17f0))throw new _0x21fa12('sessions-unregister-not-exist',null,{'channelId':_0x2b17f0});const _0x7146be=this['_registeredSessions']['get'](_0x2b17f0);this['stopListening'](_0x7146be);for(const _0x5d37a1 of _0x7146be)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x2b17f0,_0x5d37a1);this['_registeredSessions']['delete'](_0x2b17f0),this['channelSessions']['delete'](_0x2b17f0),this['channelConnectedUsers']['delete'](_0x2b17f0);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x4d56c6){for(const _0x22eb35 of this['channelSessions']['values']())for(const _0x1dc6a8 of _0x22eb35)if(_0x1dc6a8['id']===_0x4d56c6)return _0x1dc6a8['user'];}['getUserSessions'](_0x140fa8,_0x104a24){const _0xabdd02=_0x104a24?[this['channelSessions']['get'](_0x104a24)]:this['channelSessions']['values'](),_0x4ecd4c=new Set();for(const _0x203ffe of _0xabdd02)for(const _0x3d3d8d of _0x203ffe)_0x3d3d8d['user']['id']===_0x140fa8['id']&&_0x4ecd4c['add'](_0x3d3d8d['id']);return _0x4ecd4c;}['getUserRole'](_0xc15853){for(const _0x3032f5 of this['channelSessions']['values']())for(const _0x36728a of _0x3032f5)if(_0x36728a['user']===_0xc15853)return _0x36728a['role'];}['_handleSessionAdd'](_0x35cecd,_0x26889a){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1fa627=_0x26889a['user'],_0x21b5eb=this['_users']['getUser'](_0x1fa627['id'])||this['_createUser'](_0x1fa627),_0x4b4f92=Object['assign']({},_0x26889a,{'user':_0x21b5eb});this['channelSessions']['get'](_0x35cecd)['add'](_0x4b4f92);const _0x574d99=this['channelConnectedUsers']['get'](_0x35cecd);_0x574d99['has'](_0x21b5eb['id'])||_0x574d99['add'](_0x21b5eb),this['allConnectedUsers']['has'](_0x21b5eb['id'])||this['allConnectedUsers']['add'](_0x21b5eb,_0x21b5eb['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x35cecd,{'channelId':_0x35cecd,'session':_0x4b4f92});}['_handleSessionRemove'](_0x1049d9,_0x328cc9){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x11c14b=this['channelConnectedUsers']['get'](_0x1049d9),_0x5df6c4=_0x328cc9['user'];_0x5df6c4['id']&&(this['channelSessions']['get'](_0x1049d9)['remove'](_0x328cc9['id']),_0x11c14b['has'](_0x5df6c4['id'])&&!this['getUserSessions'](_0x5df6c4,_0x1049d9)['size']&&_0x11c14b['remove'](_0x5df6c4['id']),this['allConnectedUsers']['get'](_0x5df6c4['id'])&&!this['getUserSessions'](_0x5df6c4)['size']&&this['allConnectedUsers']['remove'](_0x5df6c4['id']));}['_createUser'](_0x3888b2,_0x5a97f){const _0x181585=this['_users']['addUser'](_0x3888b2);return _0x5a97f&&this['_users']['defineMe'](_0x3888b2['id']),_0x181585['orderNumber']=this['_uniqueUsersCount']++,_0x181585;}}class G extends _0x4edcf1{['_domEmitter']=new(_0x340059())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x23de68=this['editor'],_0x5d01bc=_0x23de68['plugins']['get'](i);_0x23de68['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5e3ee6,{writer:_0x49c7ab})=>function(_0x2d0c35,_0x2b9408,_0x5cd877,_0x58f353){const _0x35b545=_0x2d0c35['markerName']['split'](':')[0x2],_0x5403dd=_0x5cd877['getUserBySessionId'](_0x35b545);if(!_0x5403dd||_0x35b545===_0x5cd877['mySessionId'])return;if(!_0x58f353['model']['schema']['checkChild'](_0x2d0c35['markerRange']['start'],'$text'))return;const _0x4bb384={'class':'ck-user__marker\x20'+_0x5403dd['color']['getMarkerClass'](),'data-name':_0x5403dd['name'],'data-session-id':_0x35b545},_0x46316d=_0x58f353['model']['markers']['get'](_0x2d0c35['markerName']),_0x108b14=_0x46316d['getStart'](),_0x3e3166=_0x108b14['nodeAfter'],_0x9f6705=_0x58f353['model']['schema'];if(_0x3e3166&&_0x9f6705['isObject'](_0x3e3166)&&_0x9f6705['isInline'](_0x3e3166)&&!_0x58f353['model']['markers']['get']('user:range:'+_0x35b545)['getRange']()['isCollapsed'])return;const _0x5cc7d4=_0x108b14['parent'];return _0x58f353['model']['schema']['isLimit'](_0x5cc7d4)&&!_0x58f353['model']['hasContent'](_0x5cc7d4)&&(_0x4bb384['contenteditable']=!0x1),function(_0x161b4c,_0x5328ab,_0x54cb95){const _0x319c37=_0x161b4c['createUIElement']('span',_0x5328ab);return _0x161b4c['setCustomProperty']('userPositionMarker',!0x0,_0x319c37),_0x319c37['render']=function(_0x4ff178){const _0x5a304c=this['toDomElement'](_0x4ff178),_0x53062d=document['createElement']('span');return _0x53062d['classList']['add']('ck-user__marker-tooltip'),_0x53062d['setAttribute']('contenteditable','false'),_0x53062d['setAttribute']('spellcheck','false'),_0x53062d['textContent']=_0x54cb95['name'],_0x5a304c['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x53062d['outerHTML']+'⁠',_0x5a304c['addEventListener']('mouseenter',()=>{_0x5a304c['classList']['add']('ck-user__marker_hovered');}),_0x5a304c['addEventListener']('mouseleave',()=>{_0x5a304c['classList']['remove']('ck-user__marker_hovered');}),_0x5a304c;},_0x319c37['isSimilar']=function(_0x4ab081){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4ab081['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4ab081['getAttribute']('data-session-id'));},_0x319c37;}(_0x2b9408,_0x4bb384,_0x5403dd);}(_0x5e3ee6,_0x49c7ab,_0x5d01bc,_0x23de68)}),_0x23de68['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x8075c3=>function(_0x3da46c,_0x41c612){const _0x38aaa7=_0x3da46c['markerName']['split'](':')[0x2];if(_0x38aaa7===_0x41c612['mySessionId'])return null;const _0x27e717=_0x41c612['getUserBySessionId'](_0x38aaa7);if(!_0x27e717)return{'id':_0x38aaa7,'classes':[]};return{'id':_0x38aaa7,'classes':['ck-user__selection',_0x27e717['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x38aaa7},'priority':0x7d0+_0x27e717['orderNumber']};}(_0x8075c3,_0x5d01bc)}),function(_0x34ebca){const _0x1d3eca=_0x34ebca['model'],_0x190dff=new Map(),_0x3e017d=_0x34ebca['plugins']['get'](i);_0x1d3eca['markers']['on']('update:user:range',(_0x7b7243,_0x56bc38,_0x330a99,_0x4ba947)=>{if(!_0x4ba947&&_0x190dff['get'](_0x56bc38['name']))return _0x190dff['get'](_0x56bc38['name'])['detach'](),void _0x190dff['delete'](_0x56bc38['name']);const _0x790dc7=_0x56bc38['name']['split'](':')[0x2];if(_0x790dc7===_0x3e017d['mySessionId'])return;const _0x42910e='user:position:'+_0x790dc7;_0x1d3eca['markers']['has'](_0x42910e)&&_0x34ebca['editing']['reconvertMarker'](_0x42910e),_0x56bc38['on']('change:range',(_0x2a98c9,_0x30486d,_0xf7d200)=>{if('$graveyard'!=_0x30486d['root']['rootName']&&'$graveyard'==_0x56bc38['getRange']()['root']['rootName']&&!_0x190dff['has'](_0x56bc38['name'])){const _0x695f9c=_0x1d3eca['schema']['getNearestSelectionRange'](_0xf7d200['deletionPosition']);if(_0x695f9c){const _0x3e0d01=_0x9f50e9['fromRange'](_0x695f9c);_0x190dff['set'](_0x56bc38['name'],_0x3e0d01),_0x3e0d01['on']('change:range',(_0x51af86,_0x25adb5,_0x4fa6d5)=>{if('$graveyard'==_0x3e0d01['root']['rootName']){const _0x56001e=_0x1d3eca['schema']['getNearestSelectionRange'](_0x4fa6d5['deletionPosition']);_0x56001e?(_0x3e0d01['start']=_0x56001e['start'],_0x3e0d01['end']=_0x56001e['end']):(_0x190dff['delete'](_0x56bc38['name']),_0x3e0d01['detach']());}});}}});}),_0x1d3eca['document']['on']('change',()=>{_0x190dff['size']>0x0&&_0x1d3eca['enqueueChange']({'isUndoable':!0x1},_0x1ee2f3=>{for(const [_0x12fa29,_0x319845]of _0x190dff)'$graveyard'==_0x1d3eca['markers']['get'](_0x12fa29)['getRange']()['root']['rootName']&&(te(_0x12fa29['split'](':')[0x2],_0x319845['toRange'](),_0x1d3eca,_0x1ee2f3),_0x319845['detach']());_0x190dff['clear']();});});}(_0x23de68),this['_domEmitter']['listenTo'](_0x274993['document'],'keydown',(_0x1206e9,{key:_0x462bb6})=>{'Escape'===_0x462bb6&&function(_0x5a4cee){_0x5a4cee['editing']['view']['change'](_0x52df26=>{for(const _0x2d605d of _0x5a4cee['model']['markers']){if(!_0x2d605d['name']['startsWith']('user:position'))continue;const _0x269615=_0x5a4cee['editing']['mapper']['markerNameToElements'](_0x2d605d['name']);if(_0x269615){for(const _0xf37cf7 of _0x269615)_0x52df26['removeClass']('ck-user__marker_hovered',_0xf37cf7);}}});}(_0x23de68);},{'useCapture':!0x0});}['afterInit'](){const _0x37462c=this['editor'],_0x349e03=_0x37462c['commands']['get']('undo');_0x349e03&&_0x37462c['model']['on']('applyOperation',(_0x1ad36e,_0x1a1079)=>{const _0x1a1be5=_0x1a1079[0x0];if(!_0x1a1be5['isDocumentOperation'])return;if('marker'!=_0x1a1be5['type']||!_0x1a1be5['name']['startsWith']('user:'))return;const _0x3f9871=_0x1a1be5['batch'];_0x349e03['_createdBatches']['has'](_0x3f9871)&&(_0x1a1be5['newRange']=_0x1a1be5['oldRange']?_0x37462c['model']['createRange'](_0x1a1be5['oldRange']['start'],_0x1a1be5['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x271192=this['editor'],_0x205b1c=_0x271192['model']['document'],_0x4e10a7=_0x271192['plugins']['get'](i);_0x271192['model']['enqueueChange']({'isUndoable':!0x1},_0x41015b=>{const _0x5b0dc5='user:range:'+_0x4e10a7['mySessionId'],_0x354566='user:position:'+_0x4e10a7['mySessionId'],_0x1d5563=_0x271192['model']['markers']['has'](_0x5b0dc5);_0x271192['editing']['view']['hasDomSelection']?te(_0x4e10a7['mySessionId'],_0x205b1c['selection']['getFirstRange'](),_0x271192['model'],_0x41015b):_0x1d5563&&(_0x41015b['removeMarker'](_0x5b0dc5),_0x41015b['removeMarker'](_0x354566));});}}function te(_0x593889,_0x371bf9,_0x5e3163,_0xdeb702){const _0x4aa15c='user:range:'+_0x593889,_0x4c58ba='user:position:'+_0x593889,_0x2f769e=_0x371bf9['getContainedElement']();let _0x3ae629=_0x371bf9['start'];if(_0x2f769e&&_0x2f769e['is']('element','tableCell')){const _0x3d48e1=function(_0x1db97e,_0x2a0b72){for(const _0xef80d0 of _0x1db97e['getPositions']())if(_0x2a0b72['schema']['checkChild'](_0xef80d0,'$text'))return _0xef80d0;}(_0x371bf9,_0x5e3163);_0x3d48e1&&(_0x3ae629=_0x3d48e1,_0x371bf9=_0xdeb702['createRange'](_0x3ae629));}const _0x2ec0ff=_0xdeb702['createRange'](_0x3ae629);_0x5e3163['markers']['has'](_0x4aa15c)?(_0xdeb702['updateMarker'](_0x4aa15c,{'range':_0x371bf9}),_0xdeb702['updateMarker'](_0x4c58ba,{'range':_0x2ec0ff})):(_0xdeb702['addMarker'](_0x4aa15c,{'range':_0x371bf9,'usingOperation':!0x0}),_0xdeb702['addMarker'](_0x4c58ba,{'range':_0x2ec0ff,'usingOperation':!0x0}));}function $(_0x45f15c,_0x2b2b6c,_0x1c84a4){const _0x5a61ac=_0x45f15c['t'],t=_0x45f15c['t'];switch(_0x2b2b6c){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 _0x5a61ac({'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'},_0x1c84a4);default:return'';}}let Q=0x1;class l extends _0x4edcf1{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x467e77)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x46588f,_0x5926ab,_0x3cff3d];}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 _0x4aadf0=this['serverHistory']['getOperations']();for(let _0x34497d=_0x4aadf0['length']-0x1;_0x34497d>=0x0;_0x34497d--){const _0x44229c=_0x4aadf0[_0x34497d];if(!this['_disconnectionOperations']['has'](_0x44229c))return _0x44229c['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x51c6af){if(super(_0x51c6af),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x191b51(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x21fa12('collaboration-missing-channelid',this);const _0x3f78f6=_0x51c6af['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x3f78f6,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x3e0e91(),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 Z(this['_disconnectionOperations']);}['init'](){const _0xdcb5d5=this['editor'],_0x39ffac=_0xdcb5d5['plugins']['get'](_0x5926ab),_0x3a73aa=_0xdcb5d5['plugins']['get'](n);this['listenTo'](_0x39ffac,'getOperationAuthor',(_0x5ef5bc,_0x3cf6ef)=>{const _0x4a8709=_0x3cf6ef[0x0];_0x4a8709['_authorId']&&(_0x5ef5bc['return']=_0x39ffac['getUser'](_0x4a8709['_authorId']),_0x5ef5bc['stop']()),null===_0x4a8709['_authorId']&&(_0x5ef5bc['return']=null,_0x5ef5bc['stop']());},{'priority':'high'}),this['listenTo'](_0xdcb5d5['model']['document']['selection'],'change:range',(_0x2c0a59,_0x5c62bf)=>{_0x5c62bf['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xdcb5d5['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xdcb5d5['model']['on']('applyOperation',(_0x598981,_0x191750)=>{const _0x1213d6=_0x191750[0x0];_0x1213d6['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1213d6),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x3a73aa,'state',this,'_hasSynchronizationProblem',(_0x4bbfc8,_0x45efcd)=>'connected'===_0x4bbfc8&&!_0x45efcd),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xdcb5d5['disableReadOnlyMode']('rtc-offline'):_0xdcb5d5['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xdcb5d5['disableReadOnlyMode']('rtc-offline'):_0xdcb5d5['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x2a9ad1=this['editor']['plugins']['get'](i),_0x1aa730=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x2a9ad1['unregister'](this['_channelId']);const _0x31dde7=await this['_service']['reconnect'](_0x1aa730['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x31dde7)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x560f10=await this['_service']['getConnectedSessions']();_0x2a9ad1['register'](this['_channelId'],_0x560f10),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x263654){if(function(_0x561cf1){return'404'===_0x561cf1['code'];}(_0x263654)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x46b8fb){return'409'===_0x46b8fb['code'];}(_0x263654)){const _0x16d85f=$(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'](_0x16d85f);}else{if(!(_0x263654 instanceof X))throw _0x263654;this['_handleReconnectionError']();}}}}['destroy'](){const _0x80bfaa=this['editor']['plugins']['get'](n),_0x366c26=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x366c26['channelSessions']['has'](this['_channelId'])&&_0x366c26['unregister'](this['_channelId']),_0x80bfaa['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x356e11){if(this['sessionId']!==_0x356e11['sessionId']&&this['_lastSyncedOperationId']!==_0x356e11['lastOperationId'])throw new X();return this['sessionId']=_0x356e11['sessionId'],this['_handleServerResponse']([],{..._0x356e11,'wereChangesApplied':!0x1,'data':_0x356e11['data']},'reconnect');}async['_connectService'](_0x202251,_0x23a351=!0x1){const {connection:_0x515861}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x515861,this['_channelId'])['then'](_0x4a7809=>this['_initSessionsHandling'](_0x4a7809))['catch'](_0x30938f=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x30938f);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x262909,_0x1781b5)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1781b5);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x4ffb07=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x202251);this['_isPendingUpdate']=!0x0;const _0xa45ed9=await this['_service']['connect'](_0x515861,this['_compressOperations'](_0x202251),_0x4ffb07);if(this['sessionId']=_0xa45ed9['sessionId'],_0x23a351){if(!_0xa45ed9['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xa45ed9['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x202251,_0xa45ed9,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xa45ed9,_0x202251);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3d720e=this['editor']['plugins']['get'](i),_0x23930b=this['editor']['plugins']['get'](G),_0x3e87f3=_0x3d720e['channelSessions']['get'](this['_channelId']);_0x3e87f3&&_0x3e87f3['length']>0x1?_0x23930b['createUserMarkerOperations']():this['listenTo'](_0x3d720e,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3d720e['channelSessions']['get'](this['_channelId'])['length']&&_0x23930b['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x1ae2e4,_0x2d6104,_0x318568,_0x218ef5){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2d6104){const _0x41c530=this['_decompressOperations'](_0x318568,_0x218ef5);await this['_fetchMissingUsers'](_0x41c530),this['_handleExternalOperations'](_0x41c530,_0x2d6104,_0x318568['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x269dae}=this['editor'];let _0x508efe;try{_0x508efe=await this['_service']['getDocumentDetails']();}catch{const _0x4776eb=$(_0x269dae,'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'](_0x4776eb);}const _0x4f6867=_0x508efe['currentDocumentSession']||_0x508efe['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x4f6867['lastOperationId']){const _0x13682d=$(_0x269dae,'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'](_0x13682d);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x3d8939){const _0x3882ce=this['editor']['plugins']['get'](i);this['listenTo'](_0x3882ce,'sessionAdd:'+this['_channelId'],(_0x34e451,{session:_0x55d8b7})=>{if(_0x55d8b7['id']===_0x3882ce['mySessionId']){_0x34e451['off']();const _0x39d406=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x324d33=_0x55d8b7['permissions'];_0x39d406&&_0x39d406['isEnabled']&&(_0x324d33=_0x324d33['filter'](_0x41607f=>'document:write'!==_0x41607f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x324d33,this['_channelId']);}}),_0x3882ce['register'](this['_channelId'],_0x3d8939);}['_initThrowingOnDataSet'](){const _0x14b612=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5951bf)=>{if(!_0x5951bf[_0x5951bf['length']-0x1]['suppressErrorInCollaboration'])throw new _0x21fa12('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x14b612['apply'](this['editor']['data'],_0x5951bf);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x543437,[_0x4b9788])=>{if(this['_document']['version'])throw new _0x21fa12('realtimecollaborationclient-init-document-already-initialized',this);_0x543437['stop'](),this['_setPendingAction']();const _0x5f5c8a=this['editor']['config']['get']('rootsAttributes'),_0x4d810f=this['_getOperationsFromInitData'](_0x4b9788,_0x5f5c8a);0x0==_0x4d810f['length']&&_0x4d810f['push'](new _0x1217d9(0x0)),_0x543437['return']=this['_connectService'](_0x4d810f)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x125e5e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x125e5e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x358638,[_0x498b42,_0x3ffbdf])=>{_0x358638['stop']();const _0x516e9d=this['editor']['model']['document']['getRoot'](_0x498b42);if(!this['_knownRootNames']['has'](_0x498b42)){const _0x260d1f=_0x3ffbdf&&_0x3ffbdf['data']?_0x3ffbdf['data']:'',_0x87af5f=_0x3ffbdf&&_0x3ffbdf['attributes']?_0x3ffbdf['attributes']:{};await this['_loadRoot'](_0x498b42,_0x260d1f,_0x87af5f);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x516e9d['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x516e9d);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x4e4f2d){const _0x3fac01=this['editor']['plugins']['get'](_0x5926ab),{connection:_0x9a6e3d}=this['editor']['plugins']['get'](n),_0x378e10=new Set();for(const _0x3f505c of _0x4e4f2d){const _0x3e12ac=_0x3f505c['_authorId'];_0x3e12ac&&!_0x3fac01['getUser'](_0x3e12ac)&&_0x378e10['add'](_0x3e12ac);}if(0x0===_0x378e10['size'])return;const _0x28da9b=await ct['getMany'](_0x9a6e3d,Array['from'](_0x378e10));for(const _0x206e11 of _0x28da9b)_0x3fac01['getUser'](_0x206e11['id'])||_0x3fac01['addUser'](_0x206e11);}['_getOperationsFromInitData'](_0x433c2c,_0x24398e={}){const _0x1ce4ee=this['editor']['model'],_0x2aa11e=[];let _0x179dce=0x0;const _0x32ae1e='string'==typeof _0x433c2c?{'main':_0x433c2c}:_0x433c2c;for(const _0x3adf78 of Object['keys'](_0x32ae1e)){if(!this['_document']['roots']['has'](_0x3adf78))throw new _0x21fa12('realtimecollaborationclient-init-non-existent-root',this);const _0x57e157=this['editor']['data']['parse'](_0x32ae1e[_0x3adf78]),_0x4fecda=this['_document']['getRoot'](_0x3adf78),_0x1d309f=new _0x5d5652(_0x1ce4ee['createPositionAt'](_0x4fecda,0x0),_0x57e157,_0x179dce++);_0x2aa11e['push'](_0x1d309f);for(const [_0xe0c73e,_0x4a9f9d]of _0x57e157['markers']){const _0x408e54=_0x1ce4ee['createRange'](_0x1ce4ee['createPositionFromPath'](_0x4fecda,_0x4a9f9d['start']['path']['slice']()),_0x1ce4ee['createPositionFromPath'](_0x4fecda,_0x4a9f9d['end']['path']['slice']())),_0x3cc672=new _0x2c727b(_0xe0c73e,null,_0x408e54,_0x1ce4ee['markers'],!0x0,_0x179dce++);_0x2aa11e['push'](_0x3cc672);}}if(_0x24398e)for(const [_0x30cc16,_0x18f557]of Object['entries'](_0x24398e)){const _0x5985c5=_0x1ce4ee['document']['getRoot'](_0x30cc16);if(!_0x5985c5)throw new _0x21fa12('multi-root-editor-root-attributes-no-root',null);for(const [_0x4d24c6,_0x32b4cf]of Object['entries'](_0x18f557))if(null!==_0x32b4cf){const _0x4f552d=new _0x208e95(_0x5985c5,_0x4d24c6,null,_0x32b4cf,_0x179dce++);_0x2aa11e['push'](_0x4f552d);}}return _0x2aa11e;}async['_loadRoot'](_0x3b1a97,_0x3d1946,_0x47285f){this['_getOperationsFromInitData']({[_0x3b1a97]:_0x3d1946},{[_0x3b1a97]:_0x47285f})['forEach']((_0x22b447,_0x1d9d3b)=>{_0x22b447['baseVersion']=this['_document']['version']+_0x1d9d3b,_0x22b447['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x22b447);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5162ce,_0x3b745e){let _0x26154c;this['_offset']=_0x5162ce['offset'];const _0x8e1d45=_0x5162ce['wereChangesApplied']&&!_0x5162ce['initData'],_0x2b31e4=_0x8e1d45?0x0:_0x5162ce['data']['baseVersion'];if(_0x3b745e['forEach'](_0x36230e=>{_0x36230e['_isInit']=!0x0,_0x36230e['createdAt']=_0x5162ce['sessionCreatedAt'],_0x36230e['_authorId']=null;}),_0x8e1d45)_0x26154c=_0x3b745e,this['_applyOperationsSet'](_0x26154c,_0x8e1d45);else{if(_0x5162ce['initData']){const _0x1e8298=this['_getOperationsFromInitData'](_0x5162ce['initData']);this['_document']['history']['version']=-_0x1e8298['length'],_0x1e8298['forEach'](_0x397585=>{_0x397585['baseVersion']-=_0x1e8298['length'],_0x397585['createdAt']=_0x5162ce['sessionCreatedAt'],_0x397585['_isInit']=!0x0,_0x397585['_authorId']=null;}),this['_applyOperationsSet'](_0x1e8298,!0x0),this['serverHistory']['version']=-_0x1e8298['length']+this['_offset'],this['_updateServerHistory'](_0x1e8298);}this['_document']['history']['version']=_0x2b31e4,_0x26154c=this['_decompressOperations'](_0x5162ce['data'],_0x5162ce['metadata']),await this['_fetchMissingUsers'](_0x26154c),this['_applyOperationsSet'](_0x26154c,_0x8e1d45);}_0x5162ce['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x26154c,_0x5162ce['lastOperationId']),this['_lastSyncedOperationId']=_0x5162ce['lastOperationId']),this['serverHistory']['version']=_0x2b31e4+this['_offset'],this['_updateServerHistory'](_0x26154c),_0x3b745e['filter'](_0x3be17e=>{const _0x95848=this['_getAffectedRoot'](_0x3be17e);return _0x95848&&!this['_knownRootNames']['has'](_0x95848);})['forEach']((_0x32a915,_0x4b02c9)=>{_0x32a915['baseVersion']=this['_document']['version']+_0x4b02c9,this['_saveOperationInBuffer'](_0x32a915);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x3f3dc6,_0x5e58ce){const _0x5dc70b=_0x5e58ce&&_0x5e58ce['message'];if(_0x5dc70b&&_0x5dc70b['startsWith']('realtimecollaborationclient'))throw _0x5e58ce;const _0x30f035=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x30f035['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x21fa12(_0x3f3dc6,this['editor'],_0x5dc70b?{'originalError':_0x5dc70b}:void 0x0);}['_saveOperationInBuffer'](_0x563524){this['_knownOperations']['has'](_0x563524)||(this['_knownOperations']['add'](_0x563524),this['_bufferedOperations']['push'](_0x563524),this['_pendingAction']||'marker'==_0x563524['type']&&!_0x563524['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0xfe1ff4=!0x1){!_0xfe1ff4&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x1a6236=>{_0x1a6236&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x4902bc=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5e6f1e){return _0x5e6f1e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5e6f1e['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5e6f1e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x4902bc)||this['_crash'](_0x4902bc['message'],_0x4902bc);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2bd1ac=>{this['on']('change:_isPendingUpdate',()=>{_0x2bd1ac();});});}async['_sendBufferedOperations'](){const _0x42120d=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x42120d['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x42ce7e=[...this['_bufferedOperations']];for(const _0x285df4 of _0x42ce7e)_0x285df4['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x285df4);const _0x510565=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x42ce7e),_0x13ad76=Q++,_0x3eef7a=this['_compressOperations'](_0x42ce7e),_0x3c67d1=await this['_service']['sendOperations'](_0x3eef7a,_0x3eef7a['baseVersion'],_0x510565);try{return await this['_handleServerResponse'](_0x42ce7e,_0x3c67d1,_0x13ad76);}catch(_0x30ef13){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x30ef13);}}async['_handleServerResponse'](_0x2f55a6,_0x2c6a2a,_0x3cabbe){if('error'in _0x2c6a2a)throw _0x2c6a2a['error'];let _0x39fa57=!0x1;if(_0x2c6a2a['wereChangesApplied']){_0x2c6a2a['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2c6a2a['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5abb66=>!_0x2f55a6['includes'](_0x5abb66));for(const _0x61aec9 of _0x2f55a6)_0x61aec9['createdAt']='lastOperationAcceptedAt'in _0x2c6a2a&&_0x2c6a2a['lastOperationAcceptedAt']||void 0x0;Y(_0x2f55a6,_0x2c6a2a['version']-_0x2f55a6['length']),this['_updateServerHistory'](_0x2f55a6);const _0x45b5f4=_0x2f55a6['filter'](_0x10b5ce=>{if(!_0x10b5ce['_isInit'])return!0x1;const _0x1710fd=this['_getAffectedRoot'](_0x10b5ce);return _0x1710fd&&!this['_knownRootNames']['has'](_0x1710fd);});Y(_0x45b5f4,this['_document']['version']),this['_applyOperationsSet'](_0x45b5f4),_0x39fa57=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x145f37=this['_decompressOperations'](_0x2c6a2a['data'],_0x2c6a2a['metadata'])['filter'](_0x4e4b00=>_0x4e4b00['baseVersion']>=this['_lastServerVersion']);_0x145f37['forEach'](_0x678e89=>this['_addKnownRoot'](_0x678e89)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5af37d=>!_0x5af37d['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5af37d))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x145f37),_0x39fa57=this['_handleExternalOperations'](_0x145f37,_0x2c6a2a['version'],_0x2c6a2a['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x39fa57?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0xfce28d,_0x5e333f,_0x39ff76){try{const _0x59fa73={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5cab42,operationsB:_0x164a67,originalOperations:_0x57d1a0}=_0x45e26d(_0xfce28d,this['_bufferedOperations'],_0x59fa73);Y(_0x5cab42,this['_document']['version']),Y(_0x164a67,_0x5e333f);for(const _0x19056d of _0x5cab42){const _0xd6b31f=_0x57d1a0['get'](_0x19056d);_0x19056d['_authorId']=_0xd6b31f?_0xd6b31f['_authorId']:null;}_0x39ff76&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xfce28d,_0x39ff76),this['_lastSyncedOperationId']=_0x39ff76),this['_bufferedOperations']=[..._0x164a67],this['_applyOperationsSet'](_0x5cab42),this['_updateServerHistory'](_0xfce28d);}catch(_0x33c731){return console['error'](_0x33c731),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3116b8,_0x31668e=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5b476f=>{for(const _0x2fa748 of _0x3116b8)this['_knownOperations']['add'](_0x2fa748),this['_addKnownRoot'](_0x2fa748),_0x5b476f['batch']['addOperation'](_0x2fa748),this['editor']['model']['applyOperation'](_0x2fa748);});}['_addKnownRoot'](_0x1ad852){const _0x28cfa6=this['_getAffectedRoot'](_0x1ad852);_0x28cfa6&&this['_knownRootNames']['add'](_0x28cfa6);}['_getAffectedRoot'](_0x1b2bb7){let _0x5c1fff,_0x154a53;switch(_0x1b2bb7['type']){case'insert':_0x5c1fff=_0x1b2bb7['position']['root'];break;case'marker':if(_0x154a53=_0x1b2bb7['newRange'],!_0x154a53)return null;_0x5c1fff=_0x154a53['root'];break;case'addRootAttribute':_0x5c1fff=_0x1b2bb7['root'];break;case'addRoot':_0x5c1fff=_0x1b2bb7['affectedSelectable'];break;case'move':_0x5c1fff=_0x1b2bb7['targetPosition']['root'];break;default:return null;}return _0x5c1fff['rootName'];}['_updateServerHistory'](_0x843378){_0x843378['forEach'](_0x25ce82=>{const _0x41ef22=_0x25ce82['clone']();_0x41ef22['_authorId']=_0x25ce82['_authorId'],_0x41ef22['_isInit']=!!_0x25ce82['_isInit'],_0x41ef22['createdAt']=_0x25ce82['createdAt'],_0x41ef22['baseVersion']+=this['_offset'],_0x25ce82['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x41ef22),this['serverHistory']['addOperation'](_0x41ef22);});}['_handleReconnectionError'](_0x4e78c1){const _0x68fa3c=this['editor']['plugins']['get']('Notification'),_0x58927d=this['editor']['locale'];_0x4e78c1||(_0x4e78c1=$(_0x58927d,'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.')),_0x68fa3c['showWarning'](_0x4e78c1,{'title':$(_0x58927d,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x46588f)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x46588f)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5b4993){const _0x3f55f9=_0x5b4993['map'](_0x564746=>_0x564746['toJSON']());return this['_compressor']['compress'](_0x3f55f9);}['_decompressOperations'](_0x10d12b,_0x188fcc){return this['_compressor']['decompress'](_0x10d12b)['map']((_0x2c5337,_0x571929)=>{const _0x17f913='init'==_0x188fcc[_0x571929]['type'];if('InsertOperation'==_0x2c5337['__className']){const _0x52616c=_0x2c5337['position']['root'];!this['_document']['getRoot'](_0x52616c)&&(this['_document']['createRoot']('$root',_0x52616c)['_isAttached']=!0x1);}const _0x5a56f9=_0x88c11e['fromJSON'](_0x2c5337,this['_document']);return _0x5a56f9['wasUndone']=_0x2c5337['wasUndone'],_0x5a56f9['_isInit']=_0x17f913,_0x5a56f9['_authorId']=_0x17f913?null:_0x188fcc[_0x571929]['userId'],_0x5a56f9['_isDisconnection']='cs:removeUser'===_0x188fcc[_0x571929]['type'],_0x5a56f9['createdAt']=_0x188fcc[_0x571929]['createdAt'],_0x5a56f9;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5696fa=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5696fa&&_0x5696fa['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x593d5e,_0x59df4f){for(const _0x46e85b of _0x593d5e)_0x46e85b['baseVersion']=_0x59df4f++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0x3f029b){this['_ignoredOperations']=_0x3f029b,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x42caac){let _0xbbc7e3=_0x42caac['length'];for(;_0xbbc7e3--;){const _0x16cfb=_0x42caac[_0xbbc7e3];if(!this['_ignoredOperations']['has'](_0x16cfb)){if(!this['_operationToId']['has'](_0x16cfb)){const _0x358f23=_0xa6257d()['slice'](0x1,0x12);this['_operationToId']['set'](_0x16cfb,_0x358f23);}return this['_operationToId']['get'](_0x16cfb);}}}['setIdForTheLastOperation'](_0x54fed1,_0x5f2ef9){if(!_0x5f2ef9)return;let _0x21a374=_0x54fed1['length'];for(;_0x21a374--;){const _0x322d15=_0x54fed1[_0x21a374];this['_ignoredOperations']['has'](_0x322d15)||this['_operationToId']['set'](_0x322d15,_0x5f2ef9);}}}class a extends _0x4edcf1{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0xa0a9ec{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x360dc4)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x5926ab];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x525793){super(_0x525793),this['_services']=new Map();}async['init'](){const _0x15158a=this['context'],_0x2ebb18=_0x15158a['plugins']['get']('CommentsRepository');if(_0x15158a['plugins']['get'](n)['addToReconnectionStack'](this),_0x2ebb18['adapter']={'addCommentThread':async({channelId:_0x24591b,threadId:_0x5d7a59,comments:_0x3bcf56,resolvedAt:_0x2ce1e4,resolvedBy:_0x4def01,context:_0x1f3b64,attributes:_0xd109a1})=>{const _0x547f4e=await this['_getService'](_0x24591b)['addCommentThread']({'commentThreadId':_0x5d7a59,'comments':_0x3bcf56['map'](_0x483d52=>function(_0x55c0d7,_0x5e5e3a,_0x22d77d){return{'commentThreadId':_0x22d77d,'commentId':_0x55c0d7['commentId'],'userId':_0x55c0d7['authorId'],'content':_0x55c0d7['content'],'documentId':_0x5e5e3a,'createdAt':_0x55c0d7['createdAt'],'attributes':_0x55c0d7['attributes']||{}};}(_0x483d52,_0x24591b,_0x5d7a59)),'resolvedAt':_0x2ce1e4,'resolvedBy':_0x4def01,'context':_0x1f3b64,'attributes':_0xd109a1})['catch'](at);return{'threadId':_0x547f4e['commentThreadId'],'comments':_0x547f4e['comments']};},'getCommentThread':async({channelId:_0x55cc3c,threadId:_0x31d285})=>{const _0x54c8ca=await this['_getService'](_0x55cc3c)['getCommentThread'](_0x31d285)['catch'](at);return _0x54c8ca['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x54c8ca]),{'threadId':_0x54c8ca['commentThreadId'],'comments':_0x54c8ca['comments']['map'](B),'context':_0x54c8ca['context'],'resolvedAt':_0x54c8ca['resolvedAt'],'resolvedBy':_0x54c8ca['resolvedBy'],'attributes':_0x54c8ca['attributes']||{}});},'updateCommentThread':async({channelId:_0x17bc74,threadId:_0x289223,context:_0x527818,unlinkedAt:_0x3a57ca,attributes:_0x5ab2dc})=>this['_getService'](_0x17bc74)['updateCommentThread']({'commentThreadId':_0x289223,'context':_0x527818,'attributes':_0x5ab2dc,'unlinkedAt':_0x3a57ca})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x17a4ca,threadId:_0x490f2d})=>{const _0x27afd4=await this['_getService'](_0x17a4ca)['resolveCommentThread'](_0x490f2d)['catch'](F)['catch'](at);return{'threadId':_0x27afd4['commentThreadId'],'resolvedAt':_0x27afd4['resolvedAt'],'resolvedBy':_0x27afd4['resolvedBy']};},'reopenCommentThread':async({channelId:_0x378434,threadId:_0x3f00fd})=>this['_getService'](_0x378434)['reopenCommentThread'](_0x3f00fd)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x5c16ca,threadId:_0x371c3d})=>this['_getService'](_0x5c16ca)['removeCommentThread'](_0x371c3d)['catch'](F)['catch'](at),'addComment':({channelId:_0x33c7bd,threadId:_0xd067fc,commentId:_0x3a743a,content:_0x4e2c04,attributes:_0x4271b8})=>this['_getService'](_0x33c7bd)['addComment'](_0xd067fc,_0x3a743a,_0x4e2c04,_0x4271b8)['catch'](at),'updateComment':({channelId:_0x2bc7c8,threadId:_0x58df83,commentId:_0x204aeb,content:_0x3e14d7,attributes:_0x594d50})=>this['_getService'](_0x2bc7c8)['updateComment'](_0x58df83,_0x204aeb,_0x3e14d7,_0x594d50)['catch'](F)['catch'](at),'removeComment':({channelId:_0x40e172,threadId:_0x5d5453,commentId:_0x320411})=>this['_getService'](_0x40e172)['removeComment'](_0x5d5453,_0x320411)['catch'](F)['catch'](at)},_0x15158a instanceof _0x167299){const _0x34d4c2=_0x15158a['config']['get']('collaboration.channelId'),_0x20ae73=_0x15158a['plugins']['get'](i);await this['_setUpService'](_0x34d4c2);const _0x377b0e=await this['_services']['get'](_0x34d4c2)['getConnectedSessions']();this['listenTo'](_0x20ae73,'sessionAdd:'+_0x34d4c2,(_0x956113,{session:_0x46cb3d})=>{_0x46cb3d['id']===_0x20ae73['mySessionId']&&(_0x956113['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x46cb3d['permissions'],_0x34d4c2));}),_0x20ae73['register'](_0x34d4c2,_0x377b0e);}}async['_setUpService'](_0x69fdba){if(this['_services']['has'](_0x69fdba))throw new _0x21fa12('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x69fdba});const _0x23d09c=this['context']['plugins']['get']('CommentsRepository'),_0x517953=new s['CommentsService'](_0x69fdba);this['_services']['set'](_0x69fdba,_0x517953),this['listenTo'](_0x517953,'commentThreadAdded',(_0x3d98c1,_0x97ee56)=>{const {commentThreadId:_0x3647c8,documentId:_0x477e60,context:_0x47dfd8,attributes:_0x2495cf,resolvedAt:_0x372dc2,resolvedBy:_0x2cec50,comments:_0x3316c2}=_0x97ee56;_0x23d09c['getCommentThread'](_0x3647c8)||_0x23d09c['addCommentThread']({'threadId':_0x3647c8,'channelId':_0x477e60,'comments':_0x3316c2?_0x3316c2['map'](B):[],'context':_0x47dfd8,'attributes':_0x2495cf,'resolvedAt':_0x372dc2,'resolvedBy':_0x2cec50,'isFromAdapter':!0x0});}),this['listenTo'](_0x517953,'commentThreadUpdated',(_0x26c36c,{commentThreadId:_0x57f229,documentId:_0xa7c7a5,context:_0x19d467,unlinkedAt:_0x187b98,attributes:_0x442327})=>{_0x23d09c['getCommentThread'](_0x57f229)&&_0x23d09c['updateCommentThread']({'threadId':_0x57f229,'channelId':_0xa7c7a5,'context':_0x19d467,'unlinkedAt':_0x187b98,'attributes':_0x442327,'isFromAdapter':!0x0});}),this['listenTo'](_0x517953,'commentThreadResolved',(_0x5ac7a1,{commentThreadId:_0x436011,resolvedBy:_0x307e6b,resolvedAt:_0x554a5c})=>{const _0x49d22=_0x23d09c['getCommentThread'](_0x436011);_0x49d22&&_0x49d22['resolve']({'resolvedBy':_0x307e6b,'resolvedAt':_0x554a5c,'isFromAdapter':!0x0});}),this['listenTo'](_0x517953,'commentThreadReopened',(_0x200a34,{commentThreadId:_0x5848e4})=>{const _0xcf1c4c=_0x23d09c['getCommentThread'](_0x5848e4);_0xcf1c4c&&_0xcf1c4c['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x517953,'commentThreadRemoved',(_0x1b0000,{commentThreadId:_0x25a845})=>{const _0x3f2e18=_0x23d09c['getCommentThread'](_0x25a845);_0x3f2e18&&_0x3f2e18['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x517953,'commentAdded',(_0x4119d8,_0x1e050c)=>{const _0x2a350e=_0x1e050c['commentThreadId'],_0x2e2fef=_0x23d09c['getCommentThread'](_0x2a350e);_0x2e2fef&&_0x2e2fef['addComment']({...B(_0x1e050c),'isFromAdapter':!0x0});}),this['listenTo'](_0x517953,'commentUpdated',(_0x5b8b3e,{commentThreadId:_0x1a4bcf,commentId:_0x51714b,content:_0x1ff93b,attributes:_0x5cc035})=>{const _0x374790=_0x23d09c['getCommentThread'](_0x1a4bcf);if(_0x374790){const _0x483523=_0x374790['getComment'](_0x51714b);_0x483523&&_0x483523['update']({'content':_0x1ff93b,'attributes':_0x5cc035,'isFromAdapter':!0x0});}}),this['listenTo'](_0x517953,'commentRemoved',(_0x498d80,{commentThreadId:_0xae34b4,commentId:_0x35483b})=>{const _0x393766=_0x23d09c['getCommentThread'](_0xae34b4);if(_0x393766){const _0xa5fa34=_0x393766['getComment'](_0x35483b);_0xa5fa34&&_0xa5fa34['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x69fdba);}['destroy'](){if(this['context']instanceof _0x167299){const _0x234caf=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x234caf);}}['_terminateService'](_0xebf08c){if(!this['_services']['has'](_0xebf08c))throw new _0x21fa12('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0xebf08c});this['_getService'](_0xebf08c)['disconnect'](),this['_services']['delete'](_0xebf08c);}async['reconnect'](){for(const _0x47cd76 of this['_services']['keys']())await this['_connectService'](_0x47cd76);if(this['context']instanceof _0x167299){const _0x36348f=this['context']['config']['get']('collaboration.channelId'),_0x1747ab=this['context']['plugins']['get'](i);_0x1747ab['unregister'](_0x36348f);const _0x21090d=await this['_services']['get'](_0x36348f)['getConnectedSessions']();_0x1747ab['register'](_0x36348f,_0x21090d);}}async['_connectService'](_0x2497cc){const {connection:_0x1c7d6d}=this['context']['plugins']['get'](n),_0x5d39dd=this['context']['plugins']['get']('CommentsRepository'),_0x4fed55=this['_services']['get'](_0x2497cc),_0x28479d=await _0x4fed55['connect'](_0x1c7d6d);await this['_fetchMissingUsersForThreads'](_0x28479d);const _0x464472=new Set(Array['from'](_0x5d39dd['getCommentThreads']({'channelId':_0x2497cc}),_0x1c6d1f=>_0x1c6d1f['id']));for(const _0x8b5f0f of _0x28479d)_0x8b5f0f['deletedAt']||_0x464472['delete'](_0x8b5f0f['commentThreadId']);for(const _0x4bae4d of _0x464472)_0x5d39dd['getCommentThread'](_0x4bae4d)['remove']({'isFromAdapter':!0x0});for(const _0x548634 of _0x28479d){let _0x13ee4b=_0x5d39dd['getCommentThread'](_0x548634['commentThreadId']);const {commentThreadId:_0x2da3ba,context:_0x3fca79,attributes:_0x3ff786,resolvedBy:_0x262d1f,resolvedAt:_0x428511,unlinkedAt:_0x496e4a,deletedAt:_0x5bfc2f}=_0x548634;if(_0x5bfc2f)continue;_0x13ee4b||(_0x13ee4b=_0x5d39dd['addCommentThread']({'channelId':_0x2497cc,'threadId':_0x2da3ba,'context':_0x3fca79,'attributes':_0x3ff786||{},'resolvedBy':_0x262d1f,'resolvedAt':_0x428511,'unlinkedAt':_0x496e4a,'isFromAdapter':!0x0}));const _0x2734da=new Set(Array['from'](_0x13ee4b['comments'],_0x53e08f=>_0x53e08f['id']));for(const _0xca9ff6 of _0x548634['comments'])_0x2734da['delete'](_0xca9ff6['commentId']);for(const _0xfc0ff0 of _0x2734da)_0x13ee4b['getComment'](_0xfc0ff0)['remove']({'isFromAdapter':!0x0});for(const _0x25f95f of _0x548634['comments']){const _0x203e50=_0x13ee4b['getComment'](_0x25f95f['commentId']);_0x203e50?_0x203e50['content']!==_0x25f95f['content']&&_0x203e50['update']({'content':_0x25f95f['content'],'isFromAdapter':!0x0}):_0x13ee4b['addComment'](Object['assign'](B(_0x25f95f),{'isFromAdapter':!0x0}));}}}['_getService'](_0x247d93){if(!this['_services']['has'](_0x247d93))throw new _0x21fa12('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x247d93});return this['_services']['get'](_0x247d93);}async['_fetchMissingUsersForThreads'](_0x1c716b){const _0x547b15=this['context']['plugins']['get'](_0x5926ab),{connection:_0x5e95fb}=this['context']['plugins']['get'](n),_0x2f4f35=new Set();for(const {resolvedBy:_0x4348ae,comments:_0x54d40d}of _0x1c716b){_0x4348ae&&!_0x547b15['getUser'](_0x4348ae)&&_0x2f4f35['add'](_0x4348ae);for(const {userId:_0x34fa53}of _0x54d40d)_0x547b15['getUser'](_0x34fa53)||_0x2f4f35['add'](_0x34fa53);}if(0x0===_0x2f4f35['size'])return;const _0x2c7b7a=await ct['getMany'](_0x5e95fb,Array['from'](_0x2f4f35));for(const _0x2f87ab of _0x2c7b7a)_0x547b15['getUser'](_0x2f87ab['id'])||_0x547b15['addUser'](_0x2f87ab);}}async function F(_0x3b9ec6){if('404'!==_0x3b9ec6['code'])throw _0x3b9ec6;}function at(_0x3c643b){if((_0x47c4eb=_0x3c643b)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x47c4eb['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x47c4eb['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x47c4eb;throw _0x3c643b;}function B(_0x30a260){return{'threadId':_0x30a260['commentThreadId'],'commentId':_0x30a260['commentId'],'content':_0x30a260['content'],'createdAt':_0x30a260['createdAt'],'authorId':_0x30a260['userId'],'attributes':_0x30a260['attributes']||{}};}class m extends _0x4edcf1{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x21be87){super(_0x21be87);const _0x46bd14=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x46bd14);}['init'](){const _0x31e1d5=this['editor']['plugins']['get'](n),_0x3da68b=this['editor']['plugins']['get']('TrackChangesEditing');return _0x3da68b['adapter']={'getSuggestion':async _0x458f1d=>{await this['_waitForServiceReady']();const _0x7b01fb=await this['_trackChangesService']['get'](_0x458f1d)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0x7b01fb]),_0x7b01fb;},'addSuggestion':async({id:_0x552738,type:_0x2afcad,data:_0x40cfb4,originalSuggestionId:_0x5abaf2,attributes:_0x1d3326})=>{await this['_waitForServiceReady']();const _0x4bbde8={'id':_0x552738,'type':_0x2afcad,'data':_0x40cfb4,'originalSuggestionId':_0x5abaf2,'attributes':_0x1d3326},_0x4c56cf=await this['_trackChangesService']['add'](_0x552738,_0x2afcad,_0x40cfb4,_0x5abaf2,_0x1d3326)['catch'](_0x2afe69=>{if(ht(_0x2afe69))return new Promise(_0x6ea133=>{this['_bufferedRequests']['set'](_0x552738,{'resolve':_0x6ea133,'suggestionData':_0x4bbde8});});throw _0x2afe69;});return this['_bufferedRequests']['delete'](_0x552738),_0x4c56cf;},'updateSuggestion':async(_0x18c55d,_0x54dd09)=>{if(await this['_waitForServiceReady'](),'open'!==_0x54dd09['state'])return this['_trackChangesService']['update'](_0x18c55d,_0x54dd09)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x308cb4,_0x5ebf56)=>{_0x3da68b['hasSuggestion'](_0x5ebf56['id'])&&(_0x3da68b['getSuggestion'](_0x5ebf56['id'])['attributes']=_0x5ebf56['attributes']);}),this['_trackChangesService']['connect'](_0x31e1d5['connection'])['then'](_0x5aca8b=>(_0x31e1d5['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x5aca8b)['then'](()=>{for(const _0x4fb1b6 of _0x5aca8b){_0x3da68b['addSuggestionData'](_0x4fb1b6)['_saved']=!0x0;}})));}async['reconnect'](){const _0x3906bf=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x3011af}=this['editor']['plugins']['get'](n),_0x481ff3=await this['_trackChangesService']['connect'](_0x3011af);await this['_fetchMissingUsersForThreads'](_0x481ff3);for(const {suggestionData:_0x52b862,resolve:_0x517891}of this['_bufferedRequests']['values']()){let _0x445576=_0x481ff3['find'](_0x4e892c=>_0x4e892c['id']===_0x52b862['id']);_0x445576||(_0x445576=await this['_trackChangesService']['add'](_0x52b862['id'],_0x52b862['type'],_0x52b862['data'],_0x52b862['originalSuggestionId'])),_0x517891(_0x445576);}for(const _0x189312 of _0x481ff3)_0x3906bf['hasSuggestion'](_0x189312['id'])||_0x3906bf['addSuggestionData'](_0x189312);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x434f88=>{this['listenTo'](this['_trackChangesService'],'connected',_0x12182a=>{_0x12182a['off'](),_0x434f88();});});}async['_fetchMissingUsersForThreads'](_0x430404){const _0x1107f3=this['editor']['plugins']['get'](_0x5926ab),{connection:_0x4b01d5}=this['editor']['plugins']['get'](n),_0x290635=new Set();for(const {authorId:_0x165ca7}of _0x430404)_0x1107f3['getUser'](_0x165ca7)||_0x290635['add'](_0x165ca7);if(0x0===_0x290635['size'])return;const _0x123396=await ct['getMany'](_0x4b01d5,Array['from'](_0x290635));for(const _0x144d70 of _0x123396)_0x1107f3['getUser'](_0x144d70['id'])||_0x1107f3['addUser'](_0x144d70);}}function k(_0x4b7804){if(ht(_0x4b7804))return new Promise(()=>{});throw _0x4b7804;}function ht(_0x14be09){return _0x14be09['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x14be09['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x4edcf1{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x211781=this['editor']['plugins']['get'](n),_0x4e9aa5=this['editor']['plugins']['get']('CommentsEditing'),_0x26c129=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x211781,'change:state',(_0x9afa68,_0x45e548,_0x363acc)=>{_0x4e9aa5['isThreadsLoadingPaused']='connected'!==_0x363acc;});}),this['listenTo'](_0x211781,'change:state',(_0x3660d1,_0x215fea,_0xc3594a)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xc3594a);}),_0x26c129['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x4edcf1{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x4edcf1{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x3326f7)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x5926ab];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ba78b){super(_0x2ba78b);const _0x543687=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x543687);}async['init'](){const _0x4a09c5=this['editor']['plugins']['get'](l),_0x131234=_0x4a09c5['serverHistory'],_0x5ccaee=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x131234,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4a09c5['sessionId']});const _0x209f2e=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0xbe94b5=await _0x5a159d['isBundleUploaded'](_0x5ccaee['connection'],_0x209f2e);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x5854f6})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5854f6)),'updateRevisions':async _0x3132e2=>{await this['_waitForServiceReady']();const _0x177f99=this['_revisionTracker']['currentRevision'];if(_0xbe94b5&&0x1===_0x3132e2['length']&&_0x3132e2[0x0]['id']===_0x177f99['id'])return _0x3132e2;for(const _0x2bfa24 of _0x3132e2)_0x2bfa24['id']===_0x177f99['id']&&(_0x2bfa24['isEmptyCurrent']=_0x2bfa24['fromVersion']===_0x2bfa24['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3132e2,this['_lastRequestId'])['then'](_0x45d3f3=>(this['_lastRequestId']=_0x45d3f3,_0x3132e2))['catch'](_0x23d63c=>{if(q(_0x23d63c)||'400'===_0x23d63c['code']&&void 0x0!==_0x23d63c['data']['wrongRequestId']){for(const _0x48617b of _0x3132e2){!this['_revisionTracker']['repository']['getRevision'](_0x48617b['id'])||this['_revisionTracker']['_bufferUpdate'](_0x48617b['id'],_0x48617b,!0x1);}if(q(_0x23d63c))throw _0x23d63c;return _0x3132e2;}throw _0x23d63c;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x53e0c4,{revisionsData:_0x5f4e08,requestId:_0x224148})=>{Math['max'](..._0x5f4e08['map'](_0x532d7d=>_0x532d7d['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5f4e08,_0x224148);}):this['_handleRevisionsUpdate'](_0x5f4e08,_0x224148);});const {revisions:_0x5b37a5,requestId:_0x41ef82}=await this['_revisionHistoryService']['connect'](_0x5ccaee['connection']);_0x5ccaee['addToReconnectionStack'](this),this['_lastRequestId']=_0x41ef82,await this['_fetchMissingUsers'](_0x5b37a5);for(const _0x2229a0 of _0x5b37a5)this['_revisionTracker']['addRevisionData'](_0x2229a0);this['listenTo'](_0x4a09c5,'change:_isConnected',(_0x4dc574,_0x758de,_0x13cf65)=>{_0x13cf65&&(this['_oldOffset']=_0x4a09c5['_offset'],_0x4dc574['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5ccaee,'state',_0x526e64=>_0x526e64===_0x25a895['CONNECTED']);}async['reconnect'](){const _0x584681=this['editor']['plugins']['get'](n),_0x464cb2=this['editor']['plugins']['get'](l),_0x550ab8=async()=>{const _0x39d5bb=this['_revisionTracker']['currentRevision'],_0x38338e=_0x39d5bb['id'],_0xbd84dc=_0x38338e!==_0x464cb2['sessionId'];if(_0xbd84dc){const _0xaf0a89=_0x464cb2['_offset']-this['_oldOffset'],_0x2ec0b2=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x39d5bb['toVersion']+_0xaf0a89!==_0x2ec0b2){const _0x474fab=_0x39d5bb['fromVersion']+_0xaf0a89,_0x129f45=this['editor']['plugins']['get'](_0x5926ab),_0x7abba7=this['_revisionTracker']['buildRevisionData']({'revision':_0x39d5bb,'from':_0x474fab,'to':_0x2ec0b2});_0x7abba7['id']=_0x39d5bb['id'];const _0x2595b5=_0x7abba7['authorsIds']['map'](_0x5b835d=>_0x129f45['getUser'](_0x5b835d));_0x39d5bb['_update']({..._0x7abba7,'authors':_0x2595b5},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x39d5bb['id'],_0x7abba7,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2ec0b2,(_0x39d5bb['toVersion']===_0x39d5bb['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x38338e)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x38338e),this['_revisionTracker']['_createCurrentRevision'](_0x2ec0b2));}const {revisions:_0x5c0984,requestId:_0x18c15e}=await this['_revisionHistoryService']['reconnect'](_0x584681['connection'],this['_lastRequestId']);_0xbd84dc&&_0x5c0984['length']>0x0?_0x464cb2['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x5c0984),this['_handleRevisionsUpdate'](_0x5c0984,_0x18c15e),this['_revisionTracker']['sendBufferedUpdates']());};return _0x464cb2['_isConnected']?_0x550ab8():new Promise((_0x466187,_0x572177)=>{_0x464cb2['once']('change:_isConnected',()=>{_0x550ab8()['then'](_0x466187)['catch'](_0x572177);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x427e79=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3ec9e5=>{_0x3ec9e5['off'](),_0x427e79();});});}['_getLatestVersionFromServerOperations'](){const _0x2e86a2=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1b5524 of _0x2e86a2)if('marker'!==_0x1b5524['type']||_0x1b5524['affectsData'])return _0x1b5524['baseVersion']+0x1;}['_getLatestVersion'](){const _0x37b1bf=this['editor']['plugins']['get'](l);return new Promise(_0x3be700=>{_0x37b1bf['_isPendingUpdate']?_0x37b1bf['once']('change:_isPendingUpdate',()=>{_0x3be700(this['_getLatestVersionFromServerOperations']());}):_0x3be700(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x50b058,_0x4d19aa){const _0xf349a7=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x4d19aa;for(const _0xb13dd4 of _0x50b058){const _0x451096=_0xf349a7['getRevision'](_0xb13dd4['id']);if(_0x451096){if((_0xb13dd4['fromVersion']||_0xb13dd4['toVersion'])&&(_0xb13dd4['diffData']=null),_0x451096===this['_revisionTracker']['currentRevision']){const _0x449f77=Math['max'](_0x451096['toVersion'],_0xb13dd4['toVersion']),_0x163393=Math['max'](_0x451096['fromVersion'],_0xb13dd4['fromVersion']);let _0x2033c3;_0x451096['toVersion']===_0xb13dd4['toVersion']&&_0x451096['fromVersion']===_0xb13dd4['fromVersion']?(_0x2033c3=!0x0,this['_preventResendingRevisionData'](_0xb13dd4)):_0xb13dd4['toVersion']===_0x449f77&&_0xb13dd4['fromVersion']===_0x163393?_0x2033c3=!0x1:(_0x451096['toVersion']===_0x449f77&&_0x451096['fromVersion']===_0x163393||this['_fixRevision']({'revision':_0x451096,'from':_0x163393,'to':_0x449f77}),_0x2033c3=!0x0),_0x2033c3&&(delete _0xb13dd4['fromVersion'],delete _0xb13dd4['toVersion'],delete _0xb13dd4['diffData'],delete _0xb13dd4['createdAt'],delete _0xb13dd4['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0xb13dd4),this['_preventResendingRevisionData'](_0xb13dd4);}else this['_revisionTracker']['addRevisionData'](_0xb13dd4);}const _0x435abd=_0xf349a7['getRevisions']();_0x435abd['reverse']();for(let _0x19a724=0x0;_0x19a724<_0x435abd['length']-0x1;_0x19a724++){const _0xe01e29=_0x435abd[_0x19a724],_0x2d58ae=_0x435abd[_0x19a724+0x1];if(_0xe01e29['fromVersion']<_0x2d58ae['toVersion']){const _0x1eae0b=_0x2d58ae['toVersion'],_0xc3d649=Math['max'](_0x1eae0b,_0xe01e29['toVersion']);this['_fixRevision']({'revision':_0xe01e29,'from':_0x1eae0b,'to':_0xc3d649});}}}['_fixRevision']({revision:_0x47f3d3,from:_0x322436,to:_0xa49cb}={}){const _0x32fc75=this['editor']['plugins']['get'](_0x5926ab),_0x13802f=this['_revisionTracker']['buildRevisionData']({'revision':_0x47f3d3,'from':_0x322436,'to':_0xa49cb});_0x13802f['authors']=_0x13802f['authorsIds']['map'](_0x51a2bb=>_0x32fc75['getUser'](_0x51a2bb)),_0x47f3d3['_update'](_0x13802f);}['_preventResendingRevisionData'](_0x390959){const _0x5f2bba={};_0x5f2bba['id']=_0x390959['id'];for(const _0x6d7eee of Object['keys'](_0x390959))'id'!==_0x6d7eee&&(_0x5f2bba[_0x6d7eee]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5f2bba['id'],_0x5f2bba,!0x0);}async['_fetchMissingUsers'](_0x3ab3bc){const _0x335e73=this['editor']['plugins']['get'](_0x5926ab),{connection:_0x3dc295}=this['editor']['plugins']['get'](n),_0x2f9ecb=new Set();for(const _0x166859 of _0x3ab3bc){for(const _0x3ca9a3 of _0x166859['authorsIds'])_0x28ce36(_0x3ca9a3);_0x166859['creatorId']&&_0x28ce36(_0x166859['creatorId']);}if(0x0===_0x2f9ecb['size'])return;const _0x20eaf8=await ct['getMany'](_0x3dc295,Array['from'](_0x2f9ecb));for(const _0x3d4347 of _0x20eaf8)_0x335e73['getUser'](_0x3d4347['id'])||_0x335e73['addUser'](_0x3d4347);function _0x28ce36(_0x540ecc){_0x335e73['getUser'](_0x540ecc)||_0x2f9ecb['add'](_0x540ecc);}}}function q(_0x16941b){return _0x16941b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x16941b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x16941b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x4edcf1{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x50a2fd{['_collapseAt'];constructor(_0x1e6981,_0x1b4311=0x6){super(_0x1e6981);const _0x32dfa8=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1b4311,this['bind']('isHidden')['to'](this,'usersCount',_0x13126b=>_0x13126b<_0x1b4311),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x32dfa8['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':_0x32dfa8['to']('usersCount',_0x310b89=>'+'+(_0x310b89-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x50a2fd{['items'];['keystrokes'];constructor(_0x2835c0){super(_0x2835c0);const _0x7956e1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x4c3498(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x7956e1['if']('hasPopup'),'aria-expanded':_0x7956e1['to']('isExpanded',_0x2233be=>this['hasPopup']&&String(_0x2233be)),'aria-label':_0x7956e1['to']('hasPopup',_0x26e31d=>$(_0x2835c0,_0x26e31d?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x7956e1['to']('hasPopup',_0x5433a6=>!!_0x5433a6&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x7956e1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x7956e1['to'](_0x2f8c33=>{const _0x5a84bb=_0x2f8c33,_0x2fdb7e=document['querySelector']('.ck-presence-list__dropdown-list'),_0x5ccab4=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2fdb7e?.['contains'](_0x5a84bb['relatedTarget'])||_0x5ccab4?.['contains'](_0x5a84bb['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x49ac52,_0x25dc70,_0x2d2327)=>{this['element']&&(_0x2d2327?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']);}}class v extends _0x50a2fd{['counterView'];['inlineListView'];constructor(_0x195f43,_0x1c1b59=0x6){super(_0x195f43);const _0x453ede=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x1c1b59),this['inlineListView']=new is(_0x195f43),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5e8945 of this['inlineListView']['items'])_0x5e8945['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',_0x453ede['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x50a2fd{['listWrapperView'];constructor(_0x30b77b,_0x44ad8b){super(_0x30b77b);const _0x1df705=this['bindTemplate'];this['listWrapperView']=new ut(_0x30b77b,_0x44ad8b),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x30b77b,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x1df705['to'](_0x1d9408=>{const _0x2a071d=_0x1d9408,_0x49f0dc=document['querySelector']('.ck-presence-list__list'),_0x4fe392=document['querySelector']('.ck-balloon-panel_with-arrow');_0x49f0dc?.['contains'](_0x2a071d['relatedTarget'])||_0x4fe392?.['contains'](_0x2a071d['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x47392b{constructor(_0x570402,_0xe5d62c){super(_0x570402);const _0x3432d7=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xe5d62c?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3432d7['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3432d7['to']('role'),'aria-label':_0x3432d7['to']('ariaLabel'),'aria-labelledby':_0x3432d7['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x274993['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x397587=this['element'];_0x397587&&(this['_isScrollable']=Math['max'](_0x397587['scrollHeight'],_0x397587['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x3d7e6d,_0x102391,_0x39da59){super(_0x3d7e6d);const _0x49c0d8=this['bindTemplate'];this['userView']=new st(_0x3d7e6d,_0x102391);const _0x3b28f5={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x102391['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x102391['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x102391['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x39da59&&(_0x3b28f5['tag']='button',_0x3b28f5['on']={'click':_0x49c0d8['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3b28f5);}['focus'](){this['element']['focus']();}}class A extends _0x50a2fd{['userView'];['markerView'];constructor(_0x5526a0,_0x4084b4,_0x4aa8e9){super(_0x5526a0);const _0x38cfff=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x5526a0,_0x4084b4),this['markerView']=new ot(_0x5526a0,_0x4084b4);const _0x5d2363=new it(_0x5526a0);_0x5d2363['template']['tag']='span',_0x5d2363['text']=_0x4084b4['name'];const _0x3394d0={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x38cfff['to']('isFocusable',_0x484afb=>!!_0x484afb&&0x0),'aria-labelledby':_0x5d2363['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x38cfff['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x38cfff['to']('hasTooltip',_0x482738=>!_0x482738),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x5d2363]};_0x4aa8e9&&(_0x3394d0['tag']='button',_0x3394d0['on']={'click':_0x38cfff['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3394d0);}}class ot extends _0x50a2fd{constructor(_0x31040,_0x3d13c3){super(_0x31040),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3d13c3['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0xa0a9ec{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf7f044){super(_0xf7f044),this['context']['config']['define']('presenceList',x);const _0x338208=_0xf7f044['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x338208)throw new _0x21fa12('presencelist-collapseat-invalid-format',this);if(_0x338208<0x1)throw new _0x21fa12('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2c863a(),this['balloonPanelView']=new _0x5b36ff(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x373793 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x373793);this['listenTo'](this['_allConnectedUsers'],'add',(_0x111b68,_0xdde041)=>{this['_handleUserAdd'](_0xdde041);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0xcdad86,_0x43c20c)=>{this['_handleUserRemove'](_0x43c20c);});}['_createView'](){const _0x218b1c=this['context'],_0x110123=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x536e07=this['balloonPanelView'];if(!_0x1e73ad(_0x218b1c['config']['get']('presenceList.container')))throw new _0x21fa12('presencelist-missing-container',this);return _0x110123['counterView']['bind']('usersCount')['to'](this),_0x110123['bind']('isCollapsed')['to'](this,'usersCount',_0x3f2b4a=>{const {collapseAt:_0x3f5894}=_0x218b1c['config']['get']('presenceList'),_0x250eea=_0x3f2b4a>=_0x3f5894;if(_0x250eea&&!_0x110123['inlineListView']['items']['find'](_0x2ed3cd=>_0x2ed3cd instanceof b)){const _0x574cc2=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x574cc2&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x110123['inlineListView']['items']['add'](_0x110123['counterView']);}return _0x250eea||this['hideDropdown'](),_0x250eea;}),_0x110123['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x48612c=>{const _0x3f2c30=_0x218b1c['config']['get']('presenceList'),_0x79d2dd=new A(_0x218b1c['locale'],_0x48612c,!!_0x3f2c30['onClick']);return _0x79d2dd['bind']('hasTooltip')['to'](_0x110123,'isCollapsed',_0x90a234=>!_0x90a234),_0x79d2dd['bind']('isFocusable')['to'](_0x110123,'isCollapsed',_0x1ede3d=>!_0x1ede3d),_0x3f2c30['onClick']&&this['listenTo'](_0x79d2dd,'execute',()=>{this['view']['isCollapsed']||_0x3f2c30['onClick'](_0x48612c,_0x79d2dd['element']);}),_0x79d2dd;}),this['listenTo'](_0x110123['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x110123['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x110123['inlineListView']['keystrokes']['set']('Enter',(_0x3234d2,_0x2b34e4)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2b34e4());}),_0x110123['render'](),_0x536e07['render'](),_0x2723a3({'emitter':_0x110123,'activator':()=>_0x536e07['isVisible'],'contextElements':[_0x536e07['element'],_0x110123['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x218b1c['config']['get']('presenceList.container')['appendChild'](_0x110123['element']),this['_bodyCollection']=new _0x5a4715(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x110123;}['_handleUserAdd'](_0x1e04f0){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x1e04f0['isMe'])return;const _0x2a506f=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2a506f-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x2c9c1a=_0x1e04f0['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x1e04f0,_0x2c9c1a);}['_handleUserRemove'](_0x57c6f0){this['usersCount']--;const {collapseAt:_0x228c65}=this['context']['config']['get']('presenceList'),_0x4fb1d8=this['usersCount']>=_0x228c65;if(this['currentDisplayedUsers']['get'](_0x57c6f0['id']))this['currentDisplayedUsers']['remove'](_0x57c6f0['id']);else{if(_0x4fb1d8&&this['currentDisplayedUsers']['length']+0x1===_0x228c65-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x4fb1d8?0x1:0x0)<this['usersCount']){for(const _0x2ed4f3 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x2ed4f3['id'])&&(this['currentDisplayedUsers']['add'](_0x2ed4f3,Math['min'](this['currentDisplayedUsers']['length']-(_0x4fb1d8?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x4fb1d8?0x1:0x0)===_0x228c65-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4fc9df=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x4fc9df['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x137cba}=this['presenceDropdownView'];_0x137cba['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x197fdd=>{if(!_0x4fc9df['displayMe']&&_0x197fdd['isMe'])return null;const _0x50a103=new j(this['context']['locale'],_0x197fdd,!!_0x4fc9df['onClick']);return _0x4fc9df['onClick']&&this['listenTo'](_0x50a103,'execute',()=>{_0x4fc9df['onClick'](_0x197fdd,_0x50a103['element']);}),_0x50a103;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x137cba['focus'](),_0x137cba['checkIfScrollable']();const _0xf7dbba=(_0x59247a,_0xa8d897)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0xa8d897();};_0x137cba['keystrokes']['set']('Esc',_0xf7dbba),_0x137cba['keystrokes']['set']('Shift+Tab',_0xf7dbba),_0x137cba['keystrokes']['set']('Tab',(_0x29bcba,_0x39c2fd)=>{!function(_0x579ccf){const _0x579fa1=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x3f539e=>_0x3f539e+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x5f56b9=[...document['body']['querySelectorAll'](_0x579fa1)]['filter'](_0x4e6734=>_0x4e6734===document['activeElement']||_0x4e6734['offsetWidth']+_0x4e6734['offsetHeight']>0x0)['sort']((_0x13e5ba,_0x2d6618)=>(_0x13e5ba['tabIndex']||0x0)-(_0x2d6618['tabIndex']||0x0)),_0x434140=_0x5f56b9['indexOf'](_0x579ccf),_0x723134=_0x5f56b9[(_0x434140+0x1)%_0x5f56b9['length']];_0x723134&&_0x723134['focus']();}(this['view']['element']),this['hideDropdown'](),_0x39c2fd();}),_0x137cba['focusTracker']['add'](this['view']['element']),_0x137cba['focusTracker']['on']('change:isFocused',(_0x3e4f1d,_0x2c4ed8,_0x294613)=>{_0x294613||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0xa0a9ec{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x310930,Plugin as _0x20bbef,PendingActions as _0x3e7a8c,Context as et}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x34df2e,CKEditorError as _0x21045a,Collection as _0x4b7163,global as _0x46ec17,version as ht,uid as _0xda88c4,KeystrokeHandler as _0x46a387}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x57a024,View as _0x5c72d1,ListView as _0x215c68,ListItemView as rt,LabelView as at,BalloonPanelView as _0x240326,clickOutsideHandler as _0x210d43,BodyCollection as _0x4e4cc}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x5380b7,History as _0x23e16c,NoOperation as _0x42d262,InsertOperation as _0x570f7c,MarkerOperation as _0x1a07d4,RootAttributeOperation as _0x1e2a7e,transformOperationSets as _0x5478d1,OperationFactory as _0x2f2c38}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as dt,WEB_SOCKET_GATEWAY_STATES as _0x293cb5,CollaborativeEditingService as _0x5d70ef,User as ut,CommentsService as ot,TrackChangesService as tt,RevisionHistoryService as _0x273624,EditorService as _0x1fc74e}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0xcebe00,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x51f779}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x5bed0f}from'es-toolkit/compat';class n extends _0x310930{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x57a024];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x495e62){super(_0x495e62),this['set']('state',_0x293cb5['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x34df2e())();}['init'](){const _0x49029f=this['context'],_0x465525=_0x49029f['plugins']['get']('CloudServices'),_0x14dc8a=_0x49029f['plugins']['get'](_0x57a024);if(!_0x465525['token'])throw new _0x21045a('websocketgateway-missing-token',this);if(!_0x465525['webSocketUrl'])throw new _0x21045a('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),n['WebSocketGateway']['connect'](_0x465525['token'],_0x465525['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x21bb08=>{if(this['connection']=_0x21bb08,this['bind']('state')['to'](_0x21bb08,'state',this,'_isBrowserOffline',(_0x369723,_0x589750)=>('connected'!==_0x369723&&(this['_shouldPluginsReconnect']=!0x0),_0x589750||_0x369723!==_0x293cb5['CONNECTED']?_0x293cb5['DISCONNECTED']:this['state']==_0x293cb5['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x293cb5['CONNECTING']):_0x293cb5['CONNECTED'])),this['connection']['on']('error',(_0x306acc,_0x4b343f)=>{if('limitExceeded'!==_0x4b343f['code'])throw console['error'](_0x4b343f),new _0x21045a('cloudservices-init',null,{'originalError':_0x4b343f});_0x14dc8a['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'});}),!_0x21bb08['me'])return new Promise(_0x68ccf2=>_0x21bb08['on']('change:me',_0x68ccf2));})['catch'](_0x1462b4=>{throw console['error'](_0x1462b4),new _0x21045a('cloudservices-init',null,{'originalError':_0x1462b4});});}['addToReconnectionStack'](_0x1aef0b){if('function'!=typeof _0x1aef0b['reconnect'])throw new _0x21045a('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1aef0b))throw new _0x21045a('websocketgateway-plugin-already-registered',this,{'name':_0x1aef0b['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1aef0b);}['removeFromReconnectionStack'](_0xdce958){this['_reconnectionStack']['delete'](_0xdce958);}['isInReconnectionStack'](_0x5678a5){return this['_reconnectionStack']['has'](_0x5678a5);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x5c6b28=>_0x5c6b28['reconnect']())))['then'](()=>this['state']=_0x293cb5['CONNECTED'])['catch'](_0x19203d=>{throw console['error'](_0x19203d),new _0x21045a('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x293cb5['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x310930{['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[n,_0xcebe00];}constructor(_0x518ecb){super(_0x518ecb),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x4b7163(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0xcebe00);}['init'](){const _0x5b5740=this['context']['plugins']['get'](n);this['listenTo'](_0x5b5740,'change:state',(_0xd0a031,_0x4cd64c,_0x2a8ee0)=>{if('connected'!==_0x2a8ee0)this['channelSessions']['forEach'](_0x612acb=>_0x612acb['clear']()),this['channelConnectedUsers']['forEach'](_0x7cc7c4=>_0x7cc7c4['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x19ed94,_0xecac08]of this['_registeredSessions'])for(const _0x3f61fe of _0xecac08)this['_handleSessionAdd'](_0x19ed94,_0x3f61fe);}}),this['_createUser'](_0x5b5740['connection']['me'],!0x0);}['register'](_0x44ffc9,_0x88878d){if(this['_registeredSessions']['has'](_0x44ffc9))throw new _0x21045a('sessions-register-already-registered',null,{'channelId':_0x44ffc9});this['_registeredSessions']['set'](_0x44ffc9,_0x88878d),this['channelSessions']['set'](_0x44ffc9,new _0x4b7163()),this['channelConnectedUsers']['set'](_0x44ffc9,new _0x4b7163()),this['listenTo'](_0x88878d,'add',(_0x47184d,_0x3c3c2a)=>this['_handleSessionAdd'](_0x44ffc9,_0x3c3c2a)),this['listenTo'](_0x88878d,'remove',(_0x401bab,_0x12034c)=>this['_handleSessionRemove'](_0x44ffc9,_0x12034c));for(const _0x4f4c11 of _0x88878d)this['_handleSessionAdd'](_0x44ffc9,_0x4f4c11);}['unregister'](_0x30f0e0){if(!this['_registeredSessions']['has'](_0x30f0e0))throw new _0x21045a('sessions-unregister-not-exist',null,{'channelId':_0x30f0e0});const _0x2d3ab4=this['_registeredSessions']['get'](_0x30f0e0);this['stopListening'](_0x2d3ab4);for(const _0x380687 of _0x2d3ab4)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x30f0e0,_0x380687);this['_registeredSessions']['delete'](_0x30f0e0),this['channelSessions']['delete'](_0x30f0e0),this['channelConnectedUsers']['delete'](_0x30f0e0);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x3b5649){for(const _0x1443ba of this['channelSessions']['values']())for(const _0x49b31d of _0x1443ba)if(_0x49b31d['id']===_0x3b5649)return _0x49b31d['user'];}['getUserSessions'](_0x20387c,_0x18fb3e){const _0x51b14b=_0x18fb3e?[this['channelSessions']['get'](_0x18fb3e)]:this['channelSessions']['values'](),_0x2e4b9e=new Set();for(const _0x5a1c19 of _0x51b14b)for(const _0x159d01 of _0x5a1c19)_0x159d01['user']['id']===_0x20387c['id']&&_0x2e4b9e['add'](_0x159d01['id']);return _0x2e4b9e;}['getUserRole'](_0x1d255c){for(const _0x4140be of this['channelSessions']['values']())for(const _0x58e1d9 of _0x4140be)if(_0x58e1d9['user']===_0x1d255c)return _0x58e1d9['role'];}['_handleSessionAdd'](_0x4a5d1a,_0x257455){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x40ab7e=_0x257455['user'],_0x6a64f6=this['_users']['getUser'](_0x40ab7e['id'])||this['_createUser'](_0x40ab7e),_0x303979=Object['assign']({},_0x257455,{'user':_0x6a64f6});this['channelSessions']['get'](_0x4a5d1a)['add'](_0x303979);const _0x2aeb64=this['channelConnectedUsers']['get'](_0x4a5d1a);_0x2aeb64['has'](_0x6a64f6['id'])||_0x2aeb64['add'](_0x6a64f6),this['allConnectedUsers']['has'](_0x6a64f6['id'])||this['allConnectedUsers']['add'](_0x6a64f6,_0x6a64f6['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x4a5d1a,{'channelId':_0x4a5d1a,'session':_0x303979});}['_handleSessionRemove'](_0x500057,_0x47020f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3f4b6b=this['channelConnectedUsers']['get'](_0x500057),_0x49bcb5=_0x47020f['user'];_0x49bcb5['id']&&(this['channelSessions']['get'](_0x500057)['remove'](_0x47020f['id']),_0x3f4b6b['has'](_0x49bcb5['id'])&&!this['getUserSessions'](_0x49bcb5,_0x500057)['size']&&_0x3f4b6b['remove'](_0x49bcb5['id']),this['allConnectedUsers']['get'](_0x49bcb5['id'])&&!this['getUserSessions'](_0x49bcb5)['size']&&this['allConnectedUsers']['remove'](_0x49bcb5['id']));}['_createUser'](_0x26f068,_0x53ae98){const _0x1176b7=this['_users']['addUser'](_0x26f068);return _0x53ae98&&this['_users']['defineMe'](_0x26f068['id']),_0x1176b7['orderNumber']=this['_uniqueUsersCount']++,_0x1176b7;}}class H extends _0x20bbef{['_domEmitter']=new(_0x34df2e())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x23fbb6=this['editor'],_0x146391=_0x23fbb6['plugins']['get'](i);_0x23fbb6['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x4c78f0,{writer:_0x38bbe4})=>function(_0x54ebc9,_0x4c9aea,_0x454a66,_0x527d0c){const _0x29ace1=_0x54ebc9['markerName']['split'](':')[0x2],_0x26b75c=_0x454a66['getUserBySessionId'](_0x29ace1);if(!_0x26b75c||_0x29ace1===_0x454a66['mySessionId'])return;if(!_0x527d0c['model']['schema']['checkChild'](_0x54ebc9['markerRange']['start'],'$text'))return;const _0x3ac5d9={'class':'ck-user__marker\x20'+_0x26b75c['color']['getMarkerClass'](),'data-name':_0x26b75c['name'],'data-session-id':_0x29ace1},_0x37f8c1=_0x527d0c['model']['markers']['get'](_0x54ebc9['markerName']),_0x50793c=_0x37f8c1['getStart'](),_0xe55027=_0x50793c['nodeAfter'],_0x58304e=_0x527d0c['model']['schema'];if(_0xe55027&&_0x58304e['isObject'](_0xe55027)&&_0x58304e['isInline'](_0xe55027)&&!_0x527d0c['model']['markers']['get']('user:range:'+_0x29ace1)['getRange']()['isCollapsed'])return;const _0x1894ee=_0x50793c['parent'];return _0x527d0c['model']['schema']['isLimit'](_0x1894ee)&&!_0x527d0c['model']['hasContent'](_0x1894ee)&&(_0x3ac5d9['contenteditable']=!0x1),function(_0x40c4b1,_0xf9eeae,_0x2a0a40){const _0x21fd2b=_0x40c4b1['createUIElement']('span',_0xf9eeae);return _0x40c4b1['setCustomProperty']('userPositionMarker',!0x0,_0x21fd2b),_0x21fd2b['render']=function(_0x407f80){const _0xededcc=this['toDomElement'](_0x407f80),_0x36a72b=document['createElement']('span');return _0x36a72b['classList']['add']('ck-user__marker-tooltip'),_0x36a72b['setAttribute']('contenteditable','false'),_0x36a72b['setAttribute']('spellcheck','false'),_0x36a72b['textContent']=_0x2a0a40['name'],_0xededcc['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x36a72b['outerHTML']+'⁠',_0xededcc['addEventListener']('mouseenter',()=>{_0xededcc['classList']['add']('ck-user__marker_hovered');}),_0xededcc['addEventListener']('mouseleave',()=>{_0xededcc['classList']['remove']('ck-user__marker_hovered');}),_0xededcc;},_0x21fd2b['isSimilar']=function(_0x4a9297){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4a9297['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4a9297['getAttribute']('data-session-id'));},_0x21fd2b;}(_0x4c9aea,_0x3ac5d9,_0x26b75c);}(_0x4c78f0,_0x38bbe4,_0x146391,_0x23fbb6)}),_0x23fbb6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x207d2b=>function(_0x21ff01,_0x292fdb){const _0x1454de=_0x21ff01['markerName']['split'](':')[0x2];if(_0x1454de===_0x292fdb['mySessionId'])return null;const _0x4f3f55=_0x292fdb['getUserBySessionId'](_0x1454de);if(!_0x4f3f55)return{'id':_0x1454de,'classes':[]};return{'id':_0x1454de,'classes':['ck-user__selection',_0x4f3f55['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x1454de},'priority':0x7d0+_0x4f3f55['orderNumber']};}(_0x207d2b,_0x146391)}),function(_0x2be15f){const _0x4a81f1=_0x2be15f['model'],_0x31a55c=new Map(),_0x245269=_0x2be15f['plugins']['get'](i);_0x4a81f1['markers']['on']('update:user:range',(_0xfa073,_0x44a94b,_0x3a3235,_0x1fedfa)=>{if(!_0x1fedfa&&_0x31a55c['get'](_0x44a94b['name']))return _0x31a55c['get'](_0x44a94b['name'])['detach'](),void _0x31a55c['delete'](_0x44a94b['name']);const _0x2e89b9=_0x44a94b['name']['split'](':')[0x2];if(_0x2e89b9===_0x245269['mySessionId'])return;const _0x315542='user:position:'+_0x2e89b9;_0x4a81f1['markers']['has'](_0x315542)&&_0x2be15f['editing']['reconvertMarker'](_0x315542),_0x44a94b['on']('change:range',(_0x5963a0,_0x41ff1e,_0x22fd05)=>{if('$graveyard'!=_0x41ff1e['root']['rootName']&&'$graveyard'==_0x44a94b['getRange']()['root']['rootName']&&!_0x31a55c['has'](_0x44a94b['name'])){const _0x4f35f2=_0x4a81f1['schema']['getNearestSelectionRange'](_0x22fd05['deletionPosition']);if(_0x4f35f2){const _0x3e94e8=_0x5380b7['fromRange'](_0x4f35f2);_0x31a55c['set'](_0x44a94b['name'],_0x3e94e8),_0x3e94e8['on']('change:range',(_0xdbeb21,_0x3ff211,_0x1f1b34)=>{if('$graveyard'==_0x3e94e8['root']['rootName']){const _0xb096d1=_0x4a81f1['schema']['getNearestSelectionRange'](_0x1f1b34['deletionPosition']);_0xb096d1?(_0x3e94e8['start']=_0xb096d1['start'],_0x3e94e8['end']=_0xb096d1['end']):(_0x31a55c['delete'](_0x44a94b['name']),_0x3e94e8['detach']());}});}}});}),_0x4a81f1['document']['on']('change',()=>{_0x31a55c['size']>0x0&&_0x4a81f1['enqueueChange']({'isUndoable':!0x1},_0x2e8643=>{for(const [_0x26f8c1,_0x2954cc]of _0x31a55c)'$graveyard'==_0x4a81f1['markers']['get'](_0x26f8c1)['getRange']()['root']['rootName']&&(Y(_0x26f8c1['split'](':')[0x2],_0x2954cc['toRange'](),_0x4a81f1,_0x2e8643),_0x2954cc['detach']());_0x31a55c['clear']();});});}(_0x23fbb6),this['_domEmitter']['listenTo'](_0x46ec17['document'],'keydown',(_0x1d586d,{key:_0x1bc407})=>{'Escape'===_0x1bc407&&function(_0x263c3a){_0x263c3a['editing']['view']['change'](_0x26584f=>{for(const _0x333e80 of _0x263c3a['model']['markers']){if(!_0x333e80['name']['startsWith']('user:position'))continue;const _0x459c94=_0x263c3a['editing']['mapper']['markerNameToElements'](_0x333e80['name']);if(_0x459c94){for(const _0x4ad025 of _0x459c94)_0x26584f['removeClass']('ck-user__marker_hovered',_0x4ad025);}}});}(_0x23fbb6);},{'useCapture':!0x0});}['afterInit'](){const _0x569a08=this['editor'],_0x246340=_0x569a08['commands']['get']('undo');_0x246340&&_0x569a08['model']['on']('applyOperation',(_0x449a46,_0x2fe403)=>{const _0x43de2a=_0x2fe403[0x0];if(!_0x43de2a['isDocumentOperation'])return;if('marker'!=_0x43de2a['type']||!_0x43de2a['name']['startsWith']('user:'))return;const _0x11ace8=_0x43de2a['batch'];_0x246340['_createdBatches']['has'](_0x11ace8)&&(_0x43de2a['newRange']=_0x43de2a['oldRange']?_0x569a08['model']['createRange'](_0x43de2a['oldRange']['start'],_0x43de2a['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x436279=this['editor'],_0x2a963d=_0x436279['model']['document'],_0x404fba=_0x436279['plugins']['get'](i);_0x436279['model']['enqueueChange']({'isUndoable':!0x1},_0x24c833=>{const _0x7e2876='user:range:'+_0x404fba['mySessionId'],_0xd7504b='user:position:'+_0x404fba['mySessionId'],_0x20200d=_0x436279['model']['markers']['has'](_0x7e2876);_0x436279['editing']['view']['hasDomSelection']?Y(_0x404fba['mySessionId'],_0x2a963d['selection']['getFirstRange'](),_0x436279['model'],_0x24c833):_0x20200d&&(_0x24c833['removeMarker'](_0x7e2876),_0x24c833['removeMarker'](_0xd7504b));});}}function Y(_0x4703d5,_0xad91bd,_0x1f2b4b,_0x241f52){const _0x419758='user:range:'+_0x4703d5,_0x514b96='user:position:'+_0x4703d5,_0x3ca8d1=_0xad91bd['getContainedElement']();let _0x39fcb0=_0xad91bd['start'];if(_0x3ca8d1&&_0x3ca8d1['is']('element','tableCell')){const _0x4644f6=function(_0x4a9447,_0x11e0d6){for(const _0x2bd3d8 of _0x4a9447['getPositions']())if(_0x11e0d6['schema']['checkChild'](_0x2bd3d8,'$text'))return _0x2bd3d8;}(_0xad91bd,_0x1f2b4b);_0x4644f6&&(_0x39fcb0=_0x4644f6,_0xad91bd=_0x241f52['createRange'](_0x39fcb0));}const _0x220fdd=_0x241f52['createRange'](_0x39fcb0);_0x1f2b4b['markers']['has'](_0x419758)?(_0x241f52['updateMarker'](_0x419758,{'range':_0xad91bd}),_0x241f52['updateMarker'](_0x514b96,{'range':_0x220fdd})):(_0x241f52['addMarker'](_0x419758,{'range':_0xad91bd,'usingOperation':!0x0}),_0x241f52['addMarker'](_0x514b96,{'range':_0x220fdd,'usingOperation':!0x0}));}function V(_0x18a70e,_0x4658de,_0x2c357a){const _0x40ed36=_0x18a70e['t'],t=_0x18a70e['t'];switch(_0x4658de){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 _0x40ed36({'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'},_0x2c357a);default:return'';}}let q=0x1;class l extends _0x20bbef{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x5d70ef)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,H,_0x3e7a8c,_0xcebe00,_0x57a024];}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 _0x3e0a96=this['serverHistory']['getOperations']();for(let _0x320406=_0x3e0a96['length']-0x1;_0x320406>=0x0;_0x320406--){const _0x1a56c6=_0x3e0a96[_0x320406];if(!this['_disconnectionOperations']['has'](_0x1a56c6))return _0x1a56c6['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x361305){if(super(_0x361305),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x23e16c(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x21045a('collaboration-missing-channelid',this);const _0x169041=_0x361305['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x169041,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x51f779(),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 K(this['_disconnectionOperations']);}['init'](){const _0x4473d8=this['editor'],_0x481d12=_0x4473d8['plugins']['get'](_0xcebe00),_0x2fb4c3=_0x4473d8['plugins']['get'](n);this['listenTo'](_0x481d12,'getOperationAuthor',(_0x520d6e,_0x35fb99)=>{const _0x12a0e5=_0x35fb99[0x0];_0x12a0e5['_authorId']&&(_0x520d6e['return']=_0x481d12['getUser'](_0x12a0e5['_authorId']),_0x520d6e['stop']()),null===_0x12a0e5['_authorId']&&(_0x520d6e['return']=null,_0x520d6e['stop']());},{'priority':'high'}),this['listenTo'](_0x4473d8['model']['document']['selection'],'change:range',(_0x1e6fba,_0x393ab2)=>{_0x393ab2['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4473d8['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4473d8['model']['on']('applyOperation',(_0x38c4e6,_0x5dd73c)=>{const _0x332cb1=_0x5dd73c[0x0];_0x332cb1['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x332cb1),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2fb4c3,'state',this,'_hasSynchronizationProblem',(_0x52d0e0,_0x139bc3)=>'connected'===_0x52d0e0&&!_0x139bc3),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4473d8['disableReadOnlyMode']('rtc-offline'):_0x4473d8['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4473d8['disableReadOnlyMode']('rtc-offline'):_0x4473d8['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x13d1cd=this['editor']['plugins']['get'](i),_0x23876d=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x13d1cd['unregister'](this['_channelId']);const _0x316988=await this['_service']['reconnect'](_0x23876d['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x316988)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4b707b=await this['_service']['getConnectedSessions']();_0x13d1cd['register'](this['_channelId'],_0x4b707b),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x170722){if(function(_0x467ef5){return'404'===_0x467ef5['code'];}(_0x170722)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4b65ac){return'409'===_0x4b65ac['code'];}(_0x170722)){const _0x52486e=V(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'](_0x52486e);}else{if(!(_0x170722 instanceof G))throw _0x170722;this['_handleReconnectionError']();}}}}['destroy'](){const _0x33997e=this['editor']['plugins']['get'](n),_0x4462a7=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4462a7['channelSessions']['has'](this['_channelId'])&&_0x4462a7['unregister'](this['_channelId']),_0x33997e['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x2d4bdb){if(this['sessionId']!==_0x2d4bdb['sessionId']&&this['_lastSyncedOperationId']!==_0x2d4bdb['lastOperationId'])throw new G();return this['sessionId']=_0x2d4bdb['sessionId'],this['_handleServerResponse']([],{..._0x2d4bdb,'wereChangesApplied':!0x1,'data':_0x2d4bdb['data']},'reconnect');}async['_connectService'](_0x20126c,_0xbb69af=!0x1){const {connection:_0x2b6e06}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x2b6e06,this['_channelId'])['then'](_0x7c6594=>this['_initSessionsHandling'](_0x7c6594))['catch'](_0xacd3ce=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0xacd3ce);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x14e2c3,_0x17d026)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x17d026);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x4170c1=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x20126c);this['_isPendingUpdate']=!0x0;const _0x3d86c9=await this['_service']['connect'](_0x2b6e06,this['_compressOperations'](_0x20126c),_0x4170c1);if(this['sessionId']=_0x3d86c9['sessionId'],_0xbb69af){if(!_0x3d86c9['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3d86c9['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x20126c,_0x3d86c9,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3d86c9,_0x20126c);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x48876e=this['editor']['plugins']['get'](i),_0x1475c2=this['editor']['plugins']['get'](H),_0x436c3e=_0x48876e['channelSessions']['get'](this['_channelId']);_0x436c3e&&_0x436c3e['length']>0x1?_0x1475c2['createUserMarkerOperations']():this['listenTo'](_0x48876e,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x48876e['channelSessions']['get'](this['_channelId'])['length']&&_0x1475c2['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2d20c8,_0x192b19,_0x18d571,_0x36eb8f){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x192b19){const _0x5d0a89=this['_decompressOperations'](_0x18d571,_0x36eb8f);await this['_fetchMissingUsers'](_0x5d0a89),this['_handleExternalOperations'](_0x5d0a89,_0x192b19,_0x18d571['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2cb8c4}=this['editor'];let _0x58488f;try{_0x58488f=await this['_service']['getDocumentDetails']();}catch{const _0x584a75=V(_0x2cb8c4,'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'](_0x584a75);}const _0x5ebf1d=_0x58488f['currentDocumentSession']||_0x58488f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5ebf1d['lastOperationId']){const _0x346f57=V(_0x2cb8c4,'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'](_0x346f57);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x3d6c94){const _0x20483e=this['editor']['plugins']['get'](i);this['listenTo'](_0x20483e,'sessionAdd:'+this['_channelId'],(_0x2a8030,{session:_0x417c78})=>{if(_0x417c78['id']===_0x20483e['mySessionId']){_0x2a8030['off']();const _0x333d5a=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x231551=_0x417c78['permissions'];_0x333d5a&&_0x333d5a['isEnabled']&&(_0x231551=_0x231551['filter'](_0x31b02b=>'document:write'!==_0x31b02b)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x231551,this['_channelId']);}}),_0x20483e['register'](this['_channelId'],_0x3d6c94);}['_initThrowingOnDataSet'](){const _0x4b4f02=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5eeef5)=>{if(!_0x5eeef5[_0x5eeef5['length']-0x1]['suppressErrorInCollaboration'])throw new _0x21045a('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x4b4f02['apply'](this['editor']['data'],_0x5eeef5);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2cbda0,[_0x3178c2])=>{if(this['_document']['version'])throw new _0x21045a('realtimecollaborationclient-init-document-already-initialized',this);_0x2cbda0['stop'](),this['_setPendingAction']();const _0x2989f3=this['editor']['config']['get']('rootsAttributes'),_0x398a21=this['_getOperationsFromInitData'](_0x3178c2,_0x2989f3);0x0==_0x398a21['length']&&_0x398a21['push'](new _0x42d262(0x0)),_0x2cbda0['return']=this['_connectService'](_0x398a21)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x8acad1=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x8acad1))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x41ffdd,[_0x4b6d9a,_0x236075])=>{_0x41ffdd['stop']();const _0x1f049e=this['editor']['model']['document']['getRoot'](_0x4b6d9a);if(!this['_knownRootNames']['has'](_0x4b6d9a)){const _0x2cbcdc=_0x236075&&_0x236075['data']?_0x236075['data']:'',_0x1e15da=_0x236075&&_0x236075['attributes']?_0x236075['attributes']:{};await this['_loadRoot'](_0x4b6d9a,_0x2cbcdc,_0x1e15da);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x1f049e['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x1f049e);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x38210c){const _0x40b365=this['editor']['plugins']['get'](_0xcebe00),{connection:_0x25ecac}=this['editor']['plugins']['get'](n),_0x502141=new Set();for(const _0x5ad6e2 of _0x38210c){const _0x28a63b=_0x5ad6e2['_authorId'];_0x28a63b&&!_0x40b365['getUser'](_0x28a63b)&&_0x502141['add'](_0x28a63b);}if(0x0===_0x502141['size'])return;const _0x3e2f5f=await ut['getMany'](_0x25ecac,Array['from'](_0x502141));for(const _0x2ba87c of _0x3e2f5f)_0x40b365['getUser'](_0x2ba87c['id'])||_0x40b365['addUser'](_0x2ba87c);}['_getOperationsFromInitData'](_0x556cfb,_0x2e8676={}){const _0x3fa8dd=this['editor']['model'],_0x2068f2=[];let _0x1f3bb1=0x0;const _0x3157f8='string'==typeof _0x556cfb?{'main':_0x556cfb}:_0x556cfb;for(const _0x43e347 of Object['keys'](_0x3157f8)){if(!this['_document']['roots']['has'](_0x43e347))throw new _0x21045a('realtimecollaborationclient-init-non-existent-root',this);const _0x1516ca=this['editor']['data']['parse'](_0x3157f8[_0x43e347]),_0x54c31a=this['_document']['getRoot'](_0x43e347),_0x3ad11e=new _0x570f7c(_0x3fa8dd['createPositionAt'](_0x54c31a,0x0),_0x1516ca,_0x1f3bb1++);_0x2068f2['push'](_0x3ad11e);for(const [_0x4c5b29,_0xa49a3b]of _0x1516ca['markers']){const _0xe4686b=_0x3fa8dd['createRange'](_0x3fa8dd['createPositionFromPath'](_0x54c31a,_0xa49a3b['start']['path']['slice']()),_0x3fa8dd['createPositionFromPath'](_0x54c31a,_0xa49a3b['end']['path']['slice']())),_0x5c3941=new _0x1a07d4(_0x4c5b29,null,_0xe4686b,_0x3fa8dd['markers'],!0x0,_0x1f3bb1++);_0x2068f2['push'](_0x5c3941);}}if(_0x2e8676)for(const [_0x3d5f8,_0x334d01]of Object['entries'](_0x2e8676)){const _0x1b47ac=_0x3fa8dd['document']['getRoot'](_0x3d5f8);if(!_0x1b47ac)throw new _0x21045a('multi-root-editor-root-attributes-no-root',null);for(const [_0x35b00f,_0x5c5c9a]of Object['entries'](_0x334d01))if(null!==_0x5c5c9a){const _0x93ca9c=new _0x1e2a7e(_0x1b47ac,_0x35b00f,null,_0x5c5c9a,_0x1f3bb1++);_0x2068f2['push'](_0x93ca9c);}}return _0x2068f2;}async['_loadRoot'](_0x1e01e6,_0x47ba29,_0x2e0f24){this['_getOperationsFromInitData']({[_0x1e01e6]:_0x47ba29},{[_0x1e01e6]:_0x2e0f24})['forEach']((_0x25dfb5,_0x3d58e7)=>{_0x25dfb5['baseVersion']=this['_document']['version']+_0x3d58e7,_0x25dfb5['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x25dfb5);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0xbcdb6b,_0x4e87a0){let _0x58a007;this['_offset']=_0xbcdb6b['offset'];const _0x29aad1=_0xbcdb6b['wereChangesApplied']&&!_0xbcdb6b['initData'],_0x3981e4=_0x29aad1?0x0:_0xbcdb6b['data']['baseVersion'];if(_0x4e87a0['forEach'](_0x20d9de=>{_0x20d9de['_isInit']=!0x0,_0x20d9de['createdAt']=_0xbcdb6b['sessionCreatedAt'],_0x20d9de['_authorId']=null;}),_0x29aad1)_0x58a007=_0x4e87a0,this['_applyOperationsSet'](_0x58a007,_0x29aad1);else{if(_0xbcdb6b['initData']){const _0x17f763=this['_getOperationsFromInitData'](_0xbcdb6b['initData']);this['_document']['history']['version']=-_0x17f763['length'],_0x17f763['forEach'](_0x32e962=>{_0x32e962['baseVersion']-=_0x17f763['length'],_0x32e962['createdAt']=_0xbcdb6b['sessionCreatedAt'],_0x32e962['_isInit']=!0x0,_0x32e962['_authorId']=null;}),this['_applyOperationsSet'](_0x17f763,!0x0),this['serverHistory']['version']=-_0x17f763['length']+this['_offset'],this['_updateServerHistory'](_0x17f763);}this['_document']['history']['version']=_0x3981e4,_0x58a007=this['_decompressOperations'](_0xbcdb6b['data'],_0xbcdb6b['metadata']),await this['_fetchMissingUsers'](_0x58a007),this['_applyOperationsSet'](_0x58a007,_0x29aad1);}_0xbcdb6b['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x58a007,_0xbcdb6b['lastOperationId']),this['_lastSyncedOperationId']=_0xbcdb6b['lastOperationId']),this['serverHistory']['version']=_0x3981e4+this['_offset'],this['_updateServerHistory'](_0x58a007),_0x4e87a0['filter'](_0xaee306=>{const _0x29aab3=this['_getAffectedRoot'](_0xaee306);return _0x29aab3&&!this['_knownRootNames']['has'](_0x29aab3);})['forEach']((_0x74ef7d,_0x57538e)=>{_0x74ef7d['baseVersion']=this['_document']['version']+_0x57538e,this['_saveOperationInBuffer'](_0x74ef7d);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2a42e8,_0x5ad22e){const _0x5f31d=_0x5ad22e&&_0x5ad22e['message'];if(_0x5f31d&&_0x5f31d['startsWith']('realtimecollaborationclient'))throw _0x5ad22e;const _0x44aee7=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x44aee7['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x21045a(_0x2a42e8,this['editor'],_0x5f31d?{'originalError':_0x5f31d}:void 0x0);}['_saveOperationInBuffer'](_0x1e18ee){this['_knownOperations']['has'](_0x1e18ee)||(this['_knownOperations']['add'](_0x1e18ee),this['_bufferedOperations']['push'](_0x1e18ee),this['_pendingAction']||'marker'==_0x1e18ee['type']&&!_0x1e18ee['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x51398f=!0x1){!_0x51398f&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x185c65=>{_0x185c65&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x544c5f=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x1658c9){return _0x1658c9['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1658c9['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x1658c9['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x544c5f)||this['_crash'](_0x544c5f['message'],_0x544c5f);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x580e4c=>{this['on']('change:_isPendingUpdate',()=>{_0x580e4c();});});}async['_sendBufferedOperations'](){const _0x53c2d7=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x53c2d7['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x106760=[...this['_bufferedOperations']];for(const _0x3539c1 of _0x106760)_0x3539c1['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3539c1);const _0x1f6014=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x106760),_0xf82527=q++,_0x2d7790=this['_compressOperations'](_0x106760),_0x58bbbe=await this['_service']['sendOperations'](_0x2d7790,_0x2d7790['baseVersion'],_0x1f6014);try{return await this['_handleServerResponse'](_0x106760,_0x58bbbe,_0xf82527);}catch(_0x26d39d){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x26d39d);}}async['_handleServerResponse'](_0x277e00,_0x30950b,_0x4b66e7){if('error'in _0x30950b)throw _0x30950b['error'];let _0x1a3695=!0x1;if(_0x30950b['wereChangesApplied']){_0x30950b['lastOperationId']&&(this['_lastSyncedOperationId']=_0x30950b['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x230457=>!_0x277e00['includes'](_0x230457));for(const _0x435117 of _0x277e00)_0x435117['createdAt']='lastOperationAcceptedAt'in _0x30950b&&_0x30950b['lastOperationAcceptedAt']||void 0x0;$(_0x277e00,_0x30950b['version']-_0x277e00['length']),this['_updateServerHistory'](_0x277e00);const _0x374e9e=_0x277e00['filter'](_0x5ebd26=>{if(!_0x5ebd26['_isInit'])return!0x1;const _0x218441=this['_getAffectedRoot'](_0x5ebd26);return _0x218441&&!this['_knownRootNames']['has'](_0x218441);});$(_0x374e9e,this['_document']['version']),this['_applyOperationsSet'](_0x374e9e),_0x1a3695=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xab02d7=this['_decompressOperations'](_0x30950b['data'],_0x30950b['metadata'])['filter'](_0x11fbbe=>_0x11fbbe['baseVersion']>=this['_lastServerVersion']);_0xab02d7['forEach'](_0x39605b=>this['_addKnownRoot'](_0x39605b)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5dd2bf=>!_0x5dd2bf['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5dd2bf))),this['_bufferedOperations']['length']&&$(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xab02d7),_0x1a3695=this['_handleExternalOperations'](_0xab02d7,_0x30950b['version'],_0x30950b['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1a3695?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3bfbf2,_0x1d9ffc,_0x34068a){try{const _0x323459={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2373eb,operationsB:_0x3c4389,originalOperations:_0x554dc0}=_0x5478d1(_0x3bfbf2,this['_bufferedOperations'],_0x323459);$(_0x2373eb,this['_document']['version']),$(_0x3c4389,_0x1d9ffc);for(const _0x36311e of _0x2373eb){const _0x1c13c8=_0x554dc0['get'](_0x36311e);_0x36311e['_authorId']=_0x1c13c8?_0x1c13c8['_authorId']:null;}_0x34068a&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3bfbf2,_0x34068a),this['_lastSyncedOperationId']=_0x34068a),this['_bufferedOperations']=[..._0x3c4389],this['_applyOperationsSet'](_0x2373eb),this['_updateServerHistory'](_0x3bfbf2);}catch(_0x1428de){return console['error'](_0x1428de),!0x1;}return!0x0;}['_applyOperationsSet'](_0x48944f,_0x13ba3a=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5683f3=>{for(const _0x4b01c1 of _0x48944f)this['_knownOperations']['add'](_0x4b01c1),this['_addKnownRoot'](_0x4b01c1),_0x5683f3['batch']['addOperation'](_0x4b01c1),this['editor']['model']['applyOperation'](_0x4b01c1);});}['_addKnownRoot'](_0x497aa1){const _0x55b864=this['_getAffectedRoot'](_0x497aa1);_0x55b864&&this['_knownRootNames']['add'](_0x55b864);}['_getAffectedRoot'](_0x178429){let _0x10ca11,_0x46f115;switch(_0x178429['type']){case'insert':_0x10ca11=_0x178429['position']['root'];break;case'marker':if(_0x46f115=_0x178429['newRange'],!_0x46f115)return null;_0x10ca11=_0x46f115['root'];break;case'addRootAttribute':_0x10ca11=_0x178429['root'];break;case'addRoot':_0x10ca11=_0x178429['affectedSelectable'];break;case'move':_0x10ca11=_0x178429['targetPosition']['root'];break;default:return null;}return _0x10ca11['rootName'];}['_updateServerHistory'](_0x505a7f){_0x505a7f['forEach'](_0x4b1d0c=>{const _0x547818=_0x4b1d0c['clone']();_0x547818['_authorId']=_0x4b1d0c['_authorId'],_0x547818['_isInit']=!!_0x4b1d0c['_isInit'],_0x547818['createdAt']=_0x4b1d0c['createdAt'],_0x547818['baseVersion']+=this['_offset'],_0x4b1d0c['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x547818),this['serverHistory']['addOperation'](_0x547818);});}['_handleReconnectionError'](_0x41bd99){const _0x3d639f=this['editor']['plugins']['get']('Notification'),_0x3535a9=this['editor']['locale'];_0x41bd99||(_0x41bd99=V(_0x3535a9,'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.')),_0x3d639f['showWarning'](_0x41bd99,{'title':V(_0x3535a9,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x3e7a8c)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3e7a8c)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x4f27c9){const _0x1bf532=_0x4f27c9['map'](_0x13f9fb=>_0x13f9fb['toJSON']());return this['_compressor']['compress'](_0x1bf532);}['_decompressOperations'](_0x47251e,_0x196592){return this['_compressor']['decompress'](_0x47251e)['map']((_0x1b0fd2,_0x552fd6)=>{const _0x108db5='init'==_0x196592[_0x552fd6]['type'];if('InsertOperation'==_0x1b0fd2['__className']){const _0x49b476=_0x1b0fd2['position']['root'];!this['_document']['getRoot'](_0x49b476)&&(this['_document']['createRoot']('$root',_0x49b476)['_isAttached']=!0x1);}const _0xcb734f=_0x2f2c38['fromJSON'](_0x1b0fd2,this['_document']);return _0xcb734f['wasUndone']=_0x1b0fd2['wasUndone'],_0xcb734f['_isInit']=_0x108db5,_0xcb734f['_authorId']=_0x108db5?null:_0x196592[_0x552fd6]['userId'],_0xcb734f['_isDisconnection']='cs:removeUser'===_0x196592[_0x552fd6]['type'],_0xcb734f['createdAt']=_0x196592[_0x552fd6]['createdAt'],_0xcb734f;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4a0e5b=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4a0e5b&&_0x4a0e5b['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class G extends Error{}function $(_0x12ae83,_0x57637d){for(const _0xd58284 of _0x12ae83)_0xd58284['baseVersion']=_0x57637d++;}class K{['_ignoredOperations'];['_operationToId'];constructor(_0x491cd8){this['_ignoredOperations']=_0x491cd8,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xfab486){let _0x17fd9a=_0xfab486['length'];for(;_0x17fd9a--;){const _0x59119d=_0xfab486[_0x17fd9a];if(!this['_ignoredOperations']['has'](_0x59119d)){if(!this['_operationToId']['has'](_0x59119d)){const _0x271040=_0xda88c4()['slice'](0x1,0x12);this['_operationToId']['set'](_0x59119d,_0x271040);}return this['_operationToId']['get'](_0x59119d);}}}['setIdForTheLastOperation'](_0x54442f,_0x52ce8a){if(!_0x52ce8a)return;let _0x3c9000=_0x54442f['length'];for(;_0x3c9000--;){const _0xd80466=_0x54442f[_0x3c9000];this['_ignoredOperations']['has'](_0xd80466)||this['_operationToId']['set'](_0xd80466,_0x52ce8a);}}}class a extends _0x20bbef{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x310930{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>ot)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0xcebe00];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x48d91e){super(_0x48d91e),this['_services']=new Map();}async['init'](){const _0x4a30fc=this['context'],_0x4eb16f=_0x4a30fc['plugins']['get']('CommentsRepository');if(_0x4a30fc['plugins']['get'](n)['addToReconnectionStack'](this),_0x4eb16f['adapter']={'addCommentThread':async({channelId:_0xef143a,threadId:_0x1767f7,comments:_0xb12337,resolvedAt:_0x1a3310,resolvedBy:_0x1902f0,context:_0x36c194,attributes:_0x1caeb7})=>{const _0x194f7a=await this['_getService'](_0xef143a)['addCommentThread']({'commentThreadId':_0x1767f7,'comments':_0xb12337['map'](_0x4320bc=>function(_0x4675ef,_0x5d3e1c,_0x1f3ed2){return{'commentThreadId':_0x1f3ed2,'commentId':_0x4675ef['commentId'],'userId':_0x4675ef['authorId'],'content':_0x4675ef['content'],'documentId':_0x5d3e1c,'createdAt':_0x4675ef['createdAt'],'attributes':_0x4675ef['attributes']||{}};}(_0x4320bc,_0xef143a,_0x1767f7)),'resolvedAt':_0x1a3310,'resolvedBy':_0x1902f0,'context':_0x36c194,'attributes':_0x1caeb7})['catch'](ft);return{'threadId':_0x194f7a['commentThreadId'],'comments':_0x194f7a['comments']};},'getCommentThread':async({channelId:_0x402daf,threadId:_0x3eb6b1})=>{const _0x3373f5=await this['_getService'](_0x402daf)['getCommentThread'](_0x3eb6b1)['catch'](ft);return _0x3373f5['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x3373f5]),{'threadId':_0x3373f5['commentThreadId'],'comments':_0x3373f5['comments']['map'](st),'context':_0x3373f5['context'],'resolvedAt':_0x3373f5['resolvedAt'],'resolvedBy':_0x3373f5['resolvedBy'],'attributes':_0x3373f5['attributes']||{}});},'updateCommentThread':async({channelId:_0x489fef,threadId:_0x3c6991,context:_0x300a92,unlinkedAt:_0x335051,attributes:_0x191b6d})=>this['_getService'](_0x489fef)['updateCommentThread']({'commentThreadId':_0x3c6991,'context':_0x300a92,'attributes':_0x191b6d,'unlinkedAt':_0x335051})['catch'](nt)['catch'](ft),'resolveCommentThread':async({channelId:_0x6d5f4b,threadId:_0x5b6ab7})=>{const _0x54357f=await this['_getService'](_0x6d5f4b)['resolveCommentThread'](_0x5b6ab7)['catch'](nt)['catch'](ft);return{'threadId':_0x54357f['commentThreadId'],'resolvedAt':_0x54357f['resolvedAt'],'resolvedBy':_0x54357f['resolvedBy']};},'reopenCommentThread':async({channelId:_0x249f22,threadId:_0x10fd74})=>this['_getService'](_0x249f22)['reopenCommentThread'](_0x10fd74)['catch'](nt)['catch'](ft),'removeCommentThread':({channelId:_0x410d0f,threadId:_0x243ec9})=>this['_getService'](_0x410d0f)['removeCommentThread'](_0x243ec9)['catch'](nt)['catch'](ft),'addComment':({channelId:_0x1317c6,threadId:_0x38263a,commentId:_0x4f4fca,content:_0x51c7b3,attributes:_0xbd8dc})=>this['_getService'](_0x1317c6)['addComment'](_0x38263a,_0x4f4fca,_0x51c7b3,_0xbd8dc)['catch'](ft),'updateComment':({channelId:_0x3aa441,threadId:_0x13d8b5,commentId:_0x3c4491,content:_0x49f3b6,attributes:_0x182979})=>this['_getService'](_0x3aa441)['updateComment'](_0x13d8b5,_0x3c4491,_0x49f3b6,_0x182979)['catch'](nt)['catch'](ft),'removeComment':({channelId:_0x56eae9,threadId:_0x334829,commentId:_0x49107c})=>this['_getService'](_0x56eae9)['removeComment'](_0x334829,_0x49107c)['catch'](nt)['catch'](ft)},_0x4a30fc instanceof et){const _0x3176be=_0x4a30fc['config']['get']('collaboration.channelId'),_0x2a05d3=_0x4a30fc['plugins']['get'](i);await this['_setUpService'](_0x3176be);const _0x4214cb=await this['_services']['get'](_0x3176be)['getConnectedSessions']();this['listenTo'](_0x2a05d3,'sessionAdd:'+_0x3176be,(_0x10d013,{session:_0x19cce5})=>{_0x19cce5['id']===_0x2a05d3['mySessionId']&&(_0x10d013['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x19cce5['permissions'],_0x3176be));}),_0x2a05d3['register'](_0x3176be,_0x4214cb);}}async['_setUpService'](_0x5219e7){if(this['_services']['has'](_0x5219e7))throw new _0x21045a('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x5219e7});const _0x4bf20f=this['context']['plugins']['get']('CommentsRepository'),_0x3e75db=new s['CommentsService'](_0x5219e7);this['_services']['set'](_0x5219e7,_0x3e75db),this['listenTo'](_0x3e75db,'commentThreadAdded',(_0x3c09e4,_0x21c1af)=>{const {commentThreadId:_0x3effe3,documentId:_0x457e7c,context:_0x180de2,attributes:_0x1d4972,resolvedAt:_0x4b4830,resolvedBy:_0x5ece6d,comments:_0x42c2a0}=_0x21c1af;_0x4bf20f['getCommentThread'](_0x3effe3)||_0x4bf20f['addCommentThread']({'threadId':_0x3effe3,'channelId':_0x457e7c,'comments':_0x42c2a0?_0x42c2a0['map'](st):[],'context':_0x180de2,'attributes':_0x1d4972,'resolvedAt':_0x4b4830,'resolvedBy':_0x5ece6d,'isFromAdapter':!0x0});}),this['listenTo'](_0x3e75db,'commentThreadUpdated',(_0x821010,{commentThreadId:_0x54ef3c,documentId:_0x12c864,context:_0x59ba31,unlinkedAt:_0x26f22c,attributes:_0x270ac7})=>{_0x4bf20f['getCommentThread'](_0x54ef3c)&&_0x4bf20f['updateCommentThread']({'threadId':_0x54ef3c,'channelId':_0x12c864,'context':_0x59ba31,'unlinkedAt':_0x26f22c,'attributes':_0x270ac7,'isFromAdapter':!0x0});}),this['listenTo'](_0x3e75db,'commentThreadResolved',(_0x35fa81,{commentThreadId:_0x51a20f,resolvedBy:_0x1542e4,resolvedAt:_0x410ab4})=>{const _0x151a2d=_0x4bf20f['getCommentThread'](_0x51a20f);_0x151a2d&&_0x151a2d['resolve']({'resolvedBy':_0x1542e4,'resolvedAt':_0x410ab4,'isFromAdapter':!0x0});}),this['listenTo'](_0x3e75db,'commentThreadReopened',(_0x159352,{commentThreadId:_0x295ae3})=>{const _0x2533ba=_0x4bf20f['getCommentThread'](_0x295ae3);_0x2533ba&&_0x2533ba['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3e75db,'commentThreadRemoved',(_0x41e923,{commentThreadId:_0x2e8a52})=>{const _0x24addb=_0x4bf20f['getCommentThread'](_0x2e8a52);_0x24addb&&_0x24addb['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3e75db,'commentAdded',(_0x2dae83,_0x468800)=>{const _0x2203ab=_0x468800['commentThreadId'],_0x1116cb=_0x4bf20f['getCommentThread'](_0x2203ab);_0x1116cb&&_0x1116cb['addComment']({...st(_0x468800),'isFromAdapter':!0x0});}),this['listenTo'](_0x3e75db,'commentUpdated',(_0x22cc01,{commentThreadId:_0x3d9388,commentId:_0x3871d3,content:_0x300fb7,attributes:_0x3b5635})=>{const _0x5844ed=_0x4bf20f['getCommentThread'](_0x3d9388);if(_0x5844ed){const _0x10a7d7=_0x5844ed['getComment'](_0x3871d3);_0x10a7d7&&_0x10a7d7['update']({'content':_0x300fb7,'attributes':_0x3b5635,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3e75db,'commentRemoved',(_0x374271,{commentThreadId:_0x24e045,commentId:_0x1ca647})=>{const _0x1de7ba=_0x4bf20f['getCommentThread'](_0x24e045);if(_0x1de7ba){const _0x9bc6c4=_0x1de7ba['getComment'](_0x1ca647);_0x9bc6c4&&_0x9bc6c4['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x5219e7);}['destroy'](){if(this['context']instanceof et){const _0x1e7e96=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x1e7e96);}}['_terminateService'](_0x1ee88f){if(!this['_services']['has'](_0x1ee88f))throw new _0x21045a('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1ee88f});this['_getService'](_0x1ee88f)['disconnect'](),this['_services']['delete'](_0x1ee88f);}async['reconnect'](){for(const _0xe58559 of this['_services']['keys']())await this['_connectService'](_0xe58559);if(this['context']instanceof et){const _0x389a22=this['context']['config']['get']('collaboration.channelId'),_0x44e8b2=this['context']['plugins']['get'](i);_0x44e8b2['unregister'](_0x389a22);const _0x58e9cd=await this['_services']['get'](_0x389a22)['getConnectedSessions']();_0x44e8b2['register'](_0x389a22,_0x58e9cd);}}async['_connectService'](_0x2bb9a4){const {connection:_0x3e31df}=this['context']['plugins']['get'](n),_0x4d4f50=this['context']['plugins']['get']('CommentsRepository'),_0xf675ab=this['_services']['get'](_0x2bb9a4),_0x5dbfff=await _0xf675ab['connect'](_0x3e31df);await this['_fetchMissingUsersForThreads'](_0x5dbfff);const _0x263944=new Set(Array['from'](_0x4d4f50['getCommentThreads']({'channelId':_0x2bb9a4}),_0x263c27=>_0x263c27['id']));for(const _0x2b22d8 of _0x5dbfff)_0x2b22d8['deletedAt']||_0x263944['delete'](_0x2b22d8['commentThreadId']);for(const _0x5378d6 of _0x263944)_0x4d4f50['getCommentThread'](_0x5378d6)['remove']({'isFromAdapter':!0x0});for(const _0x3bf5b1 of _0x5dbfff){let _0xa11452=_0x4d4f50['getCommentThread'](_0x3bf5b1['commentThreadId']);const {commentThreadId:_0x4ed280,context:_0x28054d,attributes:_0x41385a,resolvedBy:_0x19bb57,resolvedAt:_0xdc80,unlinkedAt:_0x3ce13b,deletedAt:_0x454e03}=_0x3bf5b1;if(_0x454e03)continue;_0xa11452||(_0xa11452=_0x4d4f50['addCommentThread']({'channelId':_0x2bb9a4,'threadId':_0x4ed280,'context':_0x28054d,'attributes':_0x41385a||{},'resolvedBy':_0x19bb57,'resolvedAt':_0xdc80,'unlinkedAt':_0x3ce13b,'isFromAdapter':!0x0}));const _0x5c0820=new Set(Array['from'](_0xa11452['comments'],_0x35f443=>_0x35f443['id']));for(const _0x23b8aa of _0x3bf5b1['comments'])_0x5c0820['delete'](_0x23b8aa['commentId']);for(const _0x1f38a2 of _0x5c0820)_0xa11452['getComment'](_0x1f38a2)['remove']({'isFromAdapter':!0x0});for(const _0x3577a7 of _0x3bf5b1['comments']){const _0x3d0848=_0xa11452['getComment'](_0x3577a7['commentId']);_0x3d0848?_0x3d0848['content']!==_0x3577a7['content']&&_0x3d0848['update']({'content':_0x3577a7['content'],'isFromAdapter':!0x0}):_0xa11452['addComment'](Object['assign'](st(_0x3577a7),{'isFromAdapter':!0x0}));}}}['_getService'](_0x393142){if(!this['_services']['has'](_0x393142))throw new _0x21045a('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x393142});return this['_services']['get'](_0x393142);}async['_fetchMissingUsersForThreads'](_0x58707b){const _0x5dd169=this['context']['plugins']['get'](_0xcebe00),{connection:_0x2c0026}=this['context']['plugins']['get'](n),_0xe24e46=new Set();for(const {resolvedBy:_0x5706db,comments:_0x3b1361}of _0x58707b){_0x5706db&&!_0x5dd169['getUser'](_0x5706db)&&_0xe24e46['add'](_0x5706db);for(const {userId:_0x8ffc06}of _0x3b1361)_0x5dd169['getUser'](_0x8ffc06)||_0xe24e46['add'](_0x8ffc06);}if(0x0===_0xe24e46['size'])return;const _0x27e024=await ut['getMany'](_0x2c0026,Array['from'](_0xe24e46));for(const _0xf734d7 of _0x27e024)_0x5dd169['getUser'](_0xf734d7['id'])||_0x5dd169['addUser'](_0xf734d7);}}async function nt(_0x27c722){if('404'!==_0x27c722['code'])throw _0x27c722;}function ft(_0x5735ad){if((_0x171cb8=_0x5735ad)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x171cb8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x171cb8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x171cb8;throw _0x5735ad;}function st(_0x592f21){return{'threadId':_0x592f21['commentThreadId'],'commentId':_0x592f21['commentId'],'content':_0x592f21['content'],'createdAt':_0x592f21['createdAt'],'authorId':_0x592f21['userId'],'attributes':_0x592f21['attributes']||{}};}class m extends _0x20bbef{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe5aa34){super(_0xe5aa34);const _0x4ef187=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4ef187);}['init'](){const _0x34f968=this['editor']['plugins']['get'](n),_0x329e16=this['editor']['plugins']['get']('TrackChangesEditing');return _0x329e16['adapter']={'getSuggestion':async _0x2aaa50=>{await this['_waitForServiceReady']();const _0x145586=await this['_trackChangesService']['get'](_0x2aaa50)['catch'](it);return await this['_fetchMissingUsersForThreads']([_0x145586]),_0x145586;},'addSuggestion':async({id:_0x594e02,type:_0x4ad47f,data:_0x40e99e,originalSuggestionId:_0x3f0bba,attributes:_0xe85dd1})=>{await this['_waitForServiceReady']();const _0x5224a0={'id':_0x594e02,'type':_0x4ad47f,'data':_0x40e99e,'originalSuggestionId':_0x3f0bba,'attributes':_0xe85dd1},_0x54d0c4=await this['_trackChangesService']['add'](_0x594e02,_0x4ad47f,_0x40e99e,_0x3f0bba,_0xe85dd1)['catch'](_0x2d438f=>{if(mt(_0x2d438f))return new Promise(_0x1f774c=>{this['_bufferedRequests']['set'](_0x594e02,{'resolve':_0x1f774c,'suggestionData':_0x5224a0});});throw _0x2d438f;});return this['_bufferedRequests']['delete'](_0x594e02),_0x54d0c4;},'updateSuggestion':async(_0x359755,_0x2f48a9)=>{if(await this['_waitForServiceReady'](),'open'!==_0x2f48a9['state'])return this['_trackChangesService']['update'](_0x359755,_0x2f48a9)['catch'](it);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x46074d,_0x457906)=>{_0x329e16['hasSuggestion'](_0x457906['id'])&&(_0x329e16['getSuggestion'](_0x457906['id'])['attributes']=_0x457906['attributes']);}),this['_trackChangesService']['connect'](_0x34f968['connection'])['then'](_0x244661=>(_0x34f968['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x244661)['then'](()=>{for(const _0x22c07c of _0x244661){_0x329e16['addSuggestionData'](_0x22c07c)['_saved']=!0x0;}})));}async['reconnect'](){const _0x558805=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x39e690}=this['editor']['plugins']['get'](n),_0x91bfb1=await this['_trackChangesService']['connect'](_0x39e690);await this['_fetchMissingUsersForThreads'](_0x91bfb1);for(const {suggestionData:_0x23fc96,resolve:_0x5a2226}of this['_bufferedRequests']['values']()){let _0x4fbde5=_0x91bfb1['find'](_0x3e390b=>_0x3e390b['id']===_0x23fc96['id']);_0x4fbde5||(_0x4fbde5=await this['_trackChangesService']['add'](_0x23fc96['id'],_0x23fc96['type'],_0x23fc96['data'],_0x23fc96['originalSuggestionId'])),_0x5a2226(_0x4fbde5);}for(const _0x492937 of _0x91bfb1)_0x558805['hasSuggestion'](_0x492937['id'])||_0x558805['addSuggestionData'](_0x492937);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x311543=>{this['listenTo'](this['_trackChangesService'],'connected',_0xfffe=>{_0xfffe['off'](),_0x311543();});});}async['_fetchMissingUsersForThreads'](_0x305092){const _0x19e1ee=this['editor']['plugins']['get'](_0xcebe00),{connection:_0x55f490}=this['editor']['plugins']['get'](n),_0xd9264d=new Set();for(const {authorId:_0x1ba3c3}of _0x305092)_0x19e1ee['getUser'](_0x1ba3c3)||_0xd9264d['add'](_0x1ba3c3);if(0x0===_0xd9264d['size'])return;const _0x1097df=await ut['getMany'](_0x55f490,Array['from'](_0xd9264d));for(const _0x463cfd of _0x1097df)_0x19e1ee['getUser'](_0x463cfd['id'])||_0x19e1ee['addUser'](_0x463cfd);}}function it(_0x3f7a8e){if(mt(_0x3f7a8e))return new Promise(()=>{});throw _0x3f7a8e;}function mt(_0xbeac2a){return _0xbeac2a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xbeac2a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x20bbef{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x6b3e9=this['editor']['plugins']['get'](n),_0x512710=this['editor']['plugins']['get']('CommentsEditing'),_0xf4d568=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x6b3e9,'change:state',(_0x39533c,_0x36183d,_0x2d6235)=>{_0x512710['isThreadsLoadingPaused']='connected'!==_0x2d6235;});}),this['listenTo'](_0x6b3e9,'change:state',(_0x91c732,_0x238aaf,_0x257bc2)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x257bc2);}),_0xf4d568['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class pt extends _0x20bbef{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x20bbef{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x273624)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0xcebe00];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x596485){super(_0x596485);const _0x43b2c3=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x43b2c3);}async['init'](){const _0x5eca58=this['editor']['plugins']['get'](l),_0x3f4b6c=_0x5eca58['serverHistory'],_0x448bd5=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x3f4b6c,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5eca58['sessionId']});const _0x27013a=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x5f4d58=await _0x1fc74e['isBundleUploaded'](_0x448bd5['connection'],_0x27013a);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x27037b})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x27037b)),'updateRevisions':async _0x259227=>{await this['_waitForServiceReady']();const _0x3bd704=this['_revisionTracker']['currentRevision'];if(_0x5f4d58&&0x1===_0x259227['length']&&_0x259227[0x0]['id']===_0x3bd704['id'])return _0x259227;for(const _0x7b03d5 of _0x259227)_0x7b03d5['id']===_0x3bd704['id']&&(_0x7b03d5['isEmptyCurrent']=_0x7b03d5['fromVersion']===_0x7b03d5['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x259227,this['_lastRequestId'])['then'](_0x13c3e5=>(this['_lastRequestId']=_0x13c3e5,_0x259227))['catch'](_0x236325=>{if(P(_0x236325)||'400'===_0x236325['code']&&void 0x0!==_0x236325['data']['wrongRequestId']){for(const _0x40c756 of _0x259227){!this['_revisionTracker']['repository']['getRevision'](_0x40c756['id'])||this['_revisionTracker']['_bufferUpdate'](_0x40c756['id'],_0x40c756,!0x1);}if(P(_0x236325))throw _0x236325;return _0x259227;}throw _0x236325;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1e3918,{revisionsData:_0x43d282,requestId:_0x57cdba})=>{Math['max'](..._0x43d282['map'](_0x500b2d=>_0x500b2d['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x43d282,_0x57cdba);}):this['_handleRevisionsUpdate'](_0x43d282,_0x57cdba);});const {revisions:_0x5bcb76,requestId:_0x51665f}=await this['_revisionHistoryService']['connect'](_0x448bd5['connection']);_0x448bd5['addToReconnectionStack'](this),this['_lastRequestId']=_0x51665f,await this['_fetchMissingUsers'](_0x5bcb76);for(const _0x39582c of _0x5bcb76)this['_revisionTracker']['addRevisionData'](_0x39582c);this['listenTo'](_0x5eca58,'change:_isConnected',(_0x1bba96,_0x133e5c,_0x3d9ca2)=>{_0x3d9ca2&&(this['_oldOffset']=_0x5eca58['_offset'],_0x1bba96['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x448bd5,'state',_0x2cc6b5=>_0x2cc6b5===_0x293cb5['CONNECTED']);}async['reconnect'](){const _0x33f530=this['editor']['plugins']['get'](n),_0x295948=this['editor']['plugins']['get'](l),_0x3958b4=async()=>{const _0x43c322=this['_revisionTracker']['currentRevision'],_0x539284=_0x43c322['id'],_0x453040=_0x539284!==_0x295948['sessionId'];if(_0x453040){const _0x51fce7=_0x295948['_offset']-this['_oldOffset'],_0x133a0b=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x43c322['toVersion']+_0x51fce7!==_0x133a0b){const _0x26eafa=_0x43c322['fromVersion']+_0x51fce7,_0x404e7a=this['editor']['plugins']['get'](_0xcebe00),_0x412900=this['_revisionTracker']['buildRevisionData']({'revision':_0x43c322,'from':_0x26eafa,'to':_0x133a0b});_0x412900['id']=_0x43c322['id'];const _0x3ba079=_0x412900['authorsIds']['map'](_0x11e351=>_0x404e7a['getUser'](_0x11e351));_0x43c322['_update']({..._0x412900,'authors':_0x3ba079},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x43c322['id'],_0x412900,!0x0);}this['_revisionTracker']['_startingVersion']=_0x133a0b,(_0x43c322['toVersion']===_0x43c322['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x539284)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x539284),this['_revisionTracker']['_createCurrentRevision'](_0x133a0b));}const {revisions:_0x38e3fa,requestId:_0x4979c0}=await this['_revisionHistoryService']['reconnect'](_0x33f530['connection'],this['_lastRequestId']);_0x453040&&_0x38e3fa['length']>0x0?_0x295948['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x38e3fa),this['_handleRevisionsUpdate'](_0x38e3fa,_0x4979c0),this['_revisionTracker']['sendBufferedUpdates']());};return _0x295948['_isConnected']?_0x3958b4():new Promise((_0x55f857,_0x1f1cf7)=>{_0x295948['once']('change:_isConnected',()=>{_0x3958b4()['then'](_0x55f857)['catch'](_0x1f1cf7);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x3d4c12=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x47ffdf=>{_0x47ffdf['off'](),_0x3d4c12();});});}['_getLatestVersionFromServerOperations'](){const _0x23455e=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x34d53e of _0x23455e)if('marker'!==_0x34d53e['type']||_0x34d53e['affectsData'])return _0x34d53e['baseVersion']+0x1;}['_getLatestVersion'](){const _0x59cd3a=this['editor']['plugins']['get'](l);return new Promise(_0xeb3b6e=>{_0x59cd3a['_isPendingUpdate']?_0x59cd3a['once']('change:_isPendingUpdate',()=>{_0xeb3b6e(this['_getLatestVersionFromServerOperations']());}):_0xeb3b6e(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x36c1ed,_0x31cbae){const _0x67ec4=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x31cbae;for(const _0x3a2a7c of _0x36c1ed){const _0x42a022=_0x67ec4['getRevision'](_0x3a2a7c['id']);if(_0x42a022){if((_0x3a2a7c['fromVersion']||_0x3a2a7c['toVersion'])&&(_0x3a2a7c['diffData']=null),_0x42a022===this['_revisionTracker']['currentRevision']){const _0x4a0f6f=Math['max'](_0x42a022['toVersion'],_0x3a2a7c['toVersion']),_0x4cf886=Math['max'](_0x42a022['fromVersion'],_0x3a2a7c['fromVersion']);let _0x4d9682;_0x42a022['toVersion']===_0x3a2a7c['toVersion']&&_0x42a022['fromVersion']===_0x3a2a7c['fromVersion']?(_0x4d9682=!0x0,this['_preventResendingRevisionData'](_0x3a2a7c)):_0x3a2a7c['toVersion']===_0x4a0f6f&&_0x3a2a7c['fromVersion']===_0x4cf886?_0x4d9682=!0x1:(_0x42a022['toVersion']===_0x4a0f6f&&_0x42a022['fromVersion']===_0x4cf886||this['_fixRevision']({'revision':_0x42a022,'from':_0x4cf886,'to':_0x4a0f6f}),_0x4d9682=!0x0),_0x4d9682&&(delete _0x3a2a7c['fromVersion'],delete _0x3a2a7c['toVersion'],delete _0x3a2a7c['diffData'],delete _0x3a2a7c['createdAt'],delete _0x3a2a7c['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3a2a7c),this['_preventResendingRevisionData'](_0x3a2a7c);}else this['_revisionTracker']['addRevisionData'](_0x3a2a7c);}const _0x592758=_0x67ec4['getRevisions']();_0x592758['reverse']();for(let _0x4d75fd=0x0;_0x4d75fd<_0x592758['length']-0x1;_0x4d75fd++){const _0xf7ad83=_0x592758[_0x4d75fd],_0x595e94=_0x592758[_0x4d75fd+0x1];if(_0xf7ad83['fromVersion']<_0x595e94['toVersion']){const _0x229a70=_0x595e94['toVersion'],_0x103591=Math['max'](_0x229a70,_0xf7ad83['toVersion']);this['_fixRevision']({'revision':_0xf7ad83,'from':_0x229a70,'to':_0x103591});}}}['_fixRevision']({revision:_0x304437,from:_0xe21177,to:_0x41c8d3}={}){const _0x3ade9d=this['editor']['plugins']['get'](_0xcebe00),_0x30320a=this['_revisionTracker']['buildRevisionData']({'revision':_0x304437,'from':_0xe21177,'to':_0x41c8d3});_0x30320a['authors']=_0x30320a['authorsIds']['map'](_0x210811=>_0x3ade9d['getUser'](_0x210811)),_0x304437['_update'](_0x30320a);}['_preventResendingRevisionData'](_0x228279){const _0x30c654={};_0x30c654['id']=_0x228279['id'];for(const _0x5d1259 of Object['keys'](_0x228279))'id'!==_0x5d1259&&(_0x30c654[_0x5d1259]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x30c654['id'],_0x30c654,!0x0);}async['_fetchMissingUsers'](_0x1cd617){const _0x4d1248=this['editor']['plugins']['get'](_0xcebe00),{connection:_0x1afc76}=this['editor']['plugins']['get'](n),_0x494dfa=new Set();for(const _0xaa46e7 of _0x1cd617){for(const _0x807273 of _0xaa46e7['authorsIds'])_0x4d4b61(_0x807273);_0xaa46e7['creatorId']&&_0x4d4b61(_0xaa46e7['creatorId']);}if(0x0===_0x494dfa['size'])return;const _0x4fa379=await ut['getMany'](_0x1afc76,Array['from'](_0x494dfa));for(const _0x49ced0 of _0x4fa379)_0x4d1248['getUser'](_0x49ced0['id'])||_0x4d1248['addUser'](_0x49ced0);function _0x4d4b61(_0x5c4299){_0x4d1248['getUser'](_0x5c4299)||_0x494dfa['add'](_0x5c4299);}}}function P(_0x5a8ac7){return _0x5a8ac7['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5a8ac7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5a8ac7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x20bbef{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x5c72d1{['_collapseAt'];constructor(_0x147af5,_0x3c8eb6=0x6){super(_0x147af5);const _0xd5665d=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x3c8eb6,this['bind']('isHidden')['to'](this,'usersCount',_0x152fff=>_0x152fff<_0x3c8eb6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0xd5665d['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':_0xd5665d['to']('usersCount',_0x1e2b11=>'+'+(_0x1e2b11-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x5c72d1{['items'];['keystrokes'];constructor(_0x3b77df){super(_0x3b77df);const _0x49ec19=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x46a387(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x49ec19['if']('hasPopup'),'aria-expanded':_0x49ec19['to']('isExpanded',_0x3cf94f=>this['hasPopup']&&String(_0x3cf94f)),'aria-label':_0x49ec19['to']('hasPopup',_0x1f3426=>V(_0x3b77df,_0x1f3426?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x49ec19['to']('hasPopup',_0x5505c3=>!!_0x5505c3&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x49ec19['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x49ec19['to'](_0x2504c9=>{const _0x5b81e0=_0x2504c9,_0x137e24=document['querySelector']('.ck-presence-list__dropdown-list'),_0x542641=document['querySelector']('.ck-balloon-panel_with-arrow');_0x137e24?.['contains'](_0x5b81e0['relatedTarget'])||_0x542641?.['contains'](_0x5b81e0['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x12c01e,_0x1c7511,_0x46d18e)=>{this['element']&&(_0x46d18e?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']);}}class v extends _0x5c72d1{['counterView'];['inlineListView'];constructor(_0x42aa5d,_0x2f57d7=0x6){super(_0x42aa5d);const _0x266639=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x2f57d7),this['inlineListView']=new is(_0x42aa5d),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3607f9 of this['inlineListView']['items'])_0x3607f9['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',_0x266639['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x5c72d1{['listWrapperView'];constructor(_0x4ed5bc,_0x20ad9a){super(_0x4ed5bc);const _0x5e33c1=this['bindTemplate'];this['listWrapperView']=new wt(_0x4ed5bc,_0x20ad9a),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x4ed5bc,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5e33c1['to'](_0x449355=>{const _0x44010f=_0x449355,_0x34af6c=document['querySelector']('.ck-presence-list__list'),_0xe80c4f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x34af6c?.['contains'](_0x44010f['relatedTarget'])||_0xe80c4f?.['contains'](_0x44010f['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x215c68{constructor(_0x2194bd,_0x18eac7){super(_0x2194bd);const _0x4a65ac=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x18eac7?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x4a65ac['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x4a65ac['to']('role'),'aria-label':_0x4a65ac['to']('ariaLabel'),'aria-labelledby':_0x4a65ac['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x46ec17['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x10032a=this['element'];_0x10032a&&(this['_isScrollable']=Math['max'](_0x10032a['scrollHeight'],_0x10032a['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x100547,_0x4e01e7,_0x5ca32b){super(_0x100547);const _0x2cc610=this['bindTemplate'];this['userView']=new ct(_0x100547,_0x4e01e7);const _0x490814={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4e01e7['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4e01e7['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4e01e7['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5ca32b&&(_0x490814['tag']='button',_0x490814['on']={'click':_0x2cc610['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x490814);}['focus'](){this['element']['focus']();}}class A extends _0x5c72d1{['userView'];['markerView'];constructor(_0x730347,_0x55a493,_0x28b336){super(_0x730347);const _0x18f53f=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x730347,_0x55a493),this['markerView']=new lt(_0x730347,_0x55a493);const _0x55fe88=new at(_0x730347);_0x55fe88['template']['tag']='span',_0x55fe88['text']=_0x55a493['name'];const _0x11c6d8={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x18f53f['to']('isFocusable',_0x50fb17=>!!_0x50fb17&&0x0),'aria-labelledby':_0x55fe88['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x18f53f['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x18f53f['to']('hasTooltip',_0x8bd939=>!_0x8bd939),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x55fe88]};_0x28b336&&(_0x11c6d8['tag']='button',_0x11c6d8['on']={'click':_0x18f53f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x11c6d8);}}class lt extends _0x5c72d1{constructor(_0x2889e7,_0x377778){super(_0x2889e7),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x377778['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x310930{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x690945){super(_0x690945),this['context']['config']['define']('presenceList',x);const _0x727d47=_0x690945['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x727d47)throw new _0x21045a('presencelist-collapseat-invalid-format',this);if(_0x727d47<0x1)throw new _0x21045a('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x4b7163(),this['balloonPanelView']=new _0x240326(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x506463 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x506463);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5722ea,_0xb11c39)=>{this['_handleUserAdd'](_0xb11c39);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5160be,_0x2302f1)=>{this['_handleUserRemove'](_0x2302f1);});}['_createView'](){const _0x11eb51=this['context'],_0x49c0c5=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x57d0c1=this['balloonPanelView'];if(!_0x5bed0f(_0x11eb51['config']['get']('presenceList.container')))throw new _0x21045a('presencelist-missing-container',this);return _0x49c0c5['counterView']['bind']('usersCount')['to'](this),_0x49c0c5['bind']('isCollapsed')['to'](this,'usersCount',_0x713ce6=>{const {collapseAt:_0x3a838b}=_0x11eb51['config']['get']('presenceList'),_0x312a62=_0x713ce6>=_0x3a838b;if(_0x312a62&&!_0x49c0c5['inlineListView']['items']['find'](_0x510a4c=>_0x510a4c instanceof b)){const _0x9ff92b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x9ff92b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x49c0c5['inlineListView']['items']['add'](_0x49c0c5['counterView']);}return _0x312a62||this['hideDropdown'](),_0x312a62;}),_0x49c0c5['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1b5839=>{const _0x4988fa=_0x11eb51['config']['get']('presenceList'),_0x56c4ba=new A(_0x11eb51['locale'],_0x1b5839,!!_0x4988fa['onClick']);return _0x56c4ba['bind']('hasTooltip')['to'](_0x49c0c5,'isCollapsed',_0x4beb8c=>!_0x4beb8c),_0x56c4ba['bind']('isFocusable')['to'](_0x49c0c5,'isCollapsed',_0x21eb71=>!_0x21eb71),_0x4988fa['onClick']&&this['listenTo'](_0x56c4ba,'execute',()=>{this['view']['isCollapsed']||_0x4988fa['onClick'](_0x1b5839,_0x56c4ba['element']);}),_0x56c4ba;}),this['listenTo'](_0x49c0c5['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x49c0c5['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x49c0c5['inlineListView']['keystrokes']['set']('Enter',(_0x19387e,_0x369849)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x369849());}),_0x49c0c5['render'](),_0x57d0c1['render'](),_0x210d43({'emitter':_0x49c0c5,'activator':()=>_0x57d0c1['isVisible'],'contextElements':[_0x57d0c1['element'],_0x49c0c5['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x11eb51['config']['get']('presenceList.container')['appendChild'](_0x49c0c5['element']),this['_bodyCollection']=new _0x4e4cc(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x49c0c5;}['_handleUserAdd'](_0x474c6e){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x474c6e['isMe'])return;const _0x4d3197=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x4d3197-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x403ec9=_0x474c6e['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x474c6e,_0x403ec9);}['_handleUserRemove'](_0x441bdb){this['usersCount']--;const {collapseAt:_0x2ba522}=this['context']['config']['get']('presenceList'),_0x4d7c52=this['usersCount']>=_0x2ba522;if(this['currentDisplayedUsers']['get'](_0x441bdb['id']))this['currentDisplayedUsers']['remove'](_0x441bdb['id']);else{if(_0x4d7c52&&this['currentDisplayedUsers']['length']+0x1===_0x2ba522-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x4d7c52?0x1:0x0)<this['usersCount']){for(const _0xca6b67 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0xca6b67['id'])&&(this['currentDisplayedUsers']['add'](_0xca6b67,Math['min'](this['currentDisplayedUsers']['length']-(_0x4d7c52?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x4d7c52?0x1:0x0)===_0x2ba522-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4b170d=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x4b170d['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x319bdb}=this['presenceDropdownView'];_0x319bdb['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x43bb5d=>{if(!_0x4b170d['displayMe']&&_0x43bb5d['isMe'])return null;const _0x3c7a44=new j(this['context']['locale'],_0x43bb5d,!!_0x4b170d['onClick']);return _0x4b170d['onClick']&&this['listenTo'](_0x3c7a44,'execute',()=>{_0x4b170d['onClick'](_0x43bb5d,_0x3c7a44['element']);}),_0x3c7a44;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x319bdb['focus'](),_0x319bdb['checkIfScrollable']();const _0x2e8029=(_0x8ce19d,_0x3d1d50)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3d1d50();};_0x319bdb['keystrokes']['set']('Esc',_0x2e8029),_0x319bdb['keystrokes']['set']('Shift+Tab',_0x2e8029),_0x319bdb['keystrokes']['set']('Tab',(_0x189afd,_0x35c066)=>{!function(_0x3ff3a3){const _0x4bb2d4=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x58d46a=>_0x58d46a+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x4710a8=[...document['body']['querySelectorAll'](_0x4bb2d4)]['filter'](_0x194dd3=>_0x194dd3===document['activeElement']||_0x194dd3['offsetWidth']+_0x194dd3['offsetHeight']>0x0)['sort']((_0x45d8e3,_0x96897d)=>(_0x45d8e3['tabIndex']||0x0)-(_0x96897d['tabIndex']||0x0)),_0x513410=_0x4710a8['indexOf'](_0x3ff3a3),_0x1b13df=_0x4710a8[(_0x513410+0x1)%_0x4710a8['length']];_0x1b13df&&_0x1b13df['focus']();}(this['view']['element']),this['hideDropdown'](),_0x35c066();}),_0x319bdb['focusTracker']['add'](this['view']['element']),_0x319bdb['focusTracker']['on']('change:isFocused',(_0x395054,_0x2178db,_0x1ee2cb)=>{_0x1ee2cb||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class vt extends _0x310930{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,vt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,pt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};