@ckeditor/ckeditor5-real-time-collaboration 45.2.0-alpha.0 → 45.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +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
|
-
((()=>mt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x35081a];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d567d){super(_0x3d567d),this['set']('state',_0x1605b2['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x5c5569);}['init'](){const _0x3c113f=this['context'],_0x1705d4=_0x3c113f['plugins']['get']('CloudServices'),_0x380bdd=_0x3c113f['plugins']['get'](_0x35081a);if(!_0x1705d4['token'])throw new _0x404cce('websocketgateway-missing-token',this);if(!_0x1705d4['webSocketUrl'])throw new _0x404cce('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x1705d4['token'],_0x1705d4['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x20e898=>{if(this['connection']=_0x20e898,this['bind']('state')['to'](_0x20e898,'state',this,'_isBrowserOffline',(_0x23256e,_0x3176ac)=>('connected'!==_0x23256e&&(this['_shouldPluginsReconnect']=!0x0),_0x3176ac||_0x23256e!==_0x1605b2['CONNECTED']?_0x1605b2['DISCONNECTED']:this['state']==_0x1605b2['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x1605b2['CONNECTING']):_0x1605b2['CONNECTED'])),this['connection']['on']('error',(_0x3a5a5e,_0x3e0f70)=>{if('limitExceeded'!==_0x3e0f70['code'])throw console['error'](_0x3e0f70),new _0x404cce('cloudservices-init',null,{'originalError':_0x3e0f70});_0x380bdd['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'});}),!_0x20e898['me'])return new Promise(_0x2d2af7=>_0x20e898['on']('change:me',_0x2d2af7));})['catch'](_0x22d4cd=>{throw console['error'](_0x22d4cd),new _0x404cce('cloudservices-init',null,{'originalError':_0x22d4cd});});}['addToReconnectionStack'](_0x4cda33){if('function'!=typeof _0x4cda33['reconnect'])throw new _0x404cce('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4cda33))throw new _0x404cce('websocketgateway-plugin-already-registered',this,{'name':_0x4cda33['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4cda33);}['removeFromReconnectionStack'](_0xe05957){this['_reconnectionStack']['delete'](_0xe05957);}['isInReconnectionStack'](_0x1ae821){return this['_reconnectionStack']['has'](_0x1ae821);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x2cb058=>_0x2cb058['reconnect']())))['then'](()=>this['state']=_0x1605b2['CONNECTED'])['catch'](_0x2847fc=>{throw console['error'](_0x2847fc),new _0x404cce('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x1605b2['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x1390d5{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x1d491e];}constructor(_0x3b4922){super(_0x3b4922),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x210266(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d491e);}['init'](){const _0x2e6027=this['context']['plugins']['get'](c);this['listenTo'](_0x2e6027,'change:state',(_0x36b638,_0x57e2f1,_0x23d8ed)=>{if('connected'!==_0x23d8ed)this['channelSessions']['forEach'](_0x517157=>_0x517157['clear']()),this['channelConnectedUsers']['forEach'](_0x297652=>_0x297652['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x28d07d,_0x31b854]of this['_registeredSessions'])for(const _0x3063b3 of _0x31b854)this['_handleSessionAdd'](_0x28d07d,_0x3063b3);}}),this['_createUser'](_0x2e6027['connection']['me'],!0x0);}['register'](_0x23ebc8,_0x397452){if(this['_registeredSessions']['has'](_0x23ebc8))throw new _0x404cce('sessions-register-already-registered',null,{'channelId':_0x23ebc8});this['_registeredSessions']['set'](_0x23ebc8,_0x397452),this['channelSessions']['set'](_0x23ebc8,new _0x210266()),this['channelConnectedUsers']['set'](_0x23ebc8,new _0x210266()),this['listenTo'](_0x397452,'add',(_0x1ef108,_0x47f8e6)=>this['_handleSessionAdd'](_0x23ebc8,_0x47f8e6)),this['listenTo'](_0x397452,'remove',(_0x39ad43,_0x5b4504)=>this['_handleSessionRemove'](_0x23ebc8,_0x5b4504));for(const _0x57c9e0 of _0x397452)this['_handleSessionAdd'](_0x23ebc8,_0x57c9e0);}['unregister'](_0x4c1ac0){if(!this['_registeredSessions']['has'](_0x4c1ac0))throw new _0x404cce('sessions-unregister-not-exist',null,{'channelId':_0x4c1ac0});const _0x398326=this['_registeredSessions']['get'](_0x4c1ac0);this['stopListening'](_0x398326);for(const _0x3664ba of _0x398326)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x4c1ac0,_0x3664ba);this['_registeredSessions']['delete'](_0x4c1ac0),this['channelSessions']['delete'](_0x4c1ac0),this['channelConnectedUsers']['delete'](_0x4c1ac0);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0xc18eba){for(const _0x4ef2c5 of this['channelSessions']['values']())for(const _0xa76ec3 of _0x4ef2c5)if(_0xa76ec3['id']===_0xc18eba)return _0xa76ec3['user'];}['getUserSessions'](_0x37a199,_0x308d05){const _0x3ea92a=_0x308d05?[this['channelSessions']['get'](_0x308d05)]:this['channelSessions']['values'](),_0x95529c=new Set();for(const _0x201a51 of _0x3ea92a)for(const _0x331172 of _0x201a51)_0x331172['user']['id']===_0x37a199['id']&&_0x95529c['add'](_0x331172['id']);return _0x95529c;}['getUserRole'](_0x50bc17){for(const _0x2b8622 of this['channelSessions']['values']())for(const _0x24f1c1 of _0x2b8622)if(_0x24f1c1['user']===_0x50bc17)return _0x24f1c1['role'];}['_handleSessionAdd'](_0x3c4c06,_0x3d6875){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x386a57=_0x3d6875['user'],_0x174339=this['_users']['getUser'](_0x386a57['id'])||this['_createUser'](_0x386a57),_0xe6c278=Object['assign']({},_0x3d6875,{'user':_0x174339});this['channelSessions']['get'](_0x3c4c06)['add'](_0xe6c278);const _0x1d4832=this['channelConnectedUsers']['get'](_0x3c4c06);_0x1d4832['has'](_0x174339['id'])||_0x1d4832['add'](_0x174339),this['allConnectedUsers']['has'](_0x174339['id'])||this['allConnectedUsers']['add'](_0x174339,_0x174339['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3c4c06,{'channelId':_0x3c4c06,'session':_0xe6c278});}['_handleSessionRemove'](_0x467d87,_0x5baf74){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x4a14b7=this['channelConnectedUsers']['get'](_0x467d87),_0x44f38a=_0x5baf74['user'];_0x44f38a['id']&&(this['channelSessions']['get'](_0x467d87)['remove'](_0x5baf74['id']),_0x4a14b7['has'](_0x44f38a['id'])&&!this['getUserSessions'](_0x44f38a,_0x467d87)['size']&&_0x4a14b7['remove'](_0x44f38a['id']),this['allConnectedUsers']['get'](_0x44f38a['id'])&&!this['getUserSessions'](_0x44f38a)['size']&&this['allConnectedUsers']['remove'](_0x44f38a['id']));}['_createUser'](_0x5b9465,_0x11f9cf){const _0x3a03b9=this['_users']['addUser'](_0x5b9465);return _0x11f9cf&&this['_users']['defineMe'](_0x5b9465['id']),_0x3a03b9['orderNumber']=this['_uniqueUsersCount']++,_0x3a03b9;}}class E extends _0x228e35{['_domEmitter']=new(_0x5c5569())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3c9c9a=this['editor'],_0x42aafe=_0x3c9c9a['plugins']['get'](i);_0x3c9c9a['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x28008f,{writer:_0xfd9d10})=>function(_0x5b02a0,_0xaeba70,_0x5a814c,_0x5aba6b){const _0x44084f=_0x5b02a0['markerName']['split'](':')[0x2],_0x1c3d56=_0x5a814c['getUserBySessionId'](_0x44084f);if(!_0x1c3d56||_0x44084f===_0x5a814c['mySessionId'])return;if(!_0x5aba6b['model']['schema']['checkChild'](_0x5b02a0['markerRange']['start'],'$text'))return;const _0x1937f6={'class':'ck-user__marker\x20'+_0x1c3d56['color']['getMarkerClass'](),'data-name':_0x1c3d56['name'],'data-session-id':_0x44084f},_0x5422c7=_0x5aba6b['model']['markers']['get'](_0x5b02a0['markerName']),_0x3ef22b=_0x5422c7['getStart'](),_0x29d007=_0x3ef22b['nodeAfter'],_0xaaeae3=_0x5aba6b['model']['schema'];if(_0x29d007&&_0xaaeae3['isObject'](_0x29d007)&&_0xaaeae3['isInline'](_0x29d007)&&!_0x5aba6b['model']['markers']['get']('user:range:'+_0x44084f)['getRange']()['isCollapsed'])return;const _0x3da3f6=_0x3ef22b['parent'];return _0x5aba6b['model']['schema']['isLimit'](_0x3da3f6)&&!_0x5aba6b['model']['hasContent'](_0x3da3f6)&&(_0x1937f6['contenteditable']=!0x1),function(_0x58bd79,_0x5527e8,_0x4da32d){const _0x16ef88=_0x58bd79['createUIElement']('span',_0x5527e8);return _0x58bd79['setCustomProperty']('userPositionMarker',!0x0,_0x16ef88),_0x16ef88['render']=function(_0xcc5256){const _0x302ab6=this['toDomElement'](_0xcc5256),_0x832415=document['createElement']('span');return _0x832415['classList']['add']('ck-user__marker-tooltip'),_0x832415['setAttribute']('contenteditable','false'),_0x832415['setAttribute']('spellcheck','false'),_0x832415['textContent']=_0x4da32d['name'],_0x302ab6['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x832415['outerHTML']+'',_0x302ab6['addEventListener']('mouseenter',()=>{_0x302ab6['classList']['add']('ck-user__marker_hovered');}),_0x302ab6['addEventListener']('mouseleave',()=>{_0x302ab6['classList']['remove']('ck-user__marker_hovered');}),_0x302ab6;},_0x16ef88['isSimilar']=function(_0x42519c){return!(!this['getCustomProperty']('userPositionMarker')||!_0x42519c['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x42519c['getAttribute']('data-session-id'));},_0x16ef88;}(_0xaeba70,_0x1937f6,_0x1c3d56);}(_0x28008f,_0xfd9d10,_0x42aafe,_0x3c9c9a)}),_0x3c9c9a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3ec0b2=>function(_0x5450eb,_0x28247b){const _0x2b66ad=_0x5450eb['markerName']['split'](':')[0x2];if(_0x2b66ad===_0x28247b['mySessionId'])return null;const _0x30b1b6=_0x28247b['getUserBySessionId'](_0x2b66ad);if(!_0x30b1b6)return{'id':_0x2b66ad,'classes':[]};return{'id':_0x2b66ad,'classes':['ck-user__selection',_0x30b1b6['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x2b66ad},'priority':0x7d0+_0x30b1b6['orderNumber']};}(_0x3ec0b2,_0x42aafe)}),function(_0x1c428d){const _0x171e12=_0x1c428d['model'],_0x1085e1=new Map(),_0x3daa99=_0x1c428d['plugins']['get'](i);_0x171e12['markers']['on']('update:user:range',(_0x263c6f,_0x537c2b,_0x2eabe8,_0x3314ae)=>{if(!_0x3314ae&&_0x1085e1['get'](_0x537c2b['name']))return _0x1085e1['get'](_0x537c2b['name'])['detach'](),void _0x1085e1['delete'](_0x537c2b['name']);const _0x13cf84=_0x537c2b['name']['split'](':')[0x2];if(_0x13cf84===_0x3daa99['mySessionId'])return;const _0x354055='user:position:'+_0x13cf84;_0x171e12['markers']['has'](_0x354055)&&_0x1c428d['editing']['reconvertMarker'](_0x354055),_0x537c2b['on']('change:range',(_0x38c2f1,_0x4443d4,_0x371c29)=>{if('$graveyard'!=_0x4443d4['root']['rootName']&&'$graveyard'==_0x537c2b['getRange']()['root']['rootName']&&!_0x1085e1['has'](_0x537c2b['name'])){const _0x1d2bbc=_0x171e12['schema']['getNearestSelectionRange'](_0x371c29['deletionPosition']);if(_0x1d2bbc){const _0x363ef9=ft['fromRange'](_0x1d2bbc);_0x1085e1['set'](_0x537c2b['name'],_0x363ef9),_0x363ef9['on']('change:range',(_0x403f96,_0x4be16f,_0x1cd40e)=>{if('$graveyard'==_0x363ef9['root']['rootName']){const _0x38fb4b=_0x171e12['schema']['getNearestSelectionRange'](_0x1cd40e['deletionPosition']);_0x38fb4b?(_0x363ef9['start']=_0x38fb4b['start'],_0x363ef9['end']=_0x38fb4b['end']):(_0x1085e1['delete'](_0x537c2b['name']),_0x363ef9['detach']());}});}}});}),_0x171e12['document']['on']('change',()=>{_0x1085e1['size']>0x0&&_0x171e12['enqueueChange']({'isUndoable':!0x1},_0x218edf=>{for(const [_0x547bfe,_0x5d7640]of _0x1085e1)'$graveyard'==_0x171e12['markers']['get'](_0x547bfe)['getRange']()['root']['rootName']&&(G(_0x547bfe['split'](':')[0x2],_0x5d7640['toRange'](),_0x171e12,_0x218edf),_0x5d7640['detach']());_0x1085e1['clear']();});});}(_0x3c9c9a),this['_domEmitter']['listenTo'](_0xf146c8['document'],'keydown',(_0x177978,{key:_0x96aaaa})=>{'Escape'===_0x96aaaa&&function(_0x2bf501){_0x2bf501['editing']['view']['change'](_0x2af6f0=>{for(const _0x262586 of _0x2bf501['model']['markers']){if(!_0x262586['name']['startsWith']('user:position'))continue;const _0x4faf9b=_0x2bf501['editing']['mapper']['markerNameToElements'](_0x262586['name']);if(_0x4faf9b){for(const _0x440875 of _0x4faf9b)_0x2af6f0['removeClass']('ck-user__marker_hovered',_0x440875);}}});}(_0x3c9c9a);},{'useCapture':!0x0});}['afterInit'](){const _0x226b4e=this['editor'],_0x32990=_0x226b4e['commands']['get']('undo');_0x32990&&_0x226b4e['model']['on']('applyOperation',(_0x2b8b10,_0x315185)=>{const _0x1db59b=_0x315185[0x0];if(!_0x1db59b['isDocumentOperation'])return;if('marker'!=_0x1db59b['type']||!_0x1db59b['name']['startsWith']('user:'))return;const _0x1dcbc2=_0x1db59b['batch'];_0x32990['_createdBatches']['has'](_0x1dcbc2)&&(_0x1db59b['newRange']=_0x1db59b['oldRange']?_0x226b4e['model']['createRange'](_0x1db59b['oldRange']['start'],_0x1db59b['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3b8ffc=this['editor'],_0xb301bc=_0x3b8ffc['model']['document'],_0xc3c307=_0x3b8ffc['plugins']['get'](i);_0x3b8ffc['model']['enqueueChange']({'isUndoable':!0x1},_0x5f1564=>{const _0x481d0f='user:range:'+_0xc3c307['mySessionId'],_0x5017f7='user:position:'+_0xc3c307['mySessionId'],_0x3ea13c=_0x3b8ffc['model']['markers']['has'](_0x481d0f);_0x3b8ffc['editing']['view']['hasDomSelection']?G(_0xc3c307['mySessionId'],_0xb301bc['selection']['getFirstRange'](),_0x3b8ffc['model'],_0x5f1564):_0x3ea13c&&(_0x5f1564['removeMarker'](_0x481d0f),_0x5f1564['removeMarker'](_0x5017f7));});}}function G(_0x182804,_0x49f3af,_0x12d17c,_0x127d3a){const _0x2167da='user:range:'+_0x182804,_0x3dbbff='user:position:'+_0x182804,_0x14094e=_0x49f3af['getContainedElement']();let _0x169963=_0x49f3af['start'];if(_0x14094e&&_0x14094e['is']('element','tableCell')){const _0x444949=function(_0x705b4,_0x1bb02e){for(const _0x1c2d39 of _0x705b4['getPositions']())if(_0x1bb02e['schema']['checkChild'](_0x1c2d39,'$text'))return _0x1c2d39;}(_0x49f3af,_0x12d17c);_0x444949&&(_0x169963=_0x444949,_0x49f3af=_0x127d3a['createRange'](_0x169963));}const _0x184425=_0x127d3a['createRange'](_0x169963);_0x12d17c['markers']['has'](_0x2167da)?(_0x127d3a['updateMarker'](_0x2167da,{'range':_0x49f3af}),_0x127d3a['updateMarker'](_0x3dbbff,{'range':_0x184425})):(_0x127d3a['addMarker'](_0x2167da,{'range':_0x49f3af,'usingOperation':!0x0}),_0x127d3a['addMarker'](_0x3dbbff,{'range':_0x184425,'usingOperation':!0x0}));}function N(_0x393228,_0xcd068,_0x34b81f){const _0x31a231=_0x393228['t'],t=_0x393228['t'];switch(_0xcd068){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 _0x31a231({'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'},_0x34b81f);default:return'';}}let M=0x1;class l extends _0x228e35{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x669c44)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,E,_0x54c310,_0x1d491e,_0x35081a];}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 _0x1a6f8f=this['serverHistory']['getOperations']();for(let _0xbffcea=_0x1a6f8f['length']-0x1;_0xbffcea>=0x0;_0xbffcea--){const _0x39992c=_0x1a6f8f[_0xbffcea];if(!this['_disconnectionOperations']['has'](_0x39992c))return _0x39992c['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x137992){if(super(_0x137992),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5839cf(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x404cce('collaboration-missing-channelid',this);const _0x4eaa09=_0x137992['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x4eaa09,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x68aa40(),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 V(this['_disconnectionOperations']);}['init'](){const _0x30ef9b=this['editor'],_0x4b2c55=_0x30ef9b['plugins']['get'](_0x1d491e),_0x414cf4=_0x30ef9b['plugins']['get'](c);this['listenTo'](_0x4b2c55,'getOperationAuthor',(_0xfbcb81,_0x21f783)=>{const _0x34eaee=_0x21f783[0x0];_0x34eaee['_authorId']&&(_0xfbcb81['return']=_0x4b2c55['getUser'](_0x34eaee['_authorId']),_0xfbcb81['stop']()),null===_0x34eaee['_authorId']&&(_0xfbcb81['return']=null,_0xfbcb81['stop']());},{'priority':'high'}),this['listenTo'](_0x30ef9b['model']['document']['selection'],'change:range',(_0x27cde1,_0x812d30)=>{_0x812d30['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x30ef9b['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x30ef9b['model']['on']('applyOperation',(_0x832dcb,_0x2d105c)=>{const _0x2c7e5d=_0x2d105c[0x0];_0x2c7e5d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2c7e5d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x414cf4,'state',this,'_hasSynchronizationProblem',(_0x25e3eb,_0xa3f17)=>'connected'===_0x25e3eb&&!_0xa3f17),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x30ef9b['disableReadOnlyMode']('rtc-offline'):_0x30ef9b['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x30ef9b['disableReadOnlyMode']('rtc-offline'):_0x30ef9b['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xf0b91a=this['editor']['plugins']['get'](i),_0x3c1976=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0xf0b91a['unregister'](this['_channelId']);const _0x86468a=await this['_service']['reconnect'](_0x3c1976['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x86468a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4580d5=await this['_service']['getConnectedSessions']();_0xf0b91a['register'](this['_channelId'],_0x4580d5),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4465ce){if(function(_0x2a9eb0){return'404'===_0x2a9eb0['code'];}(_0x4465ce)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5d177b){return'409'===_0x5d177b['code'];}(_0x4465ce)){const _0x361359=N(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'](_0x361359);}else{if(!(_0x4465ce instanceof z))throw _0x4465ce;this['_handleReconnectionError']();}}}}['destroy'](){const _0x182ce8=this['editor']['plugins']['get'](c),_0x370845=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x370845['channelSessions']['has'](this['_channelId'])&&_0x370845['unregister'](this['_channelId']),_0x182ce8['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4b1d55){if(this['sessionId']!==_0x4b1d55['sessionId']&&this['_lastSyncedOperationId']!==_0x4b1d55['lastOperationId'])throw new z();return this['sessionId']=_0x4b1d55['sessionId'],this['_handleServerResponse']([],{..._0x4b1d55,'wereChangesApplied':!0x1,'data':_0x4b1d55['data']},'reconnect');}async['_connectService'](_0x3b7e5f,_0x19ccbb=!0x1){const {connection:_0x2343f7}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2343f7,this['_channelId'])['then'](_0x41caa5=>this['_initSessionsHandling'](_0x41caa5))['catch'](_0x33952f=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x33952f);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xdaaaba,_0x4b27d4)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x4b27d4);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x8dea57=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3b7e5f);this['_isPendingUpdate']=!0x0;const _0x16bd2e=await this['_service']['connect'](_0x2343f7,this['_compressOperations'](_0x3b7e5f),_0x8dea57);if(this['sessionId']=_0x16bd2e['sessionId'],_0x19ccbb){if(!_0x16bd2e['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x16bd2e['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3b7e5f,_0x16bd2e,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x16bd2e,_0x3b7e5f);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x746004=this['editor']['plugins']['get'](i),_0x239a18=this['editor']['plugins']['get'](E),_0x5d0de6=_0x746004['channelSessions']['get'](this['_channelId']);_0x5d0de6&&_0x5d0de6['length']>0x1?_0x239a18['createUserMarkerOperations']():this['listenTo'](_0x746004,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x746004['channelSessions']['get'](this['_channelId'])['length']&&_0x239a18['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2c61ac,_0x1d202c,_0x24ab99,_0x58dffd){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1d202c){const _0x4fa1de=this['_decompressOperations'](_0x24ab99,_0x58dffd);await this['_fetchMissingUsers'](_0x4fa1de),this['_handleExternalOperations'](_0x4fa1de,_0x1d202c,_0x24ab99['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1ad5ac}=this['editor'];let _0x28efab;try{_0x28efab=await this['_service']['getDocumentDetails']();}catch{const _0x4daeee=N(_0x1ad5ac,'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'](_0x4daeee);}const _0x13e1fc=_0x28efab['currentDocumentSession']||_0x28efab['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x13e1fc['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x55de3f=N(_0x1ad5ac,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x55de3f);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xd27a34){const _0x687603=this['editor']['plugins']['get'](i);this['listenTo'](_0x687603,'sessionAdd:'+this['_channelId'],(_0x363b9a,{session:_0x5c66ba})=>{if(_0x5c66ba['id']===_0x687603['mySessionId']){_0x363b9a['off']();const _0x21a5b1=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3a0447=_0x5c66ba['permissions'];_0x21a5b1&&_0x21a5b1['isEnabled']&&(_0x3a0447=_0x3a0447['filter'](_0x54a454=>'document:write'!==_0x54a454)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3a0447,this['_channelId']);}}),_0x687603['register'](this['_channelId'],_0xd27a34);}['_initThrowingOnDataSet'](){const _0x5193de=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x24f4d6)=>{if(!_0x24f4d6[_0x24f4d6['length']-0x1]['suppressErrorInCollaboration'])throw new _0x404cce('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5193de['apply'](this['editor']['data'],_0x24f4d6);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4d701a,[_0x27989c])=>{if(this['_document']['version'])throw new _0x404cce('realtimecollaborationclient-init-document-already-initialized',this);_0x4d701a['stop'](),this['_setPendingAction']();const _0x850f8d=this['editor']['config']['get']('rootsAttributes'),_0x78ac2e=this['_getOperationsFromInitData'](_0x27989c,_0x850f8d);0x0==_0x78ac2e['length']&&_0x78ac2e['push'](new _0x21e77f(0x0)),_0x4d701a['return']=this['_connectService'](_0x78ac2e)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1cbbf2=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1cbbf2))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x5d73a1,[_0x3b7822,_0x27dfd7])=>{_0x5d73a1['stop']();const _0x22af91=this['editor']['model']['document']['getRoot'](_0x3b7822);if(!this['_knownRootNames']['has'](_0x3b7822)){const _0xaae2f7=_0x27dfd7&&_0x27dfd7['data']?_0x27dfd7['data']:'',_0x4af59d=_0x27dfd7&&_0x27dfd7['attributes']?_0x27dfd7['attributes']:{};await this['_loadRoot'](_0x3b7822,_0xaae2f7,_0x4af59d);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x22af91['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x22af91);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x13be73){const _0x15d705=this['editor']['plugins']['get'](_0x1d491e),{connection:_0x357f93}=this['editor']['plugins']['get'](c),_0x3ef8a8=new Set();for(const _0x2c1a6f of _0x13be73){const _0x35b900=_0x2c1a6f['_authorId'];_0x35b900&&!_0x15d705['getUser'](_0x35b900)&&_0x3ef8a8['add'](_0x35b900);}if(0x0===_0x3ef8a8['size'])return;const _0x2f5e1f=await gt['getMany'](_0x357f93,Array['from'](_0x3ef8a8));for(const _0x3bfe87 of _0x2f5e1f)_0x15d705['getUser'](_0x3bfe87['id'])||_0x15d705['addUser'](_0x3bfe87);}['_getOperationsFromInitData'](_0x589cc0,_0x451c4c={}){const _0x176d2f=this['editor']['model'],_0x213fe4=[];let _0x408aa0=0x0;const _0x1ec11a='string'==typeof _0x589cc0?{'main':_0x589cc0}:_0x589cc0;for(const _0x55847b of Object['keys'](_0x1ec11a)){if(!this['_document']['roots']['has'](_0x55847b))throw new _0x404cce('realtimecollaborationclient-init-non-existent-root',this);const _0x5ea641=this['editor']['data']['parse'](_0x1ec11a[_0x55847b]),_0x110352=this['_document']['getRoot'](_0x55847b),_0x310165=new _0xfd37f2(_0x176d2f['createPositionAt'](_0x110352,0x0),_0x5ea641,_0x408aa0++);_0x213fe4['push'](_0x310165);for(const [_0x497aad,_0x1bc6c8]of _0x5ea641['markers']){const _0x4cc947=_0x176d2f['createRange'](_0x176d2f['createPositionFromPath'](_0x110352,_0x1bc6c8['start']['path']['slice']()),_0x176d2f['createPositionFromPath'](_0x110352,_0x1bc6c8['end']['path']['slice']())),_0x42cd3b=new _0x3cdadb(_0x497aad,null,_0x4cc947,_0x176d2f['markers'],!0x0,_0x408aa0++);_0x213fe4['push'](_0x42cd3b);}}if(_0x451c4c)for(const [_0x5176bc,_0x4a9716]of Object['entries'](_0x451c4c)){const _0x36c15f=_0x176d2f['document']['getRoot'](_0x5176bc);if(!_0x36c15f)throw new _0x404cce('multi-root-editor-root-attributes-no-root',null);for(const [_0x4f595c,_0xf11916]of Object['entries'](_0x4a9716))if(null!==_0xf11916){const _0x3fc1b7=new _0x431b67(_0x36c15f,_0x4f595c,null,_0xf11916,_0x408aa0++);_0x213fe4['push'](_0x3fc1b7);}}return _0x213fe4;}async['_loadRoot'](_0x281581,_0x1a52ed,_0x52213c){this['_getOperationsFromInitData']({[_0x281581]:_0x1a52ed},{[_0x281581]:_0x52213c})['forEach']((_0x33118b,_0x3de3ae)=>{_0x33118b['baseVersion']=this['_document']['version']+_0x3de3ae,_0x33118b['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x33118b);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x295869,_0x1fb3c9){let _0x2d74c2;this['_offset']=_0x295869['offset'];const _0xbda57b=_0x295869['wereChangesApplied']&&!_0x295869['initData'],_0x16d3a9=_0xbda57b?0x0:_0x295869['data']['baseVersion'];if(_0x1fb3c9['forEach'](_0x2e0ab8=>{_0x2e0ab8['_isInit']=!0x0,_0x2e0ab8['createdAt']=_0x295869['sessionCreatedAt'],_0x2e0ab8['_authorId']=null;}),_0xbda57b)_0x2d74c2=_0x1fb3c9,this['_applyOperationsSet'](_0x2d74c2,_0xbda57b);else{if(_0x295869['initData']){const _0x37949b=this['_getOperationsFromInitData'](_0x295869['initData']);this['_document']['history']['version']=-_0x37949b['length'],_0x37949b['forEach'](_0x1f6fc6=>{_0x1f6fc6['baseVersion']-=_0x37949b['length'],_0x1f6fc6['createdAt']=_0x295869['sessionCreatedAt'],_0x1f6fc6['_isInit']=!0x0,_0x1f6fc6['_authorId']=null;}),this['_applyOperationsSet'](_0x37949b,!0x0),this['serverHistory']['version']=-_0x37949b['length']+this['_offset'],this['_updateServerHistory'](_0x37949b);}this['_document']['history']['version']=_0x16d3a9,_0x2d74c2=this['_decompressOperations'](_0x295869['data'],_0x295869['metadata']),await this['_fetchMissingUsers'](_0x2d74c2),this['_applyOperationsSet'](_0x2d74c2,_0xbda57b);}_0x295869['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2d74c2,_0x295869['lastOperationId']),this['_lastSyncedOperationId']=_0x295869['lastOperationId']),this['serverHistory']['version']=_0x16d3a9+this['_offset'],this['_updateServerHistory'](_0x2d74c2),_0x1fb3c9['filter'](_0x291dee=>{const _0x209ec1=this['_getAffectedRoot'](_0x291dee);return _0x209ec1&&!this['_knownRootNames']['has'](_0x209ec1);})['forEach']((_0x1481d1,_0x192891)=>{_0x1481d1['baseVersion']=this['_document']['version']+_0x192891,this['_saveOperationInBuffer'](_0x1481d1);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2a35b9,_0x3641ae){const _0x32e5ee=_0x3641ae&&_0x3641ae['message'];if(_0x32e5ee&&_0x32e5ee['startsWith']('realtimecollaborationclient'))throw _0x3641ae;const _0x4a9ed4=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x4a9ed4['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x404cce(_0x2a35b9,this['editor'],_0x32e5ee?{'originalError':_0x32e5ee}:void 0x0);}['_saveOperationInBuffer'](_0x4d64f2){this['_knownOperations']['has'](_0x4d64f2)||(this['_knownOperations']['add'](_0x4d64f2),this['_bufferedOperations']['push'](_0x4d64f2),this['_pendingAction']||'marker'==_0x4d64f2['type']&&!_0x4d64f2['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x4f25ce=!0x1){!_0x4f25ce&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4c9cbf=>{_0x4c9cbf&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0xcbe330=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xe1eece){return _0xe1eece['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xe1eece['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xe1eece['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0xcbe330)||this['_crash'](_0xcbe330['message'],_0xcbe330);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0xcd1636=>{this['on']('change:_isPendingUpdate',()=>{_0xcd1636();});});}async['_sendBufferedOperations'](){const _0x423375=this['editor']['plugins']['get'](E);if(this['_shouldSendSelectionUpdate']()&&(_0x423375['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xf947b8=[...this['_bufferedOperations']];for(const _0x10d208 of _0xf947b8)_0x10d208['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x10d208);const _0x4af9e3=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xf947b8),_0x4c3b3b=M++,_0x5b67ac=this['_compressOperations'](_0xf947b8),_0x4197e1=await this['_service']['sendOperations'](_0x5b67ac,_0x5b67ac['baseVersion'],_0x4af9e3);try{return await this['_handleServerResponse'](_0xf947b8,_0x4197e1,_0x4c3b3b);}catch(_0x3e6ecb){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3e6ecb);}}async['_handleServerResponse'](_0x15cc5f,_0x4f519a,_0x4906f4){if('error'in _0x4f519a)throw _0x4f519a['error'];let _0x4753ba=!0x1;if(_0x4f519a['wereChangesApplied']){_0x4f519a['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4f519a['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x14a338=>!_0x15cc5f['includes'](_0x14a338));for(const _0x560296 of _0x15cc5f)_0x560296['createdAt']='lastOperationAcceptedAt'in _0x4f519a&&_0x4f519a['lastOperationAcceptedAt']||void 0x0;H(_0x15cc5f,_0x4f519a['version']-_0x15cc5f['length']),this['_updateServerHistory'](_0x15cc5f);const _0x27ce87=_0x15cc5f['filter'](_0x4dbba2=>{if(!_0x4dbba2['_isInit'])return!0x1;const _0x52bca2=this['_getAffectedRoot'](_0x4dbba2);return _0x52bca2&&!this['_knownRootNames']['has'](_0x52bca2);});H(_0x27ce87,this['_document']['version']),this['_applyOperationsSet'](_0x27ce87),_0x4753ba=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xa64f5c=this['_decompressOperations'](_0x4f519a['data'],_0x4f519a['metadata'])['filter'](_0x37417e=>_0x37417e['baseVersion']>=this['_lastServerVersion']);_0xa64f5c['forEach'](_0x4c8f5d=>this['_addKnownRoot'](_0x4c8f5d)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4b4416=>!_0x4b4416['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4b4416))),this['_bufferedOperations']['length']&&H(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xa64f5c),_0x4753ba=this['_handleExternalOperations'](_0xa64f5c,_0x4f519a['version'],_0x4f519a['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4753ba?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x30c082,_0x46d3d3,_0x74e928){try{const _0x5604c9={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x16e38e,operationsB:_0x412cf4,originalOperations:_0x425924}=_0x8c424a(_0x30c082,this['_bufferedOperations'],_0x5604c9);H(_0x16e38e,this['_document']['version']),H(_0x412cf4,_0x46d3d3);for(const _0x59a301 of _0x16e38e){const _0x4f2fb0=_0x425924['get'](_0x59a301);_0x59a301['_authorId']=_0x4f2fb0?_0x4f2fb0['_authorId']:null;}_0x74e928&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x30c082,_0x74e928),this['_lastSyncedOperationId']=_0x74e928),this['_bufferedOperations']=[..._0x412cf4],this['_applyOperationsSet'](_0x16e38e),this['_updateServerHistory'](_0x30c082);}catch(_0x222613){return console['error'](_0x222613),!0x1;}return!0x0;}['_applyOperationsSet'](_0xda0ef8,_0x14557a=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4f4c2e=>{for(const _0x10b849 of _0xda0ef8)this['_knownOperations']['add'](_0x10b849),this['_addKnownRoot'](_0x10b849),_0x4f4c2e['batch']['addOperation'](_0x10b849),this['editor']['model']['applyOperation'](_0x10b849);});}['_addKnownRoot'](_0x3ea3be){const _0x2239ee=this['_getAffectedRoot'](_0x3ea3be);_0x2239ee&&this['_knownRootNames']['add'](_0x2239ee);}['_getAffectedRoot'](_0x28b9b7){let _0x1e3259,_0x33ad2f;switch(_0x28b9b7['type']){case'insert':_0x1e3259=_0x28b9b7['position']['root'];break;case'marker':if(_0x33ad2f=_0x28b9b7['newRange'],!_0x33ad2f)return null;_0x1e3259=_0x33ad2f['root'];break;case'addRootAttribute':_0x1e3259=_0x28b9b7['root'];break;case'addRoot':_0x1e3259=_0x28b9b7['affectedSelectable'];break;case'move':_0x1e3259=_0x28b9b7['targetPosition']['root'];break;default:return null;}return _0x1e3259['rootName'];}['_updateServerHistory'](_0x2f6ff4){_0x2f6ff4['forEach'](_0x53bbee=>{const _0xc78be=_0x53bbee['clone']();_0xc78be['_authorId']=_0x53bbee['_authorId'],_0xc78be['_isInit']=!!_0x53bbee['_isInit'],_0xc78be['createdAt']=_0x53bbee['createdAt'],_0xc78be['baseVersion']+=this['_offset'],_0x53bbee['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xc78be),this['serverHistory']['addOperation'](_0xc78be);});}['_handleReconnectionError'](_0x4896dc){const _0xd8587a=this['editor']['plugins']['get']('Notification'),_0x167695=this['editor']['locale'];_0x4896dc||(_0x4896dc=N(_0x167695,'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.')),_0xd8587a['showWarning'](_0x4896dc,{'title':N(_0x167695,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x54c310)['add'](N(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x54c310)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2a9671){const _0x2a37d1=_0x2a9671['map'](_0x5326bb=>_0x5326bb['toJSON']());return this['_compressor']['compress'](_0x2a37d1);}['_decompressOperations'](_0x327075,_0x43db32){return this['_compressor']['decompress'](_0x327075)['map']((_0x690ca3,_0x56e2ee)=>{const _0x4c6cec='init'==_0x43db32[_0x56e2ee]['type'];if('InsertOperation'==_0x690ca3['__className']){const _0x30b736=_0x690ca3['position']['root'];!this['_document']['getRoot'](_0x30b736)&&(this['_document']['createRoot']('$root',_0x30b736)['_isAttached']=!0x1);}const _0x4d99bc=_0x5bc9bc['fromJSON'](_0x690ca3,this['_document']);return _0x4d99bc['wasUndone']=_0x690ca3['wasUndone'],_0x4d99bc['_isInit']=_0x4c6cec,_0x4d99bc['_authorId']=_0x4c6cec?null:_0x43db32[_0x56e2ee]['userId'],_0x4d99bc['_isDisconnection']='cs:removeUser'===_0x43db32[_0x56e2ee]['type'],_0x4d99bc['createdAt']=_0x43db32[_0x56e2ee]['createdAt'],_0x4d99bc;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2c8452=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2c8452&&_0x2c8452['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class z extends Error{}function H(_0x40d836,_0xdfc0db){for(const _0x58a1fb of _0x40d836)_0x58a1fb['baseVersion']=_0xdfc0db++;}class V{['_ignoredOperations'];['_operationToId'];constructor(_0xab132){this['_ignoredOperations']=_0xab132,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x170363){let _0x4b16be=_0x170363['length'];for(;_0x4b16be--;){const _0x1a7894=_0x170363[_0x4b16be];if(!this['_ignoredOperations']['has'](_0x1a7894)){if(!this['_operationToId']['has'](_0x1a7894)){const _0x1b8783=_0x482ed0()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1a7894,_0x1b8783);}return this['_operationToId']['get'](_0x1a7894);}}}['setIdForTheLastOperation'](_0x1e53f7,_0x3b8cc3){if(!_0x3b8cc3)return;let _0x46da6a=_0x1e53f7['length'];for(;_0x46da6a--;){const _0x4b6624=_0x1e53f7[_0x46da6a];this['_ignoredOperations']['has'](_0x4b6624)||this['_operationToId']['set'](_0x4b6624,_0x3b8cc3);}}}class n extends _0x228e35{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x1390d5{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x3a643b)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x1d491e];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x28e717){super(_0x28e717),this['_services']=new Map();}async['init'](){const _0x4bba28=this['context'],_0x34e12e=_0x4bba28['plugins']['get']('CommentsRepository');if(_0x4bba28['plugins']['get'](c)['addToReconnectionStack'](this),_0x34e12e['adapter']={'addCommentThread':async({channelId:_0x564264,threadId:_0x3dea55,comments:_0x56a4d6,resolvedAt:_0x24ee57,resolvedBy:_0x2ddafe,context:_0x2a3994,attributes:_0x3ab4fe})=>{const _0xe014ab=await this['_getService'](_0x564264)['addCommentThread']({'commentThreadId':_0x3dea55,'comments':_0x56a4d6['map'](_0x2f83bb=>function(_0x28b434,_0x3d4cca,_0x18674a){return{'commentThreadId':_0x18674a,'commentId':_0x28b434['commentId'],'userId':_0x28b434['authorId'],'content':_0x28b434['content'],'documentId':_0x3d4cca,'createdAt':_0x28b434['createdAt'],'attributes':_0x28b434['attributes']||{}};}(_0x2f83bb,_0x564264,_0x3dea55)),'resolvedAt':_0x24ee57,'resolvedBy':_0x2ddafe,'context':_0x2a3994,'attributes':_0x3ab4fe})['catch'](wt);return{'threadId':_0xe014ab['commentThreadId'],'comments':_0xe014ab['comments']};},'getCommentThread':async({channelId:_0x39276e,threadId:_0x5968f6})=>{const _0x28f30a=await this['_getService'](_0x39276e)['getCommentThread'](_0x5968f6)['catch'](wt);return _0x28f30a['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x28f30a]),{'threadId':_0x28f30a['commentThreadId'],'comments':_0x28f30a['comments']['map'](b),'context':_0x28f30a['context'],'resolvedAt':_0x28f30a['resolvedAt'],'resolvedBy':_0x28f30a['resolvedBy'],'attributes':_0x28f30a['attributes']||{}});},'updateCommentThread':async({channelId:_0x1e9030,threadId:_0x5ab45d,context:_0x118ed8,unlinkedAt:_0x9dfefa,attributes:_0x259436})=>this['_getService'](_0x1e9030)['updateCommentThread']({'commentThreadId':_0x5ab45d,'context':_0x118ed8,'attributes':_0x259436,'unlinkedAt':_0x9dfefa})['catch'](y)['catch'](wt),'resolveCommentThread':async({channelId:_0x3f244e,threadId:_0x2a8fa3})=>{const _0x30b428=await this['_getService'](_0x3f244e)['resolveCommentThread'](_0x2a8fa3)['catch'](y)['catch'](wt);return{'threadId':_0x30b428['commentThreadId'],'resolvedAt':_0x30b428['resolvedAt'],'resolvedBy':_0x30b428['resolvedBy']};},'reopenCommentThread':async({channelId:_0x297adb,threadId:_0x44574b})=>this['_getService'](_0x297adb)['reopenCommentThread'](_0x44574b)['catch'](y)['catch'](wt),'removeCommentThread':({channelId:_0xe9b566,threadId:_0x1c934c})=>this['_getService'](_0xe9b566)['removeCommentThread'](_0x1c934c)['catch'](y)['catch'](wt),'addComment':({channelId:_0x522f50,threadId:_0x158b18,commentId:_0x3a7942,content:_0x348a24,attributes:_0x5c8dd1})=>this['_getService'](_0x522f50)['addComment'](_0x158b18,_0x3a7942,_0x348a24,_0x5c8dd1)['catch'](wt),'updateComment':({channelId:_0x10f626,threadId:_0x36f36f,commentId:_0x1d101f,content:_0x400a90,attributes:_0x441e35})=>this['_getService'](_0x10f626)['updateComment'](_0x36f36f,_0x1d101f,_0x400a90,_0x441e35)['catch'](y)['catch'](wt),'removeComment':({channelId:_0x13d644,threadId:_0x357387,commentId:_0x2563c8})=>this['_getService'](_0x13d644)['removeComment'](_0x357387,_0x2563c8)['catch'](y)['catch'](wt)},_0x4bba28 instanceof _0x3485da){const _0x25dc46=_0x4bba28['config']['get']('collaboration.channelId'),_0xcee7fd=_0x4bba28['plugins']['get'](i);await this['_setUpService'](_0x25dc46);const _0x32eba5=await this['_services']['get'](_0x25dc46)['getConnectedSessions']();this['listenTo'](_0xcee7fd,'sessionAdd:'+_0x25dc46,(_0x41643d,{session:_0x586439})=>{_0x586439['id']===_0xcee7fd['mySessionId']&&(_0x41643d['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x586439['permissions'],_0x25dc46));}),_0xcee7fd['register'](_0x25dc46,_0x32eba5);}}async['_setUpService'](_0x38616c){if(this['_services']['has'](_0x38616c))throw new _0x404cce('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x38616c});const _0x545486=this['context']['plugins']['get']('CommentsRepository'),_0x53354b=new a['CommentsService'](_0x38616c);this['_services']['set'](_0x38616c,_0x53354b),this['listenTo'](_0x53354b,'commentThreadAdded',(_0x3aadfd,_0x3d40fa)=>{const {commentThreadId:_0x217c0e,documentId:_0x22a2bf,context:_0x5dda8f,attributes:_0x172b4d,resolvedAt:_0x5b7b51,resolvedBy:_0x155839,comments:_0x441bc1}=_0x3d40fa;_0x545486['getCommentThread'](_0x217c0e)||_0x545486['addCommentThread']({'threadId':_0x217c0e,'channelId':_0x22a2bf,'comments':_0x441bc1?_0x441bc1['map'](b):[],'context':_0x5dda8f,'attributes':_0x172b4d,'resolvedAt':_0x5b7b51,'resolvedBy':_0x155839,'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadUpdated',(_0x13090e,{commentThreadId:_0x3bc856,documentId:_0x175c41,context:_0x45e274,unlinkedAt:_0x53590b,attributes:_0x14f7e3})=>{_0x545486['getCommentThread'](_0x3bc856)&&_0x545486['updateCommentThread']({'threadId':_0x3bc856,'channelId':_0x175c41,'context':_0x45e274,'unlinkedAt':_0x53590b,'attributes':_0x14f7e3,'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadResolved',(_0x958179,{commentThreadId:_0x594bb9,resolvedBy:_0x95036,resolvedAt:_0x1edf88})=>{const _0x27c656=_0x545486['getCommentThread'](_0x594bb9);_0x27c656&&_0x27c656['resolve']({'resolvedBy':_0x95036,'resolvedAt':_0x1edf88,'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadReopened',(_0x19168f,{commentThreadId:_0x32d0eb})=>{const _0x5b5ed4=_0x545486['getCommentThread'](_0x32d0eb);_0x5b5ed4&&_0x5b5ed4['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadRemoved',(_0xef1b53,{commentThreadId:_0x5eca3b})=>{const _0x23d941=_0x545486['getCommentThread'](_0x5eca3b);_0x23d941&&_0x23d941['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentAdded',(_0xdc381f,_0x5c40cf)=>{const _0x20a0ae=_0x5c40cf['commentThreadId'],_0x1bce81=_0x545486['getCommentThread'](_0x20a0ae);_0x1bce81&&_0x1bce81['addComment']({...b(_0x5c40cf),'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentUpdated',(_0x4eebdc,{commentThreadId:_0x322eed,commentId:_0x35ea12,content:_0x352d25,attributes:_0x13e8fd})=>{const _0x4439a0=_0x545486['getCommentThread'](_0x322eed);if(_0x4439a0){const _0x474999=_0x4439a0['getComment'](_0x35ea12);_0x474999&&_0x474999['update']({'content':_0x352d25,'attributes':_0x13e8fd,'isFromAdapter':!0x0});}}),this['listenTo'](_0x53354b,'commentRemoved',(_0x298977,{commentThreadId:_0x2d63e6,commentId:_0x1f1eb0})=>{const _0x1086bd=_0x545486['getCommentThread'](_0x2d63e6);if(_0x1086bd){const _0x1a0e46=_0x1086bd['getComment'](_0x1f1eb0);_0x1a0e46&&_0x1a0e46['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x38616c);}['destroy'](){if(this['context']instanceof _0x3485da){const _0x4c6644=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4c6644);}}['_terminateService'](_0x1a9cf7){if(!this['_services']['has'](_0x1a9cf7))throw new _0x404cce('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1a9cf7});this['_getService'](_0x1a9cf7)['disconnect'](),this['_services']['delete'](_0x1a9cf7);}async['reconnect'](){for(const _0x1f8e7e of this['_services']['keys']())await this['_connectService'](_0x1f8e7e);if(this['context']instanceof _0x3485da){const _0xe11307=this['context']['config']['get']('collaboration.channelId'),_0x49b29c=this['context']['plugins']['get'](i);_0x49b29c['unregister'](_0xe11307);const _0x580f3d=await this['_services']['get'](_0xe11307)['getConnectedSessions']();_0x49b29c['register'](_0xe11307,_0x580f3d);}}async['_connectService'](_0x31c73a){const {connection:_0xdc7618}=this['context']['plugins']['get'](c),_0x5efccd=this['context']['plugins']['get']('CommentsRepository'),_0xf4e349=this['_services']['get'](_0x31c73a),_0x5c164f=await _0xf4e349['connect'](_0xdc7618);await this['_fetchMissingUsersForThreads'](_0x5c164f);const _0x10a374=new Set(Array['from'](_0x5efccd['getCommentThreads']({'channelId':_0x31c73a}),_0x5bf40c=>_0x5bf40c['id']));for(const _0x232731 of _0x5c164f)_0x232731['deletedAt']||_0x10a374['delete'](_0x232731['commentThreadId']);for(const _0x2f0f44 of _0x10a374)_0x5efccd['getCommentThread'](_0x2f0f44)['remove']({'isFromAdapter':!0x0});for(const _0x4c61cd of _0x5c164f){let _0x28fef4=_0x5efccd['getCommentThread'](_0x4c61cd['commentThreadId']);const {commentThreadId:_0x35500d,context:_0x72f117,attributes:_0x10f906,resolvedBy:_0x57cbf6,resolvedAt:_0x227499,unlinkedAt:_0x332078,deletedAt:_0x1dd603}=_0x4c61cd;if(_0x1dd603)continue;_0x28fef4||(_0x28fef4=_0x5efccd['addCommentThread']({'channelId':_0x31c73a,'threadId':_0x35500d,'context':_0x72f117,'attributes':_0x10f906||{},'resolvedBy':_0x57cbf6,'resolvedAt':_0x227499,'unlinkedAt':_0x332078,'isFromAdapter':!0x0}));const _0xaedc6f=new Set(Array['from'](_0x28fef4['comments'],_0x45d113=>_0x45d113['id']));for(const _0x5d3eae of _0x4c61cd['comments'])_0xaedc6f['delete'](_0x5d3eae['commentId']);for(const _0x4f00b0 of _0xaedc6f)_0x28fef4['getComment'](_0x4f00b0)['remove']({'isFromAdapter':!0x0});for(const _0x931529 of _0x4c61cd['comments']){const _0x23f2cc=_0x28fef4['getComment'](_0x931529['commentId']);_0x23f2cc?_0x23f2cc['content']!==_0x931529['content']&&_0x23f2cc['update']({'content':_0x931529['content'],'isFromAdapter':!0x0}):_0x28fef4['addComment'](Object['assign'](b(_0x931529),{'isFromAdapter':!0x0}));}}}['_getService'](_0x566258){if(!this['_services']['has'](_0x566258))throw new _0x404cce('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x566258});return this['_services']['get'](_0x566258);}async['_fetchMissingUsersForThreads'](_0x393b6c){const _0x81f9eb=this['context']['plugins']['get'](_0x1d491e),{connection:_0x58bfeb}=this['context']['plugins']['get'](c),_0x5af9aa=new Set();for(const {resolvedBy:_0x5e2fc2,comments:_0x55430e}of _0x393b6c){_0x5e2fc2&&!_0x81f9eb['getUser'](_0x5e2fc2)&&_0x5af9aa['add'](_0x5e2fc2);for(const {userId:_0x3ce35d}of _0x55430e)_0x81f9eb['getUser'](_0x3ce35d)||_0x5af9aa['add'](_0x3ce35d);}if(0x0===_0x5af9aa['size'])return;const _0x3f839c=await gt['getMany'](_0x58bfeb,Array['from'](_0x5af9aa));for(const _0x4e036b of _0x3f839c)_0x81f9eb['getUser'](_0x4e036b['id'])||_0x81f9eb['addUser'](_0x4e036b);}}async function y(_0x3d0b23){if('404'!==_0x3d0b23['code'])throw _0x3d0b23;}function wt(_0x46a169){if((_0x2283fb=_0x46a169)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2283fb['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2283fb['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2283fb;throw _0x46a169;}function b(_0x7d2c3d){return{'threadId':_0x7d2c3d['commentThreadId'],'commentId':_0x7d2c3d['commentId'],'content':_0x7d2c3d['content'],'createdAt':_0x7d2c3d['createdAt'],'authorId':_0x7d2c3d['userId'],'attributes':_0x7d2c3d['attributes']||{}};}class f extends _0x228e35{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(
|
|
28
|
-
((()=>nt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x1d491e];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3769a6){super(_0x3769a6);const _0x29dc43=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x29dc43);}async['init'](){const _0x4e0b26=this['editor']['plugins']['get'](l),_0x9c9c20=_0x4e0b26['serverHistory'],_0x4ca6a2=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x9c9c20,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4e0b26['sessionId']});const _0x1845a9=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0xfd369f=await ot['isBundleUploaded'](_0x4ca6a2['connection'],_0x1845a9);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x34861f})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x34861f)),'updateRevisions':async _0x18f4c3=>{await this['_waitForServiceReady']();const _0x3ab474=this['_revisionTracker']['currentRevision'];if(_0xfd369f&&0x1===_0x18f4c3['length']&&_0x18f4c3[0x0]['id']===_0x3ab474['id'])return _0x18f4c3;for(const _0x5b385c of _0x18f4c3)_0x5b385c['id']===_0x3ab474['id']&&(_0x5b385c['isEmptyCurrent']=_0x5b385c['fromVersion']===_0x5b385c['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x18f4c3,this['_lastRequestId'])['then'](_0x3fae21=>(this['_lastRequestId']=_0x3fae21,_0x18f4c3))['catch'](_0x5838c2=>{if(ct(_0x5838c2)||'400'===_0x5838c2['code']&&void 0x0!==_0x5838c2['data']['wrongRequestId']){for(const _0x4c7477 of _0x18f4c3){!this['_revisionTracker']['repository']['getRevision'](_0x4c7477['id'])||this['_revisionTracker']['_bufferUpdate'](_0x4c7477['id'],_0x4c7477,!0x1);}if(ct(_0x5838c2))throw _0x5838c2;return _0x18f4c3;}throw _0x5838c2;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3f31ef,{revisionsData:_0x1a97d1,requestId:_0x4f9a3c})=>{Math['max'](..._0x1a97d1['map'](_0x41a91a=>_0x41a91a['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1a97d1,_0x4f9a3c);}):this['_handleRevisionsUpdate'](_0x1a97d1,_0x4f9a3c);});const {revisions:_0x16d6a3,requestId:_0x438b00}=await this['_revisionHistoryService']['connect'](_0x4ca6a2['connection']);_0x4ca6a2['addToReconnectionStack'](this),this['_lastRequestId']=_0x438b00,await this['_fetchMissingUsers'](_0x16d6a3);for(const _0x2de84b of _0x16d6a3)this['_revisionTracker']['addRevisionData'](_0x2de84b);this['listenTo'](_0x4e0b26,'change:_isConnected',(_0x5ca09e,_0xe659a1,_0xbad84f)=>{_0xbad84f&&(this['_oldOffset']=_0x4e0b26['_offset'],_0x5ca09e['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4ca6a2,'state',_0x5a528a=>_0x5a528a===_0x1605b2['CONNECTED']);}async['reconnect'](){const _0xc3ec4c=this['editor']['plugins']['get'](c),_0x2d4cee=this['editor']['plugins']['get'](l),_0x2a2643=async()=>{const _0x23d74a=this['_revisionTracker']['currentRevision'],_0x3e8256=_0x23d74a['id'],_0x3dec0d=_0x3e8256!==_0x2d4cee['sessionId'];if(_0x3dec0d){const _0x490f48=_0x2d4cee['_offset']-this['_oldOffset'],_0x464733=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x23d74a['toVersion']+_0x490f48!==_0x464733){const _0x16e664=_0x23d74a['fromVersion']+_0x490f48,_0x314131=this['editor']['plugins']['get'](_0x1d491e),_0x553389=this['_revisionTracker']['buildRevisionData']({'revision':_0x23d74a,'from':_0x16e664,'to':_0x464733});_0x553389['id']=_0x23d74a['id'];const _0x396264=_0x553389['authorsIds']['map'](_0x577524=>_0x314131['getUser'](_0x577524));_0x23d74a['_update']({..._0x553389,'authors':_0x396264},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x23d74a['id'],_0x553389,!0x0);}this['_revisionTracker']['_startingVersion']=_0x464733,(_0x23d74a['toVersion']===_0x23d74a['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x3e8256)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x3e8256),this['_revisionTracker']['_createCurrentRevision'](_0x464733));}const {revisions:_0x224ba0,requestId:_0x15113d}=await this['_revisionHistoryService']['reconnect'](_0xc3ec4c['connection'],this['_lastRequestId']);_0x3dec0d&&_0x224ba0['length']>0x0?_0x2d4cee['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x224ba0),this['_handleRevisionsUpdate'](_0x224ba0,_0x15113d),this['_revisionTracker']['sendBufferedUpdates']());};return _0x2d4cee['_isConnected']?_0x2a2643():new Promise((_0x51d8c5,_0x2198a1)=>{_0x2d4cee['once']('change:_isConnected',()=>{_0x2a2643()['then'](_0x51d8c5)['catch'](_0x2198a1);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x1db597=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x643fdc=>{_0x643fdc['off'](),_0x1db597();});});}['_getLatestVersionFromServerOperations'](){const _0x34fca0=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x4cecb6 of _0x34fca0)if('marker'!==_0x4cecb6['type']||_0x4cecb6['affectsData'])return _0x4cecb6['baseVersion']+0x1;}['_getLatestVersion'](){const _0xab78fe=this['editor']['plugins']['get'](l);return new Promise(_0x2a04be=>{_0xab78fe['_isPendingUpdate']?_0xab78fe['once']('change:_isPendingUpdate',()=>{_0x2a04be(this['_getLatestVersionFromServerOperations']());}):_0x2a04be(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x16bbb0,_0x43b54c){const _0x2882f=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x43b54c;for(const _0x335d86 of _0x16bbb0){const _0x3f7d65=_0x2882f['getRevision'](_0x335d86['id']);if(_0x3f7d65){if((_0x335d86['fromVersion']||_0x335d86['toVersion'])&&(_0x335d86['diffData']=null),_0x3f7d65===this['_revisionTracker']['currentRevision']){const _0x5ae749=Math['max'](_0x3f7d65['toVersion'],_0x335d86['toVersion']),_0x1d594c=Math['max'](_0x3f7d65['fromVersion'],_0x335d86['fromVersion']);let _0x3db709;_0x3f7d65['toVersion']===_0x335d86['toVersion']&&_0x3f7d65['fromVersion']===_0x335d86['fromVersion']?(_0x3db709=!0x0,this['_preventResendingRevisionData'](_0x335d86)):_0x335d86['toVersion']===_0x5ae749&&_0x335d86['fromVersion']===_0x1d594c?_0x3db709=!0x1:(_0x3f7d65['toVersion']===_0x5ae749&&_0x3f7d65['fromVersion']===_0x1d594c||this['_fixRevision']({'revision':_0x3f7d65,'from':_0x1d594c,'to':_0x5ae749}),_0x3db709=!0x0),_0x3db709&&(delete _0x335d86['fromVersion'],delete _0x335d86['toVersion'],delete _0x335d86['diffData'],delete _0x335d86['createdAt'],delete _0x335d86['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x335d86),this['_preventResendingRevisionData'](_0x335d86);}else this['_revisionTracker']['addRevisionData'](_0x335d86);}const _0xd7be00=_0x2882f['getRevisions']();_0xd7be00['reverse']();for(let _0x5e6642=0x0;_0x5e6642<_0xd7be00['length']-0x1;_0x5e6642++){const _0x2860aa=_0xd7be00[_0x5e6642],_0x5ca39a=_0xd7be00[_0x5e6642+0x1];if(_0x2860aa['fromVersion']<_0x5ca39a['toVersion']){const _0x4f7ca5=_0x5ca39a['toVersion'],_0x48605a=Math['max'](_0x4f7ca5,_0x2860aa['toVersion']);this['_fixRevision']({'revision':_0x2860aa,'from':_0x4f7ca5,'to':_0x48605a});}}}['_fixRevision']({revision:_0x2f2ae5,from:_0x530c2f,to:_0x1c29e6}={}){const _0x33a2e8=this['editor']['plugins']['get'](_0x1d491e),_0x41cb9d=this['_revisionTracker']['buildRevisionData']({'revision':_0x2f2ae5,'from':_0x530c2f,'to':_0x1c29e6});_0x41cb9d['authors']=_0x41cb9d['authorsIds']['map'](_0x5d708b=>_0x33a2e8['getUser'](_0x5d708b)),_0x2f2ae5['_update'](_0x41cb9d);}['_preventResendingRevisionData'](_0x404aca){const _0x14f734={};_0x14f734['id']=_0x404aca['id'];for(const _0x5bdefa of Object['keys'](_0x404aca))'id'!==_0x5bdefa&&(_0x14f734[_0x5bdefa]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x14f734['id'],_0x14f734,!0x0);}async['_fetchMissingUsers'](_0x2d7c18){const _0x128509=this['editor']['plugins']['get'](_0x1d491e),{connection:_0x429fd8}=this['editor']['plugins']['get'](c),_0x3bfe8c=new Set();for(const _0x1dbfcc of _0x2d7c18){for(const _0x12cf64 of _0x1dbfcc['authorsIds'])_0x37757e(_0x12cf64);_0x1dbfcc['creatorId']&&_0x37757e(_0x1dbfcc['creatorId']);}if(0x0===_0x3bfe8c['size'])return;const _0x2b52f1=await gt['getMany'](_0x429fd8,Array['from'](_0x3bfe8c));for(const _0x3ee9e1 of _0x2b52f1)_0x128509['getUser'](_0x3ee9e1['id'])||_0x128509['addUser'](_0x3ee9e1);function _0x37757e(_0x193601){_0x128509['getUser'](_0x193601)||_0x3bfe8c['add'](_0x193601);}}}function ct(_0x4385b8){return _0x4385b8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4385b8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4385b8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x228e35{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class tt extends _0x405b4a{['_collapseAt'];constructor(_0x577c43,_0x14f3b3=0x6){super(_0x577c43);const _0x231461=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x14f3b3,this['bind']('isHidden')['to'](this,'usersCount',_0x2371ce=>_0x2371ce<_0x14f3b3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x231461['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':_0x231461['to']('usersCount',_0x44e79f=>'+'+(_0x44e79f-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x405b4a{['items'];['keystrokes'];constructor(_0x3bff22){super(_0x3bff22);const _0x2c8199=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x3351df(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x2c8199['if']('hasPopup'),'aria-expanded':_0x2c8199['to']('isExpanded',_0x195458=>this['hasPopup']&&String(_0x195458)),'aria-label':_0x2c8199['to']('hasPopup',_0x331c19=>N(_0x3bff22,_0x331c19?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x2c8199['to']('hasPopup',_0x24dc08=>!!_0x24dc08&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x2c8199['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x2c8199['to'](_0x746a7e=>{const _0x11fc7b=_0x746a7e,_0x45d835=document['querySelector']('.ck-presence-list__dropdown-list'),_0x18e21f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x45d835?.['contains'](_0x11fc7b['relatedTarget'])||_0x18e21f?.['contains'](_0x11fc7b['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2412e0,_0x1fdf37,_0x5b7e2a)=>{this['element']&&(_0x5b7e2a?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 Z extends _0x405b4a{['counterView'];['inlineListView'];constructor(_0x2c07b2,_0x416fbb=0x6){super(_0x2c07b2);const _0xb4175c=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new tt(this['locale'],_0x416fbb),this['inlineListView']=new ts(_0x2c07b2),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x50f131 of this['inlineListView']['items'])_0x50f131['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',_0xb4175c['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class st extends _0x405b4a{['listWrapperView'];constructor(_0x397726,_0x25841c){super(_0x397726);const _0x722851=this['bindTemplate'];this['listWrapperView']=new _t(_0x397726,_0x25841c),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':N(_0x397726,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x722851['to'](_0x57ce5c=>{const _0x4ae5d5=_0x57ce5c,_0x380229=document['querySelector']('.ck-presence-list__list'),_0x380bc2=document['querySelector']('.ck-balloon-panel_with-arrow');_0x380229?.['contains'](_0x4ae5d5['relatedTarget'])||_0x380bc2?.['contains'](_0x4ae5d5['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class _t extends _0x2d3481{constructor(_0x174f08,_0xc314e6){super(_0x174f08);const _0x4ae9c5=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xc314e6?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x4ae9c5['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x4ae9c5['to']('role'),'aria-label':_0x4ae9c5['to']('ariaLabel'),'aria-labelledby':_0x4ae9c5['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xf146c8['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xa79aab=this['element'];_0xa79aab&&(this['_isScrollable']=Math['max'](_0xa79aab['scrollHeight'],_0xa79aab['clientHeight'])>0.8*window['innerHeight']);}}class it extends lt{['userView'];constructor(_0x3a8096,_0xab8de4,_0x13e4c6){super(_0x3a8096);const _0x4b4bf0=this['bindTemplate'];this['userView']=new ut(_0x3a8096,_0xab8de4);const _0x16dab7={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0xab8de4['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0xab8de4['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xab8de4['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x13e4c6&&(_0x16dab7['tag']='button',_0x16dab7['on']={'click':_0x4b4bf0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x16dab7);}['focus'](){this['element']['focus']();}}class et extends _0x405b4a{['userView'];['markerView'];constructor(_0x32f40c,_0x3b51eb,_0x40de70){super(_0x32f40c);const _0x261e97=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ut(_0x32f40c,_0x3b51eb),this['markerView']=new dt(_0x32f40c,_0x3b51eb);const _0x6d589c=new pt(_0x32f40c);_0x6d589c['template']['tag']='span',_0x6d589c['text']=_0x3b51eb['name'];const _0x39d02a={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x261e97['to']('isFocusable',_0x4f204e=>!!_0x4f204e&&0x0),'aria-labelledby':_0x6d589c['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x261e97['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x261e97['to']('hasTooltip',_0x5a09d1=>!_0x5a09d1),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x6d589c]};_0x40de70&&(_0x39d02a['tag']='button',_0x39d02a['on']={'click':_0x261e97['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x39d02a);}}class dt extends _0x405b4a{constructor(_0x3f8a3d,_0x2bb440){super(_0x3f8a3d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2bb440['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const rt={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x1390d5{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19d11e){super(_0x19d11e),this['context']['config']['define']('presenceList',rt);const _0x1ce20d=_0x19d11e['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1ce20d)throw new _0x404cce('presencelist-collapseat-invalid-format',this);if(_0x1ce20d<0x1)throw new _0x404cce('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x210266(),this['balloonPanelView']=new _0x500144(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x113943 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x113943);this['listenTo'](this['_allConnectedUsers'],'add',(_0x20a561,_0x19c22a)=>{this['_handleUserAdd'](_0x19c22a);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x515677,_0x348fc7)=>{this['_handleUserRemove'](_0x348fc7);});}['_createView'](){const _0xef3e94=this['context'],_0x2b763e=new Z(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x31be4f=this['balloonPanelView'];if(!_0x391704(_0xef3e94['config']['get']('presenceList.container')))throw new _0x404cce('presencelist-missing-container',this);return _0x2b763e['counterView']['bind']('usersCount')['to'](this),_0x2b763e['bind']('isCollapsed')['to'](this,'usersCount',_0x5c9443=>{const {collapseAt:_0x2cdd0a}=_0xef3e94['config']['get']('presenceList'),_0x52187b=_0x5c9443>=_0x2cdd0a;if(_0x52187b&&!_0x2b763e['inlineListView']['items']['find'](_0x1aef83=>_0x1aef83 instanceof tt)){const _0x5dd194=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5dd194&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x2b763e['inlineListView']['items']['add'](_0x2b763e['counterView']);}return _0x52187b||this['hideDropdown'](),_0x52187b;}),_0x2b763e['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x30a393=>{const _0x223e9e=_0xef3e94['config']['get']('presenceList'),_0x2ab251=new et(_0xef3e94['locale'],_0x30a393,!!_0x223e9e['onClick']);return _0x2ab251['bind']('hasTooltip')['to'](_0x2b763e,'isCollapsed',_0x3535e9=>!_0x3535e9),_0x2ab251['bind']('isFocusable')['to'](_0x2b763e,'isCollapsed',_0x5d192e=>!_0x5d192e),_0x223e9e['onClick']&&this['listenTo'](_0x2ab251,'execute',()=>{this['view']['isCollapsed']||_0x223e9e['onClick'](_0x30a393,_0x2ab251['element']);}),_0x2ab251;}),this['listenTo'](_0x2b763e['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x2b763e['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x2b763e['inlineListView']['keystrokes']['set']('Enter',(_0x12ee19,_0x2a63fc)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2a63fc());}),_0x2b763e['render'](),_0x31be4f['render'](),_0x1f5fe9({'emitter':_0x2b763e,'activator':()=>_0x31be4f['isVisible'],'contextElements':[_0x31be4f['element'],_0x2b763e['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0xef3e94['config']['get']('presenceList.container')['appendChild'](_0x2b763e['element']),this['_bodyCollection']=new _0xc6f326(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2b763e;}['_handleUserAdd'](_0x2e8122){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2e8122['isMe'])return;const _0x32514b=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x32514b-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x2c92b9=_0x2e8122['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2e8122,_0x2c92b9);}['_handleUserRemove'](_0xa8510){this['usersCount']--;const {collapseAt:_0x3a8084}=this['context']['config']['get']('presenceList'),_0x578929=this['usersCount']>=_0x3a8084;if(this['currentDisplayedUsers']['get'](_0xa8510['id']))this['currentDisplayedUsers']['remove'](_0xa8510['id']);else{if(_0x578929&&this['currentDisplayedUsers']['length']+0x1===_0x3a8084-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x578929?0x1:0x0)<this['usersCount']){for(const _0x180052 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x180052['id'])&&(this['currentDisplayedUsers']['add'](_0x180052,Math['min'](this['currentDisplayedUsers']['length']-(_0x578929?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x578929?0x1:0x0)===_0x3a8084-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x9f82e8=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new st(this['context']['locale'],!!_0x9f82e8['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x5d8b89}=this['presenceDropdownView'];_0x5d8b89['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4432e0=>{if(!_0x9f82e8['displayMe']&&_0x4432e0['isMe'])return null;const _0x3ffcbd=new it(this['context']['locale'],_0x4432e0,!!_0x9f82e8['onClick']);return _0x9f82e8['onClick']&&this['listenTo'](_0x3ffcbd,'execute',()=>{_0x9f82e8['onClick'](_0x4432e0,_0x3ffcbd['element']);}),_0x3ffcbd;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x5d8b89['focus'](),_0x5d8b89['checkIfScrollable']();const _0x5af20d=(_0x58586b,_0x439250)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x439250();};_0x5d8b89['keystrokes']['set']('Esc',_0x5af20d),_0x5d8b89['keystrokes']['set']('Shift+Tab',_0x5af20d),_0x5d8b89['keystrokes']['set']('Tab',(_0x3670e8,_0x34b20d)=>{!function(_0x132169){const _0x366368=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x322aeb=>_0x322aeb+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x4b7dfe=[...document['body']['querySelectorAll'](_0x366368)]['filter'](_0x5de05e=>_0x5de05e===document['activeElement']||_0x5de05e['offsetWidth']+_0x5de05e['offsetHeight']>0x0)['sort']((_0x104bfc,_0x298737)=>(_0x104bfc['tabIndex']||0x0)-(_0x298737['tabIndex']||0x0)),_0x3d3a5a=_0x4b7dfe['indexOf'](_0x132169),_0x527abb=_0x4b7dfe[(_0x3d3a5a+0x1)%_0x4b7dfe['length']];_0x527abb&&_0x527abb['focus']();}(this['view']['element']),this['hideDropdown'](),_0x34b20d();}),_0x5d8b89['focusTracker']['add'](this['view']['element']),_0x5d8b89['focusTracker']['on']('change:isFocused',(_0x5c9632,_0xe9b25c,_0x11d403)=>{_0x11d403||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x1390d5{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
|
23
|
+
import{ContextPlugin as _0x3acd16,Plugin as _0x4ebc6b,PendingActions as _0x7c6f4e,Context as tt}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0xcf1ad0,CKEditorError as _0x4f264b,Collection as _0x3e30dd,global as _0x5e86ee,version as ht,uid as _0x15f018,KeystrokeHandler as _0x369680}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x5d8170,View as _0x31b426,ListView as _0x3a4862,ListItemView as lt,LabelView as pt,BalloonPanelView as _0xa3d209,clickOutsideHandler as _0x4a73c8,BodyCollection as _0x56d6b8}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ft,History as _0x32cf5c,NoOperation as _0x453d23,InsertOperation as _0x3aad73,MarkerOperation as _0x9ddf97,RootAttributeOperation as _0x38526e,transformSets as _0x1a949d,OperationFactory as _0x5c9b84}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as mt,WEB_SOCKET_GATEWAY_STATES as _0x3a4dd9,CollaborativeEditingService as _0x374145,User as gt,CommentsService as et,TrackChangesService as at,RevisionHistoryService as rt,EditorService as it}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x438734,UserView as ut}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x24932a}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x280390}from'es-toolkit/compat';class c extends _0x3acd16{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>mt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x5d8170];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36c48d){super(_0x36c48d),this['set']('state',_0x3a4dd9['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0xcf1ad0);}['init'](){const _0x2588bd=this['context'],_0x1457cc=_0x2588bd['plugins']['get']('CloudServices'),_0x1b6466=_0x2588bd['plugins']['get'](_0x5d8170);if(!_0x1457cc['token'])throw new _0x4f264b('websocketgateway-missing-token',this);if(!_0x1457cc['webSocketUrl'])throw new _0x4f264b('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x1457cc['token'],_0x1457cc['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x640a76=>{if(this['connection']=_0x640a76,this['bind']('state')['to'](_0x640a76,'state',this,'_isBrowserOffline',(_0x1c845e,_0x56bb98)=>('connected'!==_0x1c845e&&(this['_shouldPluginsReconnect']=!0x0),_0x56bb98||_0x1c845e!==_0x3a4dd9['CONNECTED']?_0x3a4dd9['DISCONNECTED']:this['state']==_0x3a4dd9['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3a4dd9['CONNECTING']):_0x3a4dd9['CONNECTED'])),this['connection']['on']('error',(_0x500ae0,_0x1b2189)=>{if('limitExceeded'!==_0x1b2189['code'])throw console['error'](_0x1b2189),new _0x4f264b('cloudservices-init',null,{'originalError':_0x1b2189});_0x1b6466['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'});}),!_0x640a76['me'])return new Promise(_0x847f8c=>_0x640a76['on']('change:me',_0x847f8c));})['catch'](_0x573cfe=>{throw console['error'](_0x573cfe),new _0x4f264b('cloudservices-init',null,{'originalError':_0x573cfe});});}['addToReconnectionStack'](_0x4df052){if('function'!=typeof _0x4df052['reconnect'])throw new _0x4f264b('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4df052))throw new _0x4f264b('websocketgateway-plugin-already-registered',this,{'name':_0x4df052['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4df052);}['removeFromReconnectionStack'](_0x30f2f4){this['_reconnectionStack']['delete'](_0x30f2f4);}['isInReconnectionStack'](_0x1805a4){return this['_reconnectionStack']['has'](_0x1805a4);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x24e88d=>_0x24e88d['reconnect']())))['then'](()=>this['state']=_0x3a4dd9['CONNECTED'])['catch'](_0x481049=>{throw console['error'](_0x481049),new _0x4f264b('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3a4dd9['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x3acd16{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x438734];}constructor(_0x30984e){super(_0x30984e),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x3e30dd(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x438734);}['init'](){const _0x44020f=this['context']['plugins']['get'](c);this['listenTo'](_0x44020f,'change:state',(_0x3f2c95,_0x34559b,_0x2472c2)=>{if('connected'!==_0x2472c2)this['channelSessions']['forEach'](_0x4eeaf7=>_0x4eeaf7['clear']()),this['channelConnectedUsers']['forEach'](_0x2a0cba=>_0x2a0cba['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x1557ae,_0x47ee84]of this['_registeredSessions'])for(const _0x57b30e of _0x47ee84)this['_handleSessionAdd'](_0x1557ae,_0x57b30e);}}),this['_createUser'](_0x44020f['connection']['me'],!0x0);}['register'](_0x3256cc,_0x2f0334){if(this['_registeredSessions']['has'](_0x3256cc))throw new _0x4f264b('sessions-register-already-registered',null,{'channelId':_0x3256cc});this['_registeredSessions']['set'](_0x3256cc,_0x2f0334),this['channelSessions']['set'](_0x3256cc,new _0x3e30dd()),this['channelConnectedUsers']['set'](_0x3256cc,new _0x3e30dd()),this['listenTo'](_0x2f0334,'add',(_0x52e20a,_0x3f9c07)=>this['_handleSessionAdd'](_0x3256cc,_0x3f9c07)),this['listenTo'](_0x2f0334,'remove',(_0x230ae4,_0x13b1c6)=>this['_handleSessionRemove'](_0x3256cc,_0x13b1c6));for(const _0x234457 of _0x2f0334)this['_handleSessionAdd'](_0x3256cc,_0x234457);}['unregister'](_0x15720d){if(!this['_registeredSessions']['has'](_0x15720d))throw new _0x4f264b('sessions-unregister-not-exist',null,{'channelId':_0x15720d});const _0x7e66f4=this['_registeredSessions']['get'](_0x15720d);this['stopListening'](_0x7e66f4);for(const _0xb64032 of _0x7e66f4)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x15720d,_0xb64032);this['_registeredSessions']['delete'](_0x15720d),this['channelSessions']['delete'](_0x15720d),this['channelConnectedUsers']['delete'](_0x15720d);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x4ea700){for(const _0x1fca6a of this['channelSessions']['values']())for(const _0xa4c74f of _0x1fca6a)if(_0xa4c74f['id']===_0x4ea700)return _0xa4c74f['user'];}['getUserSessions'](_0x20ebf8,_0x59cbcf){const _0x11cb4b=_0x59cbcf?[this['channelSessions']['get'](_0x59cbcf)]:this['channelSessions']['values'](),_0x4f7e32=new Set();for(const _0xca701d of _0x11cb4b)for(const _0x2a0d96 of _0xca701d)_0x2a0d96['user']['id']===_0x20ebf8['id']&&_0x4f7e32['add'](_0x2a0d96['id']);return _0x4f7e32;}['getUserRole'](_0x3b498f){for(const _0x38bebc of this['channelSessions']['values']())for(const _0x2ee73c of _0x38bebc)if(_0x2ee73c['user']===_0x3b498f)return _0x2ee73c['role'];}['_handleSessionAdd'](_0x594a28,_0x200d9b){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x43f0c=_0x200d9b['user'],_0x216284=this['_users']['getUser'](_0x43f0c['id'])||this['_createUser'](_0x43f0c),_0x501d17=Object['assign']({},_0x200d9b,{'user':_0x216284});this['channelSessions']['get'](_0x594a28)['add'](_0x501d17);const _0x1c814c=this['channelConnectedUsers']['get'](_0x594a28);_0x1c814c['has'](_0x216284['id'])||_0x1c814c['add'](_0x216284),this['allConnectedUsers']['has'](_0x216284['id'])||this['allConnectedUsers']['add'](_0x216284,_0x216284['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x594a28,{'channelId':_0x594a28,'session':_0x501d17});}['_handleSessionRemove'](_0xce2448,_0x531203){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x3b5661=this['channelConnectedUsers']['get'](_0xce2448),_0x2aff36=_0x531203['user'];_0x2aff36['id']&&(this['channelSessions']['get'](_0xce2448)['remove'](_0x531203['id']),_0x3b5661['has'](_0x2aff36['id'])&&!this['getUserSessions'](_0x2aff36,_0xce2448)['size']&&_0x3b5661['remove'](_0x2aff36['id']),this['allConnectedUsers']['get'](_0x2aff36['id'])&&!this['getUserSessions'](_0x2aff36)['size']&&this['allConnectedUsers']['remove'](_0x2aff36['id']));}['_createUser'](_0x38a876,_0x2f5c79){const _0xb161ee=this['_users']['addUser'](_0x38a876);return _0x2f5c79&&this['_users']['defineMe'](_0x38a876['id']),_0xb161ee['orderNumber']=this['_uniqueUsersCount']++,_0xb161ee;}}class B extends _0x4ebc6b{['_domEmitter']=new(_0xcf1ad0())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xdb6c77=this['editor'],_0x2b792d=_0xdb6c77['plugins']['get'](i);_0xdb6c77['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x16c009,{writer:_0x2a0dfb})=>function(_0x58d6f3,_0x423d42,_0x127763,_0x476fcb){const _0x476af9=_0x58d6f3['markerName']['split'](':')[0x2],_0x174ee2=_0x127763['getUserBySessionId'](_0x476af9);if(!_0x174ee2||_0x476af9===_0x127763['mySessionId'])return;if(!_0x476fcb['model']['schema']['checkChild'](_0x58d6f3['markerRange']['start'],'$text'))return;const _0x417547={'class':'ck-user__marker\x20'+_0x174ee2['color']['getMarkerClass'](),'data-name':_0x174ee2['name'],'data-session-id':_0x476af9},_0x3b840d=_0x476fcb['model']['markers']['get'](_0x58d6f3['markerName']),_0x2e2608=_0x3b840d['getStart'](),_0x1a4d3f=_0x2e2608['nodeAfter'],_0xdb0884=_0x476fcb['model']['schema'];if(_0x1a4d3f&&_0xdb0884['isObject'](_0x1a4d3f)&&_0xdb0884['isInline'](_0x1a4d3f)&&!_0x476fcb['model']['markers']['get']('user:range:'+_0x476af9)['getRange']()['isCollapsed'])return;const _0x124424=_0x2e2608['parent'];return _0x476fcb['model']['schema']['isLimit'](_0x124424)&&!_0x476fcb['model']['hasContent'](_0x124424)&&(_0x417547['contenteditable']=!0x1),function(_0x5b4583,_0x4aeabb,_0x11ca73){const _0x4eae9d=_0x5b4583['createUIElement']('span',_0x4aeabb);return _0x5b4583['setCustomProperty']('userPositionMarker',!0x0,_0x4eae9d),_0x4eae9d['render']=function(_0x2a4763){const _0x3a14ca=this['toDomElement'](_0x2a4763),_0x4acbfc=document['createElement']('span');return _0x4acbfc['classList']['add']('ck-user__marker-tooltip'),_0x4acbfc['setAttribute']('contenteditable','false'),_0x4acbfc['setAttribute']('spellcheck','false'),_0x4acbfc['textContent']=_0x11ca73['name'],_0x3a14ca['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x4acbfc['outerHTML']+'',_0x3a14ca['addEventListener']('mouseenter',()=>{_0x3a14ca['classList']['add']('ck-user__marker_hovered');}),_0x3a14ca['addEventListener']('mouseleave',()=>{_0x3a14ca['classList']['remove']('ck-user__marker_hovered');}),_0x3a14ca;},_0x4eae9d['isSimilar']=function(_0x4c2d51){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4c2d51['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4c2d51['getAttribute']('data-session-id'));},_0x4eae9d;}(_0x423d42,_0x417547,_0x174ee2);}(_0x16c009,_0x2a0dfb,_0x2b792d,_0xdb6c77)}),_0xdb6c77['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4a788b=>function(_0x39980b,_0x147c8c){const _0x1a715f=_0x39980b['markerName']['split'](':')[0x2];if(_0x1a715f===_0x147c8c['mySessionId'])return null;const _0x26215d=_0x147c8c['getUserBySessionId'](_0x1a715f);if(!_0x26215d)return{'id':_0x1a715f,'classes':[]};return{'id':_0x1a715f,'classes':['ck-user__selection',_0x26215d['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x1a715f},'priority':0x7d0+_0x26215d['orderNumber']};}(_0x4a788b,_0x2b792d)}),function(_0x561e59){const _0x445170=_0x561e59['model'],_0x5a7f60=new Map(),_0x4f7b8b=_0x561e59['plugins']['get'](i);_0x445170['markers']['on']('update:user:range',(_0x585e17,_0x76a548,_0x24e8cf,_0x5db201)=>{if(!_0x5db201&&_0x5a7f60['get'](_0x76a548['name']))return _0x5a7f60['get'](_0x76a548['name'])['detach'](),void _0x5a7f60['delete'](_0x76a548['name']);const _0x1dea08=_0x76a548['name']['split'](':')[0x2];if(_0x1dea08===_0x4f7b8b['mySessionId'])return;const _0x48ddf0='user:position:'+_0x1dea08;_0x445170['markers']['has'](_0x48ddf0)&&_0x561e59['editing']['reconvertMarker'](_0x48ddf0),_0x76a548['on']('change:range',(_0x3e8651,_0x23d605,_0x151b41)=>{if('$graveyard'!=_0x23d605['root']['rootName']&&'$graveyard'==_0x76a548['getRange']()['root']['rootName']&&!_0x5a7f60['has'](_0x76a548['name'])){const _0x3f82b0=_0x445170['schema']['getNearestSelectionRange'](_0x151b41['deletionPosition']);if(_0x3f82b0){const _0x3674f1=ft['fromRange'](_0x3f82b0);_0x5a7f60['set'](_0x76a548['name'],_0x3674f1),_0x3674f1['on']('change:range',(_0xa52117,_0x319ce6,_0x4b2649)=>{if('$graveyard'==_0x3674f1['root']['rootName']){const _0x46ba8f=_0x445170['schema']['getNearestSelectionRange'](_0x4b2649['deletionPosition']);_0x46ba8f?(_0x3674f1['start']=_0x46ba8f['start'],_0x3674f1['end']=_0x46ba8f['end']):(_0x5a7f60['delete'](_0x76a548['name']),_0x3674f1['detach']());}});}}});}),_0x445170['document']['on']('change',()=>{_0x5a7f60['size']>0x0&&_0x445170['enqueueChange']({'isUndoable':!0x1},_0x4dd222=>{for(const [_0x444f50,_0x36e6d6]of _0x5a7f60)'$graveyard'==_0x445170['markers']['get'](_0x444f50)['getRange']()['root']['rootName']&&(X(_0x444f50['split'](':')[0x2],_0x36e6d6['toRange'](),_0x445170,_0x4dd222),_0x36e6d6['detach']());_0x5a7f60['clear']();});});}(_0xdb6c77),this['_domEmitter']['listenTo'](_0x5e86ee['document'],'keydown',(_0x3b9056,{key:_0x33aef7})=>{'Escape'===_0x33aef7&&function(_0x5f0ca6){_0x5f0ca6['editing']['view']['change'](_0x3d9c34=>{for(const _0x34b1df of _0x5f0ca6['model']['markers']){if(!_0x34b1df['name']['startsWith']('user:position'))continue;const _0x204662=_0x5f0ca6['editing']['mapper']['markerNameToElements'](_0x34b1df['name']);if(_0x204662){for(const _0x2200ad of _0x204662)_0x3d9c34['removeClass']('ck-user__marker_hovered',_0x2200ad);}}});}(_0xdb6c77);},{'useCapture':!0x0});}['afterInit'](){const _0x598735=this['editor'],_0x50ef65=_0x598735['commands']['get']('undo');_0x50ef65&&_0x598735['model']['on']('applyOperation',(_0x20889a,_0xa0acb5)=>{const _0x44d524=_0xa0acb5[0x0];if(!_0x44d524['isDocumentOperation'])return;if('marker'!=_0x44d524['type']||!_0x44d524['name']['startsWith']('user:'))return;const _0x11cb4d=_0x44d524['batch'];_0x50ef65['_createdBatches']['has'](_0x11cb4d)&&(_0x44d524['newRange']=_0x44d524['oldRange']?_0x598735['model']['createRange'](_0x44d524['oldRange']['start'],_0x44d524['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x105798=this['editor'],_0x2b8c14=_0x105798['model']['document'],_0x2e8368=_0x105798['plugins']['get'](i);_0x105798['model']['enqueueChange']({'isUndoable':!0x1},_0x274fde=>{const _0x13b856='user:range:'+_0x2e8368['mySessionId'],_0x15f33b='user:position:'+_0x2e8368['mySessionId'],_0x4ee72d=_0x105798['model']['markers']['has'](_0x13b856);_0x105798['editing']['view']['hasDomSelection']?X(_0x2e8368['mySessionId'],_0x2b8c14['selection']['getFirstRange'](),_0x105798['model'],_0x274fde):_0x4ee72d&&(_0x274fde['removeMarker'](_0x13b856),_0x274fde['removeMarker'](_0x15f33b));});}}function X(_0x16b299,_0x416688,_0x134fce,_0x35e889){const _0x5a50e7='user:range:'+_0x16b299,_0x13eef9='user:position:'+_0x16b299,_0x3d0f4c=_0x416688['getContainedElement']();let _0x3ba932=_0x416688['start'];if(_0x3d0f4c&&_0x3d0f4c['is']('element','tableCell')){const _0x482c2e=function(_0x1c3494,_0x4ffe67){for(const _0x30c2fb of _0x1c3494['getPositions']())if(_0x4ffe67['schema']['checkChild'](_0x30c2fb,'$text'))return _0x30c2fb;}(_0x416688,_0x134fce);_0x482c2e&&(_0x3ba932=_0x482c2e,_0x416688=_0x35e889['createRange'](_0x3ba932));}const _0x32ee2c=_0x35e889['createRange'](_0x3ba932);_0x134fce['markers']['has'](_0x5a50e7)?(_0x35e889['updateMarker'](_0x5a50e7,{'range':_0x416688}),_0x35e889['updateMarker'](_0x13eef9,{'range':_0x32ee2c})):(_0x35e889['addMarker'](_0x5a50e7,{'range':_0x416688,'usingOperation':!0x0}),_0x35e889['addMarker'](_0x13eef9,{'range':_0x32ee2c,'usingOperation':!0x0}));}function M(_0xb3660d,_0x582caa,_0x3b8606){const _0x1d03f9=_0xb3660d['t'],t=_0xb3660d['t'];switch(_0x582caa){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 _0x1d03f9({'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'},_0x3b8606);default:return'';}}let F=0x1;class l extends _0x4ebc6b{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x374145)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,B,_0x7c6f4e,_0x438734,_0x5d8170];}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 _0x1473a5=this['serverHistory']['getOperations']();for(let _0x34dbde=_0x1473a5['length']-0x1;_0x34dbde>=0x0;_0x34dbde--){const _0x326144=_0x1473a5[_0x34dbde];if(!this['_disconnectionOperations']['has'](_0x326144))return _0x326144['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x43feb2){if(super(_0x43feb2),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x32cf5c(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x4f264b('collaboration-missing-channelid',this);const _0x195661=_0x43feb2['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x195661,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x24932a(),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 $(this['_disconnectionOperations']);}['init'](){const _0xa74303=this['editor'],_0xcbb83a=_0xa74303['plugins']['get'](_0x438734),_0x1a257a=_0xa74303['plugins']['get'](c);this['listenTo'](_0xcbb83a,'getOperationAuthor',(_0x6dc4fe,_0x4d8c71)=>{const _0x4b3526=_0x4d8c71[0x0];_0x4b3526['_authorId']&&(_0x6dc4fe['return']=_0xcbb83a['getUser'](_0x4b3526['_authorId']),_0x6dc4fe['stop']()),null===_0x4b3526['_authorId']&&(_0x6dc4fe['return']=null,_0x6dc4fe['stop']());},{'priority':'high'}),this['listenTo'](_0xa74303['model']['document']['selection'],'change:range',(_0xcf2652,_0x149c06)=>{_0x149c06['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xa74303['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xa74303['model']['on']('applyOperation',(_0x22df99,_0x1582f9)=>{const _0x4842dc=_0x1582f9[0x0];_0x4842dc['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4842dc),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x1a257a,'state',this,'_hasSynchronizationProblem',(_0x2e4ce5,_0x459982)=>'connected'===_0x2e4ce5&&!_0x459982),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xa74303['disableReadOnlyMode']('rtc-offline'):_0xa74303['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xa74303['disableReadOnlyMode']('rtc-offline'):_0xa74303['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xca43ca=this['editor']['plugins']['get'](i),_0x4ede8f=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0xca43ca['unregister'](this['_channelId']);const _0x4a381b=await this['_service']['reconnect'](_0x4ede8f['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4a381b)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x239799=await this['_service']['getConnectedSessions']();_0xca43ca['register'](this['_channelId'],_0x239799),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x286419){if(function(_0x432799){return'404'===_0x432799['code'];}(_0x286419)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x2f7091){return'409'===_0x2f7091['code'];}(_0x286419)){const _0x374a25=M(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'](_0x374a25);}else{if(!(_0x286419 instanceof q))throw _0x286419;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2136cb=this['editor']['plugins']['get'](c),_0x4313cb=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4313cb['channelSessions']['has'](this['_channelId'])&&_0x4313cb['unregister'](this['_channelId']),_0x2136cb['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x5ca87c){if(this['sessionId']!==_0x5ca87c['sessionId']&&this['_lastSyncedOperationId']!==_0x5ca87c['lastOperationId'])throw new q();return this['sessionId']=_0x5ca87c['sessionId'],this['_handleServerResponse']([],{..._0x5ca87c,'wereChangesApplied':!0x1,'data':_0x5ca87c['data']},'reconnect');}async['_connectService'](_0x4f73f1,_0x4ff0b8=!0x1){const {connection:_0x427fc6}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x427fc6,this['_channelId'])['then'](_0x44659e=>this['_initSessionsHandling'](_0x44659e))['catch'](_0x49787f=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x49787f);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3c50d4,_0x143447)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x143447);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3627fc=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4f73f1);this['_isPendingUpdate']=!0x0;const _0x2d3771=await this['_service']['connect'](_0x427fc6,this['_compressOperations'](_0x4f73f1),_0x3627fc);if(this['sessionId']=_0x2d3771['sessionId'],_0x4ff0b8){if(!_0x2d3771['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x2d3771['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4f73f1,_0x2d3771,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x2d3771,_0x4f73f1);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x151a37=this['editor']['plugins']['get'](i),_0x2818c8=this['editor']['plugins']['get'](B),_0x13b519=_0x151a37['channelSessions']['get'](this['_channelId']);_0x13b519&&_0x13b519['length']>0x1?_0x2818c8['createUserMarkerOperations']():this['listenTo'](_0x151a37,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x151a37['channelSessions']['get'](this['_channelId'])['length']&&_0x2818c8['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x19f740,_0x2f355c,_0x4e6784,_0x5babb5){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2f355c){const _0xd4ad3f=this['_decompressOperations'](_0x4e6784,_0x5babb5);await this['_fetchMissingUsers'](_0xd4ad3f),this['_handleExternalOperations'](_0xd4ad3f,_0x2f355c,_0x4e6784['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x358422}=this['editor'];let _0x366341;try{_0x366341=await this['_service']['getDocumentDetails']();}catch{const _0x5a5260=M(_0x358422,'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'](_0x5a5260);}const _0x2c14cb=_0x366341['currentDocumentSession']||_0x366341['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x2c14cb['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x59b03f=M(_0x358422,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x59b03f);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x261b17){const _0x23b633=this['editor']['plugins']['get'](i);this['listenTo'](_0x23b633,'sessionAdd:'+this['_channelId'],(_0xcd56fd,{session:_0xecc1f5})=>{if(_0xecc1f5['id']===_0x23b633['mySessionId']){_0xcd56fd['off']();const _0x1a7287=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x11c6b2=_0xecc1f5['permissions'];_0x1a7287&&_0x1a7287['isEnabled']&&(_0x11c6b2=_0x11c6b2['filter'](_0x5a1616=>'document:write'!==_0x5a1616)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x11c6b2,this['_channelId']);}}),_0x23b633['register'](this['_channelId'],_0x261b17);}['_initThrowingOnDataSet'](){const _0x3b6263=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x517a96)=>{if(!_0x517a96[_0x517a96['length']-0x1]['suppressErrorInCollaboration'])throw new _0x4f264b('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3b6263['apply'](this['editor']['data'],_0x517a96);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x5b13f7,[_0x5b9ca0])=>{if(this['_document']['version'])throw new _0x4f264b('realtimecollaborationclient-init-document-already-initialized',this);_0x5b13f7['stop'](),this['_setPendingAction']();const _0x114d6a=this['editor']['config']['get']('rootsAttributes'),_0x3c5e08=this['_getOperationsFromInitData'](_0x5b9ca0,_0x114d6a);0x0==_0x3c5e08['length']&&_0x3c5e08['push'](new _0x453d23(0x0)),_0x5b13f7['return']=this['_connectService'](_0x3c5e08)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x108b6a=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x108b6a))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x190eae,[_0x23a58a,_0x24dfdc])=>{_0x190eae['stop']();const _0x518584=this['editor']['model']['document']['getRoot'](_0x23a58a);if(!this['_knownRootNames']['has'](_0x23a58a)){const _0x268ffe=_0x24dfdc&&_0x24dfdc['data']?_0x24dfdc['data']:'',_0xf14b41=_0x24dfdc&&_0x24dfdc['attributes']?_0x24dfdc['attributes']:{};await this['_loadRoot'](_0x23a58a,_0x268ffe,_0xf14b41);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x518584['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x518584);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x352422){const _0x3b8737=this['editor']['plugins']['get'](_0x438734),{connection:_0x3b6a4e}=this['editor']['plugins']['get'](c),_0x382113=new Set();for(const _0x1b3e88 of _0x352422){const _0x4da334=_0x1b3e88['_authorId'];_0x4da334&&!_0x3b8737['getUser'](_0x4da334)&&_0x382113['add'](_0x4da334);}if(0x0===_0x382113['size'])return;const _0x545a93=await gt['getMany'](_0x3b6a4e,Array['from'](_0x382113));for(const _0x4a690d of _0x545a93)_0x3b8737['getUser'](_0x4a690d['id'])||_0x3b8737['addUser'](_0x4a690d);}['_getOperationsFromInitData'](_0x2845a5,_0xad6ebe={}){const _0x51259f=this['editor']['model'],_0x3fd7af=[];let _0xedd89a=0x0;const _0x2a7b2f='string'==typeof _0x2845a5?{'main':_0x2845a5}:_0x2845a5;for(const _0x3ebffa of Object['keys'](_0x2a7b2f)){if(!this['_document']['roots']['has'](_0x3ebffa))throw new _0x4f264b('realtimecollaborationclient-init-non-existent-root',this);const _0x2a6a21=this['editor']['data']['parse'](_0x2a7b2f[_0x3ebffa]),_0x34d480=this['_document']['getRoot'](_0x3ebffa),_0x2b6f77=new _0x3aad73(_0x51259f['createPositionAt'](_0x34d480,0x0),_0x2a6a21,_0xedd89a++);_0x3fd7af['push'](_0x2b6f77);for(const [_0x139e77,_0x1c7a1a]of _0x2a6a21['markers']){const _0x32eca3=_0x51259f['createRange'](_0x51259f['createPositionFromPath'](_0x34d480,_0x1c7a1a['start']['path']['slice']()),_0x51259f['createPositionFromPath'](_0x34d480,_0x1c7a1a['end']['path']['slice']())),_0x1eb8ce=new _0x9ddf97(_0x139e77,null,_0x32eca3,_0x51259f['markers'],!0x0,_0xedd89a++);_0x3fd7af['push'](_0x1eb8ce);}}if(_0xad6ebe)for(const [_0x589b1c,_0x41ace1]of Object['entries'](_0xad6ebe)){const _0x5bab99=_0x51259f['document']['getRoot'](_0x589b1c);if(!_0x5bab99)throw new _0x4f264b('multi-root-editor-root-attributes-no-root',null);for(const [_0x2e21b8,_0x5db563]of Object['entries'](_0x41ace1))if(null!==_0x5db563){const _0x151b5e=new _0x38526e(_0x5bab99,_0x2e21b8,null,_0x5db563,_0xedd89a++);_0x3fd7af['push'](_0x151b5e);}}return _0x3fd7af;}async['_loadRoot'](_0xa02ed0,_0x47becb,_0x29a6ab){this['_getOperationsFromInitData']({[_0xa02ed0]:_0x47becb},{[_0xa02ed0]:_0x29a6ab})['forEach']((_0x335a14,_0x367359)=>{_0x335a14['baseVersion']=this['_document']['version']+_0x367359,_0x335a14['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x335a14);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x2e5e00,_0x41f8ca){let _0x4ac3c2;this['_offset']=_0x2e5e00['offset'];const _0xb450cc=_0x2e5e00['wereChangesApplied']&&!_0x2e5e00['initData'],_0x356652=_0xb450cc?0x0:_0x2e5e00['data']['baseVersion'];if(_0x41f8ca['forEach'](_0xe00d2f=>{_0xe00d2f['_isInit']=!0x0,_0xe00d2f['createdAt']=_0x2e5e00['sessionCreatedAt'],_0xe00d2f['_authorId']=null;}),_0xb450cc)_0x4ac3c2=_0x41f8ca,this['_applyOperationsSet'](_0x4ac3c2,_0xb450cc);else{if(_0x2e5e00['initData']){const _0x521b18=this['_getOperationsFromInitData'](_0x2e5e00['initData']);this['_document']['history']['version']=-_0x521b18['length'],_0x521b18['forEach'](_0xbfec72=>{_0xbfec72['baseVersion']-=_0x521b18['length'],_0xbfec72['createdAt']=_0x2e5e00['sessionCreatedAt'],_0xbfec72['_isInit']=!0x0,_0xbfec72['_authorId']=null;}),this['_applyOperationsSet'](_0x521b18,!0x0),this['serverHistory']['version']=-_0x521b18['length']+this['_offset'],this['_updateServerHistory'](_0x521b18);}this['_document']['history']['version']=_0x356652,_0x4ac3c2=this['_decompressOperations'](_0x2e5e00['data'],_0x2e5e00['metadata']),await this['_fetchMissingUsers'](_0x4ac3c2),this['_applyOperationsSet'](_0x4ac3c2,_0xb450cc);}_0x2e5e00['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4ac3c2,_0x2e5e00['lastOperationId']),this['_lastSyncedOperationId']=_0x2e5e00['lastOperationId']),this['serverHistory']['version']=_0x356652+this['_offset'],this['_updateServerHistory'](_0x4ac3c2),_0x41f8ca['filter'](_0xb8a932=>{const _0x25d861=this['_getAffectedRoot'](_0xb8a932);return _0x25d861&&!this['_knownRootNames']['has'](_0x25d861);})['forEach']((_0x2ca5d8,_0x253784)=>{_0x2ca5d8['baseVersion']=this['_document']['version']+_0x253784,this['_saveOperationInBuffer'](_0x2ca5d8);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x143b19,_0x361099){const _0x5ac8da=_0x361099&&_0x361099['message'];if(_0x5ac8da&&_0x5ac8da['startsWith']('realtimecollaborationclient'))throw _0x361099;const _0x2b428d=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x2b428d['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x4f264b(_0x143b19,this['editor'],_0x5ac8da?{'originalError':_0x5ac8da}:void 0x0);}['_saveOperationInBuffer'](_0x2aa834){this['_knownOperations']['has'](_0x2aa834)||(this['_knownOperations']['add'](_0x2aa834),this['_bufferedOperations']['push'](_0x2aa834),this['_pendingAction']||'marker'==_0x2aa834['type']&&!_0x2aa834['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x9c0240=!0x1){!_0x9c0240&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x416b2f=>{_0x416b2f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x1e3697=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x4b73be){return _0x4b73be['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4b73be['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x4b73be['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x1e3697)||this['_crash'](_0x1e3697['message'],_0x1e3697);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x251214=>{this['on']('change:_isPendingUpdate',()=>{_0x251214();});});}async['_sendBufferedOperations'](){const _0x3c6998=this['editor']['plugins']['get'](B);if(this['_shouldSendSelectionUpdate']()&&(_0x3c6998['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x924977=[...this['_bufferedOperations']];for(const _0x506bfe of _0x924977)_0x506bfe['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x506bfe);const _0x4b567c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x924977),_0x4cce91=F++,_0x48932e=this['_compressOperations'](_0x924977),_0x3e32de=await this['_service']['sendOperations'](_0x48932e,_0x48932e['baseVersion'],_0x4b567c);try{return await this['_handleServerResponse'](_0x924977,_0x3e32de,_0x4cce91);}catch(_0x554474){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x554474);}}async['_handleServerResponse'](_0x437d04,_0x2e0db7,_0x540c05){if('error'in _0x2e0db7)throw _0x2e0db7['error'];let _0x542d87=!0x1;if(_0x2e0db7['wereChangesApplied']){_0x2e0db7['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2e0db7['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1fc51e=>!_0x437d04['includes'](_0x1fc51e));for(const _0x2437b8 of _0x437d04)_0x2437b8['createdAt']='lastOperationAcceptedAt'in _0x2e0db7&&_0x2e0db7['lastOperationAcceptedAt']||void 0x0;G(_0x437d04,_0x2e0db7['version']-_0x437d04['length']),this['_updateServerHistory'](_0x437d04);const _0xa9b2c0=_0x437d04['filter'](_0x3fc8ae=>{if(!_0x3fc8ae['_isInit'])return!0x1;const _0x23b6e3=this['_getAffectedRoot'](_0x3fc8ae);return _0x23b6e3&&!this['_knownRootNames']['has'](_0x23b6e3);});G(_0xa9b2c0,this['_document']['version']),this['_applyOperationsSet'](_0xa9b2c0),_0x542d87=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x20c94a=this['_decompressOperations'](_0x2e0db7['data'],_0x2e0db7['metadata'])['filter'](_0x303fa1=>_0x303fa1['baseVersion']>=this['_lastServerVersion']);_0x20c94a['forEach'](_0xf14885=>this['_addKnownRoot'](_0xf14885)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xb5aece=>!_0xb5aece['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xb5aece))),this['_bufferedOperations']['length']&&G(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x20c94a),_0x542d87=this['_handleExternalOperations'](_0x20c94a,_0x2e0db7['version'],_0x2e0db7['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x542d87?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5487d7,_0x514bfc,_0xc87b8b){try{const _0x4dfb60={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1cc027,operationsB:_0x2b16b6,originalOperations:_0x5a8e70}=_0x1a949d(_0x5487d7,this['_bufferedOperations'],_0x4dfb60);G(_0x1cc027,this['_document']['version']),G(_0x2b16b6,_0x514bfc);for(const _0x4c68a0 of _0x1cc027){const _0x4ad4c6=_0x5a8e70['get'](_0x4c68a0);_0x4c68a0['_authorId']=_0x4ad4c6?_0x4ad4c6['_authorId']:null;}_0xc87b8b&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5487d7,_0xc87b8b),this['_lastSyncedOperationId']=_0xc87b8b),this['_bufferedOperations']=[..._0x2b16b6],this['_applyOperationsSet'](_0x1cc027),this['_updateServerHistory'](_0x5487d7);}catch(_0x1e3e53){return console['error'](_0x1e3e53),!0x1;}return!0x0;}['_applyOperationsSet'](_0xa1d3cc,_0x493baa=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x126333=>{for(const _0x1eaeea of _0xa1d3cc)this['_knownOperations']['add'](_0x1eaeea),this['_addKnownRoot'](_0x1eaeea),_0x126333['batch']['addOperation'](_0x1eaeea),this['editor']['model']['applyOperation'](_0x1eaeea);});}['_addKnownRoot'](_0x5dd8b2){const _0x3f5b4b=this['_getAffectedRoot'](_0x5dd8b2);_0x3f5b4b&&this['_knownRootNames']['add'](_0x3f5b4b);}['_getAffectedRoot'](_0x1f55e0){let _0x1579a7,_0x21f80d;switch(_0x1f55e0['type']){case'insert':_0x1579a7=_0x1f55e0['position']['root'];break;case'marker':if(_0x21f80d=_0x1f55e0['newRange'],!_0x21f80d)return null;_0x1579a7=_0x21f80d['root'];break;case'addRootAttribute':_0x1579a7=_0x1f55e0['root'];break;case'addRoot':_0x1579a7=_0x1f55e0['affectedSelectable'];break;case'move':_0x1579a7=_0x1f55e0['targetPosition']['root'];break;default:return null;}return _0x1579a7['rootName'];}['_updateServerHistory'](_0x58826a){_0x58826a['forEach'](_0x372535=>{const _0x43a50b=_0x372535['clone']();_0x43a50b['_authorId']=_0x372535['_authorId'],_0x43a50b['_isInit']=!!_0x372535['_isInit'],_0x43a50b['createdAt']=_0x372535['createdAt'],_0x43a50b['baseVersion']+=this['_offset'],_0x372535['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x43a50b),this['serverHistory']['addOperation'](_0x43a50b);});}['_handleReconnectionError'](_0xb5a815){const _0x1c7c13=this['editor']['plugins']['get']('Notification'),_0x14af0d=this['editor']['locale'];_0xb5a815||(_0xb5a815=M(_0x14af0d,'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.')),_0x1c7c13['showWarning'](_0xb5a815,{'title':M(_0x14af0d,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x7c6f4e)['add'](M(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x7c6f4e)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x230f17){const _0x44022d=_0x230f17['map'](_0x159a84=>_0x159a84['toJSON']());return this['_compressor']['compress'](_0x44022d);}['_decompressOperations'](_0x169e09,_0x1f8a52){return this['_compressor']['decompress'](_0x169e09)['map']((_0xaf3acb,_0x2adf53)=>{const _0x1298cd='init'==_0x1f8a52[_0x2adf53]['type'];if('InsertOperation'==_0xaf3acb['__className']){const _0xc27f0=_0xaf3acb['position']['root'];!this['_document']['getRoot'](_0xc27f0)&&(this['_document']['createRoot']('$root',_0xc27f0)['_isAttached']=!0x1);}const _0x186665=_0x5c9b84['fromJSON'](_0xaf3acb,this['_document']);return _0x186665['wasUndone']=_0xaf3acb['wasUndone'],_0x186665['_isInit']=_0x1298cd,_0x186665['_authorId']=_0x1298cd?null:_0x1f8a52[_0x2adf53]['userId'],_0x186665['_isDisconnection']='cs:removeUser'===_0x1f8a52[_0x2adf53]['type'],_0x186665['createdAt']=_0x1f8a52[_0x2adf53]['createdAt'],_0x186665;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2d0d3e=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2d0d3e&&_0x2d0d3e['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class q extends Error{}function G(_0x2c1944,_0x2a7e8f){for(const _0x4a829b of _0x2c1944)_0x4a829b['baseVersion']=_0x2a7e8f++;}class ${['_ignoredOperations'];['_operationToId'];constructor(_0x575b4b){this['_ignoredOperations']=_0x575b4b,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xda7857){let _0x199448=_0xda7857['length'];for(;_0x199448--;){const _0x5bca6a=_0xda7857[_0x199448];if(!this['_ignoredOperations']['has'](_0x5bca6a)){if(!this['_operationToId']['has'](_0x5bca6a)){const _0x3079af=_0x15f018()['slice'](0x1,0x12);this['_operationToId']['set'](_0x5bca6a,_0x3079af);}return this['_operationToId']['get'](_0x5bca6a);}}}['setIdForTheLastOperation'](_0x358550,_0x4d1a3a){if(!_0x4d1a3a)return;let _0x11e414=_0x358550['length'];for(;_0x11e414--;){const _0x442d61=_0x358550[_0x11e414];this['_ignoredOperations']['has'](_0x442d61)||this['_operationToId']['set'](_0x442d61,_0x4d1a3a);}}}class n extends _0x4ebc6b{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x3acd16{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>et)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x438734];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x31590f){super(_0x31590f),this['_services']=new Map();}async['init'](){const _0x5e23b8=this['context'],_0x715618=_0x5e23b8['plugins']['get']('CommentsRepository');if(_0x5e23b8['plugins']['get'](c)['addToReconnectionStack'](this),_0x715618['adapter']={'addCommentThread':async({channelId:_0x37ec3a,threadId:_0x17d27c,comments:_0x59e8d2,resolvedAt:_0x6657b5,resolvedBy:_0x1dfc04,context:_0x233254,attributes:_0x15a39f})=>{const _0xd307f7=await this['_getService'](_0x37ec3a)['addCommentThread']({'commentThreadId':_0x17d27c,'comments':_0x59e8d2['map'](_0x1778a0=>function(_0x44a4b4,_0x588576,_0x3713d9){return{'commentThreadId':_0x3713d9,'commentId':_0x44a4b4['commentId'],'userId':_0x44a4b4['authorId'],'content':_0x44a4b4['content'],'documentId':_0x588576,'createdAt':_0x44a4b4['createdAt'],'attributes':_0x44a4b4['attributes']||{}};}(_0x1778a0,_0x37ec3a,_0x17d27c)),'resolvedAt':_0x6657b5,'resolvedBy':_0x1dfc04,'context':_0x233254,'attributes':_0x15a39f})['catch'](wt);return{'threadId':_0xd307f7['commentThreadId'],'comments':_0xd307f7['comments']};},'getCommentThread':async({channelId:_0x2bc740,threadId:_0x32f33f})=>{const _0x11f8dc=await this['_getService'](_0x2bc740)['getCommentThread'](_0x32f33f)['catch'](wt);return _0x11f8dc['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x11f8dc]),{'threadId':_0x11f8dc['commentThreadId'],'comments':_0x11f8dc['comments']['map'](st),'context':_0x11f8dc['context'],'resolvedAt':_0x11f8dc['resolvedAt'],'resolvedBy':_0x11f8dc['resolvedBy'],'attributes':_0x11f8dc['attributes']||{}});},'updateCommentThread':async({channelId:_0x5be260,threadId:_0x1f70d7,context:_0xb38a10,unlinkedAt:_0x385d65,attributes:_0x15226d})=>this['_getService'](_0x5be260)['updateCommentThread']({'commentThreadId':_0x1f70d7,'context':_0xb38a10,'attributes':_0x15226d,'unlinkedAt':_0x385d65})['catch'](ot)['catch'](wt),'resolveCommentThread':async({channelId:_0x5e58e2,threadId:_0x1f5cba})=>{const _0x12af32=await this['_getService'](_0x5e58e2)['resolveCommentThread'](_0x1f5cba)['catch'](ot)['catch'](wt);return{'threadId':_0x12af32['commentThreadId'],'resolvedAt':_0x12af32['resolvedAt'],'resolvedBy':_0x12af32['resolvedBy']};},'reopenCommentThread':async({channelId:_0x589f36,threadId:_0x26b2d7})=>this['_getService'](_0x589f36)['reopenCommentThread'](_0x26b2d7)['catch'](ot)['catch'](wt),'removeCommentThread':({channelId:_0x5b749a,threadId:_0x3ea111})=>this['_getService'](_0x5b749a)['removeCommentThread'](_0x3ea111)['catch'](ot)['catch'](wt),'addComment':({channelId:_0x2ab7f2,threadId:_0x1dc2a8,commentId:_0x3aad34,content:_0x21620c,attributes:_0x2368c0})=>this['_getService'](_0x2ab7f2)['addComment'](_0x1dc2a8,_0x3aad34,_0x21620c,_0x2368c0)['catch'](wt),'updateComment':({channelId:_0x45fc59,threadId:_0x461060,commentId:_0x1839a5,content:_0x576bd6,attributes:_0x3ed222})=>this['_getService'](_0x45fc59)['updateComment'](_0x461060,_0x1839a5,_0x576bd6,_0x3ed222)['catch'](ot)['catch'](wt),'removeComment':({channelId:_0x408c04,threadId:_0x308981,commentId:_0x5d9e02})=>this['_getService'](_0x408c04)['removeComment'](_0x308981,_0x5d9e02)['catch'](ot)['catch'](wt)},_0x5e23b8 instanceof tt){const _0x2c8d66=_0x5e23b8['config']['get']('collaboration.channelId'),_0x57dd5d=_0x5e23b8['plugins']['get'](i);await this['_setUpService'](_0x2c8d66);const _0x1f5ec3=await this['_services']['get'](_0x2c8d66)['getConnectedSessions']();this['listenTo'](_0x57dd5d,'sessionAdd:'+_0x2c8d66,(_0x2afbca,{session:_0xdcc279})=>{_0xdcc279['id']===_0x57dd5d['mySessionId']&&(_0x2afbca['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0xdcc279['permissions'],_0x2c8d66));}),_0x57dd5d['register'](_0x2c8d66,_0x1f5ec3);}}async['_setUpService'](_0x427e1f){if(this['_services']['has'](_0x427e1f))throw new _0x4f264b('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x427e1f});const _0x31a9bd=this['context']['plugins']['get']('CommentsRepository'),_0x32a24d=new a['CommentsService'](_0x427e1f);this['_services']['set'](_0x427e1f,_0x32a24d),this['listenTo'](_0x32a24d,'commentThreadAdded',(_0x3b6356,_0x18acad)=>{const {commentThreadId:_0x1ad68d,documentId:_0x58e36e,context:_0x125f9d,attributes:_0x50cfdd,resolvedAt:_0x4c5099,resolvedBy:_0x4e023b,comments:_0x1cb84b}=_0x18acad;_0x31a9bd['getCommentThread'](_0x1ad68d)||_0x31a9bd['addCommentThread']({'threadId':_0x1ad68d,'channelId':_0x58e36e,'comments':_0x1cb84b?_0x1cb84b['map'](st):[],'context':_0x125f9d,'attributes':_0x50cfdd,'resolvedAt':_0x4c5099,'resolvedBy':_0x4e023b,'isFromAdapter':!0x0});}),this['listenTo'](_0x32a24d,'commentThreadUpdated',(_0x31236b,{commentThreadId:_0x302d17,documentId:_0x3d2d29,context:_0x32ed45,unlinkedAt:_0x431134,attributes:_0x1f8b19})=>{_0x31a9bd['getCommentThread'](_0x302d17)&&_0x31a9bd['updateCommentThread']({'threadId':_0x302d17,'channelId':_0x3d2d29,'context':_0x32ed45,'unlinkedAt':_0x431134,'attributes':_0x1f8b19,'isFromAdapter':!0x0});}),this['listenTo'](_0x32a24d,'commentThreadResolved',(_0xb11712,{commentThreadId:_0x13c47f,resolvedBy:_0x5b172f,resolvedAt:_0x106588})=>{const _0x3635fa=_0x31a9bd['getCommentThread'](_0x13c47f);_0x3635fa&&_0x3635fa['resolve']({'resolvedBy':_0x5b172f,'resolvedAt':_0x106588,'isFromAdapter':!0x0});}),this['listenTo'](_0x32a24d,'commentThreadReopened',(_0x4b1ab0,{commentThreadId:_0x3ec97c})=>{const _0x547579=_0x31a9bd['getCommentThread'](_0x3ec97c);_0x547579&&_0x547579['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x32a24d,'commentThreadRemoved',(_0x29c983,{commentThreadId:_0x392833})=>{const _0x2fdf75=_0x31a9bd['getCommentThread'](_0x392833);_0x2fdf75&&_0x2fdf75['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x32a24d,'commentAdded',(_0x1b23a0,_0x49fbd3)=>{const _0xeb209c=_0x49fbd3['commentThreadId'],_0x56221c=_0x31a9bd['getCommentThread'](_0xeb209c);_0x56221c&&_0x56221c['addComment']({...st(_0x49fbd3),'isFromAdapter':!0x0});}),this['listenTo'](_0x32a24d,'commentUpdated',(_0x520d10,{commentThreadId:_0xa0aa0c,commentId:_0x5864d4,content:_0x1afd28,attributes:_0x2cfd4c})=>{const _0x4ffcd6=_0x31a9bd['getCommentThread'](_0xa0aa0c);if(_0x4ffcd6){const _0xa85025=_0x4ffcd6['getComment'](_0x5864d4);_0xa85025&&_0xa85025['update']({'content':_0x1afd28,'attributes':_0x2cfd4c,'isFromAdapter':!0x0});}}),this['listenTo'](_0x32a24d,'commentRemoved',(_0x1dfd18,{commentThreadId:_0x279c0f,commentId:_0x293800})=>{const _0x533255=_0x31a9bd['getCommentThread'](_0x279c0f);if(_0x533255){const _0x2c633b=_0x533255['getComment'](_0x293800);_0x2c633b&&_0x2c633b['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x427e1f);}['destroy'](){if(this['context']instanceof tt){const _0xf92e2d=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0xf92e2d);}}['_terminateService'](_0x24c6e1){if(!this['_services']['has'](_0x24c6e1))throw new _0x4f264b('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x24c6e1});this['_getService'](_0x24c6e1)['disconnect'](),this['_services']['delete'](_0x24c6e1);}async['reconnect'](){for(const _0x59c569 of this['_services']['keys']())await this['_connectService'](_0x59c569);if(this['context']instanceof tt){const _0x36c0ba=this['context']['config']['get']('collaboration.channelId'),_0x2e180e=this['context']['plugins']['get'](i);_0x2e180e['unregister'](_0x36c0ba);const _0x5ea5e2=await this['_services']['get'](_0x36c0ba)['getConnectedSessions']();_0x2e180e['register'](_0x36c0ba,_0x5ea5e2);}}async['_connectService'](_0x33306e){const {connection:_0x51d2b0}=this['context']['plugins']['get'](c),_0x137a9f=this['context']['plugins']['get']('CommentsRepository'),_0x2d3dd5=this['_services']['get'](_0x33306e),_0x4f7ba7=await _0x2d3dd5['connect'](_0x51d2b0);await this['_fetchMissingUsersForThreads'](_0x4f7ba7);const _0x2a0c5a=new Set(Array['from'](_0x137a9f['getCommentThreads']({'channelId':_0x33306e}),_0x567f07=>_0x567f07['id']));for(const _0x2627da of _0x4f7ba7)_0x2627da['deletedAt']||_0x2a0c5a['delete'](_0x2627da['commentThreadId']);for(const _0x2d7f53 of _0x2a0c5a)_0x137a9f['getCommentThread'](_0x2d7f53)['remove']({'isFromAdapter':!0x0});for(const _0xb1221b of _0x4f7ba7){let _0x12005c=_0x137a9f['getCommentThread'](_0xb1221b['commentThreadId']);const {commentThreadId:_0x5f37e3,context:_0x17d539,attributes:_0x4001f2,resolvedBy:_0xb68a43,resolvedAt:_0xf6977b,unlinkedAt:_0x47b1da,deletedAt:_0x3a6004}=_0xb1221b;if(_0x3a6004)continue;_0x12005c||(_0x12005c=_0x137a9f['addCommentThread']({'channelId':_0x33306e,'threadId':_0x5f37e3,'context':_0x17d539,'attributes':_0x4001f2||{},'resolvedBy':_0xb68a43,'resolvedAt':_0xf6977b,'unlinkedAt':_0x47b1da,'isFromAdapter':!0x0}));const _0x338962=new Set(Array['from'](_0x12005c['comments'],_0x3bc00c=>_0x3bc00c['id']));for(const _0x5f24e6 of _0xb1221b['comments'])_0x338962['delete'](_0x5f24e6['commentId']);for(const _0xa0f2f0 of _0x338962)_0x12005c['getComment'](_0xa0f2f0)['remove']({'isFromAdapter':!0x0});for(const _0x5d3942 of _0xb1221b['comments']){const _0x76e803=_0x12005c['getComment'](_0x5d3942['commentId']);_0x76e803?_0x76e803['content']!==_0x5d3942['content']&&_0x76e803['update']({'content':_0x5d3942['content'],'isFromAdapter':!0x0}):_0x12005c['addComment'](Object['assign'](st(_0x5d3942),{'isFromAdapter':!0x0}));}}}['_getService'](_0x378847){if(!this['_services']['has'](_0x378847))throw new _0x4f264b('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x378847});return this['_services']['get'](_0x378847);}async['_fetchMissingUsersForThreads'](_0x33e5b9){const _0x453d05=this['context']['plugins']['get'](_0x438734),{connection:_0x1d69de}=this['context']['plugins']['get'](c),_0x2aaaed=new Set();for(const {resolvedBy:_0xdc5a2e,comments:_0x415438}of _0x33e5b9){_0xdc5a2e&&!_0x453d05['getUser'](_0xdc5a2e)&&_0x2aaaed['add'](_0xdc5a2e);for(const {userId:_0x3364a7}of _0x415438)_0x453d05['getUser'](_0x3364a7)||_0x2aaaed['add'](_0x3364a7);}if(0x0===_0x2aaaed['size'])return;const _0x5df02a=await gt['getMany'](_0x1d69de,Array['from'](_0x2aaaed));for(const _0x4c0ffa of _0x5df02a)_0x453d05['getUser'](_0x4c0ffa['id'])||_0x453d05['addUser'](_0x4c0ffa);}}async function ot(_0x34f5a6){if('404'!==_0x34f5a6['code'])throw _0x34f5a6;}function wt(_0x5b292f){if((_0x14a294=_0x5b292f)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x14a294['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x14a294['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x14a294;throw _0x5b292f;}function st(_0x15ca79){return{'threadId':_0x15ca79['commentThreadId'],'commentId':_0x15ca79['commentId'],'content':_0x15ca79['content'],'createdAt':_0x15ca79['createdAt'],'authorId':_0x15ca79['userId'],'attributes':_0x15ca79['attributes']||{}};}class f extends _0x4ebc6b{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x56fa33){super(_0x56fa33);const _0xd1e0e5=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0xd1e0e5);}['init'](){const _0x2f621c=this['editor']['plugins']['get'](c),_0x5cca46=this['editor']['plugins']['get']('TrackChangesEditing');return _0x5cca46['adapter']={'getSuggestion':async _0x1640cd=>{await this['_waitForServiceReady']();const _0x34da89=await this['_trackChangesService']['get'](_0x1640cd)['catch'](nt);return await this['_fetchMissingUsersForThreads']([_0x34da89]),_0x34da89;},'addSuggestion':async({id:_0x394dcd,type:_0x2a7d8d,data:_0x57ece1,originalSuggestionId:_0x3cf394,attributes:_0x3d87eb})=>{await this['_waitForServiceReady']();const _0x6e259f={'id':_0x394dcd,'type':_0x2a7d8d,'data':_0x57ece1,'originalSuggestionId':_0x3cf394,'attributes':_0x3d87eb},_0x1a0602=await this['_trackChangesService']['add'](_0x394dcd,_0x2a7d8d,_0x57ece1,_0x3cf394,_0x3d87eb)['catch'](_0x5ee1bc=>{if(vt(_0x5ee1bc))return new Promise(_0x1fe3cf=>{this['_bufferedRequests']['set'](_0x394dcd,{'resolve':_0x1fe3cf,'suggestionData':_0x6e259f});});throw _0x5ee1bc;});return this['_bufferedRequests']['delete'](_0x394dcd),_0x1a0602;},'updateSuggestion':async(_0x35000b,_0x1f4d0b)=>{if(await this['_waitForServiceReady'](),'open'!==_0x1f4d0b['state'])return this['_trackChangesService']['update'](_0x35000b,_0x1f4d0b)['catch'](nt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x413a5c,_0x21c2af)=>{_0x5cca46['hasSuggestion'](_0x21c2af['id'])&&(_0x5cca46['getSuggestion'](_0x21c2af['id'])['attributes']=_0x21c2af['attributes']);}),this['_trackChangesService']['connect'](_0x2f621c['connection'])['then'](_0x3b34a0=>(_0x2f621c['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x3b34a0)['then'](()=>{for(const _0x40ca3d of _0x3b34a0){_0x5cca46['addSuggestionData'](_0x40ca3d)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5ef4fc=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x414482}=this['editor']['plugins']['get'](c),_0x544508=await this['_trackChangesService']['connect'](_0x414482);await this['_fetchMissingUsersForThreads'](_0x544508);for(const {suggestionData:_0x3ce21e,resolve:_0x382a51}of this['_bufferedRequests']['values']()){let _0x5b3c0b=_0x544508['find'](_0x56ee7a=>_0x56ee7a['id']===_0x3ce21e['id']);_0x5b3c0b||(_0x5b3c0b=await this['_trackChangesService']['add'](_0x3ce21e['id'],_0x3ce21e['type'],_0x3ce21e['data'],_0x3ce21e['originalSuggestionId'])),_0x382a51(_0x5b3c0b);}for(const _0x3f22eb of _0x544508)_0x5ef4fc['hasSuggestion'](_0x3f22eb['id'])||_0x5ef4fc['addSuggestionData'](_0x3f22eb);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x403184=>{this['listenTo'](this['_trackChangesService'],'connected',_0x2eb3ef=>{_0x2eb3ef['off'](),_0x403184();});});}async['_fetchMissingUsersForThreads'](_0x3cd398){const _0x4d0342=this['editor']['plugins']['get'](_0x438734),{connection:_0x40220f}=this['editor']['plugins']['get'](c),_0x3b6683=new Set();for(const {authorId:_0x1476d9}of _0x3cd398)_0x4d0342['getUser'](_0x1476d9)||_0x3b6683['add'](_0x1476d9);if(0x0===_0x3b6683['size'])return;const _0x228ec9=await gt['getMany'](_0x40220f,Array['from'](_0x3b6683));for(const _0x535ad9 of _0x228ec9)_0x4d0342['getUser'](_0x535ad9['id'])||_0x4d0342['addUser'](_0x535ad9);}}function nt(_0x546101){if(vt(_0x546101))return new Promise(()=>{});throw _0x546101;}function vt(_0xa64786){return _0xa64786['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xa64786['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x4ebc6b{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x53c218=this['editor']['plugins']['get'](c),_0x3cc361=this['editor']['plugins']['get']('CommentsEditing'),_0x2cd260=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x53c218,'change:state',(_0x3591cb,_0x3a8b96,_0x40e844)=>{_0x3cc361['isThreadsLoadingPaused']='connected'!==_0x40e844;});}),this['listenTo'](_0x53c218,'change:state',(_0x5c7eff,_0x2c9e2a,_0x54e1c3)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x54e1c3);}),_0x2cd260['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x4ebc6b{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x4ebc6b{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>rt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x438734];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4feb8a){super(_0x4feb8a);const _0x26b5c0=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x26b5c0);}async['init'](){const _0x1a1518=this['editor']['plugins']['get'](l),_0x487758=_0x1a1518['serverHistory'],_0x4b695e=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x487758,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x1a1518['sessionId']});const _0x4fb591=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x10ebd5=await it['isBundleUploaded'](_0x4b695e['connection'],_0x4fb591);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x52bae0})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x52bae0)),'updateRevisions':async _0x4629a5=>{await this['_waitForServiceReady']();const _0x1ada7c=this['_revisionTracker']['currentRevision'];if(_0x10ebd5&&0x1===_0x4629a5['length']&&_0x4629a5[0x0]['id']===_0x1ada7c['id'])return _0x4629a5;for(const _0x4fd52d of _0x4629a5)_0x4fd52d['id']===_0x1ada7c['id']&&(_0x4fd52d['isEmptyCurrent']=_0x4fd52d['fromVersion']===_0x4fd52d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x4629a5,this['_lastRequestId'])['then'](_0x372daf=>(this['_lastRequestId']=_0x372daf,_0x4629a5))['catch'](_0x3a9638=>{if(ct(_0x3a9638)||'400'===_0x3a9638['code']&&void 0x0!==_0x3a9638['data']['wrongRequestId']){for(const _0x5219c2 of _0x4629a5){!this['_revisionTracker']['repository']['getRevision'](_0x5219c2['id'])||this['_revisionTracker']['_bufferUpdate'](_0x5219c2['id'],_0x5219c2,!0x1);}if(ct(_0x3a9638))throw _0x3a9638;return _0x4629a5;}throw _0x3a9638;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3cad6c,{revisionsData:_0x20cc6a,requestId:_0x2bc4cd})=>{Math['max'](..._0x20cc6a['map'](_0x3a78c8=>_0x3a78c8['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x20cc6a,_0x2bc4cd);}):this['_handleRevisionsUpdate'](_0x20cc6a,_0x2bc4cd);});const {revisions:_0x52fd67,requestId:_0x3dcefa}=await this['_revisionHistoryService']['connect'](_0x4b695e['connection']);_0x4b695e['addToReconnectionStack'](this),this['_lastRequestId']=_0x3dcefa,await this['_fetchMissingUsers'](_0x52fd67);for(const _0x21c649 of _0x52fd67)this['_revisionTracker']['addRevisionData'](_0x21c649);this['listenTo'](_0x1a1518,'change:_isConnected',(_0x4f583e,_0xa2f276,_0x4d608c)=>{_0x4d608c&&(this['_oldOffset']=_0x1a1518['_offset'],_0x4f583e['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4b695e,'state',_0x1e475e=>_0x1e475e===_0x3a4dd9['CONNECTED']);}async['reconnect'](){const _0x16402a=this['editor']['plugins']['get'](c),_0x4810f2=this['editor']['plugins']['get'](l),_0x31dc6b=async()=>{const _0x20710c=this['_revisionTracker']['currentRevision'],_0x5ba48d=_0x20710c['id'],_0x8021b9=_0x5ba48d!==_0x4810f2['sessionId'];if(_0x8021b9){const _0x15c88a=_0x4810f2['_offset']-this['_oldOffset'],_0x229643=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x20710c['toVersion']+_0x15c88a!==_0x229643){const _0x496217=_0x20710c['fromVersion']+_0x15c88a,_0x5e204f=this['editor']['plugins']['get'](_0x438734),_0x45f870=this['_revisionTracker']['buildRevisionData']({'revision':_0x20710c,'from':_0x496217,'to':_0x229643});_0x45f870['id']=_0x20710c['id'];const _0x2eaa7c=_0x45f870['authorsIds']['map'](_0x1cc4a5=>_0x5e204f['getUser'](_0x1cc4a5));_0x20710c['_update']({..._0x45f870,'authors':_0x2eaa7c},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x20710c['id'],_0x45f870,!0x0);}this['_revisionTracker']['_startingVersion']=_0x229643,(_0x20710c['toVersion']===_0x20710c['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x5ba48d)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x5ba48d),this['_revisionTracker']['_createCurrentRevision'](_0x229643));}const {revisions:_0x5dc373,requestId:_0x802233}=await this['_revisionHistoryService']['reconnect'](_0x16402a['connection'],this['_lastRequestId']);_0x8021b9&&_0x5dc373['length']>0x0?_0x4810f2['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x5dc373),this['_handleRevisionsUpdate'](_0x5dc373,_0x802233),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4810f2['_isConnected']?_0x31dc6b():new Promise((_0x5f3ea4,_0x2b4671)=>{_0x4810f2['once']('change:_isConnected',()=>{_0x31dc6b()['then'](_0x5f3ea4)['catch'](_0x2b4671);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x2ca1ca=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x31f755=>{_0x31f755['off'](),_0x2ca1ca();});});}['_getLatestVersionFromServerOperations'](){const _0x806636=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1b6746 of _0x806636)if('marker'!==_0x1b6746['type']||_0x1b6746['affectsData'])return _0x1b6746['baseVersion']+0x1;}['_getLatestVersion'](){const _0x106a58=this['editor']['plugins']['get'](l);return new Promise(_0x1d8a52=>{_0x106a58['_isPendingUpdate']?_0x106a58['once']('change:_isPendingUpdate',()=>{_0x1d8a52(this['_getLatestVersionFromServerOperations']());}):_0x1d8a52(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x157dba,_0x2eb644){const _0x133388=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2eb644;for(const _0x2ec9aa of _0x157dba){const _0x440b64=_0x133388['getRevision'](_0x2ec9aa['id']);if(_0x440b64){if((_0x2ec9aa['fromVersion']||_0x2ec9aa['toVersion'])&&(_0x2ec9aa['diffData']=null),_0x440b64===this['_revisionTracker']['currentRevision']){const _0x1155e8=Math['max'](_0x440b64['toVersion'],_0x2ec9aa['toVersion']),_0x10f454=Math['max'](_0x440b64['fromVersion'],_0x2ec9aa['fromVersion']);let _0x4f7976;_0x440b64['toVersion']===_0x2ec9aa['toVersion']&&_0x440b64['fromVersion']===_0x2ec9aa['fromVersion']?(_0x4f7976=!0x0,this['_preventResendingRevisionData'](_0x2ec9aa)):_0x2ec9aa['toVersion']===_0x1155e8&&_0x2ec9aa['fromVersion']===_0x10f454?_0x4f7976=!0x1:(_0x440b64['toVersion']===_0x1155e8&&_0x440b64['fromVersion']===_0x10f454||this['_fixRevision']({'revision':_0x440b64,'from':_0x10f454,'to':_0x1155e8}),_0x4f7976=!0x0),_0x4f7976&&(delete _0x2ec9aa['fromVersion'],delete _0x2ec9aa['toVersion'],delete _0x2ec9aa['diffData'],delete _0x2ec9aa['createdAt'],delete _0x2ec9aa['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2ec9aa),this['_preventResendingRevisionData'](_0x2ec9aa);}else this['_revisionTracker']['addRevisionData'](_0x2ec9aa);}const _0x53e83f=_0x133388['getRevisions']();_0x53e83f['reverse']();for(let _0x589113=0x0;_0x589113<_0x53e83f['length']-0x1;_0x589113++){const _0x53ef2a=_0x53e83f[_0x589113],_0x4e3481=_0x53e83f[_0x589113+0x1];if(_0x53ef2a['fromVersion']<_0x4e3481['toVersion']){const _0x1724cd=_0x4e3481['toVersion'],_0x3f57b1=Math['max'](_0x1724cd,_0x53ef2a['toVersion']);this['_fixRevision']({'revision':_0x53ef2a,'from':_0x1724cd,'to':_0x3f57b1});}}}['_fixRevision']({revision:_0x5ba33b,from:_0x46e748,to:_0x2399f5}={}){const _0x3cd1dc=this['editor']['plugins']['get'](_0x438734),_0x2bea12=this['_revisionTracker']['buildRevisionData']({'revision':_0x5ba33b,'from':_0x46e748,'to':_0x2399f5});_0x2bea12['authors']=_0x2bea12['authorsIds']['map'](_0x128253=>_0x3cd1dc['getUser'](_0x128253)),_0x5ba33b['_update'](_0x2bea12);}['_preventResendingRevisionData'](_0x36baa){const _0x482ca2={};_0x482ca2['id']=_0x36baa['id'];for(const _0xcfb043 of Object['keys'](_0x36baa))'id'!==_0xcfb043&&(_0x482ca2[_0xcfb043]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x482ca2['id'],_0x482ca2,!0x0);}async['_fetchMissingUsers'](_0x577a85){const _0x695ba7=this['editor']['plugins']['get'](_0x438734),{connection:_0x48d9ad}=this['editor']['plugins']['get'](c),_0x96684e=new Set();for(const _0x58f1e0 of _0x577a85){for(const _0x205924 of _0x58f1e0['authorsIds'])_0x4c4efd(_0x205924);_0x58f1e0['creatorId']&&_0x4c4efd(_0x58f1e0['creatorId']);}if(0x0===_0x96684e['size'])return;const _0x1bea58=await gt['getMany'](_0x48d9ad,Array['from'](_0x96684e));for(const _0x2d9501 of _0x1bea58)_0x695ba7['getUser'](_0x2d9501['id'])||_0x695ba7['addUser'](_0x2d9501);function _0x4c4efd(_0x3ccbca){_0x695ba7['getUser'](_0x3ccbca)||_0x96684e['add'](_0x3ccbca);}}}function ct(_0x12f802){return _0x12f802['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x12f802['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x12f802['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x4ebc6b{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x31b426{['_collapseAt'];constructor(_0x383c9b,_0x997712=0x6){super(_0x383c9b);const _0x4cff0c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x997712,this['bind']('isHidden')['to'](this,'usersCount',_0x5dd626=>_0x5dd626<_0x997712),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4cff0c['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':_0x4cff0c['to']('usersCount',_0xaaa7f1=>'+'+(_0xaaa7f1-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x31b426{['items'];['keystrokes'];constructor(_0x35e5a7){super(_0x35e5a7);const _0x239838=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x369680(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x239838['if']('hasPopup'),'aria-expanded':_0x239838['to']('isExpanded',_0x349145=>this['hasPopup']&&String(_0x349145)),'aria-label':_0x239838['to']('hasPopup',_0x5c266e=>M(_0x35e5a7,_0x5c266e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x239838['to']('hasPopup',_0x26b712=>!!_0x26b712&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x239838['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x239838['to'](_0x1364b9=>{const _0x2f72e1=_0x1364b9,_0x44f841=document['querySelector']('.ck-presence-list__dropdown-list'),_0x35630f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x44f841?.['contains'](_0x2f72e1['relatedTarget'])||_0x35630f?.['contains'](_0x2f72e1['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x56bffc,_0x223e86,_0x28c0c2)=>{this['element']&&(_0x28c0c2?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x31b426{['counterView'];['inlineListView'];constructor(_0x42e97a,_0x10ce7a=0x6){super(_0x42e97a);const _0xf3d614=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x10ce7a),this['inlineListView']=new ts(_0x42e97a),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5e8886 of this['inlineListView']['items'])_0x5e8886['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',_0xf3d614['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x31b426{['listWrapperView'];constructor(_0x2d3dc5,_0x141ea3){super(_0x2d3dc5);const _0x22360d=this['bindTemplate'];this['listWrapperView']=new _t(_0x2d3dc5,_0x141ea3),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':M(_0x2d3dc5,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x22360d['to'](_0x32acfb=>{const _0xec1dd=_0x32acfb,_0x12edca=document['querySelector']('.ck-presence-list__list'),_0xfb831b=document['querySelector']('.ck-balloon-panel_with-arrow');_0x12edca?.['contains'](_0xec1dd['relatedTarget'])||_0xfb831b?.['contains'](_0xec1dd['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class _t extends _0x3a4862{constructor(_0x2614fa,_0x3c17d2){super(_0x2614fa);const _0x3dcbea=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x3c17d2?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3dcbea['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3dcbea['to']('role'),'aria-label':_0x3dcbea['to']('ariaLabel'),'aria-labelledby':_0x3dcbea['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x5e86ee['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x55a89a=this['element'];_0x55a89a&&(this['_isScrollable']=Math['max'](_0x55a89a['scrollHeight'],_0x55a89a['clientHeight'])>0.8*window['innerHeight']);}}class k extends lt{['userView'];constructor(_0x5d48d4,_0x1e5435,_0x123a3f){super(_0x5d48d4);const _0x47efa9=this['bindTemplate'];this['userView']=new ut(_0x5d48d4,_0x1e5435);const _0x2f9ab7={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x1e5435['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x1e5435['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1e5435['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x123a3f&&(_0x2f9ab7['tag']='button',_0x2f9ab7['on']={'click':_0x47efa9['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2f9ab7);}['focus'](){this['element']['focus']();}}class y extends _0x31b426{['userView'];['markerView'];constructor(_0x147f01,_0x27ddd8,_0x53b027){super(_0x147f01);const _0xd299bc=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ut(_0x147f01,_0x27ddd8),this['markerView']=new dt(_0x147f01,_0x27ddd8);const _0x3b1b70=new pt(_0x147f01);_0x3b1b70['template']['tag']='span',_0x3b1b70['text']=_0x27ddd8['name'];const _0x1910ec={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0xd299bc['to']('isFocusable',_0x5d38fc=>!!_0x5d38fc&&0x0),'aria-labelledby':_0x3b1b70['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0xd299bc['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0xd299bc['to']('hasTooltip',_0x31a925=>!_0x31a925),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x3b1b70]};_0x53b027&&(_0x1910ec['tag']='button',_0x1910ec['on']={'click':_0xd299bc['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1910ec);}}class dt extends _0x31b426{constructor(_0x543f62,_0x68c91a){super(_0x543f62),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x68c91a['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x3acd16{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x342e51){super(_0x342e51),this['context']['config']['define']('presenceList',C);const _0x6e4e6e=_0x342e51['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x6e4e6e)throw new _0x4f264b('presencelist-collapseat-invalid-format',this);if(_0x6e4e6e<0x1)throw new _0x4f264b('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x3e30dd(),this['balloonPanelView']=new _0xa3d209(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x19e323 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x19e323);this['listenTo'](this['_allConnectedUsers'],'add',(_0x339b98,_0x178620)=>{this['_handleUserAdd'](_0x178620);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x420af7,_0xa7f851)=>{this['_handleUserRemove'](_0xa7f851);});}['_createView'](){const _0x4bcde2=this['context'],_0x115345=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x330b01=this['balloonPanelView'];if(!_0x280390(_0x4bcde2['config']['get']('presenceList.container')))throw new _0x4f264b('presencelist-missing-container',this);return _0x115345['counterView']['bind']('usersCount')['to'](this),_0x115345['bind']('isCollapsed')['to'](this,'usersCount',_0x1519ba=>{const {collapseAt:_0x31f6d7}=_0x4bcde2['config']['get']('presenceList'),_0x2d7a5a=_0x1519ba>=_0x31f6d7;if(_0x2d7a5a&&!_0x115345['inlineListView']['items']['find'](_0xc20e7f=>_0xc20e7f instanceof A)){const _0x50a824=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x50a824&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x115345['inlineListView']['items']['add'](_0x115345['counterView']);}return _0x2d7a5a||this['hideDropdown'](),_0x2d7a5a;}),_0x115345['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x3d85b4=>{const _0x596144=_0x4bcde2['config']['get']('presenceList'),_0x3dd57a=new y(_0x4bcde2['locale'],_0x3d85b4,!!_0x596144['onClick']);return _0x3dd57a['bind']('hasTooltip')['to'](_0x115345,'isCollapsed',_0x151234=>!_0x151234),_0x3dd57a['bind']('isFocusable')['to'](_0x115345,'isCollapsed',_0x2f3e1e=>!_0x2f3e1e),_0x596144['onClick']&&this['listenTo'](_0x3dd57a,'execute',()=>{this['view']['isCollapsed']||_0x596144['onClick'](_0x3d85b4,_0x3dd57a['element']);}),_0x3dd57a;}),this['listenTo'](_0x115345['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x115345['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x115345['inlineListView']['keystrokes']['set']('Enter',(_0x231b3b,_0x381d51)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x381d51());}),_0x115345['render'](),_0x330b01['render'](),_0x4a73c8({'emitter':_0x115345,'activator':()=>_0x330b01['isVisible'],'contextElements':[_0x330b01['element'],_0x115345['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4bcde2['config']['get']('presenceList.container')['appendChild'](_0x115345['element']),this['_bodyCollection']=new _0x56d6b8(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x115345;}['_handleUserAdd'](_0x3b95b2){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3b95b2['isMe'])return;const _0x138629=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x138629-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0xcdcd24=_0x3b95b2['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3b95b2,_0xcdcd24);}['_handleUserRemove'](_0x138371){this['usersCount']--;const {collapseAt:_0x58eb49}=this['context']['config']['get']('presenceList'),_0x16b297=this['usersCount']>=_0x58eb49;if(this['currentDisplayedUsers']['get'](_0x138371['id']))this['currentDisplayedUsers']['remove'](_0x138371['id']);else{if(_0x16b297&&this['currentDisplayedUsers']['length']+0x1===_0x58eb49-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x16b297?0x1:0x0)<this['usersCount']){for(const _0x43beed of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x43beed['id'])&&(this['currentDisplayedUsers']['add'](_0x43beed,Math['min'](this['currentDisplayedUsers']['length']-(_0x16b297?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x16b297?0x1:0x0)===_0x58eb49-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4822b6=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x4822b6['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x8585ae}=this['presenceDropdownView'];_0x8585ae['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x16a7bc=>{if(!_0x4822b6['displayMe']&&_0x16a7bc['isMe'])return null;const _0x1a9a43=new k(this['context']['locale'],_0x16a7bc,!!_0x4822b6['onClick']);return _0x4822b6['onClick']&&this['listenTo'](_0x1a9a43,'execute',()=>{_0x4822b6['onClick'](_0x16a7bc,_0x1a9a43['element']);}),_0x1a9a43;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x8585ae['focus'](),_0x8585ae['checkIfScrollable']();const _0x451f5e=(_0x2cbfe2,_0x53395a)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x53395a();};_0x8585ae['keystrokes']['set']('Esc',_0x451f5e),_0x8585ae['keystrokes']['set']('Shift+Tab',_0x451f5e),_0x8585ae['keystrokes']['set']('Tab',(_0x3cb595,_0x538229)=>{!function(_0x351c1a){const _0x5a0801=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xc9f2cf=>_0xc9f2cf+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x225f51=[...document['body']['querySelectorAll'](_0x5a0801)]['filter'](_0x1446bf=>_0x1446bf===document['activeElement']||_0x1446bf['offsetWidth']+_0x1446bf['offsetHeight']>0x0)['sort']((_0x1dc4d1,_0x1aabea)=>(_0x1dc4d1['tabIndex']||0x0)-(_0x1aabea['tabIndex']||0x0)),_0x158eb7=_0x225f51['indexOf'](_0x351c1a),_0xb31fbd=_0x225f51[(_0x158eb7+0x1)%_0x225f51['length']];_0xb31fbd&&_0xb31fbd['focus']();}(this['view']['element']),this['hideDropdown'](),_0x538229();}),_0x8585ae['focusTracker']['add'](this['view']['element']),_0x8585ae['focusTracker']['on']('change:isFocused',(_0xf6ebcf,_0x30bf75,_0x54fb94)=>{_0x54fb94||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x3acd16{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x5f53ee=>0x1!=_0x5f53ee}};
|