@ckeditor/ckeditor5-real-time-collaboration 46.0.2-alpha.0 → 46.0.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +2 -2
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x5532a5];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14d259){super(_0x14d259),this['set']('state',_0x3d49a0['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x1dcc6c())();}['init'](){const _0x10371e=this['context'],_0x279285=_0x10371e['plugins']['get']('CloudServices'),_0x2d9668=_0x10371e['plugins']['get'](_0x5532a5);if(!_0x279285['token'])throw new _0x310ec5('websocketgateway-missing-token',this);if(!_0x279285['webSocketUrl'])throw new _0x310ec5('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x279285['token'],_0x279285['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x1b9184=>{if(this['connection']=_0x1b9184,this['bind']('state')['to'](_0x1b9184,'state',this,'_isBrowserOffline',(_0x2f780d,_0x32eba0)=>('connected'!==_0x2f780d&&(this['_shouldPluginsReconnect']=!0x0),_0x32eba0||_0x2f780d!==_0x3d49a0['CONNECTED']?_0x3d49a0['DISCONNECTED']:this['state']==_0x3d49a0['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3d49a0['CONNECTING']):_0x3d49a0['CONNECTED'])),this['connection']['on']('error',(_0x3f5adc,_0x45abc2)=>{if('limitExceeded'!==_0x45abc2['code'])throw console['error'](_0x45abc2),new _0x310ec5('cloudservices-init',null,{'originalError':_0x45abc2});_0x2d9668['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'});}),!_0x1b9184['me'])return new Promise(_0x308c19=>_0x1b9184['on']('change:me',_0x308c19));})['catch'](_0x596358=>{throw console['error'](_0x596358),new _0x310ec5('cloudservices-init',null,{'originalError':_0x596358});});}['addToReconnectionStack'](_0x8b2c9b){if('function'!=typeof _0x8b2c9b['reconnect'])throw new _0x310ec5('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x8b2c9b))throw new _0x310ec5('websocketgateway-plugin-already-registered',this,{'name':_0x8b2c9b['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x8b2c9b);}['removeFromReconnectionStack'](_0x219dbe){this['_reconnectionStack']['delete'](_0x219dbe);}['isInReconnectionStack'](_0x3a5d76){return this['_reconnectionStack']['has'](_0x3a5d76);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1d3fc3=>_0x1d3fc3['reconnect']())))['then'](()=>this['state']=_0x3d49a0['CONNECTED'])['catch'](_0x4022b7=>{throw console['error'](_0x4022b7),new _0x310ec5('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3d49a0['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x4d3b80{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0xaa642b];}constructor(_0x1a5da2){super(_0x1a5da2),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x3f433a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0xaa642b);}['init'](){const _0x14335d=this['context']['plugins']['get'](n);this['listenTo'](_0x14335d,'change:state',(_0x64cd4c,_0x17a2f4,_0x3f139c)=>{if('connected'!==_0x3f139c)this['channelSessions']['forEach'](_0x368550=>_0x368550['clear']()),this['channelConnectedUsers']['forEach'](_0x447c20=>_0x447c20['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5137b7,_0x42fe7c]of this['_registeredSessions'])for(const _0x3ccf53 of _0x42fe7c)this['_handleSessionAdd'](_0x5137b7,_0x3ccf53);}}),this['_createUser'](_0x14335d['connection']['me'],!0x0);}['register'](_0xa2a91b,_0x51ae6d){if(this['_registeredSessions']['has'](_0xa2a91b))throw new _0x310ec5('sessions-register-already-registered',null,{'channelId':_0xa2a91b});this['_registeredSessions']['set'](_0xa2a91b,_0x51ae6d),this['channelSessions']['set'](_0xa2a91b,new _0x3f433a()),this['channelConnectedUsers']['set'](_0xa2a91b,new _0x3f433a()),this['listenTo'](_0x51ae6d,'add',(_0x6bf4e5,_0x5cf5fb)=>this['_handleSessionAdd'](_0xa2a91b,_0x5cf5fb)),this['listenTo'](_0x51ae6d,'remove',(_0x1b669b,_0x6b1832)=>this['_handleSessionRemove'](_0xa2a91b,_0x6b1832));for(const _0x700ece of _0x51ae6d)this['_handleSessionAdd'](_0xa2a91b,_0x700ece);}['unregister'](_0x4703d8){if(!this['_registeredSessions']['has'](_0x4703d8))throw new _0x310ec5('sessions-unregister-not-exist',null,{'channelId':_0x4703d8});const _0x110f44=this['_registeredSessions']['get'](_0x4703d8);this['stopListening'](_0x110f44);for(const _0x204457 of _0x110f44)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x4703d8,_0x204457);this['_registeredSessions']['delete'](_0x4703d8),this['channelSessions']['delete'](_0x4703d8),this['channelConnectedUsers']['delete'](_0x4703d8);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x30160b){for(const _0xa5e1a0 of this['channelSessions']['values']())for(const _0x572b7f of _0xa5e1a0)if(_0x572b7f['id']===_0x30160b)return _0x572b7f['user'];}['getUserSessions'](_0x2b06e3,_0x26f999){const _0x288e55=_0x26f999?[this['channelSessions']['get'](_0x26f999)]:this['channelSessions']['values'](),_0x25abbc=new Set();for(const _0x540152 of _0x288e55)for(const _0x90e437 of _0x540152)_0x90e437['user']['id']===_0x2b06e3['id']&&_0x25abbc['add'](_0x90e437['id']);return _0x25abbc;}['getUserRole'](_0x1b207e){for(const _0x3d82ba of this['channelSessions']['values']())for(const _0x16d3e2 of _0x3d82ba)if(_0x16d3e2['user']===_0x1b207e)return _0x16d3e2['role'];}['_handleSessionAdd'](_0x11290b,_0x2d1bdb){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x553938=_0x2d1bdb['user'],_0x8c9302=this['_users']['getUser'](_0x553938['id'])||this['_createUser'](_0x553938),_0x354b09=Object['assign']({},_0x2d1bdb,{'user':_0x8c9302});this['channelSessions']['get'](_0x11290b)['add'](_0x354b09);const _0x56ef65=this['channelConnectedUsers']['get'](_0x11290b);_0x56ef65['has'](_0x8c9302['id'])||_0x56ef65['add'](_0x8c9302),this['allConnectedUsers']['has'](_0x8c9302['id'])||this['allConnectedUsers']['add'](_0x8c9302,_0x8c9302['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x11290b,{'channelId':_0x11290b,'session':_0x354b09});}['_handleSessionRemove'](_0x5c16ae,_0x25e5e2){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x50292a=this['channelConnectedUsers']['get'](_0x5c16ae),_0x3069a1=_0x25e5e2['user'];_0x3069a1['id']&&(this['channelSessions']['get'](_0x5c16ae)['remove'](_0x25e5e2['id']),_0x50292a['has'](_0x3069a1['id'])&&!this['getUserSessions'](_0x3069a1,_0x5c16ae)['size']&&_0x50292a['remove'](_0x3069a1['id']),this['allConnectedUsers']['get'](_0x3069a1['id'])&&!this['getUserSessions'](_0x3069a1)['size']&&this['allConnectedUsers']['remove'](_0x3069a1['id']));}['_createUser'](_0x17cf91,_0x16b50a){const _0x50d580=this['_users']['addUser'](_0x17cf91);return _0x16b50a&&this['_users']['defineMe'](_0x17cf91['id']),_0x50d580['orderNumber']=this['_uniqueUsersCount']++,_0x50d580;}}class G extends _0x10d243{['_domEmitter']=new(_0x1dcc6c())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x377e2d=this['editor'],_0x4f3d17=_0x377e2d['plugins']['get'](i);_0x377e2d['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x17aefb,{writer:_0x10b77d})=>function(_0x499a84,_0x33c0e7,_0x3af51a,_0x570b62){const _0x2bbb61=_0x499a84['markerName']['split'](':')[0x2],_0x44f36d=_0x3af51a['getUserBySessionId'](_0x2bbb61);if(!_0x44f36d||_0x2bbb61===_0x3af51a['mySessionId'])return;if(!_0x570b62['model']['schema']['checkChild'](_0x499a84['markerRange']['start'],'$text'))return;const _0x11a0ea={'class':'ck-user__marker\x20'+_0x44f36d['color']['getMarkerClass'](),'data-name':_0x44f36d['name'],'data-session-id':_0x2bbb61},_0x2e41e6=_0x570b62['model']['markers']['get'](_0x499a84['markerName']),_0x5a675b=_0x2e41e6['getStart'](),_0x3d4ce5=_0x5a675b['nodeAfter'],_0x3a7fc1=_0x570b62['model']['schema'];if(_0x3d4ce5&&_0x3a7fc1['isObject'](_0x3d4ce5)&&_0x3a7fc1['isInline'](_0x3d4ce5)&&!_0x570b62['model']['markers']['get']('user:range:'+_0x2bbb61)['getRange']()['isCollapsed'])return;const _0x42d193=_0x5a675b['parent'];return _0x570b62['model']['schema']['isLimit'](_0x42d193)&&!_0x570b62['model']['hasContent'](_0x42d193)&&(_0x11a0ea['contenteditable']=!0x1),function(_0x488506,_0x124bda,_0xeee715){const _0x376274=_0x488506['createUIElement']('span',_0x124bda);return _0x488506['setCustomProperty']('userPositionMarker',!0x0,_0x376274),_0x376274['render']=function(_0x173721){const _0x48f0df=this['toDomElement'](_0x173721),_0x452400=document['createElement']('span');return _0x452400['classList']['add']('ck-user__marker-tooltip'),_0x452400['setAttribute']('contenteditable','false'),_0x452400['setAttribute']('spellcheck','false'),_0x452400['textContent']=_0xeee715['name'],_0x48f0df['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x452400['outerHTML']+'',_0x48f0df['addEventListener']('mouseenter',()=>{_0x48f0df['classList']['add']('ck-user__marker_hovered');}),_0x48f0df['addEventListener']('mouseleave',()=>{_0x48f0df['classList']['remove']('ck-user__marker_hovered');}),_0x48f0df;},_0x376274['isSimilar']=function(_0x422eee){return!(!this['getCustomProperty']('userPositionMarker')||!_0x422eee['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x422eee['getAttribute']('data-session-id'));},_0x376274;}(_0x33c0e7,_0x11a0ea,_0x44f36d);}(_0x17aefb,_0x10b77d,_0x4f3d17,_0x377e2d)}),_0x377e2d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5bda9f=>function(_0x55f522,_0x60a256){const _0x29d4c6=_0x55f522['markerName']['split'](':')[0x2];if(_0x29d4c6===_0x60a256['mySessionId'])return null;const _0x5a7c52=_0x60a256['getUserBySessionId'](_0x29d4c6);if(!_0x5a7c52)return{'id':_0x29d4c6,'classes':[]};return{'id':_0x29d4c6,'classes':['ck-user__selection',_0x5a7c52['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x29d4c6},'priority':0x7d0+_0x5a7c52['orderNumber']};}(_0x5bda9f,_0x4f3d17)}),function(_0x12c2b8){const _0x4bb5c6=_0x12c2b8['model'],_0x2fe7e7=new Map(),_0x2167c5=_0x12c2b8['plugins']['get'](i);_0x4bb5c6['markers']['on']('update:user:range',(_0x63f55e,_0x3be018,_0xe7603e,_0x441c62)=>{if(!_0x441c62&&_0x2fe7e7['get'](_0x3be018['name']))return _0x2fe7e7['get'](_0x3be018['name'])['detach'](),void _0x2fe7e7['delete'](_0x3be018['name']);const _0x2521c4=_0x3be018['name']['split'](':')[0x2];if(_0x2521c4===_0x2167c5['mySessionId'])return;const _0xc71a92='user:position:'+_0x2521c4;_0x4bb5c6['markers']['has'](_0xc71a92)&&_0x12c2b8['editing']['reconvertMarker'](_0xc71a92),_0x3be018['on']('change:range',(_0x30fb35,_0x5b6bfd,_0x3390e2)=>{if('$graveyard'!=_0x5b6bfd['root']['rootName']&&'$graveyard'==_0x3be018['getRange']()['root']['rootName']&&!_0x2fe7e7['has'](_0x3be018['name'])){const _0x27cdf6=_0x4bb5c6['schema']['getNearestSelectionRange'](_0x3390e2['deletionPosition']);if(_0x27cdf6){const _0x12c48c=_0x3b6135['fromRange'](_0x27cdf6);_0x2fe7e7['set'](_0x3be018['name'],_0x12c48c),_0x12c48c['on']('change:range',(_0x47d0d9,_0x40808c,_0x493c44)=>{if('$graveyard'==_0x12c48c['root']['rootName']){const _0x5af767=_0x4bb5c6['schema']['getNearestSelectionRange'](_0x493c44['deletionPosition']);_0x5af767?(_0x12c48c['start']=_0x5af767['start'],_0x12c48c['end']=_0x5af767['end']):(_0x2fe7e7['delete'](_0x3be018['name']),_0x12c48c['detach']());}});}}});}),_0x4bb5c6['document']['on']('change',()=>{_0x2fe7e7['size']>0x0&&_0x4bb5c6['enqueueChange']({'isUndoable':!0x1},_0x224464=>{for(const [_0xb2d482,_0x303697]of _0x2fe7e7)'$graveyard'==_0x4bb5c6['markers']['get'](_0xb2d482)['getRange']()['root']['rootName']&&(te(_0xb2d482['split'](':')[0x2],_0x303697['toRange'](),_0x4bb5c6,_0x224464),_0x303697['detach']());_0x2fe7e7['clear']();});});}(_0x377e2d),this['_domEmitter']['listenTo'](_0x438e09['document'],'keydown',(_0xb65d00,{key:_0x35a8fc})=>{'Escape'===_0x35a8fc&&function(_0x2f3f86){_0x2f3f86['editing']['view']['change'](_0x2bfac9=>{for(const _0x4410be of _0x2f3f86['model']['markers']){if(!_0x4410be['name']['startsWith']('user:position'))continue;const _0x5e0e9e=_0x2f3f86['editing']['mapper']['markerNameToElements'](_0x4410be['name']);if(_0x5e0e9e){for(const _0x49d346 of _0x5e0e9e)_0x2bfac9['removeClass']('ck-user__marker_hovered',_0x49d346);}}});}(_0x377e2d);},{'useCapture':!0x0});}['afterInit'](){const _0x2c7e16=this['editor'],_0x488d8c=_0x2c7e16['commands']['get']('undo');_0x488d8c&&_0x2c7e16['model']['on']('applyOperation',(_0x39aeaf,_0x17ab04)=>{const _0x2a4ec5=_0x17ab04[0x0];if(!_0x2a4ec5['isDocumentOperation'])return;if('marker'!=_0x2a4ec5['type']||!_0x2a4ec5['name']['startsWith']('user:'))return;const _0x282157=_0x2a4ec5['batch'];_0x488d8c['_createdBatches']['has'](_0x282157)&&(_0x2a4ec5['newRange']=_0x2a4ec5['oldRange']?_0x2c7e16['model']['createRange'](_0x2a4ec5['oldRange']['start'],_0x2a4ec5['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x4bfb6e=this['editor'],_0xde02ba=_0x4bfb6e['model']['document'],_0x348c20=_0x4bfb6e['plugins']['get'](i);_0x4bfb6e['model']['enqueueChange']({'isUndoable':!0x1},_0x553c3d=>{const _0x3245ee='user:range:'+_0x348c20['mySessionId'],_0x218660='user:position:'+_0x348c20['mySessionId'],_0x426c4e=_0x4bfb6e['model']['markers']['has'](_0x3245ee);_0x4bfb6e['editing']['view']['hasDomSelection']?te(_0x348c20['mySessionId'],_0xde02ba['selection']['getFirstRange'](),_0x4bfb6e['model'],_0x553c3d):_0x426c4e&&(_0x553c3d['removeMarker'](_0x3245ee),_0x553c3d['removeMarker'](_0x218660));});}}function te(_0x2c6bb4,_0x2eda20,_0x2aebb1,_0xe968a1){const _0x3e8654='user:range:'+_0x2c6bb4,_0x22b806='user:position:'+_0x2c6bb4,_0x5dd850=_0x2eda20['getContainedElement']();let _0x23640d=_0x2eda20['start'];if(_0x5dd850&&_0x5dd850['is']('element','tableCell')){const _0x2c9f43=function(_0xbf2afe,_0x4be46e){for(const _0x2b8591 of _0xbf2afe['getPositions']())if(_0x4be46e['schema']['checkChild'](_0x2b8591,'$text'))return _0x2b8591;}(_0x2eda20,_0x2aebb1);_0x2c9f43&&(_0x23640d=_0x2c9f43,_0x2eda20=_0xe968a1['createRange'](_0x23640d));}const _0x20655e=_0xe968a1['createRange'](_0x23640d);_0x2aebb1['markers']['has'](_0x3e8654)?(_0xe968a1['updateMarker'](_0x3e8654,{'range':_0x2eda20}),_0xe968a1['updateMarker'](_0x22b806,{'range':_0x20655e})):(_0xe968a1['addMarker'](_0x3e8654,{'range':_0x2eda20,'usingOperation':!0x0}),_0xe968a1['addMarker'](_0x22b806,{'range':_0x20655e,'usingOperation':!0x0}));}function $(_0x4476c5,_0x140227,_0x372323){const _0x3877ad=_0x4476c5['t'],t=_0x4476c5['t'];switch(_0x140227){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 _0x3877ad({'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'},_0x372323);default:return'';}}let Q=0x1;class l extends _0x10d243{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x59da2e)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x36e4c0,_0xaa642b,_0x5532a5];}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 _0x474a71=this['serverHistory']['getOperations']();for(let _0x458ade=_0x474a71['length']-0x1;_0x458ade>=0x0;_0x458ade--){const _0x396c2f=_0x474a71[_0x458ade];if(!this['_disconnectionOperations']['has'](_0x396c2f))return _0x396c2f['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1fe1da){if(super(_0x1fe1da),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x4c7be5(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x310ec5('collaboration-missing-channelid',this);const _0x5c2730=_0x1fe1da['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x5c2730,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x564650(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new Z(this['_disconnectionOperations']);}['init'](){const _0x3cda53=this['editor'],_0x5f0d6c=_0x3cda53['plugins']['get'](_0xaa642b),_0x422296=_0x3cda53['plugins']['get'](n);this['listenTo'](_0x5f0d6c,'getOperationAuthor',(_0x32d915,_0xfbce2e)=>{const _0x494fc2=_0xfbce2e[0x0];_0x494fc2['_authorId']&&(_0x32d915['return']=_0x5f0d6c['getUser'](_0x494fc2['_authorId']),_0x32d915['stop']()),null===_0x494fc2['_authorId']&&(_0x32d915['return']=null,_0x32d915['stop']());},{'priority':'high'}),this['listenTo'](_0x3cda53['model']['document']['selection'],'change:range',(_0x27503f,_0x5c9ef7)=>{_0x5c9ef7['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3cda53['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3cda53['model']['on']('applyOperation',(_0x506f58,_0x267ec5)=>{const _0x42573a=_0x267ec5[0x0];_0x42573a['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x42573a),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x422296,'state',this,'_hasSynchronizationProblem',(_0x2ef156,_0x3e715a)=>'connected'===_0x2ef156&&!_0x3e715a),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3cda53['disableReadOnlyMode']('rtc-offline'):_0x3cda53['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3cda53['disableReadOnlyMode']('rtc-offline'):_0x3cda53['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5c60c6=this['editor']['plugins']['get'](i),_0x1031f2=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x5c60c6['unregister'](this['_channelId']);const _0x24109a=await this['_service']['reconnect'](_0x1031f2['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x24109a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x433a62=await this['_service']['getConnectedSessions']();_0x5c60c6['register'](this['_channelId'],_0x433a62),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x1838a8){if(function(_0x524ea2){return'404'===_0x524ea2['code'];}(_0x1838a8)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x1b4480){return'409'===_0x1b4480['code'];}(_0x1838a8)){const _0x4fec23=$(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'](_0x4fec23);}else{if(!(_0x1838a8 instanceof X))throw _0x1838a8;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2fb725=this['editor']['plugins']['get'](n),_0x4042a0=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4042a0['channelSessions']['has'](this['_channelId'])&&_0x4042a0['unregister'](this['_channelId']),_0x2fb725['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x1cb416){if(this['sessionId']!==_0x1cb416['sessionId']&&this['_lastSyncedOperationId']!==_0x1cb416['lastOperationId'])throw new X();return this['sessionId']=_0x1cb416['sessionId'],this['_handleServerResponse']([],{..._0x1cb416,'wereChangesApplied':!0x1,'data':_0x1cb416['data']},'reconnect');}async['_connectService'](_0x178725,_0x36ad2e=!0x1){const {connection:_0x517d6b}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x517d6b,this['_channelId'])['then'](_0xd06da3=>this['_initSessionsHandling'](_0xd06da3))['catch'](_0x3cbd56=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3cbd56);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x27ca59,_0x4e6cff)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x4e6cff);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x4e60fb=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x178725);this['_isPendingUpdate']=!0x0;const _0x1172a8=await this['_service']['connect'](_0x517d6b,this['_compressOperations'](_0x178725),_0x4e60fb);if(this['sessionId']=_0x1172a8['sessionId'],_0x36ad2e){if(!_0x1172a8['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x1172a8['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x178725,_0x1172a8,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x1172a8,_0x178725);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4c571f=this['editor']['plugins']['get'](i),_0x375905=this['editor']['plugins']['get'](G),_0x5ca50e=_0x4c571f['channelSessions']['get'](this['_channelId']);_0x5ca50e&&_0x5ca50e['length']>0x1?_0x375905['createUserMarkerOperations']():this['listenTo'](_0x4c571f,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4c571f['channelSessions']['get'](this['_channelId'])['length']&&_0x375905['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x24b63f,_0x15471e,_0x2b699b,_0x4d6f34){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x15471e){const _0x18f39e=this['_decompressOperations'](_0x2b699b,_0x4d6f34);await this['_fetchMissingUsers'](_0x18f39e),this['_handleExternalOperations'](_0x18f39e,_0x15471e,_0x2b699b['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1d6c5a}=this['editor'];let _0x293074;try{_0x293074=await this['_service']['getDocumentDetails']();}catch{const _0x2f9ca0=$(_0x1d6c5a,'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'](_0x2f9ca0);}const _0x26bb8a=_0x293074['currentDocumentSession']||_0x293074['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x26bb8a['lastOperationId']){const _0x233aa5=$(_0x1d6c5a,'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'](_0x233aa5);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x45cf09){const _0x2398bc=this['editor']['plugins']['get'](i);this['listenTo'](_0x2398bc,'sessionAdd:'+this['_channelId'],(_0xe54135,{session:_0x50c3aa})=>{if(_0x50c3aa['id']===_0x2398bc['mySessionId']){_0xe54135['off']();const _0x50185a=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x195639=_0x50c3aa['permissions'];_0x50185a&&_0x50185a['isEnabled']&&(_0x195639=_0x195639['filter'](_0x463d6c=>'document:write'!==_0x463d6c)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x195639,this['_channelId']);}}),_0x2398bc['register'](this['_channelId'],_0x45cf09);}['_initThrowingOnDataSet'](){const _0x41bb26=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x3ff1ad)=>{if(!_0x3ff1ad[_0x3ff1ad['length']-0x1]['suppressErrorInCollaboration'])throw new _0x310ec5('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x41bb26['apply'](this['editor']['data'],_0x3ff1ad);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4977a5,[_0x1b90bd])=>{if(this['_document']['version'])throw new _0x310ec5('realtimecollaborationclient-init-document-already-initialized',this);_0x4977a5['stop'](),this['_setPendingAction']();const _0x48244b=this['editor']['config']['get']('rootsAttributes'),_0xcd0037=this['_getOperationsFromInitData'](_0x1b90bd,_0x48244b);0x0==_0xcd0037['length']&&_0xcd0037['push'](new _0x103a01(0x0)),_0x4977a5['return']=this['_connectService'](_0xcd0037)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x19912a=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x19912a))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x16dcfd,[_0x4210e7,_0x2fda0d])=>{_0x16dcfd['stop']();const _0x50ec0b=this['editor']['model']['document']['getRoot'](_0x4210e7);if(!this['_knownRootNames']['has'](_0x4210e7)){const _0x2c75b2=_0x2fda0d&&_0x2fda0d['data']?_0x2fda0d['data']:'',_0x4c1b32=_0x2fda0d&&_0x2fda0d['attributes']?_0x2fda0d['attributes']:{};await this['_loadRoot'](_0x4210e7,_0x2c75b2,_0x4c1b32);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x50ec0b['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x50ec0b);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x6b99ec){const _0x1eeb16=this['editor']['plugins']['get'](_0xaa642b),{connection:_0x1f91bb}=this['editor']['plugins']['get'](n),_0x12e115=new Set();for(const _0xf067a4 of _0x6b99ec){const _0x5502fa=_0xf067a4['_authorId'];_0x5502fa&&!_0x1eeb16['getUser'](_0x5502fa)&&_0x12e115['add'](_0x5502fa);}if(0x0===_0x12e115['size'])return;const _0x14c5bc=await ct['getMany'](_0x1f91bb,Array['from'](_0x12e115));for(const _0x29e753 of _0x14c5bc)_0x1eeb16['getUser'](_0x29e753['id'])||_0x1eeb16['addUser'](_0x29e753);}['_getOperationsFromInitData'](_0x46db90,_0x21a634={}){const _0x5913a9=this['editor']['model'],_0x163407=[];let _0x3e4934=0x0;const _0x3ae3d0='string'==typeof _0x46db90?{'main':_0x46db90}:_0x46db90;for(const _0x537a3a of Object['keys'](_0x3ae3d0)){if(!this['_document']['roots']['has'](_0x537a3a))throw new _0x310ec5('realtimecollaborationclient-init-non-existent-root',this);const _0x430630=this['editor']['data']['parse'](_0x3ae3d0[_0x537a3a]),_0x174a27=this['_document']['getRoot'](_0x537a3a),_0x1ed2cc=new _0x8498be(_0x5913a9['createPositionAt'](_0x174a27,0x0),_0x430630,_0x3e4934++);_0x163407['push'](_0x1ed2cc);for(const [_0x4106a9,_0x31eee5]of _0x430630['markers']){const _0x32f5e5=_0x5913a9['createRange'](_0x5913a9['createPositionFromPath'](_0x174a27,_0x31eee5['start']['path']['slice']()),_0x5913a9['createPositionFromPath'](_0x174a27,_0x31eee5['end']['path']['slice']())),_0x3ff8d5=new _0x5d25f8(_0x4106a9,null,_0x32f5e5,_0x5913a9['markers'],!0x0,_0x3e4934++);_0x163407['push'](_0x3ff8d5);}}if(_0x21a634)for(const [_0x290c6f,_0x568817]of Object['entries'](_0x21a634)){const _0x467443=_0x5913a9['document']['getRoot'](_0x290c6f);if(!_0x467443)throw new _0x310ec5('multi-root-editor-root-attributes-no-root',null);for(const [_0x30e7fa,_0x10801b]of Object['entries'](_0x568817))if(null!==_0x10801b){const _0x5df43b=new _0x11397f(_0x467443,_0x30e7fa,null,_0x10801b,_0x3e4934++);_0x163407['push'](_0x5df43b);}}return _0x163407;}async['_loadRoot'](_0x4ce8ac,_0x40cef8,_0x1aeda1){this['_getOperationsFromInitData']({[_0x4ce8ac]:_0x40cef8},{[_0x4ce8ac]:_0x1aeda1})['forEach']((_0x55832a,_0x115766)=>{_0x55832a['baseVersion']=this['_document']['version']+_0x115766,_0x55832a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x55832a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x28c9a9,_0x4e323d){let _0x3f14dc;this['_offset']=_0x28c9a9['offset'];const _0x329079=_0x28c9a9['wereChangesApplied']&&!_0x28c9a9['initData'],_0x4f60ef=_0x329079?0x0:_0x28c9a9['data']['baseVersion'];if(_0x4e323d['forEach'](_0xc13205=>{_0xc13205['_isInit']=!0x0,_0xc13205['createdAt']=_0x28c9a9['sessionCreatedAt'],_0xc13205['_authorId']=null;}),_0x329079)_0x3f14dc=_0x4e323d,this['_applyOperationsSet'](_0x3f14dc,_0x329079);else{if(_0x28c9a9['initData']){const _0x36a23a=this['_getOperationsFromInitData'](_0x28c9a9['initData']);this['_document']['history']['version']=-_0x36a23a['length'],_0x36a23a['forEach'](_0x42ea25=>{_0x42ea25['baseVersion']-=_0x36a23a['length'],_0x42ea25['createdAt']=_0x28c9a9['sessionCreatedAt'],_0x42ea25['_isInit']=!0x0,_0x42ea25['_authorId']=null;}),this['_applyOperationsSet'](_0x36a23a,!0x0),this['serverHistory']['version']=-_0x36a23a['length']+this['_offset'],this['_updateServerHistory'](_0x36a23a);}this['_document']['history']['version']=_0x4f60ef,_0x3f14dc=this['_decompressOperations'](_0x28c9a9['data'],_0x28c9a9['metadata']),await this['_fetchMissingUsers'](_0x3f14dc),this['_applyOperationsSet'](_0x3f14dc,_0x329079);}_0x28c9a9['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3f14dc,_0x28c9a9['lastOperationId']),this['_lastSyncedOperationId']=_0x28c9a9['lastOperationId']),this['serverHistory']['version']=_0x4f60ef+this['_offset'],this['_updateServerHistory'](_0x3f14dc),_0x4e323d['filter'](_0x3361c4=>{const _0x44f3ef=this['_getAffectedRoot'](_0x3361c4);return _0x44f3ef&&!this['_knownRootNames']['has'](_0x44f3ef);})['forEach']((_0x236e8a,_0x2b0991)=>{_0x236e8a['baseVersion']=this['_document']['version']+_0x2b0991,this['_saveOperationInBuffer'](_0x236e8a);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x1189f0,_0x423001){const _0x5c41cc=_0x423001&&_0x423001['message'];if(_0x5c41cc&&_0x5c41cc['startsWith']('realtimecollaborationclient'))throw _0x423001;const _0x379f12=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x379f12['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x310ec5(_0x1189f0,this['editor'],_0x5c41cc?{'originalError':_0x5c41cc}:void 0x0);}['_saveOperationInBuffer'](_0x473ff9){this['_knownOperations']['has'](_0x473ff9)||(this['_knownOperations']['add'](_0x473ff9),this['_bufferedOperations']['push'](_0x473ff9),this['_pendingAction']||'marker'==_0x473ff9['type']&&!_0x473ff9['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x53a237=!0x1){!_0x53a237&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x31a0bf=>{_0x31a0bf&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3586bc=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5175cd){return _0x5175cd['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5175cd['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5175cd['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3586bc)||this['_crash'](_0x3586bc['message'],_0x3586bc);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x31b526=>{this['on']('change:_isPendingUpdate',()=>{_0x31b526();});});}async['_sendBufferedOperations'](){const _0x5381f9=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x5381f9['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x149a5c=[...this['_bufferedOperations']];for(const _0x2bd7c7 of _0x149a5c)_0x2bd7c7['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2bd7c7);const _0x268332=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x149a5c),_0x28b8d3=Q++,_0x3272d9=this['_compressOperations'](_0x149a5c),_0x4e9761=await this['_service']['sendOperations'](_0x3272d9,_0x3272d9['baseVersion'],_0x268332);try{return await this['_handleServerResponse'](_0x149a5c,_0x4e9761,_0x28b8d3);}catch(_0x22e03b){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x22e03b);}}async['_handleServerResponse'](_0x509e3d,_0x49f269,_0x2d009a){if('error'in _0x49f269)throw _0x49f269['error'];let _0x3d2711=!0x1;if(_0x49f269['wereChangesApplied']){_0x49f269['lastOperationId']&&(this['_lastSyncedOperationId']=_0x49f269['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x894f9e=>!_0x509e3d['includes'](_0x894f9e));for(const _0x5375e5 of _0x509e3d)_0x5375e5['createdAt']='lastOperationAcceptedAt'in _0x49f269&&_0x49f269['lastOperationAcceptedAt']||void 0x0;Y(_0x509e3d,_0x49f269['version']-_0x509e3d['length']),this['_updateServerHistory'](_0x509e3d);const _0x58f768=_0x509e3d['filter'](_0x26fea4=>{if(!_0x26fea4['_isInit'])return!0x1;const _0x2e8b08=this['_getAffectedRoot'](_0x26fea4);return _0x2e8b08&&!this['_knownRootNames']['has'](_0x2e8b08);});Y(_0x58f768,this['_document']['version']),this['_applyOperationsSet'](_0x58f768),_0x3d2711=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x30a760=this['_decompressOperations'](_0x49f269['data'],_0x49f269['metadata'])['filter'](_0xa96fdc=>_0xa96fdc['baseVersion']>=this['_lastServerVersion']);_0x30a760['forEach'](_0x1e55cd=>this['_addKnownRoot'](_0x1e55cd)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x568717=>!_0x568717['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x568717))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x30a760),_0x3d2711=this['_handleExternalOperations'](_0x30a760,_0x49f269['version'],_0x49f269['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x3d2711?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x7b036b,_0xf007bf,_0xcc2165){try{const _0x4a3836={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x189316,operationsB:_0x5aca0c,originalOperations:_0x74229}=_0x58190b(_0x7b036b,this['_bufferedOperations'],_0x4a3836);Y(_0x189316,this['_document']['version']),Y(_0x5aca0c,_0xf007bf);for(const _0x50d283 of _0x189316){const _0x283b4c=_0x74229['get'](_0x50d283);_0x50d283['_authorId']=_0x283b4c?_0x283b4c['_authorId']:null;}_0xcc2165&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x7b036b,_0xcc2165),this['_lastSyncedOperationId']=_0xcc2165),this['_bufferedOperations']=[..._0x5aca0c],this['_applyOperationsSet'](_0x189316),this['_updateServerHistory'](_0x7b036b);}catch(_0x35032f){return console['error'](_0x35032f),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5c3cb6,_0x167ca0=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x42f3d8=>{for(const _0x5ca165 of _0x5c3cb6)this['_knownOperations']['add'](_0x5ca165),this['_addKnownRoot'](_0x5ca165),_0x42f3d8['batch']['addOperation'](_0x5ca165),this['editor']['model']['applyOperation'](_0x5ca165);});}['_addKnownRoot'](_0x5c2e9c){const _0x3f55b8=this['_getAffectedRoot'](_0x5c2e9c);_0x3f55b8&&this['_knownRootNames']['add'](_0x3f55b8);}['_getAffectedRoot'](_0x72d56c){let _0x1ef337,_0x437297;switch(_0x72d56c['type']){case'insert':_0x1ef337=_0x72d56c['position']['root'];break;case'marker':if(_0x437297=_0x72d56c['newRange'],!_0x437297)return null;_0x1ef337=_0x437297['root'];break;case'addRootAttribute':_0x1ef337=_0x72d56c['root'];break;case'addRoot':_0x1ef337=_0x72d56c['affectedSelectable'];break;case'move':_0x1ef337=_0x72d56c['targetPosition']['root'];break;default:return null;}return _0x1ef337['rootName'];}['_updateServerHistory'](_0x97ab1e){_0x97ab1e['forEach'](_0x52e576=>{const _0x30ec1d=_0x52e576['clone']();_0x30ec1d['_authorId']=_0x52e576['_authorId'],_0x30ec1d['_isInit']=!!_0x52e576['_isInit'],_0x30ec1d['createdAt']=_0x52e576['createdAt'],_0x30ec1d['baseVersion']+=this['_offset'],_0x52e576['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x30ec1d),this['serverHistory']['addOperation'](_0x30ec1d);});}['_handleReconnectionError'](_0xc88251){const _0x204a0b=this['editor']['plugins']['get']('Notification'),_0x477c60=this['editor']['locale'];_0xc88251||(_0xc88251=$(_0x477c60,'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.')),_0x204a0b['showWarning'](_0xc88251,{'title':$(_0x477c60,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x36e4c0)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x36e4c0)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x219ecd){const _0x168286=_0x219ecd['map'](_0x2aa882=>_0x2aa882['toJSON']());return this['_compressor']['compress'](_0x168286);}['_decompressOperations'](_0x41ba75,_0x5d4b8e){return this['_compressor']['decompress'](_0x41ba75)['map']((_0x3efe5e,_0x4a516f)=>{const _0x5ce286='init'==_0x5d4b8e[_0x4a516f]['type'];if('InsertOperation'==_0x3efe5e['__className']){const _0x4dfde6=_0x3efe5e['position']['root'];!this['_document']['getRoot'](_0x4dfde6)&&(this['_document']['createRoot']('$root',_0x4dfde6)['_isAttached']=!0x1);}const _0x2d1e3b=_0x1b43cd['fromJSON'](_0x3efe5e,this['_document']);return _0x2d1e3b['wasUndone']=_0x3efe5e['wasUndone'],_0x2d1e3b['_isInit']=_0x5ce286,_0x2d1e3b['_authorId']=_0x5ce286?null:_0x5d4b8e[_0x4a516f]['userId'],_0x2d1e3b['_isDisconnection']='cs:removeUser'===_0x5d4b8e[_0x4a516f]['type'],_0x2d1e3b['createdAt']=_0x5d4b8e[_0x4a516f]['createdAt'],_0x2d1e3b;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x41d502=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x41d502&&_0x41d502['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x39b0a9,_0xf353ef){for(const _0x1c283b of _0x39b0a9)_0x1c283b['baseVersion']=_0xf353ef++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0xf99b7c){this['_ignoredOperations']=_0xf99b7c,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x30c175){let _0x91e74a=_0x30c175['length'];for(;_0x91e74a--;){const _0x1f6b0c=_0x30c175[_0x91e74a];if(!this['_ignoredOperations']['has'](_0x1f6b0c)){if(!this['_operationToId']['has'](_0x1f6b0c)){const _0x5cebdd=_0x210547()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1f6b0c,_0x5cebdd);}return this['_operationToId']['get'](_0x1f6b0c);}}}['setIdForTheLastOperation'](_0x3bc270,_0x5d9718){if(!_0x5d9718)return;let _0x4bdbdd=_0x3bc270['length'];for(;_0x4bdbdd--;){const _0x6ded86=_0x3bc270[_0x4bdbdd];this['_ignoredOperations']['has'](_0x6ded86)||this['_operationToId']['set'](_0x6ded86,_0x5d9718);}}}class a extends _0x10d243{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x4d3b80{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x58ad7c)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0xaa642b];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2fb533){super(_0x2fb533),this['_services']=new Map();}async['init'](){const _0x99ac4=this['context'],_0x4adaad=_0x99ac4['plugins']['get']('CommentsRepository');if(_0x99ac4['plugins']['get'](n)['addToReconnectionStack'](this),_0x4adaad['adapter']={'addCommentThread':async({channelId:_0x405d8c,threadId:_0x2b96d9,comments:_0x17730a,resolvedAt:_0x1d1bd6,resolvedBy:_0x25dfe7,context:_0x753089,attributes:_0x58cf56})=>{const _0x15fe7a=await this['_getService'](_0x405d8c)['addCommentThread']({'commentThreadId':_0x2b96d9,'comments':_0x17730a['map'](_0x5986f5=>function(_0x5ce39e,_0x67e921,_0x5146e0){return{'commentThreadId':_0x5146e0,'commentId':_0x5ce39e['commentId'],'userId':_0x5ce39e['authorId'],'content':_0x5ce39e['content'],'documentId':_0x67e921,'createdAt':_0x5ce39e['createdAt'],'attributes':_0x5ce39e['attributes']||{}};}(_0x5986f5,_0x405d8c,_0x2b96d9)),'resolvedAt':_0x1d1bd6,'resolvedBy':_0x25dfe7,'context':_0x753089,'attributes':_0x58cf56})['catch'](at);return{'threadId':_0x15fe7a['commentThreadId'],'comments':_0x15fe7a['comments']};},'getCommentThread':async({channelId:_0x50fc95,threadId:_0x18506b})=>{const _0x230d81=await this['_getService'](_0x50fc95)['getCommentThread'](_0x18506b)['catch'](at);return _0x230d81['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x230d81]),{'threadId':_0x230d81['commentThreadId'],'comments':_0x230d81['comments']['map'](B),'context':_0x230d81['context'],'resolvedAt':_0x230d81['resolvedAt'],'resolvedBy':_0x230d81['resolvedBy'],'attributes':_0x230d81['attributes']||{}});},'updateCommentThread':async({channelId:_0x96cf79,threadId:_0x2f8f39,context:_0x4d0a52,unlinkedAt:_0x555a91,attributes:_0x5d5196})=>this['_getService'](_0x96cf79)['updateCommentThread']({'commentThreadId':_0x2f8f39,'context':_0x4d0a52,'attributes':_0x5d5196,'unlinkedAt':_0x555a91})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x43c2f1,threadId:_0x18592d})=>{const _0x12d24c=await this['_getService'](_0x43c2f1)['resolveCommentThread'](_0x18592d)['catch'](F)['catch'](at);return{'threadId':_0x12d24c['commentThreadId'],'resolvedAt':_0x12d24c['resolvedAt'],'resolvedBy':_0x12d24c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x1974c4,threadId:_0x2a495a})=>this['_getService'](_0x1974c4)['reopenCommentThread'](_0x2a495a)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x19f9b4,threadId:_0x180dde})=>this['_getService'](_0x19f9b4)['removeCommentThread'](_0x180dde)['catch'](F)['catch'](at),'addComment':({channelId:_0x16e53d,threadId:_0x2ba195,commentId:_0x120b09,content:_0x9514d9,attributes:_0x2f6d0d})=>this['_getService'](_0x16e53d)['addComment'](_0x2ba195,_0x120b09,_0x9514d9,_0x2f6d0d)['catch'](at),'updateComment':({channelId:_0x407be3,threadId:_0x2e669e,commentId:_0x39c0cd,content:_0xaceab1,attributes:_0xd8fe3c})=>this['_getService'](_0x407be3)['updateComment'](_0x2e669e,_0x39c0cd,_0xaceab1,_0xd8fe3c)['catch'](F)['catch'](at),'removeComment':({channelId:_0x1c1139,threadId:_0x1b5669,commentId:_0x4bb676})=>this['_getService'](_0x1c1139)['removeComment'](_0x1b5669,_0x4bb676)['catch'](F)['catch'](at)},_0x99ac4 instanceof _0x1146c8){const _0x190672=_0x99ac4['config']['get']('collaboration.channelId'),_0x4011a5=_0x99ac4['plugins']['get'](i);await this['_setUpService'](_0x190672);const _0xe89cd7=await this['_services']['get'](_0x190672)['getConnectedSessions']();this['listenTo'](_0x4011a5,'sessionAdd:'+_0x190672,(_0x28baa2,{session:_0x3bc231})=>{_0x3bc231['id']===_0x4011a5['mySessionId']&&(_0x28baa2['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3bc231['permissions'],_0x190672));}),_0x4011a5['register'](_0x190672,_0xe89cd7);}}async['_setUpService'](_0x58e9ff){if(this['_services']['has'](_0x58e9ff))throw new _0x310ec5('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x58e9ff});const _0x180a25=this['context']['plugins']['get']('CommentsRepository'),_0x4ee1d4=new s['CommentsService'](_0x58e9ff);this['_services']['set'](_0x58e9ff,_0x4ee1d4),this['listenTo'](_0x4ee1d4,'commentThreadAdded',(_0x4a2071,_0x4113e7)=>{const {commentThreadId:_0x569ef9,documentId:_0x2da9b9,context:_0x361da2,attributes:_0x18edc5,resolvedAt:_0x4b1f53,resolvedBy:_0x1382df,comments:_0x352412}=_0x4113e7;_0x180a25['getCommentThread'](_0x569ef9)||_0x180a25['addCommentThread']({'threadId':_0x569ef9,'channelId':_0x2da9b9,'comments':_0x352412?_0x352412['map'](B):[],'context':_0x361da2,'attributes':_0x18edc5,'resolvedAt':_0x4b1f53,'resolvedBy':_0x1382df,'isFromAdapter':!0x0});}),this['listenTo'](_0x4ee1d4,'commentThreadUpdated',(_0x2085ba,{commentThreadId:_0x24c583,documentId:_0x1ec6a2,context:_0x32739d,unlinkedAt:_0x1b4033,attributes:_0x304c9d})=>{_0x180a25['getCommentThread'](_0x24c583)&&_0x180a25['updateCommentThread']({'threadId':_0x24c583,'channelId':_0x1ec6a2,'context':_0x32739d,'unlinkedAt':_0x1b4033,'attributes':_0x304c9d,'isFromAdapter':!0x0});}),this['listenTo'](_0x4ee1d4,'commentThreadResolved',(_0x20204c,{commentThreadId:_0x23c007,resolvedBy:_0x1cbc77,resolvedAt:_0x3bccf5})=>{const _0x16208f=_0x180a25['getCommentThread'](_0x23c007);_0x16208f&&_0x16208f['resolve']({'resolvedBy':_0x1cbc77,'resolvedAt':_0x3bccf5,'isFromAdapter':!0x0});}),this['listenTo'](_0x4ee1d4,'commentThreadReopened',(_0x2ae3be,{commentThreadId:_0x5d736c})=>{const _0x4ae748=_0x180a25['getCommentThread'](_0x5d736c);_0x4ae748&&_0x4ae748['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4ee1d4,'commentThreadRemoved',(_0x454e5c,{commentThreadId:_0x478b8d})=>{const _0x43f17f=_0x180a25['getCommentThread'](_0x478b8d);_0x43f17f&&_0x43f17f['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4ee1d4,'commentAdded',(_0x1d90ce,_0x2c34f4)=>{const _0x175db7=_0x2c34f4['commentThreadId'],_0x43b889=_0x180a25['getCommentThread'](_0x175db7);_0x43b889&&_0x43b889['addComment']({...B(_0x2c34f4),'isFromAdapter':!0x0});}),this['listenTo'](_0x4ee1d4,'commentUpdated',(_0x5c3b41,{commentThreadId:_0x336140,commentId:_0x2aeb33,content:_0x266795,attributes:_0x2bd146})=>{const _0x174afa=_0x180a25['getCommentThread'](_0x336140);if(_0x174afa){const _0x222cdb=_0x174afa['getComment'](_0x2aeb33);_0x222cdb&&_0x222cdb['update']({'content':_0x266795,'attributes':_0x2bd146,'isFromAdapter':!0x0});}}),this['listenTo'](_0x4ee1d4,'commentRemoved',(_0x4aea55,{commentThreadId:_0x54003d,commentId:_0x527f0e})=>{const _0xb65451=_0x180a25['getCommentThread'](_0x54003d);if(_0xb65451){const _0x228588=_0xb65451['getComment'](_0x527f0e);_0x228588&&_0x228588['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x58e9ff);}['destroy'](){if(this['context']instanceof _0x1146c8){const _0x3fc521=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3fc521);}}['_terminateService'](_0x2d462c){if(!this['_services']['has'](_0x2d462c))throw new _0x310ec5('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x2d462c});this['_getService'](_0x2d462c)['disconnect'](),this['_services']['delete'](_0x2d462c);}async['reconnect'](){for(const _0x51875c of this['_services']['keys']())await this['_connectService'](_0x51875c);if(this['context']instanceof _0x1146c8){const _0x1dd591=this['context']['config']['get']('collaboration.channelId'),_0x5642d9=this['context']['plugins']['get'](i);_0x5642d9['unregister'](_0x1dd591);const _0xd40ef7=await this['_services']['get'](_0x1dd591)['getConnectedSessions']();_0x5642d9['register'](_0x1dd591,_0xd40ef7);}}async['_connectService'](_0x26cc64){const {connection:_0x1e87a5}=this['context']['plugins']['get'](n),_0x2d974a=this['context']['plugins']['get']('CommentsRepository'),_0x267f0f=this['_services']['get'](_0x26cc64),_0x197775=await _0x267f0f['connect'](_0x1e87a5);await this['_fetchMissingUsersForThreads'](_0x197775);const _0x1e7f04=new Set(Array['from'](_0x2d974a['getCommentThreads']({'channelId':_0x26cc64}),_0x26dcf7=>_0x26dcf7['id']));for(const _0x1f9119 of _0x197775)_0x1f9119['deletedAt']||_0x1e7f04['delete'](_0x1f9119['commentThreadId']);for(const _0x1607fa of _0x1e7f04)_0x2d974a['getCommentThread'](_0x1607fa)['remove']({'isFromAdapter':!0x0});for(const _0x22747a of _0x197775){let _0x58badc=_0x2d974a['getCommentThread'](_0x22747a['commentThreadId']);const {commentThreadId:_0x56722b,context:_0x429e0e,attributes:_0x50600d,resolvedBy:_0x15a8bf,resolvedAt:_0x4857d7,unlinkedAt:_0x5d10b1,deletedAt:_0x402941}=_0x22747a;if(_0x402941)continue;_0x58badc||(_0x58badc=_0x2d974a['addCommentThread']({'channelId':_0x26cc64,'threadId':_0x56722b,'context':_0x429e0e,'attributes':_0x50600d||{},'resolvedBy':_0x15a8bf,'resolvedAt':_0x4857d7,'unlinkedAt':_0x5d10b1,'isFromAdapter':!0x0}));const _0x594a2a=new Set(Array['from'](_0x58badc['comments'],_0x4d5a51=>_0x4d5a51['id']));for(const _0x1c244f of _0x22747a['comments'])_0x594a2a['delete'](_0x1c244f['commentId']);for(const _0x169dde of _0x594a2a)_0x58badc['getComment'](_0x169dde)['remove']({'isFromAdapter':!0x0});for(const _0x1de1bb of _0x22747a['comments']){const _0x45bcd8=_0x58badc['getComment'](_0x1de1bb['commentId']);_0x45bcd8?_0x45bcd8['content']!==_0x1de1bb['content']&&_0x45bcd8['update']({'content':_0x1de1bb['content'],'isFromAdapter':!0x0}):_0x58badc['addComment'](Object['assign'](B(_0x1de1bb),{'isFromAdapter':!0x0}));}}}['_getService'](_0x527e8b){if(!this['_services']['has'](_0x527e8b))throw new _0x310ec5('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x527e8b});return this['_services']['get'](_0x527e8b);}async['_fetchMissingUsersForThreads'](_0x4fff87){const _0x5e1493=this['context']['plugins']['get'](_0xaa642b),{connection:_0x3ef9e8}=this['context']['plugins']['get'](n),_0x5e8d6f=new Set();for(const {resolvedBy:_0x3f6449,comments:_0x3980a5}of _0x4fff87){_0x3f6449&&!_0x5e1493['getUser'](_0x3f6449)&&_0x5e8d6f['add'](_0x3f6449);for(const {userId:_0x52df8c}of _0x3980a5)_0x5e1493['getUser'](_0x52df8c)||_0x5e8d6f['add'](_0x52df8c);}if(0x0===_0x5e8d6f['size'])return;const _0x23cf35=await ct['getMany'](_0x3ef9e8,Array['from'](_0x5e8d6f));for(const _0x15ab04 of _0x23cf35)_0x5e1493['getUser'](_0x15ab04['id'])||_0x5e1493['addUser'](_0x15ab04);}}async function F(_0x394306){if('404'!==_0x394306['code'])throw _0x394306;}function at(_0x395428){if((_0x49969d=_0x395428)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x49969d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x49969d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x49969d;throw _0x395428;}function B(_0x14fa2f){return{'threadId':_0x14fa2f['commentThreadId'],'commentId':_0x14fa2f['commentId'],'content':_0x14fa2f['content'],'createdAt':_0x14fa2f['createdAt'],'authorId':_0x14fa2f['userId'],'attributes':_0x14fa2f['attributes']||{}};}class m extends _0x10d243{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x21c89f)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0xaa642b];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1fe999){super(_0x1fe999);const _0x2991e9=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x2991e9);}async['init'](){const _0xfae8f=this['editor']['plugins']['get'](l),_0x37cff0=_0xfae8f['serverHistory'],_0x3e1930=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x37cff0,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xfae8f['sessionId']});const _0x202802=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x4a2dd6=await _0xe88053['isBundleUploaded'](_0x3e1930['connection'],_0x202802);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x464b7f})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x464b7f)),'updateRevisions':async _0x2dc911=>{await this['_waitForServiceReady']();const _0xf9c2ef=this['_revisionTracker']['currentRevision'];if(_0x4a2dd6&&0x1===_0x2dc911['length']&&_0x2dc911[0x0]['id']===_0xf9c2ef['id'])return _0x2dc911;for(const _0x3e0413 of _0x2dc911)_0x3e0413['id']===_0xf9c2ef['id']&&(_0x3e0413['isEmptyCurrent']=_0x3e0413['fromVersion']===_0x3e0413['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x2dc911,this['_lastRequestId'])['then'](_0x4ddd4d=>(this['_lastRequestId']=_0x4ddd4d,_0x2dc911))['catch'](_0x292b13=>{if(q(_0x292b13)||'400'===_0x292b13['code']&&void 0x0!==_0x292b13['data']['wrongRequestId']){for(const _0x26d34f of _0x2dc911){!this['_revisionTracker']['repository']['getRevision'](_0x26d34f['id'])||this['_revisionTracker']['_bufferUpdate'](_0x26d34f['id'],_0x26d34f,!0x1);}if(q(_0x292b13))throw _0x292b13;return _0x2dc911;}throw _0x292b13;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x7cbd97,{revisionsData:_0x13af9c,requestId:_0x3d4a21})=>{Math['max'](..._0x13af9c['map'](_0x30ee7a=>_0x30ee7a['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x13af9c,_0x3d4a21);}):this['_handleRevisionsUpdate'](_0x13af9c,_0x3d4a21);});const {revisions:_0x16b56c,requestId:_0x475db6}=await this['_revisionHistoryService']['connect'](_0x3e1930['connection']);_0x3e1930['addToReconnectionStack'](this),this['_lastRequestId']=_0x475db6,await this['_fetchMissingUsers'](_0x16b56c);for(const _0x4a0e92 of _0x16b56c)this['_revisionTracker']['addRevisionData'](_0x4a0e92);this['listenTo'](_0xfae8f,'change:_isConnected',(_0x1dfdc3,_0x505a3,_0xb8af02)=>{_0xb8af02&&(this['_oldOffset']=_0xfae8f['_offset'],_0x1dfdc3['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3e1930,'state',_0x10b540=>_0x10b540===_0x3d49a0['CONNECTED']);}async['reconnect'](){const _0x2f3754=this['editor']['plugins']['get'](n),_0xe43a20=this['editor']['plugins']['get'](l),_0x69d181=async()=>{const _0x1e3324=this['_revisionTracker']['currentRevision'],_0x51c40a=_0x1e3324['id'],_0x5e6338=_0x51c40a!==_0xe43a20['sessionId'];if(_0x5e6338){const _0x55e88a=_0xe43a20['_offset']-this['_oldOffset'],_0x186c9a=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x1e3324['toVersion']+_0x55e88a!==_0x186c9a){const _0x1b047b=_0x1e3324['fromVersion']+_0x55e88a,_0x5171fa=this['editor']['plugins']['get'](_0xaa642b),_0x2dfb6f=this['_revisionTracker']['buildRevisionData']({'revision':_0x1e3324,'from':_0x1b047b,'to':_0x186c9a});_0x2dfb6f['id']=_0x1e3324['id'];const _0x37d5a2=_0x2dfb6f['authorsIds']['map'](_0x3afa0d=>_0x5171fa['getUser'](_0x3afa0d));_0x1e3324['_update']({..._0x2dfb6f,'authors':_0x37d5a2},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x1e3324['id'],_0x2dfb6f,!0x0);}this['_revisionTracker']['_startingVersion']=_0x186c9a,(_0x1e3324['toVersion']===_0x1e3324['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x51c40a)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x51c40a),this['_revisionTracker']['_createCurrentRevision'](_0x186c9a));}const {revisions:_0x379baf,requestId:_0x5cd915}=await this['_revisionHistoryService']['reconnect'](_0x2f3754['connection'],this['_lastRequestId']);_0x5e6338&&_0x379baf['length']>0x0?_0xe43a20['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x379baf),this['_handleRevisionsUpdate'](_0x379baf,_0x5cd915),this['_revisionTracker']['sendBufferedUpdates']());};return _0xe43a20['_isConnected']?_0x69d181():new Promise((_0x588d12,_0x16f5a9)=>{_0xe43a20['once']('change:_isConnected',()=>{_0x69d181()['then'](_0x588d12)['catch'](_0x16f5a9);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x554a18=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x380781=>{_0x380781['off'](),_0x554a18();});});}['_getLatestVersionFromServerOperations'](){const _0x514533=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x5dbafd of _0x514533)if('marker'!==_0x5dbafd['type']||_0x5dbafd['affectsData'])return _0x5dbafd['baseVersion']+0x1;}['_getLatestVersion'](){const _0x2f17a8=this['editor']['plugins']['get'](l);return new Promise(_0x4dfbaa=>{_0x2f17a8['_isPendingUpdate']?_0x2f17a8['once']('change:_isPendingUpdate',()=>{_0x4dfbaa(this['_getLatestVersionFromServerOperations']());}):_0x4dfbaa(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x5bed80,_0x2fbdf7){const _0x140bf0=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2fbdf7;for(const _0xdd1dd9 of _0x5bed80){const _0x114684=_0x140bf0['getRevision'](_0xdd1dd9['id']);if(_0x114684){if((_0xdd1dd9['fromVersion']||_0xdd1dd9['toVersion'])&&(_0xdd1dd9['diffData']=null),_0x114684===this['_revisionTracker']['currentRevision']){const _0x376476=Math['max'](_0x114684['toVersion'],_0xdd1dd9['toVersion']),_0x45eb90=Math['max'](_0x114684['fromVersion'],_0xdd1dd9['fromVersion']);let _0x54f71c;_0x114684['toVersion']===_0xdd1dd9['toVersion']&&_0x114684['fromVersion']===_0xdd1dd9['fromVersion']?(_0x54f71c=!0x0,this['_preventResendingRevisionData'](_0xdd1dd9)):_0xdd1dd9['toVersion']===_0x376476&&_0xdd1dd9['fromVersion']===_0x45eb90?_0x54f71c=!0x1:(_0x114684['toVersion']===_0x376476&&_0x114684['fromVersion']===_0x45eb90||this['_fixRevision']({'revision':_0x114684,'from':_0x45eb90,'to':_0x376476}),_0x54f71c=!0x0),_0x54f71c&&(delete _0xdd1dd9['fromVersion'],delete _0xdd1dd9['toVersion'],delete _0xdd1dd9['diffData'],delete _0xdd1dd9['createdAt'],delete _0xdd1dd9['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0xdd1dd9),this['_preventResendingRevisionData'](_0xdd1dd9);}else this['_revisionTracker']['addRevisionData'](_0xdd1dd9);}const _0x4782df=_0x140bf0['getRevisions']();_0x4782df['reverse']();for(let _0x728843=0x0;_0x728843<_0x4782df['length']-0x1;_0x728843++){const _0x2102d1=_0x4782df[_0x728843],_0x137f06=_0x4782df[_0x728843+0x1];if(_0x2102d1['fromVersion']<_0x137f06['toVersion']){const _0x5edc0b=_0x137f06['toVersion'],_0x2a23b6=Math['max'](_0x5edc0b,_0x2102d1['toVersion']);this['_fixRevision']({'revision':_0x2102d1,'from':_0x5edc0b,'to':_0x2a23b6});}}}['_fixRevision']({revision:_0x284b2b,from:_0x5af2d9,to:_0x44ae92}={}){const _0x14c01b=this['editor']['plugins']['get'](_0xaa642b),_0x2a9968=this['_revisionTracker']['buildRevisionData']({'revision':_0x284b2b,'from':_0x5af2d9,'to':_0x44ae92});_0x2a9968['authors']=_0x2a9968['authorsIds']['map'](_0x5a554c=>_0x14c01b['getUser'](_0x5a554c)),_0x284b2b['_update'](_0x2a9968);}['_preventResendingRevisionData'](_0xb50b56){const _0x481579={};_0x481579['id']=_0xb50b56['id'];for(const _0x2ec318 of Object['keys'](_0xb50b56))'id'!==_0x2ec318&&(_0x481579[_0x2ec318]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x481579['id'],_0x481579,!0x0);}async['_fetchMissingUsers'](_0x181d0c){const _0xb8ceea=this['editor']['plugins']['get'](_0xaa642b),{connection:_0x199c81}=this['editor']['plugins']['get'](n),_0x3fd408=new Set();for(const _0x363f1f of _0x181d0c){for(const _0x226663 of _0x363f1f['authorsIds'])_0x47c8e8(_0x226663);_0x363f1f['creatorId']&&_0x47c8e8(_0x363f1f['creatorId']);}if(0x0===_0x3fd408['size'])return;const _0x1c027e=await ct['getMany'](_0x199c81,Array['from'](_0x3fd408));for(const _0x165bea of _0x1c027e)_0xb8ceea['getUser'](_0x165bea['id'])||_0xb8ceea['addUser'](_0x165bea);function _0x47c8e8(_0x34c184){_0xb8ceea['getUser'](_0x34c184)||_0x3fd408['add'](_0x34c184);}}}function q(_0x178d5b){return _0x178d5b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x178d5b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x178d5b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x10d243{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x3fe722{['_collapseAt'];constructor(_0x75d148,_0x4ff834=0x6){super(_0x75d148);const _0x17e2c4=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4ff834,this['bind']('isHidden')['to'](this,'usersCount',_0x10abe9=>_0x10abe9<_0x4ff834),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x17e2c4['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':_0x17e2c4['to']('usersCount',_0x1b4116=>'+'+(_0x1b4116-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x3fe722{['items'];['keystrokes'];constructor(_0x505b26){super(_0x505b26);const _0x1d4398=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5e4192(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1d4398['if']('hasPopup'),'aria-expanded':_0x1d4398['to']('isExpanded',_0x457959=>this['hasPopup']&&String(_0x457959)),'aria-label':_0x1d4398['to']('hasPopup',_0x2de54e=>$(_0x505b26,_0x2de54e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1d4398['to']('hasPopup',_0x1c4932=>!!_0x1c4932&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x1d4398['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x1d4398['to'](_0x1dce03=>{const _0x56aac2=_0x1dce03,_0x5bba7d=document['querySelector']('.ck-presence-list__dropdown-list'),_0x41366d=document['querySelector']('.ck-balloon-panel_with-arrow');_0x5bba7d?.['contains'](_0x56aac2['relatedTarget'])||_0x41366d?.['contains'](_0x56aac2['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x235559,_0x595b7d,_0x258683)=>{this['element']&&(_0x258683?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x3fe722{['counterView'];['inlineListView'];constructor(_0x235bff,_0x594d13=0x6){super(_0x235bff);const _0x4a6b90=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x594d13),this['inlineListView']=new is(_0x235bff),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x19a379 of this['inlineListView']['items'])_0x19a379['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',_0x4a6b90['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x3fe722{['listWrapperView'];constructor(_0x862238,_0x54a917){super(_0x862238);const _0x2f0885=this['bindTemplate'];this['listWrapperView']=new ut(_0x862238,_0x54a917),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x862238,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x2f0885['to'](_0x39c3b7=>{const _0x521b1a=_0x39c3b7,_0x348ef0=document['querySelector']('.ck-presence-list__list'),_0x232a0e=document['querySelector']('.ck-balloon-panel_with-arrow');_0x348ef0?.['contains'](_0x521b1a['relatedTarget'])||_0x232a0e?.['contains'](_0x521b1a['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x374e68{constructor(_0x16b98a,_0x2a4db0){super(_0x16b98a);const _0x547e17=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2a4db0?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x547e17['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x547e17['to']('role'),'aria-label':_0x547e17['to']('ariaLabel'),'aria-labelledby':_0x547e17['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x438e09['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3c9fbb=this['element'];_0x3c9fbb&&(this['_isScrollable']=Math['max'](_0x3c9fbb['scrollHeight'],_0x3c9fbb['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x4c7f6b,_0x16d1ff,_0x2a64ec){super(_0x4c7f6b);const _0x32ed6f=this['bindTemplate'];this['userView']=new st(_0x4c7f6b,_0x16d1ff);const _0x121e46={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x16d1ff['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x16d1ff['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x16d1ff['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x2a64ec&&(_0x121e46['tag']='button',_0x121e46['on']={'click':_0x32ed6f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x121e46);}['focus'](){this['element']['focus']();}}class A extends _0x3fe722{['userView'];['markerView'];constructor(_0x30a845,_0x45b519,_0x5f457){super(_0x30a845);const _0x18074a=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x30a845,_0x45b519),this['markerView']=new ot(_0x30a845,_0x45b519);const _0x2b8dfc=new it(_0x30a845);_0x2b8dfc['template']['tag']='span',_0x2b8dfc['text']=_0x45b519['name'];const _0x4b4abe={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x18074a['to']('isFocusable',_0x3813d2=>!!_0x3813d2&&0x0),'aria-labelledby':_0x2b8dfc['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x18074a['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x18074a['to']('hasTooltip',_0xb8583d=>!_0xb8583d),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2b8dfc]};_0x5f457&&(_0x4b4abe['tag']='button',_0x4b4abe['on']={'click':_0x18074a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4b4abe);}}class ot extends _0x3fe722{constructor(_0x560263,_0x1df864){super(_0x560263),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1df864['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x4d3b80{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x31304d){super(_0x31304d),this['context']['config']['define']('presenceList',x);const _0x152ac4=_0x31304d['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x152ac4)throw new _0x310ec5('presencelist-collapseat-invalid-format',this);if(_0x152ac4<0x1)throw new _0x310ec5('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x3f433a(),this['balloonPanelView']=new _0x29c12b(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x149c32 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x149c32);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4a5162,_0x37cdfc)=>{this['_handleUserAdd'](_0x37cdfc);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2919d9,_0x3d8583)=>{this['_handleUserRemove'](_0x3d8583);});}['_createView'](){const _0x4d707f=this['context'],_0x2c021a=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x2a1423=this['balloonPanelView'];if(!_0x36c3c9(_0x4d707f['config']['get']('presenceList.container')))throw new _0x310ec5('presencelist-missing-container',this);return _0x2c021a['counterView']['bind']('usersCount')['to'](this),_0x2c021a['bind']('isCollapsed')['to'](this,'usersCount',_0x2cbce8=>{const {collapseAt:_0x2e05f7}=_0x4d707f['config']['get']('presenceList'),_0x224883=_0x2cbce8>=_0x2e05f7;if(_0x224883&&!_0x2c021a['inlineListView']['items']['find'](_0x247ce6=>_0x247ce6 instanceof b)){const _0x5ed3a4=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5ed3a4&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x2c021a['inlineListView']['items']['add'](_0x2c021a['counterView']);}return _0x224883||this['hideDropdown'](),_0x224883;}),_0x2c021a['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x3d40b2=>{const _0x36b7a0=_0x4d707f['config']['get']('presenceList'),_0x10442d=new A(_0x4d707f['locale'],_0x3d40b2,!!_0x36b7a0['onClick']);return _0x10442d['bind']('hasTooltip')['to'](_0x2c021a,'isCollapsed',_0x5b2d19=>!_0x5b2d19),_0x10442d['bind']('isFocusable')['to'](_0x2c021a,'isCollapsed',_0x10585f=>!_0x10585f),_0x36b7a0['onClick']&&this['listenTo'](_0x10442d,'execute',()=>{this['view']['isCollapsed']||_0x36b7a0['onClick'](_0x3d40b2,_0x10442d['element']);}),_0x10442d;}),this['listenTo'](_0x2c021a['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x2c021a['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x2c021a['inlineListView']['keystrokes']['set']('Enter',(_0x54931e,_0xc645a5)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0xc645a5());}),_0x2c021a['render'](),_0x2a1423['render'](),_0x22e750({'emitter':_0x2c021a,'activator':()=>_0x2a1423['isVisible'],'contextElements':[_0x2a1423['element'],_0x2c021a['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4d707f['config']['get']('presenceList.container')['appendChild'](_0x2c021a['element']),this['_bodyCollection']=new _0x4a0b8d(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2c021a;}['_handleUserAdd'](_0x19dea4){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x19dea4['isMe'])return;const _0x42ba2a=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x42ba2a-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x39e657=_0x19dea4['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x19dea4,_0x39e657);}['_handleUserRemove'](_0x4a6bee){this['usersCount']--;const {collapseAt:_0x94ea06}=this['context']['config']['get']('presenceList'),_0x5f0994=this['usersCount']>=_0x94ea06;if(this['currentDisplayedUsers']['get'](_0x4a6bee['id']))this['currentDisplayedUsers']['remove'](_0x4a6bee['id']);else{if(_0x5f0994&&this['currentDisplayedUsers']['length']+0x1===_0x94ea06-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x5f0994?0x1:0x0)<this['usersCount']){for(const _0x2ce758 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x2ce758['id'])&&(this['currentDisplayedUsers']['add'](_0x2ce758,Math['min'](this['currentDisplayedUsers']['length']-(_0x5f0994?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x5f0994?0x1:0x0)===_0x94ea06-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x2ef5ec=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x2ef5ec['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1a1ef3}=this['presenceDropdownView'];_0x1a1ef3['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x398cc9=>{if(!_0x2ef5ec['displayMe']&&_0x398cc9['isMe'])return null;const _0x11b017=new j(this['context']['locale'],_0x398cc9,!!_0x2ef5ec['onClick']);return _0x2ef5ec['onClick']&&this['listenTo'](_0x11b017,'execute',()=>{_0x2ef5ec['onClick'](_0x398cc9,_0x11b017['element']);}),_0x11b017;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1a1ef3['focus'](),_0x1a1ef3['checkIfScrollable']();const _0x1080f7=(_0x31f7a8,_0x458cba)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x458cba();};_0x1a1ef3['keystrokes']['set']('Esc',_0x1080f7),_0x1a1ef3['keystrokes']['set']('Shift+Tab',_0x1080f7),_0x1a1ef3['keystrokes']['set']('Tab',(_0x38e728,_0x4498f2)=>{!function(_0x332791){const _0x18fa82=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x227e90=>_0x227e90+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x429f78=[...document['body']['querySelectorAll'](_0x18fa82)]['filter'](_0xaa0a02=>_0xaa0a02===document['activeElement']||_0xaa0a02['offsetWidth']+_0xaa0a02['offsetHeight']>0x0)['sort']((_0x2d8cd3,_0x544713)=>(_0x2d8cd3['tabIndex']||0x0)-(_0x544713['tabIndex']||0x0)),_0x30d2b2=_0x429f78['indexOf'](_0x332791),_0x49839c=_0x429f78[(_0x30d2b2+0x1)%_0x429f78['length']];_0x49839c&&_0x49839c['focus']();}(this['view']['element']),this['hideDropdown'](),_0x4498f2();}),_0x1a1ef3['focusTracker']['add'](this['view']['element']),_0x1a1ef3['focusTracker']['on']('change:isFocused',(_0x437099,_0x5b8f06,_0x1bfdb2)=>{_0x1bfdb2||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0x4d3b80{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
|
23
|
+
import{ContextPlugin as _0x2d60c1,Plugin as _0xa3957f,PendingActions as _0x46f226,Context as et}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x398b9e,CKEditorError as _0x361cf4,Collection as _0x5c1f9a,global as _0x34f2de,version as ht,uid as _0x43d7be,KeystrokeHandler as _0x403085}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1f910b,View as _0x40928d,ListView as _0xa396c4,ListItemView as rt,LabelView as at,BalloonPanelView as _0x584c05,clickOutsideHandler as _0x4ad730,BodyCollection as _0x2d8c37}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x3788b9,History as _0x33b8ee,NoOperation as _0x22981c,InsertOperation as _0x4cd219,MarkerOperation as _0x38d7d0,RootAttributeOperation as _0xb7bde,transformOperationSets as _0x1b5db5,OperationFactory as _0x53e641}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as dt,WEB_SOCKET_GATEWAY_STATES as _0x414fdf,CollaborativeEditingService as _0x10e105,User as ut,CommentsService as ot,TrackChangesService as _0x48f71b,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x2cdae6,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x2c6b24}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x873502}from'es-toolkit/compat';class n extends _0x2d60c1{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1f910b];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13c132){super(_0x13c132),this['set']('state',_0x414fdf['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x398b9e())();}['init'](){const _0x3ebda3=this['context'],_0xd1ce00=_0x3ebda3['plugins']['get']('CloudServices'),_0x9980d2=_0x3ebda3['plugins']['get'](_0x1f910b);if(!_0xd1ce00['token'])throw new _0x361cf4('websocketgateway-missing-token',this);if(!_0xd1ce00['webSocketUrl'])throw new _0x361cf4('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0xd1ce00['token'],_0xd1ce00['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0xb08a68=>{if(this['connection']=_0xb08a68,this['bind']('state')['to'](_0xb08a68,'state',this,'_isBrowserOffline',(_0x4f4698,_0x34ba9c)=>('connected'!==_0x4f4698&&(this['_shouldPluginsReconnect']=!0x0),_0x34ba9c||_0x4f4698!==_0x414fdf['CONNECTED']?_0x414fdf['DISCONNECTED']:this['state']==_0x414fdf['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x414fdf['CONNECTING']):_0x414fdf['CONNECTED'])),this['connection']['on']('error',(_0x2d30ad,_0x4ed858)=>{if('limitExceeded'!==_0x4ed858['code'])throw console['error'](_0x4ed858),new _0x361cf4('cloudservices-init',null,{'originalError':_0x4ed858});_0x9980d2['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'});}),!_0xb08a68['me'])return new Promise(_0x12d13c=>_0xb08a68['on']('change:me',_0x12d13c));})['catch'](_0x7dd56f=>{throw console['error'](_0x7dd56f),new _0x361cf4('cloudservices-init',null,{'originalError':_0x7dd56f});});}['addToReconnectionStack'](_0x24c418){if('function'!=typeof _0x24c418['reconnect'])throw new _0x361cf4('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x24c418))throw new _0x361cf4('websocketgateway-plugin-already-registered',this,{'name':_0x24c418['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x24c418);}['removeFromReconnectionStack'](_0x429d20){this['_reconnectionStack']['delete'](_0x429d20);}['isInReconnectionStack'](_0x56fbeb){return this['_reconnectionStack']['has'](_0x56fbeb);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x13a05c=>_0x13a05c['reconnect']())))['then'](()=>this['state']=_0x414fdf['CONNECTED'])['catch'](_0x3a5a1e=>{throw console['error'](_0x3a5a1e),new _0x361cf4('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x414fdf['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x2d60c1{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x2cdae6];}constructor(_0xb634b8){super(_0xb634b8),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5c1f9a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x2cdae6);}['init'](){const _0x22c809=this['context']['plugins']['get'](n);this['listenTo'](_0x22c809,'change:state',(_0x38f292,_0xeafcdf,_0x4c761b)=>{if('connected'!==_0x4c761b)this['channelSessions']['forEach'](_0x25c0c9=>_0x25c0c9['clear']()),this['channelConnectedUsers']['forEach'](_0x2cdb83=>_0x2cdb83['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2d01dc,_0x290033]of this['_registeredSessions'])for(const _0x261c60 of _0x290033)this['_handleSessionAdd'](_0x2d01dc,_0x261c60);}}),this['_createUser'](_0x22c809['connection']['me'],!0x0);}['register'](_0xef9ce0,_0x2485b4){if(this['_registeredSessions']['has'](_0xef9ce0))throw new _0x361cf4('sessions-register-already-registered',null,{'channelId':_0xef9ce0});this['_registeredSessions']['set'](_0xef9ce0,_0x2485b4),this['channelSessions']['set'](_0xef9ce0,new _0x5c1f9a()),this['channelConnectedUsers']['set'](_0xef9ce0,new _0x5c1f9a()),this['listenTo'](_0x2485b4,'add',(_0x597d4b,_0x2e960b)=>this['_handleSessionAdd'](_0xef9ce0,_0x2e960b)),this['listenTo'](_0x2485b4,'remove',(_0x4eb5ff,_0x213d3a)=>this['_handleSessionRemove'](_0xef9ce0,_0x213d3a));for(const _0x374e09 of _0x2485b4)this['_handleSessionAdd'](_0xef9ce0,_0x374e09);}['unregister'](_0x412f06){if(!this['_registeredSessions']['has'](_0x412f06))throw new _0x361cf4('sessions-unregister-not-exist',null,{'channelId':_0x412f06});const _0x34a26f=this['_registeredSessions']['get'](_0x412f06);this['stopListening'](_0x34a26f);for(const _0x13d7e9 of _0x34a26f)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x412f06,_0x13d7e9);this['_registeredSessions']['delete'](_0x412f06),this['channelSessions']['delete'](_0x412f06),this['channelConnectedUsers']['delete'](_0x412f06);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x32c159){for(const _0xae79e2 of this['channelSessions']['values']())for(const _0xaa5ed0 of _0xae79e2)if(_0xaa5ed0['id']===_0x32c159)return _0xaa5ed0['user'];}['getUserSessions'](_0x3b4fb5,_0x55a747){const _0x34ca42=_0x55a747?[this['channelSessions']['get'](_0x55a747)]:this['channelSessions']['values'](),_0x1e0bac=new Set();for(const _0x416efc of _0x34ca42)for(const _0x1558b1 of _0x416efc)_0x1558b1['user']['id']===_0x3b4fb5['id']&&_0x1e0bac['add'](_0x1558b1['id']);return _0x1e0bac;}['getUserRole'](_0xa709d3){for(const _0x79ada7 of this['channelSessions']['values']())for(const _0x4f78c6 of _0x79ada7)if(_0x4f78c6['user']===_0xa709d3)return _0x4f78c6['role'];}['_handleSessionAdd'](_0x280372,_0x31b9d6){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x283178=_0x31b9d6['user'],_0x9533e2=this['_users']['getUser'](_0x283178['id'])||this['_createUser'](_0x283178),_0x4a7d99=Object['assign']({},_0x31b9d6,{'user':_0x9533e2});this['channelSessions']['get'](_0x280372)['add'](_0x4a7d99);const _0x356405=this['channelConnectedUsers']['get'](_0x280372);_0x356405['has'](_0x9533e2['id'])||_0x356405['add'](_0x9533e2),this['allConnectedUsers']['has'](_0x9533e2['id'])||this['allConnectedUsers']['add'](_0x9533e2,_0x9533e2['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x280372,{'channelId':_0x280372,'session':_0x4a7d99});}['_handleSessionRemove'](_0x5067cf,_0x21df8a){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x56287e=this['channelConnectedUsers']['get'](_0x5067cf),_0x5e8faf=_0x21df8a['user'];_0x5e8faf['id']&&(this['channelSessions']['get'](_0x5067cf)['remove'](_0x21df8a['id']),_0x56287e['has'](_0x5e8faf['id'])&&!this['getUserSessions'](_0x5e8faf,_0x5067cf)['size']&&_0x56287e['remove'](_0x5e8faf['id']),this['allConnectedUsers']['get'](_0x5e8faf['id'])&&!this['getUserSessions'](_0x5e8faf)['size']&&this['allConnectedUsers']['remove'](_0x5e8faf['id']));}['_createUser'](_0x5f461b,_0x140f84){const _0x3c5da6=this['_users']['addUser'](_0x5f461b);return _0x140f84&&this['_users']['defineMe'](_0x5f461b['id']),_0x3c5da6['orderNumber']=this['_uniqueUsersCount']++,_0x3c5da6;}}class C extends _0xa3957f{['_domEmitter']=new(_0x398b9e())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4345d9=this['editor'],_0x1b4299=_0x4345d9['plugins']['get'](i);_0x4345d9['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x167965,{writer:_0x133b97})=>function(_0x83dd95,_0x48568a,_0x3f1b6d,_0x5ca304){const _0x7a29ed=_0x83dd95['markerName']['split'](':')[0x2],_0x1a9b10=_0x3f1b6d['getUserBySessionId'](_0x7a29ed);if(!_0x1a9b10||_0x7a29ed===_0x3f1b6d['mySessionId'])return;if(!_0x5ca304['model']['schema']['checkChild'](_0x83dd95['markerRange']['start'],'$text'))return;const _0x5a6d78={'class':'ck-user__marker\x20'+_0x1a9b10['color']['getMarkerClass'](),'data-name':_0x1a9b10['name'],'data-session-id':_0x7a29ed},_0x57dcc6=_0x5ca304['model']['markers']['get'](_0x83dd95['markerName']),_0x1e6fe3=_0x57dcc6['getStart'](),_0x5bb7c1=_0x1e6fe3['nodeAfter'],_0x3a7707=_0x5ca304['model']['schema'];if(_0x5bb7c1&&_0x3a7707['isObject'](_0x5bb7c1)&&_0x3a7707['isInline'](_0x5bb7c1)&&!_0x5ca304['model']['markers']['get']('user:range:'+_0x7a29ed)['getRange']()['isCollapsed'])return;const _0x3bfc57=_0x1e6fe3['parent'];return _0x5ca304['model']['schema']['isLimit'](_0x3bfc57)&&!_0x5ca304['model']['hasContent'](_0x3bfc57)&&(_0x5a6d78['contenteditable']=!0x1),function(_0x2cb7d3,_0x481319,_0x4e0711){const _0x363c74=_0x2cb7d3['createUIElement']('span',_0x481319);return _0x2cb7d3['setCustomProperty']('userPositionMarker',!0x0,_0x363c74),_0x363c74['render']=function(_0x2cfc95){const _0x53c935=this['toDomElement'](_0x2cfc95),_0x2bc4c7=document['createElement']('span');return _0x2bc4c7['classList']['add']('ck-user__marker-tooltip'),_0x2bc4c7['setAttribute']('contenteditable','false'),_0x2bc4c7['setAttribute']('spellcheck','false'),_0x2bc4c7['textContent']=_0x4e0711['name'],_0x53c935['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x2bc4c7['outerHTML']+'',_0x53c935['addEventListener']('mouseenter',()=>{_0x53c935['classList']['add']('ck-user__marker_hovered');}),_0x53c935['addEventListener']('mouseleave',()=>{_0x53c935['classList']['remove']('ck-user__marker_hovered');}),_0x53c935;},_0x363c74['isSimilar']=function(_0x133b3b){return!(!this['getCustomProperty']('userPositionMarker')||!_0x133b3b['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x133b3b['getAttribute']('data-session-id'));},_0x363c74;}(_0x48568a,_0x5a6d78,_0x1a9b10);}(_0x167965,_0x133b97,_0x1b4299,_0x4345d9)}),_0x4345d9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x24f841=>function(_0x5180a5,_0x1647ce){const _0x63372f=_0x5180a5['markerName']['split'](':')[0x2];if(_0x63372f===_0x1647ce['mySessionId'])return null;const _0x282ead=_0x1647ce['getUserBySessionId'](_0x63372f);if(!_0x282ead)return{'id':_0x63372f,'classes':[]};return{'id':_0x63372f,'classes':['ck-user__selection',_0x282ead['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x63372f},'priority':0x7d0+_0x282ead['orderNumber']};}(_0x24f841,_0x1b4299)}),function(_0x33c511){const _0x171894=_0x33c511['model'],_0x170fbb=new Map(),_0x210770=_0x33c511['plugins']['get'](i);_0x171894['markers']['on']('update:user:range',(_0x12b9e0,_0xc01936,_0x1756c7,_0x438d98)=>{if(!_0x438d98&&_0x170fbb['get'](_0xc01936['name']))return _0x170fbb['get'](_0xc01936['name'])['detach'](),void _0x170fbb['delete'](_0xc01936['name']);const _0x2799ae=_0xc01936['name']['split'](':')[0x2];if(_0x2799ae===_0x210770['mySessionId'])return;const _0x5f40b8='user:position:'+_0x2799ae;_0x171894['markers']['has'](_0x5f40b8)&&_0x33c511['editing']['reconvertMarker'](_0x5f40b8),_0xc01936['on']('change:range',(_0x5e1e80,_0x310743,_0x1517b7)=>{if('$graveyard'!=_0x310743['root']['rootName']&&'$graveyard'==_0xc01936['getRange']()['root']['rootName']&&!_0x170fbb['has'](_0xc01936['name'])){const _0x5860b6=_0x171894['schema']['getNearestSelectionRange'](_0x1517b7['deletionPosition']);if(_0x5860b6){const _0x569349=_0x3788b9['fromRange'](_0x5860b6);_0x170fbb['set'](_0xc01936['name'],_0x569349),_0x569349['on']('change:range',(_0x271db8,_0x20ff83,_0x249d91)=>{if('$graveyard'==_0x569349['root']['rootName']){const _0x27412f=_0x171894['schema']['getNearestSelectionRange'](_0x249d91['deletionPosition']);_0x27412f?(_0x569349['start']=_0x27412f['start'],_0x569349['end']=_0x27412f['end']):(_0x170fbb['delete'](_0xc01936['name']),_0x569349['detach']());}});}}});}),_0x171894['document']['on']('change',()=>{_0x170fbb['size']>0x0&&_0x171894['enqueueChange']({'isUndoable':!0x1},_0xf0df95=>{for(const [_0x240bbf,_0x57b390]of _0x170fbb)'$graveyard'==_0x171894['markers']['get'](_0x240bbf)['getRange']()['root']['rootName']&&(J(_0x240bbf['split'](':')[0x2],_0x57b390['toRange'](),_0x171894,_0xf0df95),_0x57b390['detach']());_0x170fbb['clear']();});});}(_0x4345d9),this['_domEmitter']['listenTo'](_0x34f2de['document'],'keydown',(_0x4632be,{key:_0x56d826})=>{'Escape'===_0x56d826&&function(_0x5c8c39){_0x5c8c39['editing']['view']['change'](_0x239d2c=>{for(const _0x3adfa7 of _0x5c8c39['model']['markers']){if(!_0x3adfa7['name']['startsWith']('user:position'))continue;const _0x170dd5=_0x5c8c39['editing']['mapper']['markerNameToElements'](_0x3adfa7['name']);if(_0x170dd5){for(const _0x16eb77 of _0x170dd5)_0x239d2c['removeClass']('ck-user__marker_hovered',_0x16eb77);}}});}(_0x4345d9);},{'useCapture':!0x0});}['afterInit'](){const _0xb5da03=this['editor'],_0x38a8ea=_0xb5da03['commands']['get']('undo');_0x38a8ea&&_0xb5da03['model']['on']('applyOperation',(_0x562604,_0x3e32e2)=>{const _0x4bb73f=_0x3e32e2[0x0];if(!_0x4bb73f['isDocumentOperation'])return;if('marker'!=_0x4bb73f['type']||!_0x4bb73f['name']['startsWith']('user:'))return;const _0x220602=_0x4bb73f['batch'];_0x38a8ea['_createdBatches']['has'](_0x220602)&&(_0x4bb73f['newRange']=_0x4bb73f['oldRange']?_0xb5da03['model']['createRange'](_0x4bb73f['oldRange']['start'],_0x4bb73f['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x17554e=this['editor'],_0x2ff88=_0x17554e['model']['document'],_0x22cb98=_0x17554e['plugins']['get'](i);_0x17554e['model']['enqueueChange']({'isUndoable':!0x1},_0x522af3=>{const _0x2f6fbc='user:range:'+_0x22cb98['mySessionId'],_0x2ade6b='user:position:'+_0x22cb98['mySessionId'],_0x1eb894=_0x17554e['model']['markers']['has'](_0x2f6fbc);_0x17554e['editing']['view']['hasDomSelection']?J(_0x22cb98['mySessionId'],_0x2ff88['selection']['getFirstRange'](),_0x17554e['model'],_0x522af3):_0x1eb894&&(_0x522af3['removeMarker'](_0x2f6fbc),_0x522af3['removeMarker'](_0x2ade6b));});}}function J(_0x260248,_0x5b1ecb,_0x4a006e,_0x277f55){const _0x506a01='user:range:'+_0x260248,_0xb86dc4='user:position:'+_0x260248,_0x25c0da=_0x5b1ecb['getContainedElement']();let _0x553ef0=_0x5b1ecb['start'];if(_0x25c0da&&_0x25c0da['is']('element','tableCell')){const _0x316545=function(_0x28dfef,_0x27d18a){for(const _0x289e5a of _0x28dfef['getPositions']())if(_0x27d18a['schema']['checkChild'](_0x289e5a,'$text'))return _0x289e5a;}(_0x5b1ecb,_0x4a006e);_0x316545&&(_0x553ef0=_0x316545,_0x5b1ecb=_0x277f55['createRange'](_0x553ef0));}const _0x4fd253=_0x277f55['createRange'](_0x553ef0);_0x4a006e['markers']['has'](_0x506a01)?(_0x277f55['updateMarker'](_0x506a01,{'range':_0x5b1ecb}),_0x277f55['updateMarker'](_0xb86dc4,{'range':_0x4fd253})):(_0x277f55['addMarker'](_0x506a01,{'range':_0x5b1ecb,'usingOperation':!0x0}),_0x277f55['addMarker'](_0xb86dc4,{'range':_0x4fd253,'usingOperation':!0x0}));}function E(_0x21abfa,_0x329d0a,_0x4eede7){const _0x286b37=_0x21abfa['t'],t=_0x21abfa['t'];switch(_0x329d0a){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 _0x286b37({'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'},_0x4eede7);default:return'';}}let H=0x1;class l extends _0xa3957f{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x10e105)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,C,_0x46f226,_0x2cdae6,_0x1f910b];}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 _0x51a8fa=this['serverHistory']['getOperations']();for(let _0x359fea=_0x51a8fa['length']-0x1;_0x359fea>=0x0;_0x359fea--){const _0x2515fc=_0x51a8fa[_0x359fea];if(!this['_disconnectionOperations']['has'](_0x2515fc))return _0x2515fc['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x53ff9e){if(super(_0x53ff9e),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x33b8ee(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x361cf4('collaboration-missing-channelid',this);const _0x2a248c=_0x53ff9e['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x2a248c,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2c6b24(),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 F(this['_disconnectionOperations']);}['init'](){const _0x209f2e=this['editor'],_0x4b3495=_0x209f2e['plugins']['get'](_0x2cdae6),_0x4915d6=_0x209f2e['plugins']['get'](n);this['listenTo'](_0x4b3495,'getOperationAuthor',(_0xa87025,_0x40bde5)=>{const _0x19fef0=_0x40bde5[0x0];_0x19fef0['_authorId']&&(_0xa87025['return']=_0x4b3495['getUser'](_0x19fef0['_authorId']),_0xa87025['stop']()),null===_0x19fef0['_authorId']&&(_0xa87025['return']=null,_0xa87025['stop']());},{'priority':'high'}),this['listenTo'](_0x209f2e['model']['document']['selection'],'change:range',(_0x12da26,_0x234f39)=>{_0x234f39['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x209f2e['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x209f2e['model']['on']('applyOperation',(_0x5cec36,_0x2480fd)=>{const _0x5a77c7=_0x2480fd[0x0];_0x5a77c7['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x5a77c7),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4915d6,'state',this,'_hasSynchronizationProblem',(_0x1b735c,_0x2fa938)=>'connected'===_0x1b735c&&!_0x2fa938),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x209f2e['disableReadOnlyMode']('rtc-offline'):_0x209f2e['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x209f2e['disableReadOnlyMode']('rtc-offline'):_0x209f2e['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xcbcfb7=this['editor']['plugins']['get'](i),_0x23a816=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0xcbcfb7['unregister'](this['_channelId']);const _0x29315c=await this['_service']['reconnect'](_0x23a816['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x29315c)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4cbec8=await this['_service']['getConnectedSessions']();_0xcbcfb7['register'](this['_channelId'],_0x4cbec8),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xf0b3bc){if(function(_0x227e16){return'404'===_0x227e16['code'];}(_0xf0b3bc)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5b5f59){return'409'===_0x5b5f59['code'];}(_0xf0b3bc)){const _0x190681=E(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'](_0x190681);}else{if(!(_0xf0b3bc instanceof V))throw _0xf0b3bc;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2e1bfb=this['editor']['plugins']['get'](n),_0x3e7986=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x3e7986['channelSessions']['has'](this['_channelId'])&&_0x3e7986['unregister'](this['_channelId']),_0x2e1bfb['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x47d26c){if(this['sessionId']!==_0x47d26c['sessionId']&&this['_lastSyncedOperationId']!==_0x47d26c['lastOperationId'])throw new V();return this['sessionId']=_0x47d26c['sessionId'],this['_handleServerResponse']([],{..._0x47d26c,'wereChangesApplied':!0x1,'data':_0x47d26c['data']},'reconnect');}async['_connectService'](_0xf1d612,_0x9febb5=!0x1){const {connection:_0x430fec}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x430fec,this['_channelId'])['then'](_0x21413d=>this['_initSessionsHandling'](_0x21413d))['catch'](_0x5850e0=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5850e0);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4ac5c3,_0x3371aa)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3371aa);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x12121a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xf1d612);this['_isPendingUpdate']=!0x0;const _0x35f009=await this['_service']['connect'](_0x430fec,this['_compressOperations'](_0xf1d612),_0x12121a);if(this['sessionId']=_0x35f009['sessionId'],_0x9febb5){if(!_0x35f009['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x35f009['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0xf1d612,_0x35f009,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x35f009,_0xf1d612);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x16bc07=this['editor']['plugins']['get'](i),_0x46dfb8=this['editor']['plugins']['get'](C),_0x59eb75=_0x16bc07['channelSessions']['get'](this['_channelId']);_0x59eb75&&_0x59eb75['length']>0x1?_0x46dfb8['createUserMarkerOperations']():this['listenTo'](_0x16bc07,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x16bc07['channelSessions']['get'](this['_channelId'])['length']&&_0x46dfb8['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x517d8e,_0x1ef4ff,_0x2779b7,_0x572f91){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1ef4ff){const _0x443182=this['_decompressOperations'](_0x2779b7,_0x572f91);await this['_fetchMissingUsers'](_0x443182),this['_handleExternalOperations'](_0x443182,_0x1ef4ff,_0x2779b7['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3c3835}=this['editor'];let _0x1cf732;try{_0x1cf732=await this['_service']['getDocumentDetails']();}catch{const _0x3d0019=E(_0x3c3835,'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'](_0x3d0019);}const _0x900037=_0x1cf732['currentDocumentSession']||_0x1cf732['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x900037['lastOperationId']){const _0x5186e5=E(_0x3c3835,'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'](_0x5186e5);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x5ac640){const _0x50886f=this['editor']['plugins']['get'](i);this['listenTo'](_0x50886f,'sessionAdd:'+this['_channelId'],(_0x247932,{session:_0x38f601})=>{if(_0x38f601['id']===_0x50886f['mySessionId']){_0x247932['off']();const _0x165d2b=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x409b5e=_0x38f601['permissions'];_0x165d2b&&_0x165d2b['isEnabled']&&(_0x409b5e=_0x409b5e['filter'](_0x508392=>'document:write'!==_0x508392)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x409b5e,this['_channelId']);}}),_0x50886f['register'](this['_channelId'],_0x5ac640);}['_initThrowingOnDataSet'](){const _0x2b66a0=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1c55f8)=>{if(!_0x1c55f8[_0x1c55f8['length']-0x1]['suppressErrorInCollaboration'])throw new _0x361cf4('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2b66a0['apply'](this['editor']['data'],_0x1c55f8);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x403fd3,[_0x58c2c6])=>{if(this['_document']['version'])throw new _0x361cf4('realtimecollaborationclient-init-document-already-initialized',this);_0x403fd3['stop'](),this['_setPendingAction']();const _0x2a2fe1=this['editor']['config']['get']('rootsAttributes'),_0x2842eb=this['_getOperationsFromInitData'](_0x58c2c6,_0x2a2fe1);0x0==_0x2842eb['length']&&_0x2842eb['push'](new _0x22981c(0x0)),_0x403fd3['return']=this['_connectService'](_0x2842eb)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x174fb1=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x174fb1))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x2b5664,[_0x500808,_0x56b517])=>{_0x2b5664['stop']();const _0x1e1f83=this['editor']['model']['document']['getRoot'](_0x500808);if(!this['_knownRootNames']['has'](_0x500808)){const _0x2c8d3c=_0x56b517&&_0x56b517['data']?_0x56b517['data']:'',_0x474f1a=_0x56b517&&_0x56b517['attributes']?_0x56b517['attributes']:{};await this['_loadRoot'](_0x500808,_0x2c8d3c,_0x474f1a);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x1e1f83['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x1e1f83);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x46822e){const _0x9cc2df=this['editor']['plugins']['get'](_0x2cdae6),{connection:_0x31358e}=this['editor']['plugins']['get'](n),_0x298201=new Set();for(const _0x212cb1 of _0x46822e){const _0x2471c5=_0x212cb1['_authorId'];_0x2471c5&&!_0x9cc2df['getUser'](_0x2471c5)&&_0x298201['add'](_0x2471c5);}if(0x0===_0x298201['size'])return;const _0x398733=await ut['getMany'](_0x31358e,Array['from'](_0x298201));for(const _0x1be052 of _0x398733)_0x9cc2df['getUser'](_0x1be052['id'])||_0x9cc2df['addUser'](_0x1be052);}['_getOperationsFromInitData'](_0x9a1c77,_0x32bd86={}){const _0x2cd9d5=this['editor']['model'],_0x115018=[];let _0xf7c91b=0x0;const _0xed551='string'==typeof _0x9a1c77?{'main':_0x9a1c77}:_0x9a1c77;for(const _0x2b65f4 of Object['keys'](_0xed551)){if(!this['_document']['roots']['has'](_0x2b65f4))throw new _0x361cf4('realtimecollaborationclient-init-non-existent-root',this);const _0x3538e6=this['editor']['data']['parse'](_0xed551[_0x2b65f4]),_0x3c87e7=this['_document']['getRoot'](_0x2b65f4),_0x129f8a=new _0x4cd219(_0x2cd9d5['createPositionAt'](_0x3c87e7,0x0),_0x3538e6,_0xf7c91b++);_0x115018['push'](_0x129f8a);for(const [_0x5e8a94,_0x264242]of _0x3538e6['markers']){const _0xaad514=_0x2cd9d5['createRange'](_0x2cd9d5['createPositionFromPath'](_0x3c87e7,_0x264242['start']['path']['slice']()),_0x2cd9d5['createPositionFromPath'](_0x3c87e7,_0x264242['end']['path']['slice']())),_0x41823b=new _0x38d7d0(_0x5e8a94,null,_0xaad514,_0x2cd9d5['markers'],!0x0,_0xf7c91b++);_0x115018['push'](_0x41823b);}}if(_0x32bd86)for(const [_0x48f060,_0x53ed0d]of Object['entries'](_0x32bd86)){const _0x5f4bba=_0x2cd9d5['document']['getRoot'](_0x48f060);if(!_0x5f4bba)throw new _0x361cf4('multi-root-editor-root-attributes-no-root',null);for(const [_0x5aa509,_0x31d14d]of Object['entries'](_0x53ed0d))if(null!==_0x31d14d){const _0x3a5a06=new _0xb7bde(_0x5f4bba,_0x5aa509,null,_0x31d14d,_0xf7c91b++);_0x115018['push'](_0x3a5a06);}}return _0x115018;}async['_loadRoot'](_0x544e75,_0x213379,_0x4a78ec){this['_getOperationsFromInitData']({[_0x544e75]:_0x213379},{[_0x544e75]:_0x4a78ec})['forEach']((_0x47efe0,_0x316cc4)=>{_0x47efe0['baseVersion']=this['_document']['version']+_0x316cc4,_0x47efe0['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x47efe0);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0xc2aeb1,_0x2f0fca){let _0xb8c50c;this['_offset']=_0xc2aeb1['offset'];const _0x30618d=_0xc2aeb1['wereChangesApplied']&&!_0xc2aeb1['initData'],_0x5b22fe=_0x30618d?0x0:_0xc2aeb1['data']['baseVersion'];if(_0x2f0fca['forEach'](_0xe28a75=>{_0xe28a75['_isInit']=!0x0,_0xe28a75['createdAt']=_0xc2aeb1['sessionCreatedAt'],_0xe28a75['_authorId']=null;}),_0x30618d)_0xb8c50c=_0x2f0fca,this['_applyOperationsSet'](_0xb8c50c,_0x30618d);else{if(_0xc2aeb1['initData']){const _0x2b5f1c=this['_getOperationsFromInitData'](_0xc2aeb1['initData']);this['_document']['history']['version']=-_0x2b5f1c['length'],_0x2b5f1c['forEach'](_0x4abd29=>{_0x4abd29['baseVersion']-=_0x2b5f1c['length'],_0x4abd29['createdAt']=_0xc2aeb1['sessionCreatedAt'],_0x4abd29['_isInit']=!0x0,_0x4abd29['_authorId']=null;}),this['_applyOperationsSet'](_0x2b5f1c,!0x0),this['serverHistory']['version']=-_0x2b5f1c['length']+this['_offset'],this['_updateServerHistory'](_0x2b5f1c);}this['_document']['history']['version']=_0x5b22fe,_0xb8c50c=this['_decompressOperations'](_0xc2aeb1['data'],_0xc2aeb1['metadata']),await this['_fetchMissingUsers'](_0xb8c50c),this['_applyOperationsSet'](_0xb8c50c,_0x30618d);}_0xc2aeb1['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xb8c50c,_0xc2aeb1['lastOperationId']),this['_lastSyncedOperationId']=_0xc2aeb1['lastOperationId']),this['serverHistory']['version']=_0x5b22fe+this['_offset'],this['_updateServerHistory'](_0xb8c50c),_0x2f0fca['filter'](_0x9cdd64=>{const _0x4c4c43=this['_getAffectedRoot'](_0x9cdd64);return _0x4c4c43&&!this['_knownRootNames']['has'](_0x4c4c43);})['forEach']((_0x2590be,_0x4e4747)=>{_0x2590be['baseVersion']=this['_document']['version']+_0x4e4747,this['_saveOperationInBuffer'](_0x2590be);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x53d557,_0x475ead){const _0x8a9ea7=_0x475ead&&_0x475ead['message'];if(_0x8a9ea7&&_0x8a9ea7['startsWith']('realtimecollaborationclient'))throw _0x475ead;const _0x20275d=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x20275d['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x361cf4(_0x53d557,this['editor'],_0x8a9ea7?{'originalError':_0x8a9ea7}:void 0x0);}['_saveOperationInBuffer'](_0x1edfeb){this['_knownOperations']['has'](_0x1edfeb)||(this['_knownOperations']['add'](_0x1edfeb),this['_bufferedOperations']['push'](_0x1edfeb),this['_pendingAction']||'marker'==_0x1edfeb['type']&&!_0x1edfeb['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x4574c0=!0x1){!_0x4574c0&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x375400=>{_0x375400&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x39da3f=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x429444){return _0x429444['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x429444['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x429444['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x39da3f)||this['_crash'](_0x39da3f['message'],_0x39da3f);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x1269e3=>{this['on']('change:_isPendingUpdate',()=>{_0x1269e3();});});}async['_sendBufferedOperations'](){const _0x285874=this['editor']['plugins']['get'](C);if(this['_shouldSendSelectionUpdate']()&&(_0x285874['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5e9bb6=[...this['_bufferedOperations']];for(const _0x172456 of _0x5e9bb6)_0x172456['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x172456);const _0x57a5c3=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5e9bb6),_0x118d8e=H++,_0x10e4a5=this['_compressOperations'](_0x5e9bb6),_0x4c0804=await this['_service']['sendOperations'](_0x10e4a5,_0x10e4a5['baseVersion'],_0x57a5c3);try{return await this['_handleServerResponse'](_0x5e9bb6,_0x4c0804,_0x118d8e);}catch(_0x43ccbd){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x43ccbd);}}async['_handleServerResponse'](_0x215eac,_0x3761fb,_0x22c6eb){if('error'in _0x3761fb)throw _0x3761fb['error'];let _0x1d6324=!0x1;if(_0x3761fb['wereChangesApplied']){_0x3761fb['lastOperationId']&&(this['_lastSyncedOperationId']=_0x3761fb['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1344c0=>!_0x215eac['includes'](_0x1344c0));for(const _0x4dd0ba of _0x215eac)_0x4dd0ba['createdAt']='lastOperationAcceptedAt'in _0x3761fb&&_0x3761fb['lastOperationAcceptedAt']||void 0x0;W(_0x215eac,_0x3761fb['version']-_0x215eac['length']),this['_updateServerHistory'](_0x215eac);const _0x1cf48c=_0x215eac['filter'](_0x52e6a5=>{if(!_0x52e6a5['_isInit'])return!0x1;const _0x20bb3a=this['_getAffectedRoot'](_0x52e6a5);return _0x20bb3a&&!this['_knownRootNames']['has'](_0x20bb3a);});W(_0x1cf48c,this['_document']['version']),this['_applyOperationsSet'](_0x1cf48c),_0x1d6324=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xe19873=this['_decompressOperations'](_0x3761fb['data'],_0x3761fb['metadata'])['filter'](_0x314f31=>_0x314f31['baseVersion']>=this['_lastServerVersion']);_0xe19873['forEach'](_0x3aa58a=>this['_addKnownRoot'](_0x3aa58a)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xd8ba66=>!_0xd8ba66['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xd8ba66))),this['_bufferedOperations']['length']&&W(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xe19873),_0x1d6324=this['_handleExternalOperations'](_0xe19873,_0x3761fb['version'],_0x3761fb['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1d6324?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2ab6a0,_0x502fbf,_0x10a2c3){try{const _0x3c6dbe={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1e4856,operationsB:_0x17d792,originalOperations:_0x833fee}=_0x1b5db5(_0x2ab6a0,this['_bufferedOperations'],_0x3c6dbe);W(_0x1e4856,this['_document']['version']),W(_0x17d792,_0x502fbf);for(const _0x1f833c of _0x1e4856){const _0x54e6b5=_0x833fee['get'](_0x1f833c);_0x1f833c['_authorId']=_0x54e6b5?_0x54e6b5['_authorId']:null;}_0x10a2c3&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2ab6a0,_0x10a2c3),this['_lastSyncedOperationId']=_0x10a2c3),this['_bufferedOperations']=[..._0x17d792],this['_applyOperationsSet'](_0x1e4856),this['_updateServerHistory'](_0x2ab6a0);}catch(_0x200352){return console['error'](_0x200352),!0x1;}return!0x0;}['_applyOperationsSet'](_0x28fe89,_0x5c2233=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x49e0e2=>{for(const _0x54c5ca of _0x28fe89)this['_knownOperations']['add'](_0x54c5ca),this['_addKnownRoot'](_0x54c5ca),_0x49e0e2['batch']['addOperation'](_0x54c5ca),this['editor']['model']['applyOperation'](_0x54c5ca);});}['_addKnownRoot'](_0x9bd9ba){const _0x5f5a3b=this['_getAffectedRoot'](_0x9bd9ba);_0x5f5a3b&&this['_knownRootNames']['add'](_0x5f5a3b);}['_getAffectedRoot'](_0x2aba31){let _0x4d8fde,_0x2eb2fb;switch(_0x2aba31['type']){case'insert':_0x4d8fde=_0x2aba31['position']['root'];break;case'marker':if(_0x2eb2fb=_0x2aba31['newRange'],!_0x2eb2fb)return null;_0x4d8fde=_0x2eb2fb['root'];break;case'addRootAttribute':_0x4d8fde=_0x2aba31['root'];break;case'addRoot':_0x4d8fde=_0x2aba31['affectedSelectable'];break;case'move':_0x4d8fde=_0x2aba31['targetPosition']['root'];break;default:return null;}return _0x4d8fde['rootName'];}['_updateServerHistory'](_0x1a1ebb){_0x1a1ebb['forEach'](_0x48197d=>{const _0x493282=_0x48197d['clone']();_0x493282['_authorId']=_0x48197d['_authorId'],_0x493282['_isInit']=!!_0x48197d['_isInit'],_0x493282['createdAt']=_0x48197d['createdAt'],_0x493282['baseVersion']+=this['_offset'],_0x48197d['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x493282),this['serverHistory']['addOperation'](_0x493282);});}['_handleReconnectionError'](_0x5a1499){const _0x3d6891=this['editor']['plugins']['get']('Notification'),_0x66b60a=this['editor']['locale'];_0x5a1499||(_0x5a1499=E(_0x66b60a,'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.')),_0x3d6891['showWarning'](_0x5a1499,{'title':E(_0x66b60a,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x46f226)['add'](E(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x46f226)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5dc3a4){const _0x2ea999=_0x5dc3a4['map'](_0x4c3408=>_0x4c3408['toJSON']());return this['_compressor']['compress'](_0x2ea999);}['_decompressOperations'](_0x2b4218,_0x59e963){return this['_compressor']['decompress'](_0x2b4218)['map']((_0xbf1350,_0xc1df51)=>{const _0xd82a03='init'==_0x59e963[_0xc1df51]['type'];if('InsertOperation'==_0xbf1350['__className']){const _0x496dd1=_0xbf1350['position']['root'];!this['_document']['getRoot'](_0x496dd1)&&(this['_document']['createRoot']('$root',_0x496dd1)['_isAttached']=!0x1);}const _0x4a539d=_0x53e641['fromJSON'](_0xbf1350,this['_document']);return _0x4a539d['wasUndone']=_0xbf1350['wasUndone'],_0x4a539d['_isInit']=_0xd82a03,_0x4a539d['_authorId']=_0xd82a03?null:_0x59e963[_0xc1df51]['userId'],_0x4a539d['_isDisconnection']='cs:removeUser'===_0x59e963[_0xc1df51]['type'],_0x4a539d['createdAt']=_0x59e963[_0xc1df51]['createdAt'],_0x4a539d;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2faa09=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2faa09&&_0x2faa09['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class V extends Error{}function W(_0x151a21,_0x4235ce){for(const _0x11e36d of _0x151a21)_0x11e36d['baseVersion']=_0x4235ce++;}class F{['_ignoredOperations'];['_operationToId'];constructor(_0x278fd7){this['_ignoredOperations']=_0x278fd7,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x390b36){let _0x2a5753=_0x390b36['length'];for(;_0x2a5753--;){const _0x47f8e9=_0x390b36[_0x2a5753];if(!this['_ignoredOperations']['has'](_0x47f8e9)){if(!this['_operationToId']['has'](_0x47f8e9)){const _0x22d724=_0x43d7be()['slice'](0x1,0x12);this['_operationToId']['set'](_0x47f8e9,_0x22d724);}return this['_operationToId']['get'](_0x47f8e9);}}}['setIdForTheLastOperation'](_0x36943b,_0x2c265b){if(!_0x2c265b)return;let _0x1c20fa=_0x36943b['length'];for(;_0x1c20fa--;){const _0x302cca=_0x36943b[_0x1c20fa];this['_ignoredOperations']['has'](_0x302cca)||this['_operationToId']['set'](_0x302cca,_0x2c265b);}}}class a extends _0xa3957f{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x2d60c1{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>ot)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x2cdae6];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x35b45c){super(_0x35b45c),this['_services']=new Map();}async['init'](){const _0x1dea4a=this['context'],_0x2787f5=_0x1dea4a['plugins']['get']('CommentsRepository');if(_0x1dea4a['plugins']['get'](n)['addToReconnectionStack'](this),_0x2787f5['adapter']={'addCommentThread':async({channelId:_0x2a77c0,threadId:_0x1424d5,comments:_0x1d2460,resolvedAt:_0x24eb18,resolvedBy:_0x168015,context:_0x7771f7,attributes:_0x511af9})=>{const _0x8c9ca8=await this['_getService'](_0x2a77c0)['addCommentThread']({'commentThreadId':_0x1424d5,'comments':_0x1d2460['map'](_0x32cb02=>function(_0x7cbe7f,_0x3d27a7,_0x237cb2){return{'commentThreadId':_0x237cb2,'commentId':_0x7cbe7f['commentId'],'userId':_0x7cbe7f['authorId'],'content':_0x7cbe7f['content'],'documentId':_0x3d27a7,'createdAt':_0x7cbe7f['createdAt'],'attributes':_0x7cbe7f['attributes']||{}};}(_0x32cb02,_0x2a77c0,_0x1424d5)),'resolvedAt':_0x24eb18,'resolvedBy':_0x168015,'context':_0x7771f7,'attributes':_0x511af9})['catch'](ft);return{'threadId':_0x8c9ca8['commentThreadId'],'comments':_0x8c9ca8['comments']};},'getCommentThread':async({channelId:_0xf5d17,threadId:_0x837a1f})=>{const _0x4ec471=await this['_getService'](_0xf5d17)['getCommentThread'](_0x837a1f)['catch'](ft);return _0x4ec471['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x4ec471]),{'threadId':_0x4ec471['commentThreadId'],'comments':_0x4ec471['comments']['map'](st),'context':_0x4ec471['context'],'resolvedAt':_0x4ec471['resolvedAt'],'resolvedBy':_0x4ec471['resolvedBy'],'attributes':_0x4ec471['attributes']||{}});},'updateCommentThread':async({channelId:_0x4f595e,threadId:_0x54d2a1,context:_0x43592a,unlinkedAt:_0xd2c5e,attributes:_0x3c0651})=>this['_getService'](_0x4f595e)['updateCommentThread']({'commentThreadId':_0x54d2a1,'context':_0x43592a,'attributes':_0x3c0651,'unlinkedAt':_0xd2c5e})['catch'](nt)['catch'](ft),'resolveCommentThread':async({channelId:_0x4544c2,threadId:_0x5d3469})=>{const _0x3b3439=await this['_getService'](_0x4544c2)['resolveCommentThread'](_0x5d3469)['catch'](nt)['catch'](ft);return{'threadId':_0x3b3439['commentThreadId'],'resolvedAt':_0x3b3439['resolvedAt'],'resolvedBy':_0x3b3439['resolvedBy']};},'reopenCommentThread':async({channelId:_0x4f3a1a,threadId:_0x1efada})=>this['_getService'](_0x4f3a1a)['reopenCommentThread'](_0x1efada)['catch'](nt)['catch'](ft),'removeCommentThread':({channelId:_0x2e6750,threadId:_0x4cd4f2})=>this['_getService'](_0x2e6750)['removeCommentThread'](_0x4cd4f2)['catch'](nt)['catch'](ft),'addComment':({channelId:_0x18d1e6,threadId:_0x17f216,commentId:_0x29491f,content:_0x78b852,attributes:_0x2f780e})=>this['_getService'](_0x18d1e6)['addComment'](_0x17f216,_0x29491f,_0x78b852,_0x2f780e)['catch'](ft),'updateComment':({channelId:_0x2e0f22,threadId:_0x1c8eff,commentId:_0xd13879,content:_0x15f483,attributes:_0x53bc53})=>this['_getService'](_0x2e0f22)['updateComment'](_0x1c8eff,_0xd13879,_0x15f483,_0x53bc53)['catch'](nt)['catch'](ft),'removeComment':({channelId:_0x5b0a69,threadId:_0xbdf3c9,commentId:_0x495630})=>this['_getService'](_0x5b0a69)['removeComment'](_0xbdf3c9,_0x495630)['catch'](nt)['catch'](ft)},_0x1dea4a instanceof et){const _0x5f5923=_0x1dea4a['config']['get']('collaboration.channelId'),_0x5d9075=_0x1dea4a['plugins']['get'](i);await this['_setUpService'](_0x5f5923);const _0x496dee=await this['_services']['get'](_0x5f5923)['getConnectedSessions']();this['listenTo'](_0x5d9075,'sessionAdd:'+_0x5f5923,(_0x1aa98e,{session:_0xf6683})=>{_0xf6683['id']===_0x5d9075['mySessionId']&&(_0x1aa98e['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0xf6683['permissions'],_0x5f5923));}),_0x5d9075['register'](_0x5f5923,_0x496dee);}}async['_setUpService'](_0x3410a6){if(this['_services']['has'](_0x3410a6))throw new _0x361cf4('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x3410a6});const _0x3db231=this['context']['plugins']['get']('CommentsRepository'),_0x306e01=new s['CommentsService'](_0x3410a6);this['_services']['set'](_0x3410a6,_0x306e01),this['listenTo'](_0x306e01,'commentThreadAdded',(_0x3a59d4,_0x391a0c)=>{const {commentThreadId:_0x20ca40,documentId:_0xcc1285,context:_0x437b47,attributes:_0xd79125,resolvedAt:_0x4dd233,resolvedBy:_0x589bca,comments:_0x2699c7}=_0x391a0c;_0x3db231['getCommentThread'](_0x20ca40)||_0x3db231['addCommentThread']({'threadId':_0x20ca40,'channelId':_0xcc1285,'comments':_0x2699c7?_0x2699c7['map'](st):[],'context':_0x437b47,'attributes':_0xd79125,'resolvedAt':_0x4dd233,'resolvedBy':_0x589bca,'isFromAdapter':!0x0});}),this['listenTo'](_0x306e01,'commentThreadUpdated',(_0x4de8ac,{commentThreadId:_0x817081,documentId:_0x4724b8,context:_0x760da3,unlinkedAt:_0x41946a,attributes:_0x39db27})=>{_0x3db231['getCommentThread'](_0x817081)&&_0x3db231['updateCommentThread']({'threadId':_0x817081,'channelId':_0x4724b8,'context':_0x760da3,'unlinkedAt':_0x41946a,'attributes':_0x39db27,'isFromAdapter':!0x0});}),this['listenTo'](_0x306e01,'commentThreadResolved',(_0x1d20de,{commentThreadId:_0x349b3b,resolvedBy:_0x2840f3,resolvedAt:_0x513743})=>{const _0x4479d6=_0x3db231['getCommentThread'](_0x349b3b);_0x4479d6&&_0x4479d6['resolve']({'resolvedBy':_0x2840f3,'resolvedAt':_0x513743,'isFromAdapter':!0x0});}),this['listenTo'](_0x306e01,'commentThreadReopened',(_0x2172c3,{commentThreadId:_0xb6dca})=>{const _0x2591b3=_0x3db231['getCommentThread'](_0xb6dca);_0x2591b3&&_0x2591b3['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x306e01,'commentThreadRemoved',(_0xc59774,{commentThreadId:_0x27bdfa})=>{const _0x5534cd=_0x3db231['getCommentThread'](_0x27bdfa);_0x5534cd&&_0x5534cd['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x306e01,'commentAdded',(_0x12d3b9,_0x19cdba)=>{const _0x2569ce=_0x19cdba['commentThreadId'],_0x75fdfd=_0x3db231['getCommentThread'](_0x2569ce);_0x75fdfd&&_0x75fdfd['addComment']({...st(_0x19cdba),'isFromAdapter':!0x0});}),this['listenTo'](_0x306e01,'commentUpdated',(_0x121832,{commentThreadId:_0x1c26df,commentId:_0x399ce1,content:_0x4a272f,attributes:_0x41b05c})=>{const _0x51a013=_0x3db231['getCommentThread'](_0x1c26df);if(_0x51a013){const _0x515d96=_0x51a013['getComment'](_0x399ce1);_0x515d96&&_0x515d96['update']({'content':_0x4a272f,'attributes':_0x41b05c,'isFromAdapter':!0x0});}}),this['listenTo'](_0x306e01,'commentRemoved',(_0x5a0dd0,{commentThreadId:_0x27be98,commentId:_0x2bfdcc})=>{const _0x4ca397=_0x3db231['getCommentThread'](_0x27be98);if(_0x4ca397){const _0x3afc64=_0x4ca397['getComment'](_0x2bfdcc);_0x3afc64&&_0x3afc64['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x3410a6);}['destroy'](){if(this['context']instanceof et){const _0x500d67=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x500d67);}}['_terminateService'](_0x537b4f){if(!this['_services']['has'](_0x537b4f))throw new _0x361cf4('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x537b4f});this['_getService'](_0x537b4f)['disconnect'](),this['_services']['delete'](_0x537b4f);}async['reconnect'](){for(const _0x4e6b7b of this['_services']['keys']())await this['_connectService'](_0x4e6b7b);if(this['context']instanceof et){const _0x12f656=this['context']['config']['get']('collaboration.channelId'),_0x4f4b10=this['context']['plugins']['get'](i);_0x4f4b10['unregister'](_0x12f656);const _0x13f6b=await this['_services']['get'](_0x12f656)['getConnectedSessions']();_0x4f4b10['register'](_0x12f656,_0x13f6b);}}async['_connectService'](_0x20b9be){const {connection:_0x5a2fbf}=this['context']['plugins']['get'](n),_0x5eab52=this['context']['plugins']['get']('CommentsRepository'),_0x4b482e=this['_services']['get'](_0x20b9be),_0x3a2025=await _0x4b482e['connect'](_0x5a2fbf);await this['_fetchMissingUsersForThreads'](_0x3a2025);const _0x415c16=new Set(Array['from'](_0x5eab52['getCommentThreads']({'channelId':_0x20b9be}),_0x14c84b=>_0x14c84b['id']));for(const _0x5d3d22 of _0x3a2025)_0x5d3d22['deletedAt']||_0x415c16['delete'](_0x5d3d22['commentThreadId']);for(const _0x305d5d of _0x415c16)_0x5eab52['getCommentThread'](_0x305d5d)['remove']({'isFromAdapter':!0x0});for(const _0x2b6b3b of _0x3a2025){let _0xae0b30=_0x5eab52['getCommentThread'](_0x2b6b3b['commentThreadId']);const {commentThreadId:_0x41a317,context:_0x985087,attributes:_0x5bc264,resolvedBy:_0x5ea9d0,resolvedAt:_0x1e0810,unlinkedAt:_0x4e8737,deletedAt:_0x11a8b6}=_0x2b6b3b;if(_0x11a8b6)continue;_0xae0b30||(_0xae0b30=_0x5eab52['addCommentThread']({'channelId':_0x20b9be,'threadId':_0x41a317,'context':_0x985087,'attributes':_0x5bc264||{},'resolvedBy':_0x5ea9d0,'resolvedAt':_0x1e0810,'unlinkedAt':_0x4e8737,'isFromAdapter':!0x0}));const _0x4bb7c7=new Set(Array['from'](_0xae0b30['comments'],_0x16a87a=>_0x16a87a['id']));for(const _0x75caea of _0x2b6b3b['comments'])_0x4bb7c7['delete'](_0x75caea['commentId']);for(const _0x5ac610 of _0x4bb7c7)_0xae0b30['getComment'](_0x5ac610)['remove']({'isFromAdapter':!0x0});for(const _0xcd1d15 of _0x2b6b3b['comments']){const _0x5da01b=_0xae0b30['getComment'](_0xcd1d15['commentId']);_0x5da01b?_0x5da01b['content']!==_0xcd1d15['content']&&_0x5da01b['update']({'content':_0xcd1d15['content'],'isFromAdapter':!0x0}):_0xae0b30['addComment'](Object['assign'](st(_0xcd1d15),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1472ab){if(!this['_services']['has'](_0x1472ab))throw new _0x361cf4('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1472ab});return this['_services']['get'](_0x1472ab);}async['_fetchMissingUsersForThreads'](_0x25c560){const _0x5a8cf3=this['context']['plugins']['get'](_0x2cdae6),{connection:_0x3cad60}=this['context']['plugins']['get'](n),_0x3abd9a=new Set();for(const {resolvedBy:_0x521d35,comments:_0x2e6453}of _0x25c560){_0x521d35&&!_0x5a8cf3['getUser'](_0x521d35)&&_0x3abd9a['add'](_0x521d35);for(const {userId:_0x4e2086}of _0x2e6453)_0x5a8cf3['getUser'](_0x4e2086)||_0x3abd9a['add'](_0x4e2086);}if(0x0===_0x3abd9a['size'])return;const _0x2df927=await ut['getMany'](_0x3cad60,Array['from'](_0x3abd9a));for(const _0x35dc16 of _0x2df927)_0x5a8cf3['getUser'](_0x35dc16['id'])||_0x5a8cf3['addUser'](_0x35dc16);}}async function nt(_0x22ab89){if('404'!==_0x22ab89['code'])throw _0x22ab89;}function ft(_0x2486a0){if((_0x41b730=_0x2486a0)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x41b730['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41b730['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x41b730;throw _0x2486a0;}function st(_0x2a0dc9){return{'threadId':_0x2a0dc9['commentThreadId'],'commentId':_0x2a0dc9['commentId'],'content':_0x2a0dc9['content'],'createdAt':_0x2a0dc9['createdAt'],'authorId':_0x2a0dc9['userId'],'attributes':_0x2a0dc9['attributes']||{}};}class m extends _0xa3957f{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>_0x48f71b)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e4e76){super(_0x3e4e76);const _0x5d4da8=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x5d4da8);}['init'](){const _0x1c4d32=this['editor']['plugins']['get'](n),_0x5c4246=this['editor']['plugins']['get']('TrackChangesEditing');return _0x5c4246['adapter']={'getSuggestion':async _0xfa9991=>{await this['_waitForServiceReady']();const _0x1b577f=await this['_trackChangesService']['get'](_0xfa9991)['catch'](Y);return await this['_fetchMissingUsersForThreads']([_0x1b577f]),_0x1b577f;},'addSuggestion':async({id:_0x3366a2,type:_0x3b5000,data:_0x2afa11,originalSuggestionId:_0x573d7f,attributes:_0x30e4e5})=>{await this['_waitForServiceReady']();const _0x4b3b0a={'id':_0x3366a2,'type':_0x3b5000,'data':_0x2afa11,'originalSuggestionId':_0x573d7f,'attributes':_0x30e4e5},_0x3ac61d=await this['_trackChangesService']['add'](_0x3366a2,_0x3b5000,_0x2afa11,_0x573d7f,_0x30e4e5)['catch'](_0x206193=>{if(mt(_0x206193))return new Promise(_0x2fd5bb=>{this['_bufferedRequests']['set'](_0x3366a2,{'resolve':_0x2fd5bb,'suggestionData':_0x4b3b0a});});throw _0x206193;});return this['_bufferedRequests']['delete'](_0x3366a2),_0x3ac61d;},'updateSuggestion':async(_0x18d215,_0x50b952)=>{if(await this['_waitForServiceReady'](),'open'!==_0x50b952['state'])return this['_trackChangesService']['update'](_0x18d215,_0x50b952)['catch'](Y);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x53bc9c,_0x58fb19)=>{_0x5c4246['hasSuggestion'](_0x58fb19['id'])&&(_0x5c4246['getSuggestion'](_0x58fb19['id'])['attributes']=_0x58fb19['attributes']);}),this['_trackChangesService']['connect'](_0x1c4d32['connection'])['then'](_0x2bcd9d=>(_0x1c4d32['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2bcd9d)['then'](()=>{for(const _0x23f1de of _0x2bcd9d){_0x5c4246['addSuggestionData'](_0x23f1de)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5646a3=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x292aba}=this['editor']['plugins']['get'](n),_0x1274fb=await this['_trackChangesService']['connect'](_0x292aba);await this['_fetchMissingUsersForThreads'](_0x1274fb);for(const {suggestionData:_0x17b6c0,resolve:_0x2b941f}of this['_bufferedRequests']['values']()){let _0x3e687c=_0x1274fb['find'](_0x2fe511=>_0x2fe511['id']===_0x17b6c0['id']);_0x3e687c||(_0x3e687c=await this['_trackChangesService']['add'](_0x17b6c0['id'],_0x17b6c0['type'],_0x17b6c0['data'],_0x17b6c0['originalSuggestionId'])),_0x2b941f(_0x3e687c);}for(const _0x7c2b29 of _0x1274fb)_0x5646a3['hasSuggestion'](_0x7c2b29['id'])||_0x5646a3['addSuggestionData'](_0x7c2b29);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x55a08d=>{this['listenTo'](this['_trackChangesService'],'connected',_0x2629d1=>{_0x2629d1['off'](),_0x55a08d();});});}async['_fetchMissingUsersForThreads'](_0x37a296){const _0x47f3ff=this['editor']['plugins']['get'](_0x2cdae6),{connection:_0x991653}=this['editor']['plugins']['get'](n),_0x41cd82=new Set();for(const {authorId:_0x26763b}of _0x37a296)_0x47f3ff['getUser'](_0x26763b)||_0x41cd82['add'](_0x26763b);if(0x0===_0x41cd82['size'])return;const _0x33ae1e=await ut['getMany'](_0x991653,Array['from'](_0x41cd82));for(const _0x38d20f of _0x33ae1e)_0x47f3ff['getUser'](_0x38d20f['id'])||_0x47f3ff['addUser'](_0x38d20f);}}function Y(_0x1a372e){if(mt(_0x1a372e))return new Promise(()=>{});throw _0x1a372e;}function mt(_0x5bfe39){return _0x5bfe39['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5bfe39['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0xa3957f{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x96b059=this['editor']['plugins']['get'](n),_0x2d6afd=this['editor']['plugins']['get']('CommentsEditing'),_0x2a091b=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x96b059,'change:state',(_0x5df31c,_0x4f3d59,_0x19939d)=>{_0x2d6afd['isThreadsLoadingPaused']='connected'!==_0x19939d;});}),this['listenTo'](_0x96b059,'change:state',(_0x4afe6a,_0x304f47,_0xff2637)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xff2637);}),_0x2a091b['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class pt extends _0xa3957f{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0xa3957f{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x2cdae6];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x437b79){super(_0x437b79);const _0x48050d=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x48050d);}async['init'](){const _0x333887=this['editor']['plugins']['get'](l),_0x2536ec=_0x333887['serverHistory'],_0x6f63f7=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x2536ec,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x333887['sessionId']});const _0x514a8c=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x3cd72b=await tt['isBundleUploaded'](_0x6f63f7['connection'],_0x514a8c);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3c0ea8})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3c0ea8)),'updateRevisions':async _0x30251f=>{await this['_waitForServiceReady']();const _0xdda884=this['_revisionTracker']['currentRevision'];if(_0x3cd72b&&0x1===_0x30251f['length']&&_0x30251f[0x0]['id']===_0xdda884['id'])return _0x30251f;for(const _0x5803a5 of _0x30251f)_0x5803a5['id']===_0xdda884['id']&&(_0x5803a5['isEmptyCurrent']=_0x5803a5['fromVersion']===_0x5803a5['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x30251f,this['_lastRequestId'])['then'](_0x54341c=>(this['_lastRequestId']=_0x54341c,_0x30251f))['catch'](_0x38bd9a=>{if(Z(_0x38bd9a)||'400'===_0x38bd9a['code']&&void 0x0!==_0x38bd9a['data']['wrongRequestId']){for(const _0x40b9fe of _0x30251f){!this['_revisionTracker']['repository']['getRevision'](_0x40b9fe['id'])||this['_revisionTracker']['_bufferUpdate'](_0x40b9fe['id'],_0x40b9fe,!0x1);}if(Z(_0x38bd9a))throw _0x38bd9a;return _0x30251f;}throw _0x38bd9a;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x916204,{revisionsData:_0x125ac2,requestId:_0x42480d})=>{Math['max'](..._0x125ac2['map'](_0x2b1d07=>_0x2b1d07['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x125ac2,_0x42480d);}):this['_handleRevisionsUpdate'](_0x125ac2,_0x42480d);});const {revisions:_0x1fb90a,requestId:_0x3794d9}=await this['_revisionHistoryService']['connect'](_0x6f63f7['connection']);_0x6f63f7['addToReconnectionStack'](this),this['_lastRequestId']=_0x3794d9,await this['_fetchMissingUsers'](_0x1fb90a);for(const _0x5f10fb of _0x1fb90a)this['_revisionTracker']['addRevisionData'](_0x5f10fb);this['listenTo'](_0x333887,'change:_isConnected',(_0x4d2212,_0x3bf9e5,_0x3cf81e)=>{_0x3cf81e&&(this['_oldOffset']=_0x333887['_offset'],_0x4d2212['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x6f63f7,'state',_0x25f906=>_0x25f906===_0x414fdf['CONNECTED']);}async['reconnect'](){const _0x2e2b14=this['editor']['plugins']['get'](n),_0xe23747=this['editor']['plugins']['get'](l),_0x5051d4=async()=>{const _0xe163e8=this['_revisionTracker']['currentRevision'],_0x462b73=_0xe163e8['id'],_0x511ccc=_0x462b73!==_0xe23747['sessionId'];if(_0x511ccc){const _0x1fe659=_0xe23747['_offset']-this['_oldOffset'],_0x327b40=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0xe163e8['toVersion']+_0x1fe659!==_0x327b40){const _0x3e2e4f=_0xe163e8['fromVersion']+_0x1fe659,_0x501c54=this['editor']['plugins']['get'](_0x2cdae6),_0x5eaca7=this['_revisionTracker']['buildRevisionData']({'revision':_0xe163e8,'from':_0x3e2e4f,'to':_0x327b40});_0x5eaca7['id']=_0xe163e8['id'];const _0x4c75bb=_0x5eaca7['authorsIds']['map'](_0x1aa08f=>_0x501c54['getUser'](_0x1aa08f));_0xe163e8['_update']({..._0x5eaca7,'authors':_0x4c75bb},!0x0),this['_revisionTracker']['_bufferUpdate'](_0xe163e8['id'],_0x5eaca7,!0x0);}this['_revisionTracker']['_startingVersion']=_0x327b40,(_0xe163e8['toVersion']===_0xe163e8['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x462b73)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x462b73),this['_revisionTracker']['_createCurrentRevision'](_0x327b40));}const {revisions:_0x3afe79,requestId:_0x5b78c2}=await this['_revisionHistoryService']['reconnect'](_0x2e2b14['connection'],this['_lastRequestId']);_0x511ccc&&_0x3afe79['length']>0x0?_0xe23747['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3afe79),this['_handleRevisionsUpdate'](_0x3afe79,_0x5b78c2),this['_revisionTracker']['sendBufferedUpdates']());};return _0xe23747['_isConnected']?_0x5051d4():new Promise((_0x415282,_0x2099c4)=>{_0xe23747['once']('change:_isConnected',()=>{_0x5051d4()['then'](_0x415282)['catch'](_0x2099c4);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4dcc1d=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x40082f=>{_0x40082f['off'](),_0x4dcc1d();});});}['_getLatestVersionFromServerOperations'](){const _0x25155b=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2149e9 of _0x25155b)if('marker'!==_0x2149e9['type']||_0x2149e9['affectsData'])return _0x2149e9['baseVersion']+0x1;}['_getLatestVersion'](){const _0x42a81a=this['editor']['plugins']['get'](l);return new Promise(_0x253f14=>{_0x42a81a['_isPendingUpdate']?_0x42a81a['once']('change:_isPendingUpdate',()=>{_0x253f14(this['_getLatestVersionFromServerOperations']());}):_0x253f14(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x2546bc,_0x179ec8){const _0x250e57=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x179ec8;for(const _0x568774 of _0x2546bc){const _0xc9220d=_0x250e57['getRevision'](_0x568774['id']);if(_0xc9220d){if((_0x568774['fromVersion']||_0x568774['toVersion'])&&(_0x568774['diffData']=null),_0xc9220d===this['_revisionTracker']['currentRevision']){const _0x119e07=Math['max'](_0xc9220d['toVersion'],_0x568774['toVersion']),_0x11b41c=Math['max'](_0xc9220d['fromVersion'],_0x568774['fromVersion']);let _0x19e3dd;_0xc9220d['toVersion']===_0x568774['toVersion']&&_0xc9220d['fromVersion']===_0x568774['fromVersion']?(_0x19e3dd=!0x0,this['_preventResendingRevisionData'](_0x568774)):_0x568774['toVersion']===_0x119e07&&_0x568774['fromVersion']===_0x11b41c?_0x19e3dd=!0x1:(_0xc9220d['toVersion']===_0x119e07&&_0xc9220d['fromVersion']===_0x11b41c||this['_fixRevision']({'revision':_0xc9220d,'from':_0x11b41c,'to':_0x119e07}),_0x19e3dd=!0x0),_0x19e3dd&&(delete _0x568774['fromVersion'],delete _0x568774['toVersion'],delete _0x568774['diffData'],delete _0x568774['createdAt'],delete _0x568774['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x568774),this['_preventResendingRevisionData'](_0x568774);}else this['_revisionTracker']['addRevisionData'](_0x568774);}const _0x201f08=_0x250e57['getRevisions']();_0x201f08['reverse']();for(let _0xb203e9=0x0;_0xb203e9<_0x201f08['length']-0x1;_0xb203e9++){const _0x29e20b=_0x201f08[_0xb203e9],_0x241cd8=_0x201f08[_0xb203e9+0x1];if(_0x29e20b['fromVersion']<_0x241cd8['toVersion']){const _0x2fddf0=_0x241cd8['toVersion'],_0x9c8fc4=Math['max'](_0x2fddf0,_0x29e20b['toVersion']);this['_fixRevision']({'revision':_0x29e20b,'from':_0x2fddf0,'to':_0x9c8fc4});}}}['_fixRevision']({revision:_0x4c6d3c,from:_0x3dd6dc,to:_0x138086}={}){const _0x3d0b32=this['editor']['plugins']['get'](_0x2cdae6),_0x3a05c8=this['_revisionTracker']['buildRevisionData']({'revision':_0x4c6d3c,'from':_0x3dd6dc,'to':_0x138086});_0x3a05c8['authors']=_0x3a05c8['authorsIds']['map'](_0x4d7f7f=>_0x3d0b32['getUser'](_0x4d7f7f)),_0x4c6d3c['_update'](_0x3a05c8);}['_preventResendingRevisionData'](_0x3b9d2e){const _0x2c1c68={};_0x2c1c68['id']=_0x3b9d2e['id'];for(const _0x1c8ddc of Object['keys'](_0x3b9d2e))'id'!==_0x1c8ddc&&(_0x2c1c68[_0x1c8ddc]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x2c1c68['id'],_0x2c1c68,!0x0);}async['_fetchMissingUsers'](_0xee1b2d){const _0x362eb8=this['editor']['plugins']['get'](_0x2cdae6),{connection:_0x268ea3}=this['editor']['plugins']['get'](n),_0x44bdcb=new Set();for(const _0x57af6e of _0xee1b2d){for(const _0x53d6e9 of _0x57af6e['authorsIds'])_0x307871(_0x53d6e9);_0x57af6e['creatorId']&&_0x307871(_0x57af6e['creatorId']);}if(0x0===_0x44bdcb['size'])return;const _0x234c49=await ut['getMany'](_0x268ea3,Array['from'](_0x44bdcb));for(const _0x48cdff of _0x234c49)_0x362eb8['getUser'](_0x48cdff['id'])||_0x362eb8['addUser'](_0x48cdff);function _0x307871(_0x3a706d){_0x362eb8['getUser'](_0x3a706d)||_0x44bdcb['add'](_0x3a706d);}}}function Z(_0x2d85c8){return _0x2d85c8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x2d85c8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2d85c8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0xa3957f{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x40928d{['_collapseAt'];constructor(_0x313e59,_0xc1d179=0x6){super(_0x313e59);const _0x4d5a2b=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0xc1d179,this['bind']('isHidden')['to'](this,'usersCount',_0x4fb043=>_0x4fb043<_0xc1d179),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4d5a2b['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':_0x4d5a2b['to']('usersCount',_0x5f46c7=>'+'+(_0x5f46c7-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x40928d{['items'];['keystrokes'];constructor(_0x28d0c9){super(_0x28d0c9);const _0x4a599a=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x403085(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x4a599a['if']('hasPopup'),'aria-expanded':_0x4a599a['to']('isExpanded',_0x1be7f6=>this['hasPopup']&&String(_0x1be7f6)),'aria-label':_0x4a599a['to']('hasPopup',_0x4ceed9=>E(_0x28d0c9,_0x4ceed9?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x4a599a['to']('hasPopup',_0x3b3d82=>!!_0x3b3d82&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x4a599a['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x4a599a['to'](_0x56065f=>{const _0x4dec34=_0x56065f,_0x59dc2b=document['querySelector']('.ck-presence-list__dropdown-list'),_0x1d5007=document['querySelector']('.ck-balloon-panel_with-arrow');_0x59dc2b?.['contains'](_0x4dec34['relatedTarget'])||_0x1d5007?.['contains'](_0x4dec34['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x237a7f,_0x56fcbb,_0x4dd65e)=>{this['element']&&(_0x4dd65e?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x40928d{['counterView'];['inlineListView'];constructor(_0x178aaa,_0x3269bf=0x6){super(_0x178aaa);const _0x3dedbc=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x3269bf),this['inlineListView']=new is(_0x178aaa),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0xe2a881 of this['inlineListView']['items'])_0xe2a881['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',_0x3dedbc['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x40928d{['listWrapperView'];constructor(_0x30546b,_0x15c113){super(_0x30546b);const _0x3c192a=this['bindTemplate'];this['listWrapperView']=new wt(_0x30546b,_0x15c113),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':E(_0x30546b,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x3c192a['to'](_0x3fdf0c=>{const _0x10cc90=_0x3fdf0c,_0x421f99=document['querySelector']('.ck-presence-list__list'),_0x40854d=document['querySelector']('.ck-balloon-panel_with-arrow');_0x421f99?.['contains'](_0x10cc90['relatedTarget'])||_0x40854d?.['contains'](_0x10cc90['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0xa396c4{constructor(_0x4caf92,_0x5be498){super(_0x4caf92);const _0x1b5bde=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x5be498?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1b5bde['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1b5bde['to']('role'),'aria-label':_0x1b5bde['to']('ariaLabel'),'aria-labelledby':_0x1b5bde['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x34f2de['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x2947e0=this['element'];_0x2947e0&&(this['_isScrollable']=Math['max'](_0x2947e0['scrollHeight'],_0x2947e0['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x1baca3,_0x24e2b4,_0x3ff23a){super(_0x1baca3);const _0x4afcba=this['bindTemplate'];this['userView']=new ct(_0x1baca3,_0x24e2b4);const _0x5c8ba5={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x24e2b4['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x24e2b4['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x24e2b4['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x3ff23a&&(_0x5c8ba5['tag']='button',_0x5c8ba5['on']={'click':_0x4afcba['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5c8ba5);}['focus'](){this['element']['focus']();}}class A extends _0x40928d{['userView'];['markerView'];constructor(_0x47a063,_0x18a7ad,_0x4a8c9d){super(_0x47a063);const _0x44f9c8=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x47a063,_0x18a7ad),this['markerView']=new lt(_0x47a063,_0x18a7ad);const _0x2b7437=new at(_0x47a063);_0x2b7437['template']['tag']='span',_0x2b7437['text']=_0x18a7ad['name'];const _0x37f1d8={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x44f9c8['to']('isFocusable',_0x5d571=>!!_0x5d571&&0x0),'aria-labelledby':_0x2b7437['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x44f9c8['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x44f9c8['to']('hasTooltip',_0x1f0e60=>!_0x1f0e60),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2b7437]};_0x4a8c9d&&(_0x37f1d8['tag']='button',_0x37f1d8['on']={'click':_0x44f9c8['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x37f1d8);}}class lt extends _0x40928d{constructor(_0x5359e5,_0x2a783a){super(_0x5359e5),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2a783a['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x2d60c1{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39d2be){super(_0x39d2be),this['context']['config']['define']('presenceList',x);const _0x5b12e2=_0x39d2be['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x5b12e2)throw new _0x361cf4('presencelist-collapseat-invalid-format',this);if(_0x5b12e2<0x1)throw new _0x361cf4('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5c1f9a(),this['balloonPanelView']=new _0x584c05(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0xf82f7a of this['_allConnectedUsers'])this['_handleUserAdd'](_0xf82f7a);this['listenTo'](this['_allConnectedUsers'],'add',(_0x53af01,_0x30741e)=>{this['_handleUserAdd'](_0x30741e);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2cf989,_0x279b5d)=>{this['_handleUserRemove'](_0x279b5d);});}['_createView'](){const _0x1248b4=this['context'],_0x480cd9=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xe62264=this['balloonPanelView'];if(!_0x873502(_0x1248b4['config']['get']('presenceList.container')))throw new _0x361cf4('presencelist-missing-container',this);return _0x480cd9['counterView']['bind']('usersCount')['to'](this),_0x480cd9['bind']('isCollapsed')['to'](this,'usersCount',_0x10b1b8=>{const {collapseAt:_0x50b4d8}=_0x1248b4['config']['get']('presenceList'),_0x21e3d2=_0x10b1b8>=_0x50b4d8;if(_0x21e3d2&&!_0x480cd9['inlineListView']['items']['find'](_0x3eb555=>_0x3eb555 instanceof b)){const _0x2e684e=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x2e684e&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x480cd9['inlineListView']['items']['add'](_0x480cd9['counterView']);}return _0x21e3d2||this['hideDropdown'](),_0x21e3d2;}),_0x480cd9['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x2721c9=>{const _0x2f8a7a=_0x1248b4['config']['get']('presenceList'),_0x567a90=new A(_0x1248b4['locale'],_0x2721c9,!!_0x2f8a7a['onClick']);return _0x567a90['bind']('hasTooltip')['to'](_0x480cd9,'isCollapsed',_0xc87040=>!_0xc87040),_0x567a90['bind']('isFocusable')['to'](_0x480cd9,'isCollapsed',_0x116560=>!_0x116560),_0x2f8a7a['onClick']&&this['listenTo'](_0x567a90,'execute',()=>{this['view']['isCollapsed']||_0x2f8a7a['onClick'](_0x2721c9,_0x567a90['element']);}),_0x567a90;}),this['listenTo'](_0x480cd9['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x480cd9['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x480cd9['inlineListView']['keystrokes']['set']('Enter',(_0x497dfe,_0x4c6a29)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4c6a29());}),_0x480cd9['render'](),_0xe62264['render'](),_0x4ad730({'emitter':_0x480cd9,'activator':()=>_0xe62264['isVisible'],'contextElements':[_0xe62264['element'],_0x480cd9['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1248b4['config']['get']('presenceList.container')['appendChild'](_0x480cd9['element']),this['_bodyCollection']=new _0x2d8c37(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x480cd9;}['_handleUserAdd'](_0x15ce7a){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x15ce7a['isMe'])return;const _0x2ef01f=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2ef01f-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x5423c7=_0x15ce7a['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x15ce7a,_0x5423c7);}['_handleUserRemove'](_0x521fb5){this['usersCount']--;const {collapseAt:_0x10e181}=this['context']['config']['get']('presenceList'),_0x5b0f6d=this['usersCount']>=_0x10e181;if(this['currentDisplayedUsers']['get'](_0x521fb5['id']))this['currentDisplayedUsers']['remove'](_0x521fb5['id']);else{if(_0x5b0f6d&&this['currentDisplayedUsers']['length']+0x1===_0x10e181-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x5b0f6d?0x1:0x0)<this['usersCount']){for(const _0x5a8fd4 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5a8fd4['id'])&&(this['currentDisplayedUsers']['add'](_0x5a8fd4,Math['min'](this['currentDisplayedUsers']['length']-(_0x5b0f6d?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x5b0f6d?0x1:0x0)===_0x10e181-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x2ea115=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x2ea115['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x598573}=this['presenceDropdownView'];_0x598573['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x127b75=>{if(!_0x2ea115['displayMe']&&_0x127b75['isMe'])return null;const _0x39fb5b=new j(this['context']['locale'],_0x127b75,!!_0x2ea115['onClick']);return _0x2ea115['onClick']&&this['listenTo'](_0x39fb5b,'execute',()=>{_0x2ea115['onClick'](_0x127b75,_0x39fb5b['element']);}),_0x39fb5b;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x598573['focus'](),_0x598573['checkIfScrollable']();const _0xa84b8f=(_0x3b75bf,_0x70f2e9)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x70f2e9();};_0x598573['keystrokes']['set']('Esc',_0xa84b8f),_0x598573['keystrokes']['set']('Shift+Tab',_0xa84b8f),_0x598573['keystrokes']['set']('Tab',(_0x3442b1,_0x38339d)=>{!function(_0x27bc17){const _0x310111=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x136864=>_0x136864+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x5171ca=[...document['body']['querySelectorAll'](_0x310111)]['filter'](_0x7c76fe=>_0x7c76fe===document['activeElement']||_0x7c76fe['offsetWidth']+_0x7c76fe['offsetHeight']>0x0)['sort']((_0x58966c,_0x303c65)=>(_0x58966c['tabIndex']||0x0)-(_0x303c65['tabIndex']||0x0)),_0x135703=_0x5171ca['indexOf'](_0x27bc17),_0x2adbee=_0x5171ca[(_0x135703+0x1)%_0x5171ca['length']];_0x2adbee&&_0x2adbee['focus']();}(this['view']['element']),this['hideDropdown'](),_0x38339d();}),_0x598573['focusTracker']['add'](this['view']['element']),_0x598573['focusTracker']['on']('change:isFocused',(_0x4b13f6,_0x51c390,_0x1494b5)=>{_0x1494b5||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class vt extends _0x2d60c1{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,vt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,pt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','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.':'','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.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','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.':'','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.':''},'getPluralForm':_0xc5ca31=>0x1!=_0xc5ca31}};
|