@ckeditor/ckeditor5-real-time-collaboration 49.0.0-alpha.0 → 49.0.0-alpha.10
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-editor.css +79 -56
- package/dist/index.css +79 -56
- package/dist/index.js +6 -6
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Context as
|
|
24
|
-
((()=>_0x49e252)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x5bcd0,_0x57a6dd];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f6646){super(_0x4f6646),this['set']('state',_0x5579e8['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x3fcc25())();}init(){const _0x333886=this['context'],_0x235245=_0x333886['plugins']['get'](_0x5bcd0),_0x2f4975=_0x333886['plugins']['get'](_0x57a6dd);if(!_0x235245['token'])throw new _0x506387('websocketgateway-missing-token',this);if(!_0x235245['webSocketUrl'])throw new _0x506387('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),WebSocketGateway['WebSocketGateway']['connect'](_0x235245['token'],_0x235245['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3521af=>{if(this['connection']=_0x3521af,this['bind']('state')['to'](_0x3521af,'state',this,'_isBrowserOffline',(_0x2ad874,_0x7aff8f)=>('connected'!==_0x2ad874&&(this['_shouldPluginsReconnect']=!0x0),_0x7aff8f||_0x2ad874!==_0x5579e8['CONNECTED']?_0x5579e8['DISCONNECTED']:this['state']==_0x5579e8['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x5579e8['CONNECTING']):_0x5579e8['CONNECTED'])),this['connection']['on']('error',(_0x1f7857,_0x4fc52d)=>{if('limitExceeded'!==_0x4fc52d['code'])throw console['error'](_0x4fc52d),new _0x506387('cloudservices-init',null,{'originalError':_0x4fc52d});_0x2f4975['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'});}),!_0x3521af['me'])return new Promise(_0xa3191a=>_0x3521af['on']('change:me',_0xa3191a));})['catch'](_0x35d8ea=>{throw console['error'](_0x35d8ea),new _0x506387('cloudservices-init',null,{'originalError':_0x35d8ea});});}addToReconnectionStack(_0x5d964d){if('function'!=typeof _0x5d964d['reconnect'])throw new _0x506387('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5d964d))throw new _0x506387('websocketgateway-plugin-already-registered',this,{'name':_0x5d964d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5d964d);}removeFromReconnectionStack(_0x809b3f){this['_reconnectionStack']['delete'](_0x809b3f);}isInReconnectionStack(_0x45b51a){return this['_reconnectionStack']['has'](_0x45b51a);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x2fcb22=>_0x2fcb22['reconnect']())))['then'](()=>this['state']=_0x5579e8['CONNECTED'])['catch'](_0x229970=>{throw console['error'](_0x229970),new _0x506387('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x5579e8['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},Q=class extends _0x566254{['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[J,_0x309335];}constructor(_0x448d03){super(_0x448d03),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2ae756(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x309335);}init(){const _0x30c9c6=this['context']['plugins']['get'](J);this['listenTo'](_0x30c9c6,'change:state',(_0x5e26af,_0x5a1b56,_0x56a9f2)=>{if('connected'!==_0x56a9f2)this['channelSessions']['forEach'](_0x5cc722=>_0x5cc722['clear']()),this['channelConnectedUsers']['forEach'](_0x1abe4b=>_0x1abe4b['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x26923d,_0x5d32c1]of this['_registeredSessions'])for(const _0x237bcf of _0x5d32c1)this['_handleSessionAdd'](_0x26923d,_0x237bcf);}}),this['_createUser'](_0x30c9c6['connection']['me'],!0x0);}register(_0xfee4c4,_0x4b82fd){if(this['_registeredSessions']['has'](_0xfee4c4))throw new _0x506387('sessions-register-already-registered',null,{'channelId':_0xfee4c4});this['_registeredSessions']['set'](_0xfee4c4,_0x4b82fd),this['channelSessions']['set'](_0xfee4c4,new _0x2ae756()),this['channelConnectedUsers']['set'](_0xfee4c4,new _0x2ae756()),this['listenTo'](_0x4b82fd,'add',(_0x3685ba,_0x2bab5c)=>this['_handleSessionAdd'](_0xfee4c4,_0x2bab5c)),this['listenTo'](_0x4b82fd,'remove',(_0x1634e5,_0x59ff7a)=>this['_handleSessionRemove'](_0xfee4c4,_0x59ff7a));for(const _0xc30bbd of _0x4b82fd)this['_handleSessionAdd'](_0xfee4c4,_0xc30bbd);}unregister(_0x4f528b){if(!this['_registeredSessions']['has'](_0x4f528b))throw new _0x506387('sessions-unregister-not-exist',null,{'channelId':_0x4f528b});const _0x4f450c=this['_registeredSessions']['get'](_0x4f528b);this['stopListening'](_0x4f450c);for(const _0xee92af of _0x4f450c)'connected'===this['context']['plugins']['get'](J)['state']&&this['_handleSessionRemove'](_0x4f528b,_0xee92af);this['_registeredSessions']['delete'](_0x4f528b),this['channelSessions']['delete'](_0x4f528b),this['channelConnectedUsers']['delete'](_0x4f528b);}get['mySessionId'](){return this['context']['plugins']['get'](J)['connection']['sessionId'];}getUserBySessionId(_0x4d7ee2){for(const _0xd0f8ea of this['channelSessions']['values']())for(const _0x3e0656 of _0xd0f8ea)if(_0x3e0656['id']===_0x4d7ee2)return _0x3e0656['user'];}getUserSessions(_0x4a6e4e,_0x3d928c){const _0x2f867b=_0x3d928c?[this['channelSessions']['get'](_0x3d928c)]:this['channelSessions']['values'](),_0x5de8f5=new Set();for(const _0x382bb6 of _0x2f867b)for(const _0x107f47 of _0x382bb6)_0x107f47['user']['id']===_0x4a6e4e['id']&&_0x5de8f5['add'](_0x107f47['id']);return _0x5de8f5;}getUserRole(_0x48bd1e){for(const _0x137d6c of this['channelSessions']['values']())for(const _0x22602d of _0x137d6c)if(_0x22602d['user']===_0x48bd1e)return _0x22602d['role'];}['_handleSessionAdd'](_0x2c5701,_0x55b611){if('connected'!==this['context']['plugins']['get'](J)['state'])return;const _0x35489=_0x55b611['user'],_0x5b01b2=this['_users']['getUser'](_0x35489['id'])||this['_createUser'](_0x35489),_0x19d302=Object['assign']({},_0x55b611,{'user':_0x5b01b2});if(this['channelSessions']['get'](_0x2c5701)['add'](_0x19d302),!_0x35489['hiddenInPresenceList']){const _0x40f80e=this['channelConnectedUsers']['get'](_0x2c5701);_0x40f80e['has'](_0x5b01b2['id'])||_0x40f80e['add'](_0x5b01b2),this['allConnectedUsers']['has'](_0x5b01b2['id'])||_0x35489['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x5b01b2,_0x5b01b2['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x2c5701,{'channelId':_0x2c5701,'session':_0x19d302});}['_handleSessionRemove'](_0x50ec20,_0x43b360){if('connected'!==this['context']['plugins']['get'](J)['state'])return;const _0x11feaf=this['channelConnectedUsers']['get'](_0x50ec20),_0x5d6fa4=_0x43b360['user'];_0x5d6fa4['id']&&(this['channelSessions']['get'](_0x50ec20)['remove'](_0x43b360['id']),_0x11feaf['has'](_0x5d6fa4['id'])&&!this['getUserSessions'](_0x5d6fa4,_0x50ec20)['size']&&_0x11feaf['remove'](_0x5d6fa4['id']),this['allConnectedUsers']['get'](_0x5d6fa4['id'])&&!this['getUserSessions'](_0x5d6fa4)['size']&&this['allConnectedUsers']['remove'](_0x5d6fa4['id']));}_createUser(_0x5da992,_0x1513b6){const _0x3bc01f=this['_users']['addUser'](_0x5da992);return _0x1513b6&&this['_users']['defineMe'](_0x5da992['id']),_0x3bc01f['orderNumber']=this['_uniqueUsersCount']++,_0x3bc01f;}},X=class extends _0x1ef3e5{_domEmitter=new(_0x3fcc25())();static get requires(){return[Q];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x38cb0c=this['editor'],_0x35a306=_0x38cb0c['plugins']['get'](Q);_0x38cb0c['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5e7530,{writer:_0x345507})=>function(_0x2ae72b,_0x3a738e,_0x1b460a,_0x24b62a){const _0x1f4ea5=_0x2ae72b['markerName']['split'](':')[0x2],_0x4b0649=_0x1b460a['getUserBySessionId'](_0x1f4ea5);if(!_0x4b0649||_0x1f4ea5===_0x1b460a['mySessionId'])return;if(!_0x24b62a['model']['schema']['checkChild'](_0x2ae72b['markerRange']['start'],'$text'))return;const _0x25793f={'class':'ck-user__marker\x20'+_0x4b0649['color']['getMarkerClass'](),'style':tt(_0x4b0649),'data-name':_0x4b0649['name'],'data-session-id':_0x1f4ea5},_0x48c067=_0x24b62a['model']['markers']['get'](_0x2ae72b['markerName'])['getStart'](),_0x27b698=_0x48c067['nodeAfter'],_0x336ec5=_0x24b62a['model']['schema'];if(_0x27b698&&_0x336ec5['isObject'](_0x27b698)&&_0x336ec5['isInline'](_0x27b698)&&!_0x24b62a['model']['markers']['get']('user:range:'+_0x1f4ea5)['getRange']()['isCollapsed'])return;const _0x32f83d=_0x48c067['parent'];return _0x24b62a['model']['schema']['isLimit'](_0x32f83d)&&!_0x24b62a['model']['hasContent'](_0x32f83d)&&(_0x25793f['contenteditable']=!0x1),function(_0x4b7f94,_0x4c0348,_0x2a5da2){const _0x5b5d99=_0x4b7f94['createUIElement']('span',_0x4c0348);return _0x4b7f94['setCustomProperty']('userPositionMarker',!0x0,_0x5b5d99),_0x5b5d99['render']=function(_0x58c923){const _0x56275f=this['toDomElement'](_0x58c923),_0x4cb16f=document['createElement']('span');return _0x4cb16f['classList']['add']('ck-user__marker-tooltip'),_0x4cb16f['setAttribute']('contenteditable','false'),_0x4cb16f['setAttribute']('spellcheck','false'),_0x4cb16f['textContent']=_0x2a5da2['name'],_0x56275f['innerHTML']=_0x5161ef('<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x4cb16f['outerHTML']+''),_0x56275f['addEventListener']('mouseenter',()=>{_0x56275f['classList']['add']('ck-user__marker_hovered');}),_0x56275f['addEventListener']('mouseleave',()=>{_0x56275f['classList']['remove']('ck-user__marker_hovered');}),_0x56275f;},_0x5b5d99['isSimilar']=function(_0x3d1d0b){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3d1d0b['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3d1d0b['getAttribute']('data-session-id'));},_0x5b5d99;}(_0x3a738e,_0x25793f,_0x4b0649);}(_0x5e7530,_0x345507,_0x35a306,_0x38cb0c)}),_0x38cb0c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1e3899=>function(_0x1697f5,_0x399805){const _0x8eb1a0=_0x1697f5['markerName']['split'](':')[0x2];if(_0x8eb1a0===_0x399805['mySessionId'])return null;const _0x3e0fa3=_0x399805['getUserBySessionId'](_0x8eb1a0);return _0x3e0fa3?{'id':_0x8eb1a0,'classes':['ck-user__selection',_0x3e0fa3['color']['getSelectionClass']()],'attributes':{'style':tt(_0x3e0fa3),'data-session-id':_0x8eb1a0},'priority':0x7d0+_0x3e0fa3['orderNumber']}:{'id':_0x8eb1a0,'classes':[]};}(_0x1e3899,_0x35a306)}),function(_0x372bc7){const _0x9bd845=_0x372bc7['model'],_0x11e002=new Map(),_0x29fbf2=_0x372bc7['plugins']['get'](Q);_0x9bd845['markers']['on']('update:user:range',(_0x4730dc,_0x5566ad,_0x3af272,_0x595c64)=>{if(!_0x595c64&&_0x11e002['get'](_0x5566ad['name']))return _0x11e002['get'](_0x5566ad['name'])['detach'](),void _0x11e002['delete'](_0x5566ad['name']);const _0x277519=_0x5566ad['name']['split'](':')[0x2];if(_0x277519===_0x29fbf2['mySessionId'])return;const _0x744d89='user:position:'+_0x277519;_0x9bd845['markers']['has'](_0x744d89)&&_0x372bc7['editing']['reconvertMarker'](_0x744d89),_0x5566ad['on']('change:range',(_0x568697,_0x2d3e71,_0x45183f)=>{if('$graveyard'!=_0x2d3e71['root']['rootName']&&'$graveyard'==_0x5566ad['getRange']()['root']['rootName']&&!_0x11e002['has'](_0x5566ad['name'])){const _0x26a46d=_0x9bd845['schema']['getNearestSelectionRange'](_0x45183f['deletionPosition']);if(_0x26a46d){const _0x57d741=_0x52c56e['fromRange'](_0x26a46d);_0x11e002['set'](_0x5566ad['name'],_0x57d741),_0x57d741['on']('change:range',(_0x4a2514,_0x5278f4,_0x38218f)=>{if('$graveyard'==_0x57d741['root']['rootName']){const _0x14cfc0=_0x9bd845['schema']['getNearestSelectionRange'](_0x38218f['deletionPosition']);_0x14cfc0?(_0x57d741['start']=_0x14cfc0['start'],_0x57d741['end']=_0x14cfc0['end']):(_0x11e002['delete'](_0x5566ad['name']),_0x57d741['detach']());}});}}});}),_0x9bd845['document']['on']('change',()=>{_0x11e002['size']>0x0&&_0x9bd845['enqueueChange']({'isUndoable':!0x1},_0x219ff9=>{for(const [_0x18333a,_0x1c4106]of _0x11e002)'$graveyard'==_0x9bd845['markers']['get'](_0x18333a)['getRange']()['root']['rootName']&&(Z(_0x18333a['split'](':')[0x2],_0x1c4106['toRange'](),_0x9bd845,_0x219ff9),_0x1c4106['detach']());_0x11e002['clear']();});});}(_0x38cb0c),this['_domEmitter']['listenTo'](_0x34368d['document'],'keydown',(_0x1d2de9,{key:_0x4664a4})=>{'Escape'===_0x4664a4&&function(_0x2792e0){_0x2792e0['editing']['view']['change'](_0x1820c7=>{for(const _0x12aef7 of _0x2792e0['model']['markers']){if(!_0x12aef7['name']['startsWith']('user:position'))continue;const _0x22e22a=_0x2792e0['editing']['mapper']['markerNameToElements'](_0x12aef7['name']);if(_0x22e22a){for(const _0x4abd98 of _0x22e22a)_0x1820c7['removeClass']('ck-user__marker_hovered',_0x4abd98);}}});}(_0x38cb0c);},{'useCapture':!0x0});}afterInit(){const _0x12d2c8=this['editor'],_0x5593c1=_0x12d2c8['commands']['get']('undo');_0x5593c1&&_0x12d2c8['model']['on']('applyOperation',(_0x374336,_0x2bf43d)=>{const _0x320b1c=_0x2bf43d[0x0];if(!_0x320b1c['isDocumentOperation'])return;if('marker'!=_0x320b1c['type']||!_0x320b1c['name']['startsWith']('user:'))return;const _0x5846e2=_0x320b1c['batch'];_0x5593c1['_createdBatches']['has'](_0x5846e2)&&(_0x320b1c['newRange']=_0x320b1c['oldRange']?_0x12d2c8['model']['createRange'](_0x320b1c['oldRange']['start'],_0x320b1c['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0xb9faf7=this['editor'],_0x58ba07=_0xb9faf7['model']['document'],_0x3b5ad2=_0xb9faf7['plugins']['get'](Q);_0xb9faf7['model']['enqueueChange']({'isUndoable':!0x1},_0x444505=>{const _0x189326='user:range:'+_0x3b5ad2['mySessionId'],_0x332c8e='user:position:'+_0x3b5ad2['mySessionId'],_0x1f893f=_0xb9faf7['model']['markers']['has'](_0x189326);_0xb9faf7['editing']['view']['hasDomSelection']?Z(_0x3b5ad2['mySessionId'],_0x58ba07['selection']['getFirstRange'](),_0xb9faf7['model'],_0x444505):_0x1f893f&&(_0x444505['removeMarker'](_0x189326),_0x444505['removeMarker'](_0x332c8e));});}};function Z(_0x443958,_0x50c6e2,_0x4ef157,_0x4d1136){const _0x3f09a='user:range:'+_0x443958,_0x218128='user:position:'+_0x443958,_0x47d950=_0x50c6e2['getContainedElement']();let _0x41eee4=_0x50c6e2['start'];if(_0x47d950&&_0x47d950['is']('element','tableCell')){const _0xe6f363=function(_0x496a7a,_0xe1471a){for(const _0x7b395 of _0x496a7a['getPositions']())if(_0xe1471a['schema']['checkChild'](_0x7b395,'$text'))return _0x7b395;}(_0x50c6e2,_0x4ef157);_0xe6f363&&(_0x41eee4=_0xe6f363,_0x50c6e2=_0x4d1136['createRange'](_0x41eee4));}const _0x325fcf=_0x4d1136['createRange'](_0x41eee4);_0x4ef157['markers']['has'](_0x3f09a)?(_0x4d1136['updateMarker'](_0x3f09a,{'range':_0x50c6e2}),_0x4d1136['updateMarker'](_0x218128,{'range':_0x325fcf})):(_0x4d1136['addMarker'](_0x3f09a,{'range':_0x50c6e2,'usingOperation':!0x0}),_0x4d1136['addMarker'](_0x218128,{'range':_0x325fcf,'usingOperation':!0x0}));}function tt(_0x12a514){return'--ck-user-color:'+_0x12a514['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x12a514['color']['getColorAlphaVariable']()+';';}function et(_0x5a25b4,_0x33b005,_0xaa5bba){const _0x110982=_0x5a25b4['t'],t=_0x5a25b4['t'];switch(_0x33b005){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 _0x110982({'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'},_0xaa5bba);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x1ef3e5{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x58b839)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[J,Q,X,_0x5d7b3b,_0x309335,_0x57a6dd];}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 _0x53fe26=this['serverHistory']['getOperations']();for(let _0x597588=_0x53fe26['length']-0x1;_0x597588>=0x0;_0x597588--){const _0x2c8dbb=_0x53fe26[_0x597588];if(!this['_disconnectionOperations']['has'](_0x2c8dbb))return _0x2c8dbb['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1435dd){if(super(_0x1435dd),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5c882e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x506387('collaboration-missing-channelid',this);const _0x129ff3=_0x1435dd['config']['get']('cloudServices.bundleVersion')||_0x535cdb;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x129ff3,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1631c2(),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 rt(this['_disconnectionOperations']);}init(){const _0x104e70=this['editor'],_0x881308=_0x104e70['plugins']['get'](_0x309335),_0x549822=_0x104e70['plugins']['get'](J);this['listenTo'](_0x881308,'getOperationAuthor',(_0x50ea83,_0x4087a2)=>{const _0x5022bc=_0x4087a2[0x0];_0x5022bc['_authorId']&&(_0x50ea83['return']=_0x881308['getUser'](_0x5022bc['_authorId']),_0x50ea83['stop']()),null===_0x5022bc['_authorId']&&(_0x50ea83['return']=null,_0x50ea83['stop']());},{'priority':'high'}),this['listenTo'](_0x104e70['model']['document']['selection'],'change:range',(_0x51ae32,_0x435911)=>{_0x435911['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x104e70['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x104e70['model']['on']('applyOperation',(_0x5292ee,_0x20e084)=>{const _0x446ed7=_0x20e084[0x0];_0x446ed7['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x446ed7),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x549822,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x33cdc5,_0x4c71e4,_0xc78327)=>'connected'===_0x33cdc5&&!_0x4c71e4&&!_0xc78327),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x104e70['disableReadOnlyMode']('rtc-offline'):_0x104e70['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x104e70['disableReadOnlyMode']('rtc-offline'):_0x104e70['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x297097=this['editor']['plugins']['get'](Q),_0x4bb64d=this['editor']['plugins']['get'](J);try{this['_isPendingUpdate']=!0x0,_0x297097['unregister'](this['_channelId']);const _0x1910c4=await this['_service']['reconnect'](_0x4bb64d['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1910c4)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x46b92b=await this['_service']['getConnectedSessions']();_0x297097['register'](this['_channelId'],_0x46b92b),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x219d0c){if(function(_0x218bcc){return'404'===_0x218bcc['code'];}(_0x219d0c)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x40a313){return'409'===_0x40a313['code'];}(_0x219d0c)){const _0x1bbf40=et(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x1bbf40);}else{if(!(_0x219d0c instanceof nt))throw _0x219d0c;this['_handleReconnectionError']();}}}}destroy(){const _0x517d8f=this['editor']['plugins']['get'](J),_0x4ad1be=this['editor']['plugins']['get'](Q);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4ad1be['channelSessions']['has'](this['_channelId'])&&_0x4ad1be['unregister'](this['_channelId']),_0x517d8f['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x2ac1b5){if(this['sessionId']!==_0x2ac1b5['sessionId']&&this['_lastSyncedOperationId']!==_0x2ac1b5['lastOperationId'])throw new nt();return this['sessionId']=_0x2ac1b5['sessionId'],this['_handleServerResponse']([],{..._0x2ac1b5,'wereChangesApplied':!0x1,'data':_0x2ac1b5['data']},'reconnect');}async _connectService(_0x1e33bc,_0x5d5627=!0x1){const {connection:_0x17de68}=this['editor']['plugins']['get'](J);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x17de68,this['_channelId'])['then'](_0x541267=>this['_initSessionsHandling'](_0x541267))['catch'](_0x18ee05=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x18ee05);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xd71f2a,_0x3c92cb)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3c92cb);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x4fe26b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1e33bc);this['_isPendingUpdate']=!0x0;const _0x16b9e0=await this['_service']['connect'](_0x17de68,this['_compressOperations'](_0x1e33bc),_0x4fe26b);if(this['sessionId']=_0x16b9e0['sessionId'],_0x5d5627){if(!_0x16b9e0['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x16b9e0['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x1e33bc,_0x16b9e0,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x16b9e0,_0x1e33bc);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x13968b=this['editor']['plugins']['get'](Q),_0x3100ce=this['editor']['plugins']['get'](X),_0xab22d8=_0x13968b['channelSessions']['get'](this['_channelId']);_0xab22d8&&_0xab22d8['length']>0x1?_0x3100ce['createUserMarkerOperations']():this['listenTo'](_0x13968b,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x13968b['channelSessions']['get'](this['_channelId'])['length']&&_0x3100ce['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x21970b,_0x1dc098,_0x4839cd,_0x311295){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1dc098){const _0x35d31b=this['_decompressOperations'](_0x4839cd,_0x311295);await this['_fetchMissingUsers'](_0x35d31b),this['_handleExternalOperations'](_0x35d31b,_0x1dc098,_0x4839cd['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x58a4c6}=this['editor'];let _0x486607;try{_0x486607=await this['_service']['getDocumentDetails']();}catch{const _0x3e50d8=et(_0x58a4c6,'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'](_0x3e50d8);}const _0x4f1ebf=_0x486607['currentDocumentSession']||_0x486607['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x4f1ebf['lastOperationId']){const _0x15dd25=et(_0x58a4c6,'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'](_0x15dd25);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x5e1c1a=this['editor']['plugins']['get'](J);if(this['_isConnected']=!0x1,!_0x5e1c1a['connection']||'connected'!==_0x5e1c1a['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x244ba5=this['editor']['plugins']['get'](Q);_0x244ba5['channelSessions']['has'](this['_channelId'])&&_0x244ba5['unregister'](this['_channelId']),_0x5e1c1a['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x57ecf5){const _0x35622d=this['editor']['plugins']['get'](Q);this['listenTo'](_0x35622d,'sessionAdd:'+this['_channelId'],(_0x15c100,{session:_0x429b91})=>{if(_0x429b91['id']===_0x35622d['mySessionId']){_0x15c100['off']();const _0x7a8b1e=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x26cc64=_0x429b91['permissions'];_0x7a8b1e&&_0x7a8b1e['isEnabled']&&(_0x26cc64=_0x26cc64['filter'](_0x322f46=>'document:write'!==_0x322f46)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x26cc64,this['_channelId']);}}),_0x35622d['register'](this['_channelId'],_0x57ecf5);}_initThrowingOnDataSet(){const _0x559b34=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x3108ec)=>{if(!_0x3108ec[_0x3108ec['length']-0x1]['suppressErrorInCollaboration'])throw new _0x506387('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x559b34['apply'](this['editor']['data'],_0x3108ec);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x1bb4a1,[_0x2b5ea8])=>{if(this['_document']['version'])throw new _0x506387('realtimecollaborationclient-init-document-already-initialized',this);_0x1bb4a1['stop'](),this['_setPendingAction']();const _0x1ef360=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x20f0f6])=>!_0x20f0f6['lazyLoad'])['map'](([_0x3e2c4a,_0x1cb742])=>[_0x3e2c4a,_0x1cb742['modelAttributes']||{}])),_0x5e1f4c=this['_getOperationsFromInitData'](_0x2b5ea8,_0x1ef360);0x0==_0x5e1f4c['length']&&_0x5e1f4c['push'](new _0xfbd4a(0x0)),_0x1bb4a1['return']=this['_connectService'](_0x5e1f4c)['then'](()=>{this['editor']['plugins']['get'](J)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x82e03=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x82e03))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x38ae88,[_0x271f96,_0x1f3264])=>{_0x38ae88['stop']();const _0x8ef7c7=this['editor']['model']['document']['getRoot'](_0x271f96);if(!this['_knownRootNames']['has'](_0x271f96)){const _0x475426=_0x1f3264&&_0x1f3264['data']?_0x1f3264['data']:'',_0x55fb2b=_0x1f3264&&_0x1f3264['attributes']?_0x1f3264['attributes']:{};await this['_loadRoot'](_0x271f96,_0x475426,_0x55fb2b);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x8ef7c7['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x8ef7c7);});},{'priority':'high'});}async _fetchMissingUsers(_0x592a70){const _0x4b5158=this['editor']['plugins']['get'](_0x309335),{connection:_0x3a8d99}=this['editor']['plugins']['get'](J),_0x452ddc=new Set();for(const _0x3b0f57 of _0x592a70){const _0x2ec082=_0x3b0f57['_authorId'];_0x2ec082&&!_0x4b5158['getUser'](_0x2ec082)&&_0x452ddc['add'](_0x2ec082);}if(0x0===_0x452ddc['size'])return;const _0x6d1253=await _0x1da1c8['getMany'](_0x3a8d99,Array['from'](_0x452ddc));for(const _0x21a9a1 of _0x6d1253)_0x4b5158['getUser'](_0x21a9a1['id'])||_0x4b5158['addUser'](_0x21a9a1);}_getOperationsFromInitData(_0x30882a,_0xac3921={}){const _0x3cc866=this['editor']['model'],_0x1121c7=[];let _0x43986a=0x0;const _0x19656a='string'==typeof _0x30882a?{'main':_0x30882a}:_0x30882a;for(const _0x1af36b of Object['keys'](_0x19656a)){if(!this['_document']['roots']['has'](_0x1af36b))throw new _0x506387('realtimecollaborationclient-init-non-existent-root',this);const _0x48b9e6=this['_document']['getRoot'](_0x1af36b),_0x14c87c=this['editor']['data']['parse'](_0x19656a[_0x1af36b],_0x48b9e6),_0x1ae844=new _0x475a5f(_0x3cc866['createPositionAt'](_0x48b9e6,0x0),_0x14c87c,_0x43986a++);_0x1121c7['push'](_0x1ae844);for(const [_0x4e3e2b,_0x4a7806]of _0x14c87c['markers']){const _0x428fed=_0x3cc866['createRange'](_0x3cc866['createPositionFromPath'](_0x48b9e6,_0x4a7806['start']['path']['slice']()),_0x3cc866['createPositionFromPath'](_0x48b9e6,_0x4a7806['end']['path']['slice']())),_0x670a57=new _0x4bf24d(_0x4e3e2b,null,_0x428fed,_0x3cc866['markers'],!0x0,_0x43986a++);_0x1121c7['push'](_0x670a57);}}if(_0xac3921)for(const [_0x7391e3,_0x57d1c3]of Object['entries'](_0xac3921)){const _0x687e6=_0x3cc866['document']['getRoot'](_0x7391e3);if(!_0x687e6)throw new _0x506387('multi-root-editor-root-attributes-no-root',null);for(const [_0x1f1385,_0x2f4705]of Object['entries'](_0x57d1c3))if(null!==_0x2f4705){const _0x1f58c3=new _0x42fa76(_0x687e6,_0x1f1385,null,_0x2f4705,_0x43986a++);_0x1121c7['push'](_0x1f58c3);}}return _0x1121c7;}async _loadRoot(_0x655010,_0x1c4e86,_0x100d18){this['_getOperationsFromInitData']({[_0x655010]:_0x1c4e86},{[_0x655010]:_0x100d18})['forEach']((_0x388e19,_0x5dc0a5)=>{_0x388e19['baseVersion']=this['_document']['version']+_0x5dc0a5,_0x388e19['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x388e19);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x2cde52,_0x432bb2){let _0x290412;this['_offset']=_0x2cde52['offset'];const _0x50c0b1=_0x2cde52['wereChangesApplied']&&!_0x2cde52['initData'],_0x83457f=_0x50c0b1?0x0:_0x2cde52['data']['baseVersion'];if(_0x432bb2['forEach'](_0x2142ac=>{_0x2142ac['_isInit']=!0x0,_0x2142ac['createdAt']=_0x2cde52['sessionCreatedAt'],_0x2142ac['_authorId']=null;}),_0x50c0b1)_0x290412=_0x432bb2,this['_applyOperationsSet'](_0x290412,_0x50c0b1);else{if(_0x2cde52['initData']){const _0x3e7447=this['_getOperationsFromInitData'](_0x2cde52['initData']);this['_document']['history']['version']=-_0x3e7447['length'],_0x3e7447['forEach'](_0x48c92c=>{_0x48c92c['baseVersion']-=_0x3e7447['length'],_0x48c92c['createdAt']=_0x2cde52['sessionCreatedAt'],_0x48c92c['_isInit']=!0x0,_0x48c92c['_authorId']=null;}),this['_applyOperationsSet'](_0x3e7447,!0x0),this['serverHistory']['version']=-_0x3e7447['length']+this['_offset'],this['_updateServerHistory'](_0x3e7447);}this['_document']['history']['version']=_0x83457f,_0x290412=this['_decompressOperations'](_0x2cde52['data'],_0x2cde52['metadata']),await this['_fetchMissingUsers'](_0x290412),this['_applyOperationsSet'](_0x290412,_0x50c0b1);}_0x2cde52['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x290412,_0x2cde52['lastOperationId']),this['_lastSyncedOperationId']=_0x2cde52['lastOperationId']),this['serverHistory']['version']=_0x83457f+this['_offset'],this['_updateServerHistory'](_0x290412),_0x432bb2['filter'](_0x2d95ee=>{const _0x12906b=this['_getAffectedRoot'](_0x2d95ee);return _0x12906b&&!this['_knownRootNames']['has'](_0x12906b);})['forEach']((_0x511796,_0x438f16)=>{_0x511796['baseVersion']=this['_document']['version']+_0x438f16,this['_saveOperationInBuffer'](_0x511796);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x1de0a0,_0x305af5){const _0x4235bb=_0x305af5&&_0x305af5['message'];if(_0x4235bb&&_0x4235bb['startsWith']('realtimecollaborationclient'))throw _0x305af5;const _0x5e9b9a=this['editor']['plugins']['get'](J);throw this['_isPendingUpdate']=!0x0,_0x5e9b9a['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x506387(_0x1de0a0,this['editor'],_0x4235bb?{'originalError':_0x4235bb}:void 0x0);}_saveOperationInBuffer(_0x2eb748){this['_knownOperations']['has'](_0x2eb748)||(this['_knownOperations']['add'](_0x2eb748),this['_bufferedOperations']['push'](_0x2eb748),this['_pendingAction']||'marker'==_0x2eb748['type']&&!_0x2eb748['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0xa44483=!0x1){!_0xa44483&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2a5056=>{_0x2a5056&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x30a567=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x384192){return _0x384192['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x384192['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x384192['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x30a567)||this['_crash'](_0x30a567['message'],_0x30a567);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x223454=>{this['on']('change:_isPendingUpdate',()=>{_0x223454();});});}async _sendBufferedOperations(){const _0x452f23=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x452f23['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x22974c=[...this['_bufferedOperations']];for(const _0x3be03e of _0x22974c)_0x3be03e['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3be03e);const _0x3efa6c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x22974c),_0x4943b9=st++,_0x519184=this['_compressOperations'](_0x22974c),_0x1d2e59=await this['_service']['sendOperations'](_0x519184,_0x519184['baseVersion'],_0x3efa6c);try{return await this['_handleServerResponse'](_0x22974c,_0x1d2e59,_0x4943b9);}catch(_0x17221c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x17221c);}}async['_handleServerResponse'](_0x53ec20,_0x31f76e,_0x101d64){if('error'in _0x31f76e)throw _0x31f76e['error'];let _0x46d2f8;if(_0x31f76e['wereChangesApplied']){_0x31f76e['lastOperationId']&&(this['_lastSyncedOperationId']=_0x31f76e['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x576973=>!_0x53ec20['includes'](_0x576973));for(const _0x54e8d9 of _0x53ec20)_0x54e8d9['createdAt']='lastOperationAcceptedAt'in _0x31f76e&&_0x31f76e['lastOperationAcceptedAt']||void 0x0;ot(_0x53ec20,_0x31f76e['version']-_0x53ec20['length']),this['_updateServerHistory'](_0x53ec20);const _0x367da7=_0x53ec20['filter'](_0x1730d8=>{if(!_0x1730d8['_isInit'])return!0x1;const _0x150b69=this['_getAffectedRoot'](_0x1730d8);return _0x150b69&&!this['_knownRootNames']['has'](_0x150b69);});ot(_0x367da7,this['_document']['version']),this['_applyOperationsSet'](_0x367da7),_0x46d2f8=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x2aafd4=this['_decompressOperations'](_0x31f76e['data'],_0x31f76e['metadata'])['filter'](_0x572110=>_0x572110['baseVersion']>=this['_lastServerVersion']);_0x2aafd4['forEach'](_0x131a0e=>this['_addKnownRoot'](_0x131a0e)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3f9720=>!_0x3f9720['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3f9720))),this['_bufferedOperations']['length']&&ot(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x2aafd4),_0x46d2f8=this['_handleExternalOperations'](_0x2aafd4,_0x31f76e['version'],_0x31f76e['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x46d2f8?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x28f5bc,_0x167a71,_0x102451){try{const _0x3f2f0f={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x45adff,operationsB:_0x53b8d6,originalOperations:_0xfe5386}=_0x25b084(_0x28f5bc,this['_bufferedOperations'],_0x3f2f0f);ot(_0x45adff,this['_document']['version']),ot(_0x53b8d6,_0x167a71);for(const _0x45d070 of _0x45adff){const _0x148670=_0xfe5386['get'](_0x45d070);_0x148670?(_0x45d070['_authorId']=_0x148670['_authorId'],'noop'!==_0x45d070['type']&&(_0x45d070['_aiSource']=_0x148670['_aiSource'])):_0x45d070['_authorId']=null;}for(const _0xe41cd6 of _0x53b8d6)'noop'!==_0xe41cd6['type']&&(_0xe41cd6['_aiSource']=_0xfe5386['get'](_0xe41cd6)?.['_aiSource']);_0x102451&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x28f5bc,_0x102451),this['_lastSyncedOperationId']=_0x102451),this['_bufferedOperations']=[..._0x53b8d6],this['_applyOperationsSet'](_0x45adff),this['_updateServerHistory'](_0x28f5bc);}catch(_0x3c169d){return console['error'](_0x3c169d),!0x1;}return!0x0;}_applyOperationsSet(_0x34dd67,_0x4c5b76=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x10a899=>{for(const _0x358306 of _0x34dd67)this['_knownOperations']['add'](_0x358306),this['_addKnownRoot'](_0x358306),_0x10a899['batch']['addOperation'](_0x358306),this['editor']['model']['applyOperation'](_0x358306);});}_addKnownRoot(_0x526e5f){const _0x2477d8=this['_getAffectedRoot'](_0x526e5f);_0x2477d8&&this['_knownRootNames']['add'](_0x2477d8);}_getAffectedRoot(_0x33999a){let _0x3ec4d0,_0x157549;switch(_0x33999a['type']){case'insert':_0x3ec4d0=_0x33999a['position']['root'];break;case'marker':if(_0x157549=_0x33999a['newRange'],!_0x157549)return null;_0x3ec4d0=_0x157549['root'];break;case'addRootAttribute':_0x3ec4d0=_0x33999a['root'];break;case'addRoot':_0x3ec4d0=_0x33999a['affectedSelectable'];break;case'move':_0x3ec4d0=_0x33999a['targetPosition']['root'];break;default:return null;}return _0x3ec4d0['rootName'];}_updateServerHistory(_0x2fe28e){_0x2fe28e['forEach'](_0x389063=>{const _0x41a4ca=_0x389063['clone']();_0x41a4ca['_authorId']=_0x389063['_authorId'],_0x41a4ca['_isInit']=!!_0x389063['_isInit'],_0x41a4ca['_aiSource']=_0x389063['_aiSource'],_0x41a4ca['createdAt']=_0x389063['createdAt'],_0x41a4ca['baseVersion']+=this['_offset'],_0x389063['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x41a4ca),this['serverHistory']['addOperation'](_0x41a4ca);});}_handleReconnectionError(_0x12a33f){const _0x4ac8f1=this['editor']['plugins']['get']('Notification'),_0x5a2b84=this['editor']['locale'];_0x12a33f||(_0x12a33f=et(_0x5a2b84,'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.')),_0x4ac8f1['showWarning'](_0x12a33f,{'title':et(_0x5a2b84,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](J)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x5d7b3b)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x5d7b3b)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x21207c){const _0x19b94e=_0x21207c['map'](_0x2ccf6a=>_0x2ccf6a['toJSON']());return this['_compressor']['compress'](_0x19b94e);}_decompressOperations(_0x2b3c3b,_0x6b3b69){return this['_compressor']['decompress'](_0x2b3c3b)['map']((_0x1cfceb,_0x1283e4)=>{const _0x23fb98='init'==_0x6b3b69[_0x1283e4]['type'];if('InsertOperation'==_0x1cfceb['__className']){const _0x478312=_0x1cfceb['position']['root'];!this['_document']['getRoot'](_0x478312)&&(this['_document']['createRoot']('$unknown',_0x478312)['_isAttached']=!0x1);}else{if('RootOperation'==_0x1cfceb['__className']){const _0x3a70ac=this['_document']['getRoot'](_0x1cfceb['rootName']);_0x3a70ac&&'$unknown'==_0x3a70ac['name']&&_0x1cfceb['elementName']!=_0x3a70ac['name']&&(_0x3a70ac['name']=_0x1cfceb['elementName']);}}const _0x424eb8=_0x1f62bf['fromJSON'](_0x1cfceb,this['_document']);return _0x424eb8['wasUndone']=_0x1cfceb['wasUndone'],_0x424eb8['_isInit']=_0x23fb98,_0x424eb8['_authorId']=_0x23fb98?null:_0x6b3b69[_0x1283e4]['userId'],_0x424eb8['_isDisconnection']='cs:removeUser'===_0x6b3b69[_0x1283e4]['type'],_0x424eb8['_aiSource']=_0x1cfceb['_aiSource']||void 0x0,_0x424eb8['createdAt']=_0x6b3b69[_0x1283e4]['createdAt'],_0x424eb8;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x449f75=this['editor']['plugins']['get'](Q)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x449f75&&_0x449f75['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function ot(_0x479e36,_0x4a657f){for(const _0x48eeb3 of _0x479e36)_0x48eeb3['baseVersion']=_0x4a657f++;}var rt=class{_ignoredOperations;_operationToId;constructor(_0x3b66c5){this['_ignoredOperations']=_0x3b66c5,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x40a619){let _0x2981c8=_0x40a619['length'];for(;_0x2981c8--;){const _0x115af3=_0x40a619[_0x2981c8];if(!this['_ignoredOperations']['has'](_0x115af3)){if(!this['_operationToId']['has'](_0x115af3)){const _0x1decea=_0x1595fb()['slice'](0x1,0x12);this['_operationToId']['set'](_0x115af3,_0x1decea);}return this['_operationToId']['get'](_0x115af3);}}}setIdForTheLastOperation(_0x20b9c7,_0x4ef7c2){if(!_0x4ef7c2)return;let _0x4291c3=_0x20b9c7['length'];for(;_0x4291c3--;){const _0x3ac80a=_0x20b9c7[_0x4291c3];this['_ignoredOperations']['has'](_0x3ac80a)||this['_operationToId']['set'](_0x3ac80a,_0x4ef7c2);}}},ct=class extends _0x1ef3e5{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class CloudServicesCommentsAdapter extends _0x566254{static CommentsService=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x46c038)());['_services'];static get requires(){return[J,_0xb6c8ae,Q,_0x309335];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3a4c0d){super(_0x3a4c0d),this['_services']=new Map();}async init(){const _0x40a4fd=this['context'],_0x29edfc=_0x40a4fd['plugins']['get'](_0xb6c8ae);if(_0x40a4fd['plugins']['get'](J)['addToReconnectionStack'](this),_0x29edfc['adapter']={'addCommentThread':async({channelId:_0x3a29e6,threadId:_0x309e5a,comments:_0xde44c7,resolvedAt:_0x751b03,resolvedBy:_0x52a3a6,context:_0x2a6990,attributes:_0x5873cd})=>{const _0x24f7ef=await this['_getService'](_0x3a29e6)['addCommentThread']({'commentThreadId':_0x309e5a,'comments':_0xde44c7['map'](_0x5ede7d=>function(_0x259d89,_0x28f39d,_0x5848da){return{'commentThreadId':_0x5848da,'commentId':_0x259d89['commentId'],'userId':_0x259d89['authorId'],'content':_0x259d89['content'],'documentId':_0x28f39d,'createdAt':_0x259d89['createdAt'],'attributes':_0x259d89['attributes']||{}};}(_0x5ede7d,_0x3a29e6,_0x309e5a)),'resolvedAt':_0x751b03,'resolvedBy':_0x52a3a6,'context':_0x2a6990,'attributes':_0x5873cd})['catch'](lt);return{'threadId':_0x24f7ef['commentThreadId'],'comments':_0x24f7ef['comments']};},'getCommentThread':async({channelId:_0x27e08b,threadId:_0x1d2e91})=>{const _0x5b3d54=await this['_getService'](_0x27e08b)['getCommentThread'](_0x1d2e91)['catch'](ht)['catch'](lt);return _0x5b3d54?_0x5b3d54['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5b3d54]),{'threadId':_0x5b3d54['commentThreadId'],'comments':_0x5b3d54['comments']['map'](dt),'context':_0x5b3d54['context'],'resolvedAt':_0x5b3d54['resolvedAt'],'resolvedBy':_0x5b3d54['resolvedBy'],'attributes':_0x5b3d54['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x329d95,threadId:_0x18f306,context:_0x10c8df,unlinkedAt:_0x1b19a8,attributes:_0x4e66f5})=>this['_getService'](_0x329d95)['updateCommentThread']({'commentThreadId':_0x18f306,'context':_0x10c8df,'attributes':_0x4e66f5,'unlinkedAt':_0x1b19a8})['catch'](ht)['catch'](lt),'resolveCommentThread':async({channelId:_0x2a8e21,threadId:_0x58c18})=>{const _0x16eae5=await this['_getService'](_0x2a8e21)['resolveCommentThread'](_0x58c18)['catch'](ht)['catch'](lt);return{'threadId':_0x16eae5['commentThreadId'],'resolvedAt':_0x16eae5['resolvedAt'],'resolvedBy':_0x16eae5['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3ddfeb,threadId:_0x337fd8})=>this['_getService'](_0x3ddfeb)['reopenCommentThread'](_0x337fd8)['catch'](ht)['catch'](lt),'removeCommentThread':({channelId:_0x4db2fc,threadId:_0x56f3c5})=>this['_getService'](_0x4db2fc)['removeCommentThread'](_0x56f3c5)['catch'](ht)['catch'](lt),'addComment':({channelId:_0x463b7e,threadId:_0x1cd326,commentId:_0x3abfde,content:_0x6799c4,attributes:_0x5ca45c})=>this['_getService'](_0x463b7e)['addComment'](_0x1cd326,_0x3abfde,_0x6799c4,_0x5ca45c)['catch'](lt),'updateComment':({channelId:_0x13ff3c,threadId:_0xdf2fc1,commentId:_0x125087,content:_0x286e3d,attributes:_0x451897})=>this['_getService'](_0x13ff3c)['updateComment'](_0xdf2fc1,_0x125087,_0x286e3d,_0x451897)['catch'](ht)['catch'](lt),'removeComment':({channelId:_0x2db223,threadId:_0x5189c7,commentId:_0x1caf68})=>this['_getService'](_0x2db223)['removeComment'](_0x5189c7,_0x1caf68)['catch'](ht)['catch'](lt)},_0x40a4fd instanceof _0x52494c){const _0x1893d5=_0x40a4fd['config']['get']('collaboration.channelId'),_0xeaff2a=_0x40a4fd['plugins']['get'](Q);await this['_setUpService'](_0x1893d5);const _0x208d86=await this['_services']['get'](_0x1893d5)['getConnectedSessions']();this['listenTo'](_0xeaff2a,'sessionAdd:'+_0x1893d5,(_0x3c05fc,{session:_0x46d036})=>{_0x46d036['id']===_0xeaff2a['mySessionId']&&(_0x3c05fc['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x46d036['permissions'],_0x1893d5));}),_0xeaff2a['register'](_0x1893d5,_0x208d86);}}async _setUpService(_0x1d2286){if(this['_services']['has'](_0x1d2286))throw new _0x506387('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x1d2286});const _0xe7536a=this['context']['plugins']['get'](_0xb6c8ae),_0x701021=new CloudServicesCommentsAdapter['CommentsService'](_0x1d2286);this['_services']['set'](_0x1d2286,_0x701021),this['listenTo'](_0x701021,'commentThreadAdded',(_0x3a0f98,_0x35669b)=>{const {commentThreadId:_0x5a554b,documentId:_0x4f2195,context:_0x5e6b46,attributes:_0x832baa,resolvedAt:_0x3e877c,resolvedBy:_0x3e2bf3,comments:_0xae121e}=_0x35669b;_0xe7536a['getCommentThread'](_0x5a554b)||_0xe7536a['addCommentThread']({'threadId':_0x5a554b,'channelId':_0x4f2195,'comments':_0xae121e?_0xae121e['map'](dt):[],'context':_0x5e6b46,'attributes':_0x832baa,'resolvedAt':_0x3e877c,'resolvedBy':_0x3e2bf3,'isFromAdapter':!0x0});}),this['listenTo'](_0x701021,'commentThreadUpdated',(_0x58db8e,{commentThreadId:_0x56d16d,documentId:_0xae9c7f,context:_0x26db05,unlinkedAt:_0x446cdf,attributes:_0x4ae684})=>{_0xe7536a['getCommentThread'](_0x56d16d)&&_0xe7536a['updateCommentThread']({'threadId':_0x56d16d,'channelId':_0xae9c7f,'context':_0x26db05,'unlinkedAt':_0x446cdf,'attributes':_0x4ae684,'isFromAdapter':!0x0});}),this['listenTo'](_0x701021,'commentThreadResolved',(_0x1c8583,{commentThreadId:_0xf116d5,resolvedBy:_0xdc00b5,resolvedAt:_0x2e41ec})=>{const _0x3a24ea=_0xe7536a['getCommentThread'](_0xf116d5);_0x3a24ea&&_0x3a24ea['resolve']({'resolvedBy':_0xdc00b5,'resolvedAt':_0x2e41ec,'isFromAdapter':!0x0});}),this['listenTo'](_0x701021,'commentThreadReopened',(_0xd3f372,{commentThreadId:_0x10623c})=>{const _0x550e73=_0xe7536a['getCommentThread'](_0x10623c);_0x550e73&&_0x550e73['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x701021,'commentThreadRemoved',(_0x59dd3c,{commentThreadId:_0xd8e890})=>{const _0x1b7bb9=_0xe7536a['getCommentThread'](_0xd8e890);_0x1b7bb9&&_0x1b7bb9['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x701021,'commentAdded',(_0x531978,_0x57bf9e)=>{const _0x5e1bd4=_0x57bf9e['commentThreadId'],_0x20ca0b=_0xe7536a['getCommentThread'](_0x5e1bd4);_0x20ca0b&&_0x20ca0b['addComment']({...dt(_0x57bf9e),'isFromAdapter':!0x0});}),this['listenTo'](_0x701021,'commentUpdated',(_0x21c13d,{commentThreadId:_0x4eaf24,commentId:_0x4bb465,content:_0x270340,attributes:_0x127b6e})=>{const _0x3b416c=_0xe7536a['getCommentThread'](_0x4eaf24);if(_0x3b416c){const _0x544a83=_0x3b416c['getComment'](_0x4bb465);_0x544a83&&_0x544a83['update']({'content':_0x270340,'attributes':_0x127b6e,'isFromAdapter':!0x0});}}),this['listenTo'](_0x701021,'commentRemoved',(_0x3aa705,{commentThreadId:_0x466977,commentId:_0x9e0919})=>{const _0x901204=_0xe7536a['getCommentThread'](_0x466977);if(_0x901204){const _0x3df22c=_0x901204['getComment'](_0x9e0919);_0x3df22c&&_0x3df22c['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x701021,'disconnected',()=>{'connected'===this['context']['plugins']['get'](J)['connection']?.['state']&&(this['_services']['delete'](_0x1d2286),this['stopListening'](_0x701021));}),await this['_connectService'](_0x1d2286);}destroy(){if(this['context']instanceof _0x52494c){const _0x5e28cb=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x5e28cb)&&this['_terminateService'](_0x5e28cb);}}_terminateService(_0x130672){if(!this['_services']['has'](_0x130672))throw new _0x506387('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x130672});this['_getService'](_0x130672)['disconnect'](),this['_services']['delete'](_0x130672);}async reconnect(){for(const _0x29d3b6 of this['_services']['keys']())await this['_connectService'](_0x29d3b6);if(this['context']instanceof _0x52494c){const _0x5ea1e7=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x5ea1e7)){const _0x43bd1f=this['context']['plugins']['get'](Q);_0x43bd1f['unregister'](_0x5ea1e7);const _0x1706ea=await this['_services']['get'](_0x5ea1e7)['getConnectedSessions']();_0x43bd1f['register'](_0x5ea1e7,_0x1706ea);}}}async _connectService(_0x13deff){const {connection:_0x3b7786}=this['context']['plugins']['get'](J),_0x35ba22=this['context']['plugins']['get'](_0xb6c8ae),_0x3e5a13=await this['_services']['get'](_0x13deff)['connect'](_0x3b7786);await this['_fetchMissingUsersForThreads'](_0x3e5a13);const _0x56f82c=new Set(Array['from'](_0x35ba22['getCommentThreads']({'channelId':_0x13deff}),_0x356142=>_0x356142['id']));for(const _0x2c6b46 of _0x3e5a13)_0x2c6b46['deletedAt']||_0x56f82c['delete'](_0x2c6b46['commentThreadId']);for(const _0x576420 of _0x56f82c)_0x35ba22['getCommentThread'](_0x576420)['remove']({'isFromAdapter':!0x0});for(const _0x1d29b5 of _0x3e5a13){let _0x3d339a=_0x35ba22['getCommentThread'](_0x1d29b5['commentThreadId']);const {commentThreadId:_0x1ed6f7,context:_0x135be7,attributes:_0x4154db,resolvedBy:_0x262b3e,resolvedAt:_0x571e3a,unlinkedAt:_0x14fd9b,deletedAt:_0xa4f8ea}=_0x1d29b5;if(_0xa4f8ea)continue;_0x3d339a||(_0x3d339a=_0x35ba22['addCommentThread']({'channelId':_0x13deff,'threadId':_0x1ed6f7,'context':_0x135be7,'attributes':_0x4154db||{},'resolvedBy':_0x262b3e,'resolvedAt':_0x571e3a,'unlinkedAt':_0x14fd9b,'isFromAdapter':!0x0}));const _0x33ae7e=new Set(Array['from'](_0x3d339a['comments'],_0x4299ec=>_0x4299ec['id']));for(const _0x4964c5 of _0x1d29b5['comments'])_0x33ae7e['delete'](_0x4964c5['commentId']);for(const _0xbc725b of _0x33ae7e)_0x3d339a['getComment'](_0xbc725b)['remove']({'isFromAdapter':!0x0});for(const _0x45acac of _0x1d29b5['comments']){const _0x584c49=_0x3d339a['getComment'](_0x45acac['commentId']);_0x584c49?_0x584c49['content']!==_0x45acac['content']&&_0x584c49['update']({'content':_0x45acac['content'],'isFromAdapter':!0x0}):_0x3d339a['addComment'](Object['assign'](dt(_0x45acac),{'isFromAdapter':!0x0}));}}}_getService(_0x58701f){if(!this['_services']['has'](_0x58701f))throw new _0x506387('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x58701f});return this['_services']['get'](_0x58701f);}async _fetchMissingUsersForThreads(_0x186478){const _0x378763=this['context']['plugins']['get'](_0x309335),{connection:_0x4b6678}=this['context']['plugins']['get'](J),_0x31a8f5=new Set();for(const {resolvedBy:_0x558914,comments:_0x3ab4da}of _0x186478){_0x558914&&!_0x378763['getUser'](_0x558914)&&_0x31a8f5['add'](_0x558914);for(const {userId:_0x1e3b23}of _0x3ab4da)_0x378763['getUser'](_0x1e3b23)||_0x31a8f5['add'](_0x1e3b23);}if(0x0===_0x31a8f5['size'])return;const _0x14b2b8=await _0x1da1c8['getMany'](_0x4b6678,Array['from'](_0x31a8f5));for(const _0x3e8200 of _0x14b2b8)_0x378763['getUser'](_0x3e8200['id'])||_0x378763['addUser'](_0x3e8200);}};async function ht(_0x24e9be){if('404'!==_0x24e9be['code'])throw _0x24e9be;}function lt(_0x245e40){if((_0x19a211=_0x245e40)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x19a211['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x19a211['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x19a211;throw _0x245e40;}function dt(_0x904e9e){return{'threadId':_0x904e9e['commentThreadId'],'commentId':_0x904e9e['commentId'],'content':_0x904e9e['content'],'createdAt':_0x904e9e['createdAt'],'authorId':_0x904e9e['userId'],'attributes':_0x904e9e['attributes']||{}};}var ut=class CloudServicesTrackChangesAdapter extends _0x1ef3e5{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x4babd0)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;static get requires(){return[J,it,_0x2ede9a,Q,_0x309335];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1f0728){super(_0x1f0728);const _0x4b7c0a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x4b7c0a);}async init(){const _0x34fe83=this['editor']['plugins']['get'](it),_0x42ae87=_0x34fe83['serverHistory'],_0x2eb6cc=this['editor']['plugins']['get'](J);this['_revisionTracker']['setSource']({'history':_0x42ae87,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x34fe83['sessionId']});const _0x256fa9=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x535cdb,_0x7aa8b9=await _0x5de62b['isBundleUploaded'](_0x2eb6cc['connection'],_0x256fa9);this['editor']['plugins']['get'](_0x2ede9a)['adapter']={'getRevision':async({revisionId:_0xf8f9ef})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0xf8f9ef)),'updateRevisions':async _0x546deb=>{await this['_waitForServiceReady']();const _0x3ca29b=this['_revisionTracker']['currentRevision'];if(_0x7aa8b9&&0x1===_0x546deb['length']&&_0x546deb[0x0]['id']===_0x3ca29b['id'])return _0x546deb;for(const _0x23c90b of _0x546deb)_0x23c90b['id']===_0x3ca29b['id']&&(_0x23c90b['isEmptyCurrent']=_0x23c90b['fromVersion']===_0x23c90b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x546deb,this['_lastRequestId'])['then'](_0x2ac7be=>(this['_lastRequestId']=_0x2ac7be,_0x546deb))['catch'](_0xb716f6=>{if(vt(_0xb716f6)||'400'===_0xb716f6['code']&&void 0x0!==_0xb716f6['data']['wrongRequestId']){for(const _0x1009df of _0x546deb)this['_revisionTracker']['repository']['getRevision'](_0x1009df['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x1009df['id'],_0x1009df,!0x1);if(vt(_0xb716f6)&&'destroyed'!==this['editor']['state'])throw _0xb716f6;return _0x546deb;}throw _0xb716f6;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x533e6f,{revisionsData:_0x422a46,requestId:_0x1cfd8f})=>{Math['max'](..._0x422a46['map'](_0x68a6e7=>_0x68a6e7['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x422a46,_0x1cfd8f);}):this['_handleRevisionsUpdate'](_0x422a46,_0x1cfd8f);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x2eb6cc['connection']?.['state']&&(_0x2eb6cc['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x458fce,requestId:_0x3493e7}=await this['_revisionHistoryService']['connect'](_0x2eb6cc['connection']);_0x2eb6cc['addToReconnectionStack'](this),this['_lastRequestId']=_0x3493e7,await this['_fetchMissingUsers'](_0x458fce);for(const _0x2c6f8d of _0x458fce)this['_revisionTracker']['addRevisionData'](_0x2c6f8d);this['listenTo'](_0x34fe83,'change:_isConnected',(_0x1bcd03,_0x205c8e,_0x3e3257)=>{_0x3e3257&&(this['_oldOffset']=_0x34fe83['_offset'],_0x1bcd03['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async reconnect(){const _0x16a124=this['editor']['plugins']['get'](J),_0x378e22=this['editor']['plugins']['get'](it),_0xfbbf07=async()=>{const _0x13865b=this['_revisionTracker']['currentRevision'],_0x23821d=_0x13865b['id'],_0x519704=_0x23821d!==_0x378e22['sessionId'];if(_0x519704){const _0x4cb369=_0x378e22['_offset']-this['_oldOffset'],_0x49ecf2=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x13865b['toVersion']+_0x4cb369!==_0x49ecf2){const _0x4ccf71=_0x13865b['fromVersion']+_0x4cb369,_0xd9ee8b=this['editor']['plugins']['get'](_0x309335),_0x2d75a8=this['_revisionTracker']['buildRevisionData']({'revision':_0x13865b,'from':_0x4ccf71,'to':_0x49ecf2});_0x2d75a8['id']=_0x13865b['id'];const _0x5f5902=_0x2d75a8['authorsIds']['map'](_0x9473d5=>_0xd9ee8b['getUser'](_0x9473d5));_0x13865b['_update']({..._0x2d75a8,'authors':_0x5f5902},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x13865b['id'],_0x2d75a8,!0x0);}this['_revisionTracker']['_startingVersion']=_0x49ecf2,_0x13865b['toVersion']!==_0x13865b['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x23821d)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x23821d),this['_revisionTracker']['_createCurrentRevision'](_0x49ecf2);}const {revisions:_0x3f7bd6,requestId:_0x2187cd}=await this['_revisionHistoryService']['reconnect'](_0x16a124['connection'],this['_lastRequestId']);_0x519704&&_0x3f7bd6['length']>0x0?_0x378e22['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3f7bd6),this['_handleRevisionsUpdate'](_0x3f7bd6,_0x2187cd),this['_revisionTracker']['sendBufferedUpdates']());};return _0x378e22['_isConnected']?_0xfbbf07():new Promise((_0x5d55ee,_0x2aeea6)=>{_0x378e22['once']('change:_isConnected',()=>{_0xfbbf07()['then'](_0x5d55ee)['catch'](_0x2aeea6);});});}destroy(){super['destroy']();}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5f4d2c=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x2f604a=>{_0x2f604a['off'](),_0x5f4d2c();});});}_getLatestVersionFromServerOperations(){const _0x683b29=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x2b2911 of _0x683b29)if('marker'!==_0x2b2911['type']||_0x2b2911['affectsData'])return _0x2b2911['baseVersion']+0x1;}_getLatestVersion(){const _0x148099=this['editor']['plugins']['get'](it);return new Promise(_0xd4f7a5=>{_0x148099['_isPendingUpdate']?_0x148099['once']('change:_isPendingUpdate',()=>{_0xd4f7a5(this['_getLatestVersionFromServerOperations']());}):_0xd4f7a5(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x467b37,_0x32ac3a){const _0x8f12a8=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x32ac3a;for(const _0x38d9fb of _0x467b37){const _0x7b1973=_0x8f12a8['getRevision'](_0x38d9fb['id']);if(_0x7b1973){if((_0x38d9fb['fromVersion']||_0x38d9fb['toVersion'])&&(_0x38d9fb['diffData']=null),_0x7b1973===this['_revisionTracker']['currentRevision']){const _0x283236=Math['max'](_0x7b1973['toVersion'],_0x38d9fb['toVersion']),_0x2bab10=Math['max'](_0x7b1973['fromVersion'],_0x38d9fb['fromVersion']);let _0x315301;_0x7b1973['toVersion']===_0x38d9fb['toVersion']&&_0x7b1973['fromVersion']===_0x38d9fb['fromVersion']?(_0x315301=!0x0,this['_preventResendingRevisionData'](_0x38d9fb)):_0x38d9fb['toVersion']===_0x283236&&_0x38d9fb['fromVersion']===_0x2bab10?_0x315301=!0x1:(_0x7b1973['toVersion']===_0x283236&&_0x7b1973['fromVersion']===_0x2bab10||this['_fixRevision']({'revision':_0x7b1973,'from':_0x2bab10,'to':_0x283236}),_0x315301=!0x0),_0x315301&&(delete _0x38d9fb['fromVersion'],delete _0x38d9fb['toVersion'],delete _0x38d9fb['diffData'],delete _0x38d9fb['createdAt'],delete _0x38d9fb['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x38d9fb),this['_preventResendingRevisionData'](_0x38d9fb);}else this['_revisionTracker']['addRevisionData'](_0x38d9fb);}const _0x2d7034=_0x8f12a8['getRevisions']();_0x2d7034['reverse']();for(let _0x22fa72=0x0;_0x22fa72<_0x2d7034['length']-0x1;_0x22fa72++){const _0x2151ee=_0x2d7034[_0x22fa72],_0x4e4047=_0x2d7034[_0x22fa72+0x1];if(_0x2151ee['fromVersion']<_0x4e4047['toVersion']){const _0x4e7a54=_0x4e4047['toVersion'],_0x5d2310=Math['max'](_0x4e7a54,_0x2151ee['toVersion']);this['_fixRevision']({'revision':_0x2151ee,'from':_0x4e7a54,'to':_0x5d2310});}}}['_fixRevision']({revision:_0x2a5236,from:_0x138889,to:_0x177083}={}){const _0xe3bfef=this['editor']['plugins']['get'](_0x309335),_0x37b24b=this['_revisionTracker']['buildRevisionData']({'revision':_0x2a5236,'from':_0x138889,'to':_0x177083});_0x37b24b['authors']=_0x37b24b['authorsIds']['map'](_0x46fa20=>_0xe3bfef['getUser'](_0x46fa20)),_0x2a5236['_update'](_0x37b24b);}_preventResendingRevisionData(_0x47b8bf){const _0x5c4a21={};_0x5c4a21['id']=_0x47b8bf['id'];for(const _0x496979 of Object['keys'](_0x47b8bf))'id'!==_0x496979&&(_0x5c4a21[_0x496979]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5c4a21['id'],_0x5c4a21,!0x0);}async _fetchMissingUsers(_0x251641){const _0x1ce847=this['editor']['plugins']['get'](_0x309335),{connection:_0x19be20}=this['editor']['plugins']['get'](J),_0x1bfb27=new Set();for(const _0x3e5221 of _0x251641){for(const _0x59e8c1 of _0x3e5221['authorsIds'])_0x4742c9(_0x59e8c1);_0x3e5221['creatorId']&&_0x4742c9(_0x3e5221['creatorId']);}if(0x0===_0x1bfb27['size'])return;const _0x41145=await _0x1da1c8['getMany'](_0x19be20,Array['from'](_0x1bfb27));for(const _0x11ec40 of _0x41145)_0x1ce847['getUser'](_0x11ec40['id'])||_0x1ce847['addUser'](_0x11ec40);function _0x4742c9(_0x2d6d57){_0x1ce847['getUser'](_0x2d6d57)||_0x1bfb27['add'](_0x2d6d57);}}};function vt(_0x22abc6){return _0x22abc6['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x22abc6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x22abc6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var _t=class extends _0x1ef3e5{static get requires(){return[_0x2ede9a,wt,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},yt=class extends _0x33a1e3{_collapseAt;constructor(_0x250ff2,_0x6c642f=0x6){super(_0x250ff2);const _0x3e535f=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x6c642f,this['bind']('isHidden')['to'](this,'usersCount',_0x49079a=>_0x49079a<_0x6c642f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3e535f['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':_0x3e535f['to']('usersCount',_0xb80fab=>'+'+(_0xb80fab-this['_collapseAt']+0x2)['toString']())}]}]}]});}},bt=class extends _0x33a1e3{items;keystrokes;constructor(_0x1d5ec7){super(_0x1d5ec7);const _0x188c44=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x593e5d(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x188c44['if']('hasPopup'),'aria-expanded':_0x188c44['to']('isExpanded',_0x329e74=>this['hasPopup']&&String(_0x329e74)),'aria-label':_0x188c44['to']('hasPopup',_0x9d7cd4=>et(_0x1d5ec7,_0x9d7cd4?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x188c44['to']('hasPopup',_0x4c908e=>!!_0x4c908e&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0x53ffd2,_0xa3060d,_0x1b9580)=>{this['element']&&(_0x1b9580?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']);}},kt=class extends _0x33a1e3{counterView;inlineListView;constructor(_0x43488f,_0x38d1d9=0x6){super(_0x43488f);const _0x582d13=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new yt(this['locale'],_0x38d1d9),this['inlineListView']=new bt(_0x43488f),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x49efd4 of this['inlineListView']['items'])_0x49efd4['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',_0x582d13['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},It=class extends _0x33a1e3{listWrapperView;constructor(_0x50ad38,_0x1f4185){super(_0x50ad38),this['listWrapperView']=new St(_0x50ad38,_0x1f4185),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0x50ad38,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},St=class extends _0x13406a{constructor(_0x64b6de,_0x52f571){super(_0x64b6de);const _0x10a70f=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x52f571?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x10a70f['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x10a70f['to']('role'),'aria-label':_0x10a70f['to']('ariaLabel'),'aria-labelledby':_0x10a70f['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x34368d['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x615d44=this['element'];_0x615d44&&(this['_isScrollable']=Math['max'](_0x615d44['scrollHeight'],_0x615d44['clientHeight'])>0.8*window['innerHeight']);}},Tt=class extends _0x148dcf{['userView'];constructor(_0x143561,_0x13a881,_0x4db114){super(_0x143561);const _0x1ca5aa=this['bindTemplate'];this['userView']=new _0x497636(_0x143561,_0x13a881);const _0xa50bdc={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x13a881['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x13a881['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x13a881['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x13a881['color']['getColorVariable'](),'--ck-user-color-alpha':_0x13a881['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x4db114&&(_0xa50bdc['tag']='button',_0xa50bdc['on']={'click':_0x1ca5aa['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xa50bdc);}['focus'](){this['element']['focus']();}},Ct=class extends _0x33a1e3{['userView'];['markerView'];constructor(_0x472bae,_0x8e494,_0x5d88f2){super(_0x472bae);const _0x3f4200=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x497636(_0x472bae,_0x8e494),this['markerView']=new At(_0x472bae,_0x8e494);const _0x418716=new _0x36004a(_0x472bae);_0x418716['template']['tag']='span',_0x418716['text']=_0x8e494['name'];const _0x4c75f0={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x3f4200['to']('isFocusable',_0x18a330=>!!_0x18a330&&0x0),'aria-labelledby':_0x418716['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x3f4200['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x3f4200['to']('hasTooltip',_0x978e6c=>!_0x978e6c),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x418716]};_0x5d88f2&&(_0x4c75f0['tag']='button',_0x4c75f0['on']={'click':_0x3f4200['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4c75f0);}},At=class extends _0x33a1e3{constructor(_0x1fbae4,_0x1672c8){super(_0x1fbae4),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1672c8['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x1672c8['color']['getColorVariable'](),'--ck-user-color-alpha':_0x1672c8['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Pt={'collapseAt':0x6,'displayMe':!0x0};var Ot=class extends _0x566254{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1f6c6f){super(_0x1f6c6f),this['context']['config']['define']('presenceList',Pt);const _0x5737ab=_0x1f6c6f['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x5737ab)throw new _0x506387('presencelist-collapseat-invalid-format',this);if(_0x5737ab<0x1)throw new _0x506387('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Q)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2ae756(),this['balloonPanelView']=new _0x29e4cc(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[Q];}init(){for(const _0x19044f of this['_allConnectedUsers'])this['_handleUserAdd'](_0x19044f);this['listenTo'](this['_allConnectedUsers'],'add',(_0x3e67d7,_0x147595)=>{this['_handleUserAdd'](_0x147595);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x518059,_0x4b1487)=>{this['_handleUserRemove'](_0x4b1487);});}_createView(){const _0x9c4203=this['context'],_0x1a45bf=new kt(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4768ec=this['balloonPanelView'];if(!_0xd4ae81(_0x9c4203['config']['get']('presenceList.container')))throw new _0x506387('presencelist-missing-container',this);_0x1a45bf['counterView']['bind']('usersCount')['to'](this),_0x1a45bf['bind']('isCollapsed')['to'](this,'usersCount',_0x4a6a30=>{const {collapseAt:_0x1d1088}=_0x9c4203['config']['get']('presenceList'),_0x4abf99=_0x4a6a30>=_0x1d1088;if(_0x4abf99&&!_0x1a45bf['inlineListView']['items']['find'](_0x415c8e=>_0x415c8e instanceof yt)){const _0xfa093b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0xfa093b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x1a45bf['inlineListView']['items']['add'](_0x1a45bf['counterView']);}return _0x4abf99||this['hideDropdown'](),_0x4abf99;}),_0x1a45bf['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xc88f21=>{const _0x54c6d8=_0x9c4203['config']['get']('presenceList'),_0x553fb5=new Ct(_0x9c4203['locale'],_0xc88f21,!!_0x54c6d8['onClick']);return _0x553fb5['bind']('hasTooltip')['to'](_0x1a45bf,'isCollapsed',_0x2d8af4=>!_0x2d8af4),_0x553fb5['bind']('isFocusable')['to'](_0x1a45bf,'isCollapsed',_0x4e6c47=>!_0x4e6c47),_0x54c6d8['onClick']&&this['listenTo'](_0x553fb5,'execute',()=>{this['view']['isCollapsed']||_0x54c6d8['onClick'](_0xc88f21,_0x553fb5['element']);}),_0x553fb5;}),_0x1a45bf['inlineListView']['keystrokes']['set']('Enter',(_0x512170,_0xa5d598)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0xa5d598());}),_0x1a45bf['render'](),_0x4768ec['render'](),_0x1a45bf['listenTo'](_0x1a45bf['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x47e514=(_0x554ddd,_0x4bda4f)=>{this['_hideDropdownUnlessPointerInside'](_0x4bda4f);};return _0x1a45bf['listenTo'](_0x1a45bf['inlineListView']['element'],'mouseleave',_0x47e514),_0x1a45bf['listenTo'](_0x4768ec['element'],'mouseleave',_0x47e514),_0x13785d({'emitter':_0x1a45bf,'activator':()=>_0x4768ec['isVisible'],'contextElements':[_0x4768ec['element'],_0x1a45bf['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x9c4203['config']['get']('presenceList.container')['appendChild'](_0x1a45bf['element']),this['_overlayHost']=new _0x20b1a3(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x1a45bf;}_resolveOverlayTarget(){const _0x317abb=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x317abb)return _0x317abb;const _0x93b148=this['context']['config']['get']('presenceList.container');return _0x93b148?_0x3b9441(_0x93b148):null;}['_handleUserAdd'](_0xe4a208){if(!this['context']['config']['get']('presenceList.displayMe')&&_0xe4a208['isMe'])return;const _0x5ca2ce=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x5ca2ce-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x1373e3=_0xe4a208['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0xe4a208,_0x1373e3);}['_handleUserRemove'](_0x447406){this['usersCount']--;const {collapseAt:_0x547cdc}=this['context']['config']['get']('presenceList'),_0x4909cf=this['usersCount']>=_0x547cdc;if(this['currentDisplayedUsers']['get'](_0x447406['id']))this['currentDisplayedUsers']['remove'](_0x447406['id']);else{if(_0x4909cf&&this['currentDisplayedUsers']['length']+0x1===_0x547cdc-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x4909cf?0x1:0x0)<this['usersCount']){for(const _0x4d467d of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4d467d['id'])&&(this['currentDisplayedUsers']['add'](_0x4d467d,Math['min'](this['currentDisplayedUsers']['length']-(_0x4909cf?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x4909cf?0x1:0x0)===_0x547cdc-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x388b66=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new It(this['context']['locale'],!!_0x388b66['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0xf81067}=this['presenceDropdownView'];_0xf81067['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x12279d=>{if(!_0x388b66['displayMe']&&_0x12279d['isMe'])return null;const _0x4b83b7=new Tt(this['context']['locale'],_0x12279d,!!_0x388b66['onClick']);return _0x388b66['onClick']&&this['listenTo'](_0x4b83b7,'execute',()=>{_0x388b66['onClick'](_0x12279d,_0x4b83b7['element']);}),_0x4b83b7;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0xf81067['focus'](),_0xf81067['checkIfScrollable']();const _0x4f10bb=(_0x360d5c,_0x3394c8)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3394c8();};_0xf81067['keystrokes']['set']('Esc',_0x4f10bb),_0xf81067['keystrokes']['set']('Shift+Tab',_0x4f10bb),_0xf81067['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0xf81067['focusTracker']['add'](this['view']['element']),_0xf81067['focusTracker']['on']('change:isFocused',(_0x2b29b3,_0x544e3c,_0x59acef)=>{_0x59acef||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}_hideDropdownUnlessPointerInside(_0x3b7302){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x33f842=>_0x300a14(_0x33f842,_0x3b7302))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},xt=class extends _0x566254{static get requires(){return[Q,Ot];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{at as CloudServicesCommentsAdapter,wt as CloudServicesRevisionHistoryAdapter,ut as CloudServicesTrackChangesAdapter,xt as PresenceList,Ot as PresenceListUI,it as RealTimeCollaborationClient,pt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,_t as RealTimeCollaborativeRevisionHistory,gt as RealTimeCollaborativeTrackChanges,Q as Sessions,J as WebSocketGateway};
|
|
23
|
+
import{Context as _0x5bdd40,ContextPlugin as _0x15a293,PendingActions as _0x308c72,Plugin as _0x25a63a}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x287bee,Collection as _0x42c4d2,DomEmitterMixin as _0x2db052,KeystrokeHandler as _0x39c9b2,getOverlayMountRoot as _0x337ae7,global as _0x37a491,trustedHtml as _0x52cbeb,uid as _0x293c9a,version as _0x2f0ce3}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x5d38fc,LabelView as _0x24defb,ListItemView as _0x182c65,ListView as _0x2bdca1,Notification as _0x5013db,OverlayHost as _0x4e3b41,View as _0x3395c3,clickOutsideHandler as _0x3b4e81}from'@ckeditor/ckeditor5-ui';import{History as _0x33cb2b,InsertOperation as _0x25d45c,MarkerOperation as _0x35d9e3,ModelLiveRange as _0x198acf,NoOperation as _0x4389ac,OperationFactory as _0x2e3823,RootAttributeOperation as _0x27224b,transformOperationSets as _0x2c58db}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x4053f4}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x5e0c19,CommentsService as _0x4accae,EditorService as _0x31dfe2,RevisionHistoryService as _0xc7a318,TrackChangesService as _0x60c57a,User as _0x111aa6,WEB_SOCKET_GATEWAY_STATES as _0x90bb5f,WebSocketGateway as _0x446651}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x132f1a,Users as _0x1ec951,isPointerStillOver as _0x552395}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x4ac37a}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x2c49db,TrackChangesEditing as _0x3fa8ee}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x5d890b,CommentsEditing as _0x2ee7a0,CommentsRepository as _0x2650ae}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x4aeac8}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x4505f3}from'es-toolkit/compat';var J=class WebSocketGateway extends _0x15a293{static WebSocketGateway=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>_0x446651)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x4053f4,_0x5013db];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5a2f29){super(_0x5a2f29),this['set']('state',_0x90bb5f['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2db052())();}init(){const _0x44958f=this['context'],_0x1cf232=_0x44958f['plugins']['get'](_0x4053f4),_0xe80782=_0x44958f['plugins']['get'](_0x5013db);if(!_0x1cf232['token'])throw new _0x287bee('websocketgateway-missing-token',this);if(!_0x1cf232['webSocketUrl'])throw new _0x287bee('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),WebSocketGateway['WebSocketGateway']['connect'](_0x1cf232['token'],_0x1cf232['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2f0421=>{if(this['connection']=_0x2f0421,this['bind']('state')['to'](_0x2f0421,'state',this,'_isBrowserOffline',(_0x5f0fa8,_0x891a52)=>('connected'!==_0x5f0fa8&&(this['_shouldPluginsReconnect']=!0x0),_0x891a52||_0x5f0fa8!==_0x90bb5f['CONNECTED']?_0x90bb5f['DISCONNECTED']:this['state']==_0x90bb5f['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x90bb5f['CONNECTING']):_0x90bb5f['CONNECTED'])),this['connection']['on']('error',(_0x228151,_0x2edb77)=>{if('limitExceeded'!==_0x2edb77['code'])throw console['error'](_0x2edb77),new _0x287bee('cloudservices-init',null,{'originalError':_0x2edb77});_0xe80782['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'});}),!_0x2f0421['me'])return new Promise(_0x1acde7=>_0x2f0421['on']('change:me',_0x1acde7));})['catch'](_0x17c30a=>{throw console['error'](_0x17c30a),new _0x287bee('cloudservices-init',null,{'originalError':_0x17c30a});});}addToReconnectionStack(_0x2019cd){if('function'!=typeof _0x2019cd['reconnect'])throw new _0x287bee('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x2019cd))throw new _0x287bee('websocketgateway-plugin-already-registered',this,{'name':_0x2019cd['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x2019cd);}removeFromReconnectionStack(_0x218768){this['_reconnectionStack']['delete'](_0x218768);}isInReconnectionStack(_0x470afd){return this['_reconnectionStack']['has'](_0x470afd);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x556d25=>_0x556d25['reconnect']())))['then'](()=>this['state']=_0x90bb5f['CONNECTED'])['catch'](_0x1839e7=>{throw console['error'](_0x1839e7),new _0x287bee('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x90bb5f['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},Q=class extends _0x15a293{['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[J,_0x1ec951];}constructor(_0x2f4173){super(_0x2f4173),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x42c4d2(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1ec951);}init(){const _0x3091f1=this['context']['plugins']['get'](J);this['listenTo'](_0x3091f1,'change:state',(_0x2f0082,_0x2f4f75,_0x425c5d)=>{if('connected'!==_0x425c5d)this['channelSessions']['forEach'](_0x2a76fb=>_0x2a76fb['clear']()),this['channelConnectedUsers']['forEach'](_0x16f669=>_0x16f669['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x12c1bc,_0xa96172]of this['_registeredSessions'])for(const _0x3a0c68 of _0xa96172)this['_handleSessionAdd'](_0x12c1bc,_0x3a0c68);}}),this['_createUser'](_0x3091f1['connection']['me'],!0x0);}register(_0x139b0c,_0x19e046){if(this['_registeredSessions']['has'](_0x139b0c))throw new _0x287bee('sessions-register-already-registered',null,{'channelId':_0x139b0c});this['_registeredSessions']['set'](_0x139b0c,_0x19e046),this['channelSessions']['set'](_0x139b0c,new _0x42c4d2()),this['channelConnectedUsers']['set'](_0x139b0c,new _0x42c4d2()),this['listenTo'](_0x19e046,'add',(_0x48d869,_0x30a9f9)=>this['_handleSessionAdd'](_0x139b0c,_0x30a9f9)),this['listenTo'](_0x19e046,'remove',(_0x2b0ba9,_0x42e9fd)=>this['_handleSessionRemove'](_0x139b0c,_0x42e9fd));for(const _0x26e9b0 of _0x19e046)this['_handleSessionAdd'](_0x139b0c,_0x26e9b0);}unregister(_0x23cf4c){if(!this['_registeredSessions']['has'](_0x23cf4c))throw new _0x287bee('sessions-unregister-not-exist',null,{'channelId':_0x23cf4c});const _0x21c02f=this['_registeredSessions']['get'](_0x23cf4c);this['stopListening'](_0x21c02f);for(const _0x20b6d2 of _0x21c02f)'connected'===this['context']['plugins']['get'](J)['state']&&this['_handleSessionRemove'](_0x23cf4c,_0x20b6d2);this['_registeredSessions']['delete'](_0x23cf4c),this['channelSessions']['delete'](_0x23cf4c),this['channelConnectedUsers']['delete'](_0x23cf4c);}get['mySessionId'](){return this['context']['plugins']['get'](J)['connection']['sessionId'];}getUserBySessionId(_0x1483e6){for(const _0x3b9ee9 of this['channelSessions']['values']())for(const _0x29a7cb of _0x3b9ee9)if(_0x29a7cb['id']===_0x1483e6)return _0x29a7cb['user'];}getUserSessions(_0x211c9a,_0x46b06d){const _0x4be789=_0x46b06d?[this['channelSessions']['get'](_0x46b06d)]:this['channelSessions']['values'](),_0x5a3afa=new Set();for(const _0x7b8c69 of _0x4be789)for(const _0x48ab98 of _0x7b8c69)_0x48ab98['user']['id']===_0x211c9a['id']&&_0x5a3afa['add'](_0x48ab98['id']);return _0x5a3afa;}getUserRole(_0x412942){for(const _0x77112c of this['channelSessions']['values']())for(const _0x2f5ae6 of _0x77112c)if(_0x2f5ae6['user']===_0x412942)return _0x2f5ae6['role'];}['_handleSessionAdd'](_0x194852,_0x3aeb25){if('connected'!==this['context']['plugins']['get'](J)['state'])return;const _0x3a478f=_0x3aeb25['user'],_0x17ef87=this['_users']['getUser'](_0x3a478f['id'])||this['_createUser'](_0x3a478f),_0x130119=Object['assign']({},_0x3aeb25,{'user':_0x17ef87});if(this['channelSessions']['get'](_0x194852)['add'](_0x130119),!_0x3a478f['hiddenInPresenceList']){const _0x20e497=this['channelConnectedUsers']['get'](_0x194852);_0x20e497['has'](_0x17ef87['id'])||_0x20e497['add'](_0x17ef87),this['allConnectedUsers']['has'](_0x17ef87['id'])||_0x3a478f['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x17ef87,_0x17ef87['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x194852,{'channelId':_0x194852,'session':_0x130119});}['_handleSessionRemove'](_0x1ee6a1,_0x166418){if('connected'!==this['context']['plugins']['get'](J)['state'])return;const _0x131c4c=this['channelConnectedUsers']['get'](_0x1ee6a1),_0x522ae8=_0x166418['user'];_0x522ae8['id']&&(this['channelSessions']['get'](_0x1ee6a1)['remove'](_0x166418['id']),_0x131c4c['has'](_0x522ae8['id'])&&!this['getUserSessions'](_0x522ae8,_0x1ee6a1)['size']&&_0x131c4c['remove'](_0x522ae8['id']),this['allConnectedUsers']['get'](_0x522ae8['id'])&&!this['getUserSessions'](_0x522ae8)['size']&&this['allConnectedUsers']['remove'](_0x522ae8['id']));}_createUser(_0x2eee58,_0x160cd5){const _0x5291f8=this['_users']['addUser'](_0x2eee58);return _0x160cd5&&this['_users']['defineMe'](_0x2eee58['id']),_0x5291f8['orderNumber']=this['_uniqueUsersCount']++,_0x5291f8;}},X=class extends _0x25a63a{_domEmitter=new(_0x2db052())();static get requires(){return[Q];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x51a1d4=this['editor'],_0x12f241=_0x51a1d4['plugins']['get'](Q);_0x51a1d4['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0xce1645,{writer:_0x498cb1})=>function(_0x43403e,_0x2f182d,_0x51334d,_0x572050){const _0x4233b6=_0x43403e['markerName']['split'](':')[0x2],_0x14743b=_0x51334d['getUserBySessionId'](_0x4233b6);if(!_0x14743b||_0x4233b6===_0x51334d['mySessionId'])return;if(!_0x572050['model']['schema']['checkChild'](_0x43403e['markerRange']['start'],'$text'))return;const _0x1a7216={'class':'ck-user__marker\x20'+_0x14743b['color']['getMarkerClass'](),'style':tt(_0x14743b),'data-name':_0x14743b['name'],'data-session-id':_0x4233b6},_0x51e60b=_0x572050['model']['markers']['get'](_0x43403e['markerName'])['getStart'](),_0x5abedb=_0x51e60b['nodeAfter'],_0x136127=_0x572050['model']['schema'];if(_0x5abedb&&_0x136127['isObject'](_0x5abedb)&&_0x136127['isInline'](_0x5abedb)&&!_0x572050['model']['markers']['get']('user:range:'+_0x4233b6)['getRange']()['isCollapsed'])return;const _0x4fda9f=_0x51e60b['parent'];return _0x572050['model']['schema']['isLimit'](_0x4fda9f)&&!_0x572050['model']['hasContent'](_0x4fda9f)&&(_0x1a7216['contenteditable']=!0x1),function(_0x203798,_0x25af3e,_0xc770c7){const _0x33f1d6=_0x203798['createUIElement']('span',_0x25af3e);return _0x203798['setCustomProperty']('userPositionMarker',!0x0,_0x33f1d6),_0x33f1d6['render']=function(_0x5690bc){const _0x4cf6fc=this['toDomElement'](_0x5690bc),_0x44ebfa=document['createElement']('span');return _0x44ebfa['classList']['add']('ck-user__marker-tooltip'),_0x44ebfa['setAttribute']('contenteditable','false'),_0x44ebfa['setAttribute']('spellcheck','false'),_0x44ebfa['textContent']=_0xc770c7['name'],_0x4cf6fc['innerHTML']=_0x52cbeb('<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x44ebfa['outerHTML']+''),_0x4cf6fc['addEventListener']('mouseenter',()=>{_0x4cf6fc['classList']['add']('ck-user__marker_hovered');}),_0x4cf6fc['addEventListener']('mouseleave',()=>{_0x4cf6fc['classList']['remove']('ck-user__marker_hovered');}),_0x4cf6fc;},_0x33f1d6['isSimilar']=function(_0x1eaa3a){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1eaa3a['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1eaa3a['getAttribute']('data-session-id'));},_0x33f1d6;}(_0x2f182d,_0x1a7216,_0x14743b);}(_0xce1645,_0x498cb1,_0x12f241,_0x51a1d4)}),_0x51a1d4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x142e91=>function(_0x107010,_0x2b67a3){const _0x2b275a=_0x107010['markerName']['split'](':')[0x2];if(_0x2b275a===_0x2b67a3['mySessionId'])return null;const _0x6fad7a=_0x2b67a3['getUserBySessionId'](_0x2b275a);return _0x6fad7a?{'id':_0x2b275a,'classes':['ck-user__selection',_0x6fad7a['color']['getSelectionClass']()],'attributes':{'style':tt(_0x6fad7a),'data-session-id':_0x2b275a},'priority':0x7d0+_0x6fad7a['orderNumber']}:{'id':_0x2b275a,'classes':[]};}(_0x142e91,_0x12f241)}),function(_0x5e671b){const _0x5038b7=_0x5e671b['model'],_0x1ca985=new Map(),_0x4af115=_0x5e671b['plugins']['get'](Q);_0x5038b7['markers']['on']('update:user:range',(_0x17aec8,_0x46b330,_0x7d31f,_0x323fd6)=>{if(!_0x323fd6&&_0x1ca985['get'](_0x46b330['name']))return _0x1ca985['get'](_0x46b330['name'])['detach'](),void _0x1ca985['delete'](_0x46b330['name']);const _0x4b0dcd=_0x46b330['name']['split'](':')[0x2];if(_0x4b0dcd===_0x4af115['mySessionId'])return;const _0x5170ec='user:position:'+_0x4b0dcd;_0x5038b7['markers']['has'](_0x5170ec)&&_0x5e671b['editing']['reconvertMarker'](_0x5170ec),_0x46b330['on']('change:range',(_0x31994c,_0x2ac61b,_0x39fcec)=>{if('$graveyard'!=_0x2ac61b['root']['rootName']&&'$graveyard'==_0x46b330['getRange']()['root']['rootName']&&!_0x1ca985['has'](_0x46b330['name'])){const _0x3c8516=_0x5038b7['schema']['getNearestSelectionRange'](_0x39fcec['deletionPosition']);if(_0x3c8516){const _0x189092=_0x198acf['fromRange'](_0x3c8516);_0x1ca985['set'](_0x46b330['name'],_0x189092),_0x189092['on']('change:range',(_0x5e52fc,_0x2956db,_0xc5c8ea)=>{if('$graveyard'==_0x189092['root']['rootName']){const _0x2cf8bd=_0x5038b7['schema']['getNearestSelectionRange'](_0xc5c8ea['deletionPosition']);_0x2cf8bd?(_0x189092['start']=_0x2cf8bd['start'],_0x189092['end']=_0x2cf8bd['end']):(_0x1ca985['delete'](_0x46b330['name']),_0x189092['detach']());}});}}});}),_0x5038b7['document']['on']('change',()=>{_0x1ca985['size']>0x0&&_0x5038b7['enqueueChange']({'isUndoable':!0x1},_0x5218ba=>{for(const [_0x3f9047,_0x1d45ea]of _0x1ca985)'$graveyard'==_0x5038b7['markers']['get'](_0x3f9047)['getRange']()['root']['rootName']&&(Z(_0x3f9047['split'](':')[0x2],_0x1d45ea['toRange'](),_0x5038b7,_0x5218ba),_0x1d45ea['detach']());_0x1ca985['clear']();});});}(_0x51a1d4),this['_domEmitter']['listenTo'](_0x37a491['document'],'keydown',(_0x481e7c,{key:_0xf72ce0})=>{'Escape'===_0xf72ce0&&function(_0xb13717){_0xb13717['editing']['view']['change'](_0x4674b2=>{for(const _0x1698ff of _0xb13717['model']['markers']){if(!_0x1698ff['name']['startsWith']('user:position'))continue;const _0x1092f4=_0xb13717['editing']['mapper']['markerNameToElements'](_0x1698ff['name']);if(_0x1092f4){for(const _0x2e5097 of _0x1092f4)_0x4674b2['removeClass']('ck-user__marker_hovered',_0x2e5097);}}});}(_0x51a1d4);},{'useCapture':!0x0});}afterInit(){const _0x16c047=this['editor'],_0x4c7b9a=_0x16c047['commands']['get']('undo');_0x4c7b9a&&_0x16c047['model']['on']('applyOperation',(_0x5f0f04,_0x295abb)=>{const _0x1755c0=_0x295abb[0x0];if(!_0x1755c0['isDocumentOperation'])return;if('marker'!=_0x1755c0['type']||!_0x1755c0['name']['startsWith']('user:'))return;const _0x88d594=_0x1755c0['batch'];_0x4c7b9a['_createdBatches']['has'](_0x88d594)&&(_0x1755c0['newRange']=_0x1755c0['oldRange']?_0x16c047['model']['createRange'](_0x1755c0['oldRange']['start'],_0x1755c0['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x4ff5b2=this['editor'],_0x1ede8d=_0x4ff5b2['model']['document'],_0x337117=_0x4ff5b2['plugins']['get'](Q);_0x4ff5b2['model']['enqueueChange']({'isUndoable':!0x1},_0x38141c=>{const _0x1dcd93='user:range:'+_0x337117['mySessionId'],_0x31324f='user:position:'+_0x337117['mySessionId'],_0x14942f=_0x4ff5b2['model']['markers']['has'](_0x1dcd93);_0x4ff5b2['editing']['view']['hasDomSelection']?Z(_0x337117['mySessionId'],_0x1ede8d['selection']['getFirstRange'](),_0x4ff5b2['model'],_0x38141c):_0x14942f&&(_0x38141c['removeMarker'](_0x1dcd93),_0x38141c['removeMarker'](_0x31324f));});}};function Z(_0x3e835c,_0x3d6c97,_0x3f6037,_0x58176f){const _0x4230e3='user:range:'+_0x3e835c,_0x195f75='user:position:'+_0x3e835c,_0x159af3=_0x3d6c97['getContainedElement']();let _0x135f67=_0x3d6c97['start'];if(_0x159af3&&_0x159af3['is']('element','tableCell')){const _0x27be2e=function(_0x5ea2f9,_0x591b58){for(const _0x5aeeb1 of _0x5ea2f9['getPositions']())if(_0x591b58['schema']['checkChild'](_0x5aeeb1,'$text'))return _0x5aeeb1;}(_0x3d6c97,_0x3f6037);_0x27be2e&&(_0x135f67=_0x27be2e,_0x3d6c97=_0x58176f['createRange'](_0x135f67));}const _0x16ceae=_0x58176f['createRange'](_0x135f67);_0x3f6037['markers']['has'](_0x4230e3)?(_0x58176f['updateMarker'](_0x4230e3,{'range':_0x3d6c97}),_0x58176f['updateMarker'](_0x195f75,{'range':_0x16ceae})):(_0x58176f['addMarker'](_0x4230e3,{'range':_0x3d6c97,'usingOperation':!0x0}),_0x58176f['addMarker'](_0x195f75,{'range':_0x16ceae,'usingOperation':!0x0}));}function tt(_0x5a9c96){return'--ck-user-color:'+_0x5a9c96['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x5a9c96['color']['getColorAlphaVariable']()+';';}function et(_0x3f9647,_0x474508,_0x3ef27c){const _0xda7b52=_0x3f9647['t'],t=_0x3f9647['t'];switch(_0x474508){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 _0xda7b52({'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'},_0x3ef27c);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x25a63a{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x5e0c19)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[J,Q,X,_0x308c72,_0x1ec951,_0x5013db];}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 _0x5f1f7b=this['serverHistory']['getOperations']();for(let _0x43aadd=_0x5f1f7b['length']-0x1;_0x43aadd>=0x0;_0x43aadd--){const _0xc36918=_0x5f1f7b[_0x43aadd];if(!this['_disconnectionOperations']['has'](_0xc36918))return _0xc36918['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x5d2080){if(super(_0x5d2080),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x33cb2b(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x287bee('collaboration-missing-channelid',this);const _0x35fb02=_0x5d2080['config']['get']('cloudServices.bundleVersion')||_0x2f0ce3;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x35fb02,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x4ac37a(),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 rt(this['_disconnectionOperations']);}init(){const _0x55ce9f=this['editor'],_0x539a07=_0x55ce9f['plugins']['get'](_0x1ec951),_0x2b8e7c=_0x55ce9f['plugins']['get'](J);this['listenTo'](_0x539a07,'getOperationAuthor',(_0x1ac52c,_0x51e65e)=>{const _0x3a8d1f=_0x51e65e[0x0];_0x3a8d1f['_authorId']&&(_0x1ac52c['return']=_0x539a07['getUser'](_0x3a8d1f['_authorId']),_0x1ac52c['stop']()),null===_0x3a8d1f['_authorId']&&(_0x1ac52c['return']=null,_0x1ac52c['stop']());},{'priority':'high'}),this['listenTo'](_0x55ce9f['model']['document']['selection'],'change:range',(_0x56777e,_0x241e9d)=>{_0x241e9d['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x55ce9f['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x55ce9f['model']['on']('applyOperation',(_0x20969e,_0x3e3f76)=>{const _0x35ffa3=_0x3e3f76[0x0];_0x35ffa3['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x35ffa3),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x2b8e7c,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x160b72,_0x3cdebe,_0x5795c6)=>'connected'===_0x160b72&&!_0x3cdebe&&!_0x5795c6),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x55ce9f['disableReadOnlyMode']('rtc-offline'):_0x55ce9f['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x55ce9f['disableReadOnlyMode']('rtc-offline'):_0x55ce9f['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x14d873=this['editor']['plugins']['get'](Q),_0x20a403=this['editor']['plugins']['get'](J);try{this['_isPendingUpdate']=!0x0,_0x14d873['unregister'](this['_channelId']);const _0x212840=await this['_service']['reconnect'](_0x20a403['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x212840)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x49ae12=await this['_service']['getConnectedSessions']();_0x14d873['register'](this['_channelId'],_0x49ae12),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2926e3){if(function(_0x39ca15){return'404'===_0x39ca15['code'];}(_0x2926e3)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5082b3){return'409'===_0x5082b3['code'];}(_0x2926e3)){const _0x3d562f=et(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x3d562f);}else{if(!(_0x2926e3 instanceof nt))throw _0x2926e3;this['_handleReconnectionError']();}}}}destroy(){const _0x157cd2=this['editor']['plugins']['get'](J),_0x2f86c8=this['editor']['plugins']['get'](Q);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2f86c8['channelSessions']['has'](this['_channelId'])&&_0x2f86c8['unregister'](this['_channelId']),_0x157cd2['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x50f772){if(this['sessionId']!==_0x50f772['sessionId']&&this['_lastSyncedOperationId']!==_0x50f772['lastOperationId'])throw new nt();return this['sessionId']=_0x50f772['sessionId'],this['_handleServerResponse']([],{..._0x50f772,'wereChangesApplied':!0x1,'data':_0x50f772['data']},'reconnect');}async _connectService(_0x424562,_0x160caf=!0x1){const {connection:_0x1a9a09}=this['editor']['plugins']['get'](J);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x1a9a09,this['_channelId'])['then'](_0x25f636=>this['_initSessionsHandling'](_0x25f636))['catch'](_0x5857f4=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5857f4);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x5bea7a,_0x113c6b)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x113c6b);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x2a2f22=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x424562);this['_isPendingUpdate']=!0x0;const _0x71d78d=await this['_service']['connect'](_0x1a9a09,this['_compressOperations'](_0x424562),_0x2a2f22);if(this['sessionId']=_0x71d78d['sessionId'],_0x160caf){if(!_0x71d78d['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x71d78d['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x424562,_0x71d78d,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x71d78d,_0x424562);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x41b788=this['editor']['plugins']['get'](Q),_0x4beeaf=this['editor']['plugins']['get'](X),_0x5b53b4=_0x41b788['channelSessions']['get'](this['_channelId']);_0x5b53b4&&_0x5b53b4['length']>0x1?_0x4beeaf['createUserMarkerOperations']():this['listenTo'](_0x41b788,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x41b788['channelSessions']['get'](this['_channelId'])['length']&&_0x4beeaf['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x46e590,_0xbfadbd,_0x1657a1,_0x1e4e69){if(!this['_isPendingUpdate']&&this['_document']['version']==_0xbfadbd){const _0x1ae76d=this['_decompressOperations'](_0x1657a1,_0x1e4e69);await this['_fetchMissingUsers'](_0x1ae76d),this['_handleExternalOperations'](_0x1ae76d,_0xbfadbd,_0x1657a1['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x4971ba}=this['editor'];let _0x5e0a39;try{_0x5e0a39=await this['_service']['getDocumentDetails']();}catch{const _0x36c3c1=et(_0x4971ba,'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'](_0x36c3c1);}const _0x47f22a=_0x5e0a39['currentDocumentSession']||_0x5e0a39['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x47f22a['lastOperationId']){const _0x55c38c=et(_0x4971ba,'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'](_0x55c38c);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x354801=this['editor']['plugins']['get'](J);if(this['_isConnected']=!0x1,!_0x354801['connection']||'connected'!==_0x354801['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x443b18=this['editor']['plugins']['get'](Q);_0x443b18['channelSessions']['has'](this['_channelId'])&&_0x443b18['unregister'](this['_channelId']),_0x354801['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x5cd322){const _0x5d9055=this['editor']['plugins']['get'](Q);this['listenTo'](_0x5d9055,'sessionAdd:'+this['_channelId'],(_0x53fc06,{session:_0x89e494})=>{if(_0x89e494['id']===_0x5d9055['mySessionId']){_0x53fc06['off']();const _0x3c09d6=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x362b04=_0x89e494['permissions'];_0x3c09d6&&_0x3c09d6['isEnabled']&&(_0x362b04=_0x362b04['filter'](_0x304c08=>'document:write'!==_0x304c08)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x362b04,this['_channelId']);}}),_0x5d9055['register'](this['_channelId'],_0x5cd322);}_initThrowingOnDataSet(){const _0x2cbb34=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x60f68c)=>{if(!_0x60f68c[_0x60f68c['length']-0x1]['suppressErrorInCollaboration'])throw new _0x287bee('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2cbb34['apply'](this['editor']['data'],_0x60f68c);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0xf8d4b1,[_0xc1b5c8])=>{if(this['_document']['version'])throw new _0x287bee('realtimecollaborationclient-init-document-already-initialized',this);_0xf8d4b1['stop'](),this['_setPendingAction']();const _0x3697d7=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x27ef92])=>!_0x27ef92['lazyLoad'])['map'](([_0x46d290,_0x5e64c3])=>[_0x46d290,_0x5e64c3['modelAttributes']||{}])),_0x3ed6e5=this['_getOperationsFromInitData'](_0xc1b5c8,_0x3697d7);0x0==_0x3ed6e5['length']&&_0x3ed6e5['push'](new _0x4389ac(0x0)),_0xf8d4b1['return']=this['_connectService'](_0x3ed6e5)['then'](()=>{this['editor']['plugins']['get'](J)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2d99ce=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2d99ce))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x9d7c6f,[_0x800b76,_0x2e2094])=>{_0x9d7c6f['stop']();const _0xee65a=this['editor']['model']['document']['getRoot'](_0x800b76);if(!this['_knownRootNames']['has'](_0x800b76)){const _0x50f7cd=_0x2e2094&&_0x2e2094['data']?_0x2e2094['data']:'',_0x37cd75=_0x2e2094&&_0x2e2094['attributes']?_0x2e2094['attributes']:{};await this['_loadRoot'](_0x800b76,_0x50f7cd,_0x37cd75);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0xee65a['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0xee65a);});},{'priority':'high'});}async _fetchMissingUsers(_0x49fe80){const _0x23b3f3=this['editor']['plugins']['get'](_0x1ec951),{connection:_0x29c46f}=this['editor']['plugins']['get'](J),_0x45a413=new Set();for(const _0x25f4b1 of _0x49fe80){const _0x289985=_0x25f4b1['_authorId'];_0x289985&&!_0x23b3f3['getUser'](_0x289985)&&_0x45a413['add'](_0x289985);}if(0x0===_0x45a413['size'])return;const _0x3683ea=await _0x111aa6['getMany'](_0x29c46f,Array['from'](_0x45a413));for(const _0x2fef9e of _0x3683ea)_0x23b3f3['getUser'](_0x2fef9e['id'])||_0x23b3f3['addUser'](_0x2fef9e);}_getOperationsFromInitData(_0x464d4f,_0x32ad74={}){const _0x382a08=this['editor']['model'],_0x33de95=[];let _0x141ccf=0x0;const _0x28deec='string'==typeof _0x464d4f?{'main':_0x464d4f}:_0x464d4f;for(const _0x563a95 of Object['keys'](_0x28deec)){if(!this['_document']['roots']['has'](_0x563a95))throw new _0x287bee('realtimecollaborationclient-init-non-existent-root',this);const _0x36ce9f=this['_document']['getRoot'](_0x563a95),_0x456d78=this['editor']['data']['parse'](_0x28deec[_0x563a95],_0x36ce9f),_0x2b46a6=new _0x25d45c(_0x382a08['createPositionAt'](_0x36ce9f,0x0),_0x456d78,_0x141ccf++);_0x33de95['push'](_0x2b46a6);for(const [_0x1b8c6b,_0x1dab44]of _0x456d78['markers']){const _0x1f3747=_0x382a08['createRange'](_0x382a08['createPositionFromPath'](_0x36ce9f,_0x1dab44['start']['path']['slice']()),_0x382a08['createPositionFromPath'](_0x36ce9f,_0x1dab44['end']['path']['slice']())),_0x65c5d0=new _0x35d9e3(_0x1b8c6b,null,_0x1f3747,_0x382a08['markers'],!0x0,_0x141ccf++);_0x33de95['push'](_0x65c5d0);}}if(_0x32ad74)for(const [_0x2552a6,_0x599923]of Object['entries'](_0x32ad74)){const _0x31bc6d=_0x382a08['document']['getRoot'](_0x2552a6);if(!_0x31bc6d)throw new _0x287bee('multi-root-editor-root-attributes-no-root',null);for(const [_0x669129,_0x505b84]of Object['entries'](_0x599923))if(null!==_0x505b84){const _0x3f217a=new _0x27224b(_0x31bc6d,_0x669129,null,_0x505b84,_0x141ccf++);_0x33de95['push'](_0x3f217a);}}return _0x33de95;}async _loadRoot(_0x312f60,_0x6fd4c6,_0x43e107){this['_getOperationsFromInitData']({[_0x312f60]:_0x6fd4c6},{[_0x312f60]:_0x43e107})['forEach']((_0x3d30ac,_0x50ff9c)=>{_0x3d30ac['baseVersion']=this['_document']['version']+_0x50ff9c,_0x3d30ac['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x3d30ac);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x45abe9,_0x2b1428){let _0x3f14fb;this['_offset']=_0x45abe9['offset'];const _0x4e7b55=_0x45abe9['wereChangesApplied']&&!_0x45abe9['initData'],_0x4ccc5f=_0x4e7b55?0x0:_0x45abe9['data']['baseVersion'];if(_0x2b1428['forEach'](_0x29e62f=>{_0x29e62f['_isInit']=!0x0,_0x29e62f['createdAt']=_0x45abe9['sessionCreatedAt'],_0x29e62f['_authorId']=null;}),_0x4e7b55)_0x3f14fb=_0x2b1428,this['_applyOperationsSet'](_0x3f14fb,_0x4e7b55);else{if(_0x45abe9['initData']){const _0x5b4a9c=this['_getOperationsFromInitData'](_0x45abe9['initData']);this['_document']['history']['version']=-_0x5b4a9c['length'],_0x5b4a9c['forEach'](_0x4ad697=>{_0x4ad697['baseVersion']-=_0x5b4a9c['length'],_0x4ad697['createdAt']=_0x45abe9['sessionCreatedAt'],_0x4ad697['_isInit']=!0x0,_0x4ad697['_authorId']=null;}),this['_applyOperationsSet'](_0x5b4a9c,!0x0),this['serverHistory']['version']=-_0x5b4a9c['length']+this['_offset'],this['_updateServerHistory'](_0x5b4a9c);}this['_document']['history']['version']=_0x4ccc5f,_0x3f14fb=this['_decompressOperations'](_0x45abe9['data'],_0x45abe9['metadata']),await this['_fetchMissingUsers'](_0x3f14fb),this['_applyOperationsSet'](_0x3f14fb,_0x4e7b55);}_0x45abe9['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3f14fb,_0x45abe9['lastOperationId']),this['_lastSyncedOperationId']=_0x45abe9['lastOperationId']),this['serverHistory']['version']=_0x4ccc5f+this['_offset'],this['_updateServerHistory'](_0x3f14fb),_0x2b1428['filter'](_0x3a98cf=>{const _0x45b0b4=this['_getAffectedRoot'](_0x3a98cf);return _0x45b0b4&&!this['_knownRootNames']['has'](_0x45b0b4);})['forEach']((_0x2513e8,_0x26c049)=>{_0x2513e8['baseVersion']=this['_document']['version']+_0x26c049,this['_saveOperationInBuffer'](_0x2513e8);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4c8d45,_0x470564){const _0x243ea4=_0x470564&&_0x470564['message'];if(_0x243ea4&&_0x243ea4['startsWith']('realtimecollaborationclient'))throw _0x470564;const _0x596bf2=this['editor']['plugins']['get'](J);throw this['_isPendingUpdate']=!0x0,_0x596bf2['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x287bee(_0x4c8d45,this['editor'],_0x243ea4?{'originalError':_0x243ea4}:void 0x0);}_saveOperationInBuffer(_0x393431){this['_knownOperations']['has'](_0x393431)||(this['_knownOperations']['add'](_0x393431),this['_bufferedOperations']['push'](_0x393431),this['_pendingAction']||'marker'==_0x393431['type']&&!_0x393431['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0xd4e0c6=!0x1){!_0xd4e0c6&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x25e93f=>{_0x25e93f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x1893ce=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x284687){return _0x284687['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x284687['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x284687['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x1893ce)||this['_crash'](_0x1893ce['message'],_0x1893ce);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x20be95=>{this['on']('change:_isPendingUpdate',()=>{_0x20be95();});});}async _sendBufferedOperations(){const _0x37f160=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x37f160['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x4eb50a=[...this['_bufferedOperations']];for(const _0x1a00b2 of _0x4eb50a)_0x1a00b2['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1a00b2);const _0x26930e=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4eb50a),_0x57137b=st++,_0x556bb8=this['_compressOperations'](_0x4eb50a),_0x1f464e=await this['_service']['sendOperations'](_0x556bb8,_0x556bb8['baseVersion'],_0x26930e);try{return await this['_handleServerResponse'](_0x4eb50a,_0x1f464e,_0x57137b);}catch(_0x2bb1e5){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2bb1e5);}}async['_handleServerResponse'](_0x8bd596,_0x2cf049,_0x6b3aa1){if('error'in _0x2cf049)throw _0x2cf049['error'];let _0x3a4965;if(_0x2cf049['wereChangesApplied']){_0x2cf049['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2cf049['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x40d365=>!_0x8bd596['includes'](_0x40d365));for(const _0x4c2125 of _0x8bd596)_0x4c2125['createdAt']='lastOperationAcceptedAt'in _0x2cf049&&_0x2cf049['lastOperationAcceptedAt']||void 0x0;ot(_0x8bd596,_0x2cf049['version']-_0x8bd596['length']),this['_updateServerHistory'](_0x8bd596);const _0x55ee29=_0x8bd596['filter'](_0x2410f1=>{if(!_0x2410f1['_isInit'])return!0x1;const _0x3af20a=this['_getAffectedRoot'](_0x2410f1);return _0x3af20a&&!this['_knownRootNames']['has'](_0x3af20a);});ot(_0x55ee29,this['_document']['version']),this['_applyOperationsSet'](_0x55ee29),_0x3a4965=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5260e3=this['_decompressOperations'](_0x2cf049['data'],_0x2cf049['metadata'])['filter'](_0x3c889e=>_0x3c889e['baseVersion']>=this['_lastServerVersion']);_0x5260e3['forEach'](_0x5af662=>this['_addKnownRoot'](_0x5af662)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5b849e=>!_0x5b849e['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5b849e))),this['_bufferedOperations']['length']&&ot(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5260e3),_0x3a4965=this['_handleExternalOperations'](_0x5260e3,_0x2cf049['version'],_0x2cf049['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x3a4965?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x2ac17b,_0x4ca4df,_0x120998){try{const _0x24356a={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2f0ea6,operationsB:_0x3015d8,originalOperations:_0x16b4f5}=_0x2c58db(_0x2ac17b,this['_bufferedOperations'],_0x24356a);ot(_0x2f0ea6,this['_document']['version']),ot(_0x3015d8,_0x4ca4df);for(const _0xa375f3 of _0x2f0ea6){const _0x5b0119=_0x16b4f5['get'](_0xa375f3);_0x5b0119?(_0xa375f3['_authorId']=_0x5b0119['_authorId'],'noop'!==_0xa375f3['type']&&(_0xa375f3['_aiSource']=_0x5b0119['_aiSource'])):_0xa375f3['_authorId']=null;}for(const _0x25f5a4 of _0x3015d8)'noop'!==_0x25f5a4['type']&&(_0x25f5a4['_aiSource']=_0x16b4f5['get'](_0x25f5a4)?.['_aiSource']);_0x120998&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2ac17b,_0x120998),this['_lastSyncedOperationId']=_0x120998),this['_bufferedOperations']=[..._0x3015d8],this['_applyOperationsSet'](_0x2f0ea6),this['_updateServerHistory'](_0x2ac17b);}catch(_0x4b173c){return console['error'](_0x4b173c),!0x1;}return!0x0;}_applyOperationsSet(_0x867378,_0x2a0688=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x22799d=>{for(const _0x119416 of _0x867378)this['_knownOperations']['add'](_0x119416),this['_addKnownRoot'](_0x119416),_0x22799d['batch']['addOperation'](_0x119416),this['editor']['model']['applyOperation'](_0x119416);});}_addKnownRoot(_0xb2c9c7){const _0x65d796=this['_getAffectedRoot'](_0xb2c9c7);_0x65d796&&this['_knownRootNames']['add'](_0x65d796);}_getAffectedRoot(_0x22c5c6){let _0x4f9a4a,_0x2e87f8;switch(_0x22c5c6['type']){case'insert':_0x4f9a4a=_0x22c5c6['position']['root'];break;case'marker':if(_0x2e87f8=_0x22c5c6['newRange'],!_0x2e87f8)return null;_0x4f9a4a=_0x2e87f8['root'];break;case'addRootAttribute':_0x4f9a4a=_0x22c5c6['root'];break;case'addRoot':_0x4f9a4a=_0x22c5c6['affectedSelectable'];break;case'move':_0x4f9a4a=_0x22c5c6['targetPosition']['root'];break;default:return null;}return _0x4f9a4a['rootName'];}_updateServerHistory(_0x12de4e){_0x12de4e['forEach'](_0x287d01=>{const _0xf93955=_0x287d01['clone']();_0xf93955['_authorId']=_0x287d01['_authorId'],_0xf93955['_isInit']=!!_0x287d01['_isInit'],_0xf93955['_aiSource']=_0x287d01['_aiSource'],_0xf93955['createdAt']=_0x287d01['createdAt'],_0xf93955['baseVersion']+=this['_offset'],_0x287d01['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xf93955),this['serverHistory']['addOperation'](_0xf93955);});}_handleReconnectionError(_0x966b2e){const _0xbf9f7=this['editor']['plugins']['get']('Notification'),_0x3fcfd5=this['editor']['locale'];_0x966b2e||(_0x966b2e=et(_0x3fcfd5,'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.')),_0xbf9f7['showWarning'](_0x966b2e,{'title':et(_0x3fcfd5,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](J)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x308c72)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x308c72)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x360a3d){const _0x59b862=_0x360a3d['map'](_0x43bc27=>_0x43bc27['toJSON']());return this['_compressor']['compress'](_0x59b862);}_decompressOperations(_0xf95986,_0x4f4990){return this['_compressor']['decompress'](_0xf95986)['map']((_0x3328b7,_0x3bc9ae)=>{const _0x36e708='init'==_0x4f4990[_0x3bc9ae]['type'];if('InsertOperation'==_0x3328b7['__className']){const _0x95e75c=_0x3328b7['position']['root'];!this['_document']['getRoot'](_0x95e75c)&&(this['_document']['createRoot']('$unknown',_0x95e75c)['_isAttached']=!0x1);}else{if('RootOperation'==_0x3328b7['__className']){const _0x1d121a=this['_document']['getRoot'](_0x3328b7['rootName']);_0x1d121a&&'$unknown'==_0x1d121a['name']&&_0x3328b7['elementName']!=_0x1d121a['name']&&(_0x1d121a['name']=_0x3328b7['elementName']);}}const _0x8c98f2=_0x2e3823['fromJSON'](_0x3328b7,this['_document']);return _0x8c98f2['wasUndone']=_0x3328b7['wasUndone'],_0x8c98f2['_isInit']=_0x36e708,_0x8c98f2['_authorId']=_0x36e708?null:_0x4f4990[_0x3bc9ae]['userId'],_0x8c98f2['_isDisconnection']='cs:removeUser'===_0x4f4990[_0x3bc9ae]['type'],_0x8c98f2['_aiSource']=_0x3328b7['_aiSource']||void 0x0,_0x8c98f2['createdAt']=_0x4f4990[_0x3bc9ae]['createdAt'],_0x8c98f2;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x292253=this['editor']['plugins']['get'](Q)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x292253&&_0x292253['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function ot(_0x5ed517,_0x1ac0b0){for(const _0x142082 of _0x5ed517)_0x142082['baseVersion']=_0x1ac0b0++;}var rt=class{_ignoredOperations;_operationToId;constructor(_0x39121e){this['_ignoredOperations']=_0x39121e,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x38a44e){let _0x43665d=_0x38a44e['length'];for(;_0x43665d--;){const _0x484191=_0x38a44e[_0x43665d];if(!this['_ignoredOperations']['has'](_0x484191)){if(!this['_operationToId']['has'](_0x484191)){const _0x4d1f4a=_0x293c9a()['slice'](0x1,0x12);this['_operationToId']['set'](_0x484191,_0x4d1f4a);}return this['_operationToId']['get'](_0x484191);}}}setIdForTheLastOperation(_0x1e6f2e,_0x437a2f){if(!_0x437a2f)return;let _0x3bdfe0=_0x1e6f2e['length'];for(;_0x3bdfe0--;){const _0x51e7e9=_0x1e6f2e[_0x3bdfe0];this['_ignoredOperations']['has'](_0x51e7e9)||this['_operationToId']['set'](_0x51e7e9,_0x437a2f);}}},ct=class extends _0x25a63a{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class CloudServicesCommentsAdapter extends _0x15a293{static CommentsService=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x4accae)());['_services'];static get requires(){return[J,_0x2650ae,Q,_0x1ec951];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x40652f){super(_0x40652f),this['_services']=new Map();}async init(){const _0x3f81e5=this['context'],_0x42fd54=_0x3f81e5['plugins']['get'](_0x2650ae);if(_0x3f81e5['plugins']['get'](J)['addToReconnectionStack'](this),_0x42fd54['adapter']={'addCommentThread':async({channelId:_0x3175b6,threadId:_0x47f08b,comments:_0x4c9d4f,resolvedAt:_0x28efc1,resolvedBy:_0x226f57,context:_0x4a48cd,attributes:_0x15735f})=>{const _0xba8a74=await this['_getService'](_0x3175b6)['addCommentThread']({'commentThreadId':_0x47f08b,'comments':_0x4c9d4f['map'](_0x2e86e6=>function(_0x206dc6,_0x542461,_0x2e13e9){return{'commentThreadId':_0x2e13e9,'commentId':_0x206dc6['commentId'],'userId':_0x206dc6['authorId'],'content':_0x206dc6['content'],'documentId':_0x542461,'createdAt':_0x206dc6['createdAt'],'attributes':_0x206dc6['attributes']||{}};}(_0x2e86e6,_0x3175b6,_0x47f08b)),'resolvedAt':_0x28efc1,'resolvedBy':_0x226f57,'context':_0x4a48cd,'attributes':_0x15735f})['catch'](lt);return{'threadId':_0xba8a74['commentThreadId'],'comments':_0xba8a74['comments']};},'getCommentThread':async({channelId:_0x323d94,threadId:_0x1f528d})=>{const _0x80c30d=await this['_getService'](_0x323d94)['getCommentThread'](_0x1f528d)['catch'](ht)['catch'](lt);return _0x80c30d?_0x80c30d['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x80c30d]),{'threadId':_0x80c30d['commentThreadId'],'comments':_0x80c30d['comments']['map'](dt),'context':_0x80c30d['context'],'resolvedAt':_0x80c30d['resolvedAt'],'resolvedBy':_0x80c30d['resolvedBy'],'attributes':_0x80c30d['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x2d399e,threadId:_0x171751,context:_0x2738c9,unlinkedAt:_0x3b57d2,attributes:_0xc27e06})=>this['_getService'](_0x2d399e)['updateCommentThread']({'commentThreadId':_0x171751,'context':_0x2738c9,'attributes':_0xc27e06,'unlinkedAt':_0x3b57d2})['catch'](ht)['catch'](lt),'resolveCommentThread':async({channelId:_0x171494,threadId:_0x1b1991})=>{const _0x518784=await this['_getService'](_0x171494)['resolveCommentThread'](_0x1b1991)['catch'](ht)['catch'](lt);return{'threadId':_0x518784['commentThreadId'],'resolvedAt':_0x518784['resolvedAt'],'resolvedBy':_0x518784['resolvedBy']};},'reopenCommentThread':async({channelId:_0x223a54,threadId:_0x3a1e1d})=>this['_getService'](_0x223a54)['reopenCommentThread'](_0x3a1e1d)['catch'](ht)['catch'](lt),'removeCommentThread':({channelId:_0x2e122d,threadId:_0x40616d})=>this['_getService'](_0x2e122d)['removeCommentThread'](_0x40616d)['catch'](ht)['catch'](lt),'addComment':({channelId:_0x541435,threadId:_0x1d9bb7,commentId:_0x4ccff9,content:_0x419ebc,attributes:_0x4ad85c})=>this['_getService'](_0x541435)['addComment'](_0x1d9bb7,_0x4ccff9,_0x419ebc,_0x4ad85c)['catch'](lt),'updateComment':({channelId:_0x2839fb,threadId:_0x55d48d,commentId:_0xb5e101,content:_0x57c055,attributes:_0x3acf9a})=>this['_getService'](_0x2839fb)['updateComment'](_0x55d48d,_0xb5e101,_0x57c055,_0x3acf9a)['catch'](ht)['catch'](lt),'removeComment':({channelId:_0x19d402,threadId:_0x271a91,commentId:_0x3ef1c1})=>this['_getService'](_0x19d402)['removeComment'](_0x271a91,_0x3ef1c1)['catch'](ht)['catch'](lt)},_0x3f81e5 instanceof _0x5bdd40){const _0x282ed5=_0x3f81e5['config']['get']('collaboration.channelId'),_0x400bf2=_0x3f81e5['plugins']['get'](Q);await this['_setUpService'](_0x282ed5);const _0x45e3b5=await this['_services']['get'](_0x282ed5)['getConnectedSessions']();this['listenTo'](_0x400bf2,'sessionAdd:'+_0x282ed5,(_0x584e2a,{session:_0x2f4942})=>{_0x2f4942['id']===_0x400bf2['mySessionId']&&(_0x584e2a['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2f4942['permissions'],_0x282ed5));}),_0x400bf2['register'](_0x282ed5,_0x45e3b5);}}async _setUpService(_0x34daf7){if(this['_services']['has'](_0x34daf7))throw new _0x287bee('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x34daf7});const _0x4851c5=this['context']['plugins']['get'](_0x2650ae),_0x58e5a0=new CloudServicesCommentsAdapter['CommentsService'](_0x34daf7);this['_services']['set'](_0x34daf7,_0x58e5a0),this['listenTo'](_0x58e5a0,'commentThreadAdded',(_0xea0ec9,_0x16d134)=>{const {commentThreadId:_0x4cd804,documentId:_0x57f2e3,context:_0x3cd69a,attributes:_0x3492a1,resolvedAt:_0x4dbc10,resolvedBy:_0x437213,comments:_0xc362ae}=_0x16d134;_0x4851c5['getCommentThread'](_0x4cd804)||_0x4851c5['addCommentThread']({'threadId':_0x4cd804,'channelId':_0x57f2e3,'comments':_0xc362ae?_0xc362ae['map'](dt):[],'context':_0x3cd69a,'attributes':_0x3492a1,'resolvedAt':_0x4dbc10,'resolvedBy':_0x437213,'isFromAdapter':!0x0});}),this['listenTo'](_0x58e5a0,'commentThreadUpdated',(_0x50713d,{commentThreadId:_0x271137,documentId:_0x42f38c,context:_0x56b337,unlinkedAt:_0x50cfc9,attributes:_0xd1b7f4})=>{_0x4851c5['getCommentThread'](_0x271137)&&_0x4851c5['updateCommentThread']({'threadId':_0x271137,'channelId':_0x42f38c,'context':_0x56b337,'unlinkedAt':_0x50cfc9,'attributes':_0xd1b7f4,'isFromAdapter':!0x0});}),this['listenTo'](_0x58e5a0,'commentThreadResolved',(_0x128386,{commentThreadId:_0x435ce9,resolvedBy:_0xb9294d,resolvedAt:_0x15c36c})=>{const _0xa62d5b=_0x4851c5['getCommentThread'](_0x435ce9);_0xa62d5b&&_0xa62d5b['resolve']({'resolvedBy':_0xb9294d,'resolvedAt':_0x15c36c,'isFromAdapter':!0x0});}),this['listenTo'](_0x58e5a0,'commentThreadReopened',(_0x3f55a3,{commentThreadId:_0x4f243e})=>{const _0x4cbb7a=_0x4851c5['getCommentThread'](_0x4f243e);_0x4cbb7a&&_0x4cbb7a['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x58e5a0,'commentThreadRemoved',(_0x3ac2e4,{commentThreadId:_0x40d88d})=>{const _0x396cd9=_0x4851c5['getCommentThread'](_0x40d88d);_0x396cd9&&_0x396cd9['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x58e5a0,'commentAdded',(_0x58c020,_0x6e93cb)=>{const _0x43bbc6=_0x6e93cb['commentThreadId'],_0x3b6850=_0x4851c5['getCommentThread'](_0x43bbc6);_0x3b6850&&_0x3b6850['addComment']({...dt(_0x6e93cb),'isFromAdapter':!0x0});}),this['listenTo'](_0x58e5a0,'commentUpdated',(_0xda1047,{commentThreadId:_0x55bbba,commentId:_0xadfbeb,content:_0x455efa,attributes:_0x1c3e5c})=>{const _0x4b1236=_0x4851c5['getCommentThread'](_0x55bbba);if(_0x4b1236){const _0x1e644a=_0x4b1236['getComment'](_0xadfbeb);_0x1e644a&&_0x1e644a['update']({'content':_0x455efa,'attributes':_0x1c3e5c,'isFromAdapter':!0x0});}}),this['listenTo'](_0x58e5a0,'commentRemoved',(_0x56edf6,{commentThreadId:_0x5ecf79,commentId:_0x1e2f7c})=>{const _0x355b0c=_0x4851c5['getCommentThread'](_0x5ecf79);if(_0x355b0c){const _0x56341b=_0x355b0c['getComment'](_0x1e2f7c);_0x56341b&&_0x56341b['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x58e5a0,'disconnected',()=>{'connected'===this['context']['plugins']['get'](J)['connection']?.['state']&&(this['_services']['delete'](_0x34daf7),this['stopListening'](_0x58e5a0));}),await this['_connectService'](_0x34daf7);}destroy(){if(this['context']instanceof _0x5bdd40){const _0x537c04=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x537c04)&&this['_terminateService'](_0x537c04);}}_terminateService(_0x41adaa){if(!this['_services']['has'](_0x41adaa))throw new _0x287bee('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x41adaa});this['_getService'](_0x41adaa)['disconnect'](),this['_services']['delete'](_0x41adaa);}async reconnect(){for(const _0x1e643f of this['_services']['keys']())await this['_connectService'](_0x1e643f);if(this['context']instanceof _0x5bdd40){const _0x587749=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x587749)){const _0x485c00=this['context']['plugins']['get'](Q);_0x485c00['unregister'](_0x587749);const _0x19635a=await this['_services']['get'](_0x587749)['getConnectedSessions']();_0x485c00['register'](_0x587749,_0x19635a);}}}async _connectService(_0x1ae9a4){const {connection:_0x370958}=this['context']['plugins']['get'](J),_0x509638=this['context']['plugins']['get'](_0x2650ae),_0x4da737=await this['_services']['get'](_0x1ae9a4)['connect'](_0x370958);await this['_fetchMissingUsersForThreads'](_0x4da737);const _0x4b3fdf=new Set(Array['from'](_0x509638['getCommentThreads']({'channelId':_0x1ae9a4}),_0x58d733=>_0x58d733['id']));for(const _0x4b9dc7 of _0x4da737)_0x4b9dc7['deletedAt']||_0x4b3fdf['delete'](_0x4b9dc7['commentThreadId']);for(const _0xeb6548 of _0x4b3fdf)_0x509638['getCommentThread'](_0xeb6548)['remove']({'isFromAdapter':!0x0});for(const _0x4690a2 of _0x4da737){let _0x4ebdbc=_0x509638['getCommentThread'](_0x4690a2['commentThreadId']);const {commentThreadId:_0x394a99,context:_0x5ab64d,attributes:_0x31aac2,resolvedBy:_0x368223,resolvedAt:_0x3a304d,unlinkedAt:_0x53b401,deletedAt:_0x4d0c7b}=_0x4690a2;if(_0x4d0c7b)continue;_0x4ebdbc||(_0x4ebdbc=_0x509638['addCommentThread']({'channelId':_0x1ae9a4,'threadId':_0x394a99,'context':_0x5ab64d,'attributes':_0x31aac2||{},'resolvedBy':_0x368223,'resolvedAt':_0x3a304d,'unlinkedAt':_0x53b401,'isFromAdapter':!0x0}));const _0x2e45be=new Set(Array['from'](_0x4ebdbc['comments'],_0x3173e5=>_0x3173e5['id']));for(const _0x335c9f of _0x4690a2['comments'])_0x2e45be['delete'](_0x335c9f['commentId']);for(const _0x504c1f of _0x2e45be)_0x4ebdbc['getComment'](_0x504c1f)['remove']({'isFromAdapter':!0x0});for(const _0x3867d2 of _0x4690a2['comments']){const _0x3d9996=_0x4ebdbc['getComment'](_0x3867d2['commentId']);_0x3d9996?_0x3d9996['content']!==_0x3867d2['content']&&_0x3d9996['update']({'content':_0x3867d2['content'],'isFromAdapter':!0x0}):_0x4ebdbc['addComment'](Object['assign'](dt(_0x3867d2),{'isFromAdapter':!0x0}));}}}_getService(_0x4aad18){if(!this['_services']['has'](_0x4aad18))throw new _0x287bee('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4aad18});return this['_services']['get'](_0x4aad18);}async _fetchMissingUsersForThreads(_0x2df75e){const _0x1f0aa4=this['context']['plugins']['get'](_0x1ec951),{connection:_0x533118}=this['context']['plugins']['get'](J),_0x308232=new Set();for(const {resolvedBy:_0x41a181,comments:_0x18706f}of _0x2df75e){_0x41a181&&!_0x1f0aa4['getUser'](_0x41a181)&&_0x308232['add'](_0x41a181);for(const {userId:_0xa63134}of _0x18706f)_0x1f0aa4['getUser'](_0xa63134)||_0x308232['add'](_0xa63134);}if(0x0===_0x308232['size'])return;const _0x354c03=await _0x111aa6['getMany'](_0x533118,Array['from'](_0x308232));for(const _0x43d072 of _0x354c03)_0x1f0aa4['getUser'](_0x43d072['id'])||_0x1f0aa4['addUser'](_0x43d072);}};async function ht(_0x363091){if('404'!==_0x363091['code'])throw _0x363091;}function lt(_0x38a89b){if((_0x35192b=_0x38a89b)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x35192b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x35192b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x35192b;throw _0x38a89b;}function dt(_0x31e6b1){return{'threadId':_0x31e6b1['commentThreadId'],'commentId':_0x31e6b1['commentId'],'content':_0x31e6b1['content'],'createdAt':_0x31e6b1['createdAt'],'authorId':_0x31e6b1['userId'],'attributes':_0x31e6b1['attributes']||{}};}var ut=class CloudServicesTrackChangesAdapter extends _0x25a63a{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>_0x60c57a)());_bufferedRequests;_trackChangesService;static get requires(){return[at,_0x3fa8ee,J];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa84337){super(_0xa84337);const _0x56a6ad=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x56a6ad);}init(){const _0x278ef6=this['editor']['plugins']['get'](J),_0x57bdec=this['editor']['plugins']['get'](_0x3fa8ee);return _0x57bdec['adapter']={'getSuggestion':async _0x39a308=>{await this['_waitForServiceReady']();const _0x9312c0=await this['_trackChangesService']['get'](_0x39a308)['catch'](ft);return await this['_fetchMissingUsersForThreads']([_0x9312c0]),_0x9312c0;},'addSuggestion':async({id:_0x1203b4,type:_0x26f148,data:_0xc680b9,originalSuggestionId:_0x1c1f04,attributes:_0x4d50ba})=>{await this['_waitForServiceReady']();const _0x5f3c8b={'id':_0x1203b4,'type':_0x26f148,'data':_0xc680b9,'originalSuggestionId':_0x1c1f04,'attributes':_0x4d50ba},_0x397e61=await this['_trackChangesService']['add'](_0x1203b4,_0x26f148,_0xc680b9,_0x1c1f04,_0x4d50ba)['catch'](_0x2162df=>{if(mt(_0x2162df))return new Promise(_0x50eb10=>{this['_bufferedRequests']['set'](_0x1203b4,{'resolve':_0x50eb10,'suggestionData':_0x5f3c8b});});throw _0x2162df;});return this['_bufferedRequests']['delete'](_0x1203b4),_0x397e61;},'updateSuggestion':async(_0x248387,_0x4a9c53)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4a9c53['state'])return this['_trackChangesService']['update'](_0x248387,_0x4a9c53)['catch'](ft);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x43477a,_0x73f3db)=>{_0x57bdec['hasSuggestion'](_0x73f3db['id'])&&(_0x57bdec['getSuggestion'](_0x73f3db['id'])['attributes']=_0x73f3db['attributes']);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x278ef6['connection']?.['state']&&(_0x278ef6['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));}),this['_trackChangesService']['connect'](_0x278ef6['connection'])['then'](_0x4313ec=>(_0x278ef6['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x4313ec)['then'](()=>{for(const _0x573a9c of _0x4313ec){_0x57bdec['addSuggestionData'](_0x573a9c)['_saved']=!0x0;}})));}async reconnect(){const _0x514ad8=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x513a15}=this['editor']['plugins']['get'](J),_0x31fec5=await this['_trackChangesService']['connect'](_0x513a15);await this['_fetchMissingUsersForThreads'](_0x31fec5);for(const {suggestionData:_0x531f37,resolve:_0x2cad72}of this['_bufferedRequests']['values']()){let _0x4dfab2=_0x31fec5['find'](_0x4f0282=>_0x4f0282['id']===_0x531f37['id']);_0x4dfab2||(_0x4dfab2=await this['_trackChangesService']['add'](_0x531f37['id'],_0x531f37['type'],_0x531f37['data'],_0x531f37['originalSuggestionId'])),_0x2cad72(_0x4dfab2);}for(const _0x48c4e1 of _0x31fec5)_0x514ad8['hasSuggestion'](_0x48c4e1['id'])||_0x514ad8['addSuggestionData'](_0x48c4e1);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x31de86=>{this['listenTo'](this['_trackChangesService'],'connected',_0xc16210=>{_0xc16210['off'](),_0x31de86();});});}async _fetchMissingUsersForThreads(_0xc2f5b5){const _0x14e003=this['editor']['plugins']['get'](_0x1ec951),{connection:_0x5ee937}=this['editor']['plugins']['get'](J),_0xb9158f=new Set();for(const {authorId:_0x30ab3c}of _0xc2f5b5)_0x14e003['getUser'](_0x30ab3c)||_0xb9158f['add'](_0x30ab3c);if(0x0===_0xb9158f['size'])return;const _0x40e777=await _0x111aa6['getMany'](_0x5ee937,Array['from'](_0xb9158f));for(const _0x1023d1 of _0x40e777)_0x14e003['getUser'](_0x1023d1['id'])||_0x14e003['addUser'](_0x1023d1);}};function ft(_0x394c09){if(mt(_0x394c09))return new Promise(()=>{});throw _0x394c09;}function mt(_0x384033){return _0x384033['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x384033['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var pt=class extends _0x25a63a{static get requires(){return[_0x5d890b,at,ct,J];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x270fb5=this['editor']['plugins']['get'](J),_0x2423fc=this['editor']['plugins']['get'](_0x2ee7a0),_0x10189c=this['editor']['plugins']['get'](at);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x270fb5,'change:state',(_0x2ecaed,_0xcf42c8,_0x1de288)=>{_0x2423fc['isThreadsLoadingPaused']='connected'!==_0x1de288;});}),this['listenTo'](_0x270fb5,'change:state',(_0x3188d8,_0x483443,_0x56af08)=>{this['editor']['plugins']['get'](_0x2650ae)['switchReadOnly']('connected'!==_0x56af08);}),_0x10189c['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}destroy(){const _0x45d24a=this['editor']['plugins']['get'](at),_0x13bf1b=this['editor']['config']['get']('collaboration.channelId');_0x45d24a['_services']['has'](_0x13bf1b)&&_0x45d24a['_terminateService'](_0x13bf1b),super['destroy']();}},gt=class extends _0x25a63a{static get requires(){return[pt,ut,_0x2c49db];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class CloudServicesRevisionHistoryAdapter extends _0x25a63a{static RevisionHistoryService=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>_0xc7a318)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;static get requires(){return[J,it,_0x4aeac8,Q,_0x1ec951];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1a4640){super(_0x1a4640);const _0x2d1340=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x2d1340);}async init(){const _0xa942ec=this['editor']['plugins']['get'](it),_0x1c6fd9=_0xa942ec['serverHistory'],_0x23a3fc=this['editor']['plugins']['get'](J);this['_revisionTracker']['setSource']({'history':_0x1c6fd9,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xa942ec['sessionId']});const _0x1703b2=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x2f0ce3,_0x167bef=await _0x31dfe2['isBundleUploaded'](_0x23a3fc['connection'],_0x1703b2);this['editor']['plugins']['get'](_0x4aeac8)['adapter']={'getRevision':async({revisionId:_0x5530a3})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5530a3)),'updateRevisions':async _0x2ddad3=>{await this['_waitForServiceReady']();const _0x3aa582=this['_revisionTracker']['currentRevision'];if(_0x167bef&&0x1===_0x2ddad3['length']&&_0x2ddad3[0x0]['id']===_0x3aa582['id'])return _0x2ddad3;for(const _0x417652 of _0x2ddad3)_0x417652['id']===_0x3aa582['id']&&(_0x417652['isEmptyCurrent']=_0x417652['fromVersion']===_0x417652['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x2ddad3,this['_lastRequestId'])['then'](_0x31f5d0=>(this['_lastRequestId']=_0x31f5d0,_0x2ddad3))['catch'](_0x52de10=>{if(vt(_0x52de10)||'400'===_0x52de10['code']&&void 0x0!==_0x52de10['data']['wrongRequestId']){for(const _0x33494d of _0x2ddad3)this['_revisionTracker']['repository']['getRevision'](_0x33494d['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x33494d['id'],_0x33494d,!0x1);if(vt(_0x52de10)&&'destroyed'!==this['editor']['state'])throw _0x52de10;return _0x2ddad3;}throw _0x52de10;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x231d9a,{revisionsData:_0xb76dee,requestId:_0x4b56cf})=>{Math['max'](..._0xb76dee['map'](_0x2e6165=>_0x2e6165['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0xb76dee,_0x4b56cf);}):this['_handleRevisionsUpdate'](_0xb76dee,_0x4b56cf);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x23a3fc['connection']?.['state']&&(_0x23a3fc['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x5cf6de,requestId:_0x43e67b}=await this['_revisionHistoryService']['connect'](_0x23a3fc['connection']);_0x23a3fc['addToReconnectionStack'](this),this['_lastRequestId']=_0x43e67b,await this['_fetchMissingUsers'](_0x5cf6de);for(const _0x118a6d of _0x5cf6de)this['_revisionTracker']['addRevisionData'](_0x118a6d);this['listenTo'](_0xa942ec,'change:_isConnected',(_0x2531c5,_0x52b4cb,_0x41de2b)=>{_0x41de2b&&(this['_oldOffset']=_0xa942ec['_offset'],_0x2531c5['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async reconnect(){const _0x1ac820=this['editor']['plugins']['get'](J),_0x58ffdd=this['editor']['plugins']['get'](it),_0x1d7fac=async()=>{const _0x43c6b0=this['_revisionTracker']['currentRevision'],_0x1a832c=_0x43c6b0['id'],_0x209eb1=_0x1a832c!==_0x58ffdd['sessionId'];if(_0x209eb1){const _0x41f914=_0x58ffdd['_offset']-this['_oldOffset'],_0x4c2c7c=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x43c6b0['toVersion']+_0x41f914!==_0x4c2c7c){const _0x257c8b=_0x43c6b0['fromVersion']+_0x41f914,_0x58c74d=this['editor']['plugins']['get'](_0x1ec951),_0x524f28=this['_revisionTracker']['buildRevisionData']({'revision':_0x43c6b0,'from':_0x257c8b,'to':_0x4c2c7c});_0x524f28['id']=_0x43c6b0['id'];const _0x1812ff=_0x524f28['authorsIds']['map'](_0x470ed1=>_0x58c74d['getUser'](_0x470ed1));_0x43c6b0['_update']({..._0x524f28,'authors':_0x1812ff},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x43c6b0['id'],_0x524f28,!0x0);}this['_revisionTracker']['_startingVersion']=_0x4c2c7c,_0x43c6b0['toVersion']!==_0x43c6b0['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x1a832c)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x1a832c),this['_revisionTracker']['_createCurrentRevision'](_0x4c2c7c);}const {revisions:_0x507843,requestId:_0x22e86a}=await this['_revisionHistoryService']['reconnect'](_0x1ac820['connection'],this['_lastRequestId']);_0x209eb1&&_0x507843['length']>0x0?_0x58ffdd['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x507843),this['_handleRevisionsUpdate'](_0x507843,_0x22e86a),this['_revisionTracker']['sendBufferedUpdates']());};return _0x58ffdd['_isConnected']?_0x1d7fac():new Promise((_0x280093,_0x26d08f)=>{_0x58ffdd['once']('change:_isConnected',()=>{_0x1d7fac()['then'](_0x280093)['catch'](_0x26d08f);});});}destroy(){super['destroy']();}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x26ac99=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x51f938=>{_0x51f938['off'](),_0x26ac99();});});}_getLatestVersionFromServerOperations(){const _0x3d05c1=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x12068c of _0x3d05c1)if('marker'!==_0x12068c['type']||_0x12068c['affectsData'])return _0x12068c['baseVersion']+0x1;}_getLatestVersion(){const _0xde11e1=this['editor']['plugins']['get'](it);return new Promise(_0x54a92b=>{_0xde11e1['_isPendingUpdate']?_0xde11e1['once']('change:_isPendingUpdate',()=>{_0x54a92b(this['_getLatestVersionFromServerOperations']());}):_0x54a92b(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x2be37b,_0x2aa44b){const _0x143004=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2aa44b;for(const _0x2eb96e of _0x2be37b){const _0x50b1f0=_0x143004['getRevision'](_0x2eb96e['id']);if(_0x50b1f0){if((_0x2eb96e['fromVersion']||_0x2eb96e['toVersion'])&&(_0x2eb96e['diffData']=null),_0x50b1f0===this['_revisionTracker']['currentRevision']){const _0x166675=Math['max'](_0x50b1f0['toVersion'],_0x2eb96e['toVersion']),_0x576645=Math['max'](_0x50b1f0['fromVersion'],_0x2eb96e['fromVersion']);let _0x3e7227;_0x50b1f0['toVersion']===_0x2eb96e['toVersion']&&_0x50b1f0['fromVersion']===_0x2eb96e['fromVersion']?(_0x3e7227=!0x0,this['_preventResendingRevisionData'](_0x2eb96e)):_0x2eb96e['toVersion']===_0x166675&&_0x2eb96e['fromVersion']===_0x576645?_0x3e7227=!0x1:(_0x50b1f0['toVersion']===_0x166675&&_0x50b1f0['fromVersion']===_0x576645||this['_fixRevision']({'revision':_0x50b1f0,'from':_0x576645,'to':_0x166675}),_0x3e7227=!0x0),_0x3e7227&&(delete _0x2eb96e['fromVersion'],delete _0x2eb96e['toVersion'],delete _0x2eb96e['diffData'],delete _0x2eb96e['createdAt'],delete _0x2eb96e['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2eb96e),this['_preventResendingRevisionData'](_0x2eb96e);}else this['_revisionTracker']['addRevisionData'](_0x2eb96e);}const _0x1e187a=_0x143004['getRevisions']();_0x1e187a['reverse']();for(let _0x4b647f=0x0;_0x4b647f<_0x1e187a['length']-0x1;_0x4b647f++){const _0x42ec30=_0x1e187a[_0x4b647f],_0x43dc73=_0x1e187a[_0x4b647f+0x1];if(_0x42ec30['fromVersion']<_0x43dc73['toVersion']){const _0x33f114=_0x43dc73['toVersion'],_0x12c956=Math['max'](_0x33f114,_0x42ec30['toVersion']);this['_fixRevision']({'revision':_0x42ec30,'from':_0x33f114,'to':_0x12c956});}}}['_fixRevision']({revision:_0x205e80,from:_0x573d92,to:_0x2853bd}={}){const _0x879c49=this['editor']['plugins']['get'](_0x1ec951),_0x4bbbb5=this['_revisionTracker']['buildRevisionData']({'revision':_0x205e80,'from':_0x573d92,'to':_0x2853bd});_0x4bbbb5['authors']=_0x4bbbb5['authorsIds']['map'](_0xe95e01=>_0x879c49['getUser'](_0xe95e01)),_0x205e80['_update'](_0x4bbbb5);}_preventResendingRevisionData(_0x5e7599){const _0x27261f={};_0x27261f['id']=_0x5e7599['id'];for(const _0x1a8f7f of Object['keys'](_0x5e7599))'id'!==_0x1a8f7f&&(_0x27261f[_0x1a8f7f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x27261f['id'],_0x27261f,!0x0);}async _fetchMissingUsers(_0x13b90e){const _0x5a6c84=this['editor']['plugins']['get'](_0x1ec951),{connection:_0x42795a}=this['editor']['plugins']['get'](J),_0x4ae964=new Set();for(const _0x17e908 of _0x13b90e){for(const _0x215ab7 of _0x17e908['authorsIds'])_0x33d7fa(_0x215ab7);_0x17e908['creatorId']&&_0x33d7fa(_0x17e908['creatorId']);}if(0x0===_0x4ae964['size'])return;const _0xbd42a5=await _0x111aa6['getMany'](_0x42795a,Array['from'](_0x4ae964));for(const _0x46279f of _0xbd42a5)_0x5a6c84['getUser'](_0x46279f['id'])||_0x5a6c84['addUser'](_0x46279f);function _0x33d7fa(_0x263fdd){_0x5a6c84['getUser'](_0x263fdd)||_0x4ae964['add'](_0x263fdd);}}};function vt(_0x5c6ec9){return _0x5c6ec9['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5c6ec9['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5c6ec9['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var _t=class extends _0x25a63a{static get requires(){return[_0x4aeac8,wt,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},yt=class extends _0x3395c3{_collapseAt;constructor(_0x5bcdf5,_0x1179b6=0x6){super(_0x5bcdf5);const _0x5640c4=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1179b6,this['bind']('isHidden')['to'](this,'usersCount',_0x23f886=>_0x23f886<_0x1179b6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x5640c4['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':_0x5640c4['to']('usersCount',_0x24b228=>'+'+(_0x24b228-this['_collapseAt']+0x2)['toString']())}]}]}]});}},bt=class extends _0x3395c3{items;keystrokes;constructor(_0x43401d){super(_0x43401d);const _0x1fe3ac=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x39c9b2(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1fe3ac['if']('hasPopup'),'aria-expanded':_0x1fe3ac['to']('isExpanded',_0x43a79d=>this['hasPopup']&&String(_0x43a79d)),'aria-label':_0x1fe3ac['to']('hasPopup',_0x1079c1=>et(_0x43401d,_0x1079c1?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1fe3ac['to']('hasPopup',_0x5a6184=>!!_0x5a6184&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0x20d062,_0x2b8569,_0x5672fb)=>{this['element']&&(_0x5672fb?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']);}},kt=class extends _0x3395c3{counterView;inlineListView;constructor(_0x551ddc,_0x5f50af=0x6){super(_0x551ddc);const _0x58435f=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new yt(this['locale'],_0x5f50af),this['inlineListView']=new bt(_0x551ddc),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x571113 of this['inlineListView']['items'])_0x571113['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',_0x58435f['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},It=class extends _0x3395c3{listWrapperView;constructor(_0x5996b5,_0xa0b686){super(_0x5996b5),this['listWrapperView']=new St(_0x5996b5,_0xa0b686),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0x5996b5,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},St=class extends _0x2bdca1{constructor(_0xa643dc,_0x5899a4){super(_0xa643dc);const _0x12f7a3=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x5899a4?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x12f7a3['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x12f7a3['to']('role'),'aria-label':_0x12f7a3['to']('ariaLabel'),'aria-labelledby':_0x12f7a3['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x37a491['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5a7ce3=this['element'];_0x5a7ce3&&(this['_isScrollable']=Math['max'](_0x5a7ce3['scrollHeight'],_0x5a7ce3['clientHeight'])>0.8*window['innerHeight']);}},Tt=class extends _0x182c65{['userView'];constructor(_0x22d710,_0x47ae9b,_0x43f726){super(_0x22d710);const _0x239126=this['bindTemplate'];this['userView']=new _0x132f1a(_0x22d710,_0x47ae9b);const _0x3f660d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x47ae9b['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x47ae9b['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x47ae9b['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x47ae9b['color']['getColorVariable'](),'--ck-user-color-alpha':_0x47ae9b['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x43f726&&(_0x3f660d['tag']='button',_0x3f660d['on']={'click':_0x239126['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3f660d);}['focus'](){this['element']['focus']();}},Ct=class extends _0x3395c3{['userView'];['markerView'];constructor(_0x3d4108,_0x1e2ea8,_0x11a28b){super(_0x3d4108);const _0x33dd77=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x132f1a(_0x3d4108,_0x1e2ea8),this['markerView']=new At(_0x3d4108,_0x1e2ea8);const _0x5eda9f=new _0x24defb(_0x3d4108);_0x5eda9f['template']['tag']='span',_0x5eda9f['text']=_0x1e2ea8['name'];const _0x37daf4={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x33dd77['to']('isFocusable',_0x56cc75=>_0x56cc75?0x0:-0x1),'aria-labelledby':_0x5eda9f['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x33dd77['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x33dd77['to']('hasTooltip',_0x486ecb=>!_0x486ecb),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x5eda9f]};_0x11a28b&&(_0x37daf4['tag']='button',_0x37daf4['on']={'click':_0x33dd77['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x37daf4);}},At=class extends _0x3395c3{constructor(_0x14486e,_0x42dd0){super(_0x14486e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x42dd0['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x42dd0['color']['getColorVariable'](),'--ck-user-color-alpha':_0x42dd0['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Pt={'collapseAt':0x6,'displayMe':!0x0};var Ot=class extends _0x15a293{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x8201c5){super(_0x8201c5),this['context']['config']['define']('presenceList',Pt);const _0x3d2252=_0x8201c5['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3d2252)throw new _0x287bee('presencelist-collapseat-invalid-format',this);if(_0x3d2252<0x1)throw new _0x287bee('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Q)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x42c4d2(),this['balloonPanelView']=new _0x5d38fc(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[Q];}init(){for(const _0x428151 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x428151);this['listenTo'](this['_allConnectedUsers'],'add',(_0x2f1a6c,_0x2081d8)=>{this['_handleUserAdd'](_0x2081d8);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x47ebbb,_0x4f4087)=>{this['_handleUserRemove'](_0x4f4087);});}_createView(){const _0x14e427=this['context'],_0x7bca61=new kt(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x1871ce=this['balloonPanelView'];if(!_0x4505f3(_0x14e427['config']['get']('presenceList.container')))throw new _0x287bee('presencelist-missing-container',this);_0x7bca61['counterView']['bind']('usersCount')['to'](this),_0x7bca61['bind']('isCollapsed')['to'](this,'usersCount',_0x4acde6=>{const {collapseAt:_0x7f283}=_0x14e427['config']['get']('presenceList'),_0x2326be=_0x4acde6>=_0x7f283;if(_0x2326be&&!_0x7bca61['inlineListView']['items']['find'](_0x263606=>_0x263606 instanceof yt)){const _0x20fe08=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x20fe08&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x7bca61['inlineListView']['items']['add'](_0x7bca61['counterView']);}return _0x2326be||this['hideDropdown'](),_0x2326be;}),_0x7bca61['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x3d396a=>{const _0x164d52=_0x14e427['config']['get']('presenceList'),_0x5953aa=new Ct(_0x14e427['locale'],_0x3d396a,!!_0x164d52['onClick']);return _0x5953aa['bind']('hasTooltip')['to'](_0x7bca61,'isCollapsed',_0x1c75e0=>!_0x1c75e0),_0x5953aa['bind']('isFocusable')['to'](_0x7bca61,'isCollapsed',_0x59d9a2=>!_0x59d9a2),_0x164d52['onClick']&&this['listenTo'](_0x5953aa,'execute',()=>{this['view']['isCollapsed']||_0x164d52['onClick'](_0x3d396a,_0x5953aa['element']);}),_0x5953aa;}),_0x7bca61['inlineListView']['keystrokes']['set']('Enter',(_0x3454ed,_0x4f72dd)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0x4f72dd());}),_0x7bca61['render'](),_0x1871ce['render'](),_0x7bca61['listenTo'](_0x7bca61['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x55aadd=(_0x1bab9a,_0x3fbcb6)=>{this['_hideDropdownUnlessPointerInside'](_0x3fbcb6);};return _0x7bca61['listenTo'](_0x7bca61['inlineListView']['element'],'mouseleave',_0x55aadd),_0x7bca61['listenTo'](_0x1871ce['element'],'mouseleave',_0x55aadd),_0x3b4e81({'emitter':_0x7bca61,'activator':()=>_0x1871ce['isVisible'],'contextElements':[_0x1871ce['element'],_0x7bca61['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x14e427['config']['get']('presenceList.container')['appendChild'](_0x7bca61['element']),this['_overlayHost']=new _0x4e3b41(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x7bca61;}_resolveOverlayTarget(){const _0x278385=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x278385)return _0x278385;const _0x3eab02=this['context']['config']['get']('presenceList.container');return _0x3eab02?_0x337ae7(_0x3eab02):null;}['_handleUserAdd'](_0x4e4c14){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x4e4c14['isMe'])return;const _0x541708=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x541708-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4c3a0f=_0x4e4c14['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x4e4c14,_0x4c3a0f);}['_handleUserRemove'](_0x319db3){this['usersCount']--;const {collapseAt:_0x358af3}=this['context']['config']['get']('presenceList'),_0x3118c1=this['usersCount']>=_0x358af3;if(this['currentDisplayedUsers']['get'](_0x319db3['id']))this['currentDisplayedUsers']['remove'](_0x319db3['id']);else{if(_0x3118c1&&this['currentDisplayedUsers']['length']+0x1===_0x358af3-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x3118c1?0x1:0x0)<this['usersCount']){for(const _0x1b1726 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1b1726['id'])&&(this['currentDisplayedUsers']['add'](_0x1b1726,Math['min'](this['currentDisplayedUsers']['length']-(_0x3118c1?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x3118c1?0x1:0x0)===_0x358af3-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1443d0=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new It(this['context']['locale'],!!_0x1443d0['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x2f7671}=this['presenceDropdownView'];_0x2f7671['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x19fbdc=>{if(!_0x1443d0['displayMe']&&_0x19fbdc['isMe'])return null;const _0x5ec1c1=new Tt(this['context']['locale'],_0x19fbdc,!!_0x1443d0['onClick']);return _0x1443d0['onClick']&&this['listenTo'](_0x5ec1c1,'execute',()=>{_0x1443d0['onClick'](_0x19fbdc,_0x5ec1c1['element']);}),_0x5ec1c1;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']);const _0x39369a=_0x5d38fc['generatePositions']({'heightOffset':0x3,'config':{'withArrow':!0x1}});this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element'],'positions':[_0x39369a['southArrowNorth'],_0x39369a['southArrowNorthMiddleWest'],_0x39369a['southArrowNorthMiddleEast'],_0x39369a['southArrowNorthWest'],_0x39369a['southArrowNorthEast'],_0x39369a['northArrowSouth'],_0x39369a['northArrowSouthMiddleWest'],_0x39369a['northArrowSouthMiddleEast'],_0x39369a['northArrowSouthWest'],_0x39369a['northArrowSouthEast'],_0x39369a['viewportStickyNorth']]}),_0x2f7671['focus'](),_0x2f7671['checkIfScrollable']();const _0x541b36=(_0x2a3681,_0x417b2f)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x417b2f();};_0x2f7671['keystrokes']['set']('Esc',_0x541b36),_0x2f7671['keystrokes']['set']('Shift+Tab',_0x541b36),_0x2f7671['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0x2f7671['focusTracker']['add'](this['view']['element']),_0x2f7671['focusTracker']['on']('change:isFocused',(_0x12aab5,_0x5138b3,_0x489164)=>{_0x489164||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}_hideDropdownUnlessPointerInside(_0x4cffcb){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x1ad67a=>_0x552395(_0x1ad67a,_0x4cffcb))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},xt=class extends _0x15a293{static get requires(){return[Q,Ot];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{at as CloudServicesCommentsAdapter,wt as CloudServicesRevisionHistoryAdapter,ut as CloudServicesTrackChangesAdapter,xt as PresenceList,Ot as PresenceListUI,it as RealTimeCollaborationClient,pt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,_t as RealTimeCollaborativeRevisionHistory,gt as RealTimeCollaborativeTrackChanges,Q as Sessions,J as WebSocketGateway};
|