@ckeditor/ckeditor5-real-time-collaboration 47.7.5-alpha.0 → 47.7.5
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
|
-
((()=>at)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3e1d7c];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xb23052){super(_0xb23052),this['set']('state',_0x36321a['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2dbd2e())();}['init'](){const _0x145201=this['context'],_0x1857a9=_0x145201['plugins']['get']('CloudServices'),_0x854bd4=_0x145201['plugins']['get'](_0x3e1d7c);if(!_0x1857a9['token'])throw new _0xb4ae54('websocketgateway-missing-token',this);if(!_0x1857a9['webSocketUrl'])throw new _0xb4ae54('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x1857a9['token'],_0x1857a9['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5134aa=>{if(this['connection']=_0x5134aa,this['bind']('state')['to'](_0x5134aa,'state',this,'_isBrowserOffline',(_0x3da22f,_0x54ba08)=>('connected'!==_0x3da22f&&(this['_shouldPluginsReconnect']=!0x0),_0x54ba08||_0x3da22f!==_0x36321a['CONNECTED']?_0x36321a['DISCONNECTED']:this['state']==_0x36321a['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x36321a['CONNECTING']):_0x36321a['CONNECTED'])),this['connection']['on']('error',(_0x3084f0,_0x38c974)=>{if('limitExceeded'!==_0x38c974['code'])throw console['error'](_0x38c974),new _0xb4ae54('cloudservices-init',null,{'originalError':_0x38c974});_0x854bd4['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'});}),!_0x5134aa['me'])return new Promise(_0x3e48a0=>_0x5134aa['on']('change:me',_0x3e48a0));})['catch'](_0xc1c03b=>{throw console['error'](_0xc1c03b),new _0xb4ae54('cloudservices-init',null,{'originalError':_0xc1c03b});});}['addToReconnectionStack'](_0x5b7927){if('function'!=typeof _0x5b7927['reconnect'])throw new _0xb4ae54('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5b7927))throw new _0xb4ae54('websocketgateway-plugin-already-registered',this,{'name':_0x5b7927['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5b7927);}['removeFromReconnectionStack'](_0x1ac1ac){this['_reconnectionStack']['delete'](_0x1ac1ac);}['isInReconnectionStack'](_0x103f81){return this['_reconnectionStack']['has'](_0x103f81);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x495a72=>_0x495a72['reconnect']())))['then'](()=>this['state']=_0x36321a['CONNECTED'])['catch'](_0x182ae8=>{throw console['error'](_0x182ae8),new _0xb4ae54('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x36321a['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x6f804a{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x4fba0e];}constructor(_0x50ebb1){super(_0x50ebb1),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x247fc3(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4fba0e);}['init'](){const _0x278446=this['context']['plugins']['get'](n);this['listenTo'](_0x278446,'change:state',(_0xf474e9,_0x1412e9,_0x14a3bf)=>{if('connected'!==_0x14a3bf)this['channelSessions']['forEach'](_0x346632=>_0x346632['clear']()),this['channelConnectedUsers']['forEach'](_0x206cd6=>_0x206cd6['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x23792b,_0x13acf1]of this['_registeredSessions'])for(const _0x55121d of _0x13acf1)this['_handleSessionAdd'](_0x23792b,_0x55121d);}}),this['_createUser'](_0x278446['connection']['me'],!0x0);}['register'](_0x550fd9,_0x37d088){if(this['_registeredSessions']['has'](_0x550fd9))throw new _0xb4ae54('sessions-register-already-registered',null,{'channelId':_0x550fd9});this['_registeredSessions']['set'](_0x550fd9,_0x37d088),this['channelSessions']['set'](_0x550fd9,new _0x247fc3()),this['channelConnectedUsers']['set'](_0x550fd9,new _0x247fc3()),this['listenTo'](_0x37d088,'add',(_0x3963d2,_0x221931)=>this['_handleSessionAdd'](_0x550fd9,_0x221931)),this['listenTo'](_0x37d088,'remove',(_0xc44466,_0x3640a4)=>this['_handleSessionRemove'](_0x550fd9,_0x3640a4));for(const _0x2ca5a5 of _0x37d088)this['_handleSessionAdd'](_0x550fd9,_0x2ca5a5);}['unregister'](_0x11fc63){if(!this['_registeredSessions']['has'](_0x11fc63))throw new _0xb4ae54('sessions-unregister-not-exist',null,{'channelId':_0x11fc63});const _0x1944cd=this['_registeredSessions']['get'](_0x11fc63);this['stopListening'](_0x1944cd);for(const _0xce34fb of _0x1944cd)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x11fc63,_0xce34fb);this['_registeredSessions']['delete'](_0x11fc63),this['channelSessions']['delete'](_0x11fc63),this['channelConnectedUsers']['delete'](_0x11fc63);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x3ca925){for(const _0x3ffab3 of this['channelSessions']['values']())for(const _0xac68cc of _0x3ffab3)if(_0xac68cc['id']===_0x3ca925)return _0xac68cc['user'];}['getUserSessions'](_0x2dbb8e,_0x553a00){const _0x41e212=_0x553a00?[this['channelSessions']['get'](_0x553a00)]:this['channelSessions']['values'](),_0x26fc40=new Set();for(const _0x28d43a of _0x41e212)for(const _0x9fee79 of _0x28d43a)_0x9fee79['user']['id']===_0x2dbb8e['id']&&_0x26fc40['add'](_0x9fee79['id']);return _0x26fc40;}['getUserRole'](_0x557a0c){for(const _0x5598ef of this['channelSessions']['values']())for(const _0x351c1e of _0x5598ef)if(_0x351c1e['user']===_0x557a0c)return _0x351c1e['role'];}['_handleSessionAdd'](_0x51ba5f,_0x4afe19){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x4bff60=_0x4afe19['user'],_0x3f480f=this['_users']['getUser'](_0x4bff60['id'])||this['_createUser'](_0x4bff60),_0x204f30=Object['assign']({},_0x4afe19,{'user':_0x3f480f});if(this['channelSessions']['get'](_0x51ba5f)['add'](_0x204f30),!_0x4bff60['hiddenInPresenceList']){const _0x284e30=this['channelConnectedUsers']['get'](_0x51ba5f);_0x284e30['has'](_0x3f480f['id'])||_0x284e30['add'](_0x3f480f),this['allConnectedUsers']['has'](_0x3f480f['id'])||_0x4bff60['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x3f480f,_0x3f480f['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x51ba5f,{'channelId':_0x51ba5f,'session':_0x204f30});}['_handleSessionRemove'](_0x2c0a90,_0x323c43){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x529989=this['channelConnectedUsers']['get'](_0x2c0a90),_0x108d78=_0x323c43['user'];_0x108d78['id']&&(this['channelSessions']['get'](_0x2c0a90)['remove'](_0x323c43['id']),_0x529989['has'](_0x108d78['id'])&&!this['getUserSessions'](_0x108d78,_0x2c0a90)['size']&&_0x529989['remove'](_0x108d78['id']),this['allConnectedUsers']['get'](_0x108d78['id'])&&!this['getUserSessions'](_0x108d78)['size']&&this['allConnectedUsers']['remove'](_0x108d78['id']));}['_createUser'](_0x2373a0,_0xa3572){const _0xff6cda=this['_users']['addUser'](_0x2373a0);return _0xa3572&&this['_users']['defineMe'](_0x2373a0['id']),_0xff6cda['orderNumber']=this['_uniqueUsersCount']++,_0xff6cda;}}class N extends _0x25b979{['_domEmitter']=new(_0x2dbd2e())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3e01d0=this['editor'],_0xb19470=_0x3e01d0['plugins']['get'](i);_0x3e01d0['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3c62d4,{writer:_0x39fea8})=>function(_0xd435bb,_0x45e02f,_0x26ac71,_0x472f6d){const _0x1a8827=_0xd435bb['markerName']['split'](':')[0x2],_0x12dd32=_0x26ac71['getUserBySessionId'](_0x1a8827);if(!_0x12dd32||_0x1a8827===_0x26ac71['mySessionId'])return;if(!_0x472f6d['model']['schema']['checkChild'](_0xd435bb['markerRange']['start'],'$text'))return;const _0x5653aa={'class':'ck-user__marker\x20'+_0x12dd32['color']['getMarkerClass'](),'data-name':_0x12dd32['name'],'data-session-id':_0x1a8827},_0x10cef2=_0x472f6d['model']['markers']['get'](_0xd435bb['markerName']),_0x520ac1=_0x10cef2['getStart'](),_0x3116e1=_0x520ac1['nodeAfter'],_0x16caef=_0x472f6d['model']['schema'];if(_0x3116e1&&_0x16caef['isObject'](_0x3116e1)&&_0x16caef['isInline'](_0x3116e1)&&!_0x472f6d['model']['markers']['get']('user:range:'+_0x1a8827)['getRange']()['isCollapsed'])return;const _0x4fba67=_0x520ac1['parent'];return _0x472f6d['model']['schema']['isLimit'](_0x4fba67)&&!_0x472f6d['model']['hasContent'](_0x4fba67)&&(_0x5653aa['contenteditable']=!0x1),function(_0x236131,_0x5ea949,_0x3dfe47){const _0x1f5f46=_0x236131['createUIElement']('span',_0x5ea949);return _0x236131['setCustomProperty']('userPositionMarker',!0x0,_0x1f5f46),_0x1f5f46['render']=function(_0x266e41){const _0x9b3418=this['toDomElement'](_0x266e41),_0x1ec3ed=document['createElement']('span');return _0x1ec3ed['classList']['add']('ck-user__marker-tooltip'),_0x1ec3ed['setAttribute']('contenteditable','false'),_0x1ec3ed['setAttribute']('spellcheck','false'),_0x1ec3ed['textContent']=_0x3dfe47['name'],_0x9b3418['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x1ec3ed['outerHTML']+'',_0x9b3418['addEventListener']('mouseenter',()=>{_0x9b3418['classList']['add']('ck-user__marker_hovered');}),_0x9b3418['addEventListener']('mouseleave',()=>{_0x9b3418['classList']['remove']('ck-user__marker_hovered');}),_0x9b3418;},_0x1f5f46['isSimilar']=function(_0x1e9d22){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1e9d22['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1e9d22['getAttribute']('data-session-id'));},_0x1f5f46;}(_0x45e02f,_0x5653aa,_0x12dd32);}(_0x3c62d4,_0x39fea8,_0xb19470,_0x3e01d0)}),_0x3e01d0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0xddbd27=>function(_0x29d85b,_0x1f39eb){const _0x82bdb7=_0x29d85b['markerName']['split'](':')[0x2];if(_0x82bdb7===_0x1f39eb['mySessionId'])return null;const _0x485ed0=_0x1f39eb['getUserBySessionId'](_0x82bdb7);if(!_0x485ed0)return{'id':_0x82bdb7,'classes':[]};return{'id':_0x82bdb7,'classes':['ck-user__selection',_0x485ed0['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x82bdb7},'priority':0x7d0+_0x485ed0['orderNumber']};}(_0xddbd27,_0xb19470)}),function(_0x91ff2c){const _0x32a3e2=_0x91ff2c['model'],_0x431652=new Map(),_0x33f71f=_0x91ff2c['plugins']['get'](i);_0x32a3e2['markers']['on']('update:user:range',(_0x2f953d,_0x18d6ad,_0x197dff,_0x27b530)=>{if(!_0x27b530&&_0x431652['get'](_0x18d6ad['name']))return _0x431652['get'](_0x18d6ad['name'])['detach'](),void _0x431652['delete'](_0x18d6ad['name']);const _0x26afcf=_0x18d6ad['name']['split'](':')[0x2];if(_0x26afcf===_0x33f71f['mySessionId'])return;const _0xfbeefb='user:position:'+_0x26afcf;_0x32a3e2['markers']['has'](_0xfbeefb)&&_0x91ff2c['editing']['reconvertMarker'](_0xfbeefb),_0x18d6ad['on']('change:range',(_0x3fa395,_0x5cbf91,_0xa733c0)=>{if('$graveyard'!=_0x5cbf91['root']['rootName']&&'$graveyard'==_0x18d6ad['getRange']()['root']['rootName']&&!_0x431652['has'](_0x18d6ad['name'])){const _0x31e4a4=_0x32a3e2['schema']['getNearestSelectionRange'](_0xa733c0['deletionPosition']);if(_0x31e4a4){const _0x47e4e8=_0x59bb9f['fromRange'](_0x31e4a4);_0x431652['set'](_0x18d6ad['name'],_0x47e4e8),_0x47e4e8['on']('change:range',(_0x3c647b,_0x44db0,_0x5545f1)=>{if('$graveyard'==_0x47e4e8['root']['rootName']){const _0x26a344=_0x32a3e2['schema']['getNearestSelectionRange'](_0x5545f1['deletionPosition']);_0x26a344?(_0x47e4e8['start']=_0x26a344['start'],_0x47e4e8['end']=_0x26a344['end']):(_0x431652['delete'](_0x18d6ad['name']),_0x47e4e8['detach']());}});}}});}),_0x32a3e2['document']['on']('change',()=>{_0x431652['size']>0x0&&_0x32a3e2['enqueueChange']({'isUndoable':!0x1},_0x3316ea=>{for(const [_0x359703,_0x1dd5e2]of _0x431652)'$graveyard'==_0x32a3e2['markers']['get'](_0x359703)['getRange']()['root']['rootName']&&(J(_0x359703['split'](':')[0x2],_0x1dd5e2['toRange'](),_0x32a3e2,_0x3316ea),_0x1dd5e2['detach']());_0x431652['clear']();});});}(_0x3e01d0),this['_domEmitter']['listenTo'](_0x57f3d3['document'],'keydown',(_0x36e32a,{key:_0x56010c})=>{'Escape'===_0x56010c&&function(_0x5dca6d){_0x5dca6d['editing']['view']['change'](_0x4b47a7=>{for(const _0x4cf76d of _0x5dca6d['model']['markers']){if(!_0x4cf76d['name']['startsWith']('user:position'))continue;const _0x41140c=_0x5dca6d['editing']['mapper']['markerNameToElements'](_0x4cf76d['name']);if(_0x41140c){for(const _0x349a8a of _0x41140c)_0x4b47a7['removeClass']('ck-user__marker_hovered',_0x349a8a);}}});}(_0x3e01d0);},{'useCapture':!0x0});}['afterInit'](){const _0x259daf=this['editor'],_0x3bb581=_0x259daf['commands']['get']('undo');_0x3bb581&&_0x259daf['model']['on']('applyOperation',(_0x592e87,_0x1132d3)=>{const _0x2e8e67=_0x1132d3[0x0];if(!_0x2e8e67['isDocumentOperation'])return;if('marker'!=_0x2e8e67['type']||!_0x2e8e67['name']['startsWith']('user:'))return;const _0x16baab=_0x2e8e67['batch'];_0x3bb581['_createdBatches']['has'](_0x16baab)&&(_0x2e8e67['newRange']=_0x2e8e67['oldRange']?_0x259daf['model']['createRange'](_0x2e8e67['oldRange']['start'],_0x2e8e67['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x17ad26=this['editor'],_0x31be4a=_0x17ad26['model']['document'],_0x4813db=_0x17ad26['plugins']['get'](i);_0x17ad26['model']['enqueueChange']({'isUndoable':!0x1},_0x209d3b=>{const _0x5eb139='user:range:'+_0x4813db['mySessionId'],_0x56377e='user:position:'+_0x4813db['mySessionId'],_0x1f220a=_0x17ad26['model']['markers']['has'](_0x5eb139);_0x17ad26['editing']['view']['hasDomSelection']?J(_0x4813db['mySessionId'],_0x31be4a['selection']['getFirstRange'](),_0x17ad26['model'],_0x209d3b):_0x1f220a&&(_0x209d3b['removeMarker'](_0x5eb139),_0x209d3b['removeMarker'](_0x56377e));});}}function J(_0x131c55,_0x2f8199,_0x11f359,_0x4da829){const _0xe6a6a1='user:range:'+_0x131c55,_0x5d5ff3='user:position:'+_0x131c55,_0x176f18=_0x2f8199['getContainedElement']();let _0x422bcc=_0x2f8199['start'];if(_0x176f18&&_0x176f18['is']('element','tableCell')){const _0x5612a7=function(_0x3a09d1,_0x37232b){for(const _0x198ccc of _0x3a09d1['getPositions']())if(_0x37232b['schema']['checkChild'](_0x198ccc,'$text'))return _0x198ccc;}(_0x2f8199,_0x11f359);_0x5612a7&&(_0x422bcc=_0x5612a7,_0x2f8199=_0x4da829['createRange'](_0x422bcc));}const _0x5180e0=_0x4da829['createRange'](_0x422bcc);_0x11f359['markers']['has'](_0xe6a6a1)?(_0x4da829['updateMarker'](_0xe6a6a1,{'range':_0x2f8199}),_0x4da829['updateMarker'](_0x5d5ff3,{'range':_0x5180e0})):(_0x4da829['addMarker'](_0xe6a6a1,{'range':_0x2f8199,'usingOperation':!0x0}),_0x4da829['addMarker'](_0x5d5ff3,{'range':_0x5180e0,'usingOperation':!0x0}));}function B(_0x4ddb1f,_0x4b2f6d,_0x147b33){const _0x3f4958=_0x4ddb1f['t'],t=_0x4ddb1f['t'];switch(_0x4b2f6d){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 _0x3f4958({'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'},_0x147b33);default:return'';}}let z=0x1;class l extends _0x25b979{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x21cc40)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,N,_0x235b6b,_0x4fba0e,_0x3e1d7c];}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 _0x345825=this['serverHistory']['getOperations']();for(let _0x3b158=_0x345825['length']-0x1;_0x3b158>=0x0;_0x3b158--){const _0x2f547a=_0x345825[_0x3b158];if(!this['_disconnectionOperations']['has'](_0x2f547a))return _0x2f547a['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3b9df9){if(super(_0x3b9df9),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x49c641(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0xb4ae54('collaboration-missing-channelid',this);const _0xaaadf6=_0x3b9df9['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xaaadf6,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x504bc6(),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 OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x540954=this['editor'],_0x17f4b4=_0x540954['plugins']['get'](_0x4fba0e),_0x18d655=_0x540954['plugins']['get'](n);this['listenTo'](_0x17f4b4,'getOperationAuthor',(_0x509fe0,_0x1fcae7)=>{const _0x14bda3=_0x1fcae7[0x0];_0x14bda3['_authorId']&&(_0x509fe0['return']=_0x17f4b4['getUser'](_0x14bda3['_authorId']),_0x509fe0['stop']()),null===_0x14bda3['_authorId']&&(_0x509fe0['return']=null,_0x509fe0['stop']());},{'priority':'high'}),this['listenTo'](_0x540954['model']['document']['selection'],'change:range',(_0x59fc11,_0x5c3aaf)=>{_0x5c3aaf['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x540954['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x540954['model']['on']('applyOperation',(_0x1b818b,_0x5ceee2)=>{const _0x3d1b42=_0x5ceee2[0x0];_0x3d1b42['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x3d1b42),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x18d655,'state',this,'_hasSynchronizationProblem',(_0x1c23e3,_0x18096c)=>'connected'===_0x1c23e3&&!_0x18096c),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x540954['disableReadOnlyMode']('rtc-offline'):_0x540954['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x540954['disableReadOnlyMode']('rtc-offline'):_0x540954['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1e595e=this['editor']['plugins']['get'](i),_0x16d362=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x1e595e['unregister'](this['_channelId']);const _0x5f4cd8=await this['_service']['reconnect'](_0x16d362['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5f4cd8)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x152cf2=await this['_service']['getConnectedSessions']();_0x1e595e['register'](this['_channelId'],_0x152cf2),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x3ac4bb){if(function(_0x10f1e2){return'404'===_0x10f1e2['code'];}(_0x3ac4bb)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5dca9c){return'409'===_0x5dca9c['code'];}(_0x3ac4bb)){const _0x46fae2=B(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'](_0x46fae2);}else{if(!(_0x3ac4bb instanceof ReconnectionError))throw _0x3ac4bb;this['_handleReconnectionError']();}}}}['destroy'](){const _0x677b6=this['editor']['plugins']['get'](n),_0x205e60=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x205e60['channelSessions']['has'](this['_channelId'])&&_0x205e60['unregister'](this['_channelId']),_0x677b6['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x1b0e59){if(this['sessionId']!==_0x1b0e59['sessionId']&&this['_lastSyncedOperationId']!==_0x1b0e59['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x1b0e59['sessionId'],this['_handleServerResponse']([],{..._0x1b0e59,'wereChangesApplied':!0x1,'data':_0x1b0e59['data']},'reconnect');}async['_connectService'](_0x357ee7,_0x30ab1d=!0x1){const {connection:_0x46e7ad}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x46e7ad,this['_channelId'])['then'](_0x3f99d7=>this['_initSessionsHandling'](_0x3f99d7))['catch'](_0x23a8dd=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x23a8dd);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xeaf0d2,_0xb35574)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xb35574);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xeb945c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x357ee7);this['_isPendingUpdate']=!0x0;const _0x572731=await this['_service']['connect'](_0x46e7ad,this['_compressOperations'](_0x357ee7),_0xeb945c);if(this['sessionId']=_0x572731['sessionId'],_0x30ab1d){if(!_0x572731['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x572731['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x357ee7,_0x572731,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x572731,_0x357ee7);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3a3c00=this['editor']['plugins']['get'](i),_0x1fd868=this['editor']['plugins']['get'](N),_0x359073=_0x3a3c00['channelSessions']['get'](this['_channelId']);_0x359073&&_0x359073['length']>0x1?_0x1fd868['createUserMarkerOperations']():this['listenTo'](_0x3a3c00,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3a3c00['channelSessions']['get'](this['_channelId'])['length']&&_0x1fd868['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x51a602,_0x40cfb4,_0x31973d,_0xfeb6bb){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x40cfb4){const _0x5172c2=this['_decompressOperations'](_0x31973d,_0xfeb6bb);await this['_fetchMissingUsers'](_0x5172c2),this['_handleExternalOperations'](_0x5172c2,_0x40cfb4,_0x31973d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x49a3f2}=this['editor'];let _0x57305f;try{_0x57305f=await this['_service']['getDocumentDetails']();}catch{const _0xb93821=B(_0x49a3f2,'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'](_0xb93821);}const _0x5220dc=_0x57305f['currentDocumentSession']||_0x57305f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5220dc['lastOperationId']){const _0x5129ec=B(_0x49a3f2,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x5129ec);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x57f56a){const _0x58ba57=this['editor']['plugins']['get'](i);this['listenTo'](_0x58ba57,'sessionAdd:'+this['_channelId'],(_0x4e22a1,{session:_0x562630})=>{if(_0x562630['id']===_0x58ba57['mySessionId']){_0x4e22a1['off']();const _0x2bac27=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0xe1587e=_0x562630['permissions'];_0x2bac27&&_0x2bac27['isEnabled']&&(_0xe1587e=_0xe1587e['filter'](_0x222c50=>'document:write'!==_0x222c50)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0xe1587e,this['_channelId']);}}),_0x58ba57['register'](this['_channelId'],_0x57f56a);}['_initThrowingOnDataSet'](){const _0x49dd77=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4ef11e)=>{if(!_0x4ef11e[_0x4ef11e['length']-0x1]['suppressErrorInCollaboration'])throw new _0xb4ae54('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x49dd77['apply'](this['editor']['data'],_0x4ef11e);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4795ff,[_0x41d118])=>{if(this['_document']['version'])throw new _0xb4ae54('realtimecollaborationclient-init-document-already-initialized',this);_0x4795ff['stop'](),this['_setPendingAction']();const _0x3ca150=this['editor']['config']['get']('rootsAttributes'),_0x2162e7=this['_getOperationsFromInitData'](_0x41d118,_0x3ca150);0x0==_0x2162e7['length']&&_0x2162e7['push'](new _0x566909(0x0)),_0x4795ff['return']=this['_connectService'](_0x2162e7)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x46b213=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x46b213))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3e4d76,[_0x3e1168,_0x326e2])=>{_0x3e4d76['stop']();const _0x26f291=this['editor']['model']['document']['getRoot'](_0x3e1168);if(!this['_knownRootNames']['has'](_0x3e1168)){const _0x171efd=_0x326e2&&_0x326e2['data']?_0x326e2['data']:'',_0x147379=_0x326e2&&_0x326e2['attributes']?_0x326e2['attributes']:{};await this['_loadRoot'](_0x3e1168,_0x171efd,_0x147379);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x26f291['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x26f291);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x14d1e6){const _0xe3652b=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x407c24}=this['editor']['plugins']['get'](n),_0x17c24e=new Set();for(const _0x5084a of _0x14d1e6){const _0x87008d=_0x5084a['_authorId'];_0x87008d&&!_0xe3652b['getUser'](_0x87008d)&&_0x17c24e['add'](_0x87008d);}if(0x0===_0x17c24e['size'])return;const _0x47ab62=await ht['getMany'](_0x407c24,Array['from'](_0x17c24e));for(const _0x2f7865 of _0x47ab62)_0xe3652b['getUser'](_0x2f7865['id'])||_0xe3652b['addUser'](_0x2f7865);}['_getOperationsFromInitData'](_0x2c5438,_0x249893={}){const _0x37ed97=this['editor']['model'],_0x661660=[];let _0x33ab38=0x0;const _0x4e3895='string'==typeof _0x2c5438?{'main':_0x2c5438}:_0x2c5438;for(const _0x19d887 of Object['keys'](_0x4e3895)){if(!this['_document']['roots']['has'](_0x19d887))throw new _0xb4ae54('realtimecollaborationclient-init-non-existent-root',this);const _0x3b470c=this['editor']['data']['parse'](_0x4e3895[_0x19d887]),_0x14869b=this['_document']['getRoot'](_0x19d887),_0x45c20a=new _0x4dfc76(_0x37ed97['createPositionAt'](_0x14869b,0x0),_0x3b470c,_0x33ab38++);_0x661660['push'](_0x45c20a);for(const [_0x4718a8,_0xc03d36]of _0x3b470c['markers']){const _0x1627a7=_0x37ed97['createRange'](_0x37ed97['createPositionFromPath'](_0x14869b,_0xc03d36['start']['path']['slice']()),_0x37ed97['createPositionFromPath'](_0x14869b,_0xc03d36['end']['path']['slice']())),_0x24c85e=new _0x7b3172(_0x4718a8,null,_0x1627a7,_0x37ed97['markers'],!0x0,_0x33ab38++);_0x661660['push'](_0x24c85e);}}if(_0x249893)for(const [_0xb91e5f,_0x4ec710]of Object['entries'](_0x249893)){const _0x2a90b6=_0x37ed97['document']['getRoot'](_0xb91e5f);if(!_0x2a90b6)throw new _0xb4ae54('multi-root-editor-root-attributes-no-root',null);for(const [_0x23d38e,_0x3df3c1]of Object['entries'](_0x4ec710))if(null!==_0x3df3c1){const _0x12be2b=new _0x3b01b0(_0x2a90b6,_0x23d38e,null,_0x3df3c1,_0x33ab38++);_0x661660['push'](_0x12be2b);}}return _0x661660;}async['_loadRoot'](_0x56b140,_0x3333a4,_0x49fe52){this['_getOperationsFromInitData']({[_0x56b140]:_0x3333a4},{[_0x56b140]:_0x49fe52})['forEach']((_0x4fac65,_0x44ae69)=>{_0x4fac65['baseVersion']=this['_document']['version']+_0x44ae69,_0x4fac65['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x4fac65);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5e9e49,_0x2be744){let _0x5f1ca7;this['_offset']=_0x5e9e49['offset'];const _0x1e82ea=_0x5e9e49['wereChangesApplied']&&!_0x5e9e49['initData'],_0x522d99=_0x1e82ea?0x0:_0x5e9e49['data']['baseVersion'];if(_0x2be744['forEach'](_0x47efb2=>{_0x47efb2['_isInit']=!0x0,_0x47efb2['createdAt']=_0x5e9e49['sessionCreatedAt'],_0x47efb2['_authorId']=null;}),_0x1e82ea)_0x5f1ca7=_0x2be744,this['_applyOperationsSet'](_0x5f1ca7,_0x1e82ea);else{if(_0x5e9e49['initData']){const _0x83b04d=this['_getOperationsFromInitData'](_0x5e9e49['initData']);this['_document']['history']['version']=-_0x83b04d['length'],_0x83b04d['forEach'](_0x567481=>{_0x567481['baseVersion']-=_0x83b04d['length'],_0x567481['createdAt']=_0x5e9e49['sessionCreatedAt'],_0x567481['_isInit']=!0x0,_0x567481['_authorId']=null;}),this['_applyOperationsSet'](_0x83b04d,!0x0),this['serverHistory']['version']=-_0x83b04d['length']+this['_offset'],this['_updateServerHistory'](_0x83b04d);}this['_document']['history']['version']=_0x522d99,_0x5f1ca7=this['_decompressOperations'](_0x5e9e49['data'],_0x5e9e49['metadata']),await this['_fetchMissingUsers'](_0x5f1ca7),this['_applyOperationsSet'](_0x5f1ca7,_0x1e82ea);}_0x5e9e49['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5f1ca7,_0x5e9e49['lastOperationId']),this['_lastSyncedOperationId']=_0x5e9e49['lastOperationId']),this['serverHistory']['version']=_0x522d99+this['_offset'],this['_updateServerHistory'](_0x5f1ca7),_0x2be744['filter'](_0x26f2fa=>{const _0x2aa8ab=this['_getAffectedRoot'](_0x26f2fa);return _0x2aa8ab&&!this['_knownRootNames']['has'](_0x2aa8ab);})['forEach']((_0x1f5590,_0x5e6e0f)=>{_0x1f5590['baseVersion']=this['_document']['version']+_0x5e6e0f,this['_saveOperationInBuffer'](_0x1f5590);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x313452,_0x381fdb){const _0x4ebf80=_0x381fdb&&_0x381fdb['message'];if(_0x4ebf80&&_0x4ebf80['startsWith']('realtimecollaborationclient'))throw _0x381fdb;const _0x219db1=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x219db1['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0xb4ae54(_0x313452,this['editor'],_0x4ebf80?{'originalError':_0x4ebf80}:void 0x0);}['_saveOperationInBuffer'](_0x57738b){this['_knownOperations']['has'](_0x57738b)||(this['_knownOperations']['add'](_0x57738b),this['_bufferedOperations']['push'](_0x57738b),this['_pendingAction']||'marker'==_0x57738b['type']&&!_0x57738b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x493a4f=!0x1){!_0x493a4f&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4629ca=>{_0x4629ca&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x335304=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3a861f){return _0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x335304)||this['_crash'](_0x335304['message'],_0x335304);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x55f140=>{this['on']('change:_isPendingUpdate',()=>{_0x55f140();});});}async['_sendBufferedOperations'](){const _0x305385=this['editor']['plugins']['get'](N);if(this['_shouldSendSelectionUpdate']()&&(_0x305385['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5f22b4=[...this['_bufferedOperations']];for(const _0x5e33cb of _0x5f22b4)_0x5e33cb['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x5e33cb);const _0x4c1e80=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5f22b4),_0x50ab91=z++,_0x2d7e4c=this['_compressOperations'](_0x5f22b4),_0x5f3b27=await this['_service']['sendOperations'](_0x2d7e4c,_0x2d7e4c['baseVersion'],_0x4c1e80);try{return await this['_handleServerResponse'](_0x5f22b4,_0x5f3b27,_0x50ab91);}catch(_0x368908){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x368908);}}async['_handleServerResponse'](_0xeeee15,_0x485877,_0x4e4c4a){if('error'in _0x485877)throw _0x485877['error'];let _0x149003=!0x1;if(_0x485877['wereChangesApplied']){_0x485877['lastOperationId']&&(this['_lastSyncedOperationId']=_0x485877['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x189afd=>!_0xeeee15['includes'](_0x189afd));for(const _0x234286 of _0xeeee15)_0x234286['createdAt']='lastOperationAcceptedAt'in _0x485877&&_0x485877['lastOperationAcceptedAt']||void 0x0;H(_0xeeee15,_0x485877['version']-_0xeeee15['length']),this['_updateServerHistory'](_0xeeee15);const _0x5bdcc7=_0xeeee15['filter'](_0xbeff4f=>{if(!_0xbeff4f['_isInit'])return!0x1;const _0x51471b=this['_getAffectedRoot'](_0xbeff4f);return _0x51471b&&!this['_knownRootNames']['has'](_0x51471b);});H(_0x5bdcc7,this['_document']['version']),this['_applyOperationsSet'](_0x5bdcc7),_0x149003=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3af6f6=this['_decompressOperations'](_0x485877['data'],_0x485877['metadata'])['filter'](_0x222ee5=>_0x222ee5['baseVersion']>=this['_lastServerVersion']);_0x3af6f6['forEach'](_0x584b2c=>this['_addKnownRoot'](_0x584b2c)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xf520d8=>!_0xf520d8['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xf520d8))),this['_bufferedOperations']['length']&&H(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3af6f6),_0x149003=this['_handleExternalOperations'](_0x3af6f6,_0x485877['version'],_0x485877['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x149003?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x37a5ba,_0x251df1,_0x7c83c2){try{const _0x3f9f14={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x98152c,operationsB:_0x1e634c,originalOperations:_0x3fa4ad}=_0x3283fc(_0x37a5ba,this['_bufferedOperations'],_0x3f9f14);H(_0x98152c,this['_document']['version']),H(_0x1e634c,_0x251df1);for(const _0x2124b9 of _0x98152c){const _0x43a760=_0x3fa4ad['get'](_0x2124b9);_0x2124b9['_authorId']=_0x43a760?_0x43a760['_authorId']:null;}_0x7c83c2&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x37a5ba,_0x7c83c2),this['_lastSyncedOperationId']=_0x7c83c2),this['_bufferedOperations']=[..._0x1e634c],this['_applyOperationsSet'](_0x98152c),this['_updateServerHistory'](_0x37a5ba);}catch(_0x7b0030){return console['error'](_0x7b0030),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1aea17,_0x4f4a8f=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3c1316=>{for(const _0x46cebf of _0x1aea17)this['_knownOperations']['add'](_0x46cebf),this['_addKnownRoot'](_0x46cebf),_0x3c1316['batch']['addOperation'](_0x46cebf),this['editor']['model']['applyOperation'](_0x46cebf);});}['_addKnownRoot'](_0x279e95){const _0x3417c=this['_getAffectedRoot'](_0x279e95);_0x3417c&&this['_knownRootNames']['add'](_0x3417c);}['_getAffectedRoot'](_0x1b912b){let _0x317df4,_0x1b9ef9;switch(_0x1b912b['type']){case'insert':_0x317df4=_0x1b912b['position']['root'];break;case'marker':if(_0x1b9ef9=_0x1b912b['newRange'],!_0x1b9ef9)return null;_0x317df4=_0x1b9ef9['root'];break;case'addRootAttribute':_0x317df4=_0x1b912b['root'];break;case'addRoot':_0x317df4=_0x1b912b['affectedSelectable'];break;case'move':_0x317df4=_0x1b912b['targetPosition']['root'];break;default:return null;}return _0x317df4['rootName'];}['_updateServerHistory'](_0x5df474){_0x5df474['forEach'](_0x45a6f6=>{const _0xc0fb25=_0x45a6f6['clone']();_0xc0fb25['_authorId']=_0x45a6f6['_authorId'],_0xc0fb25['_isInit']=!!_0x45a6f6['_isInit'],_0xc0fb25['createdAt']=_0x45a6f6['createdAt'],_0xc0fb25['baseVersion']+=this['_offset'],_0x45a6f6['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xc0fb25),this['serverHistory']['addOperation'](_0xc0fb25);});}['_handleReconnectionError'](_0x5f306f){const _0x58a2ed=this['editor']['plugins']['get']('Notification'),_0x2a63fa=this['editor']['locale'];_0x5f306f||(_0x5f306f=B(_0x2a63fa,'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.')),_0x58a2ed['showWarning'](_0x5f306f,{'title':B(_0x2a63fa,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x235b6b)['add'](B(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x235b6b)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2d5c58){const _0x51b171=_0x2d5c58['map'](_0x10941c=>_0x10941c['toJSON']());return this['_compressor']['compress'](_0x51b171);}['_decompressOperations'](_0x35f415,_0x359214){return this['_compressor']['decompress'](_0x35f415)['map']((_0x2e67f2,_0x23d322)=>{const _0x5d6196='init'==_0x359214[_0x23d322]['type'];if('InsertOperation'==_0x2e67f2['__className']){const _0x19b85c=_0x2e67f2['position']['root'];!this['_document']['getRoot'](_0x19b85c)&&(this['_document']['createRoot']('$root',_0x19b85c)['_isAttached']=!0x1);}const _0x1b518c=_0x2f9f6e['fromJSON'](_0x2e67f2,this['_document']);return _0x1b518c['wasUndone']=_0x2e67f2['wasUndone'],_0x1b518c['_isInit']=_0x5d6196,_0x1b518c['_authorId']=_0x5d6196?null:_0x359214[_0x23d322]['userId'],_0x1b518c['_isDisconnection']='cs:removeUser'===_0x359214[_0x23d322]['type'],_0x1b518c['createdAt']=_0x359214[_0x23d322]['createdAt'],_0x1b518c;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x7a3f18=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x7a3f18&&_0x7a3f18['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function H(_0x2ebd14,_0x26e98b){for(const _0x35d48e of _0x2ebd14)_0x35d48e['baseVersion']=_0x26e98b++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x59ec0a){this['_ignoredOperations']=_0x59ec0a,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x258177){let _0x41014a=_0x258177['length'];for(;_0x41014a--;){const _0xa60319=_0x258177[_0x41014a];if(!this['_ignoredOperations']['has'](_0xa60319)){if(!this['_operationToId']['has'](_0xa60319)){const _0x2ce520=_0x525198()['slice'](0x1,0x12);this['_operationToId']['set'](_0xa60319,_0x2ce520);}return this['_operationToId']['get'](_0xa60319);}}}['setIdForTheLastOperation'](_0x37e157,_0xacf77c){if(!_0xacf77c)return;let _0x4faaa5=_0x37e157['length'];for(;_0x4faaa5--;){const _0x3f1180=_0x37e157[_0x4faaa5];this['_ignoredOperations']['has'](_0x3f1180)||this['_operationToId']['set'](_0x3f1180,_0xacf77c);}}}class a extends _0x25b979{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x6f804a{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x3a26f5)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x4fba0e];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x221e66){super(_0x221e66),this['_services']=new Map();}async['init'](){const _0x37e86a=this['context'],_0x203228=_0x37e86a['plugins']['get']('CommentsRepository');if(_0x37e86a['plugins']['get'](n)['addToReconnectionStack'](this),_0x203228['adapter']={'addCommentThread':async({channelId:_0x396b0c,threadId:_0x42ac52,comments:_0x2113a4,resolvedAt:_0x389818,resolvedBy:_0x44f9ea,context:_0xa39db3,attributes:_0x9afce8})=>{const _0x13d852=await this['_getService'](_0x396b0c)['addCommentThread']({'commentThreadId':_0x42ac52,'comments':_0x2113a4['map'](_0x576995=>function(_0x5014f4,_0x393d4b,_0x1dbd06){return{'commentThreadId':_0x1dbd06,'commentId':_0x5014f4['commentId'],'userId':_0x5014f4['authorId'],'content':_0x5014f4['content'],'documentId':_0x393d4b,'createdAt':_0x5014f4['createdAt'],'attributes':_0x5014f4['attributes']||{}};}(_0x576995,_0x396b0c,_0x42ac52)),'resolvedAt':_0x389818,'resolvedBy':_0x44f9ea,'context':_0xa39db3,'attributes':_0x9afce8})['catch'](lt);return{'threadId':_0x13d852['commentThreadId'],'comments':_0x13d852['comments']};},'getCommentThread':async({channelId:_0x54d7e6,threadId:_0xcef519})=>{const _0x2c8fe7=await this['_getService'](_0x54d7e6)['getCommentThread'](_0xcef519)['catch'](f)['catch'](lt);return _0x2c8fe7?_0x2c8fe7['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2c8fe7]),{'threadId':_0x2c8fe7['commentThreadId'],'comments':_0x2c8fe7['comments']['map'](p),'context':_0x2c8fe7['context'],'resolvedAt':_0x2c8fe7['resolvedAt'],'resolvedBy':_0x2c8fe7['resolvedBy'],'attributes':_0x2c8fe7['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x24be81,threadId:_0x184c17,context:_0x28eea9,unlinkedAt:_0x1426f2,attributes:_0x21fdf0})=>this['_getService'](_0x24be81)['updateCommentThread']({'commentThreadId':_0x184c17,'context':_0x28eea9,'attributes':_0x21fdf0,'unlinkedAt':_0x1426f2})['catch'](f)['catch'](lt),'resolveCommentThread':async({channelId:_0x587672,threadId:_0x57b12e})=>{const _0x2a546f=await this['_getService'](_0x587672)['resolveCommentThread'](_0x57b12e)['catch'](f)['catch'](lt);return{'threadId':_0x2a546f['commentThreadId'],'resolvedAt':_0x2a546f['resolvedAt'],'resolvedBy':_0x2a546f['resolvedBy']};},'reopenCommentThread':async({channelId:_0x233cb0,threadId:_0x16dd60})=>this['_getService'](_0x233cb0)['reopenCommentThread'](_0x16dd60)['catch'](f)['catch'](lt),'removeCommentThread':({channelId:_0x3d23f8,threadId:_0x9e332b})=>this['_getService'](_0x3d23f8)['removeCommentThread'](_0x9e332b)['catch'](f)['catch'](lt),'addComment':({channelId:_0x3d071c,threadId:_0x1ad221,commentId:_0x24028f,content:_0x12810d,attributes:_0xafd23})=>this['_getService'](_0x3d071c)['addComment'](_0x1ad221,_0x24028f,_0x12810d,_0xafd23)['catch'](lt),'updateComment':({channelId:_0x22bdc0,threadId:_0x210e64,commentId:_0xe78022,content:_0x2f1e5d,attributes:_0x16291d})=>this['_getService'](_0x22bdc0)['updateComment'](_0x210e64,_0xe78022,_0x2f1e5d,_0x16291d)['catch'](f)['catch'](lt),'removeComment':({channelId:_0x548745,threadId:_0x4e7bc5,commentId:_0x108129})=>this['_getService'](_0x548745)['removeComment'](_0x4e7bc5,_0x108129)['catch'](f)['catch'](lt)},_0x37e86a instanceof _0x506ccb){const _0x3349cd=_0x37e86a['config']['get']('collaboration.channelId'),_0x34bb37=_0x37e86a['plugins']['get'](i);await this['_setUpService'](_0x3349cd);const _0x4ccf96=await this['_services']['get'](_0x3349cd)['getConnectedSessions']();this['listenTo'](_0x34bb37,'sessionAdd:'+_0x3349cd,(_0x481fd5,{session:_0x24b635})=>{_0x24b635['id']===_0x34bb37['mySessionId']&&(_0x481fd5['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x24b635['permissions'],_0x3349cd));}),_0x34bb37['register'](_0x3349cd,_0x4ccf96);}}async['_setUpService'](_0xa63e35){if(this['_services']['has'](_0xa63e35))throw new _0xb4ae54('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0xa63e35});const _0x43830e=this['context']['plugins']['get']('CommentsRepository'),_0x3d7838=new s['CommentsService'](_0xa63e35);this['_services']['set'](_0xa63e35,_0x3d7838),this['listenTo'](_0x3d7838,'commentThreadAdded',(_0x7d70bc,_0x22d4c7)=>{const {commentThreadId:_0x2aeeb0,documentId:_0x625929,context:_0x527c7b,attributes:_0x4c9275,resolvedAt:_0x1ff0fe,resolvedBy:_0x1ad205,comments:_0x19600b}=_0x22d4c7;_0x43830e['getCommentThread'](_0x2aeeb0)||_0x43830e['addCommentThread']({'threadId':_0x2aeeb0,'channelId':_0x625929,'comments':_0x19600b?_0x19600b['map'](p):[],'context':_0x527c7b,'attributes':_0x4c9275,'resolvedAt':_0x1ff0fe,'resolvedBy':_0x1ad205,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadUpdated',(_0x1c6d3d,{commentThreadId:_0x7d6762,documentId:_0x907741,context:_0x42d5d0,unlinkedAt:_0x344e54,attributes:_0xb11611})=>{_0x43830e['getCommentThread'](_0x7d6762)&&_0x43830e['updateCommentThread']({'threadId':_0x7d6762,'channelId':_0x907741,'context':_0x42d5d0,'unlinkedAt':_0x344e54,'attributes':_0xb11611,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadResolved',(_0x183dd9,{commentThreadId:_0x4c07cb,resolvedBy:_0x3e9e14,resolvedAt:_0x12e5f0})=>{const _0x45bb89=_0x43830e['getCommentThread'](_0x4c07cb);_0x45bb89&&_0x45bb89['resolve']({'resolvedBy':_0x3e9e14,'resolvedAt':_0x12e5f0,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadReopened',(_0xa1363a,{commentThreadId:_0x4cdd81})=>{const _0x560714=_0x43830e['getCommentThread'](_0x4cdd81);_0x560714&&_0x560714['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadRemoved',(_0x3899aa,{commentThreadId:_0x4764ae})=>{const _0x47b0cc=_0x43830e['getCommentThread'](_0x4764ae);_0x47b0cc&&_0x47b0cc['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentAdded',(_0x3f85c5,_0x330168)=>{const _0x37f7ab=_0x330168['commentThreadId'],_0x3db75a=_0x43830e['getCommentThread'](_0x37f7ab);_0x3db75a&&_0x3db75a['addComment']({...p(_0x330168),'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentUpdated',(_0x403fca,{commentThreadId:_0x1120d4,commentId:_0x146fe5,content:_0x411193,attributes:_0x2b0e50})=>{const _0x32c085=_0x43830e['getCommentThread'](_0x1120d4);if(_0x32c085){const _0x5d4b1e=_0x32c085['getComment'](_0x146fe5);_0x5d4b1e&&_0x5d4b1e['update']({'content':_0x411193,'attributes':_0x2b0e50,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3d7838,'commentRemoved',(_0x2055cc,{commentThreadId:_0x345dbc,commentId:_0xa899d8})=>{const _0x4de994=_0x43830e['getCommentThread'](_0x345dbc);if(_0x4de994){const _0x133ddd=_0x4de994['getComment'](_0xa899d8);_0x133ddd&&_0x133ddd['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0xa63e35);}['destroy'](){if(this['context']instanceof _0x506ccb){const _0x12636c=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x12636c);}}['_terminateService'](_0x97c675){if(!this['_services']['has'](_0x97c675))throw new _0xb4ae54('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x97c675});this['_getService'](_0x97c675)['disconnect'](),this['_services']['delete'](_0x97c675);}async['reconnect'](){for(const _0x304da5 of this['_services']['keys']())await this['_connectService'](_0x304da5);if(this['context']instanceof _0x506ccb){const _0x2b7fae=this['context']['config']['get']('collaboration.channelId'),_0x575866=this['context']['plugins']['get'](i);_0x575866['unregister'](_0x2b7fae);const _0x30e47c=await this['_services']['get'](_0x2b7fae)['getConnectedSessions']();_0x575866['register'](_0x2b7fae,_0x30e47c);}}async['_connectService'](_0x1e2675){const {connection:_0x3c7838}=this['context']['plugins']['get'](n),_0x1ccce8=this['context']['plugins']['get']('CommentsRepository'),_0x1e185e=this['_services']['get'](_0x1e2675),_0x50e894=await _0x1e185e['connect'](_0x3c7838);await this['_fetchMissingUsersForThreads'](_0x50e894);const _0x22b7ce=new Set(Array['from'](_0x1ccce8['getCommentThreads']({'channelId':_0x1e2675}),_0x2f62ba=>_0x2f62ba['id']));for(const _0xb51728 of _0x50e894)_0xb51728['deletedAt']||_0x22b7ce['delete'](_0xb51728['commentThreadId']);for(const _0x5bfdf3 of _0x22b7ce)_0x1ccce8['getCommentThread'](_0x5bfdf3)['remove']({'isFromAdapter':!0x0});for(const _0xfa3b56 of _0x50e894){let _0x4f6abe=_0x1ccce8['getCommentThread'](_0xfa3b56['commentThreadId']);const {commentThreadId:_0x6e241d,context:_0x234307,attributes:_0x1e8d55,resolvedBy:_0x496c3d,resolvedAt:_0x3d7bc6,unlinkedAt:_0x19d69a,deletedAt:_0x5d775e}=_0xfa3b56;if(_0x5d775e)continue;_0x4f6abe||(_0x4f6abe=_0x1ccce8['addCommentThread']({'channelId':_0x1e2675,'threadId':_0x6e241d,'context':_0x234307,'attributes':_0x1e8d55||{},'resolvedBy':_0x496c3d,'resolvedAt':_0x3d7bc6,'unlinkedAt':_0x19d69a,'isFromAdapter':!0x0}));const _0x24f30d=new Set(Array['from'](_0x4f6abe['comments'],_0x56e736=>_0x56e736['id']));for(const _0x277802 of _0xfa3b56['comments'])_0x24f30d['delete'](_0x277802['commentId']);for(const _0x33b219 of _0x24f30d)_0x4f6abe['getComment'](_0x33b219)['remove']({'isFromAdapter':!0x0});for(const _0xe80118 of _0xfa3b56['comments']){const _0x40d03a=_0x4f6abe['getComment'](_0xe80118['commentId']);_0x40d03a?_0x40d03a['content']!==_0xe80118['content']&&_0x40d03a['update']({'content':_0xe80118['content'],'isFromAdapter':!0x0}):_0x4f6abe['addComment'](Object['assign'](p(_0xe80118),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1721c4){if(!this['_services']['has'](_0x1721c4))throw new _0xb4ae54('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1721c4});return this['_services']['get'](_0x1721c4);}async['_fetchMissingUsersForThreads'](_0x2000fb){const _0x5e24b0=this['context']['plugins']['get'](_0x4fba0e),{connection:_0x5b2fe6}=this['context']['plugins']['get'](n),_0x2d035b=new Set();for(const {resolvedBy:_0x3e34a4,comments:_0x53ff3e}of _0x2000fb){_0x3e34a4&&!_0x5e24b0['getUser'](_0x3e34a4)&&_0x2d035b['add'](_0x3e34a4);for(const {userId:_0xd1b7a4}of _0x53ff3e)_0x5e24b0['getUser'](_0xd1b7a4)||_0x2d035b['add'](_0xd1b7a4);}if(0x0===_0x2d035b['size'])return;const _0x2051a1=await ht['getMany'](_0x5b2fe6,Array['from'](_0x2d035b));for(const _0x16894f of _0x2051a1)_0x5e24b0['getUser'](_0x16894f['id'])||_0x5e24b0['addUser'](_0x16894f);}}async function f(_0x4fb759){if('404'!==_0x4fb759['code'])throw _0x4fb759;}function lt(_0x4715f7){if((_0x1f6911=_0x4715f7)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1f6911['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1f6911['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1f6911;throw _0x4715f7;}function p(_0x5bbe51){return{'threadId':_0x5bbe51['commentThreadId'],'commentId':_0x5bbe51['commentId'],'content':_0x5bbe51['content'],'createdAt':_0x5bbe51['createdAt'],'authorId':_0x5bbe51['userId'],'attributes':_0x5bbe51['attributes']||{}};}class m extends _0x25b979{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x16dd6a)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x4fba0e];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x477479){super(_0x477479);const _0x15bd8f=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x15bd8f);}async['init'](){const _0x39d88a=this['editor']['plugins']['get'](l),_0xe111aa=_0x39d88a['serverHistory'],_0x3b2647=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xe111aa,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x39d88a['sessionId']});const _0x1feb35=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x5b349d=await _0x25c22d['isBundleUploaded'](_0x3b2647['connection'],_0x1feb35);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3e87f1})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3e87f1)),'updateRevisions':async _0x204858=>{await this['_waitForServiceReady']();const _0x47bfa9=this['_revisionTracker']['currentRevision'];if(_0x5b349d&&0x1===_0x204858['length']&&_0x204858[0x0]['id']===_0x47bfa9['id'])return _0x204858;for(const _0x1c305b of _0x204858)_0x1c305b['id']===_0x47bfa9['id']&&(_0x1c305b['isEmptyCurrent']=_0x1c305b['fromVersion']===_0x1c305b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x204858,this['_lastRequestId'])['then'](_0x9d8fc9=>(this['_lastRequestId']=_0x9d8fc9,_0x204858))['catch'](_0x36d865=>{if(b(_0x36d865)||'400'===_0x36d865['code']&&void 0x0!==_0x36d865['data']['wrongRequestId']){for(const _0x41e2d0 of _0x204858){!this['_revisionTracker']['repository']['getRevision'](_0x41e2d0['id'])||this['_revisionTracker']['_bufferUpdate'](_0x41e2d0['id'],_0x41e2d0,!0x1);}if(b(_0x36d865))throw _0x36d865;return _0x204858;}throw _0x36d865;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x65f68a,{revisionsData:_0x18c58c,requestId:_0x539926})=>{Math['max'](..._0x18c58c['map'](_0x32a7a7=>_0x32a7a7['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x18c58c,_0x539926);}):this['_handleRevisionsUpdate'](_0x18c58c,_0x539926);});const {revisions:_0x93e961,requestId:_0x502fdf}=await this['_revisionHistoryService']['connect'](_0x3b2647['connection']);_0x3b2647['addToReconnectionStack'](this),this['_lastRequestId']=_0x502fdf,await this['_fetchMissingUsers'](_0x93e961);for(const _0x177c3d of _0x93e961)this['_revisionTracker']['addRevisionData'](_0x177c3d);this['listenTo'](_0x39d88a,'change:_isConnected',(_0x58bb1d,_0x9162d2,_0x1b6dfc)=>{_0x1b6dfc&&(this['_oldOffset']=_0x39d88a['_offset'],_0x58bb1d['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3b2647,'state',_0x67fdc1=>_0x67fdc1===_0x36321a['CONNECTED']);}async['reconnect'](){const _0x280788=this['editor']['plugins']['get'](n),_0x117192=this['editor']['plugins']['get'](l),_0x28f8f7=async()=>{const _0x31d7d6=this['_revisionTracker']['currentRevision'],_0x2d8d85=_0x31d7d6['id'],_0x56b7e7=_0x2d8d85!==_0x117192['sessionId'];if(_0x56b7e7){const _0x5a7b4a=_0x117192['_offset']-this['_oldOffset'],_0x22c727=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x31d7d6['toVersion']+_0x5a7b4a!==_0x22c727){const _0x45a79a=_0x31d7d6['fromVersion']+_0x5a7b4a,_0xb3c4bd=this['editor']['plugins']['get'](_0x4fba0e),_0x168414=this['_revisionTracker']['buildRevisionData']({'revision':_0x31d7d6,'from':_0x45a79a,'to':_0x22c727});_0x168414['id']=_0x31d7d6['id'];const _0x2655c7=_0x168414['authorsIds']['map'](_0x226102=>_0xb3c4bd['getUser'](_0x226102));_0x31d7d6['_update']({..._0x168414,'authors':_0x2655c7},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x31d7d6['id'],_0x168414,!0x0);}this['_revisionTracker']['_startingVersion']=_0x22c727,(_0x31d7d6['toVersion']===_0x31d7d6['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x2d8d85)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x2d8d85),this['_revisionTracker']['_createCurrentRevision'](_0x22c727));}const {revisions:_0x99da9c,requestId:_0x18f9c7}=await this['_revisionHistoryService']['reconnect'](_0x280788['connection'],this['_lastRequestId']);_0x56b7e7&&_0x99da9c['length']>0x0?_0x117192['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x99da9c),this['_handleRevisionsUpdate'](_0x99da9c,_0x18f9c7),this['_revisionTracker']['sendBufferedUpdates']());};return _0x117192['_isConnected']?_0x28f8f7():new Promise((_0x113bf9,_0x5e5a55)=>{_0x117192['once']('change:_isConnected',()=>{_0x28f8f7()['then'](_0x113bf9)['catch'](_0x5e5a55);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0xa89520=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5e8325=>{_0x5e8325['off'](),_0xa89520();});});}['_getLatestVersionFromServerOperations'](){const _0x55ddd9=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x302613 of _0x55ddd9)if('marker'!==_0x302613['type']||_0x302613['affectsData'])return _0x302613['baseVersion']+0x1;}['_getLatestVersion'](){const _0x2cc296=this['editor']['plugins']['get'](l);return new Promise(_0x5314e7=>{_0x2cc296['_isPendingUpdate']?_0x2cc296['once']('change:_isPendingUpdate',()=>{_0x5314e7(this['_getLatestVersionFromServerOperations']());}):_0x5314e7(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x57386c,_0x17c7fc){const _0x400794=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x17c7fc;for(const _0x48d000 of _0x57386c){const _0x21e1bd=_0x400794['getRevision'](_0x48d000['id']);if(_0x21e1bd){if((_0x48d000['fromVersion']||_0x48d000['toVersion'])&&(_0x48d000['diffData']=null),_0x21e1bd===this['_revisionTracker']['currentRevision']){const _0x46b05e=Math['max'](_0x21e1bd['toVersion'],_0x48d000['toVersion']),_0x2d80cc=Math['max'](_0x21e1bd['fromVersion'],_0x48d000['fromVersion']);let _0x5d7028;_0x21e1bd['toVersion']===_0x48d000['toVersion']&&_0x21e1bd['fromVersion']===_0x48d000['fromVersion']?(_0x5d7028=!0x0,this['_preventResendingRevisionData'](_0x48d000)):_0x48d000['toVersion']===_0x46b05e&&_0x48d000['fromVersion']===_0x2d80cc?_0x5d7028=!0x1:(_0x21e1bd['toVersion']===_0x46b05e&&_0x21e1bd['fromVersion']===_0x2d80cc||this['_fixRevision']({'revision':_0x21e1bd,'from':_0x2d80cc,'to':_0x46b05e}),_0x5d7028=!0x0),_0x5d7028&&(delete _0x48d000['fromVersion'],delete _0x48d000['toVersion'],delete _0x48d000['diffData'],delete _0x48d000['createdAt'],delete _0x48d000['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x48d000),this['_preventResendingRevisionData'](_0x48d000);}else this['_revisionTracker']['addRevisionData'](_0x48d000);}const _0x57baaf=_0x400794['getRevisions']();_0x57baaf['reverse']();for(let _0x4344e5=0x0;_0x4344e5<_0x57baaf['length']-0x1;_0x4344e5++){const _0x660bb9=_0x57baaf[_0x4344e5],_0x35cad4=_0x57baaf[_0x4344e5+0x1];if(_0x660bb9['fromVersion']<_0x35cad4['toVersion']){const _0x50483f=_0x35cad4['toVersion'],_0x5740fb=Math['max'](_0x50483f,_0x660bb9['toVersion']);this['_fixRevision']({'revision':_0x660bb9,'from':_0x50483f,'to':_0x5740fb});}}}['_fixRevision']({revision:_0x515260,from:_0x35a6a8,to:_0x1f744e}={}){const _0x901358=this['editor']['plugins']['get'](_0x4fba0e),_0x43fdaf=this['_revisionTracker']['buildRevisionData']({'revision':_0x515260,'from':_0x35a6a8,'to':_0x1f744e});_0x43fdaf['authors']=_0x43fdaf['authorsIds']['map'](_0x25e4fc=>_0x901358['getUser'](_0x25e4fc)),_0x515260['_update'](_0x43fdaf);}['_preventResendingRevisionData'](_0x44e278){const _0x162662={};_0x162662['id']=_0x44e278['id'];for(const _0x4db6fe of Object['keys'](_0x44e278))'id'!==_0x4db6fe&&(_0x162662[_0x4db6fe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x162662['id'],_0x162662,!0x0);}async['_fetchMissingUsers'](_0x35799e){const _0x5071c5=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x82124c}=this['editor']['plugins']['get'](n),_0x68e5dc=new Set();for(const _0x32b4f6 of _0x35799e){for(const _0x169be3 of _0x32b4f6['authorsIds'])_0x17992e(_0x169be3);_0x32b4f6['creatorId']&&_0x17992e(_0x32b4f6['creatorId']);}if(0x0===_0x68e5dc['size'])return;const _0x49218=await ht['getMany'](_0x82124c,Array['from'](_0x68e5dc));for(const _0x388184 of _0x49218)_0x5071c5['getUser'](_0x388184['id'])||_0x5071c5['addUser'](_0x388184);function _0x17992e(_0x2edf8e){_0x5071c5['getUser'](_0x2edf8e)||_0x68e5dc['add'](_0x2edf8e);}}}function b(_0x295dc0){return _0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x25b979{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Z extends _0x1c3372{['_collapseAt'];constructor(_0x4607a5,_0x44cc6c=0x6){super(_0x4607a5);const _0x28527c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x44cc6c,this['bind']('isHidden')['to'](this,'usersCount',_0x17a4c2=>_0x17a4c2<_0x44cc6c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x28527c['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':_0x28527c['to']('usersCount',_0x2db5b2=>'+'+(_0x2db5b2-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x1c3372{['items'];['keystrokes'];constructor(_0x7b63){super(_0x7b63);const _0x5a45c1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5360be(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5a45c1['if']('hasPopup'),'aria-expanded':_0x5a45c1['to']('isExpanded',_0x5bb8b0=>this['hasPopup']&&String(_0x5bb8b0)),'aria-label':_0x5a45c1['to']('hasPopup',_0x58c25e=>B(_0x7b63,_0x58c25e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5a45c1['to']('hasPopup',_0x33df25=>!!_0x33df25&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x5a45c1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x5a45c1['to'](_0x6cd37=>{const _0x5ea4bc=_0x6cd37,_0x2da6d1=document['querySelector']('.ck-presence-list__dropdown-list'),_0x1107cd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2da6d1?.['contains'](_0x5ea4bc['relatedTarget'])||_0x1107cd?.['contains'](_0x5ea4bc['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x333b88,_0xe63128,_0x32c3a1)=>{this['element']&&(_0x32c3a1?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 Y extends _0x1c3372{['counterView'];['inlineListView'];constructor(_0x8d3b9e,_0x151b8c=0x6){super(_0x8d3b9e);const _0x111f7b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new Z(this['locale'],_0x151b8c),this['inlineListView']=new is(_0x8d3b9e),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x14b91c of this['inlineListView']['items'])_0x14b91c['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',_0x111f7b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class tt extends _0x1c3372{['listWrapperView'];constructor(_0x3711e9,_0x237b33){super(_0x3711e9);const _0x3c4577=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x3711e9,_0x237b33),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':B(_0x3711e9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x3c4577['to'](_0x10d3d8=>{const _0x1743bb=_0x10d3d8,_0x4434f3=document['querySelector']('.ck-presence-list__list'),_0x395e25=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4434f3?.['contains'](_0x1743bb['relatedTarget'])||_0x395e25?.['contains'](_0x1743bb['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x4de888{constructor(_0x2c5149,_0x182271){super(_0x2c5149);const _0x7a8e13=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x182271?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x7a8e13['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x7a8e13['to']('role'),'aria-label':_0x7a8e13['to']('ariaLabel'),'aria-labelledby':_0x7a8e13['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x57f3d3['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4cd10f=this['element'];_0x4cd10f&&(this['_isScrollable']=Math['max'](_0x4cd10f['scrollHeight'],_0x4cd10f['clientHeight'])>0.8*window['innerHeight']);}}class st extends rt{['userView'];constructor(_0xfd44e4,_0x464d5b,_0x4f093a){super(_0xfd44e4);const _0x47798e=this['bindTemplate'];this['userView']=new ct(_0xfd44e4,_0x464d5b);const _0x246048={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x464d5b['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x464d5b['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x464d5b['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4f093a&&(_0x246048['tag']='button',_0x246048['on']={'click':_0x47798e['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x246048);}['focus'](){this['element']['focus']();}}class it extends _0x1c3372{['userView'];['markerView'];constructor(_0x4900f9,_0x11ebe9,_0x56c5fc){super(_0x4900f9);const _0x488512=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x4900f9,_0x11ebe9),this['markerView']=new MarkerView(_0x4900f9,_0x11ebe9);const _0x2cc920=new ot(_0x4900f9);_0x2cc920['template']['tag']='span',_0x2cc920['text']=_0x11ebe9['name'];const _0x12ead6={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x488512['to']('isFocusable',_0xcaed44=>!!_0xcaed44&&0x0),'aria-labelledby':_0x2cc920['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x488512['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x488512['to']('hasTooltip',_0x2b7d71=>!_0x2b7d71),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2cc920]};_0x56c5fc&&(_0x12ead6['tag']='button',_0x12ead6['on']={'click':_0x488512['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x12ead6);}}class MarkerView extends _0x1c3372{constructor(_0x258691,_0x3bf991){super(_0x258691),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3bf991['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const et={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x6f804a{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xad3726){super(_0xad3726),this['context']['config']['define']('presenceList',et);const _0x494f30=_0xad3726['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x494f30)throw new _0xb4ae54('presencelist-collapseat-invalid-format',this);if(_0x494f30<0x1)throw new _0xb4ae54('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x247fc3(),this['balloonPanelView']=new _0x146574(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x2bf566 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x2bf566);this['listenTo'](this['_allConnectedUsers'],'add',(_0x37f636,_0x47e298)=>{this['_handleUserAdd'](_0x47e298);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2efb9b,_0x177acb)=>{this['_handleUserRemove'](_0x177acb);});}['_createView'](){const _0x4a8fce=this['context'],_0x388caa=new Y(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x385da9=this['balloonPanelView'];if(!_0x245a67(_0x4a8fce['config']['get']('presenceList.container')))throw new _0xb4ae54('presencelist-missing-container',this);return _0x388caa['counterView']['bind']('usersCount')['to'](this),_0x388caa['bind']('isCollapsed')['to'](this,'usersCount',_0x14b98c=>{const {collapseAt:_0x314b8a}=_0x4a8fce['config']['get']('presenceList'),_0x1de2d4=_0x14b98c>=_0x314b8a;if(_0x1de2d4&&!_0x388caa['inlineListView']['items']['find'](_0x52ac15=>_0x52ac15 instanceof Z)){const _0x580540=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x580540&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x388caa['inlineListView']['items']['add'](_0x388caa['counterView']);}return _0x1de2d4||this['hideDropdown'](),_0x1de2d4;}),_0x388caa['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x420d31=>{const _0x127a66=_0x4a8fce['config']['get']('presenceList'),_0x714f12=new it(_0x4a8fce['locale'],_0x420d31,!!_0x127a66['onClick']);return _0x714f12['bind']('hasTooltip')['to'](_0x388caa,'isCollapsed',_0x4fd4f7=>!_0x4fd4f7),_0x714f12['bind']('isFocusable')['to'](_0x388caa,'isCollapsed',_0x5c6e72=>!_0x5c6e72),_0x127a66['onClick']&&this['listenTo'](_0x714f12,'execute',()=>{this['view']['isCollapsed']||_0x127a66['onClick'](_0x420d31,_0x714f12['element']);}),_0x714f12;}),this['listenTo'](_0x388caa['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x388caa['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x388caa['inlineListView']['keystrokes']['set']('Enter',(_0x33b79d,_0x3c5329)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3c5329());}),_0x388caa['render'](),_0x385da9['render'](),_0x144a34({'emitter':_0x388caa,'activator':()=>_0x385da9['isVisible'],'contextElements':[_0x385da9['element'],_0x388caa['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4a8fce['config']['get']('presenceList.container')['appendChild'](_0x388caa['element']),this['_bodyCollection']=new _0x5c43da(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x388caa;}['_handleUserAdd'](_0xdbaba){if(!this['context']['config']['get']('presenceList.displayMe')&&_0xdbaba['isMe'])return;const _0x2c59f1=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2c59f1-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4947df=_0xdbaba['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0xdbaba,_0x4947df);}['_handleUserRemove'](_0x4b20f6){this['usersCount']--;const {collapseAt:_0x56e1fc}=this['context']['config']['get']('presenceList'),_0x1fa543=this['usersCount']>=_0x56e1fc;if(this['currentDisplayedUsers']['get'](_0x4b20f6['id']))this['currentDisplayedUsers']['remove'](_0x4b20f6['id']);else{if(_0x1fa543&&this['currentDisplayedUsers']['length']+0x1===_0x56e1fc-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1fa543?0x1:0x0)<this['usersCount']){for(const _0x362447 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x362447['id'])&&(this['currentDisplayedUsers']['add'](_0x362447,Math['min'](this['currentDisplayedUsers']['length']-(_0x1fa543?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1fa543?0x1:0x0)===_0x56e1fc-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x261efe=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new tt(this['context']['locale'],!!_0x261efe['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x25ec65}=this['presenceDropdownView'];_0x25ec65['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x35f8e0=>{if(!_0x261efe['displayMe']&&_0x35f8e0['isMe'])return null;const _0x23c584=new st(this['context']['locale'],_0x35f8e0,!!_0x261efe['onClick']);return _0x261efe['onClick']&&this['listenTo'](_0x23c584,'execute',()=>{_0x261efe['onClick'](_0x35f8e0,_0x23c584['element']);}),_0x23c584;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x25ec65['focus'](),_0x25ec65['checkIfScrollable']();const _0x5500a7=(_0x54e6a4,_0x19a30c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x19a30c();};_0x25ec65['keystrokes']['set']('Esc',_0x5500a7),_0x25ec65['keystrokes']['set']('Shift+Tab',_0x5500a7),_0x25ec65['keystrokes']['set']('Tab',(_0x5834f7,_0x425799)=>{!function(_0x28a6e0){const _0x3459cd=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x32f569=>_0x32f569+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x55005d=[...document['body']['querySelectorAll'](_0x3459cd)]['filter'](_0x59dd5a=>_0x59dd5a===document['activeElement']||_0x59dd5a['offsetWidth']+_0x59dd5a['offsetHeight']>0x0)['sort']((_0x112acf,_0x12544d)=>(_0x112acf['tabIndex']||0x0)-(_0x12544d['tabIndex']||0x0)),_0x5dde6c=_0x55005d['indexOf'](_0x28a6e0),_0x451aac=_0x55005d[(_0x5dde6c+0x1)%_0x55005d['length']];_0x451aac&&_0x451aac['focus']();}(this['view']['element']),this['hideDropdown'](),_0x425799();}),_0x25ec65['focusTracker']['add'](this['view']['element']),_0x25ec65['focusTracker']['on']('change:isFocused',(_0x34302c,_0x15bcbe,_0x54ddc0)=>{_0x54ddc0||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 PresenceList extends _0x6f804a{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
|
23
|
+
import{ContextPlugin as _0x3bdf57,Plugin as _0x3332be,PendingActions as _0x442f90,Context as _0x1dce13}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x353b8b,CKEditorError as _0x5d0ce2,Collection as _0x9d9df4,global as _0x1b8319,version as nt,uid as _0x91b62c,KeystrokeHandler as _0x45cc9b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x452da1,View as _0x512b3c,ListView as _0x477aad,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x4371c1,clickOutsideHandler as _0x2a979d,BodyCollection as _0x2b3d32}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x2bf042,History as _0x5d395f,NoOperation as _0x5dd696,InsertOperation as _0x44c460,MarkerOperation as _0xc8e293,RootAttributeOperation as _0x53ed4f,transformOperationSets as _0x4179bf,OperationFactory as _0x287ee3}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as at,WEB_SOCKET_GATEWAY_STATES as _0x495437,CollaborativeEditingService as _0x660943,User as ht,CommentsService as _0x35a16d,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1d83a7,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x28cf58}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3063f7}from'es-toolkit/compat';class n extends _0x3bdf57{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>at)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x452da1];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9b4bbc){super(_0x9b4bbc),this['set']('state',_0x495437['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x353b8b())();}['init'](){const _0x505a07=this['context'],_0x23904d=_0x505a07['plugins']['get']('CloudServices'),_0x2e0f30=_0x505a07['plugins']['get'](_0x452da1);if(!_0x23904d['token'])throw new _0x5d0ce2('websocketgateway-missing-token',this);if(!_0x23904d['webSocketUrl'])throw new _0x5d0ce2('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x23904d['token'],_0x23904d['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x25fed1=>{if(this['connection']=_0x25fed1,this['bind']('state')['to'](_0x25fed1,'state',this,'_isBrowserOffline',(_0x2308cc,_0x36c2a8)=>('connected'!==_0x2308cc&&(this['_shouldPluginsReconnect']=!0x0),_0x36c2a8||_0x2308cc!==_0x495437['CONNECTED']?_0x495437['DISCONNECTED']:this['state']==_0x495437['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x495437['CONNECTING']):_0x495437['CONNECTED'])),this['connection']['on']('error',(_0x941424,_0x21c707)=>{if('limitExceeded'!==_0x21c707['code'])throw console['error'](_0x21c707),new _0x5d0ce2('cloudservices-init',null,{'originalError':_0x21c707});_0x2e0f30['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'});}),!_0x25fed1['me'])return new Promise(_0x22d250=>_0x25fed1['on']('change:me',_0x22d250));})['catch'](_0x8f65b3=>{throw console['error'](_0x8f65b3),new _0x5d0ce2('cloudservices-init',null,{'originalError':_0x8f65b3});});}['addToReconnectionStack'](_0x4cebff){if('function'!=typeof _0x4cebff['reconnect'])throw new _0x5d0ce2('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4cebff))throw new _0x5d0ce2('websocketgateway-plugin-already-registered',this,{'name':_0x4cebff['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4cebff);}['removeFromReconnectionStack'](_0x597577){this['_reconnectionStack']['delete'](_0x597577);}['isInReconnectionStack'](_0x5df197){return this['_reconnectionStack']['has'](_0x5df197);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1572fa=>_0x1572fa['reconnect']())))['then'](()=>this['state']=_0x495437['CONNECTED'])['catch'](_0x55c51b=>{throw console['error'](_0x55c51b),new _0x5d0ce2('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x495437['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x3bdf57{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x1d83a7];}constructor(_0x4c3b95){super(_0x4c3b95),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x9d9df4(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d83a7);}['init'](){const _0x4b00f3=this['context']['plugins']['get'](n);this['listenTo'](_0x4b00f3,'change:state',(_0x2b0dc3,_0x216d35,_0xa59dd5)=>{if('connected'!==_0xa59dd5)this['channelSessions']['forEach'](_0x5d6005=>_0x5d6005['clear']()),this['channelConnectedUsers']['forEach'](_0x2ef3e2=>_0x2ef3e2['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x114a92,_0x26f7ba]of this['_registeredSessions'])for(const _0x48bcae of _0x26f7ba)this['_handleSessionAdd'](_0x114a92,_0x48bcae);}}),this['_createUser'](_0x4b00f3['connection']['me'],!0x0);}['register'](_0x27df37,_0x170725){if(this['_registeredSessions']['has'](_0x27df37))throw new _0x5d0ce2('sessions-register-already-registered',null,{'channelId':_0x27df37});this['_registeredSessions']['set'](_0x27df37,_0x170725),this['channelSessions']['set'](_0x27df37,new _0x9d9df4()),this['channelConnectedUsers']['set'](_0x27df37,new _0x9d9df4()),this['listenTo'](_0x170725,'add',(_0x10cc86,_0x31b0f4)=>this['_handleSessionAdd'](_0x27df37,_0x31b0f4)),this['listenTo'](_0x170725,'remove',(_0x94d45e,_0x3717f1)=>this['_handleSessionRemove'](_0x27df37,_0x3717f1));for(const _0x5d49df of _0x170725)this['_handleSessionAdd'](_0x27df37,_0x5d49df);}['unregister'](_0x1cbd39){if(!this['_registeredSessions']['has'](_0x1cbd39))throw new _0x5d0ce2('sessions-unregister-not-exist',null,{'channelId':_0x1cbd39});const _0x33f692=this['_registeredSessions']['get'](_0x1cbd39);this['stopListening'](_0x33f692);for(const _0x3d1e5c of _0x33f692)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x1cbd39,_0x3d1e5c);this['_registeredSessions']['delete'](_0x1cbd39),this['channelSessions']['delete'](_0x1cbd39),this['channelConnectedUsers']['delete'](_0x1cbd39);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0xe0e1db){for(const _0x1df18b of this['channelSessions']['values']())for(const _0x9eacad of _0x1df18b)if(_0x9eacad['id']===_0xe0e1db)return _0x9eacad['user'];}['getUserSessions'](_0xbfcb2c,_0xe621d1){const _0x82b693=_0xe621d1?[this['channelSessions']['get'](_0xe621d1)]:this['channelSessions']['values'](),_0x123aa2=new Set();for(const _0x40b4f7 of _0x82b693)for(const _0x158cc7 of _0x40b4f7)_0x158cc7['user']['id']===_0xbfcb2c['id']&&_0x123aa2['add'](_0x158cc7['id']);return _0x123aa2;}['getUserRole'](_0x4180ae){for(const _0x3e7aa9 of this['channelSessions']['values']())for(const _0x588af3 of _0x3e7aa9)if(_0x588af3['user']===_0x4180ae)return _0x588af3['role'];}['_handleSessionAdd'](_0x33697a,_0x113bd2){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x5b3107=_0x113bd2['user'],_0x5b19b1=this['_users']['getUser'](_0x5b3107['id'])||this['_createUser'](_0x5b3107),_0x4917d5=Object['assign']({},_0x113bd2,{'user':_0x5b19b1});if(this['channelSessions']['get'](_0x33697a)['add'](_0x4917d5),!_0x5b3107['hiddenInPresenceList']){const _0x642f05=this['channelConnectedUsers']['get'](_0x33697a);_0x642f05['has'](_0x5b19b1['id'])||_0x642f05['add'](_0x5b19b1),this['allConnectedUsers']['has'](_0x5b19b1['id'])||_0x5b3107['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x5b19b1,_0x5b19b1['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x33697a,{'channelId':_0x33697a,'session':_0x4917d5});}['_handleSessionRemove'](_0x139445,_0x2ae7d1){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x679de1=this['channelConnectedUsers']['get'](_0x139445),_0x228036=_0x2ae7d1['user'];_0x228036['id']&&(this['channelSessions']['get'](_0x139445)['remove'](_0x2ae7d1['id']),_0x679de1['has'](_0x228036['id'])&&!this['getUserSessions'](_0x228036,_0x139445)['size']&&_0x679de1['remove'](_0x228036['id']),this['allConnectedUsers']['get'](_0x228036['id'])&&!this['getUserSessions'](_0x228036)['size']&&this['allConnectedUsers']['remove'](_0x228036['id']));}['_createUser'](_0x5cac7c,_0x2d0256){const _0x54e8e7=this['_users']['addUser'](_0x5cac7c);return _0x2d0256&&this['_users']['defineMe'](_0x5cac7c['id']),_0x54e8e7['orderNumber']=this['_uniqueUsersCount']++,_0x54e8e7;}}class k extends _0x3332be{['_domEmitter']=new(_0x353b8b())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x47b9c3=this['editor'],_0x19ca72=_0x47b9c3['plugins']['get'](i);_0x47b9c3['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x1a74d0,{writer:_0x2ad035})=>function(_0x2fc635,_0x4043d,_0x31a83a,_0x11bdf0){const _0x26570e=_0x2fc635['markerName']['split'](':')[0x2],_0x89f437=_0x31a83a['getUserBySessionId'](_0x26570e);if(!_0x89f437||_0x26570e===_0x31a83a['mySessionId'])return;if(!_0x11bdf0['model']['schema']['checkChild'](_0x2fc635['markerRange']['start'],'$text'))return;const _0x3ccff0={'class':'ck-user__marker\x20'+_0x89f437['color']['getMarkerClass'](),'data-name':_0x89f437['name'],'data-session-id':_0x26570e},_0xc52b65=_0x11bdf0['model']['markers']['get'](_0x2fc635['markerName']),_0x6a96bd=_0xc52b65['getStart'](),_0x3befd5=_0x6a96bd['nodeAfter'],_0x4b4e24=_0x11bdf0['model']['schema'];if(_0x3befd5&&_0x4b4e24['isObject'](_0x3befd5)&&_0x4b4e24['isInline'](_0x3befd5)&&!_0x11bdf0['model']['markers']['get']('user:range:'+_0x26570e)['getRange']()['isCollapsed'])return;const _0x1e04d6=_0x6a96bd['parent'];return _0x11bdf0['model']['schema']['isLimit'](_0x1e04d6)&&!_0x11bdf0['model']['hasContent'](_0x1e04d6)&&(_0x3ccff0['contenteditable']=!0x1),function(_0x1b97b4,_0xf78131,_0x58253a){const _0x3575cd=_0x1b97b4['createUIElement']('span',_0xf78131);return _0x1b97b4['setCustomProperty']('userPositionMarker',!0x0,_0x3575cd),_0x3575cd['render']=function(_0x235f6b){const _0x5d4b3f=this['toDomElement'](_0x235f6b),_0x539fcd=document['createElement']('span');return _0x539fcd['classList']['add']('ck-user__marker-tooltip'),_0x539fcd['setAttribute']('contenteditable','false'),_0x539fcd['setAttribute']('spellcheck','false'),_0x539fcd['textContent']=_0x58253a['name'],_0x5d4b3f['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x539fcd['outerHTML']+'',_0x5d4b3f['addEventListener']('mouseenter',()=>{_0x5d4b3f['classList']['add']('ck-user__marker_hovered');}),_0x5d4b3f['addEventListener']('mouseleave',()=>{_0x5d4b3f['classList']['remove']('ck-user__marker_hovered');}),_0x5d4b3f;},_0x3575cd['isSimilar']=function(_0xbf74cb){return!(!this['getCustomProperty']('userPositionMarker')||!_0xbf74cb['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xbf74cb['getAttribute']('data-session-id'));},_0x3575cd;}(_0x4043d,_0x3ccff0,_0x89f437);}(_0x1a74d0,_0x2ad035,_0x19ca72,_0x47b9c3)}),_0x47b9c3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x331303=>function(_0x8edeaf,_0x180390){const _0x16469c=_0x8edeaf['markerName']['split'](':')[0x2];if(_0x16469c===_0x180390['mySessionId'])return null;const _0x578cd6=_0x180390['getUserBySessionId'](_0x16469c);if(!_0x578cd6)return{'id':_0x16469c,'classes':[]};return{'id':_0x16469c,'classes':['ck-user__selection',_0x578cd6['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x16469c},'priority':0x7d0+_0x578cd6['orderNumber']};}(_0x331303,_0x19ca72)}),function(_0x2a5ee9){const _0x48c828=_0x2a5ee9['model'],_0x19221a=new Map(),_0x206450=_0x2a5ee9['plugins']['get'](i);_0x48c828['markers']['on']('update:user:range',(_0x47fb6e,_0x276cb5,_0x581f55,_0x19f1b8)=>{if(!_0x19f1b8&&_0x19221a['get'](_0x276cb5['name']))return _0x19221a['get'](_0x276cb5['name'])['detach'](),void _0x19221a['delete'](_0x276cb5['name']);const _0x27034b=_0x276cb5['name']['split'](':')[0x2];if(_0x27034b===_0x206450['mySessionId'])return;const _0x26e7e6='user:position:'+_0x27034b;_0x48c828['markers']['has'](_0x26e7e6)&&_0x2a5ee9['editing']['reconvertMarker'](_0x26e7e6),_0x276cb5['on']('change:range',(_0x5f0ead,_0x4da703,_0x1a8886)=>{if('$graveyard'!=_0x4da703['root']['rootName']&&'$graveyard'==_0x276cb5['getRange']()['root']['rootName']&&!_0x19221a['has'](_0x276cb5['name'])){const _0x2f8c1b=_0x48c828['schema']['getNearestSelectionRange'](_0x1a8886['deletionPosition']);if(_0x2f8c1b){const _0x36c0ec=_0x2bf042['fromRange'](_0x2f8c1b);_0x19221a['set'](_0x276cb5['name'],_0x36c0ec),_0x36c0ec['on']('change:range',(_0x2d23d5,_0xc23baf,_0x2fcdcd)=>{if('$graveyard'==_0x36c0ec['root']['rootName']){const _0x5e4cb3=_0x48c828['schema']['getNearestSelectionRange'](_0x2fcdcd['deletionPosition']);_0x5e4cb3?(_0x36c0ec['start']=_0x5e4cb3['start'],_0x36c0ec['end']=_0x5e4cb3['end']):(_0x19221a['delete'](_0x276cb5['name']),_0x36c0ec['detach']());}});}}});}),_0x48c828['document']['on']('change',()=>{_0x19221a['size']>0x0&&_0x48c828['enqueueChange']({'isUndoable':!0x1},_0x293b05=>{for(const [_0x404cd5,_0x447937]of _0x19221a)'$graveyard'==_0x48c828['markers']['get'](_0x404cd5)['getRange']()['root']['rootName']&&(x(_0x404cd5['split'](':')[0x2],_0x447937['toRange'](),_0x48c828,_0x293b05),_0x447937['detach']());_0x19221a['clear']();});});}(_0x47b9c3),this['_domEmitter']['listenTo'](_0x1b8319['document'],'keydown',(_0x152eab,{key:_0x56f6bf})=>{'Escape'===_0x56f6bf&&function(_0x28aad8){_0x28aad8['editing']['view']['change'](_0x5a8117=>{for(const _0x4e275e of _0x28aad8['model']['markers']){if(!_0x4e275e['name']['startsWith']('user:position'))continue;const _0x54668a=_0x28aad8['editing']['mapper']['markerNameToElements'](_0x4e275e['name']);if(_0x54668a){for(const _0x29653d of _0x54668a)_0x5a8117['removeClass']('ck-user__marker_hovered',_0x29653d);}}});}(_0x47b9c3);},{'useCapture':!0x0});}['afterInit'](){const _0x249a60=this['editor'],_0x232bf6=_0x249a60['commands']['get']('undo');_0x232bf6&&_0x249a60['model']['on']('applyOperation',(_0x457326,_0x3e4d8d)=>{const _0x15c3f3=_0x3e4d8d[0x0];if(!_0x15c3f3['isDocumentOperation'])return;if('marker'!=_0x15c3f3['type']||!_0x15c3f3['name']['startsWith']('user:'))return;const _0x35d055=_0x15c3f3['batch'];_0x232bf6['_createdBatches']['has'](_0x35d055)&&(_0x15c3f3['newRange']=_0x15c3f3['oldRange']?_0x249a60['model']['createRange'](_0x15c3f3['oldRange']['start'],_0x15c3f3['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x383a9b=this['editor'],_0xfe5c3f=_0x383a9b['model']['document'],_0x37dd4a=_0x383a9b['plugins']['get'](i);_0x383a9b['model']['enqueueChange']({'isUndoable':!0x1},_0x56d30a=>{const _0x37113c='user:range:'+_0x37dd4a['mySessionId'],_0x5a4c98='user:position:'+_0x37dd4a['mySessionId'],_0x32b148=_0x383a9b['model']['markers']['has'](_0x37113c);_0x383a9b['editing']['view']['hasDomSelection']?x(_0x37dd4a['mySessionId'],_0xfe5c3f['selection']['getFirstRange'](),_0x383a9b['model'],_0x56d30a):_0x32b148&&(_0x56d30a['removeMarker'](_0x37113c),_0x56d30a['removeMarker'](_0x5a4c98));});}}function x(_0x28b303,_0xf949a0,_0x2a6e63,_0x25e47e){const _0x48e2f4='user:range:'+_0x28b303,_0x4b4f47='user:position:'+_0x28b303,_0x4868f3=_0xf949a0['getContainedElement']();let _0x5c95b9=_0xf949a0['start'];if(_0x4868f3&&_0x4868f3['is']('element','tableCell')){const _0x2f68d1=function(_0x58a4cc,_0x32af22){for(const _0x5ecf9d of _0x58a4cc['getPositions']())if(_0x32af22['schema']['checkChild'](_0x5ecf9d,'$text'))return _0x5ecf9d;}(_0xf949a0,_0x2a6e63);_0x2f68d1&&(_0x5c95b9=_0x2f68d1,_0xf949a0=_0x25e47e['createRange'](_0x5c95b9));}const _0x1aa3a5=_0x25e47e['createRange'](_0x5c95b9);_0x2a6e63['markers']['has'](_0x48e2f4)?(_0x25e47e['updateMarker'](_0x48e2f4,{'range':_0xf949a0}),_0x25e47e['updateMarker'](_0x4b4f47,{'range':_0x1aa3a5})):(_0x25e47e['addMarker'](_0x48e2f4,{'range':_0xf949a0,'usingOperation':!0x0}),_0x25e47e['addMarker'](_0x4b4f47,{'range':_0x1aa3a5,'usingOperation':!0x0}));}function R(_0x185dab,_0x28b1b7,_0x8b8799){const _0x435f5e=_0x185dab['t'],t=_0x185dab['t'];switch(_0x28b1b7){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 _0x435f5e({'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'},_0x8b8799);default:return'';}}let j=0x1;class l extends _0x3332be{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x660943)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,k,_0x442f90,_0x1d83a7,_0x452da1];}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 _0x3fdb34=this['serverHistory']['getOperations']();for(let _0x29e414=_0x3fdb34['length']-0x1;_0x29e414>=0x0;_0x29e414--){const _0x346a40=_0x3fdb34[_0x29e414];if(!this['_disconnectionOperations']['has'](_0x346a40))return _0x346a40['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x30c291){if(super(_0x30c291),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5d395f(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x5d0ce2('collaboration-missing-channelid',this);const _0x554c0e=_0x30c291['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x554c0e,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x28cf58(),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 OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x1d03ec=this['editor'],_0x478588=_0x1d03ec['plugins']['get'](_0x1d83a7),_0x1bee79=_0x1d03ec['plugins']['get'](n);this['listenTo'](_0x478588,'getOperationAuthor',(_0xa610,_0x419f50)=>{const _0x3d74d0=_0x419f50[0x0];_0x3d74d0['_authorId']&&(_0xa610['return']=_0x478588['getUser'](_0x3d74d0['_authorId']),_0xa610['stop']()),null===_0x3d74d0['_authorId']&&(_0xa610['return']=null,_0xa610['stop']());},{'priority':'high'}),this['listenTo'](_0x1d03ec['model']['document']['selection'],'change:range',(_0x4044b7,_0x1bb5c2)=>{_0x1bb5c2['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1d03ec['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1d03ec['model']['on']('applyOperation',(_0x225fd0,_0x13da4e)=>{const _0x2eaba2=_0x13da4e[0x0];_0x2eaba2['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2eaba2),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x1bee79,'state',this,'_hasSynchronizationProblem',(_0x37d2f4,_0x4ba3a9)=>'connected'===_0x37d2f4&&!_0x4ba3a9),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1d03ec['disableReadOnlyMode']('rtc-offline'):_0x1d03ec['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1d03ec['disableReadOnlyMode']('rtc-offline'):_0x1d03ec['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xbf7d69=this['editor']['plugins']['get'](i),_0x4668ab=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0xbf7d69['unregister'](this['_channelId']);const _0x1c550a=await this['_service']['reconnect'](_0x4668ab['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1c550a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x5ed837=await this['_service']['getConnectedSessions']();_0xbf7d69['register'](this['_channelId'],_0x5ed837),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2575a4){if(function(_0xaa76fa){return'404'===_0xaa76fa['code'];}(_0x2575a4)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x350e5f){return'409'===_0x350e5f['code'];}(_0x2575a4)){const _0x219549=R(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'](_0x219549);}else{if(!(_0x2575a4 instanceof ReconnectionError))throw _0x2575a4;this['_handleReconnectionError']();}}}}['destroy'](){const _0x25b645=this['editor']['plugins']['get'](n),_0x4597d6=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4597d6['channelSessions']['has'](this['_channelId'])&&_0x4597d6['unregister'](this['_channelId']),_0x25b645['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x1e5de8){if(this['sessionId']!==_0x1e5de8['sessionId']&&this['_lastSyncedOperationId']!==_0x1e5de8['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x1e5de8['sessionId'],this['_handleServerResponse']([],{..._0x1e5de8,'wereChangesApplied':!0x1,'data':_0x1e5de8['data']},'reconnect');}async['_connectService'](_0x31752d,_0x1aaf5f=!0x1){const {connection:_0x16fcad}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x16fcad,this['_channelId'])['then'](_0x582dee=>this['_initSessionsHandling'](_0x582dee))['catch'](_0x4a6aa3=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4a6aa3);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xff5fd9,_0x2f88ac)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x2f88ac);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x7844=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x31752d);this['_isPendingUpdate']=!0x0;const _0x202fad=await this['_service']['connect'](_0x16fcad,this['_compressOperations'](_0x31752d),_0x7844);if(this['sessionId']=_0x202fad['sessionId'],_0x1aaf5f){if(!_0x202fad['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x202fad['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x31752d,_0x202fad,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x202fad,_0x31752d);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0xa3bb79=this['editor']['plugins']['get'](i),_0xcd2ef7=this['editor']['plugins']['get'](k),_0x314274=_0xa3bb79['channelSessions']['get'](this['_channelId']);_0x314274&&_0x314274['length']>0x1?_0xcd2ef7['createUserMarkerOperations']():this['listenTo'](_0xa3bb79,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xa3bb79['channelSessions']['get'](this['_channelId'])['length']&&_0xcd2ef7['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x36b97b,_0x3fe60a,_0x1c6d1d,_0x881d4c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3fe60a){const _0x11ad3a=this['_decompressOperations'](_0x1c6d1d,_0x881d4c);await this['_fetchMissingUsers'](_0x11ad3a),this['_handleExternalOperations'](_0x11ad3a,_0x3fe60a,_0x1c6d1d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x44d53b}=this['editor'];let _0x4cec64;try{_0x4cec64=await this['_service']['getDocumentDetails']();}catch{const _0x274d3e=R(_0x44d53b,'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'](_0x274d3e);}const _0x3a1759=_0x4cec64['currentDocumentSession']||_0x4cec64['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x3a1759['lastOperationId']){const _0x58eb22=R(_0x44d53b,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x58eb22);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x3d9a06){const _0x4f38fb=this['editor']['plugins']['get'](i);this['listenTo'](_0x4f38fb,'sessionAdd:'+this['_channelId'],(_0x312e91,{session:_0x8bd5db})=>{if(_0x8bd5db['id']===_0x4f38fb['mySessionId']){_0x312e91['off']();const _0x41e86f=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x41e760=_0x8bd5db['permissions'];_0x41e86f&&_0x41e86f['isEnabled']&&(_0x41e760=_0x41e760['filter'](_0x32b567=>'document:write'!==_0x32b567)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x41e760,this['_channelId']);}}),_0x4f38fb['register'](this['_channelId'],_0x3d9a06);}['_initThrowingOnDataSet'](){const _0x30810c=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x8b6c9c)=>{if(!_0x8b6c9c[_0x8b6c9c['length']-0x1]['suppressErrorInCollaboration'])throw new _0x5d0ce2('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x30810c['apply'](this['editor']['data'],_0x8b6c9c);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x218568,[_0x45c54a])=>{if(this['_document']['version'])throw new _0x5d0ce2('realtimecollaborationclient-init-document-already-initialized',this);_0x218568['stop'](),this['_setPendingAction']();const _0x5e0249=this['editor']['config']['get']('rootsAttributes'),_0x5a96c2=this['_getOperationsFromInitData'](_0x45c54a,_0x5e0249);0x0==_0x5a96c2['length']&&_0x5a96c2['push'](new _0x5dd696(0x0)),_0x218568['return']=this['_connectService'](_0x5a96c2)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x53ba17=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x53ba17))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x451241,[_0x21f9b8,_0x37d630])=>{_0x451241['stop']();const _0x17b12f=this['editor']['model']['document']['getRoot'](_0x21f9b8);if(!this['_knownRootNames']['has'](_0x21f9b8)){const _0x28a1d5=_0x37d630&&_0x37d630['data']?_0x37d630['data']:'',_0xe0d6f7=_0x37d630&&_0x37d630['attributes']?_0x37d630['attributes']:{};await this['_loadRoot'](_0x21f9b8,_0x28a1d5,_0xe0d6f7);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x17b12f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x17b12f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x155326){const _0x7d7bc9=this['editor']['plugins']['get'](_0x1d83a7),{connection:_0x2a4c7c}=this['editor']['plugins']['get'](n),_0x556b2f=new Set();for(const _0x4be550 of _0x155326){const _0x30a567=_0x4be550['_authorId'];_0x30a567&&!_0x7d7bc9['getUser'](_0x30a567)&&_0x556b2f['add'](_0x30a567);}if(0x0===_0x556b2f['size'])return;const _0x20b7de=await ht['getMany'](_0x2a4c7c,Array['from'](_0x556b2f));for(const _0x4d6447 of _0x20b7de)_0x7d7bc9['getUser'](_0x4d6447['id'])||_0x7d7bc9['addUser'](_0x4d6447);}['_getOperationsFromInitData'](_0x505307,_0x432d28={}){const _0x28ede4=this['editor']['model'],_0x4f7be9=[];let _0x3556bd=0x0;const _0x472eb2='string'==typeof _0x505307?{'main':_0x505307}:_0x505307;for(const _0x2ce86a of Object['keys'](_0x472eb2)){if(!this['_document']['roots']['has'](_0x2ce86a))throw new _0x5d0ce2('realtimecollaborationclient-init-non-existent-root',this);const _0x20af55=this['editor']['data']['parse'](_0x472eb2[_0x2ce86a]),_0x5bc084=this['_document']['getRoot'](_0x2ce86a),_0x6f61d9=new _0x44c460(_0x28ede4['createPositionAt'](_0x5bc084,0x0),_0x20af55,_0x3556bd++);_0x4f7be9['push'](_0x6f61d9);for(const [_0x309b1a,_0x5f4121]of _0x20af55['markers']){const _0x37f9cf=_0x28ede4['createRange'](_0x28ede4['createPositionFromPath'](_0x5bc084,_0x5f4121['start']['path']['slice']()),_0x28ede4['createPositionFromPath'](_0x5bc084,_0x5f4121['end']['path']['slice']())),_0x3a6222=new _0xc8e293(_0x309b1a,null,_0x37f9cf,_0x28ede4['markers'],!0x0,_0x3556bd++);_0x4f7be9['push'](_0x3a6222);}}if(_0x432d28)for(const [_0x3d031d,_0x35d64f]of Object['entries'](_0x432d28)){const _0x576a92=_0x28ede4['document']['getRoot'](_0x3d031d);if(!_0x576a92)throw new _0x5d0ce2('multi-root-editor-root-attributes-no-root',null);for(const [_0x1a61cb,_0x1a2ca9]of Object['entries'](_0x35d64f))if(null!==_0x1a2ca9){const _0x580479=new _0x53ed4f(_0x576a92,_0x1a61cb,null,_0x1a2ca9,_0x3556bd++);_0x4f7be9['push'](_0x580479);}}return _0x4f7be9;}async['_loadRoot'](_0x17b26b,_0x2b72df,_0x24251f){this['_getOperationsFromInitData']({[_0x17b26b]:_0x2b72df},{[_0x17b26b]:_0x24251f})['forEach']((_0x2af9b8,_0x55bf4f)=>{_0x2af9b8['baseVersion']=this['_document']['version']+_0x55bf4f,_0x2af9b8['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2af9b8);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1b5ffd,_0x34ea2d){let _0x53a5f0;this['_offset']=_0x1b5ffd['offset'];const _0x4ae5e8=_0x1b5ffd['wereChangesApplied']&&!_0x1b5ffd['initData'],_0x1428b8=_0x4ae5e8?0x0:_0x1b5ffd['data']['baseVersion'];if(_0x34ea2d['forEach'](_0x30f3ff=>{_0x30f3ff['_isInit']=!0x0,_0x30f3ff['createdAt']=_0x1b5ffd['sessionCreatedAt'],_0x30f3ff['_authorId']=null;}),_0x4ae5e8)_0x53a5f0=_0x34ea2d,this['_applyOperationsSet'](_0x53a5f0,_0x4ae5e8);else{if(_0x1b5ffd['initData']){const _0x568197=this['_getOperationsFromInitData'](_0x1b5ffd['initData']);this['_document']['history']['version']=-_0x568197['length'],_0x568197['forEach'](_0x1bc938=>{_0x1bc938['baseVersion']-=_0x568197['length'],_0x1bc938['createdAt']=_0x1b5ffd['sessionCreatedAt'],_0x1bc938['_isInit']=!0x0,_0x1bc938['_authorId']=null;}),this['_applyOperationsSet'](_0x568197,!0x0),this['serverHistory']['version']=-_0x568197['length']+this['_offset'],this['_updateServerHistory'](_0x568197);}this['_document']['history']['version']=_0x1428b8,_0x53a5f0=this['_decompressOperations'](_0x1b5ffd['data'],_0x1b5ffd['metadata']),await this['_fetchMissingUsers'](_0x53a5f0),this['_applyOperationsSet'](_0x53a5f0,_0x4ae5e8);}_0x1b5ffd['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x53a5f0,_0x1b5ffd['lastOperationId']),this['_lastSyncedOperationId']=_0x1b5ffd['lastOperationId']),this['serverHistory']['version']=_0x1428b8+this['_offset'],this['_updateServerHistory'](_0x53a5f0),_0x34ea2d['filter'](_0x3e56b7=>{const _0x1a5cd8=this['_getAffectedRoot'](_0x3e56b7);return _0x1a5cd8&&!this['_knownRootNames']['has'](_0x1a5cd8);})['forEach']((_0x3a93e2,_0x282e59)=>{_0x3a93e2['baseVersion']=this['_document']['version']+_0x282e59,this['_saveOperationInBuffer'](_0x3a93e2);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x48f353,_0x19042c){const _0x14510a=_0x19042c&&_0x19042c['message'];if(_0x14510a&&_0x14510a['startsWith']('realtimecollaborationclient'))throw _0x19042c;const _0x4da8cb=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x4da8cb['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x5d0ce2(_0x48f353,this['editor'],_0x14510a?{'originalError':_0x14510a}:void 0x0);}['_saveOperationInBuffer'](_0x2de4e1){this['_knownOperations']['has'](_0x2de4e1)||(this['_knownOperations']['add'](_0x2de4e1),this['_bufferedOperations']['push'](_0x2de4e1),this['_pendingAction']||'marker'==_0x2de4e1['type']&&!_0x2de4e1['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3ed6c0=!0x1){!_0x3ed6c0&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3e1ca6=>{_0x3e1ca6&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x66851b=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x969358){return _0x969358['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x969358['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x969358['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x66851b)||this['_crash'](_0x66851b['message'],_0x66851b);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x1256f0=>{this['on']('change:_isPendingUpdate',()=>{_0x1256f0();});});}async['_sendBufferedOperations'](){const _0x7780a6=this['editor']['plugins']['get'](k);if(this['_shouldSendSelectionUpdate']()&&(_0x7780a6['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x12009a=[...this['_bufferedOperations']];for(const _0x351707 of _0x12009a)_0x351707['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x351707);const _0x45c072=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x12009a),_0x3ef26e=j++,_0x5e779c=this['_compressOperations'](_0x12009a),_0x54a56c=await this['_service']['sendOperations'](_0x5e779c,_0x5e779c['baseVersion'],_0x45c072);try{return await this['_handleServerResponse'](_0x12009a,_0x54a56c,_0x3ef26e);}catch(_0x409fc1){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x409fc1);}}async['_handleServerResponse'](_0x384c0c,_0x923a5d,_0x373c06){if('error'in _0x923a5d)throw _0x923a5d['error'];let _0x5d0e83=!0x1;if(_0x923a5d['wereChangesApplied']){_0x923a5d['lastOperationId']&&(this['_lastSyncedOperationId']=_0x923a5d['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x42fffd=>!_0x384c0c['includes'](_0x42fffd));for(const _0x42eb12 of _0x384c0c)_0x42eb12['createdAt']='lastOperationAcceptedAt'in _0x923a5d&&_0x923a5d['lastOperationAcceptedAt']||void 0x0;D(_0x384c0c,_0x923a5d['version']-_0x384c0c['length']),this['_updateServerHistory'](_0x384c0c);const _0x26fd45=_0x384c0c['filter'](_0x5278ed=>{if(!_0x5278ed['_isInit'])return!0x1;const _0x43fbb2=this['_getAffectedRoot'](_0x5278ed);return _0x43fbb2&&!this['_knownRootNames']['has'](_0x43fbb2);});D(_0x26fd45,this['_document']['version']),this['_applyOperationsSet'](_0x26fd45),_0x5d0e83=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3c139e=this['_decompressOperations'](_0x923a5d['data'],_0x923a5d['metadata'])['filter'](_0x4cd877=>_0x4cd877['baseVersion']>=this['_lastServerVersion']);_0x3c139e['forEach'](_0x39d374=>this['_addKnownRoot'](_0x39d374)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x351e13=>!_0x351e13['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x351e13))),this['_bufferedOperations']['length']&&D(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3c139e),_0x5d0e83=this['_handleExternalOperations'](_0x3c139e,_0x923a5d['version'],_0x923a5d['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5d0e83?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x1f0c9f,_0x534012,_0x3e9637){try{const _0x547d8a={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5ae186,operationsB:_0x390b68,originalOperations:_0xd5ebee}=_0x4179bf(_0x1f0c9f,this['_bufferedOperations'],_0x547d8a);D(_0x5ae186,this['_document']['version']),D(_0x390b68,_0x534012);for(const _0x9d6a64 of _0x5ae186){const _0x377811=_0xd5ebee['get'](_0x9d6a64);_0x9d6a64['_authorId']=_0x377811?_0x377811['_authorId']:null;}_0x3e9637&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1f0c9f,_0x3e9637),this['_lastSyncedOperationId']=_0x3e9637),this['_bufferedOperations']=[..._0x390b68],this['_applyOperationsSet'](_0x5ae186),this['_updateServerHistory'](_0x1f0c9f);}catch(_0x443a7d){return console['error'](_0x443a7d),!0x1;}return!0x0;}['_applyOperationsSet'](_0x37e4c1,_0x9b230f=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1523da=>{for(const _0x22d2a6 of _0x37e4c1)this['_knownOperations']['add'](_0x22d2a6),this['_addKnownRoot'](_0x22d2a6),_0x1523da['batch']['addOperation'](_0x22d2a6),this['editor']['model']['applyOperation'](_0x22d2a6);});}['_addKnownRoot'](_0x1fc8b8){const _0x47ac2d=this['_getAffectedRoot'](_0x1fc8b8);_0x47ac2d&&this['_knownRootNames']['add'](_0x47ac2d);}['_getAffectedRoot'](_0x46356a){let _0x257f6b,_0x4cf0ea;switch(_0x46356a['type']){case'insert':_0x257f6b=_0x46356a['position']['root'];break;case'marker':if(_0x4cf0ea=_0x46356a['newRange'],!_0x4cf0ea)return null;_0x257f6b=_0x4cf0ea['root'];break;case'addRootAttribute':_0x257f6b=_0x46356a['root'];break;case'addRoot':_0x257f6b=_0x46356a['affectedSelectable'];break;case'move':_0x257f6b=_0x46356a['targetPosition']['root'];break;default:return null;}return _0x257f6b['rootName'];}['_updateServerHistory'](_0x119183){_0x119183['forEach'](_0x14ad68=>{const _0xe2bc5b=_0x14ad68['clone']();_0xe2bc5b['_authorId']=_0x14ad68['_authorId'],_0xe2bc5b['_isInit']=!!_0x14ad68['_isInit'],_0xe2bc5b['createdAt']=_0x14ad68['createdAt'],_0xe2bc5b['baseVersion']+=this['_offset'],_0x14ad68['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xe2bc5b),this['serverHistory']['addOperation'](_0xe2bc5b);});}['_handleReconnectionError'](_0x598977){const _0x3da053=this['editor']['plugins']['get']('Notification'),_0xfdcfcd=this['editor']['locale'];_0x598977||(_0x598977=R(_0xfdcfcd,'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.')),_0x3da053['showWarning'](_0x598977,{'title':R(_0xfdcfcd,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x442f90)['add'](R(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x442f90)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x39a549){const _0xdb2945=_0x39a549['map'](_0x111a05=>_0x111a05['toJSON']());return this['_compressor']['compress'](_0xdb2945);}['_decompressOperations'](_0x1a15d0,_0x21317d){return this['_compressor']['decompress'](_0x1a15d0)['map']((_0x2e6db9,_0x5754af)=>{const _0x22d7f7='init'==_0x21317d[_0x5754af]['type'];if('InsertOperation'==_0x2e6db9['__className']){const _0x3afad5=_0x2e6db9['position']['root'];!this['_document']['getRoot'](_0x3afad5)&&(this['_document']['createRoot']('$root',_0x3afad5)['_isAttached']=!0x1);}const _0x564f13=_0x287ee3['fromJSON'](_0x2e6db9,this['_document']);return _0x564f13['wasUndone']=_0x2e6db9['wasUndone'],_0x564f13['_isInit']=_0x22d7f7,_0x564f13['_authorId']=_0x22d7f7?null:_0x21317d[_0x5754af]['userId'],_0x564f13['_isDisconnection']='cs:removeUser'===_0x21317d[_0x5754af]['type'],_0x564f13['createdAt']=_0x21317d[_0x5754af]['createdAt'],_0x564f13;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4ae32e=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4ae32e&&_0x4ae32e['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function D(_0x2b6dfc,_0x3eb5a7){for(const _0xdde325 of _0x2b6dfc)_0xdde325['baseVersion']=_0x3eb5a7++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x11c7d3){this['_ignoredOperations']=_0x11c7d3,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x3bf7c4){let _0xf9f0c3=_0x3bf7c4['length'];for(;_0xf9f0c3--;){const _0x2a78e2=_0x3bf7c4[_0xf9f0c3];if(!this['_ignoredOperations']['has'](_0x2a78e2)){if(!this['_operationToId']['has'](_0x2a78e2)){const _0x3b3564=_0x91b62c()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2a78e2,_0x3b3564);}return this['_operationToId']['get'](_0x2a78e2);}}}['setIdForTheLastOperation'](_0x57da7e,_0x5a9a31){if(!_0x5a9a31)return;let _0x1111bd=_0x57da7e['length'];for(;_0x1111bd--;){const _0x4d36c4=_0x57da7e[_0x1111bd];this['_ignoredOperations']['has'](_0x4d36c4)||this['_operationToId']['set'](_0x4d36c4,_0x5a9a31);}}}class a extends _0x3332be{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x3bdf57{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x35a16d)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x1d83a7];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x392bb1){super(_0x392bb1),this['_services']=new Map();}async['init'](){const _0x1d8716=this['context'],_0xd6e760=_0x1d8716['plugins']['get']('CommentsRepository');if(_0x1d8716['plugins']['get'](n)['addToReconnectionStack'](this),_0xd6e760['adapter']={'addCommentThread':async({channelId:_0x216dcd,threadId:_0x2eb5e0,comments:_0x31d136,resolvedAt:_0x401226,resolvedBy:_0x402355,context:_0x974e3f,attributes:_0x451db1})=>{const _0x2a0f84=await this['_getService'](_0x216dcd)['addCommentThread']({'commentThreadId':_0x2eb5e0,'comments':_0x31d136['map'](_0x4576ba=>function(_0x66fd1c,_0x86835b,_0x113fa0){return{'commentThreadId':_0x113fa0,'commentId':_0x66fd1c['commentId'],'userId':_0x66fd1c['authorId'],'content':_0x66fd1c['content'],'documentId':_0x86835b,'createdAt':_0x66fd1c['createdAt'],'attributes':_0x66fd1c['attributes']||{}};}(_0x4576ba,_0x216dcd,_0x2eb5e0)),'resolvedAt':_0x401226,'resolvedBy':_0x402355,'context':_0x974e3f,'attributes':_0x451db1})['catch'](lt);return{'threadId':_0x2a0f84['commentThreadId'],'comments':_0x2a0f84['comments']};},'getCommentThread':async({channelId:_0x1c91e2,threadId:_0x4a2143})=>{const _0x1dc964=await this['_getService'](_0x1c91e2)['getCommentThread'](_0x4a2143)['catch'](X)['catch'](lt);return _0x1dc964?_0x1dc964['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x1dc964]),{'threadId':_0x1dc964['commentThreadId'],'comments':_0x1dc964['comments']['map'](Z),'context':_0x1dc964['context'],'resolvedAt':_0x1dc964['resolvedAt'],'resolvedBy':_0x1dc964['resolvedBy'],'attributes':_0x1dc964['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x37a873,threadId:_0x284d79,context:_0x236cab,unlinkedAt:_0x487808,attributes:_0x5e3b8d})=>this['_getService'](_0x37a873)['updateCommentThread']({'commentThreadId':_0x284d79,'context':_0x236cab,'attributes':_0x5e3b8d,'unlinkedAt':_0x487808})['catch'](X)['catch'](lt),'resolveCommentThread':async({channelId:_0x351e26,threadId:_0x5542ff})=>{const _0x16ca63=await this['_getService'](_0x351e26)['resolveCommentThread'](_0x5542ff)['catch'](X)['catch'](lt);return{'threadId':_0x16ca63['commentThreadId'],'resolvedAt':_0x16ca63['resolvedAt'],'resolvedBy':_0x16ca63['resolvedBy']};},'reopenCommentThread':async({channelId:_0x116865,threadId:_0x555c4c})=>this['_getService'](_0x116865)['reopenCommentThread'](_0x555c4c)['catch'](X)['catch'](lt),'removeCommentThread':({channelId:_0x54ca7d,threadId:_0x13535b})=>this['_getService'](_0x54ca7d)['removeCommentThread'](_0x13535b)['catch'](X)['catch'](lt),'addComment':({channelId:_0x3b3358,threadId:_0x89fbb0,commentId:_0xc81d8a,content:_0x220c09,attributes:_0x53a4a1})=>this['_getService'](_0x3b3358)['addComment'](_0x89fbb0,_0xc81d8a,_0x220c09,_0x53a4a1)['catch'](lt),'updateComment':({channelId:_0x37688b,threadId:_0x5f261d,commentId:_0x36d62e,content:_0xc77c03,attributes:_0x4d08d7})=>this['_getService'](_0x37688b)['updateComment'](_0x5f261d,_0x36d62e,_0xc77c03,_0x4d08d7)['catch'](X)['catch'](lt),'removeComment':({channelId:_0x1780ae,threadId:_0x1cef70,commentId:_0x1b3d97})=>this['_getService'](_0x1780ae)['removeComment'](_0x1cef70,_0x1b3d97)['catch'](X)['catch'](lt)},_0x1d8716 instanceof _0x1dce13){const _0x1da2e4=_0x1d8716['config']['get']('collaboration.channelId'),_0x2ba257=_0x1d8716['plugins']['get'](i);await this['_setUpService'](_0x1da2e4);const _0x221096=await this['_services']['get'](_0x1da2e4)['getConnectedSessions']();this['listenTo'](_0x2ba257,'sessionAdd:'+_0x1da2e4,(_0x2cb42e,{session:_0x503bab})=>{_0x503bab['id']===_0x2ba257['mySessionId']&&(_0x2cb42e['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x503bab['permissions'],_0x1da2e4));}),_0x2ba257['register'](_0x1da2e4,_0x221096);}}async['_setUpService'](_0xc638b9){if(this['_services']['has'](_0xc638b9))throw new _0x5d0ce2('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0xc638b9});const _0x48d998=this['context']['plugins']['get']('CommentsRepository'),_0x13c413=new s['CommentsService'](_0xc638b9);this['_services']['set'](_0xc638b9,_0x13c413),this['listenTo'](_0x13c413,'commentThreadAdded',(_0x1f9e70,_0x1a1f73)=>{const {commentThreadId:_0x19a61c,documentId:_0x5b8bca,context:_0x2fed02,attributes:_0x35e456,resolvedAt:_0x33ef3,resolvedBy:_0x50fea0,comments:_0x2db765}=_0x1a1f73;_0x48d998['getCommentThread'](_0x19a61c)||_0x48d998['addCommentThread']({'threadId':_0x19a61c,'channelId':_0x5b8bca,'comments':_0x2db765?_0x2db765['map'](Z):[],'context':_0x2fed02,'attributes':_0x35e456,'resolvedAt':_0x33ef3,'resolvedBy':_0x50fea0,'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadUpdated',(_0x4ae9a6,{commentThreadId:_0x9d39cc,documentId:_0x222cd3,context:_0x122503,unlinkedAt:_0x501b7a,attributes:_0x51a10c})=>{_0x48d998['getCommentThread'](_0x9d39cc)&&_0x48d998['updateCommentThread']({'threadId':_0x9d39cc,'channelId':_0x222cd3,'context':_0x122503,'unlinkedAt':_0x501b7a,'attributes':_0x51a10c,'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadResolved',(_0x49a380,{commentThreadId:_0x2b5b3d,resolvedBy:_0x20f9aa,resolvedAt:_0x3696d7})=>{const _0x19a660=_0x48d998['getCommentThread'](_0x2b5b3d);_0x19a660&&_0x19a660['resolve']({'resolvedBy':_0x20f9aa,'resolvedAt':_0x3696d7,'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadReopened',(_0x19bb11,{commentThreadId:_0x4dfd6a})=>{const _0x26a2dd=_0x48d998['getCommentThread'](_0x4dfd6a);_0x26a2dd&&_0x26a2dd['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadRemoved',(_0x3a107c,{commentThreadId:_0x462415})=>{const _0x5c3c8c=_0x48d998['getCommentThread'](_0x462415);_0x5c3c8c&&_0x5c3c8c['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentAdded',(_0x4789a8,_0x12e69a)=>{const _0x3122ba=_0x12e69a['commentThreadId'],_0x1d9642=_0x48d998['getCommentThread'](_0x3122ba);_0x1d9642&&_0x1d9642['addComment']({...Z(_0x12e69a),'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentUpdated',(_0xe39273,{commentThreadId:_0x50e91e,commentId:_0x10fdee,content:_0x2513a1,attributes:_0x1d526b})=>{const _0x423fa4=_0x48d998['getCommentThread'](_0x50e91e);if(_0x423fa4){const _0x504eff=_0x423fa4['getComment'](_0x10fdee);_0x504eff&&_0x504eff['update']({'content':_0x2513a1,'attributes':_0x1d526b,'isFromAdapter':!0x0});}}),this['listenTo'](_0x13c413,'commentRemoved',(_0x3d4f7d,{commentThreadId:_0x18dc14,commentId:_0x2ac99b})=>{const _0x1732d1=_0x48d998['getCommentThread'](_0x18dc14);if(_0x1732d1){const _0x4eb53a=_0x1732d1['getComment'](_0x2ac99b);_0x4eb53a&&_0x4eb53a['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0xc638b9);}['destroy'](){if(this['context']instanceof _0x1dce13){const _0x49ff67=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x49ff67);}}['_terminateService'](_0x30c04d){if(!this['_services']['has'](_0x30c04d))throw new _0x5d0ce2('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x30c04d});this['_getService'](_0x30c04d)['disconnect'](),this['_services']['delete'](_0x30c04d);}async['reconnect'](){for(const _0x4a0bad of this['_services']['keys']())await this['_connectService'](_0x4a0bad);if(this['context']instanceof _0x1dce13){const _0x3bd3dc=this['context']['config']['get']('collaboration.channelId'),_0x4398da=this['context']['plugins']['get'](i);_0x4398da['unregister'](_0x3bd3dc);const _0x501616=await this['_services']['get'](_0x3bd3dc)['getConnectedSessions']();_0x4398da['register'](_0x3bd3dc,_0x501616);}}async['_connectService'](_0x7468d0){const {connection:_0xd77112}=this['context']['plugins']['get'](n),_0x50cf70=this['context']['plugins']['get']('CommentsRepository'),_0x2c812b=this['_services']['get'](_0x7468d0),_0x30e5af=await _0x2c812b['connect'](_0xd77112);await this['_fetchMissingUsersForThreads'](_0x30e5af);const _0xe2a77a=new Set(Array['from'](_0x50cf70['getCommentThreads']({'channelId':_0x7468d0}),_0x5255f3=>_0x5255f3['id']));for(const _0x40965f of _0x30e5af)_0x40965f['deletedAt']||_0xe2a77a['delete'](_0x40965f['commentThreadId']);for(const _0xd746fb of _0xe2a77a)_0x50cf70['getCommentThread'](_0xd746fb)['remove']({'isFromAdapter':!0x0});for(const _0x15e92c of _0x30e5af){let _0x1c8108=_0x50cf70['getCommentThread'](_0x15e92c['commentThreadId']);const {commentThreadId:_0x47694e,context:_0x48eb93,attributes:_0x1c60a0,resolvedBy:_0x4103a6,resolvedAt:_0xbdb24a,unlinkedAt:_0x5a411d,deletedAt:_0x102c1d}=_0x15e92c;if(_0x102c1d)continue;_0x1c8108||(_0x1c8108=_0x50cf70['addCommentThread']({'channelId':_0x7468d0,'threadId':_0x47694e,'context':_0x48eb93,'attributes':_0x1c60a0||{},'resolvedBy':_0x4103a6,'resolvedAt':_0xbdb24a,'unlinkedAt':_0x5a411d,'isFromAdapter':!0x0}));const _0x39b23e=new Set(Array['from'](_0x1c8108['comments'],_0x2749ed=>_0x2749ed['id']));for(const _0x343f78 of _0x15e92c['comments'])_0x39b23e['delete'](_0x343f78['commentId']);for(const _0x2132ac of _0x39b23e)_0x1c8108['getComment'](_0x2132ac)['remove']({'isFromAdapter':!0x0});for(const _0x1a388c of _0x15e92c['comments']){const _0x4832ba=_0x1c8108['getComment'](_0x1a388c['commentId']);_0x4832ba?_0x4832ba['content']!==_0x1a388c['content']&&_0x4832ba['update']({'content':_0x1a388c['content'],'isFromAdapter':!0x0}):_0x1c8108['addComment'](Object['assign'](Z(_0x1a388c),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5a8e65){if(!this['_services']['has'](_0x5a8e65))throw new _0x5d0ce2('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5a8e65});return this['_services']['get'](_0x5a8e65);}async['_fetchMissingUsersForThreads'](_0xa3960c){const _0x90344e=this['context']['plugins']['get'](_0x1d83a7),{connection:_0x1ad0d3}=this['context']['plugins']['get'](n),_0x1069f8=new Set();for(const {resolvedBy:_0x2269c7,comments:_0x1487c2}of _0xa3960c){_0x2269c7&&!_0x90344e['getUser'](_0x2269c7)&&_0x1069f8['add'](_0x2269c7);for(const {userId:_0x55846c}of _0x1487c2)_0x90344e['getUser'](_0x55846c)||_0x1069f8['add'](_0x55846c);}if(0x0===_0x1069f8['size'])return;const _0x22b964=await ht['getMany'](_0x1ad0d3,Array['from'](_0x1069f8));for(const _0x311138 of _0x22b964)_0x90344e['getUser'](_0x311138['id'])||_0x90344e['addUser'](_0x311138);}}async function X(_0x182606){if('404'!==_0x182606['code'])throw _0x182606;}function lt(_0x295cb5){if((_0x4d532c=_0x295cb5)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x4d532c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4d532c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x4d532c;throw _0x295cb5;}function Z(_0x576bd8){return{'threadId':_0x576bd8['commentThreadId'],'commentId':_0x576bd8['commentId'],'content':_0x576bd8['content'],'createdAt':_0x576bd8['createdAt'],'authorId':_0x576bd8['userId'],'attributes':_0x576bd8['attributes']||{}};}class m extends _0x3332be{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1011fb){super(_0x1011fb);const _0x19acde=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x19acde);}['init'](){const _0x5856f8=this['editor']['plugins']['get'](n),_0x11c1a6=this['editor']['plugins']['get']('TrackChangesEditing');return _0x11c1a6['adapter']={'getSuggestion':async _0x8986c2=>{await this['_waitForServiceReady']();const _0x51962e=await this['_trackChangesService']['get'](_0x8986c2)['catch'](Y);return await this['_fetchMissingUsersForThreads']([_0x51962e]),_0x51962e;},'addSuggestion':async({id:_0x5bc14c,type:_0x50290d,data:_0x3615a5,originalSuggestionId:_0x3a8c2e,attributes:_0x676985})=>{await this['_waitForServiceReady']();const _0x48bdbc={'id':_0x5bc14c,'type':_0x50290d,'data':_0x3615a5,'originalSuggestionId':_0x3a8c2e,'attributes':_0x676985},_0x4524dc=await this['_trackChangesService']['add'](_0x5bc14c,_0x50290d,_0x3615a5,_0x3a8c2e,_0x676985)['catch'](_0x5701dc=>{if(dt(_0x5701dc))return new Promise(_0x40a7cb=>{this['_bufferedRequests']['set'](_0x5bc14c,{'resolve':_0x40a7cb,'suggestionData':_0x48bdbc});});throw _0x5701dc;});return this['_bufferedRequests']['delete'](_0x5bc14c),_0x4524dc;},'updateSuggestion':async(_0x13bdd8,_0x4a5613)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4a5613['state'])return this['_trackChangesService']['update'](_0x13bdd8,_0x4a5613)['catch'](Y);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1c4d9c,_0x11b2b3)=>{_0x11c1a6['hasSuggestion'](_0x11b2b3['id'])&&(_0x11c1a6['getSuggestion'](_0x11b2b3['id'])['attributes']=_0x11b2b3['attributes']);}),this['_trackChangesService']['connect'](_0x5856f8['connection'])['then'](_0x42dcc1=>(_0x5856f8['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x42dcc1)['then'](()=>{for(const _0x270d3d of _0x42dcc1){_0x11c1a6['addSuggestionData'](_0x270d3d)['_saved']=!0x0;}})));}async['reconnect'](){const _0x42ced0=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1b718d}=this['editor']['plugins']['get'](n),_0xa2b766=await this['_trackChangesService']['connect'](_0x1b718d);await this['_fetchMissingUsersForThreads'](_0xa2b766);for(const {suggestionData:_0xe976f2,resolve:_0x553ee7}of this['_bufferedRequests']['values']()){let _0x241add=_0xa2b766['find'](_0x539a98=>_0x539a98['id']===_0xe976f2['id']);_0x241add||(_0x241add=await this['_trackChangesService']['add'](_0xe976f2['id'],_0xe976f2['type'],_0xe976f2['data'],_0xe976f2['originalSuggestionId'])),_0x553ee7(_0x241add);}for(const _0x35f86c of _0xa2b766)_0x42ced0['hasSuggestion'](_0x35f86c['id'])||_0x42ced0['addSuggestionData'](_0x35f86c);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1c83cd=>{this['listenTo'](this['_trackChangesService'],'connected',_0x42a8a2=>{_0x42a8a2['off'](),_0x1c83cd();});});}async['_fetchMissingUsersForThreads'](_0x41a0be){const _0x59df4a=this['editor']['plugins']['get'](_0x1d83a7),{connection:_0x23fdc4}=this['editor']['plugins']['get'](n),_0xcc34cc=new Set();for(const {authorId:_0x55a90a}of _0x41a0be)_0x59df4a['getUser'](_0x55a90a)||_0xcc34cc['add'](_0x55a90a);if(0x0===_0xcc34cc['size'])return;const _0x19b2ad=await ht['getMany'](_0x23fdc4,Array['from'](_0xcc34cc));for(const _0x3489db of _0x19b2ad)_0x59df4a['getUser'](_0x3489db['id'])||_0x59df4a['addUser'](_0x3489db);}}function Y(_0x31cf09){if(dt(_0x31cf09))return new Promise(()=>{});throw _0x31cf09;}function dt(_0x5a6a30){return _0x5a6a30['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5a6a30['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x3332be{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3090dd=this['editor']['plugins']['get'](n),_0x1c510b=this['editor']['plugins']['get']('CommentsEditing'),_0x17125b=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3090dd,'change:state',(_0x49bd19,_0x4829d2,_0x211d86)=>{_0x1c510b['isThreadsLoadingPaused']='connected'!==_0x211d86;});}),this['listenTo'](_0x3090dd,'change:state',(_0x2981cf,_0x1862bc,_0x334239)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x334239);}),_0x17125b['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class RealTimeCollaborativeTrackChanges extends _0x3332be{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x3332be{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x1d83a7];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x80fd00){super(_0x80fd00);const _0x29d053=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x29d053);}async['init'](){const _0xd8c3c2=this['editor']['plugins']['get'](l),_0x39270a=_0xd8c3c2['serverHistory'],_0x221076=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x39270a,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xd8c3c2['sessionId']});const _0x4607b0=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x2385c7=await tt['isBundleUploaded'](_0x221076['connection'],_0x4607b0);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x5073a1})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5073a1)),'updateRevisions':async _0xa9fb55=>{await this['_waitForServiceReady']();const _0x89fcb5=this['_revisionTracker']['currentRevision'];if(_0x2385c7&&0x1===_0xa9fb55['length']&&_0xa9fb55[0x0]['id']===_0x89fcb5['id'])return _0xa9fb55;for(const _0x544a7d of _0xa9fb55)_0x544a7d['id']===_0x89fcb5['id']&&(_0x544a7d['isEmptyCurrent']=_0x544a7d['fromVersion']===_0x544a7d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0xa9fb55,this['_lastRequestId'])['then'](_0x58b01b=>(this['_lastRequestId']=_0x58b01b,_0xa9fb55))['catch'](_0x19782b=>{if(st(_0x19782b)||'400'===_0x19782b['code']&&void 0x0!==_0x19782b['data']['wrongRequestId']){for(const _0x3ec713 of _0xa9fb55){!this['_revisionTracker']['repository']['getRevision'](_0x3ec713['id'])||this['_revisionTracker']['_bufferUpdate'](_0x3ec713['id'],_0x3ec713,!0x1);}if(st(_0x19782b))throw _0x19782b;return _0xa9fb55;}throw _0x19782b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x44e11d,{revisionsData:_0xed2875,requestId:_0x48c1b5})=>{Math['max'](..._0xed2875['map'](_0x17a5dd=>_0x17a5dd['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0xed2875,_0x48c1b5);}):this['_handleRevisionsUpdate'](_0xed2875,_0x48c1b5);});const {revisions:_0x101be8,requestId:_0x401e4a}=await this['_revisionHistoryService']['connect'](_0x221076['connection']);_0x221076['addToReconnectionStack'](this),this['_lastRequestId']=_0x401e4a,await this['_fetchMissingUsers'](_0x101be8);for(const _0x3ebc7c of _0x101be8)this['_revisionTracker']['addRevisionData'](_0x3ebc7c);this['listenTo'](_0xd8c3c2,'change:_isConnected',(_0x283754,_0x14567b,_0x5106d6)=>{_0x5106d6&&(this['_oldOffset']=_0xd8c3c2['_offset'],_0x283754['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x221076,'state',_0x459dc8=>_0x459dc8===_0x495437['CONNECTED']);}async['reconnect'](){const _0x39d052=this['editor']['plugins']['get'](n),_0x4dda0d=this['editor']['plugins']['get'](l),_0xa6ee07=async()=>{const _0x4e0979=this['_revisionTracker']['currentRevision'],_0x223878=_0x4e0979['id'],_0x5a485a=_0x223878!==_0x4dda0d['sessionId'];if(_0x5a485a){const _0x21951f=_0x4dda0d['_offset']-this['_oldOffset'],_0x1b944e=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x4e0979['toVersion']+_0x21951f!==_0x1b944e){const _0x309f61=_0x4e0979['fromVersion']+_0x21951f,_0x3cce7b=this['editor']['plugins']['get'](_0x1d83a7),_0x53a9b3=this['_revisionTracker']['buildRevisionData']({'revision':_0x4e0979,'from':_0x309f61,'to':_0x1b944e});_0x53a9b3['id']=_0x4e0979['id'];const _0x421463=_0x53a9b3['authorsIds']['map'](_0x1c1d49=>_0x3cce7b['getUser'](_0x1c1d49));_0x4e0979['_update']({..._0x53a9b3,'authors':_0x421463},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4e0979['id'],_0x53a9b3,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1b944e,(_0x4e0979['toVersion']===_0x4e0979['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x223878)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x223878),this['_revisionTracker']['_createCurrentRevision'](_0x1b944e));}const {revisions:_0x4bc677,requestId:_0x3ac256}=await this['_revisionHistoryService']['reconnect'](_0x39d052['connection'],this['_lastRequestId']);_0x5a485a&&_0x4bc677['length']>0x0?_0x4dda0d['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x4bc677),this['_handleRevisionsUpdate'](_0x4bc677,_0x3ac256),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4dda0d['_isConnected']?_0xa6ee07():new Promise((_0x1819b1,_0x1e9589)=>{_0x4dda0d['once']('change:_isConnected',()=>{_0xa6ee07()['then'](_0x1819b1)['catch'](_0x1e9589);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4eacea=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5c2a3b=>{_0x5c2a3b['off'](),_0x4eacea();});});}['_getLatestVersionFromServerOperations'](){const _0x525a20=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x79d24b of _0x525a20)if('marker'!==_0x79d24b['type']||_0x79d24b['affectsData'])return _0x79d24b['baseVersion']+0x1;}['_getLatestVersion'](){const _0x12bfaf=this['editor']['plugins']['get'](l);return new Promise(_0x24d763=>{_0x12bfaf['_isPendingUpdate']?_0x12bfaf['once']('change:_isPendingUpdate',()=>{_0x24d763(this['_getLatestVersionFromServerOperations']());}):_0x24d763(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x1e0161,_0x3ba2ad){const _0x466b2f=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3ba2ad;for(const _0x296797 of _0x1e0161){const _0x47fb97=_0x466b2f['getRevision'](_0x296797['id']);if(_0x47fb97){if((_0x296797['fromVersion']||_0x296797['toVersion'])&&(_0x296797['diffData']=null),_0x47fb97===this['_revisionTracker']['currentRevision']){const _0x1f7a33=Math['max'](_0x47fb97['toVersion'],_0x296797['toVersion']),_0x1a324c=Math['max'](_0x47fb97['fromVersion'],_0x296797['fromVersion']);let _0x4672bd;_0x47fb97['toVersion']===_0x296797['toVersion']&&_0x47fb97['fromVersion']===_0x296797['fromVersion']?(_0x4672bd=!0x0,this['_preventResendingRevisionData'](_0x296797)):_0x296797['toVersion']===_0x1f7a33&&_0x296797['fromVersion']===_0x1a324c?_0x4672bd=!0x1:(_0x47fb97['toVersion']===_0x1f7a33&&_0x47fb97['fromVersion']===_0x1a324c||this['_fixRevision']({'revision':_0x47fb97,'from':_0x1a324c,'to':_0x1f7a33}),_0x4672bd=!0x0),_0x4672bd&&(delete _0x296797['fromVersion'],delete _0x296797['toVersion'],delete _0x296797['diffData'],delete _0x296797['createdAt'],delete _0x296797['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x296797),this['_preventResendingRevisionData'](_0x296797);}else this['_revisionTracker']['addRevisionData'](_0x296797);}const _0x212144=_0x466b2f['getRevisions']();_0x212144['reverse']();for(let _0x3fd9f6=0x0;_0x3fd9f6<_0x212144['length']-0x1;_0x3fd9f6++){const _0x25d846=_0x212144[_0x3fd9f6],_0x25a613=_0x212144[_0x3fd9f6+0x1];if(_0x25d846['fromVersion']<_0x25a613['toVersion']){const _0x533082=_0x25a613['toVersion'],_0x34d20b=Math['max'](_0x533082,_0x25d846['toVersion']);this['_fixRevision']({'revision':_0x25d846,'from':_0x533082,'to':_0x34d20b});}}}['_fixRevision']({revision:_0x4827d0,from:_0x710838,to:_0x1ca8b7}={}){const _0x1b527a=this['editor']['plugins']['get'](_0x1d83a7),_0x25e8da=this['_revisionTracker']['buildRevisionData']({'revision':_0x4827d0,'from':_0x710838,'to':_0x1ca8b7});_0x25e8da['authors']=_0x25e8da['authorsIds']['map'](_0x3c50f8=>_0x1b527a['getUser'](_0x3c50f8)),_0x4827d0['_update'](_0x25e8da);}['_preventResendingRevisionData'](_0x326297){const _0x46caa4={};_0x46caa4['id']=_0x326297['id'];for(const _0x2b4185 of Object['keys'](_0x326297))'id'!==_0x2b4185&&(_0x46caa4[_0x2b4185]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x46caa4['id'],_0x46caa4,!0x0);}async['_fetchMissingUsers'](_0x24eb16){const _0x339a50=this['editor']['plugins']['get'](_0x1d83a7),{connection:_0x47e00f}=this['editor']['plugins']['get'](n),_0x2ef23e=new Set();for(const _0x15655f of _0x24eb16){for(const _0x5aab58 of _0x15655f['authorsIds'])_0x473443(_0x5aab58);_0x15655f['creatorId']&&_0x473443(_0x15655f['creatorId']);}if(0x0===_0x2ef23e['size'])return;const _0x2382af=await ht['getMany'](_0x47e00f,Array['from'](_0x2ef23e));for(const _0x245742 of _0x2382af)_0x339a50['getUser'](_0x245742['id'])||_0x339a50['addUser'](_0x245742);function _0x473443(_0x53f97e){_0x339a50['getUser'](_0x53f97e)||_0x2ef23e['add'](_0x53f97e);}}}function st(_0x39be54){return _0x39be54['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x39be54['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x39be54['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x3332be{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class N extends _0x512b3c{['_collapseAt'];constructor(_0x87c68,_0x12b3b5=0x6){super(_0x87c68);const _0x3fae1a=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x12b3b5,this['bind']('isHidden')['to'](this,'usersCount',_0x359fcd=>_0x359fcd<_0x12b3b5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3fae1a['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':_0x3fae1a['to']('usersCount',_0x1d4d9f=>'+'+(_0x1d4d9f-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x512b3c{['items'];['keystrokes'];constructor(_0x358187){super(_0x358187);const _0x160548=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x45cc9b(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x160548['if']('hasPopup'),'aria-expanded':_0x160548['to']('isExpanded',_0x26ce3b=>this['hasPopup']&&String(_0x26ce3b)),'aria-label':_0x160548['to']('hasPopup',_0x2e9966=>R(_0x358187,_0x2e9966?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x160548['to']('hasPopup',_0x303076=>!!_0x303076&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x160548['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x160548['to'](_0x4c3088=>{const _0x3032d9=_0x4c3088,_0x3eb32b=document['querySelector']('.ck-presence-list__dropdown-list'),_0x281689=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3eb32b?.['contains'](_0x3032d9['relatedTarget'])||_0x281689?.['contains'](_0x3032d9['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0xa1674a,_0x59afaa,_0x2c1b64)=>{this['element']&&(_0x2c1b64?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 q extends _0x512b3c{['counterView'];['inlineListView'];constructor(_0x48f538,_0x18b20c=0x6){super(_0x48f538);const _0x381196=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new N(this['locale'],_0x18b20c),this['inlineListView']=new is(_0x48f538),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2a2fd6 of this['inlineListView']['items'])_0x2a2fd6['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',_0x381196['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class z extends _0x512b3c{['listWrapperView'];constructor(_0xeafbe,_0x27e3cc){super(_0xeafbe);const _0x5eefbb=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0xeafbe,_0x27e3cc),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':R(_0xeafbe,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5eefbb['to'](_0x284952=>{const _0x5ab49b=_0x284952,_0x2a302b=document['querySelector']('.ck-presence-list__list'),_0x49f1ab=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2a302b?.['contains'](_0x5ab49b['relatedTarget'])||_0x49f1ab?.['contains'](_0x5ab49b['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x477aad{constructor(_0x56cf01,_0x268b42){super(_0x56cf01);const _0x25692a=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x268b42?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x25692a['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x25692a['to']('role'),'aria-label':_0x25692a['to']('ariaLabel'),'aria-labelledby':_0x25692a['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1b8319['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x20467c=this['element'];_0x20467c&&(this['_isScrollable']=Math['max'](_0x20467c['scrollHeight'],_0x20467c['clientHeight'])>0.8*window['innerHeight']);}}class B extends rt{['userView'];constructor(_0xf3108b,_0x419518,_0x2915a2){super(_0xf3108b);const _0x4a8e6c=this['bindTemplate'];this['userView']=new ct(_0xf3108b,_0x419518);const _0x4ae608={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x419518['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x419518['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x419518['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x2915a2&&(_0x4ae608['tag']='button',_0x4ae608['on']={'click':_0x4a8e6c['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4ae608);}['focus'](){this['element']['focus']();}}class H extends _0x512b3c{['userView'];['markerView'];constructor(_0x564b27,_0x1d49a9,_0x4934e2){super(_0x564b27);const _0x23f9f0=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x564b27,_0x1d49a9),this['markerView']=new MarkerView(_0x564b27,_0x1d49a9);const _0x37562e=new ot(_0x564b27);_0x37562e['template']['tag']='span',_0x37562e['text']=_0x1d49a9['name'];const _0x3d35bb={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x23f9f0['to']('isFocusable',_0x3d91de=>!!_0x3d91de&&0x0),'aria-labelledby':_0x37562e['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x23f9f0['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x23f9f0['to']('hasTooltip',_0x38ab5e=>!_0x38ab5e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x37562e]};_0x4934e2&&(_0x3d35bb['tag']='button',_0x3d35bb['on']={'click':_0x23f9f0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3d35bb);}}class MarkerView extends _0x512b3c{constructor(_0x201073,_0x1a0e1d){super(_0x201073),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1a0e1d['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const J={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x3bdf57{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2348f4){super(_0x2348f4),this['context']['config']['define']('presenceList',J);const _0x2b1674=_0x2348f4['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2b1674)throw new _0x5d0ce2('presencelist-collapseat-invalid-format',this);if(_0x2b1674<0x1)throw new _0x5d0ce2('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x9d9df4(),this['balloonPanelView']=new _0x4371c1(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4be74d of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4be74d);this['listenTo'](this['_allConnectedUsers'],'add',(_0x293e8b,_0x18b53a)=>{this['_handleUserAdd'](_0x18b53a);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0xd2088b,_0x49f1e3)=>{this['_handleUserRemove'](_0x49f1e3);});}['_createView'](){const _0x36c438=this['context'],_0x2f9f90=new q(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3afcba=this['balloonPanelView'];if(!_0x3063f7(_0x36c438['config']['get']('presenceList.container')))throw new _0x5d0ce2('presencelist-missing-container',this);return _0x2f9f90['counterView']['bind']('usersCount')['to'](this),_0x2f9f90['bind']('isCollapsed')['to'](this,'usersCount',_0x382519=>{const {collapseAt:_0x32e27f}=_0x36c438['config']['get']('presenceList'),_0x53901d=_0x382519>=_0x32e27f;if(_0x53901d&&!_0x2f9f90['inlineListView']['items']['find'](_0x9a6d49=>_0x9a6d49 instanceof N)){const _0x6090bb=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x6090bb&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x2f9f90['inlineListView']['items']['add'](_0x2f9f90['counterView']);}return _0x53901d||this['hideDropdown'](),_0x53901d;}),_0x2f9f90['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x425ca4=>{const _0xadf46e=_0x36c438['config']['get']('presenceList'),_0x30c4b9=new H(_0x36c438['locale'],_0x425ca4,!!_0xadf46e['onClick']);return _0x30c4b9['bind']('hasTooltip')['to'](_0x2f9f90,'isCollapsed',_0x2fb0e0=>!_0x2fb0e0),_0x30c4b9['bind']('isFocusable')['to'](_0x2f9f90,'isCollapsed',_0x3e794b=>!_0x3e794b),_0xadf46e['onClick']&&this['listenTo'](_0x30c4b9,'execute',()=>{this['view']['isCollapsed']||_0xadf46e['onClick'](_0x425ca4,_0x30c4b9['element']);}),_0x30c4b9;}),this['listenTo'](_0x2f9f90['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x2f9f90['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x2f9f90['inlineListView']['keystrokes']['set']('Enter',(_0xce6258,_0x5e292d)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x5e292d());}),_0x2f9f90['render'](),_0x3afcba['render'](),_0x2a979d({'emitter':_0x2f9f90,'activator':()=>_0x3afcba['isVisible'],'contextElements':[_0x3afcba['element'],_0x2f9f90['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x36c438['config']['get']('presenceList.container')['appendChild'](_0x2f9f90['element']),this['_bodyCollection']=new _0x2b3d32(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2f9f90;}['_handleUserAdd'](_0x41b07a){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x41b07a['isMe'])return;const _0x596e7c=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x596e7c-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4c683e=_0x41b07a['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x41b07a,_0x4c683e);}['_handleUserRemove'](_0x3934cb){this['usersCount']--;const {collapseAt:_0x18c347}=this['context']['config']['get']('presenceList'),_0x328e7d=this['usersCount']>=_0x18c347;if(this['currentDisplayedUsers']['get'](_0x3934cb['id']))this['currentDisplayedUsers']['remove'](_0x3934cb['id']);else{if(_0x328e7d&&this['currentDisplayedUsers']['length']+0x1===_0x18c347-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x328e7d?0x1:0x0)<this['usersCount']){for(const _0x91933b of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x91933b['id'])&&(this['currentDisplayedUsers']['add'](_0x91933b,Math['min'](this['currentDisplayedUsers']['length']-(_0x328e7d?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x328e7d?0x1:0x0)===_0x18c347-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x25b84f=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new z(this['context']['locale'],!!_0x25b84f['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x282a36}=this['presenceDropdownView'];_0x282a36['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4638af=>{if(!_0x25b84f['displayMe']&&_0x4638af['isMe'])return null;const _0x3a6c6e=new B(this['context']['locale'],_0x4638af,!!_0x25b84f['onClick']);return _0x25b84f['onClick']&&this['listenTo'](_0x3a6c6e,'execute',()=>{_0x25b84f['onClick'](_0x4638af,_0x3a6c6e['element']);}),_0x3a6c6e;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x282a36['focus'](),_0x282a36['checkIfScrollable']();const _0x35256f=(_0x3346f8,_0x595934)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x595934();};_0x282a36['keystrokes']['set']('Esc',_0x35256f),_0x282a36['keystrokes']['set']('Shift+Tab',_0x35256f),_0x282a36['keystrokes']['set']('Tab',(_0x50e8c1,_0x256015)=>{!function(_0x4989ce){const _0x273628=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x40c637=>_0x40c637+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x1737c1=[...document['body']['querySelectorAll'](_0x273628)]['filter'](_0x194362=>_0x194362===document['activeElement']||_0x194362['offsetWidth']+_0x194362['offsetHeight']>0x0)['sort']((_0x5f40be,_0x37f212)=>(_0x5f40be['tabIndex']||0x0)-(_0x37f212['tabIndex']||0x0)),_0x4c939d=_0x1737c1['indexOf'](_0x4989ce),_0x9d0e50=_0x1737c1[(_0x4c939d+0x1)%_0x1737c1['length']];_0x9d0e50&&_0x9d0e50['focus']();}(this['view']['element']),this['hideDropdown'](),_0x256015();}),_0x282a36['focusTracker']['add'](this['view']['element']),_0x282a36['focusTracker']['on']('change:isFocused',(_0x4e7fc2,_0x27beef,_0x223957)=>{_0x223957||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 PresenceList extends _0x3bdf57{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x559048=>0x1!=_0x559048}};
|