@ckeditor/ckeditor5-real-time-collaboration 45.2.0-alpha.7 → 45.2.0
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 +1 -1
- 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
|
-
((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4775e8];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x157d5b){super(_0x157d5b),this['set']('state',_0x4e41a1['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x19722b);}['init'](){const _0x1e8d62=this['context'],_0x48a966=_0x1e8d62['plugins']['get']('CloudServices'),_0x4be19f=_0x1e8d62['plugins']['get'](_0x4775e8);if(!_0x48a966['token'])throw new _0x42186d('websocketgateway-missing-token',this);if(!_0x48a966['webSocketUrl'])throw new _0x42186d('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),c['WebSocketGateway']['connect'](_0x48a966['token'],_0x48a966['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3b7c7a=>{if(this['connection']=_0x3b7c7a,this['bind']('state')['to'](_0x3b7c7a,'state',this,'_isBrowserOffline',(_0x193899,_0x4fca0d)=>('connected'!==_0x193899&&(this['_shouldPluginsReconnect']=!0x0),_0x4fca0d||_0x193899!==_0x4e41a1['CONNECTED']?_0x4e41a1['DISCONNECTED']:this['state']==_0x4e41a1['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x4e41a1['CONNECTING']):_0x4e41a1['CONNECTED'])),this['connection']['on']('error',(_0x5a2ebb,_0x101e47)=>{if('limitExceeded'!==_0x101e47['code'])throw console['error'](_0x101e47),new _0x42186d('cloudservices-init',null,{'originalError':_0x101e47});_0x4be19f['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'});}),!_0x3b7c7a['me'])return new Promise(_0x49c5f8=>_0x3b7c7a['on']('change:me',_0x49c5f8));})['catch'](_0x4d905b=>{throw console['error'](_0x4d905b),new _0x42186d('cloudservices-init',null,{'originalError':_0x4d905b});});}['addToReconnectionStack'](_0x55993d){if('function'!=typeof _0x55993d['reconnect'])throw new _0x42186d('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x55993d))throw new _0x42186d('websocketgateway-plugin-already-registered',this,{'name':_0x55993d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x55993d);}['removeFromReconnectionStack'](_0x43b79c){this['_reconnectionStack']['delete'](_0x43b79c);}['isInReconnectionStack'](_0x1cb4ea){return this['_reconnectionStack']['has'](_0x1cb4ea);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x507431=>_0x507431['reconnect']())))['then'](()=>this['state']=_0x4e41a1['CONNECTED'])['catch'](_0x5e1465=>{throw console['error'](_0x5e1465),new _0x42186d('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x4e41a1['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x6e3cec{['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[c,_0xb8f378];}constructor(_0x363ac1){super(_0x363ac1),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2fd983(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0xb8f378);}['init'](){const _0x154c7f=this['context']['plugins']['get'](c);this['listenTo'](_0x154c7f,'change:state',(_0x2bedf1,_0x4cc26c,_0x214b3b)=>{if('connected'!==_0x214b3b)this['channelSessions']['forEach'](_0x26644c=>_0x26644c['clear']()),this['channelConnectedUsers']['forEach'](_0x369724=>_0x369724['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x67a1f4,_0x14416d]of this['_registeredSessions'])for(const _0x516117 of _0x14416d)this['_handleSessionAdd'](_0x67a1f4,_0x516117);}}),this['_createUser'](_0x154c7f['connection']['me'],!0x0);}['register'](_0x4dd465,_0x4e0d76){if(this['_registeredSessions']['has'](_0x4dd465))throw new _0x42186d('sessions-register-already-registered',null,{'channelId':_0x4dd465});this['_registeredSessions']['set'](_0x4dd465,_0x4e0d76),this['channelSessions']['set'](_0x4dd465,new _0x2fd983()),this['channelConnectedUsers']['set'](_0x4dd465,new _0x2fd983()),this['listenTo'](_0x4e0d76,'add',(_0x5184de,_0x4749c1)=>this['_handleSessionAdd'](_0x4dd465,_0x4749c1)),this['listenTo'](_0x4e0d76,'remove',(_0x255e87,_0x85a88c)=>this['_handleSessionRemove'](_0x4dd465,_0x85a88c));for(const _0x401d0a of _0x4e0d76)this['_handleSessionAdd'](_0x4dd465,_0x401d0a);}['unregister'](_0x2c706b){if(!this['_registeredSessions']['has'](_0x2c706b))throw new _0x42186d('sessions-unregister-not-exist',null,{'channelId':_0x2c706b});const _0x6b6814=this['_registeredSessions']['get'](_0x2c706b);this['stopListening'](_0x6b6814);for(const _0xc7c06a of _0x6b6814)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x2c706b,_0xc7c06a);this['_registeredSessions']['delete'](_0x2c706b),this['channelSessions']['delete'](_0x2c706b),this['channelConnectedUsers']['delete'](_0x2c706b);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0xdd4a03){for(const _0x56ad61 of this['channelSessions']['values']())for(const _0x4f611c of _0x56ad61)if(_0x4f611c['id']===_0xdd4a03)return _0x4f611c['user'];}['getUserSessions'](_0x284412,_0x44a817){const _0x3231ab=_0x44a817?[this['channelSessions']['get'](_0x44a817)]:this['channelSessions']['values'](),_0x1fda95=new Set();for(const _0x56e646 of _0x3231ab)for(const _0x1c0f78 of _0x56e646)_0x1c0f78['user']['id']===_0x284412['id']&&_0x1fda95['add'](_0x1c0f78['id']);return _0x1fda95;}['getUserRole'](_0x564c65){for(const _0x345e8e of this['channelSessions']['values']())for(const _0x962415 of _0x345e8e)if(_0x962415['user']===_0x564c65)return _0x962415['role'];}['_handleSessionAdd'](_0x203019,_0x23d374){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x282a11=_0x23d374['user'],_0x82c496=this['_users']['getUser'](_0x282a11['id'])||this['_createUser'](_0x282a11),_0x5d7f99=Object['assign']({},_0x23d374,{'user':_0x82c496});this['channelSessions']['get'](_0x203019)['add'](_0x5d7f99);const _0x1db735=this['channelConnectedUsers']['get'](_0x203019);_0x1db735['has'](_0x82c496['id'])||_0x1db735['add'](_0x82c496),this['allConnectedUsers']['has'](_0x82c496['id'])||this['allConnectedUsers']['add'](_0x82c496,_0x82c496['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x203019,{'channelId':_0x203019,'session':_0x5d7f99});}['_handleSessionRemove'](_0x3354a8,_0x159939){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x1abfd2=this['channelConnectedUsers']['get'](_0x3354a8),_0x50fb3f=_0x159939['user'];_0x50fb3f['id']&&(this['channelSessions']['get'](_0x3354a8)['remove'](_0x159939['id']),_0x1abfd2['has'](_0x50fb3f['id'])&&!this['getUserSessions'](_0x50fb3f,_0x3354a8)['size']&&_0x1abfd2['remove'](_0x50fb3f['id']),this['allConnectedUsers']['get'](_0x50fb3f['id'])&&!this['getUserSessions'](_0x50fb3f)['size']&&this['allConnectedUsers']['remove'](_0x50fb3f['id']));}['_createUser'](_0x1f1d31,_0x2a7e81){const _0x3ca1ec=this['_users']['addUser'](_0x1f1d31);return _0x2a7e81&&this['_users']['defineMe'](_0x1f1d31['id']),_0x3ca1ec['orderNumber']=this['_uniqueUsersCount']++,_0x3ca1ec;}}class q extends _0x2d3c3d{['_domEmitter']=new(_0x19722b())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4f273f=this['editor'],_0x37caba=_0x4f273f['plugins']['get'](i);_0x4f273f['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x854b3c,{writer:_0x254c54})=>function(_0x3286e7,_0x21e841,_0x35c618,_0x1da4df){const _0x1933f0=_0x3286e7['markerName']['split'](':')[0x2],_0x2da2e8=_0x35c618['getUserBySessionId'](_0x1933f0);if(!_0x2da2e8||_0x1933f0===_0x35c618['mySessionId'])return;if(!_0x1da4df['model']['schema']['checkChild'](_0x3286e7['markerRange']['start'],'$text'))return;const _0x22196a={'class':'ck-user__marker\x20'+_0x2da2e8['color']['getMarkerClass'](),'data-name':_0x2da2e8['name'],'data-session-id':_0x1933f0},_0x371e33=_0x1da4df['model']['markers']['get'](_0x3286e7['markerName']),_0x277b8a=_0x371e33['getStart'](),_0x3404fa=_0x277b8a['nodeAfter'],_0x48e5fe=_0x1da4df['model']['schema'];if(_0x3404fa&&_0x48e5fe['isObject'](_0x3404fa)&&_0x48e5fe['isInline'](_0x3404fa)&&!_0x1da4df['model']['markers']['get']('user:range:'+_0x1933f0)['getRange']()['isCollapsed'])return;const _0x2e49ce=_0x277b8a['parent'];return _0x1da4df['model']['schema']['isLimit'](_0x2e49ce)&&!_0x1da4df['model']['hasContent'](_0x2e49ce)&&(_0x22196a['contenteditable']=!0x1),function(_0x453c9e,_0x422480,_0xbc1bb6){const _0x323d9a=_0x453c9e['createUIElement']('span',_0x422480);return _0x453c9e['setCustomProperty']('userPositionMarker',!0x0,_0x323d9a),_0x323d9a['render']=function(_0x48cf51){const _0x494b06=this['toDomElement'](_0x48cf51),_0x6ceaeb=document['createElement']('span');return _0x6ceaeb['classList']['add']('ck-user__marker-tooltip'),_0x6ceaeb['setAttribute']('contenteditable','false'),_0x6ceaeb['setAttribute']('spellcheck','false'),_0x6ceaeb['textContent']=_0xbc1bb6['name'],_0x494b06['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x6ceaeb['outerHTML']+'',_0x494b06['addEventListener']('mouseenter',()=>{_0x494b06['classList']['add']('ck-user__marker_hovered');}),_0x494b06['addEventListener']('mouseleave',()=>{_0x494b06['classList']['remove']('ck-user__marker_hovered');}),_0x494b06;},_0x323d9a['isSimilar']=function(_0x269780){return!(!this['getCustomProperty']('userPositionMarker')||!_0x269780['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x269780['getAttribute']('data-session-id'));},_0x323d9a;}(_0x21e841,_0x22196a,_0x2da2e8);}(_0x854b3c,_0x254c54,_0x37caba,_0x4f273f)}),_0x4f273f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3f8f6c=>function(_0x182eff,_0x3c188b){const _0x3412e9=_0x182eff['markerName']['split'](':')[0x2];if(_0x3412e9===_0x3c188b['mySessionId'])return null;const _0x346030=_0x3c188b['getUserBySessionId'](_0x3412e9);if(!_0x346030)return{'id':_0x3412e9,'classes':[]};return{'id':_0x3412e9,'classes':['ck-user__selection',_0x346030['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3412e9},'priority':0x7d0+_0x346030['orderNumber']};}(_0x3f8f6c,_0x37caba)}),function(_0x20f735){const _0x260b66=_0x20f735['model'],_0x38a500=new Map(),_0x47062a=_0x20f735['plugins']['get'](i);_0x260b66['markers']['on']('update:user:range',(_0x72283,_0x2ad813,_0x3454a2,_0x4519ad)=>{if(!_0x4519ad&&_0x38a500['get'](_0x2ad813['name']))return _0x38a500['get'](_0x2ad813['name'])['detach'](),void _0x38a500['delete'](_0x2ad813['name']);const _0x2a1c04=_0x2ad813['name']['split'](':')[0x2];if(_0x2a1c04===_0x47062a['mySessionId'])return;const _0x361444='user:position:'+_0x2a1c04;_0x260b66['markers']['has'](_0x361444)&&_0x20f735['editing']['reconvertMarker'](_0x361444),_0x2ad813['on']('change:range',(_0x32c1c7,_0x1e1ba4,_0x1d4a67)=>{if('$graveyard'!=_0x1e1ba4['root']['rootName']&&'$graveyard'==_0x2ad813['getRange']()['root']['rootName']&&!_0x38a500['has'](_0x2ad813['name'])){const _0x25e334=_0x260b66['schema']['getNearestSelectionRange'](_0x1d4a67['deletionPosition']);if(_0x25e334){const _0x3d7469=ht['fromRange'](_0x25e334);_0x38a500['set'](_0x2ad813['name'],_0x3d7469),_0x3d7469['on']('change:range',(_0x4e091b,_0x1fd8e1,_0x57e8ac)=>{if('$graveyard'==_0x3d7469['root']['rootName']){const _0x162001=_0x260b66['schema']['getNearestSelectionRange'](_0x57e8ac['deletionPosition']);_0x162001?(_0x3d7469['start']=_0x162001['start'],_0x3d7469['end']=_0x162001['end']):(_0x38a500['delete'](_0x2ad813['name']),_0x3d7469['detach']());}});}}});}),_0x260b66['document']['on']('change',()=>{_0x38a500['size']>0x0&&_0x260b66['enqueueChange']({'isUndoable':!0x1},_0x28004e=>{for(const [_0x359fad,_0x54865e]of _0x38a500)'$graveyard'==_0x260b66['markers']['get'](_0x359fad)['getRange']()['root']['rootName']&&(te(_0x359fad['split'](':')[0x2],_0x54865e['toRange'](),_0x260b66,_0x28004e),_0x54865e['detach']());_0x38a500['clear']();});});}(_0x4f273f),this['_domEmitter']['listenTo'](_0x17d00d['document'],'keydown',(_0x3b69b1,{key:_0x35f8e4})=>{'Escape'===_0x35f8e4&&function(_0x4464d6){_0x4464d6['editing']['view']['change'](_0x3d5663=>{for(const _0xaf2664 of _0x4464d6['model']['markers']){if(!_0xaf2664['name']['startsWith']('user:position'))continue;const _0xec2037=_0x4464d6['editing']['mapper']['markerNameToElements'](_0xaf2664['name']);if(_0xec2037){for(const _0x3c9df3 of _0xec2037)_0x3d5663['removeClass']('ck-user__marker_hovered',_0x3c9df3);}}});}(_0x4f273f);},{'useCapture':!0x0});}['afterInit'](){const _0x50992c=this['editor'],_0x11addc=_0x50992c['commands']['get']('undo');_0x11addc&&_0x50992c['model']['on']('applyOperation',(_0x4aef53,_0x3c2430)=>{const _0x2f99a3=_0x3c2430[0x0];if(!_0x2f99a3['isDocumentOperation'])return;if('marker'!=_0x2f99a3['type']||!_0x2f99a3['name']['startsWith']('user:'))return;const _0x3911aa=_0x2f99a3['batch'];_0x11addc['_createdBatches']['has'](_0x3911aa)&&(_0x2f99a3['newRange']=_0x2f99a3['oldRange']?_0x50992c['model']['createRange'](_0x2f99a3['oldRange']['start'],_0x2f99a3['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3b3b29=this['editor'],_0x51d9b0=_0x3b3b29['model']['document'],_0x117826=_0x3b3b29['plugins']['get'](i);_0x3b3b29['model']['enqueueChange']({'isUndoable':!0x1},_0x4ffb31=>{const _0x1eb968='user:range:'+_0x117826['mySessionId'],_0xe70ff9='user:position:'+_0x117826['mySessionId'],_0x43822=_0x3b3b29['model']['markers']['has'](_0x1eb968);_0x3b3b29['editing']['view']['hasDomSelection']?te(_0x117826['mySessionId'],_0x51d9b0['selection']['getFirstRange'](),_0x3b3b29['model'],_0x4ffb31):_0x43822&&(_0x4ffb31['removeMarker'](_0x1eb968),_0x4ffb31['removeMarker'](_0xe70ff9));});}}function te(_0xe3939c,_0x21b508,_0x466b85,_0x1280ec){const _0xd1e5b8='user:range:'+_0xe3939c,_0x383c31='user:position:'+_0xe3939c,_0x49e6c3=_0x21b508['getContainedElement']();let _0x120eaa=_0x21b508['start'];if(_0x49e6c3&&_0x49e6c3['is']('element','tableCell')){const _0x4940ab=function(_0x805ae8,_0x238ffb){for(const _0x33965f of _0x805ae8['getPositions']())if(_0x238ffb['schema']['checkChild'](_0x33965f,'$text'))return _0x33965f;}(_0x21b508,_0x466b85);_0x4940ab&&(_0x120eaa=_0x4940ab,_0x21b508=_0x1280ec['createRange'](_0x120eaa));}const _0x279eeb=_0x1280ec['createRange'](_0x120eaa);_0x466b85['markers']['has'](_0xd1e5b8)?(_0x1280ec['updateMarker'](_0xd1e5b8,{'range':_0x21b508}),_0x1280ec['updateMarker'](_0x383c31,{'range':_0x279eeb})):(_0x1280ec['addMarker'](_0xd1e5b8,{'range':_0x21b508,'usingOperation':!0x0}),_0x1280ec['addMarker'](_0x383c31,{'range':_0x279eeb,'usingOperation':!0x0}));}function G(_0x2160a7,_0x49a6ac,_0x5b9ddf){const _0x10cb0f=_0x2160a7['t'],t=_0x2160a7['t'];switch(_0x49a6ac){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 _0x10cb0f({'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'},_0x5b9ddf);default:return'';}}let J=0x1;class l extends _0x2d3c3d{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x3be59a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,q,_0x198b2a,_0xb8f378,_0x4775e8];}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 _0x44dd28=this['serverHistory']['getOperations']();for(let _0x5a4cc6=_0x44dd28['length']-0x1;_0x5a4cc6>=0x0;_0x5a4cc6--){const _0x1291ff=_0x44dd28[_0x5a4cc6];if(!this['_disconnectionOperations']['has'](_0x1291ff))return _0x1291ff['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x217c3a){if(super(_0x217c3a),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x2d6d08(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x42186d('collaboration-missing-channelid',this);const _0x4ddd88=_0x217c3a['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x4ddd88,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x3c22ea(),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 Y(this['_disconnectionOperations']);}['init'](){const _0x35c916=this['editor'],_0x4dbe79=_0x35c916['plugins']['get'](_0xb8f378),_0x2bfde0=_0x35c916['plugins']['get'](c);this['listenTo'](_0x4dbe79,'getOperationAuthor',(_0x4cc6ca,_0xd11c9f)=>{const _0x1b3d4a=_0xd11c9f[0x0];_0x1b3d4a['_authorId']&&(_0x4cc6ca['return']=_0x4dbe79['getUser'](_0x1b3d4a['_authorId']),_0x4cc6ca['stop']()),null===_0x1b3d4a['_authorId']&&(_0x4cc6ca['return']=null,_0x4cc6ca['stop']());},{'priority':'high'}),this['listenTo'](_0x35c916['model']['document']['selection'],'change:range',(_0xa0bc96,_0x31b7ef)=>{_0x31b7ef['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x35c916['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x35c916['model']['on']('applyOperation',(_0x54057a,_0x3f835d)=>{const _0x2b4769=_0x3f835d[0x0];_0x2b4769['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2b4769),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2bfde0,'state',this,'_hasSynchronizationProblem',(_0x346a4c,_0x4df4f8)=>'connected'===_0x346a4c&&!_0x4df4f8),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x35c916['disableReadOnlyMode']('rtc-offline'):_0x35c916['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x35c916['disableReadOnlyMode']('rtc-offline'):_0x35c916['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5efe81=this['editor']['plugins']['get'](i),_0x6e2367=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x5efe81['unregister'](this['_channelId']);const _0x2dd901=await this['_service']['reconnect'](_0x6e2367['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x2dd901)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1f8c2a=await this['_service']['getConnectedSessions']();_0x5efe81['register'](this['_channelId'],_0x1f8c2a),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x1f9344){if(function(_0x9b1e4){return'404'===_0x9b1e4['code'];}(_0x1f9344)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x14b323){return'409'===_0x14b323['code'];}(_0x1f9344)){const _0x1768f3=G(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'](_0x1768f3);}else{if(!(_0x1f9344 instanceof Q))throw _0x1f9344;this['_handleReconnectionError']();}}}}['destroy'](){const _0xf0d283=this['editor']['plugins']['get'](c),_0x433bea=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x433bea['channelSessions']['has'](this['_channelId'])&&_0x433bea['unregister'](this['_channelId']),_0xf0d283['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4a08b5){if(this['sessionId']!==_0x4a08b5['sessionId']&&this['_lastSyncedOperationId']!==_0x4a08b5['lastOperationId'])throw new Q();return this['sessionId']=_0x4a08b5['sessionId'],this['_handleServerResponse']([],{..._0x4a08b5,'wereChangesApplied':!0x1,'data':_0x4a08b5['data']},'reconnect');}async['_connectService'](_0x4dbcf7,_0x59a443=!0x1){const {connection:_0x36682e}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x36682e,this['_channelId'])['then'](_0x24b860=>this['_initSessionsHandling'](_0x24b860))['catch'](_0x5a4f87=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5a4f87);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x2de53b,_0x523e1a)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x523e1a);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x25cad0=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4dbcf7);this['_isPendingUpdate']=!0x0;const _0xb9d01f=await this['_service']['connect'](_0x36682e,this['_compressOperations'](_0x4dbcf7),_0x25cad0);if(this['sessionId']=_0xb9d01f['sessionId'],_0x59a443){if(!_0xb9d01f['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xb9d01f['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4dbcf7,_0xb9d01f,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xb9d01f,_0x4dbcf7);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x15053c=this['editor']['plugins']['get'](i),_0x51e5d0=this['editor']['plugins']['get'](q),_0x57b3ac=_0x15053c['channelSessions']['get'](this['_channelId']);_0x57b3ac&&_0x57b3ac['length']>0x1?_0x51e5d0['createUserMarkerOperations']():this['listenTo'](_0x15053c,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x15053c['channelSessions']['get'](this['_channelId'])['length']&&_0x51e5d0['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x342a71,_0x2d680e,_0x528852,_0x323577){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2d680e){const _0x208267=this['_decompressOperations'](_0x528852,_0x323577);await this['_fetchMissingUsers'](_0x208267),this['_handleExternalOperations'](_0x208267,_0x2d680e,_0x528852['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x331956}=this['editor'];let _0x1eb9f2;try{_0x1eb9f2=await this['_service']['getDocumentDetails']();}catch{const _0x4f898d=G(_0x331956,'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'](_0x4f898d);}const _0x181712=_0x1eb9f2['currentDocumentSession']||_0x1eb9f2['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x181712['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x434ff1=G(_0x331956,'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.');this['_handleReconnectionError'](_0x434ff1);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x32abf3){const _0x126fb0=this['editor']['plugins']['get'](i);this['listenTo'](_0x126fb0,'sessionAdd:'+this['_channelId'],(_0x320002,{session:_0x5d4e69})=>{if(_0x5d4e69['id']===_0x126fb0['mySessionId']){_0x320002['off']();const _0x16b11e=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x23b794=_0x5d4e69['permissions'];_0x16b11e&&_0x16b11e['isEnabled']&&(_0x23b794=_0x23b794['filter'](_0xe890a0=>'document:write'!==_0xe890a0)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x23b794,this['_channelId']);}}),_0x126fb0['register'](this['_channelId'],_0x32abf3);}['_initThrowingOnDataSet'](){const _0x3146b7=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2a95db)=>{if(!_0x2a95db[_0x2a95db['length']-0x1]['suppressErrorInCollaboration'])throw new _0x42186d('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3146b7['apply'](this['editor']['data'],_0x2a95db);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x56c998,[_0x57b49b])=>{if(this['_document']['version'])throw new _0x42186d('realtimecollaborationclient-init-document-already-initialized',this);_0x56c998['stop'](),this['_setPendingAction']();const _0xa38023=this['editor']['config']['get']('rootsAttributes'),_0x2d157a=this['_getOperationsFromInitData'](_0x57b49b,_0xa38023);0x0==_0x2d157a['length']&&_0x2d157a['push'](new _0x9a9dca(0x0)),_0x56c998['return']=this['_connectService'](_0x2d157a)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3d0dc7=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3d0dc7))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x520532,[_0x1decfe,_0x1b16f4])=>{_0x520532['stop']();const _0xa5db2f=this['editor']['model']['document']['getRoot'](_0x1decfe);if(!this['_knownRootNames']['has'](_0x1decfe)){const _0x208223=_0x1b16f4&&_0x1b16f4['data']?_0x1b16f4['data']:'',_0x5c5958=_0x1b16f4&&_0x1b16f4['attributes']?_0x1b16f4['attributes']:{};await this['_loadRoot'](_0x1decfe,_0x208223,_0x5c5958);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0xa5db2f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0xa5db2f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x6e4728){const _0x166e7a=this['editor']['plugins']['get'](_0xb8f378),{connection:_0x1e0f41}=this['editor']['plugins']['get'](c),_0x64981f=new Set();for(const _0x4f3eee of _0x6e4728){const _0x3079cb=_0x4f3eee['_authorId'];_0x3079cb&&!_0x166e7a['getUser'](_0x3079cb)&&_0x64981f['add'](_0x3079cb);}if(0x0===_0x64981f['size'])return;const _0x2b29a4=await dt['getMany'](_0x1e0f41,Array['from'](_0x64981f));for(const _0xd549ea of _0x2b29a4)_0x166e7a['getUser'](_0xd549ea['id'])||_0x166e7a['addUser'](_0xd549ea);}['_getOperationsFromInitData'](_0x5bee2d,_0x4eecca={}){const _0x28f7fa=this['editor']['model'],_0x6aa9ef=[];let _0x28f34d=0x0;const _0x195ed4='string'==typeof _0x5bee2d?{'main':_0x5bee2d}:_0x5bee2d;for(const _0x50a8f4 of Object['keys'](_0x195ed4)){if(!this['_document']['roots']['has'](_0x50a8f4))throw new _0x42186d('realtimecollaborationclient-init-non-existent-root',this);const _0xeff023=this['editor']['data']['parse'](_0x195ed4[_0x50a8f4]),_0x1f075c=this['_document']['getRoot'](_0x50a8f4),_0x444b15=new _0x4536dc(_0x28f7fa['createPositionAt'](_0x1f075c,0x0),_0xeff023,_0x28f34d++);_0x6aa9ef['push'](_0x444b15);for(const [_0x4e063d,_0x4772e8]of _0xeff023['markers']){const _0x2f859c=_0x28f7fa['createRange'](_0x28f7fa['createPositionFromPath'](_0x1f075c,_0x4772e8['start']['path']['slice']()),_0x28f7fa['createPositionFromPath'](_0x1f075c,_0x4772e8['end']['path']['slice']())),_0x5627b0=new _0x226fed(_0x4e063d,null,_0x2f859c,_0x28f7fa['markers'],!0x0,_0x28f34d++);_0x6aa9ef['push'](_0x5627b0);}}if(_0x4eecca)for(const [_0x197f87,_0x565d12]of Object['entries'](_0x4eecca)){const _0x2104b8=_0x28f7fa['document']['getRoot'](_0x197f87);if(!_0x2104b8)throw new _0x42186d('multi-root-editor-root-attributes-no-root',null);for(const [_0x4a41b0,_0x19b686]of Object['entries'](_0x565d12))if(null!==_0x19b686){const _0x437e01=new _0x2c43ba(_0x2104b8,_0x4a41b0,null,_0x19b686,_0x28f34d++);_0x6aa9ef['push'](_0x437e01);}}return _0x6aa9ef;}async['_loadRoot'](_0x51868e,_0x44e3aa,_0x15a1ef){this['_getOperationsFromInitData']({[_0x51868e]:_0x44e3aa},{[_0x51868e]:_0x15a1ef})['forEach']((_0x182a31,_0x520748)=>{_0x182a31['baseVersion']=this['_document']['version']+_0x520748,_0x182a31['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x182a31);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x406d84,_0x2d3153){let _0x24c9da;this['_offset']=_0x406d84['offset'];const _0x5cae5c=_0x406d84['wereChangesApplied']&&!_0x406d84['initData'],_0x34209e=_0x5cae5c?0x0:_0x406d84['data']['baseVersion'];if(_0x2d3153['forEach'](_0x37b9c9=>{_0x37b9c9['_isInit']=!0x0,_0x37b9c9['createdAt']=_0x406d84['sessionCreatedAt'],_0x37b9c9['_authorId']=null;}),_0x5cae5c)_0x24c9da=_0x2d3153,this['_applyOperationsSet'](_0x24c9da,_0x5cae5c);else{if(_0x406d84['initData']){const _0x3346ec=this['_getOperationsFromInitData'](_0x406d84['initData']);this['_document']['history']['version']=-_0x3346ec['length'],_0x3346ec['forEach'](_0x40c5dc=>{_0x40c5dc['baseVersion']-=_0x3346ec['length'],_0x40c5dc['createdAt']=_0x406d84['sessionCreatedAt'],_0x40c5dc['_isInit']=!0x0,_0x40c5dc['_authorId']=null;}),this['_applyOperationsSet'](_0x3346ec,!0x0),this['serverHistory']['version']=-_0x3346ec['length']+this['_offset'],this['_updateServerHistory'](_0x3346ec);}this['_document']['history']['version']=_0x34209e,_0x24c9da=this['_decompressOperations'](_0x406d84['data'],_0x406d84['metadata']),await this['_fetchMissingUsers'](_0x24c9da),this['_applyOperationsSet'](_0x24c9da,_0x5cae5c);}_0x406d84['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x24c9da,_0x406d84['lastOperationId']),this['_lastSyncedOperationId']=_0x406d84['lastOperationId']),this['serverHistory']['version']=_0x34209e+this['_offset'],this['_updateServerHistory'](_0x24c9da),_0x2d3153['filter'](_0x4189ca=>{const _0x26eb94=this['_getAffectedRoot'](_0x4189ca);return _0x26eb94&&!this['_knownRootNames']['has'](_0x26eb94);})['forEach']((_0x356695,_0x31f78a)=>{_0x356695['baseVersion']=this['_document']['version']+_0x31f78a,this['_saveOperationInBuffer'](_0x356695);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x27990d,_0x5f4f0f){const _0x89b3a8=_0x5f4f0f&&_0x5f4f0f['message'];if(_0x89b3a8&&_0x89b3a8['startsWith']('realtimecollaborationclient'))throw _0x5f4f0f;const _0x37f7a8=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x37f7a8['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x42186d(_0x27990d,this['editor'],_0x89b3a8?{'originalError':_0x89b3a8}:void 0x0);}['_saveOperationInBuffer'](_0x26273b){this['_knownOperations']['has'](_0x26273b)||(this['_knownOperations']['add'](_0x26273b),this['_bufferedOperations']['push'](_0x26273b),this['_pendingAction']||'marker'==_0x26273b['type']&&!_0x26273b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x1764d0=!0x1){!_0x1764d0&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xbc0f77=>{_0xbc0f77&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0xf37a2f=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x2b5694){return _0x2b5694['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2b5694['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2b5694['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0xf37a2f)||this['_crash'](_0xf37a2f['message'],_0xf37a2f);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x480694=>{this['on']('change:_isPendingUpdate',()=>{_0x480694();});});}async['_sendBufferedOperations'](){const _0x37114a=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x37114a['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x38c329=[...this['_bufferedOperations']];for(const _0x29bcb6 of _0x38c329)_0x29bcb6['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x29bcb6);const _0x59b19e=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x38c329),_0x533f11=J++,_0x47c914=this['_compressOperations'](_0x38c329),_0x160b1b=await this['_service']['sendOperations'](_0x47c914,_0x47c914['baseVersion'],_0x59b19e);try{return await this['_handleServerResponse'](_0x38c329,_0x160b1b,_0x533f11);}catch(_0x456a5c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x456a5c);}}async['_handleServerResponse'](_0x4f6039,_0x18716a,_0x4855ff){if('error'in _0x18716a)throw _0x18716a['error'];let _0x2d4634=!0x1;if(_0x18716a['wereChangesApplied']){_0x18716a['lastOperationId']&&(this['_lastSyncedOperationId']=_0x18716a['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x197a9f=>!_0x4f6039['includes'](_0x197a9f));for(const _0x3ca634 of _0x4f6039)_0x3ca634['createdAt']='lastOperationAcceptedAt'in _0x18716a&&_0x18716a['lastOperationAcceptedAt']||void 0x0;X(_0x4f6039,_0x18716a['version']-_0x4f6039['length']),this['_updateServerHistory'](_0x4f6039);const _0x47c49c=_0x4f6039['filter'](_0xcd0751=>{if(!_0xcd0751['_isInit'])return!0x1;const _0x5d43c5=this['_getAffectedRoot'](_0xcd0751);return _0x5d43c5&&!this['_knownRootNames']['has'](_0x5d43c5);});X(_0x47c49c,this['_document']['version']),this['_applyOperationsSet'](_0x47c49c),_0x2d4634=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x4b0eae=this['_decompressOperations'](_0x18716a['data'],_0x18716a['metadata'])['filter'](_0x4aaf92=>_0x4aaf92['baseVersion']>=this['_lastServerVersion']);_0x4b0eae['forEach'](_0x1aa55c=>this['_addKnownRoot'](_0x1aa55c)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5f4498=>!_0x5f4498['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5f4498))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x4b0eae),_0x2d4634=this['_handleExternalOperations'](_0x4b0eae,_0x18716a['version'],_0x18716a['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x2d4634?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x43d81b,_0x313654,_0x149013){try{const _0x26e3df={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2e06a4,operationsB:_0x9cfce5,originalOperations:_0x3ef869}=_0x138667(_0x43d81b,this['_bufferedOperations'],_0x26e3df);X(_0x2e06a4,this['_document']['version']),X(_0x9cfce5,_0x313654);for(const _0x4ba2e6 of _0x2e06a4){const _0x25327e=_0x3ef869['get'](_0x4ba2e6);_0x4ba2e6['_authorId']=_0x25327e?_0x25327e['_authorId']:null;}_0x149013&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x43d81b,_0x149013),this['_lastSyncedOperationId']=_0x149013),this['_bufferedOperations']=[..._0x9cfce5],this['_applyOperationsSet'](_0x2e06a4),this['_updateServerHistory'](_0x43d81b);}catch(_0x3decb0){return console['error'](_0x3decb0),!0x1;}return!0x0;}['_applyOperationsSet'](_0x42ada7,_0x218b17=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3db3c3=>{for(const _0x471a47 of _0x42ada7)this['_knownOperations']['add'](_0x471a47),this['_addKnownRoot'](_0x471a47),_0x3db3c3['batch']['addOperation'](_0x471a47),this['editor']['model']['applyOperation'](_0x471a47);});}['_addKnownRoot'](_0x5dd61a){const _0x72b09d=this['_getAffectedRoot'](_0x5dd61a);_0x72b09d&&this['_knownRootNames']['add'](_0x72b09d);}['_getAffectedRoot'](_0x24069a){let _0x50306b,_0x259174;switch(_0x24069a['type']){case'insert':_0x50306b=_0x24069a['position']['root'];break;case'marker':if(_0x259174=_0x24069a['newRange'],!_0x259174)return null;_0x50306b=_0x259174['root'];break;case'addRootAttribute':_0x50306b=_0x24069a['root'];break;case'addRoot':_0x50306b=_0x24069a['affectedSelectable'];break;case'move':_0x50306b=_0x24069a['targetPosition']['root'];break;default:return null;}return _0x50306b['rootName'];}['_updateServerHistory'](_0x35058f){_0x35058f['forEach'](_0x41f4c4=>{const _0x358508=_0x41f4c4['clone']();_0x358508['_authorId']=_0x41f4c4['_authorId'],_0x358508['_isInit']=!!_0x41f4c4['_isInit'],_0x358508['createdAt']=_0x41f4c4['createdAt'],_0x358508['baseVersion']+=this['_offset'],_0x41f4c4['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x358508),this['serverHistory']['addOperation'](_0x358508);});}['_handleReconnectionError'](_0x3b7e56){const _0x2b60e5=this['editor']['plugins']['get']('Notification'),_0xa1c37b=this['editor']['locale'];_0x3b7e56||(_0x3b7e56=G(_0xa1c37b,'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.')),_0x2b60e5['showWarning'](_0x3b7e56,{'title':G(_0xa1c37b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x198b2a)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x198b2a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x58f241){const _0x102a18=_0x58f241['map'](_0x42f0ff=>_0x42f0ff['toJSON']());return this['_compressor']['compress'](_0x102a18);}['_decompressOperations'](_0xbeadac,_0x5aca23){return this['_compressor']['decompress'](_0xbeadac)['map']((_0x586cde,_0x1b7d9f)=>{const _0x29701e='init'==_0x5aca23[_0x1b7d9f]['type'];if('InsertOperation'==_0x586cde['__className']){const _0x133168=_0x586cde['position']['root'];!this['_document']['getRoot'](_0x133168)&&(this['_document']['createRoot']('$root',_0x133168)['_isAttached']=!0x1);}const _0x3e16bf=_0x48a87d['fromJSON'](_0x586cde,this['_document']);return _0x3e16bf['wasUndone']=_0x586cde['wasUndone'],_0x3e16bf['_isInit']=_0x29701e,_0x3e16bf['_authorId']=_0x29701e?null:_0x5aca23[_0x1b7d9f]['userId'],_0x3e16bf['_isDisconnection']='cs:removeUser'===_0x5aca23[_0x1b7d9f]['type'],_0x3e16bf['createdAt']=_0x5aca23[_0x1b7d9f]['createdAt'],_0x3e16bf;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x46750c=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x46750c&&_0x46750c['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x2e8a7a,_0x5412b5){for(const _0x2d8294 of _0x2e8a7a)_0x2d8294['baseVersion']=_0x5412b5++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x210026){this['_ignoredOperations']=_0x210026,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x1e5c34){let _0x4cbbd4=_0x1e5c34['length'];for(;_0x4cbbd4--;){const _0x1882d9=_0x1e5c34[_0x4cbbd4];if(!this['_ignoredOperations']['has'](_0x1882d9)){if(!this['_operationToId']['has'](_0x1882d9)){const _0x108db7=_0x401110()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1882d9,_0x108db7);}return this['_operationToId']['get'](_0x1882d9);}}}['setIdForTheLastOperation'](_0x3cac63,_0x42cce2){if(!_0x42cce2)return;let _0x5ab31d=_0x3cac63['length'];for(;_0x5ab31d--;){const _0x372c50=_0x3cac63[_0x5ab31d];this['_ignoredOperations']['has'](_0x372c50)||this['_operationToId']['set'](_0x372c50,_0x42cce2);}}}class n extends _0x2d3c3d{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x6e3cec{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x20bf0f)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0xb8f378];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x111dc5){super(_0x111dc5),this['_services']=new Map();}async['init'](){const _0x4a8d04=this['context'],_0x129c9c=_0x4a8d04['plugins']['get']('CommentsRepository');if(_0x4a8d04['plugins']['get'](c)['addToReconnectionStack'](this),_0x129c9c['adapter']={'addCommentThread':async({channelId:_0x5aebef,threadId:_0x22108d,comments:_0x247a37,resolvedAt:_0x4f289e,resolvedBy:_0x432163,context:_0x1112ae,attributes:_0x40ac06})=>{const _0x582699=await this['_getService'](_0x5aebef)['addCommentThread']({'commentThreadId':_0x22108d,'comments':_0x247a37['map'](_0x55d52a=>function(_0xd323c6,_0x16e105,_0x39fdaa){return{'commentThreadId':_0x39fdaa,'commentId':_0xd323c6['commentId'],'userId':_0xd323c6['authorId'],'content':_0xd323c6['content'],'documentId':_0x16e105,'createdAt':_0xd323c6['createdAt'],'attributes':_0xd323c6['attributes']||{}};}(_0x55d52a,_0x5aebef,_0x22108d)),'resolvedAt':_0x4f289e,'resolvedBy':_0x432163,'context':_0x1112ae,'attributes':_0x40ac06})['catch'](ut);return{'threadId':_0x582699['commentThreadId'],'comments':_0x582699['comments']};},'getCommentThread':async({channelId:_0x45fa80,threadId:_0x108283})=>{const _0x157148=await this['_getService'](_0x45fa80)['getCommentThread'](_0x108283)['catch'](ut);return _0x157148['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x157148]),{'threadId':_0x157148['commentThreadId'],'comments':_0x157148['comments']['map'](_),'context':_0x157148['context'],'resolvedAt':_0x157148['resolvedAt'],'resolvedBy':_0x157148['resolvedBy'],'attributes':_0x157148['attributes']||{}});},'updateCommentThread':async({channelId:_0x24dcfd,threadId:_0x41931e,context:_0x361935,unlinkedAt:_0x1f32cc,attributes:_0x22836a})=>this['_getService'](_0x24dcfd)['updateCommentThread']({'commentThreadId':_0x41931e,'context':_0x361935,'attributes':_0x22836a,'unlinkedAt':_0x1f32cc})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x29e630,threadId:_0x4df2eb})=>{const _0x2e2b7e=await this['_getService'](_0x29e630)['resolveCommentThread'](_0x4df2eb)['catch'](S)['catch'](ut);return{'threadId':_0x2e2b7e['commentThreadId'],'resolvedAt':_0x2e2b7e['resolvedAt'],'resolvedBy':_0x2e2b7e['resolvedBy']};},'reopenCommentThread':async({channelId:_0x6633cb,threadId:_0x26e78d})=>this['_getService'](_0x6633cb)['reopenCommentThread'](_0x26e78d)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x874241,threadId:_0x46d774})=>this['_getService'](_0x874241)['removeCommentThread'](_0x46d774)['catch'](S)['catch'](ut),'addComment':({channelId:_0xed5b60,threadId:_0x5b095e,commentId:_0x523e4c,content:_0x4ac8f2,attributes:_0x9285a2})=>this['_getService'](_0xed5b60)['addComment'](_0x5b095e,_0x523e4c,_0x4ac8f2,_0x9285a2)['catch'](ut),'updateComment':({channelId:_0x232105,threadId:_0x599a5a,commentId:_0x1b8afe,content:_0x4ccaaa,attributes:_0x5ef4fc})=>this['_getService'](_0x232105)['updateComment'](_0x599a5a,_0x1b8afe,_0x4ccaaa,_0x5ef4fc)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x73f578,threadId:_0x41fa3c,commentId:_0x497692})=>this['_getService'](_0x73f578)['removeComment'](_0x41fa3c,_0x497692)['catch'](S)['catch'](ut)},_0x4a8d04 instanceof _0x427df){const _0xa5f47b=_0x4a8d04['config']['get']('collaboration.channelId'),_0x49866b=_0x4a8d04['plugins']['get'](i);await this['_setUpService'](_0xa5f47b);const _0x4c76d7=await this['_services']['get'](_0xa5f47b)['getConnectedSessions']();this['listenTo'](_0x49866b,'sessionAdd:'+_0xa5f47b,(_0x333d94,{session:_0xd99ec6})=>{_0xd99ec6['id']===_0x49866b['mySessionId']&&(_0x333d94['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0xd99ec6['permissions'],_0xa5f47b));}),_0x49866b['register'](_0xa5f47b,_0x4c76d7);}}async['_setUpService'](_0x26c4a1){if(this['_services']['has'](_0x26c4a1))throw new _0x42186d('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x26c4a1});const _0x3fe41f=this['context']['plugins']['get']('CommentsRepository'),_0x5da069=new a['CommentsService'](_0x26c4a1);this['_services']['set'](_0x26c4a1,_0x5da069),this['listenTo'](_0x5da069,'commentThreadAdded',(_0x5f316f,_0x436b5a)=>{const {commentThreadId:_0xebd85e,documentId:_0x29795c,context:_0x5e4125,attributes:_0x4ef92f,resolvedAt:_0x227d1a,resolvedBy:_0x5dd020,comments:_0x30303e}=_0x436b5a;_0x3fe41f['getCommentThread'](_0xebd85e)||_0x3fe41f['addCommentThread']({'threadId':_0xebd85e,'channelId':_0x29795c,'comments':_0x30303e?_0x30303e['map'](_):[],'context':_0x5e4125,'attributes':_0x4ef92f,'resolvedAt':_0x227d1a,'resolvedBy':_0x5dd020,'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadUpdated',(_0x1aa0ba,{commentThreadId:_0x5f1a4b,documentId:_0x236490,context:_0x904839,unlinkedAt:_0x1ec780,attributes:_0x134872})=>{_0x3fe41f['getCommentThread'](_0x5f1a4b)&&_0x3fe41f['updateCommentThread']({'threadId':_0x5f1a4b,'channelId':_0x236490,'context':_0x904839,'unlinkedAt':_0x1ec780,'attributes':_0x134872,'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadResolved',(_0x43994b,{commentThreadId:_0x3164ea,resolvedBy:_0x19cea6,resolvedAt:_0x2dceb7})=>{const _0x5a66e1=_0x3fe41f['getCommentThread'](_0x3164ea);_0x5a66e1&&_0x5a66e1['resolve']({'resolvedBy':_0x19cea6,'resolvedAt':_0x2dceb7,'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadReopened',(_0x19121a,{commentThreadId:_0x2c687d})=>{const _0x1fcdba=_0x3fe41f['getCommentThread'](_0x2c687d);_0x1fcdba&&_0x1fcdba['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentThreadRemoved',(_0x34d9a6,{commentThreadId:_0x4e6f89})=>{const _0xdc4569=_0x3fe41f['getCommentThread'](_0x4e6f89);_0xdc4569&&_0xdc4569['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentAdded',(_0x187920,_0x120934)=>{const _0x1231c6=_0x120934['commentThreadId'],_0x4a58b7=_0x3fe41f['getCommentThread'](_0x1231c6);_0x4a58b7&&_0x4a58b7['addComment']({..._(_0x120934),'isFromAdapter':!0x0});}),this['listenTo'](_0x5da069,'commentUpdated',(_0x31c919,{commentThreadId:_0x538797,commentId:_0x27cdba,content:_0x2ff7b5,attributes:_0x3101f1})=>{const _0x4e6ccc=_0x3fe41f['getCommentThread'](_0x538797);if(_0x4e6ccc){const _0x432bf9=_0x4e6ccc['getComment'](_0x27cdba);_0x432bf9&&_0x432bf9['update']({'content':_0x2ff7b5,'attributes':_0x3101f1,'isFromAdapter':!0x0});}}),this['listenTo'](_0x5da069,'commentRemoved',(_0x46185a,{commentThreadId:_0x2d4449,commentId:_0x784b1})=>{const _0x598c84=_0x3fe41f['getCommentThread'](_0x2d4449);if(_0x598c84){const _0x285e0b=_0x598c84['getComment'](_0x784b1);_0x285e0b&&_0x285e0b['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x26c4a1);}['destroy'](){if(this['context']instanceof _0x427df){const _0x3c4c94=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3c4c94);}}['_terminateService'](_0x4beeb0){if(!this['_services']['has'](_0x4beeb0))throw new _0x42186d('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4beeb0});this['_getService'](_0x4beeb0)['disconnect'](),this['_services']['delete'](_0x4beeb0);}async['reconnect'](){for(const _0x5bb00c of this['_services']['keys']())await this['_connectService'](_0x5bb00c);if(this['context']instanceof _0x427df){const _0x1e9ab5=this['context']['config']['get']('collaboration.channelId'),_0x2ab12c=this['context']['plugins']['get'](i);_0x2ab12c['unregister'](_0x1e9ab5);const _0x537fd2=await this['_services']['get'](_0x1e9ab5)['getConnectedSessions']();_0x2ab12c['register'](_0x1e9ab5,_0x537fd2);}}async['_connectService'](_0x13aba3){const {connection:_0x45911a}=this['context']['plugins']['get'](c),_0xcafee1=this['context']['plugins']['get']('CommentsRepository'),_0x35329c=this['_services']['get'](_0x13aba3),_0x22af57=await _0x35329c['connect'](_0x45911a);await this['_fetchMissingUsersForThreads'](_0x22af57);const _0xe95199=new Set(Array['from'](_0xcafee1['getCommentThreads']({'channelId':_0x13aba3}),_0x4b3575=>_0x4b3575['id']));for(const _0x50ca11 of _0x22af57)_0x50ca11['deletedAt']||_0xe95199['delete'](_0x50ca11['commentThreadId']);for(const _0x1c5977 of _0xe95199)_0xcafee1['getCommentThread'](_0x1c5977)['remove']({'isFromAdapter':!0x0});for(const _0x225769 of _0x22af57){let _0x5e503d=_0xcafee1['getCommentThread'](_0x225769['commentThreadId']);const {commentThreadId:_0xee6b91,context:_0x157b8f,attributes:_0x1ff237,resolvedBy:_0x40de5b,resolvedAt:_0x39d64d,unlinkedAt:_0x1128d8,deletedAt:_0x3b4a2d}=_0x225769;if(_0x3b4a2d)continue;_0x5e503d||(_0x5e503d=_0xcafee1['addCommentThread']({'channelId':_0x13aba3,'threadId':_0xee6b91,'context':_0x157b8f,'attributes':_0x1ff237||{},'resolvedBy':_0x40de5b,'resolvedAt':_0x39d64d,'unlinkedAt':_0x1128d8,'isFromAdapter':!0x0}));const _0x3711de=new Set(Array['from'](_0x5e503d['comments'],_0x580eea=>_0x580eea['id']));for(const _0x588b18 of _0x225769['comments'])_0x3711de['delete'](_0x588b18['commentId']);for(const _0x2eb3dd of _0x3711de)_0x5e503d['getComment'](_0x2eb3dd)['remove']({'isFromAdapter':!0x0});for(const _0x3d4273 of _0x225769['comments']){const _0x338410=_0x5e503d['getComment'](_0x3d4273['commentId']);_0x338410?_0x338410['content']!==_0x3d4273['content']&&_0x338410['update']({'content':_0x3d4273['content'],'isFromAdapter':!0x0}):_0x5e503d['addComment'](Object['assign'](_(_0x3d4273),{'isFromAdapter':!0x0}));}}}['_getService'](_0x578421){if(!this['_services']['has'](_0x578421))throw new _0x42186d('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x578421});return this['_services']['get'](_0x578421);}async['_fetchMissingUsersForThreads'](_0x39cfb1){const _0x4b6d81=this['context']['plugins']['get'](_0xb8f378),{connection:_0x549e10}=this['context']['plugins']['get'](c),_0x28712c=new Set();for(const {resolvedBy:_0x235d6e,comments:_0x320ca9}of _0x39cfb1){_0x235d6e&&!_0x4b6d81['getUser'](_0x235d6e)&&_0x28712c['add'](_0x235d6e);for(const {userId:_0x4ca853}of _0x320ca9)_0x4b6d81['getUser'](_0x4ca853)||_0x28712c['add'](_0x4ca853);}if(0x0===_0x28712c['size'])return;const _0x5147e3=await dt['getMany'](_0x549e10,Array['from'](_0x28712c));for(const _0x468779 of _0x5147e3)_0x4b6d81['getUser'](_0x468779['id'])||_0x4b6d81['addUser'](_0x468779);}}async function S(_0x40529c){if('404'!==_0x40529c['code'])throw _0x40529c;}function ut(_0x4f3b44){if((_0x2d0038=_0x4f3b44)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2d0038['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2d0038['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2d0038;throw _0x4f3b44;}function _(_0x571b37){return{'threadId':_0x571b37['commentThreadId'],'commentId':_0x571b37['commentId'],'content':_0x571b37['content'],'createdAt':_0x571b37['createdAt'],'authorId':_0x571b37['userId'],'attributes':_0x571b37['attributes']||{}};}class f extends _0x2d3c3d{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(
|
|
28
|
-
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0xb8f378];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b8e93){super(_0x5b8e93);const _0xbf7f84=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0xbf7f84);}async['init'](){const _0x46f720=this['editor']['plugins']['get'](l),_0x3a879e=_0x46f720['serverHistory'],_0x22553f=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x3a879e,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x46f720['sessionId']});const _0x2c9ebb=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x2e04d6=await tt['isBundleUploaded'](_0x22553f['connection'],_0x2c9ebb);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x16df4f})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x16df4f)),'updateRevisions':async _0xb9e078=>{await this['_waitForServiceReady']();const _0xa50f0e=this['_revisionTracker']['currentRevision'];if(_0x2e04d6&&0x1===_0xb9e078['length']&&_0xb9e078[0x0]['id']===_0xa50f0e['id'])return _0xb9e078;for(const _0x3a286b of _0xb9e078)_0x3a286b['id']===_0xa50f0e['id']&&(_0x3a286b['isEmptyCurrent']=_0x3a286b['fromVersion']===_0x3a286b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0xb9e078,this['_lastRequestId'])['then'](_0x5c774b=>(this['_lastRequestId']=_0x5c774b,_0xb9e078))['catch'](_0xda3ba1=>{if(st(_0xda3ba1)||'400'===_0xda3ba1['code']&&void 0x0!==_0xda3ba1['data']['wrongRequestId']){for(const _0x51d38e of _0xb9e078){!this['_revisionTracker']['repository']['getRevision'](_0x51d38e['id'])||this['_revisionTracker']['_bufferUpdate'](_0x51d38e['id'],_0x51d38e,!0x1);}if(st(_0xda3ba1))throw _0xda3ba1;return _0xb9e078;}throw _0xda3ba1;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xd297bf,{revisionsData:_0x5f6dac,requestId:_0x417085})=>{Math['max'](..._0x5f6dac['map'](_0x40070b=>_0x40070b['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5f6dac,_0x417085);}):this['_handleRevisionsUpdate'](_0x5f6dac,_0x417085);});const {revisions:_0x150b53,requestId:_0xef2f06}=await this['_revisionHistoryService']['connect'](_0x22553f['connection']);_0x22553f['addToReconnectionStack'](this),this['_lastRequestId']=_0xef2f06,await this['_fetchMissingUsers'](_0x150b53);for(const _0x1c6785 of _0x150b53)this['_revisionTracker']['addRevisionData'](_0x1c6785);this['listenTo'](_0x46f720,'change:_isConnected',(_0x1bb490,_0x178042,_0xc1bbdd)=>{_0xc1bbdd&&(this['_oldOffset']=_0x46f720['_offset'],_0x1bb490['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x22553f,'state',_0x351ae7=>_0x351ae7===_0x4e41a1['CONNECTED']);}async['reconnect'](){const _0x5c1baf=this['editor']['plugins']['get'](c),_0x37f83f=this['editor']['plugins']['get'](l),_0x3b9817=async()=>{const _0x41413d=this['_revisionTracker']['currentRevision'],_0x38266e=_0x41413d['id'],_0x16207d=_0x38266e!==_0x37f83f['sessionId'];if(_0x16207d){const _0xaa1a81=_0x37f83f['_offset']-this['_oldOffset'],_0xb792=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x41413d['toVersion']+_0xaa1a81!==_0xb792){const _0x2c3129=_0x41413d['fromVersion']+_0xaa1a81,_0x22555d=this['editor']['plugins']['get'](_0xb8f378),_0x5b55fe=this['_revisionTracker']['buildRevisionData']({'revision':_0x41413d,'from':_0x2c3129,'to':_0xb792});_0x5b55fe['id']=_0x41413d['id'];const _0xdf0332=_0x5b55fe['authorsIds']['map'](_0x108358=>_0x22555d['getUser'](_0x108358));_0x41413d['_update']({..._0x5b55fe,'authors':_0xdf0332},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x41413d['id'],_0x5b55fe,!0x0);}this['_revisionTracker']['_startingVersion']=_0xb792,(_0x41413d['toVersion']===_0x41413d['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x38266e)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x38266e),this['_revisionTracker']['_createCurrentRevision'](_0xb792));}const {revisions:_0x2f9b0e,requestId:_0x6021a5}=await this['_revisionHistoryService']['reconnect'](_0x5c1baf['connection'],this['_lastRequestId']);_0x16207d&&_0x2f9b0e['length']>0x0?_0x37f83f['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x2f9b0e),this['_handleRevisionsUpdate'](_0x2f9b0e,_0x6021a5),this['_revisionTracker']['sendBufferedUpdates']());};return _0x37f83f['_isConnected']?_0x3b9817():new Promise((_0x43594d,_0x3f342a)=>{_0x37f83f['once']('change:_isConnected',()=>{_0x3b9817()['then'](_0x43594d)['catch'](_0x3f342a);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x52bc50=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x483de0=>{_0x483de0['off'](),_0x52bc50();});});}['_getLatestVersionFromServerOperations'](){const _0x2d115c=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x238792 of _0x2d115c)if('marker'!==_0x238792['type']||_0x238792['affectsData'])return _0x238792['baseVersion']+0x1;}['_getLatestVersion'](){const _0x4ac4a4=this['editor']['plugins']['get'](l);return new Promise(_0x3a52a8=>{_0x4ac4a4['_isPendingUpdate']?_0x4ac4a4['once']('change:_isPendingUpdate',()=>{_0x3a52a8(this['_getLatestVersionFromServerOperations']());}):_0x3a52a8(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x33f3ee,_0x5f09ca){const _0x22ba26=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5f09ca;for(const _0x51db6a of _0x33f3ee){const _0x44dcef=_0x22ba26['getRevision'](_0x51db6a['id']);if(_0x44dcef){if((_0x51db6a['fromVersion']||_0x51db6a['toVersion'])&&(_0x51db6a['diffData']=null),_0x44dcef===this['_revisionTracker']['currentRevision']){const _0x2bbd47=Math['max'](_0x44dcef['toVersion'],_0x51db6a['toVersion']),_0x45d9e1=Math['max'](_0x44dcef['fromVersion'],_0x51db6a['fromVersion']);let _0x142fda;_0x44dcef['toVersion']===_0x51db6a['toVersion']&&_0x44dcef['fromVersion']===_0x51db6a['fromVersion']?(_0x142fda=!0x0,this['_preventResendingRevisionData'](_0x51db6a)):_0x51db6a['toVersion']===_0x2bbd47&&_0x51db6a['fromVersion']===_0x45d9e1?_0x142fda=!0x1:(_0x44dcef['toVersion']===_0x2bbd47&&_0x44dcef['fromVersion']===_0x45d9e1||this['_fixRevision']({'revision':_0x44dcef,'from':_0x45d9e1,'to':_0x2bbd47}),_0x142fda=!0x0),_0x142fda&&(delete _0x51db6a['fromVersion'],delete _0x51db6a['toVersion'],delete _0x51db6a['diffData'],delete _0x51db6a['createdAt'],delete _0x51db6a['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x51db6a),this['_preventResendingRevisionData'](_0x51db6a);}else this['_revisionTracker']['addRevisionData'](_0x51db6a);}const _0x45c155=_0x22ba26['getRevisions']();_0x45c155['reverse']();for(let _0x3e7dfe=0x0;_0x3e7dfe<_0x45c155['length']-0x1;_0x3e7dfe++){const _0x370b7b=_0x45c155[_0x3e7dfe],_0xf9bed9=_0x45c155[_0x3e7dfe+0x1];if(_0x370b7b['fromVersion']<_0xf9bed9['toVersion']){const _0x309730=_0xf9bed9['toVersion'],_0x374caa=Math['max'](_0x309730,_0x370b7b['toVersion']);this['_fixRevision']({'revision':_0x370b7b,'from':_0x309730,'to':_0x374caa});}}}['_fixRevision']({revision:_0x1d8ea8,from:_0x155e19,to:_0x2225b1}={}){const _0xda001d=this['editor']['plugins']['get'](_0xb8f378),_0x85a321=this['_revisionTracker']['buildRevisionData']({'revision':_0x1d8ea8,'from':_0x155e19,'to':_0x2225b1});_0x85a321['authors']=_0x85a321['authorsIds']['map'](_0x23ae3=>_0xda001d['getUser'](_0x23ae3)),_0x1d8ea8['_update'](_0x85a321);}['_preventResendingRevisionData'](_0x14687a){const _0x32fb61={};_0x32fb61['id']=_0x14687a['id'];for(const _0x16f65f of Object['keys'](_0x14687a))'id'!==_0x16f65f&&(_0x32fb61[_0x16f65f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x32fb61['id'],_0x32fb61,!0x0);}async['_fetchMissingUsers'](_0x4a24cc){const _0x24b84d=this['editor']['plugins']['get'](_0xb8f378),{connection:_0x3c1191}=this['editor']['plugins']['get'](c),_0x351138=new Set();for(const _0x2cae3d of _0x4a24cc){for(const _0x54e07e of _0x2cae3d['authorsIds'])_0x59d5a1(_0x54e07e);_0x2cae3d['creatorId']&&_0x59d5a1(_0x2cae3d['creatorId']);}if(0x0===_0x351138['size'])return;const _0x5d6d80=await dt['getMany'](_0x3c1191,Array['from'](_0x351138));for(const _0x25b493 of _0x5d6d80)_0x24b84d['getUser'](_0x25b493['id'])||_0x24b84d['addUser'](_0x25b493);function _0x59d5a1(_0x137f44){_0x24b84d['getUser'](_0x137f44)||_0x351138['add'](_0x137f44);}}}function st(_0x41a610){return _0x41a610['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x41a610['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41a610['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x2d3c3d{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x1f1e81{['_collapseAt'];constructor(_0x503896,_0x2dc319=0x6){super(_0x503896);const _0x59b92b=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x2dc319,this['bind']('isHidden')['to'](this,'usersCount',_0x800baf=>_0x800baf<_0x2dc319),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x59b92b['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':_0x59b92b['to']('usersCount',_0x37a4ac=>'+'+(_0x37a4ac-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x1f1e81{['items'];['keystrokes'];constructor(_0x15dfad){super(_0x15dfad);const _0x4a6fdf=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5b08a7(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x4a6fdf['if']('hasPopup'),'aria-expanded':_0x4a6fdf['to']('isExpanded',_0x275de3=>this['hasPopup']&&String(_0x275de3)),'aria-label':_0x4a6fdf['to']('hasPopup',_0x6744ab=>G(_0x15dfad,_0x6744ab?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x4a6fdf['to']('hasPopup',_0x4f0a29=>!!_0x4f0a29&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x4a6fdf['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x4a6fdf['to'](_0x2dea86=>{const _0x547f99=_0x2dea86,_0x50da7e=document['querySelector']('.ck-presence-list__dropdown-list'),_0x523eee=document['querySelector']('.ck-balloon-panel_with-arrow');_0x50da7e?.['contains'](_0x547f99['relatedTarget'])||_0x523eee?.['contains'](_0x547f99['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x53e7c6,_0x55b847,_0x474e06)=>{this['element']&&(_0x474e06?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 j extends _0x1f1e81{['counterView'];['inlineListView'];constructor(_0x1c3ce0,_0x39d106=0x6){super(_0x1c3ce0);const _0x48aa51=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x39d106),this['inlineListView']=new ts(_0x1c3ce0),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x392a50 of this['inlineListView']['items'])_0x392a50['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',_0x48aa51['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x1f1e81{['listWrapperView'];constructor(_0x5f4eb1,_0x497614){super(_0x5f4eb1);const _0x5b7b65=this['bindTemplate'];this['listWrapperView']=new mt(_0x5f4eb1,_0x497614),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x5f4eb1,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5b7b65['to'](_0x24a702=>{const _0x153ffd=_0x24a702,_0xdb3dd5=document['querySelector']('.ck-presence-list__list'),_0x476934=document['querySelector']('.ck-balloon-panel_with-arrow');_0xdb3dd5?.['contains'](_0x153ffd['relatedTarget'])||_0x476934?.['contains'](_0x153ffd['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x2837ad{constructor(_0x936546,_0x2fe4a8){super(_0x936546);const _0x220eb3=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2fe4a8?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x220eb3['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x220eb3['to']('role'),'aria-label':_0x220eb3['to']('ariaLabel'),'aria-labelledby':_0x220eb3['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x17d00d['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xd2c7a9=this['element'];_0xd2c7a9&&(this['_isScrollable']=Math['max'](_0xd2c7a9['scrollHeight'],_0xd2c7a9['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x10d4a7,_0x4fc489,_0xa594ab){super(_0x10d4a7);const _0x339187=this['bindTemplate'];this['userView']=new ct(_0x10d4a7,_0x4fc489);const _0x205c6d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4fc489['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4fc489['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4fc489['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xa594ab&&(_0x205c6d['tag']='button',_0x205c6d['on']={'click':_0x339187['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x205c6d);}['focus'](){this['element']['focus']();}}class y extends _0x1f1e81{['userView'];['markerView'];constructor(_0xf20989,_0x355cf3,_0x25d65a){super(_0xf20989);const _0x284fd5=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0xf20989,_0x355cf3),this['markerView']=new at(_0xf20989,_0x355cf3);const _0x22c8a1=new ot(_0xf20989);_0x22c8a1['template']['tag']='span',_0x22c8a1['text']=_0x355cf3['name'];const _0x27532a={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x284fd5['to']('isFocusable',_0x47a759=>!!_0x47a759&&0x0),'aria-labelledby':_0x22c8a1['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x284fd5['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x284fd5['to']('hasTooltip',_0x2c2a5d=>!_0x2c2a5d),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x22c8a1]};_0x25d65a&&(_0x27532a['tag']='button',_0x27532a['on']={'click':_0x284fd5['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x27532a);}}class at extends _0x1f1e81{constructor(_0x21f685,_0x17f799){super(_0x21f685),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x17f799['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x6e3cec{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x274153){super(_0x274153),this['context']['config']['define']('presenceList',C);const _0x360400=_0x274153['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x360400)throw new _0x42186d('presencelist-collapseat-invalid-format',this);if(_0x360400<0x1)throw new _0x42186d('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2fd983(),this['balloonPanelView']=new _0x53a00a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x1bdb5f of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1bdb5f);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4600d6,_0x26b076)=>{this['_handleUserAdd'](_0x26b076);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x75c088,_0x618851)=>{this['_handleUserRemove'](_0x618851);});}['_createView'](){const _0x42c3fd=this['context'],_0x5505e5=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x5d0890=this['balloonPanelView'];if(!_0x35aebf(_0x42c3fd['config']['get']('presenceList.container')))throw new _0x42186d('presencelist-missing-container',this);return _0x5505e5['counterView']['bind']('usersCount')['to'](this),_0x5505e5['bind']('isCollapsed')['to'](this,'usersCount',_0xcf84a=>{const {collapseAt:_0x186013}=_0x42c3fd['config']['get']('presenceList'),_0xcf0ded=_0xcf84a>=_0x186013;if(_0xcf0ded&&!_0x5505e5['inlineListView']['items']['find'](_0x405e37=>_0x405e37 instanceof A)){const _0x1abf47=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x1abf47&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x5505e5['inlineListView']['items']['add'](_0x5505e5['counterView']);}return _0xcf0ded||this['hideDropdown'](),_0xcf0ded;}),_0x5505e5['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x31e29c=>{const _0x42a6df=_0x42c3fd['config']['get']('presenceList'),_0x3565bc=new y(_0x42c3fd['locale'],_0x31e29c,!!_0x42a6df['onClick']);return _0x3565bc['bind']('hasTooltip')['to'](_0x5505e5,'isCollapsed',_0x1a7223=>!_0x1a7223),_0x3565bc['bind']('isFocusable')['to'](_0x5505e5,'isCollapsed',_0x4cf586=>!_0x4cf586),_0x42a6df['onClick']&&this['listenTo'](_0x3565bc,'execute',()=>{this['view']['isCollapsed']||_0x42a6df['onClick'](_0x31e29c,_0x3565bc['element']);}),_0x3565bc;}),this['listenTo'](_0x5505e5['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x5505e5['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x5505e5['inlineListView']['keystrokes']['set']('Enter',(_0x23c6ba,_0x3b5f8f)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3b5f8f());}),_0x5505e5['render'](),_0x5d0890['render'](),_0x3527e1({'emitter':_0x5505e5,'activator':()=>_0x5d0890['isVisible'],'contextElements':[_0x5d0890['element'],_0x5505e5['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x42c3fd['config']['get']('presenceList.container')['appendChild'](_0x5505e5['element']),this['_bodyCollection']=new _0x30db24(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5505e5;}['_handleUserAdd'](_0x39c82f){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x39c82f['isMe'])return;const _0x2cd6dd=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2cd6dd-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4d44a9=_0x39c82f['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x39c82f,_0x4d44a9);}['_handleUserRemove'](_0x1dbdd0){this['usersCount']--;const {collapseAt:_0x10365c}=this['context']['config']['get']('presenceList'),_0x298450=this['usersCount']>=_0x10365c;if(this['currentDisplayedUsers']['get'](_0x1dbdd0['id']))this['currentDisplayedUsers']['remove'](_0x1dbdd0['id']);else{if(_0x298450&&this['currentDisplayedUsers']['length']+0x1===_0x10365c-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x298450?0x1:0x0)<this['usersCount']){for(const _0x5cf579 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5cf579['id'])&&(this['currentDisplayedUsers']['add'](_0x5cf579,Math['min'](this['currentDisplayedUsers']['length']-(_0x298450?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x298450?0x1:0x0)===_0x10365c-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3e95c7=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x3e95c7['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x10f869}=this['presenceDropdownView'];_0x10f869['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x455d5d=>{if(!_0x3e95c7['displayMe']&&_0x455d5d['isMe'])return null;const _0x1c11df=new k(this['context']['locale'],_0x455d5d,!!_0x3e95c7['onClick']);return _0x3e95c7['onClick']&&this['listenTo'](_0x1c11df,'execute',()=>{_0x3e95c7['onClick'](_0x455d5d,_0x1c11df['element']);}),_0x1c11df;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x10f869['focus'](),_0x10f869['checkIfScrollable']();const _0x1940b8=(_0x1e07e0,_0x22b564)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x22b564();};_0x10f869['keystrokes']['set']('Esc',_0x1940b8),_0x10f869['keystrokes']['set']('Shift+Tab',_0x1940b8),_0x10f869['keystrokes']['set']('Tab',(_0x40ca84,_0x97fc46)=>{!function(_0x35754c){const _0x2e249e=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x1a3f85=>_0x1a3f85+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x168db5=[...document['body']['querySelectorAll'](_0x2e249e)]['filter'](_0xaac535=>_0xaac535===document['activeElement']||_0xaac535['offsetWidth']+_0xaac535['offsetHeight']>0x0)['sort']((_0x9f10ed,_0x211b55)=>(_0x9f10ed['tabIndex']||0x0)-(_0x211b55['tabIndex']||0x0)),_0x2fb4a2=_0x168db5['indexOf'](_0x35754c),_0xf73f95=_0x168db5[(_0x2fb4a2+0x1)%_0x168db5['length']];_0xf73f95&&_0xf73f95['focus']();}(this['view']['element']),this['hideDropdown'](),_0x97fc46();}),_0x10f869['focusTracker']['add'](this['view']['element']),_0x10f869['focusTracker']['on']('change:isFocused',(_0x30a073,_0x256f50,_0x23ebb3)=>{_0x23ebb3||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 s extends _0x6e3cec{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
|
23
|
+
import{ContextPlugin as _0x2519a7,Plugin as _0x2be3f4,PendingActions as _0x2dbc0f,Context as _0x5693c5}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x25265a,CKEditorError as _0x64ac9c,Collection as _0x1c089a,global as _0x1c8415,version as nt,uid as _0x5c4947,KeystrokeHandler as _0x19a0cb}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0xaefee6,View as _0x2b7110,ListView as _0x58ee55,ListItemView as rt,LabelView as ot,BalloonPanelView as _0xee9b38,clickOutsideHandler as _0x3dfbaf,BodyCollection as _0x55a4bd}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0xbc2a7d,NoOperation as _0x575b2e,InsertOperation as _0x4a16eb,MarkerOperation as _0xc512eb,RootAttributeOperation as _0x106729,transformSets as _0x2d1e05,OperationFactory as _0x14ae82}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x1c1fcd,CollaborativeEditingService as _0x40440f,User as dt,CommentsService as _0x19e6a1,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x449269,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x17e426}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3feb0d}from'es-toolkit/compat';class c extends _0x2519a7{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0xaefee6];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x90de41){super(_0x90de41),this['set']('state',_0x1c1fcd['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x25265a);}['init'](){const _0x26bb51=this['context'],_0x26e836=_0x26bb51['plugins']['get']('CloudServices'),_0x351e8d=_0x26bb51['plugins']['get'](_0xaefee6);if(!_0x26e836['token'])throw new _0x64ac9c('websocketgateway-missing-token',this);if(!_0x26e836['webSocketUrl'])throw new _0x64ac9c('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),c['WebSocketGateway']['connect'](_0x26e836['token'],_0x26e836['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0xec6875=>{if(this['connection']=_0xec6875,this['bind']('state')['to'](_0xec6875,'state',this,'_isBrowserOffline',(_0x558907,_0x88c1df)=>('connected'!==_0x558907&&(this['_shouldPluginsReconnect']=!0x0),_0x88c1df||_0x558907!==_0x1c1fcd['CONNECTED']?_0x1c1fcd['DISCONNECTED']:this['state']==_0x1c1fcd['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x1c1fcd['CONNECTING']):_0x1c1fcd['CONNECTED'])),this['connection']['on']('error',(_0x545a8e,_0x27b056)=>{if('limitExceeded'!==_0x27b056['code'])throw console['error'](_0x27b056),new _0x64ac9c('cloudservices-init',null,{'originalError':_0x27b056});_0x351e8d['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'});}),!_0xec6875['me'])return new Promise(_0x143617=>_0xec6875['on']('change:me',_0x143617));})['catch'](_0x3d8ab5=>{throw console['error'](_0x3d8ab5),new _0x64ac9c('cloudservices-init',null,{'originalError':_0x3d8ab5});});}['addToReconnectionStack'](_0x10512d){if('function'!=typeof _0x10512d['reconnect'])throw new _0x64ac9c('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x10512d))throw new _0x64ac9c('websocketgateway-plugin-already-registered',this,{'name':_0x10512d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x10512d);}['removeFromReconnectionStack'](_0x39d863){this['_reconnectionStack']['delete'](_0x39d863);}['isInReconnectionStack'](_0x4a4f9c){return this['_reconnectionStack']['has'](_0x4a4f9c);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x47f020=>_0x47f020['reconnect']())))['then'](()=>this['state']=_0x1c1fcd['CONNECTED'])['catch'](_0x442aea=>{throw console['error'](_0x442aea),new _0x64ac9c('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x1c1fcd['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x2519a7{['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[c,_0x449269];}constructor(_0x217a72){super(_0x217a72),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1c089a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x449269);}['init'](){const _0xc9b02b=this['context']['plugins']['get'](c);this['listenTo'](_0xc9b02b,'change:state',(_0x4f70fb,_0x1bead3,_0x5bc420)=>{if('connected'!==_0x5bc420)this['channelSessions']['forEach'](_0x4168cb=>_0x4168cb['clear']()),this['channelConnectedUsers']['forEach'](_0x2bef7e=>_0x2bef7e['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x15f545,_0x410dcf]of this['_registeredSessions'])for(const _0x1c23b6 of _0x410dcf)this['_handleSessionAdd'](_0x15f545,_0x1c23b6);}}),this['_createUser'](_0xc9b02b['connection']['me'],!0x0);}['register'](_0x21a0ac,_0x5cd40c){if(this['_registeredSessions']['has'](_0x21a0ac))throw new _0x64ac9c('sessions-register-already-registered',null,{'channelId':_0x21a0ac});this['_registeredSessions']['set'](_0x21a0ac,_0x5cd40c),this['channelSessions']['set'](_0x21a0ac,new _0x1c089a()),this['channelConnectedUsers']['set'](_0x21a0ac,new _0x1c089a()),this['listenTo'](_0x5cd40c,'add',(_0xa39562,_0x2d982a)=>this['_handleSessionAdd'](_0x21a0ac,_0x2d982a)),this['listenTo'](_0x5cd40c,'remove',(_0x1be16a,_0x177207)=>this['_handleSessionRemove'](_0x21a0ac,_0x177207));for(const _0x28c95f of _0x5cd40c)this['_handleSessionAdd'](_0x21a0ac,_0x28c95f);}['unregister'](_0x501831){if(!this['_registeredSessions']['has'](_0x501831))throw new _0x64ac9c('sessions-unregister-not-exist',null,{'channelId':_0x501831});const _0x32e707=this['_registeredSessions']['get'](_0x501831);this['stopListening'](_0x32e707);for(const _0x2973a5 of _0x32e707)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x501831,_0x2973a5);this['_registeredSessions']['delete'](_0x501831),this['channelSessions']['delete'](_0x501831),this['channelConnectedUsers']['delete'](_0x501831);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x2ffa04){for(const _0x5f52e1 of this['channelSessions']['values']())for(const _0x48ed56 of _0x5f52e1)if(_0x48ed56['id']===_0x2ffa04)return _0x48ed56['user'];}['getUserSessions'](_0x1fc648,_0x5d2094){const _0x3e03cf=_0x5d2094?[this['channelSessions']['get'](_0x5d2094)]:this['channelSessions']['values'](),_0x182e42=new Set();for(const _0x5220f9 of _0x3e03cf)for(const _0x28671e of _0x5220f9)_0x28671e['user']['id']===_0x1fc648['id']&&_0x182e42['add'](_0x28671e['id']);return _0x182e42;}['getUserRole'](_0x2da04a){for(const _0x41103a of this['channelSessions']['values']())for(const _0x28f9dc of _0x41103a)if(_0x28f9dc['user']===_0x2da04a)return _0x28f9dc['role'];}['_handleSessionAdd'](_0x4aba0f,_0x83eb10){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x3b5d64=_0x83eb10['user'],_0x54ac88=this['_users']['getUser'](_0x3b5d64['id'])||this['_createUser'](_0x3b5d64),_0x3f60c5=Object['assign']({},_0x83eb10,{'user':_0x54ac88});this['channelSessions']['get'](_0x4aba0f)['add'](_0x3f60c5);const _0x28483e=this['channelConnectedUsers']['get'](_0x4aba0f);_0x28483e['has'](_0x54ac88['id'])||_0x28483e['add'](_0x54ac88),this['allConnectedUsers']['has'](_0x54ac88['id'])||this['allConnectedUsers']['add'](_0x54ac88,_0x54ac88['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x4aba0f,{'channelId':_0x4aba0f,'session':_0x3f60c5});}['_handleSessionRemove'](_0x1c3d14,_0x3da41a){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x364fac=this['channelConnectedUsers']['get'](_0x1c3d14),_0x3376d4=_0x3da41a['user'];_0x3376d4['id']&&(this['channelSessions']['get'](_0x1c3d14)['remove'](_0x3da41a['id']),_0x364fac['has'](_0x3376d4['id'])&&!this['getUserSessions'](_0x3376d4,_0x1c3d14)['size']&&_0x364fac['remove'](_0x3376d4['id']),this['allConnectedUsers']['get'](_0x3376d4['id'])&&!this['getUserSessions'](_0x3376d4)['size']&&this['allConnectedUsers']['remove'](_0x3376d4['id']));}['_createUser'](_0x313aa3,_0x2ff40f){const _0x72093b=this['_users']['addUser'](_0x313aa3);return _0x2ff40f&&this['_users']['defineMe'](_0x313aa3['id']),_0x72093b['orderNumber']=this['_uniqueUsersCount']++,_0x72093b;}}class q extends _0x2be3f4{['_domEmitter']=new(_0x25265a())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x253273=this['editor'],_0x5341df=_0x253273['plugins']['get'](i);_0x253273['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3d52ab,{writer:_0x5b46cb})=>function(_0x25bc02,_0x16b132,_0x7c630a,_0x236d00){const _0x5f9316=_0x25bc02['markerName']['split'](':')[0x2],_0x112395=_0x7c630a['getUserBySessionId'](_0x5f9316);if(!_0x112395||_0x5f9316===_0x7c630a['mySessionId'])return;if(!_0x236d00['model']['schema']['checkChild'](_0x25bc02['markerRange']['start'],'$text'))return;const _0x53046e={'class':'ck-user__marker\x20'+_0x112395['color']['getMarkerClass'](),'data-name':_0x112395['name'],'data-session-id':_0x5f9316},_0x1306ee=_0x236d00['model']['markers']['get'](_0x25bc02['markerName']),_0x3019ea=_0x1306ee['getStart'](),_0x3834b4=_0x3019ea['nodeAfter'],_0x39fc32=_0x236d00['model']['schema'];if(_0x3834b4&&_0x39fc32['isObject'](_0x3834b4)&&_0x39fc32['isInline'](_0x3834b4)&&!_0x236d00['model']['markers']['get']('user:range:'+_0x5f9316)['getRange']()['isCollapsed'])return;const _0x46efee=_0x3019ea['parent'];return _0x236d00['model']['schema']['isLimit'](_0x46efee)&&!_0x236d00['model']['hasContent'](_0x46efee)&&(_0x53046e['contenteditable']=!0x1),function(_0x56dadc,_0xb38a04,_0x2b1bb9){const _0xe399c3=_0x56dadc['createUIElement']('span',_0xb38a04);return _0x56dadc['setCustomProperty']('userPositionMarker',!0x0,_0xe399c3),_0xe399c3['render']=function(_0x6060cd){const _0x38de81=this['toDomElement'](_0x6060cd),_0x3aae95=document['createElement']('span');return _0x3aae95['classList']['add']('ck-user__marker-tooltip'),_0x3aae95['setAttribute']('contenteditable','false'),_0x3aae95['setAttribute']('spellcheck','false'),_0x3aae95['textContent']=_0x2b1bb9['name'],_0x38de81['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3aae95['outerHTML']+'',_0x38de81['addEventListener']('mouseenter',()=>{_0x38de81['classList']['add']('ck-user__marker_hovered');}),_0x38de81['addEventListener']('mouseleave',()=>{_0x38de81['classList']['remove']('ck-user__marker_hovered');}),_0x38de81;},_0xe399c3['isSimilar']=function(_0x3dbd5c){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3dbd5c['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3dbd5c['getAttribute']('data-session-id'));},_0xe399c3;}(_0x16b132,_0x53046e,_0x112395);}(_0x3d52ab,_0x5b46cb,_0x5341df,_0x253273)}),_0x253273['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x10964b=>function(_0x24f142,_0x1952ad){const _0x5417dd=_0x24f142['markerName']['split'](':')[0x2];if(_0x5417dd===_0x1952ad['mySessionId'])return null;const _0x49a836=_0x1952ad['getUserBySessionId'](_0x5417dd);if(!_0x49a836)return{'id':_0x5417dd,'classes':[]};return{'id':_0x5417dd,'classes':['ck-user__selection',_0x49a836['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x5417dd},'priority':0x7d0+_0x49a836['orderNumber']};}(_0x10964b,_0x5341df)}),function(_0x1d70e6){const _0x59a773=_0x1d70e6['model'],_0x2379c2=new Map(),_0x4b3b61=_0x1d70e6['plugins']['get'](i);_0x59a773['markers']['on']('update:user:range',(_0x26ba36,_0x1ce759,_0x2e3b9b,_0x48b999)=>{if(!_0x48b999&&_0x2379c2['get'](_0x1ce759['name']))return _0x2379c2['get'](_0x1ce759['name'])['detach'](),void _0x2379c2['delete'](_0x1ce759['name']);const _0x4ba2da=_0x1ce759['name']['split'](':')[0x2];if(_0x4ba2da===_0x4b3b61['mySessionId'])return;const _0x425de1='user:position:'+_0x4ba2da;_0x59a773['markers']['has'](_0x425de1)&&_0x1d70e6['editing']['reconvertMarker'](_0x425de1),_0x1ce759['on']('change:range',(_0x378b34,_0x2afa44,_0x6dc7a8)=>{if('$graveyard'!=_0x2afa44['root']['rootName']&&'$graveyard'==_0x1ce759['getRange']()['root']['rootName']&&!_0x2379c2['has'](_0x1ce759['name'])){const _0x3bcdd6=_0x59a773['schema']['getNearestSelectionRange'](_0x6dc7a8['deletionPosition']);if(_0x3bcdd6){const _0x3108a7=ht['fromRange'](_0x3bcdd6);_0x2379c2['set'](_0x1ce759['name'],_0x3108a7),_0x3108a7['on']('change:range',(_0x38deea,_0x1326f4,_0x4eae48)=>{if('$graveyard'==_0x3108a7['root']['rootName']){const _0x1fbf0b=_0x59a773['schema']['getNearestSelectionRange'](_0x4eae48['deletionPosition']);_0x1fbf0b?(_0x3108a7['start']=_0x1fbf0b['start'],_0x3108a7['end']=_0x1fbf0b['end']):(_0x2379c2['delete'](_0x1ce759['name']),_0x3108a7['detach']());}});}}});}),_0x59a773['document']['on']('change',()=>{_0x2379c2['size']>0x0&&_0x59a773['enqueueChange']({'isUndoable':!0x1},_0x1575f4=>{for(const [_0xf942b9,_0x325c9c]of _0x2379c2)'$graveyard'==_0x59a773['markers']['get'](_0xf942b9)['getRange']()['root']['rootName']&&(te(_0xf942b9['split'](':')[0x2],_0x325c9c['toRange'](),_0x59a773,_0x1575f4),_0x325c9c['detach']());_0x2379c2['clear']();});});}(_0x253273),this['_domEmitter']['listenTo'](_0x1c8415['document'],'keydown',(_0x4615e5,{key:_0xc82430})=>{'Escape'===_0xc82430&&function(_0x7d776f){_0x7d776f['editing']['view']['change'](_0xb4b60d=>{for(const _0x3821ab of _0x7d776f['model']['markers']){if(!_0x3821ab['name']['startsWith']('user:position'))continue;const _0x1b2f86=_0x7d776f['editing']['mapper']['markerNameToElements'](_0x3821ab['name']);if(_0x1b2f86){for(const _0x1b646d of _0x1b2f86)_0xb4b60d['removeClass']('ck-user__marker_hovered',_0x1b646d);}}});}(_0x253273);},{'useCapture':!0x0});}['afterInit'](){const _0x40abe3=this['editor'],_0x2d9625=_0x40abe3['commands']['get']('undo');_0x2d9625&&_0x40abe3['model']['on']('applyOperation',(_0x3bd08f,_0x3e4a36)=>{const _0x3468d1=_0x3e4a36[0x0];if(!_0x3468d1['isDocumentOperation'])return;if('marker'!=_0x3468d1['type']||!_0x3468d1['name']['startsWith']('user:'))return;const _0x33b2fb=_0x3468d1['batch'];_0x2d9625['_createdBatches']['has'](_0x33b2fb)&&(_0x3468d1['newRange']=_0x3468d1['oldRange']?_0x40abe3['model']['createRange'](_0x3468d1['oldRange']['start'],_0x3468d1['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x2b4f41=this['editor'],_0x20e7cb=_0x2b4f41['model']['document'],_0x447616=_0x2b4f41['plugins']['get'](i);_0x2b4f41['model']['enqueueChange']({'isUndoable':!0x1},_0x2857c8=>{const _0x30c1f5='user:range:'+_0x447616['mySessionId'],_0x3a2dc='user:position:'+_0x447616['mySessionId'],_0x1bba7e=_0x2b4f41['model']['markers']['has'](_0x30c1f5);_0x2b4f41['editing']['view']['hasDomSelection']?te(_0x447616['mySessionId'],_0x20e7cb['selection']['getFirstRange'](),_0x2b4f41['model'],_0x2857c8):_0x1bba7e&&(_0x2857c8['removeMarker'](_0x30c1f5),_0x2857c8['removeMarker'](_0x3a2dc));});}}function te(_0x44cce6,_0x3f3b80,_0x14382c,_0x151672){const _0x5b81c4='user:range:'+_0x44cce6,_0x5108ac='user:position:'+_0x44cce6,_0x32894e=_0x3f3b80['getContainedElement']();let _0x577ef3=_0x3f3b80['start'];if(_0x32894e&&_0x32894e['is']('element','tableCell')){const _0x1f2f92=function(_0x151738,_0x5541df){for(const _0x778112 of _0x151738['getPositions']())if(_0x5541df['schema']['checkChild'](_0x778112,'$text'))return _0x778112;}(_0x3f3b80,_0x14382c);_0x1f2f92&&(_0x577ef3=_0x1f2f92,_0x3f3b80=_0x151672['createRange'](_0x577ef3));}const _0x3b4013=_0x151672['createRange'](_0x577ef3);_0x14382c['markers']['has'](_0x5b81c4)?(_0x151672['updateMarker'](_0x5b81c4,{'range':_0x3f3b80}),_0x151672['updateMarker'](_0x5108ac,{'range':_0x3b4013})):(_0x151672['addMarker'](_0x5b81c4,{'range':_0x3f3b80,'usingOperation':!0x0}),_0x151672['addMarker'](_0x5108ac,{'range':_0x3b4013,'usingOperation':!0x0}));}function G(_0x214caa,_0x1ce0ae,_0x4d5ca6){const _0x1d9af8=_0x214caa['t'],t=_0x214caa['t'];switch(_0x1ce0ae){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 _0x1d9af8({'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'},_0x4d5ca6);default:return'';}}let J=0x1;class l extends _0x2be3f4{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x40440f)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,q,_0x2dbc0f,_0x449269,_0xaefee6];}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 _0xfe10b=this['serverHistory']['getOperations']();for(let _0x536496=_0xfe10b['length']-0x1;_0x536496>=0x0;_0x536496--){const _0x4f5934=_0xfe10b[_0x536496];if(!this['_disconnectionOperations']['has'](_0x4f5934))return _0x4f5934['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x125432){if(super(_0x125432),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0xbc2a7d(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x64ac9c('collaboration-missing-channelid',this);const _0x458c60=_0x125432['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x458c60,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x17e426(),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 Y(this['_disconnectionOperations']);}['init'](){const _0x11aab7=this['editor'],_0x957649=_0x11aab7['plugins']['get'](_0x449269),_0x5579b7=_0x11aab7['plugins']['get'](c);this['listenTo'](_0x957649,'getOperationAuthor',(_0x5e2b5a,_0x4201d8)=>{const _0x525f3d=_0x4201d8[0x0];_0x525f3d['_authorId']&&(_0x5e2b5a['return']=_0x957649['getUser'](_0x525f3d['_authorId']),_0x5e2b5a['stop']()),null===_0x525f3d['_authorId']&&(_0x5e2b5a['return']=null,_0x5e2b5a['stop']());},{'priority':'high'}),this['listenTo'](_0x11aab7['model']['document']['selection'],'change:range',(_0x94ef1d,_0xdb9a55)=>{_0xdb9a55['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x11aab7['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x11aab7['model']['on']('applyOperation',(_0x48bae2,_0x3fad4b)=>{const _0x3e0b0b=_0x3fad4b[0x0];_0x3e0b0b['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x3e0b0b),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5579b7,'state',this,'_hasSynchronizationProblem',(_0x261324,_0xcf233a)=>'connected'===_0x261324&&!_0xcf233a),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x11aab7['disableReadOnlyMode']('rtc-offline'):_0x11aab7['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x11aab7['disableReadOnlyMode']('rtc-offline'):_0x11aab7['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x3f2002=this['editor']['plugins']['get'](i),_0x454202=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x3f2002['unregister'](this['_channelId']);const _0x45462f=await this['_service']['reconnect'](_0x454202['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x45462f)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x29d21e=await this['_service']['getConnectedSessions']();_0x3f2002['register'](this['_channelId'],_0x29d21e),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4c5d92){if(function(_0x27d2d6){return'404'===_0x27d2d6['code'];}(_0x4c5d92)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x39b919){return'409'===_0x39b919['code'];}(_0x4c5d92)){const _0x1e6473=G(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'](_0x1e6473);}else{if(!(_0x4c5d92 instanceof Q))throw _0x4c5d92;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1e9ce1=this['editor']['plugins']['get'](c),_0x463f4f=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x463f4f['channelSessions']['has'](this['_channelId'])&&_0x463f4f['unregister'](this['_channelId']),_0x1e9ce1['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x26eedd){if(this['sessionId']!==_0x26eedd['sessionId']&&this['_lastSyncedOperationId']!==_0x26eedd['lastOperationId'])throw new Q();return this['sessionId']=_0x26eedd['sessionId'],this['_handleServerResponse']([],{..._0x26eedd,'wereChangesApplied':!0x1,'data':_0x26eedd['data']},'reconnect');}async['_connectService'](_0x564770,_0x10e526=!0x1){const {connection:_0x52235c}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x52235c,this['_channelId'])['then'](_0x4f0141=>this['_initSessionsHandling'](_0x4f0141))['catch'](_0x598849=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x598849);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xd6cf29,_0x40044c)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x40044c);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x2706b0=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x564770);this['_isPendingUpdate']=!0x0;const _0x21aaf6=await this['_service']['connect'](_0x52235c,this['_compressOperations'](_0x564770),_0x2706b0);if(this['sessionId']=_0x21aaf6['sessionId'],_0x10e526){if(!_0x21aaf6['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x21aaf6['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x564770,_0x21aaf6,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x21aaf6,_0x564770);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3283f4=this['editor']['plugins']['get'](i),_0x375a8e=this['editor']['plugins']['get'](q),_0x232a53=_0x3283f4['channelSessions']['get'](this['_channelId']);_0x232a53&&_0x232a53['length']>0x1?_0x375a8e['createUserMarkerOperations']():this['listenTo'](_0x3283f4,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3283f4['channelSessions']['get'](this['_channelId'])['length']&&_0x375a8e['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4981b5,_0x4d2aea,_0x8d786,_0x4b0be0){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x4d2aea){const _0x531c52=this['_decompressOperations'](_0x8d786,_0x4b0be0);await this['_fetchMissingUsers'](_0x531c52),this['_handleExternalOperations'](_0x531c52,_0x4d2aea,_0x8d786['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2233e2}=this['editor'];let _0xd2193;try{_0xd2193=await this['_service']['getDocumentDetails']();}catch{const _0x33c8c5=G(_0x2233e2,'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'](_0x33c8c5);}const _0x5e245c=_0xd2193['currentDocumentSession']||_0xd2193['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x5e245c['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x3ccedb=G(_0x2233e2,'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.');this['_handleReconnectionError'](_0x3ccedb);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x5c1fdd){const _0x459bf6=this['editor']['plugins']['get'](i);this['listenTo'](_0x459bf6,'sessionAdd:'+this['_channelId'],(_0x266bf1,{session:_0x1e4cf6})=>{if(_0x1e4cf6['id']===_0x459bf6['mySessionId']){_0x266bf1['off']();const _0x38420d=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2fafc6=_0x1e4cf6['permissions'];_0x38420d&&_0x38420d['isEnabled']&&(_0x2fafc6=_0x2fafc6['filter'](_0x34a87f=>'document:write'!==_0x34a87f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2fafc6,this['_channelId']);}}),_0x459bf6['register'](this['_channelId'],_0x5c1fdd);}['_initThrowingOnDataSet'](){const _0x22e8ba=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5ca1a4)=>{if(!_0x5ca1a4[_0x5ca1a4['length']-0x1]['suppressErrorInCollaboration'])throw new _0x64ac9c('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x22e8ba['apply'](this['editor']['data'],_0x5ca1a4);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x38283f,[_0x19dcf3])=>{if(this['_document']['version'])throw new _0x64ac9c('realtimecollaborationclient-init-document-already-initialized',this);_0x38283f['stop'](),this['_setPendingAction']();const _0x3d4b65=this['editor']['config']['get']('rootsAttributes'),_0x10d5fd=this['_getOperationsFromInitData'](_0x19dcf3,_0x3d4b65);0x0==_0x10d5fd['length']&&_0x10d5fd['push'](new _0x575b2e(0x0)),_0x38283f['return']=this['_connectService'](_0x10d5fd)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x5c3b08=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x5c3b08))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x4a26d9,[_0x3b7af6,_0x42c670])=>{_0x4a26d9['stop']();const _0x20ac74=this['editor']['model']['document']['getRoot'](_0x3b7af6);if(!this['_knownRootNames']['has'](_0x3b7af6)){const _0x5e7b09=_0x42c670&&_0x42c670['data']?_0x42c670['data']:'',_0x4755c6=_0x42c670&&_0x42c670['attributes']?_0x42c670['attributes']:{};await this['_loadRoot'](_0x3b7af6,_0x5e7b09,_0x4755c6);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x20ac74['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x20ac74);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x5084f8){const _0x84da3f=this['editor']['plugins']['get'](_0x449269),{connection:_0x340568}=this['editor']['plugins']['get'](c),_0x58ae60=new Set();for(const _0x3c5907 of _0x5084f8){const _0x39d42f=_0x3c5907['_authorId'];_0x39d42f&&!_0x84da3f['getUser'](_0x39d42f)&&_0x58ae60['add'](_0x39d42f);}if(0x0===_0x58ae60['size'])return;const _0x253105=await dt['getMany'](_0x340568,Array['from'](_0x58ae60));for(const _0x4991a1 of _0x253105)_0x84da3f['getUser'](_0x4991a1['id'])||_0x84da3f['addUser'](_0x4991a1);}['_getOperationsFromInitData'](_0x3727e1,_0x1f496f={}){const _0x584388=this['editor']['model'],_0x34a9a3=[];let _0x1fe943=0x0;const _0x5aa8b6='string'==typeof _0x3727e1?{'main':_0x3727e1}:_0x3727e1;for(const _0x9c37f8 of Object['keys'](_0x5aa8b6)){if(!this['_document']['roots']['has'](_0x9c37f8))throw new _0x64ac9c('realtimecollaborationclient-init-non-existent-root',this);const _0x391dc0=this['editor']['data']['parse'](_0x5aa8b6[_0x9c37f8]),_0x1a797f=this['_document']['getRoot'](_0x9c37f8),_0x68fb74=new _0x4a16eb(_0x584388['createPositionAt'](_0x1a797f,0x0),_0x391dc0,_0x1fe943++);_0x34a9a3['push'](_0x68fb74);for(const [_0x207d70,_0x11aaed]of _0x391dc0['markers']){const _0x2662d6=_0x584388['createRange'](_0x584388['createPositionFromPath'](_0x1a797f,_0x11aaed['start']['path']['slice']()),_0x584388['createPositionFromPath'](_0x1a797f,_0x11aaed['end']['path']['slice']())),_0x25be45=new _0xc512eb(_0x207d70,null,_0x2662d6,_0x584388['markers'],!0x0,_0x1fe943++);_0x34a9a3['push'](_0x25be45);}}if(_0x1f496f)for(const [_0x1f5d4b,_0x295ad7]of Object['entries'](_0x1f496f)){const _0x497561=_0x584388['document']['getRoot'](_0x1f5d4b);if(!_0x497561)throw new _0x64ac9c('multi-root-editor-root-attributes-no-root',null);for(const [_0x360e6c,_0x5e9aa9]of Object['entries'](_0x295ad7))if(null!==_0x5e9aa9){const _0x10b8e3=new _0x106729(_0x497561,_0x360e6c,null,_0x5e9aa9,_0x1fe943++);_0x34a9a3['push'](_0x10b8e3);}}return _0x34a9a3;}async['_loadRoot'](_0x10580a,_0x5a64b5,_0x59bfe9){this['_getOperationsFromInitData']({[_0x10580a]:_0x5a64b5},{[_0x10580a]:_0x59bfe9})['forEach']((_0x5245d9,_0x5e94bc)=>{_0x5245d9['baseVersion']=this['_document']['version']+_0x5e94bc,_0x5245d9['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x5245d9);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x397559,_0x487033){let _0x250285;this['_offset']=_0x397559['offset'];const _0x183d33=_0x397559['wereChangesApplied']&&!_0x397559['initData'],_0x574273=_0x183d33?0x0:_0x397559['data']['baseVersion'];if(_0x487033['forEach'](_0x413092=>{_0x413092['_isInit']=!0x0,_0x413092['createdAt']=_0x397559['sessionCreatedAt'],_0x413092['_authorId']=null;}),_0x183d33)_0x250285=_0x487033,this['_applyOperationsSet'](_0x250285,_0x183d33);else{if(_0x397559['initData']){const _0x2d1fa3=this['_getOperationsFromInitData'](_0x397559['initData']);this['_document']['history']['version']=-_0x2d1fa3['length'],_0x2d1fa3['forEach'](_0x492d8c=>{_0x492d8c['baseVersion']-=_0x2d1fa3['length'],_0x492d8c['createdAt']=_0x397559['sessionCreatedAt'],_0x492d8c['_isInit']=!0x0,_0x492d8c['_authorId']=null;}),this['_applyOperationsSet'](_0x2d1fa3,!0x0),this['serverHistory']['version']=-_0x2d1fa3['length']+this['_offset'],this['_updateServerHistory'](_0x2d1fa3);}this['_document']['history']['version']=_0x574273,_0x250285=this['_decompressOperations'](_0x397559['data'],_0x397559['metadata']),await this['_fetchMissingUsers'](_0x250285),this['_applyOperationsSet'](_0x250285,_0x183d33);}_0x397559['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x250285,_0x397559['lastOperationId']),this['_lastSyncedOperationId']=_0x397559['lastOperationId']),this['serverHistory']['version']=_0x574273+this['_offset'],this['_updateServerHistory'](_0x250285),_0x487033['filter'](_0x5891e2=>{const _0x133c15=this['_getAffectedRoot'](_0x5891e2);return _0x133c15&&!this['_knownRootNames']['has'](_0x133c15);})['forEach']((_0x1bffd5,_0x30e0ab)=>{_0x1bffd5['baseVersion']=this['_document']['version']+_0x30e0ab,this['_saveOperationInBuffer'](_0x1bffd5);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x29e257,_0x5fc796){const _0x535fc3=_0x5fc796&&_0x5fc796['message'];if(_0x535fc3&&_0x535fc3['startsWith']('realtimecollaborationclient'))throw _0x5fc796;const _0x1f5d35=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x1f5d35['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x64ac9c(_0x29e257,this['editor'],_0x535fc3?{'originalError':_0x535fc3}:void 0x0);}['_saveOperationInBuffer'](_0x352a19){this['_knownOperations']['has'](_0x352a19)||(this['_knownOperations']['add'](_0x352a19),this['_bufferedOperations']['push'](_0x352a19),this['_pendingAction']||'marker'==_0x352a19['type']&&!_0x352a19['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x586662=!0x1){!_0x586662&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3fb236=>{_0x3fb236&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x11c6d0=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x54bbd1){return _0x54bbd1['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x54bbd1['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x54bbd1['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x11c6d0)||this['_crash'](_0x11c6d0['message'],_0x11c6d0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5a4477=>{this['on']('change:_isPendingUpdate',()=>{_0x5a4477();});});}async['_sendBufferedOperations'](){const _0x225a24=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x225a24['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1da37c=[...this['_bufferedOperations']];for(const _0x219ea3 of _0x1da37c)_0x219ea3['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x219ea3);const _0x2f0572=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1da37c),_0x567a6f=J++,_0x549f14=this['_compressOperations'](_0x1da37c),_0x78c86=await this['_service']['sendOperations'](_0x549f14,_0x549f14['baseVersion'],_0x2f0572);try{return await this['_handleServerResponse'](_0x1da37c,_0x78c86,_0x567a6f);}catch(_0x229489){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x229489);}}async['_handleServerResponse'](_0x246aef,_0x41fd65,_0x471e87){if('error'in _0x41fd65)throw _0x41fd65['error'];let _0x17e00c=!0x1;if(_0x41fd65['wereChangesApplied']){_0x41fd65['lastOperationId']&&(this['_lastSyncedOperationId']=_0x41fd65['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3908ad=>!_0x246aef['includes'](_0x3908ad));for(const _0xe698a0 of _0x246aef)_0xe698a0['createdAt']='lastOperationAcceptedAt'in _0x41fd65&&_0x41fd65['lastOperationAcceptedAt']||void 0x0;X(_0x246aef,_0x41fd65['version']-_0x246aef['length']),this['_updateServerHistory'](_0x246aef);const _0x109beb=_0x246aef['filter'](_0x5f0560=>{if(!_0x5f0560['_isInit'])return!0x1;const _0x60e96a=this['_getAffectedRoot'](_0x5f0560);return _0x60e96a&&!this['_knownRootNames']['has'](_0x60e96a);});X(_0x109beb,this['_document']['version']),this['_applyOperationsSet'](_0x109beb),_0x17e00c=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x864d28=this['_decompressOperations'](_0x41fd65['data'],_0x41fd65['metadata'])['filter'](_0x199cd7=>_0x199cd7['baseVersion']>=this['_lastServerVersion']);_0x864d28['forEach'](_0xa2fa26=>this['_addKnownRoot'](_0xa2fa26)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x7e09e0=>!_0x7e09e0['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x7e09e0))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x864d28),_0x17e00c=this['_handleExternalOperations'](_0x864d28,_0x41fd65['version'],_0x41fd65['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x17e00c?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x316248,_0x451405,_0x8f9bdc){try{const _0x50d58f={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x16b3e9,operationsB:_0x5d467a,originalOperations:_0x3586b6}=_0x2d1e05(_0x316248,this['_bufferedOperations'],_0x50d58f);X(_0x16b3e9,this['_document']['version']),X(_0x5d467a,_0x451405);for(const _0x599317 of _0x16b3e9){const _0x21e6d4=_0x3586b6['get'](_0x599317);_0x599317['_authorId']=_0x21e6d4?_0x21e6d4['_authorId']:null;}_0x8f9bdc&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x316248,_0x8f9bdc),this['_lastSyncedOperationId']=_0x8f9bdc),this['_bufferedOperations']=[..._0x5d467a],this['_applyOperationsSet'](_0x16b3e9),this['_updateServerHistory'](_0x316248);}catch(_0x39e7fb){return console['error'](_0x39e7fb),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3b51a0,_0x2c94f1=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1d351=>{for(const _0x3ad81c of _0x3b51a0)this['_knownOperations']['add'](_0x3ad81c),this['_addKnownRoot'](_0x3ad81c),_0x1d351['batch']['addOperation'](_0x3ad81c),this['editor']['model']['applyOperation'](_0x3ad81c);});}['_addKnownRoot'](_0x185bd0){const _0x37637b=this['_getAffectedRoot'](_0x185bd0);_0x37637b&&this['_knownRootNames']['add'](_0x37637b);}['_getAffectedRoot'](_0x53a7a8){let _0xa663be,_0x31eefd;switch(_0x53a7a8['type']){case'insert':_0xa663be=_0x53a7a8['position']['root'];break;case'marker':if(_0x31eefd=_0x53a7a8['newRange'],!_0x31eefd)return null;_0xa663be=_0x31eefd['root'];break;case'addRootAttribute':_0xa663be=_0x53a7a8['root'];break;case'addRoot':_0xa663be=_0x53a7a8['affectedSelectable'];break;case'move':_0xa663be=_0x53a7a8['targetPosition']['root'];break;default:return null;}return _0xa663be['rootName'];}['_updateServerHistory'](_0x59958d){_0x59958d['forEach'](_0x30b2d8=>{const _0x2b46a0=_0x30b2d8['clone']();_0x2b46a0['_authorId']=_0x30b2d8['_authorId'],_0x2b46a0['_isInit']=!!_0x30b2d8['_isInit'],_0x2b46a0['createdAt']=_0x30b2d8['createdAt'],_0x2b46a0['baseVersion']+=this['_offset'],_0x30b2d8['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x2b46a0),this['serverHistory']['addOperation'](_0x2b46a0);});}['_handleReconnectionError'](_0x51f325){const _0x1f96c5=this['editor']['plugins']['get']('Notification'),_0x13a8ab=this['editor']['locale'];_0x51f325||(_0x51f325=G(_0x13a8ab,'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.')),_0x1f96c5['showWarning'](_0x51f325,{'title':G(_0x13a8ab,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x2dbc0f)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x2dbc0f)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x3b846a){const _0x4d317b=_0x3b846a['map'](_0x438e3a=>_0x438e3a['toJSON']());return this['_compressor']['compress'](_0x4d317b);}['_decompressOperations'](_0x409915,_0x389b05){return this['_compressor']['decompress'](_0x409915)['map']((_0x35886a,_0xb277dd)=>{const _0x145c9d='init'==_0x389b05[_0xb277dd]['type'];if('InsertOperation'==_0x35886a['__className']){const _0x5b1580=_0x35886a['position']['root'];!this['_document']['getRoot'](_0x5b1580)&&(this['_document']['createRoot']('$root',_0x5b1580)['_isAttached']=!0x1);}const _0x153b3a=_0x14ae82['fromJSON'](_0x35886a,this['_document']);return _0x153b3a['wasUndone']=_0x35886a['wasUndone'],_0x153b3a['_isInit']=_0x145c9d,_0x153b3a['_authorId']=_0x145c9d?null:_0x389b05[_0xb277dd]['userId'],_0x153b3a['_isDisconnection']='cs:removeUser'===_0x389b05[_0xb277dd]['type'],_0x153b3a['createdAt']=_0x389b05[_0xb277dd]['createdAt'],_0x153b3a;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4370cd=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4370cd&&_0x4370cd['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x41a338,_0x2358a1){for(const _0x15f69a of _0x41a338)_0x15f69a['baseVersion']=_0x2358a1++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x145115){this['_ignoredOperations']=_0x145115,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4d7811){let _0x1e91ee=_0x4d7811['length'];for(;_0x1e91ee--;){const _0x4e1037=_0x4d7811[_0x1e91ee];if(!this['_ignoredOperations']['has'](_0x4e1037)){if(!this['_operationToId']['has'](_0x4e1037)){const _0x4d2ce7=_0x5c4947()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4e1037,_0x4d2ce7);}return this['_operationToId']['get'](_0x4e1037);}}}['setIdForTheLastOperation'](_0x2b85f4,_0x55e592){if(!_0x55e592)return;let _0x4155ec=_0x2b85f4['length'];for(;_0x4155ec--;){const _0x4b5033=_0x2b85f4[_0x4155ec];this['_ignoredOperations']['has'](_0x4b5033)||this['_operationToId']['set'](_0x4b5033,_0x55e592);}}}class n extends _0x2be3f4{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x2519a7{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x19e6a1)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x449269];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1f5e41){super(_0x1f5e41),this['_services']=new Map();}async['init'](){const _0x37307e=this['context'],_0x1138d2=_0x37307e['plugins']['get']('CommentsRepository');if(_0x37307e['plugins']['get'](c)['addToReconnectionStack'](this),_0x1138d2['adapter']={'addCommentThread':async({channelId:_0x545772,threadId:_0x2dd127,comments:_0x24efb3,resolvedAt:_0x54138b,resolvedBy:_0x30238b,context:_0x5f4d1e,attributes:_0x3bf5cf})=>{const _0x394513=await this['_getService'](_0x545772)['addCommentThread']({'commentThreadId':_0x2dd127,'comments':_0x24efb3['map'](_0x21b531=>function(_0x3fa557,_0x15f831,_0x56d64b){return{'commentThreadId':_0x56d64b,'commentId':_0x3fa557['commentId'],'userId':_0x3fa557['authorId'],'content':_0x3fa557['content'],'documentId':_0x15f831,'createdAt':_0x3fa557['createdAt'],'attributes':_0x3fa557['attributes']||{}};}(_0x21b531,_0x545772,_0x2dd127)),'resolvedAt':_0x54138b,'resolvedBy':_0x30238b,'context':_0x5f4d1e,'attributes':_0x3bf5cf})['catch'](ut);return{'threadId':_0x394513['commentThreadId'],'comments':_0x394513['comments']};},'getCommentThread':async({channelId:_0x480449,threadId:_0x13e5a8})=>{const _0x285c4d=await this['_getService'](_0x480449)['getCommentThread'](_0x13e5a8)['catch'](ut);return _0x285c4d['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x285c4d]),{'threadId':_0x285c4d['commentThreadId'],'comments':_0x285c4d['comments']['map'](_),'context':_0x285c4d['context'],'resolvedAt':_0x285c4d['resolvedAt'],'resolvedBy':_0x285c4d['resolvedBy'],'attributes':_0x285c4d['attributes']||{}});},'updateCommentThread':async({channelId:_0x2ed92e,threadId:_0x719b0e,context:_0x57cc21,unlinkedAt:_0x4809b6,attributes:_0x1ef2f6})=>this['_getService'](_0x2ed92e)['updateCommentThread']({'commentThreadId':_0x719b0e,'context':_0x57cc21,'attributes':_0x1ef2f6,'unlinkedAt':_0x4809b6})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x4bde03,threadId:_0x184cae})=>{const _0x257c61=await this['_getService'](_0x4bde03)['resolveCommentThread'](_0x184cae)['catch'](S)['catch'](ut);return{'threadId':_0x257c61['commentThreadId'],'resolvedAt':_0x257c61['resolvedAt'],'resolvedBy':_0x257c61['resolvedBy']};},'reopenCommentThread':async({channelId:_0x481d2a,threadId:_0x215878})=>this['_getService'](_0x481d2a)['reopenCommentThread'](_0x215878)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x2f3ce6,threadId:_0x586009})=>this['_getService'](_0x2f3ce6)['removeCommentThread'](_0x586009)['catch'](S)['catch'](ut),'addComment':({channelId:_0x4b6a7e,threadId:_0x34fdc3,commentId:_0x2a8757,content:_0x334675,attributes:_0xaeb279})=>this['_getService'](_0x4b6a7e)['addComment'](_0x34fdc3,_0x2a8757,_0x334675,_0xaeb279)['catch'](ut),'updateComment':({channelId:_0x578eea,threadId:_0xffe281,commentId:_0xb76e36,content:_0x4c8e47,attributes:_0x1b1597})=>this['_getService'](_0x578eea)['updateComment'](_0xffe281,_0xb76e36,_0x4c8e47,_0x1b1597)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x57a4d4,threadId:_0x31300f,commentId:_0x1a50b4})=>this['_getService'](_0x57a4d4)['removeComment'](_0x31300f,_0x1a50b4)['catch'](S)['catch'](ut)},_0x37307e instanceof _0x5693c5){const _0x1ef128=_0x37307e['config']['get']('collaboration.channelId'),_0x1c7b76=_0x37307e['plugins']['get'](i);await this['_setUpService'](_0x1ef128);const _0x3050d1=await this['_services']['get'](_0x1ef128)['getConnectedSessions']();this['listenTo'](_0x1c7b76,'sessionAdd:'+_0x1ef128,(_0x3bd38e,{session:_0x7ab35a})=>{_0x7ab35a['id']===_0x1c7b76['mySessionId']&&(_0x3bd38e['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x7ab35a['permissions'],_0x1ef128));}),_0x1c7b76['register'](_0x1ef128,_0x3050d1);}}async['_setUpService'](_0x10a8cb){if(this['_services']['has'](_0x10a8cb))throw new _0x64ac9c('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x10a8cb});const _0x5d0093=this['context']['plugins']['get']('CommentsRepository'),_0x14b524=new a['CommentsService'](_0x10a8cb);this['_services']['set'](_0x10a8cb,_0x14b524),this['listenTo'](_0x14b524,'commentThreadAdded',(_0x257cb0,_0x5bc280)=>{const {commentThreadId:_0x59c21e,documentId:_0x232245,context:_0xec339e,attributes:_0xae8c8b,resolvedAt:_0x51907f,resolvedBy:_0x683fa0,comments:_0x625214}=_0x5bc280;_0x5d0093['getCommentThread'](_0x59c21e)||_0x5d0093['addCommentThread']({'threadId':_0x59c21e,'channelId':_0x232245,'comments':_0x625214?_0x625214['map'](_):[],'context':_0xec339e,'attributes':_0xae8c8b,'resolvedAt':_0x51907f,'resolvedBy':_0x683fa0,'isFromAdapter':!0x0});}),this['listenTo'](_0x14b524,'commentThreadUpdated',(_0x4c5f68,{commentThreadId:_0x12f98f,documentId:_0x1fe010,context:_0x165754,unlinkedAt:_0x5715f0,attributes:_0x3dacc6})=>{_0x5d0093['getCommentThread'](_0x12f98f)&&_0x5d0093['updateCommentThread']({'threadId':_0x12f98f,'channelId':_0x1fe010,'context':_0x165754,'unlinkedAt':_0x5715f0,'attributes':_0x3dacc6,'isFromAdapter':!0x0});}),this['listenTo'](_0x14b524,'commentThreadResolved',(_0x5ce03f,{commentThreadId:_0x50fcb5,resolvedBy:_0x156f58,resolvedAt:_0x28e47b})=>{const _0x5ab5bf=_0x5d0093['getCommentThread'](_0x50fcb5);_0x5ab5bf&&_0x5ab5bf['resolve']({'resolvedBy':_0x156f58,'resolvedAt':_0x28e47b,'isFromAdapter':!0x0});}),this['listenTo'](_0x14b524,'commentThreadReopened',(_0x25be6c,{commentThreadId:_0xcaf1d5})=>{const _0x41ec7f=_0x5d0093['getCommentThread'](_0xcaf1d5);_0x41ec7f&&_0x41ec7f['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x14b524,'commentThreadRemoved',(_0x123941,{commentThreadId:_0x4eaf49})=>{const _0x52e1f6=_0x5d0093['getCommentThread'](_0x4eaf49);_0x52e1f6&&_0x52e1f6['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x14b524,'commentAdded',(_0x5bf521,_0x587db6)=>{const _0xd2c7a0=_0x587db6['commentThreadId'],_0x5d40ce=_0x5d0093['getCommentThread'](_0xd2c7a0);_0x5d40ce&&_0x5d40ce['addComment']({..._(_0x587db6),'isFromAdapter':!0x0});}),this['listenTo'](_0x14b524,'commentUpdated',(_0x408657,{commentThreadId:_0x1f4b19,commentId:_0x48167b,content:_0x4fd1ec,attributes:_0x10f72a})=>{const _0x48b49e=_0x5d0093['getCommentThread'](_0x1f4b19);if(_0x48b49e){const _0x5719b6=_0x48b49e['getComment'](_0x48167b);_0x5719b6&&_0x5719b6['update']({'content':_0x4fd1ec,'attributes':_0x10f72a,'isFromAdapter':!0x0});}}),this['listenTo'](_0x14b524,'commentRemoved',(_0x341e58,{commentThreadId:_0x2fdf0a,commentId:_0x410d98})=>{const _0x511479=_0x5d0093['getCommentThread'](_0x2fdf0a);if(_0x511479){const _0xac3379=_0x511479['getComment'](_0x410d98);_0xac3379&&_0xac3379['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x10a8cb);}['destroy'](){if(this['context']instanceof _0x5693c5){const _0x5acea7=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x5acea7);}}['_terminateService'](_0xfedd99){if(!this['_services']['has'](_0xfedd99))throw new _0x64ac9c('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0xfedd99});this['_getService'](_0xfedd99)['disconnect'](),this['_services']['delete'](_0xfedd99);}async['reconnect'](){for(const _0x2bfaf5 of this['_services']['keys']())await this['_connectService'](_0x2bfaf5);if(this['context']instanceof _0x5693c5){const _0x4bbdcf=this['context']['config']['get']('collaboration.channelId'),_0x404341=this['context']['plugins']['get'](i);_0x404341['unregister'](_0x4bbdcf);const _0x35edd3=await this['_services']['get'](_0x4bbdcf)['getConnectedSessions']();_0x404341['register'](_0x4bbdcf,_0x35edd3);}}async['_connectService'](_0x26b9cf){const {connection:_0xdc9fb}=this['context']['plugins']['get'](c),_0x5b8639=this['context']['plugins']['get']('CommentsRepository'),_0x3a389d=this['_services']['get'](_0x26b9cf),_0x487201=await _0x3a389d['connect'](_0xdc9fb);await this['_fetchMissingUsersForThreads'](_0x487201);const _0x271711=new Set(Array['from'](_0x5b8639['getCommentThreads']({'channelId':_0x26b9cf}),_0x3cd59b=>_0x3cd59b['id']));for(const _0xbb1519 of _0x487201)_0xbb1519['deletedAt']||_0x271711['delete'](_0xbb1519['commentThreadId']);for(const _0x56a998 of _0x271711)_0x5b8639['getCommentThread'](_0x56a998)['remove']({'isFromAdapter':!0x0});for(const _0x412895 of _0x487201){let _0x204573=_0x5b8639['getCommentThread'](_0x412895['commentThreadId']);const {commentThreadId:_0x5a4b2c,context:_0x53b3a9,attributes:_0x5aee27,resolvedBy:_0x320aaf,resolvedAt:_0x3520c7,unlinkedAt:_0x58ce29,deletedAt:_0x281169}=_0x412895;if(_0x281169)continue;_0x204573||(_0x204573=_0x5b8639['addCommentThread']({'channelId':_0x26b9cf,'threadId':_0x5a4b2c,'context':_0x53b3a9,'attributes':_0x5aee27||{},'resolvedBy':_0x320aaf,'resolvedAt':_0x3520c7,'unlinkedAt':_0x58ce29,'isFromAdapter':!0x0}));const _0x370142=new Set(Array['from'](_0x204573['comments'],_0x54de98=>_0x54de98['id']));for(const _0x32852b of _0x412895['comments'])_0x370142['delete'](_0x32852b['commentId']);for(const _0x4b2ed1 of _0x370142)_0x204573['getComment'](_0x4b2ed1)['remove']({'isFromAdapter':!0x0});for(const _0x292d8f of _0x412895['comments']){const _0xdf0529=_0x204573['getComment'](_0x292d8f['commentId']);_0xdf0529?_0xdf0529['content']!==_0x292d8f['content']&&_0xdf0529['update']({'content':_0x292d8f['content'],'isFromAdapter':!0x0}):_0x204573['addComment'](Object['assign'](_(_0x292d8f),{'isFromAdapter':!0x0}));}}}['_getService'](_0x3e8a2f){if(!this['_services']['has'](_0x3e8a2f))throw new _0x64ac9c('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x3e8a2f});return this['_services']['get'](_0x3e8a2f);}async['_fetchMissingUsersForThreads'](_0xb8e446){const _0x555d1f=this['context']['plugins']['get'](_0x449269),{connection:_0xabdc3c}=this['context']['plugins']['get'](c),_0x2eda3c=new Set();for(const {resolvedBy:_0x449793,comments:_0x55d2fa}of _0xb8e446){_0x449793&&!_0x555d1f['getUser'](_0x449793)&&_0x2eda3c['add'](_0x449793);for(const {userId:_0x5968d1}of _0x55d2fa)_0x555d1f['getUser'](_0x5968d1)||_0x2eda3c['add'](_0x5968d1);}if(0x0===_0x2eda3c['size'])return;const _0x182f1a=await dt['getMany'](_0xabdc3c,Array['from'](_0x2eda3c));for(const _0x1e84e5 of _0x182f1a)_0x555d1f['getUser'](_0x1e84e5['id'])||_0x555d1f['addUser'](_0x1e84e5);}}async function S(_0x437a65){if('404'!==_0x437a65['code'])throw _0x437a65;}function ut(_0x1de819){if((_0x29895c=_0x1de819)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x29895c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x29895c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x29895c;throw _0x1de819;}function _(_0x4852da){return{'threadId':_0x4852da['commentThreadId'],'commentId':_0x4852da['commentId'],'content':_0x4852da['content'],'createdAt':_0x4852da['createdAt'],'authorId':_0x4852da['userId'],'attributes':_0x4852da['attributes']||{}};}class f extends _0x2be3f4{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ce9aa){super(_0x2ce9aa);const _0x58267a=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x58267a);}['init'](){const _0x214321=this['editor']['plugins']['get'](c),_0x509993=this['editor']['plugins']['get']('TrackChangesEditing');return _0x509993['adapter']={'getSuggestion':async _0x1bd1a2=>{await this['_waitForServiceReady']();const _0x327b83=await this['_trackChangesService']['get'](_0x1bd1a2)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x327b83]),_0x327b83;},'addSuggestion':async({id:_0x23c98d,type:_0x146dd2,data:_0x179472,originalSuggestionId:_0x40e057,attributes:_0x5d5858})=>{await this['_waitForServiceReady']();const _0x14fa81={'id':_0x23c98d,'type':_0x146dd2,'data':_0x179472,'originalSuggestionId':_0x40e057,'attributes':_0x5d5858},_0xca0303=await this['_trackChangesService']['add'](_0x23c98d,_0x146dd2,_0x179472,_0x40e057,_0x5d5858)['catch'](_0x4316d3=>{if(ft(_0x4316d3))return new Promise(_0x1407bf=>{this['_bufferedRequests']['set'](_0x23c98d,{'resolve':_0x1407bf,'suggestionData':_0x14fa81});});throw _0x4316d3;});return this['_bufferedRequests']['delete'](_0x23c98d),_0xca0303;},'updateSuggestion':async(_0x585375,_0x58a77d)=>{if(await this['_waitForServiceReady'](),'open'!==_0x58a77d['state'])return this['_trackChangesService']['update'](_0x585375,_0x58a77d)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x122e86,_0x4fd5b6)=>{_0x509993['hasSuggestion'](_0x4fd5b6['id'])&&(_0x509993['getSuggestion'](_0x4fd5b6['id'])['attributes']=_0x4fd5b6['attributes']);}),this['_trackChangesService']['connect'](_0x214321['connection'])['then'](_0x34b08e=>(_0x214321['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x34b08e)['then'](()=>{for(const _0x1f7506 of _0x34b08e){_0x509993['addSuggestionData'](_0x1f7506)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5306ae=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x499ccc}=this['editor']['plugins']['get'](c),_0x1ac527=await this['_trackChangesService']['connect'](_0x499ccc);await this['_fetchMissingUsersForThreads'](_0x1ac527);for(const {suggestionData:_0x388545,resolve:_0x34360c}of this['_bufferedRequests']['values']()){let _0x2cc4ff=_0x1ac527['find'](_0x18cc20=>_0x18cc20['id']===_0x388545['id']);_0x2cc4ff||(_0x2cc4ff=await this['_trackChangesService']['add'](_0x388545['id'],_0x388545['type'],_0x388545['data'],_0x388545['originalSuggestionId'])),_0x34360c(_0x2cc4ff);}for(const _0x1b77be of _0x1ac527)_0x5306ae['hasSuggestion'](_0x1b77be['id'])||_0x5306ae['addSuggestionData'](_0x1b77be);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x8f5ef1=>{this['listenTo'](this['_trackChangesService'],'connected',_0x3d2951=>{_0x3d2951['off'](),_0x8f5ef1();});});}async['_fetchMissingUsersForThreads'](_0x10edcd){const _0x49eeae=this['editor']['plugins']['get'](_0x449269),{connection:_0x2c6719}=this['editor']['plugins']['get'](c),_0x420d86=new Set();for(const {authorId:_0x3df18a}of _0x10edcd)_0x49eeae['getUser'](_0x3df18a)||_0x420d86['add'](_0x3df18a);if(0x0===_0x420d86['size'])return;const _0x5c24a5=await dt['getMany'](_0x2c6719,Array['from'](_0x420d86));for(const _0x476f55 of _0x5c24a5)_0x49eeae['getUser'](_0x476f55['id'])||_0x49eeae['addUser'](_0x476f55);}}function R(_0x530255){if(ft(_0x530255))return new Promise(()=>{});throw _0x530255;}function ft(_0xc0458f){return _0xc0458f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xc0458f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x2be3f4{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4db41f=this['editor']['plugins']['get'](c),_0x3ff203=this['editor']['plugins']['get']('CommentsEditing'),_0x30d55c=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x4db41f,'change:state',(_0x4caffb,_0x1ae46a,_0x4174f0)=>{_0x3ff203['isThreadsLoadingPaused']='connected'!==_0x4174f0;});}),this['listenTo'](_0x4db41f,'change:state',(_0xc227ec,_0x2e4b7c,_0x48fe7e)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x48fe7e);}),_0x30d55c['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x2be3f4{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x2be3f4{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x449269];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3df74d){super(_0x3df74d);const _0x2b224f=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x2b224f);}async['init'](){const _0x5738a2=this['editor']['plugins']['get'](l),_0x395765=_0x5738a2['serverHistory'],_0x239928=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x395765,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5738a2['sessionId']});const _0x3bca3c=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x24115e=await tt['isBundleUploaded'](_0x239928['connection'],_0x3bca3c);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x5de0ee})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5de0ee)),'updateRevisions':async _0x32dd59=>{await this['_waitForServiceReady']();const _0x89c644=this['_revisionTracker']['currentRevision'];if(_0x24115e&&0x1===_0x32dd59['length']&&_0x32dd59[0x0]['id']===_0x89c644['id'])return _0x32dd59;for(const _0x26242d of _0x32dd59)_0x26242d['id']===_0x89c644['id']&&(_0x26242d['isEmptyCurrent']=_0x26242d['fromVersion']===_0x26242d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x32dd59,this['_lastRequestId'])['then'](_0x51b4c8=>(this['_lastRequestId']=_0x51b4c8,_0x32dd59))['catch'](_0x363b06=>{if(st(_0x363b06)||'400'===_0x363b06['code']&&void 0x0!==_0x363b06['data']['wrongRequestId']){for(const _0x5d02ab of _0x32dd59){!this['_revisionTracker']['repository']['getRevision'](_0x5d02ab['id'])||this['_revisionTracker']['_bufferUpdate'](_0x5d02ab['id'],_0x5d02ab,!0x1);}if(st(_0x363b06))throw _0x363b06;return _0x32dd59;}throw _0x363b06;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x5d8f5a,{revisionsData:_0x12b1c9,requestId:_0x5a8b84})=>{Math['max'](..._0x12b1c9['map'](_0x2fa9c0=>_0x2fa9c0['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x12b1c9,_0x5a8b84);}):this['_handleRevisionsUpdate'](_0x12b1c9,_0x5a8b84);});const {revisions:_0x385eea,requestId:_0x45bdf2}=await this['_revisionHistoryService']['connect'](_0x239928['connection']);_0x239928['addToReconnectionStack'](this),this['_lastRequestId']=_0x45bdf2,await this['_fetchMissingUsers'](_0x385eea);for(const _0x176cd5 of _0x385eea)this['_revisionTracker']['addRevisionData'](_0x176cd5);this['listenTo'](_0x5738a2,'change:_isConnected',(_0x519013,_0xde8fc2,_0x57e879)=>{_0x57e879&&(this['_oldOffset']=_0x5738a2['_offset'],_0x519013['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x239928,'state',_0x115af9=>_0x115af9===_0x1c1fcd['CONNECTED']);}async['reconnect'](){const _0x16e179=this['editor']['plugins']['get'](c),_0x56fd85=this['editor']['plugins']['get'](l),_0x462ba8=async()=>{const _0x8676b7=this['_revisionTracker']['currentRevision'],_0x4838e5=_0x8676b7['id'],_0x472582=_0x4838e5!==_0x56fd85['sessionId'];if(_0x472582){const _0x5cdb2a=_0x56fd85['_offset']-this['_oldOffset'],_0x178d2d=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x8676b7['toVersion']+_0x5cdb2a!==_0x178d2d){const _0xf2aff7=_0x8676b7['fromVersion']+_0x5cdb2a,_0x19bbac=this['editor']['plugins']['get'](_0x449269),_0x2e98fe=this['_revisionTracker']['buildRevisionData']({'revision':_0x8676b7,'from':_0xf2aff7,'to':_0x178d2d});_0x2e98fe['id']=_0x8676b7['id'];const _0x33fdce=_0x2e98fe['authorsIds']['map'](_0x3f7193=>_0x19bbac['getUser'](_0x3f7193));_0x8676b7['_update']({..._0x2e98fe,'authors':_0x33fdce},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x8676b7['id'],_0x2e98fe,!0x0);}this['_revisionTracker']['_startingVersion']=_0x178d2d,(_0x8676b7['toVersion']===_0x8676b7['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x4838e5)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x4838e5),this['_revisionTracker']['_createCurrentRevision'](_0x178d2d));}const {revisions:_0x482f7b,requestId:_0x41089e}=await this['_revisionHistoryService']['reconnect'](_0x16e179['connection'],this['_lastRequestId']);_0x472582&&_0x482f7b['length']>0x0?_0x56fd85['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x482f7b),this['_handleRevisionsUpdate'](_0x482f7b,_0x41089e),this['_revisionTracker']['sendBufferedUpdates']());};return _0x56fd85['_isConnected']?_0x462ba8():new Promise((_0x43159f,_0x30491f)=>{_0x56fd85['once']('change:_isConnected',()=>{_0x462ba8()['then'](_0x43159f)['catch'](_0x30491f);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x119a44=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x1f18b4=>{_0x1f18b4['off'](),_0x119a44();});});}['_getLatestVersionFromServerOperations'](){const _0x3fca4f=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x5eab27 of _0x3fca4f)if('marker'!==_0x5eab27['type']||_0x5eab27['affectsData'])return _0x5eab27['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1ba166=this['editor']['plugins']['get'](l);return new Promise(_0x247c93=>{_0x1ba166['_isPendingUpdate']?_0x1ba166['once']('change:_isPendingUpdate',()=>{_0x247c93(this['_getLatestVersionFromServerOperations']());}):_0x247c93(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x16d518,_0x5f0db6){const _0x4df908=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5f0db6;for(const _0x4dd5e4 of _0x16d518){const _0x8568d0=_0x4df908['getRevision'](_0x4dd5e4['id']);if(_0x8568d0){if((_0x4dd5e4['fromVersion']||_0x4dd5e4['toVersion'])&&(_0x4dd5e4['diffData']=null),_0x8568d0===this['_revisionTracker']['currentRevision']){const _0x457d36=Math['max'](_0x8568d0['toVersion'],_0x4dd5e4['toVersion']),_0x3f1ff5=Math['max'](_0x8568d0['fromVersion'],_0x4dd5e4['fromVersion']);let _0x17b57f;_0x8568d0['toVersion']===_0x4dd5e4['toVersion']&&_0x8568d0['fromVersion']===_0x4dd5e4['fromVersion']?(_0x17b57f=!0x0,this['_preventResendingRevisionData'](_0x4dd5e4)):_0x4dd5e4['toVersion']===_0x457d36&&_0x4dd5e4['fromVersion']===_0x3f1ff5?_0x17b57f=!0x1:(_0x8568d0['toVersion']===_0x457d36&&_0x8568d0['fromVersion']===_0x3f1ff5||this['_fixRevision']({'revision':_0x8568d0,'from':_0x3f1ff5,'to':_0x457d36}),_0x17b57f=!0x0),_0x17b57f&&(delete _0x4dd5e4['fromVersion'],delete _0x4dd5e4['toVersion'],delete _0x4dd5e4['diffData'],delete _0x4dd5e4['createdAt'],delete _0x4dd5e4['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x4dd5e4),this['_preventResendingRevisionData'](_0x4dd5e4);}else this['_revisionTracker']['addRevisionData'](_0x4dd5e4);}const _0x8ac14c=_0x4df908['getRevisions']();_0x8ac14c['reverse']();for(let _0x29482a=0x0;_0x29482a<_0x8ac14c['length']-0x1;_0x29482a++){const _0x1092ee=_0x8ac14c[_0x29482a],_0x216258=_0x8ac14c[_0x29482a+0x1];if(_0x1092ee['fromVersion']<_0x216258['toVersion']){const _0x151c1b=_0x216258['toVersion'],_0x5ed88c=Math['max'](_0x151c1b,_0x1092ee['toVersion']);this['_fixRevision']({'revision':_0x1092ee,'from':_0x151c1b,'to':_0x5ed88c});}}}['_fixRevision']({revision:_0x4001cd,from:_0x27d293,to:_0x11b334}={}){const _0x22dc01=this['editor']['plugins']['get'](_0x449269),_0x3bb5f5=this['_revisionTracker']['buildRevisionData']({'revision':_0x4001cd,'from':_0x27d293,'to':_0x11b334});_0x3bb5f5['authors']=_0x3bb5f5['authorsIds']['map'](_0x362414=>_0x22dc01['getUser'](_0x362414)),_0x4001cd['_update'](_0x3bb5f5);}['_preventResendingRevisionData'](_0x521b81){const _0x558dcf={};_0x558dcf['id']=_0x521b81['id'];for(const _0x309fcc of Object['keys'](_0x521b81))'id'!==_0x309fcc&&(_0x558dcf[_0x309fcc]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x558dcf['id'],_0x558dcf,!0x0);}async['_fetchMissingUsers'](_0x9f81f8){const _0x4d111b=this['editor']['plugins']['get'](_0x449269),{connection:_0xa4b1a5}=this['editor']['plugins']['get'](c),_0x3b4ed4=new Set();for(const _0x5174b9 of _0x9f81f8){for(const _0x331e4f of _0x5174b9['authorsIds'])_0x160d73(_0x331e4f);_0x5174b9['creatorId']&&_0x160d73(_0x5174b9['creatorId']);}if(0x0===_0x3b4ed4['size'])return;const _0x1ce0b3=await dt['getMany'](_0xa4b1a5,Array['from'](_0x3b4ed4));for(const _0x59cf9a of _0x1ce0b3)_0x4d111b['getUser'](_0x59cf9a['id'])||_0x4d111b['addUser'](_0x59cf9a);function _0x160d73(_0xea29df){_0x4d111b['getUser'](_0xea29df)||_0x3b4ed4['add'](_0xea29df);}}}function st(_0x7bf542){return _0x7bf542['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x7bf542['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x7bf542['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x2be3f4{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x2b7110{['_collapseAt'];constructor(_0x315b22,_0x331f69=0x6){super(_0x315b22);const _0x52c466=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x331f69,this['bind']('isHidden')['to'](this,'usersCount',_0x124dab=>_0x124dab<_0x331f69),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x52c466['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':_0x52c466['to']('usersCount',_0x3beeb9=>'+'+(_0x3beeb9-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x2b7110{['items'];['keystrokes'];constructor(_0x415e77){super(_0x415e77);const _0x19e56e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x19a0cb(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x19e56e['if']('hasPopup'),'aria-expanded':_0x19e56e['to']('isExpanded',_0x244681=>this['hasPopup']&&String(_0x244681)),'aria-label':_0x19e56e['to']('hasPopup',_0x3d2cd8=>G(_0x415e77,_0x3d2cd8?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x19e56e['to']('hasPopup',_0x941d7e=>!!_0x941d7e&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x19e56e['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x19e56e['to'](_0x5b7a5e=>{const _0x5877ee=_0x5b7a5e,_0x1f4736=document['querySelector']('.ck-presence-list__dropdown-list'),_0x182d5d=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1f4736?.['contains'](_0x5877ee['relatedTarget'])||_0x182d5d?.['contains'](_0x5877ee['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x59f4a4,_0x1d4786,_0x14762d)=>{this['element']&&(_0x14762d?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 j extends _0x2b7110{['counterView'];['inlineListView'];constructor(_0x10293c,_0x1ea83c=0x6){super(_0x10293c);const _0x226fb6=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x1ea83c),this['inlineListView']=new ts(_0x10293c),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3ababb of this['inlineListView']['items'])_0x3ababb['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',_0x226fb6['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x2b7110{['listWrapperView'];constructor(_0x14ad03,_0x5a1ea8){super(_0x14ad03);const _0x357e84=this['bindTemplate'];this['listWrapperView']=new mt(_0x14ad03,_0x5a1ea8),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x14ad03,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x357e84['to'](_0x27b453=>{const _0x49071e=_0x27b453,_0x4d2fcb=document['querySelector']('.ck-presence-list__list'),_0x3a29e9=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4d2fcb?.['contains'](_0x49071e['relatedTarget'])||_0x3a29e9?.['contains'](_0x49071e['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x58ee55{constructor(_0x2300cf,_0x155b85){super(_0x2300cf);const _0x212dd7=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x155b85?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x212dd7['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x212dd7['to']('role'),'aria-label':_0x212dd7['to']('ariaLabel'),'aria-labelledby':_0x212dd7['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1c8415['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x2c5cf7=this['element'];_0x2c5cf7&&(this['_isScrollable']=Math['max'](_0x2c5cf7['scrollHeight'],_0x2c5cf7['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x46fd11,_0x3efa5a,_0x5909a8){super(_0x46fd11);const _0x1460d0=this['bindTemplate'];this['userView']=new ct(_0x46fd11,_0x3efa5a);const _0xbfcc9={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x3efa5a['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x3efa5a['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3efa5a['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5909a8&&(_0xbfcc9['tag']='button',_0xbfcc9['on']={'click':_0x1460d0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xbfcc9);}['focus'](){this['element']['focus']();}}class y extends _0x2b7110{['userView'];['markerView'];constructor(_0x1a3749,_0x44041c,_0x302fb7){super(_0x1a3749);const _0x1bbef9=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x1a3749,_0x44041c),this['markerView']=new at(_0x1a3749,_0x44041c);const _0x8d1c1a=new ot(_0x1a3749);_0x8d1c1a['template']['tag']='span',_0x8d1c1a['text']=_0x44041c['name'];const _0x3c65e1={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1bbef9['to']('isFocusable',_0x55e59f=>!!_0x55e59f&&0x0),'aria-labelledby':_0x8d1c1a['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1bbef9['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1bbef9['to']('hasTooltip',_0x3c6830=>!_0x3c6830),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x8d1c1a]};_0x302fb7&&(_0x3c65e1['tag']='button',_0x3c65e1['on']={'click':_0x1bbef9['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3c65e1);}}class at extends _0x2b7110{constructor(_0x58565e,_0x473c98){super(_0x58565e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x473c98['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x2519a7{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a101f){super(_0x4a101f),this['context']['config']['define']('presenceList',C);const _0x40fa90=_0x4a101f['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x40fa90)throw new _0x64ac9c('presencelist-collapseat-invalid-format',this);if(_0x40fa90<0x1)throw new _0x64ac9c('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1c089a(),this['balloonPanelView']=new _0xee9b38(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x59cc0c of this['_allConnectedUsers'])this['_handleUserAdd'](_0x59cc0c);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1866ab,_0x11ce9c)=>{this['_handleUserAdd'](_0x11ce9c);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x3e9fd2,_0xd7ac6a)=>{this['_handleUserRemove'](_0xd7ac6a);});}['_createView'](){const _0x1185d2=this['context'],_0x6104c7=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3dc1f3=this['balloonPanelView'];if(!_0x3feb0d(_0x1185d2['config']['get']('presenceList.container')))throw new _0x64ac9c('presencelist-missing-container',this);return _0x6104c7['counterView']['bind']('usersCount')['to'](this),_0x6104c7['bind']('isCollapsed')['to'](this,'usersCount',_0x5e5daa=>{const {collapseAt:_0x47c207}=_0x1185d2['config']['get']('presenceList'),_0x24455f=_0x5e5daa>=_0x47c207;if(_0x24455f&&!_0x6104c7['inlineListView']['items']['find'](_0x359ca7=>_0x359ca7 instanceof A)){const _0x19ee56=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x19ee56&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x6104c7['inlineListView']['items']['add'](_0x6104c7['counterView']);}return _0x24455f||this['hideDropdown'](),_0x24455f;}),_0x6104c7['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x238957=>{const _0x3d91bd=_0x1185d2['config']['get']('presenceList'),_0x2a2165=new y(_0x1185d2['locale'],_0x238957,!!_0x3d91bd['onClick']);return _0x2a2165['bind']('hasTooltip')['to'](_0x6104c7,'isCollapsed',_0x2159d7=>!_0x2159d7),_0x2a2165['bind']('isFocusable')['to'](_0x6104c7,'isCollapsed',_0x320292=>!_0x320292),_0x3d91bd['onClick']&&this['listenTo'](_0x2a2165,'execute',()=>{this['view']['isCollapsed']||_0x3d91bd['onClick'](_0x238957,_0x2a2165['element']);}),_0x2a2165;}),this['listenTo'](_0x6104c7['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x6104c7['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x6104c7['inlineListView']['keystrokes']['set']('Enter',(_0x3f2d9b,_0x5d4030)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x5d4030());}),_0x6104c7['render'](),_0x3dc1f3['render'](),_0x3dfbaf({'emitter':_0x6104c7,'activator':()=>_0x3dc1f3['isVisible'],'contextElements':[_0x3dc1f3['element'],_0x6104c7['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1185d2['config']['get']('presenceList.container')['appendChild'](_0x6104c7['element']),this['_bodyCollection']=new _0x55a4bd(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x6104c7;}['_handleUserAdd'](_0x557aa3){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x557aa3['isMe'])return;const _0x949ebe=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x949ebe-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4de9b4=_0x557aa3['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x557aa3,_0x4de9b4);}['_handleUserRemove'](_0x513ecc){this['usersCount']--;const {collapseAt:_0x15c266}=this['context']['config']['get']('presenceList'),_0x117b5f=this['usersCount']>=_0x15c266;if(this['currentDisplayedUsers']['get'](_0x513ecc['id']))this['currentDisplayedUsers']['remove'](_0x513ecc['id']);else{if(_0x117b5f&&this['currentDisplayedUsers']['length']+0x1===_0x15c266-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x117b5f?0x1:0x0)<this['usersCount']){for(const _0x1f85f2 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1f85f2['id'])&&(this['currentDisplayedUsers']['add'](_0x1f85f2,Math['min'](this['currentDisplayedUsers']['length']-(_0x117b5f?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x117b5f?0x1:0x0)===_0x15c266-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x23af5e=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x23af5e['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1e1ffa}=this['presenceDropdownView'];_0x1e1ffa['items']['bindTo'](this['_allConnectedUsers'])['using'](_0xa2d3e9=>{if(!_0x23af5e['displayMe']&&_0xa2d3e9['isMe'])return null;const _0x254d05=new k(this['context']['locale'],_0xa2d3e9,!!_0x23af5e['onClick']);return _0x23af5e['onClick']&&this['listenTo'](_0x254d05,'execute',()=>{_0x23af5e['onClick'](_0xa2d3e9,_0x254d05['element']);}),_0x254d05;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1e1ffa['focus'](),_0x1e1ffa['checkIfScrollable']();const _0x5f0c56=(_0x495cff,_0x537eeb)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x537eeb();};_0x1e1ffa['keystrokes']['set']('Esc',_0x5f0c56),_0x1e1ffa['keystrokes']['set']('Shift+Tab',_0x5f0c56),_0x1e1ffa['keystrokes']['set']('Tab',(_0x248716,_0x3433e6)=>{!function(_0x15a8f8){const _0x37b22c=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x1eab91=>_0x1eab91+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x4202c9=[...document['body']['querySelectorAll'](_0x37b22c)]['filter'](_0xaba20b=>_0xaba20b===document['activeElement']||_0xaba20b['offsetWidth']+_0xaba20b['offsetHeight']>0x0)['sort']((_0x1d5889,_0x3bd8e3)=>(_0x1d5889['tabIndex']||0x0)-(_0x3bd8e3['tabIndex']||0x0)),_0x26a114=_0x4202c9['indexOf'](_0x15a8f8),_0x3f57c4=_0x4202c9[(_0x26a114+0x1)%_0x4202c9['length']];_0x3f57c4&&_0x3f57c4['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3433e6();}),_0x1e1ffa['focusTracker']['add'](this['view']['element']),_0x1e1ffa['focusTracker']['on']('change:isFocused',(_0x2d046e,_0x584403,_0x53a0f5)=>{_0x53a0f5||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 s extends _0x2519a7{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
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':_0x5a4cad=>0x1!=_0x5a4cad}};
|