@ckeditor/ckeditor5-real-time-collaboration 47.0.0-alpha.1 → 47.0.0-alpha.3
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
|
-
((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4610c4];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19e899){super(_0x19e899),this['set']('state',_0x46f1ff['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x46c868())();}['init'](){const _0x1bf02a=this['context'],_0x2d83a7=_0x1bf02a['plugins']['get']('CloudServices'),_0x25801a=_0x1bf02a['plugins']['get'](_0x4610c4);if(!_0x2d83a7['token'])throw new _0x18bf15('websocketgateway-missing-token',this);if(!_0x2d83a7['webSocketUrl'])throw new _0x18bf15('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x2d83a7['token'],_0x2d83a7['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4a3539=>{if(this['connection']=_0x4a3539,this['bind']('state')['to'](_0x4a3539,'state',this,'_isBrowserOffline',(_0xb2cd06,_0x5e80e6)=>('connected'!==_0xb2cd06&&(this['_shouldPluginsReconnect']=!0x0),_0x5e80e6||_0xb2cd06!==_0x46f1ff['CONNECTED']?_0x46f1ff['DISCONNECTED']:this['state']==_0x46f1ff['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x46f1ff['CONNECTING']):_0x46f1ff['CONNECTED'])),this['connection']['on']('error',(_0x25eaaf,_0x461167)=>{if('limitExceeded'!==_0x461167['code'])throw console['error'](_0x461167),new _0x18bf15('cloudservices-init',null,{'originalError':_0x461167});_0x25801a['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'});}),!_0x4a3539['me'])return new Promise(_0x9976c2=>_0x4a3539['on']('change:me',_0x9976c2));})['catch'](_0xdb63d9=>{throw console['error'](_0xdb63d9),new _0x18bf15('cloudservices-init',null,{'originalError':_0xdb63d9});});}['addToReconnectionStack'](_0x328b81){if('function'!=typeof _0x328b81['reconnect'])throw new _0x18bf15('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x328b81))throw new _0x18bf15('websocketgateway-plugin-already-registered',this,{'name':_0x328b81['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x328b81);}['removeFromReconnectionStack'](_0x27560e){this['_reconnectionStack']['delete'](_0x27560e);}['isInReconnectionStack'](_0x7f520){return this['_reconnectionStack']['has'](_0x7f520);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x21e0bb=>_0x21e0bb['reconnect']())))['then'](()=>this['state']=_0x46f1ff['CONNECTED'])['catch'](_0x529c49=>{throw console['error'](_0x529c49),new _0x18bf15('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x46f1ff['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x4ac1ff{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x1d7a86];}constructor(_0x1ba1e5){super(_0x1ba1e5),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x410c43(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d7a86);}['init'](){const _0x52d989=this['context']['plugins']['get'](n);this['listenTo'](_0x52d989,'change:state',(_0x54bb8e,_0x46f421,_0x2c0c1f)=>{if('connected'!==_0x2c0c1f)this['channelSessions']['forEach'](_0xd3e557=>_0xd3e557['clear']()),this['channelConnectedUsers']['forEach'](_0x303183=>_0x303183['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2d9aa0,_0x10e7cc]of this['_registeredSessions'])for(const _0xb90447 of _0x10e7cc)this['_handleSessionAdd'](_0x2d9aa0,_0xb90447);}}),this['_createUser'](_0x52d989['connection']['me'],!0x0);}['register'](_0x20cbb5,_0x20935d){if(this['_registeredSessions']['has'](_0x20cbb5))throw new _0x18bf15('sessions-register-already-registered',null,{'channelId':_0x20cbb5});this['_registeredSessions']['set'](_0x20cbb5,_0x20935d),this['channelSessions']['set'](_0x20cbb5,new _0x410c43()),this['channelConnectedUsers']['set'](_0x20cbb5,new _0x410c43()),this['listenTo'](_0x20935d,'add',(_0x172925,_0x5efae3)=>this['_handleSessionAdd'](_0x20cbb5,_0x5efae3)),this['listenTo'](_0x20935d,'remove',(_0x26628e,_0xdad811)=>this['_handleSessionRemove'](_0x20cbb5,_0xdad811));for(const _0x2bb59c of _0x20935d)this['_handleSessionAdd'](_0x20cbb5,_0x2bb59c);}['unregister'](_0x58913c){if(!this['_registeredSessions']['has'](_0x58913c))throw new _0x18bf15('sessions-unregister-not-exist',null,{'channelId':_0x58913c});const _0x37d7ca=this['_registeredSessions']['get'](_0x58913c);this['stopListening'](_0x37d7ca);for(const _0x47b537 of _0x37d7ca)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x58913c,_0x47b537);this['_registeredSessions']['delete'](_0x58913c),this['channelSessions']['delete'](_0x58913c),this['channelConnectedUsers']['delete'](_0x58913c);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x76545e){for(const _0x1b090e of this['channelSessions']['values']())for(const _0x41b2e5 of _0x1b090e)if(_0x41b2e5['id']===_0x76545e)return _0x41b2e5['user'];}['getUserSessions'](_0x3f91c5,_0x576b7e){const _0x6368c9=_0x576b7e?[this['channelSessions']['get'](_0x576b7e)]:this['channelSessions']['values'](),_0x40072e=new Set();for(const _0xcd510c of _0x6368c9)for(const _0x1df1da of _0xcd510c)_0x1df1da['user']['id']===_0x3f91c5['id']&&_0x40072e['add'](_0x1df1da['id']);return _0x40072e;}['getUserRole'](_0x17bf02){for(const _0x38b53e of this['channelSessions']['values']())for(const _0x201ba4 of _0x38b53e)if(_0x201ba4['user']===_0x17bf02)return _0x201ba4['role'];}['_handleSessionAdd'](_0x1679bd,_0x538b7f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x19e8a6=_0x538b7f['user'],_0x33933e=this['_users']['getUser'](_0x19e8a6['id'])||this['_createUser'](_0x19e8a6),_0x4c453f=Object['assign']({},_0x538b7f,{'user':_0x33933e});if(this['channelSessions']['get'](_0x1679bd)['add'](_0x4c453f),!_0x19e8a6['hiddenInPresenceList']){const _0x5bfd0b=this['channelConnectedUsers']['get'](_0x1679bd);_0x5bfd0b['has'](_0x33933e['id'])||_0x5bfd0b['add'](_0x33933e),this['allConnectedUsers']['has'](_0x33933e['id'])||_0x19e8a6['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x33933e,_0x33933e['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x1679bd,{'channelId':_0x1679bd,'session':_0x4c453f});}['_handleSessionRemove'](_0x5c81a6,_0x2dbe3e){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1b1e52=this['channelConnectedUsers']['get'](_0x5c81a6),_0x8f1da2=_0x2dbe3e['user'];_0x8f1da2['id']&&(this['channelSessions']['get'](_0x5c81a6)['remove'](_0x2dbe3e['id']),_0x1b1e52['has'](_0x8f1da2['id'])&&!this['getUserSessions'](_0x8f1da2,_0x5c81a6)['size']&&_0x1b1e52['remove'](_0x8f1da2['id']),this['allConnectedUsers']['get'](_0x8f1da2['id'])&&!this['getUserSessions'](_0x8f1da2)['size']&&this['allConnectedUsers']['remove'](_0x8f1da2['id']));}['_createUser'](_0x5d029e,_0x3b30fc){const _0x2d2422=this['_users']['addUser'](_0x5d029e);return _0x3b30fc&&this['_users']['defineMe'](_0x5d029e['id']),_0x2d2422['orderNumber']=this['_uniqueUsersCount']++,_0x2d2422;}}class G extends _0x160203{['_domEmitter']=new(_0x46c868())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xd72876=this['editor'],_0x4dd1bc=_0xd72876['plugins']['get'](i);_0xd72876['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3b8640,{writer:_0x2c0d46})=>function(_0x4a7a3d,_0x183aa1,_0x289323,_0x14b987){const _0x6f0588=_0x4a7a3d['markerName']['split'](':')[0x2],_0x3a0310=_0x289323['getUserBySessionId'](_0x6f0588);if(!_0x3a0310||_0x6f0588===_0x289323['mySessionId'])return;if(!_0x14b987['model']['schema']['checkChild'](_0x4a7a3d['markerRange']['start'],'$text'))return;const _0x20dbc6={'class':'ck-user__marker\x20'+_0x3a0310['color']['getMarkerClass'](),'data-name':_0x3a0310['name'],'data-session-id':_0x6f0588},_0x16b4e8=_0x14b987['model']['markers']['get'](_0x4a7a3d['markerName']),_0x2a3503=_0x16b4e8['getStart'](),_0x22aff8=_0x2a3503['nodeAfter'],_0x39a07b=_0x14b987['model']['schema'];if(_0x22aff8&&_0x39a07b['isObject'](_0x22aff8)&&_0x39a07b['isInline'](_0x22aff8)&&!_0x14b987['model']['markers']['get']('user:range:'+_0x6f0588)['getRange']()['isCollapsed'])return;const _0x7cf737=_0x2a3503['parent'];return _0x14b987['model']['schema']['isLimit'](_0x7cf737)&&!_0x14b987['model']['hasContent'](_0x7cf737)&&(_0x20dbc6['contenteditable']=!0x1),function(_0x4ea818,_0x204c37,_0x53d3b0){const _0x17d31a=_0x4ea818['createUIElement']('span',_0x204c37);return _0x4ea818['setCustomProperty']('userPositionMarker',!0x0,_0x17d31a),_0x17d31a['render']=function(_0x2e20c0){const _0x3efbdd=this['toDomElement'](_0x2e20c0),_0x479340=document['createElement']('span');return _0x479340['classList']['add']('ck-user__marker-tooltip'),_0x479340['setAttribute']('contenteditable','false'),_0x479340['setAttribute']('spellcheck','false'),_0x479340['textContent']=_0x53d3b0['name'],_0x3efbdd['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x479340['outerHTML']+'',_0x3efbdd['addEventListener']('mouseenter',()=>{_0x3efbdd['classList']['add']('ck-user__marker_hovered');}),_0x3efbdd['addEventListener']('mouseleave',()=>{_0x3efbdd['classList']['remove']('ck-user__marker_hovered');}),_0x3efbdd;},_0x17d31a['isSimilar']=function(_0x3a4a8b){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3a4a8b['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3a4a8b['getAttribute']('data-session-id'));},_0x17d31a;}(_0x183aa1,_0x20dbc6,_0x3a0310);}(_0x3b8640,_0x2c0d46,_0x4dd1bc,_0xd72876)}),_0xd72876['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x7cbacd=>function(_0x41eacf,_0x3d7f78){const _0x365682=_0x41eacf['markerName']['split'](':')[0x2];if(_0x365682===_0x3d7f78['mySessionId'])return null;const _0x1587c1=_0x3d7f78['getUserBySessionId'](_0x365682);if(!_0x1587c1)return{'id':_0x365682,'classes':[]};return{'id':_0x365682,'classes':['ck-user__selection',_0x1587c1['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x365682},'priority':0x7d0+_0x1587c1['orderNumber']};}(_0x7cbacd,_0x4dd1bc)}),function(_0x5b85e3){const _0x4c76b2=_0x5b85e3['model'],_0x522722=new Map(),_0x3839a6=_0x5b85e3['plugins']['get'](i);_0x4c76b2['markers']['on']('update:user:range',(_0x23d038,_0x43ce3b,_0x2ac261,_0x4dce50)=>{if(!_0x4dce50&&_0x522722['get'](_0x43ce3b['name']))return _0x522722['get'](_0x43ce3b['name'])['detach'](),void _0x522722['delete'](_0x43ce3b['name']);const _0x5287a6=_0x43ce3b['name']['split'](':')[0x2];if(_0x5287a6===_0x3839a6['mySessionId'])return;const _0x27ad58='user:position:'+_0x5287a6;_0x4c76b2['markers']['has'](_0x27ad58)&&_0x5b85e3['editing']['reconvertMarker'](_0x27ad58),_0x43ce3b['on']('change:range',(_0x180736,_0x10c221,_0x6a8164)=>{if('$graveyard'!=_0x10c221['root']['rootName']&&'$graveyard'==_0x43ce3b['getRange']()['root']['rootName']&&!_0x522722['has'](_0x43ce3b['name'])){const _0x4f8f6e=_0x4c76b2['schema']['getNearestSelectionRange'](_0x6a8164['deletionPosition']);if(_0x4f8f6e){const _0x42117d=_0x93d8bd['fromRange'](_0x4f8f6e);_0x522722['set'](_0x43ce3b['name'],_0x42117d),_0x42117d['on']('change:range',(_0x47a96b,_0xe578dc,_0x56f10e)=>{if('$graveyard'==_0x42117d['root']['rootName']){const _0x2acecf=_0x4c76b2['schema']['getNearestSelectionRange'](_0x56f10e['deletionPosition']);_0x2acecf?(_0x42117d['start']=_0x2acecf['start'],_0x42117d['end']=_0x2acecf['end']):(_0x522722['delete'](_0x43ce3b['name']),_0x42117d['detach']());}});}}});}),_0x4c76b2['document']['on']('change',()=>{_0x522722['size']>0x0&&_0x4c76b2['enqueueChange']({'isUndoable':!0x1},_0x6090b1=>{for(const [_0x4a4a8a,_0x34c902]of _0x522722)'$graveyard'==_0x4c76b2['markers']['get'](_0x4a4a8a)['getRange']()['root']['rootName']&&(te(_0x4a4a8a['split'](':')[0x2],_0x34c902['toRange'](),_0x4c76b2,_0x6090b1),_0x34c902['detach']());_0x522722['clear']();});});}(_0xd72876),this['_domEmitter']['listenTo'](_0x3deb78['document'],'keydown',(_0x553104,{key:_0x3f79a0})=>{'Escape'===_0x3f79a0&&function(_0x21be04){_0x21be04['editing']['view']['change'](_0x317bdd=>{for(const _0x53b9b4 of _0x21be04['model']['markers']){if(!_0x53b9b4['name']['startsWith']('user:position'))continue;const _0x279684=_0x21be04['editing']['mapper']['markerNameToElements'](_0x53b9b4['name']);if(_0x279684){for(const _0x1318d7 of _0x279684)_0x317bdd['removeClass']('ck-user__marker_hovered',_0x1318d7);}}});}(_0xd72876);},{'useCapture':!0x0});}['afterInit'](){const _0x4c285f=this['editor'],_0x2fa292=_0x4c285f['commands']['get']('undo');_0x2fa292&&_0x4c285f['model']['on']('applyOperation',(_0x5e2ba2,_0x6dfde2)=>{const _0x3945c4=_0x6dfde2[0x0];if(!_0x3945c4['isDocumentOperation'])return;if('marker'!=_0x3945c4['type']||!_0x3945c4['name']['startsWith']('user:'))return;const _0x201577=_0x3945c4['batch'];_0x2fa292['_createdBatches']['has'](_0x201577)&&(_0x3945c4['newRange']=_0x3945c4['oldRange']?_0x4c285f['model']['createRange'](_0x3945c4['oldRange']['start'],_0x3945c4['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x290f5e=this['editor'],_0x3e59ad=_0x290f5e['model']['document'],_0x3f4459=_0x290f5e['plugins']['get'](i);_0x290f5e['model']['enqueueChange']({'isUndoable':!0x1},_0x44f264=>{const _0x547fc4='user:range:'+_0x3f4459['mySessionId'],_0x418940='user:position:'+_0x3f4459['mySessionId'],_0x6d1202=_0x290f5e['model']['markers']['has'](_0x547fc4);_0x290f5e['editing']['view']['hasDomSelection']?te(_0x3f4459['mySessionId'],_0x3e59ad['selection']['getFirstRange'](),_0x290f5e['model'],_0x44f264):_0x6d1202&&(_0x44f264['removeMarker'](_0x547fc4),_0x44f264['removeMarker'](_0x418940));});}}function te(_0x1cdaa9,_0x39e9ab,_0x297912,_0x153187){const _0x520c7d='user:range:'+_0x1cdaa9,_0x1016b2='user:position:'+_0x1cdaa9,_0x11910d=_0x39e9ab['getContainedElement']();let _0x5ede45=_0x39e9ab['start'];if(_0x11910d&&_0x11910d['is']('element','tableCell')){const _0xe53420=function(_0x49bdfe,_0x58574a){for(const _0x507d52 of _0x49bdfe['getPositions']())if(_0x58574a['schema']['checkChild'](_0x507d52,'$text'))return _0x507d52;}(_0x39e9ab,_0x297912);_0xe53420&&(_0x5ede45=_0xe53420,_0x39e9ab=_0x153187['createRange'](_0x5ede45));}const _0x4dbceb=_0x153187['createRange'](_0x5ede45);_0x297912['markers']['has'](_0x520c7d)?(_0x153187['updateMarker'](_0x520c7d,{'range':_0x39e9ab}),_0x153187['updateMarker'](_0x1016b2,{'range':_0x4dbceb})):(_0x153187['addMarker'](_0x520c7d,{'range':_0x39e9ab,'usingOperation':!0x0}),_0x153187['addMarker'](_0x1016b2,{'range':_0x4dbceb,'usingOperation':!0x0}));}function $(_0x4b9f69,_0x52ca78,_0x103e3b){const _0x50109b=_0x4b9f69['t'],t=_0x4b9f69['t'];switch(_0x52ca78){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 _0x50109b({'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'},_0x103e3b);default:return'';}}let Q=0x1;class l extends _0x160203{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x49395a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x52720a,_0x1d7a86,_0x4610c4];}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 _0x3690c8=this['serverHistory']['getOperations']();for(let _0x402626=_0x3690c8['length']-0x1;_0x402626>=0x0;_0x402626--){const _0x4bff16=_0x3690c8[_0x402626];if(!this['_disconnectionOperations']['has'](_0x4bff16))return _0x4bff16['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x19ce88){if(super(_0x19ce88),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x24ea1e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x18bf15('collaboration-missing-channelid',this);const _0x14fed1=_0x19ce88['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x14fed1,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x55c2ea(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new Z(this['_disconnectionOperations']);}['init'](){const _0x5c7bc9=this['editor'],_0x434c85=_0x5c7bc9['plugins']['get'](_0x1d7a86),_0x3210f1=_0x5c7bc9['plugins']['get'](n);this['listenTo'](_0x434c85,'getOperationAuthor',(_0x4ef6fb,_0x39d5e2)=>{const _0x3dd497=_0x39d5e2[0x0];_0x3dd497['_authorId']&&(_0x4ef6fb['return']=_0x434c85['getUser'](_0x3dd497['_authorId']),_0x4ef6fb['stop']()),null===_0x3dd497['_authorId']&&(_0x4ef6fb['return']=null,_0x4ef6fb['stop']());},{'priority':'high'}),this['listenTo'](_0x5c7bc9['model']['document']['selection'],'change:range',(_0x5dd121,_0x45c520)=>{_0x45c520['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x5c7bc9['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x5c7bc9['model']['on']('applyOperation',(_0xf7eb4,_0x20465c)=>{const _0x4fb07d=_0x20465c[0x0];_0x4fb07d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4fb07d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x3210f1,'state',this,'_hasSynchronizationProblem',(_0x16799b,_0x3525d3)=>'connected'===_0x16799b&&!_0x3525d3),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x5c7bc9['disableReadOnlyMode']('rtc-offline'):_0x5c7bc9['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x5c7bc9['disableReadOnlyMode']('rtc-offline'):_0x5c7bc9['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4a0a2e=this['editor']['plugins']['get'](i),_0x5266c1=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x4a0a2e['unregister'](this['_channelId']);const _0x1b182d=await this['_service']['reconnect'](_0x5266c1['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1b182d)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2351dd=await this['_service']['getConnectedSessions']();_0x4a0a2e['register'](this['_channelId'],_0x2351dd),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x93d7ec){if(function(_0x2daeb9){return'404'===_0x2daeb9['code'];}(_0x93d7ec)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x13b06f){return'409'===_0x13b06f['code'];}(_0x93d7ec)){const _0x38e8cd=$(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'](_0x38e8cd);}else{if(!(_0x93d7ec instanceof X))throw _0x93d7ec;this['_handleReconnectionError']();}}}}['destroy'](){const _0x14fdf1=this['editor']['plugins']['get'](n),_0x18b233=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x18b233['channelSessions']['has'](this['_channelId'])&&_0x18b233['unregister'](this['_channelId']),_0x14fdf1['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x10eeb6){if(this['sessionId']!==_0x10eeb6['sessionId']&&this['_lastSyncedOperationId']!==_0x10eeb6['lastOperationId'])throw new X();return this['sessionId']=_0x10eeb6['sessionId'],this['_handleServerResponse']([],{..._0x10eeb6,'wereChangesApplied':!0x1,'data':_0x10eeb6['data']},'reconnect');}async['_connectService'](_0x5b3cd9,_0x3f9c4d=!0x1){const {connection:_0x2b2874}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x2b2874,this['_channelId'])['then'](_0x3073cb=>this['_initSessionsHandling'](_0x3073cb))['catch'](_0xc3aa1a=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0xc3aa1a);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x5b2729,_0x363177)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x363177);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x18aac1=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5b3cd9);this['_isPendingUpdate']=!0x0;const _0x6d4863=await this['_service']['connect'](_0x2b2874,this['_compressOperations'](_0x5b3cd9),_0x18aac1);if(this['sessionId']=_0x6d4863['sessionId'],_0x3f9c4d){if(!_0x6d4863['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x6d4863['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x5b3cd9,_0x6d4863,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x6d4863,_0x5b3cd9);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1cac9f=this['editor']['plugins']['get'](i),_0x4b9819=this['editor']['plugins']['get'](G),_0x3dd5a9=_0x1cac9f['channelSessions']['get'](this['_channelId']);_0x3dd5a9&&_0x3dd5a9['length']>0x1?_0x4b9819['createUserMarkerOperations']():this['listenTo'](_0x1cac9f,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1cac9f['channelSessions']['get'](this['_channelId'])['length']&&_0x4b9819['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2924d5,_0x580ba5,_0x74b097,_0xd2ac2b){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x580ba5){const _0x3213e6=this['_decompressOperations'](_0x74b097,_0xd2ac2b);await this['_fetchMissingUsers'](_0x3213e6),this['_handleExternalOperations'](_0x3213e6,_0x580ba5,_0x74b097['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1919c0}=this['editor'];let _0x2d6422;try{_0x2d6422=await this['_service']['getDocumentDetails']();}catch{const _0x34de8b=$(_0x1919c0,'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'](_0x34de8b);}const _0x46d842=_0x2d6422['currentDocumentSession']||_0x2d6422['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x46d842['lastOperationId']){const _0x3825b4=$(_0x1919c0,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x3825b4);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x239975){const _0x1b7b23=this['editor']['plugins']['get'](i);this['listenTo'](_0x1b7b23,'sessionAdd:'+this['_channelId'],(_0x1efd7e,{session:_0x4c0348})=>{if(_0x4c0348['id']===_0x1b7b23['mySessionId']){_0x1efd7e['off']();const _0x2f9142=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x25c7ae=_0x4c0348['permissions'];_0x2f9142&&_0x2f9142['isEnabled']&&(_0x25c7ae=_0x25c7ae['filter'](_0xb0a7f=>'document:write'!==_0xb0a7f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x25c7ae,this['_channelId']);}}),_0x1b7b23['register'](this['_channelId'],_0x239975);}['_initThrowingOnDataSet'](){const _0x246417=this['editor']['data']['set'];this['editor']['data']['set']=(..._0xf452e3)=>{if(!_0xf452e3[_0xf452e3['length']-0x1]['suppressErrorInCollaboration'])throw new _0x18bf15('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x246417['apply'](this['editor']['data'],_0xf452e3);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1522c5,[_0x2f35f5])=>{if(this['_document']['version'])throw new _0x18bf15('realtimecollaborationclient-init-document-already-initialized',this);_0x1522c5['stop'](),this['_setPendingAction']();const _0x5243e8=this['editor']['config']['get']('rootsAttributes'),_0x5263b1=this['_getOperationsFromInitData'](_0x2f35f5,_0x5243e8);0x0==_0x5263b1['length']&&_0x5263b1['push'](new _0x4bdc51(0x0)),_0x1522c5['return']=this['_connectService'](_0x5263b1)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x376282=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x376282))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3304c1,[_0x303550,_0x12b928])=>{_0x3304c1['stop']();const _0x474437=this['editor']['model']['document']['getRoot'](_0x303550);if(!this['_knownRootNames']['has'](_0x303550)){const _0x1a8df8=_0x12b928&&_0x12b928['data']?_0x12b928['data']:'',_0x4ae713=_0x12b928&&_0x12b928['attributes']?_0x12b928['attributes']:{};await this['_loadRoot'](_0x303550,_0x1a8df8,_0x4ae713);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x474437['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x474437);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x288d82){const _0x51dc3e=this['editor']['plugins']['get'](_0x1d7a86),{connection:_0x282265}=this['editor']['plugins']['get'](n),_0x2dcf44=new Set();for(const _0x55b0ad of _0x288d82){const _0x37f311=_0x55b0ad['_authorId'];_0x37f311&&!_0x51dc3e['getUser'](_0x37f311)&&_0x2dcf44['add'](_0x37f311);}if(0x0===_0x2dcf44['size'])return;const _0x3574e4=await ct['getMany'](_0x282265,Array['from'](_0x2dcf44));for(const _0x4166e6 of _0x3574e4)_0x51dc3e['getUser'](_0x4166e6['id'])||_0x51dc3e['addUser'](_0x4166e6);}['_getOperationsFromInitData'](_0x3b17be,_0x15e112={}){const _0x11e28a=this['editor']['model'],_0x43fe8d=[];let _0xd451b6=0x0;const _0x540f03='string'==typeof _0x3b17be?{'main':_0x3b17be}:_0x3b17be;for(const _0x4abc66 of Object['keys'](_0x540f03)){if(!this['_document']['roots']['has'](_0x4abc66))throw new _0x18bf15('realtimecollaborationclient-init-non-existent-root',this);const _0x4d188c=this['editor']['data']['parse'](_0x540f03[_0x4abc66]),_0x425beb=this['_document']['getRoot'](_0x4abc66),_0x4ded61=new _0x78ae33(_0x11e28a['createPositionAt'](_0x425beb,0x0),_0x4d188c,_0xd451b6++);_0x43fe8d['push'](_0x4ded61);for(const [_0x1e03d5,_0x25d534]of _0x4d188c['markers']){const _0x2ea999=_0x11e28a['createRange'](_0x11e28a['createPositionFromPath'](_0x425beb,_0x25d534['start']['path']['slice']()),_0x11e28a['createPositionFromPath'](_0x425beb,_0x25d534['end']['path']['slice']())),_0x2cb435=new _0x273597(_0x1e03d5,null,_0x2ea999,_0x11e28a['markers'],!0x0,_0xd451b6++);_0x43fe8d['push'](_0x2cb435);}}if(_0x15e112)for(const [_0x52c2de,_0x115f87]of Object['entries'](_0x15e112)){const _0x20676e=_0x11e28a['document']['getRoot'](_0x52c2de);if(!_0x20676e)throw new _0x18bf15('multi-root-editor-root-attributes-no-root',null);for(const [_0x5e5328,_0x30a16b]of Object['entries'](_0x115f87))if(null!==_0x30a16b){const _0x3de1d9=new _0x487d54(_0x20676e,_0x5e5328,null,_0x30a16b,_0xd451b6++);_0x43fe8d['push'](_0x3de1d9);}}return _0x43fe8d;}async['_loadRoot'](_0x32b2f1,_0x54fd0e,_0x1011eb){this['_getOperationsFromInitData']({[_0x32b2f1]:_0x54fd0e},{[_0x32b2f1]:_0x1011eb})['forEach']((_0x58e422,_0x39d432)=>{_0x58e422['baseVersion']=this['_document']['version']+_0x39d432,_0x58e422['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x58e422);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x360453,_0x5cdb02){let _0x38437a;this['_offset']=_0x360453['offset'];const _0x51fd23=_0x360453['wereChangesApplied']&&!_0x360453['initData'],_0x156d89=_0x51fd23?0x0:_0x360453['data']['baseVersion'];if(_0x5cdb02['forEach'](_0x598ad8=>{_0x598ad8['_isInit']=!0x0,_0x598ad8['createdAt']=_0x360453['sessionCreatedAt'],_0x598ad8['_authorId']=null;}),_0x51fd23)_0x38437a=_0x5cdb02,this['_applyOperationsSet'](_0x38437a,_0x51fd23);else{if(_0x360453['initData']){const _0x31b8ba=this['_getOperationsFromInitData'](_0x360453['initData']);this['_document']['history']['version']=-_0x31b8ba['length'],_0x31b8ba['forEach'](_0x8cf51e=>{_0x8cf51e['baseVersion']-=_0x31b8ba['length'],_0x8cf51e['createdAt']=_0x360453['sessionCreatedAt'],_0x8cf51e['_isInit']=!0x0,_0x8cf51e['_authorId']=null;}),this['_applyOperationsSet'](_0x31b8ba,!0x0),this['serverHistory']['version']=-_0x31b8ba['length']+this['_offset'],this['_updateServerHistory'](_0x31b8ba);}this['_document']['history']['version']=_0x156d89,_0x38437a=this['_decompressOperations'](_0x360453['data'],_0x360453['metadata']),await this['_fetchMissingUsers'](_0x38437a),this['_applyOperationsSet'](_0x38437a,_0x51fd23);}_0x360453['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x38437a,_0x360453['lastOperationId']),this['_lastSyncedOperationId']=_0x360453['lastOperationId']),this['serverHistory']['version']=_0x156d89+this['_offset'],this['_updateServerHistory'](_0x38437a),_0x5cdb02['filter'](_0x2f0f24=>{const _0x476d38=this['_getAffectedRoot'](_0x2f0f24);return _0x476d38&&!this['_knownRootNames']['has'](_0x476d38);})['forEach']((_0x3afff9,_0x4e095f)=>{_0x3afff9['baseVersion']=this['_document']['version']+_0x4e095f,this['_saveOperationInBuffer'](_0x3afff9);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4e0c99,_0x1f1bc7){const _0x5ae4bf=_0x1f1bc7&&_0x1f1bc7['message'];if(_0x5ae4bf&&_0x5ae4bf['startsWith']('realtimecollaborationclient'))throw _0x1f1bc7;const _0x1c4891=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x1c4891['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x18bf15(_0x4e0c99,this['editor'],_0x5ae4bf?{'originalError':_0x5ae4bf}:void 0x0);}['_saveOperationInBuffer'](_0x2fde7e){this['_knownOperations']['has'](_0x2fde7e)||(this['_knownOperations']['add'](_0x2fde7e),this['_bufferedOperations']['push'](_0x2fde7e),this['_pendingAction']||'marker'==_0x2fde7e['type']&&!_0x2fde7e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x447d31=!0x1){!_0x447d31&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x1eee18=>{_0x1eee18&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x88abcd=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x248c80){return _0x248c80['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x248c80['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x248c80['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x88abcd)||this['_crash'](_0x88abcd['message'],_0x88abcd);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5ea9bc=>{this['on']('change:_isPendingUpdate',()=>{_0x5ea9bc();});});}async['_sendBufferedOperations'](){const _0x4920e4=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x4920e4['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x256a84=[...this['_bufferedOperations']];for(const _0x2124f8 of _0x256a84)_0x2124f8['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2124f8);const _0x1bab80=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x256a84),_0x32513e=Q++,_0x424c51=this['_compressOperations'](_0x256a84),_0x3033e7=await this['_service']['sendOperations'](_0x424c51,_0x424c51['baseVersion'],_0x1bab80);try{return await this['_handleServerResponse'](_0x256a84,_0x3033e7,_0x32513e);}catch(_0x1a11ed){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1a11ed);}}async['_handleServerResponse'](_0x887b73,_0x195089,_0x40502d){if('error'in _0x195089)throw _0x195089['error'];let _0x848f8a=!0x1;if(_0x195089['wereChangesApplied']){_0x195089['lastOperationId']&&(this['_lastSyncedOperationId']=_0x195089['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2e2824=>!_0x887b73['includes'](_0x2e2824));for(const _0x223c01 of _0x887b73)_0x223c01['createdAt']='lastOperationAcceptedAt'in _0x195089&&_0x195089['lastOperationAcceptedAt']||void 0x0;Y(_0x887b73,_0x195089['version']-_0x887b73['length']),this['_updateServerHistory'](_0x887b73);const _0x458e22=_0x887b73['filter'](_0x2d3f2c=>{if(!_0x2d3f2c['_isInit'])return!0x1;const _0x911215=this['_getAffectedRoot'](_0x2d3f2c);return _0x911215&&!this['_knownRootNames']['has'](_0x911215);});Y(_0x458e22,this['_document']['version']),this['_applyOperationsSet'](_0x458e22),_0x848f8a=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5731c2=this['_decompressOperations'](_0x195089['data'],_0x195089['metadata'])['filter'](_0x576268=>_0x576268['baseVersion']>=this['_lastServerVersion']);_0x5731c2['forEach'](_0x5e2959=>this['_addKnownRoot'](_0x5e2959)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4e9f37=>!_0x4e9f37['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4e9f37))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5731c2),_0x848f8a=this['_handleExternalOperations'](_0x5731c2,_0x195089['version'],_0x195089['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x848f8a?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0xca580e,_0x3d6504,_0x51bd6f){try{const _0xa9b0dd={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x51325e,operationsB:_0xc30488,originalOperations:_0x2f9d32}=_0x234499(_0xca580e,this['_bufferedOperations'],_0xa9b0dd);Y(_0x51325e,this['_document']['version']),Y(_0xc30488,_0x3d6504);for(const _0xccb38c of _0x51325e){const _0xba41e2=_0x2f9d32['get'](_0xccb38c);_0xccb38c['_authorId']=_0xba41e2?_0xba41e2['_authorId']:null;}_0x51bd6f&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xca580e,_0x51bd6f),this['_lastSyncedOperationId']=_0x51bd6f),this['_bufferedOperations']=[..._0xc30488],this['_applyOperationsSet'](_0x51325e),this['_updateServerHistory'](_0xca580e);}catch(_0x591749){return console['error'](_0x591749),!0x1;}return!0x0;}['_applyOperationsSet'](_0x364632,_0x109174=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x580c50=>{for(const _0x4e3bb9 of _0x364632)this['_knownOperations']['add'](_0x4e3bb9),this['_addKnownRoot'](_0x4e3bb9),_0x580c50['batch']['addOperation'](_0x4e3bb9),this['editor']['model']['applyOperation'](_0x4e3bb9);});}['_addKnownRoot'](_0x231e29){const _0x2fbb6d=this['_getAffectedRoot'](_0x231e29);_0x2fbb6d&&this['_knownRootNames']['add'](_0x2fbb6d);}['_getAffectedRoot'](_0x3a2e69){let _0x34e8fe,_0x16636e;switch(_0x3a2e69['type']){case'insert':_0x34e8fe=_0x3a2e69['position']['root'];break;case'marker':if(_0x16636e=_0x3a2e69['newRange'],!_0x16636e)return null;_0x34e8fe=_0x16636e['root'];break;case'addRootAttribute':_0x34e8fe=_0x3a2e69['root'];break;case'addRoot':_0x34e8fe=_0x3a2e69['affectedSelectable'];break;case'move':_0x34e8fe=_0x3a2e69['targetPosition']['root'];break;default:return null;}return _0x34e8fe['rootName'];}['_updateServerHistory'](_0x21070c){_0x21070c['forEach'](_0x3b401f=>{const _0x3b53d7=_0x3b401f['clone']();_0x3b53d7['_authorId']=_0x3b401f['_authorId'],_0x3b53d7['_isInit']=!!_0x3b401f['_isInit'],_0x3b53d7['createdAt']=_0x3b401f['createdAt'],_0x3b53d7['baseVersion']+=this['_offset'],_0x3b401f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3b53d7),this['serverHistory']['addOperation'](_0x3b53d7);});}['_handleReconnectionError'](_0x1687f8){const _0x1ce4a0=this['editor']['plugins']['get']('Notification'),_0x2e76ad=this['editor']['locale'];_0x1687f8||(_0x1687f8=$(_0x2e76ad,'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.')),_0x1ce4a0['showWarning'](_0x1687f8,{'title':$(_0x2e76ad,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x52720a)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x52720a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0xe75acf){const _0x1de4b3=_0xe75acf['map'](_0x4777c4=>_0x4777c4['toJSON']());return this['_compressor']['compress'](_0x1de4b3);}['_decompressOperations'](_0x2083bf,_0x3311d8){return this['_compressor']['decompress'](_0x2083bf)['map']((_0x52599f,_0x19634c)=>{const _0x2a8bc7='init'==_0x3311d8[_0x19634c]['type'];if('InsertOperation'==_0x52599f['__className']){const _0x1fbdd7=_0x52599f['position']['root'];!this['_document']['getRoot'](_0x1fbdd7)&&(this['_document']['createRoot']('$root',_0x1fbdd7)['_isAttached']=!0x1);}const _0x1d590e=_0x13ad1b['fromJSON'](_0x52599f,this['_document']);return _0x1d590e['wasUndone']=_0x52599f['wasUndone'],_0x1d590e['_isInit']=_0x2a8bc7,_0x1d590e['_authorId']=_0x2a8bc7?null:_0x3311d8[_0x19634c]['userId'],_0x1d590e['_isDisconnection']='cs:removeUser'===_0x3311d8[_0x19634c]['type'],_0x1d590e['createdAt']=_0x3311d8[_0x19634c]['createdAt'],_0x1d590e;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3ab3d4=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3ab3d4&&_0x3ab3d4['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x89d104,_0x5ad60f){for(const _0x58834d of _0x89d104)_0x58834d['baseVersion']=_0x5ad60f++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0x36ce36){this['_ignoredOperations']=_0x36ce36,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x430b52){let _0x459bc2=_0x430b52['length'];for(;_0x459bc2--;){const _0x358561=_0x430b52[_0x459bc2];if(!this['_ignoredOperations']['has'](_0x358561)){if(!this['_operationToId']['has'](_0x358561)){const _0x1d1989=_0x3bb5a9()['slice'](0x1,0x12);this['_operationToId']['set'](_0x358561,_0x1d1989);}return this['_operationToId']['get'](_0x358561);}}}['setIdForTheLastOperation'](_0x22ffac,_0x58d64b){if(!_0x58d64b)return;let _0x3078ec=_0x22ffac['length'];for(;_0x3078ec--;){const _0x5dabda=_0x22ffac[_0x3078ec];this['_ignoredOperations']['has'](_0x5dabda)||this['_operationToId']['set'](_0x5dabda,_0x58d64b);}}}class a extends _0x160203{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x4ac1ff{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x9e5482)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x1d7a86];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x368531){super(_0x368531),this['_services']=new Map();}async['init'](){const _0xddb6f8=this['context'],_0x41a735=_0xddb6f8['plugins']['get']('CommentsRepository');if(_0xddb6f8['plugins']['get'](n)['addToReconnectionStack'](this),_0x41a735['adapter']={'addCommentThread':async({channelId:_0x53fae9,threadId:_0x4a33db,comments:_0x40b9f8,resolvedAt:_0x304b3b,resolvedBy:_0x3494eb,context:_0x5624bf,attributes:_0x13175c})=>{const _0x4568ee=await this['_getService'](_0x53fae9)['addCommentThread']({'commentThreadId':_0x4a33db,'comments':_0x40b9f8['map'](_0x1b45bf=>function(_0x11b5e1,_0x536d35,_0x2348e3){return{'commentThreadId':_0x2348e3,'commentId':_0x11b5e1['commentId'],'userId':_0x11b5e1['authorId'],'content':_0x11b5e1['content'],'documentId':_0x536d35,'createdAt':_0x11b5e1['createdAt'],'attributes':_0x11b5e1['attributes']||{}};}(_0x1b45bf,_0x53fae9,_0x4a33db)),'resolvedAt':_0x304b3b,'resolvedBy':_0x3494eb,'context':_0x5624bf,'attributes':_0x13175c})['catch'](at);return{'threadId':_0x4568ee['commentThreadId'],'comments':_0x4568ee['comments']};},'getCommentThread':async({channelId:_0x2cd4bf,threadId:_0x55c464})=>{const _0x23080c=await this['_getService'](_0x2cd4bf)['getCommentThread'](_0x55c464)['catch'](F)['catch'](at);return _0x23080c?_0x23080c['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x23080c]),{'threadId':_0x23080c['commentThreadId'],'comments':_0x23080c['comments']['map'](P),'context':_0x23080c['context'],'resolvedAt':_0x23080c['resolvedAt'],'resolvedBy':_0x23080c['resolvedBy'],'attributes':_0x23080c['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x479b50,threadId:_0x4b7a3f,context:_0x42b33f,unlinkedAt:_0x23fb96,attributes:_0xc98d1f})=>this['_getService'](_0x479b50)['updateCommentThread']({'commentThreadId':_0x4b7a3f,'context':_0x42b33f,'attributes':_0xc98d1f,'unlinkedAt':_0x23fb96})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x3d75f3,threadId:_0x3485d2})=>{const _0x256d04=await this['_getService'](_0x3d75f3)['resolveCommentThread'](_0x3485d2)['catch'](F)['catch'](at);return{'threadId':_0x256d04['commentThreadId'],'resolvedAt':_0x256d04['resolvedAt'],'resolvedBy':_0x256d04['resolvedBy']};},'reopenCommentThread':async({channelId:_0x1dad70,threadId:_0x1b7698})=>this['_getService'](_0x1dad70)['reopenCommentThread'](_0x1b7698)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x23faa6,threadId:_0x657a0})=>this['_getService'](_0x23faa6)['removeCommentThread'](_0x657a0)['catch'](F)['catch'](at),'addComment':({channelId:_0x373179,threadId:_0x2feadb,commentId:_0x480e74,content:_0x4200fd,attributes:_0x1032b6})=>this['_getService'](_0x373179)['addComment'](_0x2feadb,_0x480e74,_0x4200fd,_0x1032b6)['catch'](at),'updateComment':({channelId:_0x31dddb,threadId:_0x56f202,commentId:_0x2b9ac4,content:_0x53a402,attributes:_0x31fa91})=>this['_getService'](_0x31dddb)['updateComment'](_0x56f202,_0x2b9ac4,_0x53a402,_0x31fa91)['catch'](F)['catch'](at),'removeComment':({channelId:_0x1fc4db,threadId:_0x4964ee,commentId:_0x294ad2})=>this['_getService'](_0x1fc4db)['removeComment'](_0x4964ee,_0x294ad2)['catch'](F)['catch'](at)},_0xddb6f8 instanceof _0x11ac81){const _0x4f3585=_0xddb6f8['config']['get']('collaboration.channelId'),_0x32ae0a=_0xddb6f8['plugins']['get'](i);await this['_setUpService'](_0x4f3585);const _0x4dbaed=await this['_services']['get'](_0x4f3585)['getConnectedSessions']();this['listenTo'](_0x32ae0a,'sessionAdd:'+_0x4f3585,(_0x5e03fd,{session:_0x2a5849})=>{_0x2a5849['id']===_0x32ae0a['mySessionId']&&(_0x5e03fd['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2a5849['permissions'],_0x4f3585));}),_0x32ae0a['register'](_0x4f3585,_0x4dbaed);}}async['_setUpService'](_0x205f8b){if(this['_services']['has'](_0x205f8b))throw new _0x18bf15('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x205f8b});const _0x1cdfb7=this['context']['plugins']['get']('CommentsRepository'),_0x53297a=new s['CommentsService'](_0x205f8b);this['_services']['set'](_0x205f8b,_0x53297a),this['listenTo'](_0x53297a,'commentThreadAdded',(_0x5c6f78,_0x5937e5)=>{const {commentThreadId:_0xfb81b5,documentId:_0x54eeef,context:_0x2f80b8,attributes:_0x98e2eb,resolvedAt:_0x1502e4,resolvedBy:_0x308f9a,comments:_0x3c20c2}=_0x5937e5;_0x1cdfb7['getCommentThread'](_0xfb81b5)||_0x1cdfb7['addCommentThread']({'threadId':_0xfb81b5,'channelId':_0x54eeef,'comments':_0x3c20c2?_0x3c20c2['map'](P):[],'context':_0x2f80b8,'attributes':_0x98e2eb,'resolvedAt':_0x1502e4,'resolvedBy':_0x308f9a,'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadUpdated',(_0x292db3,{commentThreadId:_0x3a7dae,documentId:_0x370c29,context:_0x10832c,unlinkedAt:_0x5584e1,attributes:_0x2fd99d})=>{_0x1cdfb7['getCommentThread'](_0x3a7dae)&&_0x1cdfb7['updateCommentThread']({'threadId':_0x3a7dae,'channelId':_0x370c29,'context':_0x10832c,'unlinkedAt':_0x5584e1,'attributes':_0x2fd99d,'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadResolved',(_0x549ff7,{commentThreadId:_0x49a9a3,resolvedBy:_0x360c08,resolvedAt:_0x1af1f0})=>{const _0x14981f=_0x1cdfb7['getCommentThread'](_0x49a9a3);_0x14981f&&_0x14981f['resolve']({'resolvedBy':_0x360c08,'resolvedAt':_0x1af1f0,'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadReopened',(_0x78b655,{commentThreadId:_0x90f482})=>{const _0x2b19c5=_0x1cdfb7['getCommentThread'](_0x90f482);_0x2b19c5&&_0x2b19c5['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentThreadRemoved',(_0x425b63,{commentThreadId:_0x205f39})=>{const _0x555f69=_0x1cdfb7['getCommentThread'](_0x205f39);_0x555f69&&_0x555f69['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentAdded',(_0x2a8436,_0x1a2f31)=>{const _0x4d5d76=_0x1a2f31['commentThreadId'],_0x1a6e5f=_0x1cdfb7['getCommentThread'](_0x4d5d76);_0x1a6e5f&&_0x1a6e5f['addComment']({...P(_0x1a2f31),'isFromAdapter':!0x0});}),this['listenTo'](_0x53297a,'commentUpdated',(_0x20e17c,{commentThreadId:_0x620413,commentId:_0x39dc7e,content:_0x1e9323,attributes:_0x271246})=>{const _0x1c0c15=_0x1cdfb7['getCommentThread'](_0x620413);if(_0x1c0c15){const _0x3b9943=_0x1c0c15['getComment'](_0x39dc7e);_0x3b9943&&_0x3b9943['update']({'content':_0x1e9323,'attributes':_0x271246,'isFromAdapter':!0x0});}}),this['listenTo'](_0x53297a,'commentRemoved',(_0x2a899a,{commentThreadId:_0x5b35f4,commentId:_0x5993f9})=>{const _0x11b3ae=_0x1cdfb7['getCommentThread'](_0x5b35f4);if(_0x11b3ae){const _0x12fafa=_0x11b3ae['getComment'](_0x5993f9);_0x12fafa&&_0x12fafa['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x205f8b);}['destroy'](){if(this['context']instanceof _0x11ac81){const _0x4a2a37=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4a2a37);}}['_terminateService'](_0x4e23b9){if(!this['_services']['has'](_0x4e23b9))throw new _0x18bf15('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4e23b9});this['_getService'](_0x4e23b9)['disconnect'](),this['_services']['delete'](_0x4e23b9);}async['reconnect'](){for(const _0x166cb0 of this['_services']['keys']())await this['_connectService'](_0x166cb0);if(this['context']instanceof _0x11ac81){const _0x3d8557=this['context']['config']['get']('collaboration.channelId'),_0x4c62a0=this['context']['plugins']['get'](i);_0x4c62a0['unregister'](_0x3d8557);const _0x4d69a0=await this['_services']['get'](_0x3d8557)['getConnectedSessions']();_0x4c62a0['register'](_0x3d8557,_0x4d69a0);}}async['_connectService'](_0x2afa0b){const {connection:_0x1c0b63}=this['context']['plugins']['get'](n),_0x3e30c3=this['context']['plugins']['get']('CommentsRepository'),_0x3478d3=this['_services']['get'](_0x2afa0b),_0x4073b1=await _0x3478d3['connect'](_0x1c0b63);await this['_fetchMissingUsersForThreads'](_0x4073b1);const _0x5bc8d3=new Set(Array['from'](_0x3e30c3['getCommentThreads']({'channelId':_0x2afa0b}),_0x2d5481=>_0x2d5481['id']));for(const _0x25b6ce of _0x4073b1)_0x25b6ce['deletedAt']||_0x5bc8d3['delete'](_0x25b6ce['commentThreadId']);for(const _0x2de1b7 of _0x5bc8d3)_0x3e30c3['getCommentThread'](_0x2de1b7)['remove']({'isFromAdapter':!0x0});for(const _0x63d6bb of _0x4073b1){let _0x55e5f2=_0x3e30c3['getCommentThread'](_0x63d6bb['commentThreadId']);const {commentThreadId:_0x5a8ea5,context:_0x542b00,attributes:_0x4715ff,resolvedBy:_0x36fbd1,resolvedAt:_0x367fb6,unlinkedAt:_0x3ced01,deletedAt:_0x537eb1}=_0x63d6bb;if(_0x537eb1)continue;_0x55e5f2||(_0x55e5f2=_0x3e30c3['addCommentThread']({'channelId':_0x2afa0b,'threadId':_0x5a8ea5,'context':_0x542b00,'attributes':_0x4715ff||{},'resolvedBy':_0x36fbd1,'resolvedAt':_0x367fb6,'unlinkedAt':_0x3ced01,'isFromAdapter':!0x0}));const _0x551d73=new Set(Array['from'](_0x55e5f2['comments'],_0xb497c4=>_0xb497c4['id']));for(const _0xbf273e of _0x63d6bb['comments'])_0x551d73['delete'](_0xbf273e['commentId']);for(const _0x40038c of _0x551d73)_0x55e5f2['getComment'](_0x40038c)['remove']({'isFromAdapter':!0x0});for(const _0x57418a of _0x63d6bb['comments']){const _0x5679c6=_0x55e5f2['getComment'](_0x57418a['commentId']);_0x5679c6?_0x5679c6['content']!==_0x57418a['content']&&_0x5679c6['update']({'content':_0x57418a['content'],'isFromAdapter':!0x0}):_0x55e5f2['addComment'](Object['assign'](P(_0x57418a),{'isFromAdapter':!0x0}));}}}['_getService'](_0x2f455a){if(!this['_services']['has'](_0x2f455a))throw new _0x18bf15('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x2f455a});return this['_services']['get'](_0x2f455a);}async['_fetchMissingUsersForThreads'](_0x36fa9c){const _0x236d07=this['context']['plugins']['get'](_0x1d7a86),{connection:_0x2db4d9}=this['context']['plugins']['get'](n),_0x19ad62=new Set();for(const {resolvedBy:_0x4a903e,comments:_0x4b5e66}of _0x36fa9c){_0x4a903e&&!_0x236d07['getUser'](_0x4a903e)&&_0x19ad62['add'](_0x4a903e);for(const {userId:_0x3c38ef}of _0x4b5e66)_0x236d07['getUser'](_0x3c38ef)||_0x19ad62['add'](_0x3c38ef);}if(0x0===_0x19ad62['size'])return;const _0x25f5fc=await ct['getMany'](_0x2db4d9,Array['from'](_0x19ad62));for(const _0x49be0e of _0x25f5fc)_0x236d07['getUser'](_0x49be0e['id'])||_0x236d07['addUser'](_0x49be0e);}}async function F(_0x4514dd){if('404'!==_0x4514dd['code'])throw _0x4514dd;}function at(_0x375dbf){if((_0x2e2757=_0x375dbf)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2e2757['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2e2757['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2e2757;throw _0x375dbf;}function P(_0xea7029){return{'threadId':_0xea7029['commentThreadId'],'commentId':_0xea7029['commentId'],'content':_0xea7029['content'],'createdAt':_0xea7029['createdAt'],'authorId':_0xea7029['userId'],'attributes':_0xea7029['attributes']||{}};}class m extends _0x160203{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x31a884)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x1d7a86];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x289f27){super(_0x289f27);const _0x576b76=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x576b76);}async['init'](){const _0x5cb238=this['editor']['plugins']['get'](l),_0x3af6aa=_0x5cb238['serverHistory'],_0x4860b2=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x3af6aa,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5cb238['sessionId']});const _0x2a5a41=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0xd6c89e=await _0x431abb['isBundleUploaded'](_0x4860b2['connection'],_0x2a5a41);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3670d2})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3670d2)),'updateRevisions':async _0x236283=>{await this['_waitForServiceReady']();const _0x644b31=this['_revisionTracker']['currentRevision'];if(_0xd6c89e&&0x1===_0x236283['length']&&_0x236283[0x0]['id']===_0x644b31['id'])return _0x236283;for(const _0x4fe53b of _0x236283)_0x4fe53b['id']===_0x644b31['id']&&(_0x4fe53b['isEmptyCurrent']=_0x4fe53b['fromVersion']===_0x4fe53b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x236283,this['_lastRequestId'])['then'](_0xa1b26a=>(this['_lastRequestId']=_0xa1b26a,_0x236283))['catch'](_0x27ed5a=>{if(I(_0x27ed5a)||'400'===_0x27ed5a['code']&&void 0x0!==_0x27ed5a['data']['wrongRequestId']){for(const _0x238de4 of _0x236283){!this['_revisionTracker']['repository']['getRevision'](_0x238de4['id'])||this['_revisionTracker']['_bufferUpdate'](_0x238de4['id'],_0x238de4,!0x1);}if(I(_0x27ed5a))throw _0x27ed5a;return _0x236283;}throw _0x27ed5a;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4146f0,{revisionsData:_0x2243d0,requestId:_0x21bd5b})=>{Math['max'](..._0x2243d0['map'](_0x2da9d8=>_0x2da9d8['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2243d0,_0x21bd5b);}):this['_handleRevisionsUpdate'](_0x2243d0,_0x21bd5b);});const {revisions:_0x3bd3a5,requestId:_0x2dd973}=await this['_revisionHistoryService']['connect'](_0x4860b2['connection']);_0x4860b2['addToReconnectionStack'](this),this['_lastRequestId']=_0x2dd973,await this['_fetchMissingUsers'](_0x3bd3a5);for(const _0x3ce85b of _0x3bd3a5)this['_revisionTracker']['addRevisionData'](_0x3ce85b);this['listenTo'](_0x5cb238,'change:_isConnected',(_0x5cb7da,_0x3993e8,_0xe65e6a)=>{_0xe65e6a&&(this['_oldOffset']=_0x5cb238['_offset'],_0x5cb7da['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4860b2,'state',_0x5e57f0=>_0x5e57f0===_0x46f1ff['CONNECTED']);}async['reconnect'](){const _0x5ce044=this['editor']['plugins']['get'](n),_0x45cb89=this['editor']['plugins']['get'](l),_0x56bc6a=async()=>{const _0x27a5bb=this['_revisionTracker']['currentRevision'],_0x188c9b=_0x27a5bb['id'],_0xe46d23=_0x188c9b!==_0x45cb89['sessionId'];if(_0xe46d23){const _0x8893f4=_0x45cb89['_offset']-this['_oldOffset'],_0x147de3=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x27a5bb['toVersion']+_0x8893f4!==_0x147de3){const _0x2ef377=_0x27a5bb['fromVersion']+_0x8893f4,_0x23ed7c=this['editor']['plugins']['get'](_0x1d7a86),_0x135e09=this['_revisionTracker']['buildRevisionData']({'revision':_0x27a5bb,'from':_0x2ef377,'to':_0x147de3});_0x135e09['id']=_0x27a5bb['id'];const _0x5389af=_0x135e09['authorsIds']['map'](_0x237a79=>_0x23ed7c['getUser'](_0x237a79));_0x27a5bb['_update']({..._0x135e09,'authors':_0x5389af},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x27a5bb['id'],_0x135e09,!0x0);}this['_revisionTracker']['_startingVersion']=_0x147de3,(_0x27a5bb['toVersion']===_0x27a5bb['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x188c9b)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x188c9b),this['_revisionTracker']['_createCurrentRevision'](_0x147de3));}const {revisions:_0x318ea2,requestId:_0xe4cad1}=await this['_revisionHistoryService']['reconnect'](_0x5ce044['connection'],this['_lastRequestId']);_0xe46d23&&_0x318ea2['length']>0x0?_0x45cb89['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x318ea2),this['_handleRevisionsUpdate'](_0x318ea2,_0xe4cad1),this['_revisionTracker']['sendBufferedUpdates']());};return _0x45cb89['_isConnected']?_0x56bc6a():new Promise((_0x39077b,_0x5418fd)=>{_0x45cb89['once']('change:_isConnected',()=>{_0x56bc6a()['then'](_0x39077b)['catch'](_0x5418fd);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x3d335d=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x49d6a9=>{_0x49d6a9['off'](),_0x3d335d();});});}['_getLatestVersionFromServerOperations'](){const _0x161d6c=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2fa19d of _0x161d6c)if('marker'!==_0x2fa19d['type']||_0x2fa19d['affectsData'])return _0x2fa19d['baseVersion']+0x1;}['_getLatestVersion'](){const _0x54d880=this['editor']['plugins']['get'](l);return new Promise(_0x2fa020=>{_0x54d880['_isPendingUpdate']?_0x54d880['once']('change:_isPendingUpdate',()=>{_0x2fa020(this['_getLatestVersionFromServerOperations']());}):_0x2fa020(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x5758ac,_0x57a11e){const _0x278b66=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x57a11e;for(const _0x4ea32e of _0x5758ac){const _0x25707c=_0x278b66['getRevision'](_0x4ea32e['id']);if(_0x25707c){if((_0x4ea32e['fromVersion']||_0x4ea32e['toVersion'])&&(_0x4ea32e['diffData']=null),_0x25707c===this['_revisionTracker']['currentRevision']){const _0x31ab34=Math['max'](_0x25707c['toVersion'],_0x4ea32e['toVersion']),_0x39012b=Math['max'](_0x25707c['fromVersion'],_0x4ea32e['fromVersion']);let _0x2cdc4e;_0x25707c['toVersion']===_0x4ea32e['toVersion']&&_0x25707c['fromVersion']===_0x4ea32e['fromVersion']?(_0x2cdc4e=!0x0,this['_preventResendingRevisionData'](_0x4ea32e)):_0x4ea32e['toVersion']===_0x31ab34&&_0x4ea32e['fromVersion']===_0x39012b?_0x2cdc4e=!0x1:(_0x25707c['toVersion']===_0x31ab34&&_0x25707c['fromVersion']===_0x39012b||this['_fixRevision']({'revision':_0x25707c,'from':_0x39012b,'to':_0x31ab34}),_0x2cdc4e=!0x0),_0x2cdc4e&&(delete _0x4ea32e['fromVersion'],delete _0x4ea32e['toVersion'],delete _0x4ea32e['diffData'],delete _0x4ea32e['createdAt'],delete _0x4ea32e['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x4ea32e),this['_preventResendingRevisionData'](_0x4ea32e);}else this['_revisionTracker']['addRevisionData'](_0x4ea32e);}const _0x401a4b=_0x278b66['getRevisions']();_0x401a4b['reverse']();for(let _0x1fdc89=0x0;_0x1fdc89<_0x401a4b['length']-0x1;_0x1fdc89++){const _0x2dc837=_0x401a4b[_0x1fdc89],_0x2c8bac=_0x401a4b[_0x1fdc89+0x1];if(_0x2dc837['fromVersion']<_0x2c8bac['toVersion']){const _0x5e5fde=_0x2c8bac['toVersion'],_0x592514=Math['max'](_0x5e5fde,_0x2dc837['toVersion']);this['_fixRevision']({'revision':_0x2dc837,'from':_0x5e5fde,'to':_0x592514});}}}['_fixRevision']({revision:_0x924ff,from:_0x22ece5,to:_0x3a935d}={}){const _0x113637=this['editor']['plugins']['get'](_0x1d7a86),_0x4897e8=this['_revisionTracker']['buildRevisionData']({'revision':_0x924ff,'from':_0x22ece5,'to':_0x3a935d});_0x4897e8['authors']=_0x4897e8['authorsIds']['map'](_0x2007ec=>_0x113637['getUser'](_0x2007ec)),_0x924ff['_update'](_0x4897e8);}['_preventResendingRevisionData'](_0x120b3b){const _0x1f18c6={};_0x1f18c6['id']=_0x120b3b['id'];for(const _0x300680 of Object['keys'](_0x120b3b))'id'!==_0x300680&&(_0x1f18c6[_0x300680]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1f18c6['id'],_0x1f18c6,!0x0);}async['_fetchMissingUsers'](_0x34a1aa){const _0x36080f=this['editor']['plugins']['get'](_0x1d7a86),{connection:_0x12f1f6}=this['editor']['plugins']['get'](n),_0x168155=new Set();for(const _0x301d36 of _0x34a1aa){for(const _0x14f2bf of _0x301d36['authorsIds'])_0x5cf8ac(_0x14f2bf);_0x301d36['creatorId']&&_0x5cf8ac(_0x301d36['creatorId']);}if(0x0===_0x168155['size'])return;const _0xa431d=await ct['getMany'](_0x12f1f6,Array['from'](_0x168155));for(const _0x239919 of _0xa431d)_0x36080f['getUser'](_0x239919['id'])||_0x36080f['addUser'](_0x239919);function _0x5cf8ac(_0x4318de){_0x36080f['getUser'](_0x4318de)||_0x168155['add'](_0x4318de);}}}function I(_0x37510f){return _0x37510f['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x37510f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x37510f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x160203{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x56bb97{['_collapseAt'];constructor(_0x592a71,_0x1f841f=0x6){super(_0x592a71);const _0x3a8006=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1f841f,this['bind']('isHidden')['to'](this,'usersCount',_0x548009=>_0x548009<_0x1f841f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3a8006['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':_0x3a8006['to']('usersCount',_0x38c5f9=>'+'+(_0x38c5f9-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x56bb97{['items'];['keystrokes'];constructor(_0x485b7b){super(_0x485b7b);const _0x44d419=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x13a22f(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x44d419['if']('hasPopup'),'aria-expanded':_0x44d419['to']('isExpanded',_0x351616=>this['hasPopup']&&String(_0x351616)),'aria-label':_0x44d419['to']('hasPopup',_0x3a9114=>$(_0x485b7b,_0x3a9114?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x44d419['to']('hasPopup',_0x2afd30=>!!_0x2afd30&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x44d419['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x44d419['to'](_0x31bd80=>{const _0x1e7ff7=_0x31bd80,_0x4672e9=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4d8e30=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4672e9?.['contains'](_0x1e7ff7['relatedTarget'])||_0x4d8e30?.['contains'](_0x1e7ff7['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x5db902,_0x516904,_0x3e72fd)=>{this['element']&&(_0x3e72fd?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x56bb97{['counterView'];['inlineListView'];constructor(_0x18fa03,_0x4355c4=0x6){super(_0x18fa03);const _0x593e12=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x4355c4),this['inlineListView']=new is(_0x18fa03),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2ffc71 of this['inlineListView']['items'])_0x2ffc71['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',_0x593e12['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x56bb97{['listWrapperView'];constructor(_0x476b02,_0x5a39cd){super(_0x476b02);const _0x2e88ec=this['bindTemplate'];this['listWrapperView']=new ut(_0x476b02,_0x5a39cd),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x476b02,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x2e88ec['to'](_0x3f344d=>{const _0x4b24a9=_0x3f344d,_0x386b35=document['querySelector']('.ck-presence-list__list'),_0x3e406a=document['querySelector']('.ck-balloon-panel_with-arrow');_0x386b35?.['contains'](_0x4b24a9['relatedTarget'])||_0x3e406a?.['contains'](_0x4b24a9['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x3c678d{constructor(_0x548fd8,_0x785841){super(_0x548fd8);const _0x3bda3c=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x785841?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3bda3c['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3bda3c['to']('role'),'aria-label':_0x3bda3c['to']('ariaLabel'),'aria-labelledby':_0x3bda3c['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3deb78['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5b850f=this['element'];_0x5b850f&&(this['_isScrollable']=Math['max'](_0x5b850f['scrollHeight'],_0x5b850f['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0xcec225,_0x434c5f,_0xd67785){super(_0xcec225);const _0x21da83=this['bindTemplate'];this['userView']=new st(_0xcec225,_0x434c5f);const _0x48ce7d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x434c5f['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x434c5f['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x434c5f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xd67785&&(_0x48ce7d['tag']='button',_0x48ce7d['on']={'click':_0x21da83['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x48ce7d);}['focus'](){this['element']['focus']();}}class A extends _0x56bb97{['userView'];['markerView'];constructor(_0x54f6fb,_0x4f7ad3,_0xafc729){super(_0x54f6fb);const _0x104001=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x54f6fb,_0x4f7ad3),this['markerView']=new ot(_0x54f6fb,_0x4f7ad3);const _0x54fc95=new it(_0x54f6fb);_0x54fc95['template']['tag']='span',_0x54fc95['text']=_0x4f7ad3['name'];const _0x25b5fe={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x104001['to']('isFocusable',_0x1315ef=>!!_0x1315ef&&0x0),'aria-labelledby':_0x54fc95['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x104001['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x104001['to']('hasTooltip',_0x1fc5a6=>!_0x1fc5a6),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x54fc95]};_0xafc729&&(_0x25b5fe['tag']='button',_0x25b5fe['on']={'click':_0x104001['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x25b5fe);}}class ot extends _0x56bb97{constructor(_0x5ac035,_0x4e1223){super(_0x5ac035),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4e1223['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x4ac1ff{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30241b){super(_0x30241b),this['context']['config']['define']('presenceList',x);const _0x3e7b51=_0x30241b['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3e7b51)throw new _0x18bf15('presencelist-collapseat-invalid-format',this);if(_0x3e7b51<0x1)throw new _0x18bf15('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x410c43(),this['balloonPanelView']=new _0x398ac4(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x20b052 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x20b052);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4a61ae,_0x3bbacd)=>{this['_handleUserAdd'](_0x3bbacd);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x14eb2d,_0x433cdc)=>{this['_handleUserRemove'](_0x433cdc);});}['_createView'](){const _0x287900=this['context'],_0x8031a2=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x11959d=this['balloonPanelView'];if(!_0x339925(_0x287900['config']['get']('presenceList.container')))throw new _0x18bf15('presencelist-missing-container',this);return _0x8031a2['counterView']['bind']('usersCount')['to'](this),_0x8031a2['bind']('isCollapsed')['to'](this,'usersCount',_0x3b9b79=>{const {collapseAt:_0x17ba23}=_0x287900['config']['get']('presenceList'),_0x1dd233=_0x3b9b79>=_0x17ba23;if(_0x1dd233&&!_0x8031a2['inlineListView']['items']['find'](_0xc06b22=>_0xc06b22 instanceof b)){const _0x9040b2=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x9040b2&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x8031a2['inlineListView']['items']['add'](_0x8031a2['counterView']);}return _0x1dd233||this['hideDropdown'](),_0x1dd233;}),_0x8031a2['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x43b174=>{const _0x4fef71=_0x287900['config']['get']('presenceList'),_0x2e6554=new A(_0x287900['locale'],_0x43b174,!!_0x4fef71['onClick']);return _0x2e6554['bind']('hasTooltip')['to'](_0x8031a2,'isCollapsed',_0x467362=>!_0x467362),_0x2e6554['bind']('isFocusable')['to'](_0x8031a2,'isCollapsed',_0x1abb37=>!_0x1abb37),_0x4fef71['onClick']&&this['listenTo'](_0x2e6554,'execute',()=>{this['view']['isCollapsed']||_0x4fef71['onClick'](_0x43b174,_0x2e6554['element']);}),_0x2e6554;}),this['listenTo'](_0x8031a2['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x8031a2['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x8031a2['inlineListView']['keystrokes']['set']('Enter',(_0x2525f2,_0x2737b3)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2737b3());}),_0x8031a2['render'](),_0x11959d['render'](),_0x196e8e({'emitter':_0x8031a2,'activator':()=>_0x11959d['isVisible'],'contextElements':[_0x11959d['element'],_0x8031a2['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x287900['config']['get']('presenceList.container')['appendChild'](_0x8031a2['element']),this['_bodyCollection']=new _0x5280fe(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x8031a2;}['_handleUserAdd'](_0x393cff){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x393cff['isMe'])return;const _0x1ae168=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x1ae168-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x90d4ef=_0x393cff['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x393cff,_0x90d4ef);}['_handleUserRemove'](_0x50b988){this['usersCount']--;const {collapseAt:_0x19961a}=this['context']['config']['get']('presenceList'),_0x1f83e9=this['usersCount']>=_0x19961a;if(this['currentDisplayedUsers']['get'](_0x50b988['id']))this['currentDisplayedUsers']['remove'](_0x50b988['id']);else{if(_0x1f83e9&&this['currentDisplayedUsers']['length']+0x1===_0x19961a-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1f83e9?0x1:0x0)<this['usersCount']){for(const _0x5a313f of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5a313f['id'])&&(this['currentDisplayedUsers']['add'](_0x5a313f,Math['min'](this['currentDisplayedUsers']['length']-(_0x1f83e9?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1f83e9?0x1:0x0)===_0x19961a-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x23e952=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x23e952['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x21535c}=this['presenceDropdownView'];_0x21535c['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4e30e9=>{if(!_0x23e952['displayMe']&&_0x4e30e9['isMe'])return null;const _0x23d1d5=new j(this['context']['locale'],_0x4e30e9,!!_0x23e952['onClick']);return _0x23e952['onClick']&&this['listenTo'](_0x23d1d5,'execute',()=>{_0x23e952['onClick'](_0x4e30e9,_0x23d1d5['element']);}),_0x23d1d5;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x21535c['focus'](),_0x21535c['checkIfScrollable']();const _0x27e5c9=(_0x3093ec,_0x48fc2d)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x48fc2d();};_0x21535c['keystrokes']['set']('Esc',_0x27e5c9),_0x21535c['keystrokes']['set']('Shift+Tab',_0x27e5c9),_0x21535c['keystrokes']['set']('Tab',(_0x3d1b29,_0x1cc033)=>{!function(_0x30ce00){const _0x178c8d=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x186113=>_0x186113+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x604663=[...document['body']['querySelectorAll'](_0x178c8d)]['filter'](_0x4a5aa8=>_0x4a5aa8===document['activeElement']||_0x4a5aa8['offsetWidth']+_0x4a5aa8['offsetHeight']>0x0)['sort']((_0x3cf6c8,_0x38c42c)=>(_0x3cf6c8['tabIndex']||0x0)-(_0x38c42c['tabIndex']||0x0)),_0x5b6b1d=_0x604663['indexOf'](_0x30ce00),_0x4c8392=_0x604663[(_0x5b6b1d+0x1)%_0x604663['length']];_0x4c8392&&_0x4c8392['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1cc033();}),_0x21535c['focusTracker']['add'](this['view']['element']),_0x21535c['focusTracker']['on']('change:isFocused',(_0x3eb92b,_0x5dbe0d,_0x59f1af)=>{_0x59f1af||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0x4ac1ff{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
|
23
|
+
import{ContextPlugin as _0x5b3d3d,Plugin as _0x38fa51,PendingActions as _0x353cb1,Context as _0x39648d}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x5a6129,CKEditorError as _0x3c299b,Collection as _0x3e4b61,global as _0x166590,version as nt,uid as _0x1b3102,KeystrokeHandler as _0x4cb197}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0xc37cde,View as _0x2e7f59,ListView as _0x189eb0,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x2f1aa7,clickOutsideHandler as _0x47fb05,BodyCollection as _0x115a40}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x57d69b,History as _0x5f4adf,NoOperation as _0x249d09,InsertOperation as _0xa284d2,MarkerOperation as _0x552db8,RootAttributeOperation as _0x1defe4,transformOperationSets as _0x2ea55e,OperationFactory as _0x13e959}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x1eb7a7,User as lt,CommentsService as _0x4b6acc,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x43f46f,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x357efb}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x420389}from'es-toolkit/compat';class n extends _0x5b3d3d{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0xc37cde];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1933cb){super(_0x1933cb),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x5a6129())();}['init'](){const _0xe15243=this['context'],_0x435216=_0xe15243['plugins']['get']('CloudServices'),_0x594bf8=_0xe15243['plugins']['get'](_0xc37cde);if(!_0x435216['token'])throw new _0x3c299b('websocketgateway-missing-token',this);if(!_0x435216['webSocketUrl'])throw new _0x3c299b('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x435216['token'],_0x435216['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x150613=>{if(this['connection']=_0x150613,this['bind']('state')['to'](_0x150613,'state',this,'_isBrowserOffline',(_0x4262f3,_0xc26b52)=>('connected'!==_0x4262f3&&(this['_shouldPluginsReconnect']=!0x0),_0xc26b52||_0x4262f3!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0xdd8bff,_0x18fd56)=>{if('limitExceeded'!==_0x18fd56['code'])throw console['error'](_0x18fd56),new _0x3c299b('cloudservices-init',null,{'originalError':_0x18fd56});_0x594bf8['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'});}),!_0x150613['me'])return new Promise(_0x40356c=>_0x150613['on']('change:me',_0x40356c));})['catch'](_0x461672=>{throw console['error'](_0x461672),new _0x3c299b('cloudservices-init',null,{'originalError':_0x461672});});}['addToReconnectionStack'](_0x19a90f){if('function'!=typeof _0x19a90f['reconnect'])throw new _0x3c299b('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x19a90f))throw new _0x3c299b('websocketgateway-plugin-already-registered',this,{'name':_0x19a90f['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x19a90f);}['removeFromReconnectionStack'](_0xec446e){this['_reconnectionStack']['delete'](_0xec446e);}['isInReconnectionStack'](_0x4d8984){return this['_reconnectionStack']['has'](_0x4d8984);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0xd5e428=>_0xd5e428['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x4cb39f=>{throw console['error'](_0x4cb39f),new _0x3c299b('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x5b3d3d{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x43f46f];}constructor(_0x40855b){super(_0x40855b),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x3e4b61(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x43f46f);}['init'](){const _0x2661ee=this['context']['plugins']['get'](n);this['listenTo'](_0x2661ee,'change:state',(_0x47f5c7,_0x52bc23,_0x476b64)=>{if('connected'!==_0x476b64)this['channelSessions']['forEach'](_0x5469ef=>_0x5469ef['clear']()),this['channelConnectedUsers']['forEach'](_0x3cb419=>_0x3cb419['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x269ec9,_0x4319c6]of this['_registeredSessions'])for(const _0xcc0996 of _0x4319c6)this['_handleSessionAdd'](_0x269ec9,_0xcc0996);}}),this['_createUser'](_0x2661ee['connection']['me'],!0x0);}['register'](_0x55b09f,_0xe4a20f){if(this['_registeredSessions']['has'](_0x55b09f))throw new _0x3c299b('sessions-register-already-registered',null,{'channelId':_0x55b09f});this['_registeredSessions']['set'](_0x55b09f,_0xe4a20f),this['channelSessions']['set'](_0x55b09f,new _0x3e4b61()),this['channelConnectedUsers']['set'](_0x55b09f,new _0x3e4b61()),this['listenTo'](_0xe4a20f,'add',(_0x34c873,_0x164daf)=>this['_handleSessionAdd'](_0x55b09f,_0x164daf)),this['listenTo'](_0xe4a20f,'remove',(_0x5b540b,_0x156c4b)=>this['_handleSessionRemove'](_0x55b09f,_0x156c4b));for(const _0x79bdb0 of _0xe4a20f)this['_handleSessionAdd'](_0x55b09f,_0x79bdb0);}['unregister'](_0x45cb0c){if(!this['_registeredSessions']['has'](_0x45cb0c))throw new _0x3c299b('sessions-unregister-not-exist',null,{'channelId':_0x45cb0c});const _0x10d146=this['_registeredSessions']['get'](_0x45cb0c);this['stopListening'](_0x10d146);for(const _0x48770e of _0x10d146)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x45cb0c,_0x48770e);this['_registeredSessions']['delete'](_0x45cb0c),this['channelSessions']['delete'](_0x45cb0c),this['channelConnectedUsers']['delete'](_0x45cb0c);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x4c7e8d){for(const _0x12dfa6 of this['channelSessions']['values']())for(const _0x493253 of _0x12dfa6)if(_0x493253['id']===_0x4c7e8d)return _0x493253['user'];}['getUserSessions'](_0x59e388,_0x3ee410){const _0x936289=_0x3ee410?[this['channelSessions']['get'](_0x3ee410)]:this['channelSessions']['values'](),_0x5efb0e=new Set();for(const _0x4076de of _0x936289)for(const _0x3598ad of _0x4076de)_0x3598ad['user']['id']===_0x59e388['id']&&_0x5efb0e['add'](_0x3598ad['id']);return _0x5efb0e;}['getUserRole'](_0x1e33f4){for(const _0xbe400b of this['channelSessions']['values']())for(const _0x46aa11 of _0xbe400b)if(_0x46aa11['user']===_0x1e33f4)return _0x46aa11['role'];}['_handleSessionAdd'](_0x5d8f3f,_0xbc77f3){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x279a03=_0xbc77f3['user'],_0x49acc1=this['_users']['getUser'](_0x279a03['id'])||this['_createUser'](_0x279a03),_0x39fa9e=Object['assign']({},_0xbc77f3,{'user':_0x49acc1});if(this['channelSessions']['get'](_0x5d8f3f)['add'](_0x39fa9e),!_0x279a03['hiddenInPresenceList']){const _0x1f9e1f=this['channelConnectedUsers']['get'](_0x5d8f3f);_0x1f9e1f['has'](_0x49acc1['id'])||_0x1f9e1f['add'](_0x49acc1),this['allConnectedUsers']['has'](_0x49acc1['id'])||_0x279a03['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x49acc1,_0x49acc1['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x5d8f3f,{'channelId':_0x5d8f3f,'session':_0x39fa9e});}['_handleSessionRemove'](_0x1efa03,_0x2f6838){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x291af4=this['channelConnectedUsers']['get'](_0x1efa03),_0x1ed50d=_0x2f6838['user'];_0x1ed50d['id']&&(this['channelSessions']['get'](_0x1efa03)['remove'](_0x2f6838['id']),_0x291af4['has'](_0x1ed50d['id'])&&!this['getUserSessions'](_0x1ed50d,_0x1efa03)['size']&&_0x291af4['remove'](_0x1ed50d['id']),this['allConnectedUsers']['get'](_0x1ed50d['id'])&&!this['getUserSessions'](_0x1ed50d)['size']&&this['allConnectedUsers']['remove'](_0x1ed50d['id']));}['_createUser'](_0x4860bd,_0x453b5b){const _0x1ec7b0=this['_users']['addUser'](_0x4860bd);return _0x453b5b&&this['_users']['defineMe'](_0x4860bd['id']),_0x1ec7b0['orderNumber']=this['_uniqueUsersCount']++,_0x1ec7b0;}}class V extends _0x38fa51{['_domEmitter']=new(_0x5a6129())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x15090b=this['editor'],_0x3c7003=_0x15090b['plugins']['get'](i);_0x15090b['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x4cca01,{writer:_0x3f70a0})=>function(_0x4c9111,_0xbc80fe,_0x2cc0d4,_0x3bc77d){const _0x143d49=_0x4c9111['markerName']['split'](':')[0x2],_0x68f7f5=_0x2cc0d4['getUserBySessionId'](_0x143d49);if(!_0x68f7f5||_0x143d49===_0x2cc0d4['mySessionId'])return;if(!_0x3bc77d['model']['schema']['checkChild'](_0x4c9111['markerRange']['start'],'$text'))return;const _0x11b0fa={'class':'ck-user__marker\x20'+_0x68f7f5['color']['getMarkerClass'](),'data-name':_0x68f7f5['name'],'data-session-id':_0x143d49},_0x47dcf7=_0x3bc77d['model']['markers']['get'](_0x4c9111['markerName']),_0xe501f2=_0x47dcf7['getStart'](),_0x1093af=_0xe501f2['nodeAfter'],_0x3990f8=_0x3bc77d['model']['schema'];if(_0x1093af&&_0x3990f8['isObject'](_0x1093af)&&_0x3990f8['isInline'](_0x1093af)&&!_0x3bc77d['model']['markers']['get']('user:range:'+_0x143d49)['getRange']()['isCollapsed'])return;const _0x4495cc=_0xe501f2['parent'];return _0x3bc77d['model']['schema']['isLimit'](_0x4495cc)&&!_0x3bc77d['model']['hasContent'](_0x4495cc)&&(_0x11b0fa['contenteditable']=!0x1),function(_0x42f6eb,_0x2c1b8b,_0x3e9154){const _0x1116c9=_0x42f6eb['createUIElement']('span',_0x2c1b8b);return _0x42f6eb['setCustomProperty']('userPositionMarker',!0x0,_0x1116c9),_0x1116c9['render']=function(_0x336566){const _0x59a9c0=this['toDomElement'](_0x336566),_0x443eee=document['createElement']('span');return _0x443eee['classList']['add']('ck-user__marker-tooltip'),_0x443eee['setAttribute']('contenteditable','false'),_0x443eee['setAttribute']('spellcheck','false'),_0x443eee['textContent']=_0x3e9154['name'],_0x59a9c0['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x443eee['outerHTML']+'',_0x59a9c0['addEventListener']('mouseenter',()=>{_0x59a9c0['classList']['add']('ck-user__marker_hovered');}),_0x59a9c0['addEventListener']('mouseleave',()=>{_0x59a9c0['classList']['remove']('ck-user__marker_hovered');}),_0x59a9c0;},_0x1116c9['isSimilar']=function(_0x8b428a){return!(!this['getCustomProperty']('userPositionMarker')||!_0x8b428a['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x8b428a['getAttribute']('data-session-id'));},_0x1116c9;}(_0xbc80fe,_0x11b0fa,_0x68f7f5);}(_0x4cca01,_0x3f70a0,_0x3c7003,_0x15090b)}),_0x15090b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x23e69f=>function(_0x3bbe1c,_0x2f7900){const _0x549459=_0x3bbe1c['markerName']['split'](':')[0x2];if(_0x549459===_0x2f7900['mySessionId'])return null;const _0x4377b0=_0x2f7900['getUserBySessionId'](_0x549459);if(!_0x4377b0)return{'id':_0x549459,'classes':[]};return{'id':_0x549459,'classes':['ck-user__selection',_0x4377b0['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x549459},'priority':0x7d0+_0x4377b0['orderNumber']};}(_0x23e69f,_0x3c7003)}),function(_0x8c2943){const _0x56843e=_0x8c2943['model'],_0x3ba191=new Map(),_0x11fa6e=_0x8c2943['plugins']['get'](i);_0x56843e['markers']['on']('update:user:range',(_0x5331d9,_0x10424a,_0x21b523,_0x5d328d)=>{if(!_0x5d328d&&_0x3ba191['get'](_0x10424a['name']))return _0x3ba191['get'](_0x10424a['name'])['detach'](),void _0x3ba191['delete'](_0x10424a['name']);const _0x49a671=_0x10424a['name']['split'](':')[0x2];if(_0x49a671===_0x11fa6e['mySessionId'])return;const _0x3e9c4d='user:position:'+_0x49a671;_0x56843e['markers']['has'](_0x3e9c4d)&&_0x8c2943['editing']['reconvertMarker'](_0x3e9c4d),_0x10424a['on']('change:range',(_0x30c00b,_0x261b07,_0x5479c9)=>{if('$graveyard'!=_0x261b07['root']['rootName']&&'$graveyard'==_0x10424a['getRange']()['root']['rootName']&&!_0x3ba191['has'](_0x10424a['name'])){const _0x556465=_0x56843e['schema']['getNearestSelectionRange'](_0x5479c9['deletionPosition']);if(_0x556465){const _0x5edc95=_0x57d69b['fromRange'](_0x556465);_0x3ba191['set'](_0x10424a['name'],_0x5edc95),_0x5edc95['on']('change:range',(_0x72bb54,_0x130cc9,_0x24040b)=>{if('$graveyard'==_0x5edc95['root']['rootName']){const _0x4ac1df=_0x56843e['schema']['getNearestSelectionRange'](_0x24040b['deletionPosition']);_0x4ac1df?(_0x5edc95['start']=_0x4ac1df['start'],_0x5edc95['end']=_0x4ac1df['end']):(_0x3ba191['delete'](_0x10424a['name']),_0x5edc95['detach']());}});}}});}),_0x56843e['document']['on']('change',()=>{_0x3ba191['size']>0x0&&_0x56843e['enqueueChange']({'isUndoable':!0x1},_0x2aa1af=>{for(const [_0x28603b,_0x52e28f]of _0x3ba191)'$graveyard'==_0x56843e['markers']['get'](_0x28603b)['getRange']()['root']['rootName']&&(Z(_0x28603b['split'](':')[0x2],_0x52e28f['toRange'](),_0x56843e,_0x2aa1af),_0x52e28f['detach']());_0x3ba191['clear']();});});}(_0x15090b),this['_domEmitter']['listenTo'](_0x166590['document'],'keydown',(_0x4cb0e0,{key:_0x4f2d4e})=>{'Escape'===_0x4f2d4e&&function(_0x29c078){_0x29c078['editing']['view']['change'](_0x3af29f=>{for(const _0x579f66 of _0x29c078['model']['markers']){if(!_0x579f66['name']['startsWith']('user:position'))continue;const _0x4717fe=_0x29c078['editing']['mapper']['markerNameToElements'](_0x579f66['name']);if(_0x4717fe){for(const _0x319802 of _0x4717fe)_0x3af29f['removeClass']('ck-user__marker_hovered',_0x319802);}}});}(_0x15090b);},{'useCapture':!0x0});}['afterInit'](){const _0x46a5f8=this['editor'],_0xfc8e8c=_0x46a5f8['commands']['get']('undo');_0xfc8e8c&&_0x46a5f8['model']['on']('applyOperation',(_0x405aee,_0x5aa7e7)=>{const _0x10270e=_0x5aa7e7[0x0];if(!_0x10270e['isDocumentOperation'])return;if('marker'!=_0x10270e['type']||!_0x10270e['name']['startsWith']('user:'))return;const _0x424752=_0x10270e['batch'];_0xfc8e8c['_createdBatches']['has'](_0x424752)&&(_0x10270e['newRange']=_0x10270e['oldRange']?_0x46a5f8['model']['createRange'](_0x10270e['oldRange']['start'],_0x10270e['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x177473=this['editor'],_0x1617be=_0x177473['model']['document'],_0x58efce=_0x177473['plugins']['get'](i);_0x177473['model']['enqueueChange']({'isUndoable':!0x1},_0x2a0ce5=>{const _0xf04803='user:range:'+_0x58efce['mySessionId'],_0x3b68c0='user:position:'+_0x58efce['mySessionId'],_0x4e8e35=_0x177473['model']['markers']['has'](_0xf04803);_0x177473['editing']['view']['hasDomSelection']?Z(_0x58efce['mySessionId'],_0x1617be['selection']['getFirstRange'](),_0x177473['model'],_0x2a0ce5):_0x4e8e35&&(_0x2a0ce5['removeMarker'](_0xf04803),_0x2a0ce5['removeMarker'](_0x3b68c0));});}}function Z(_0x32262a,_0x2fa432,_0x229f9a,_0x3352a0){const _0x1ca262='user:range:'+_0x32262a,_0x47866a='user:position:'+_0x32262a,_0x34cb00=_0x2fa432['getContainedElement']();let _0x57f7a2=_0x2fa432['start'];if(_0x34cb00&&_0x34cb00['is']('element','tableCell')){const _0xa9c377=function(_0x53e942,_0x5a45e4){for(const _0x35635c of _0x53e942['getPositions']())if(_0x5a45e4['schema']['checkChild'](_0x35635c,'$text'))return _0x35635c;}(_0x2fa432,_0x229f9a);_0xa9c377&&(_0x57f7a2=_0xa9c377,_0x2fa432=_0x3352a0['createRange'](_0x57f7a2));}const _0x42f264=_0x3352a0['createRange'](_0x57f7a2);_0x229f9a['markers']['has'](_0x1ca262)?(_0x3352a0['updateMarker'](_0x1ca262,{'range':_0x2fa432}),_0x3352a0['updateMarker'](_0x47866a,{'range':_0x42f264})):(_0x3352a0['addMarker'](_0x1ca262,{'range':_0x2fa432,'usingOperation':!0x0}),_0x3352a0['addMarker'](_0x47866a,{'range':_0x42f264,'usingOperation':!0x0}));}function W(_0x1c0caf,_0x4f01ad,_0x48a4fc){const _0x2e1efa=_0x1c0caf['t'],t=_0x1c0caf['t'];switch(_0x4f01ad){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 _0x2e1efa({'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'},_0x48a4fc);default:return'';}}let G=0x1;class l extends _0x38fa51{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x1eb7a7)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,V,_0x353cb1,_0x43f46f,_0xc37cde];}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 _0x3a6f57=this['serverHistory']['getOperations']();for(let _0x47f0ab=_0x3a6f57['length']-0x1;_0x47f0ab>=0x0;_0x47f0ab--){const _0x55c951=_0x3a6f57[_0x47f0ab];if(!this['_disconnectionOperations']['has'](_0x55c951))return _0x55c951['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x214aca){if(super(_0x214aca),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5f4adf(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3c299b('collaboration-missing-channelid',this);const _0xbf9e8b=_0x214aca['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xbf9e8b,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x357efb(),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 J(this['_disconnectionOperations']);}['init'](){const _0x3df039=this['editor'],_0x4e7677=_0x3df039['plugins']['get'](_0x43f46f),_0x3c6350=_0x3df039['plugins']['get'](n);this['listenTo'](_0x4e7677,'getOperationAuthor',(_0x128240,_0x2723b6)=>{const _0x288485=_0x2723b6[0x0];_0x288485['_authorId']&&(_0x128240['return']=_0x4e7677['getUser'](_0x288485['_authorId']),_0x128240['stop']()),null===_0x288485['_authorId']&&(_0x128240['return']=null,_0x128240['stop']());},{'priority':'high'}),this['listenTo'](_0x3df039['model']['document']['selection'],'change:range',(_0x16b125,_0x465ece)=>{_0x465ece['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3df039['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3df039['model']['on']('applyOperation',(_0x37b1c4,_0x4da77f)=>{const _0x384baa=_0x4da77f[0x0];_0x384baa['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x384baa),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x3c6350,'state',this,'_hasSynchronizationProblem',(_0x2472d2,_0x56b6f1)=>'connected'===_0x2472d2&&!_0x56b6f1),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3df039['disableReadOnlyMode']('rtc-offline'):_0x3df039['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3df039['disableReadOnlyMode']('rtc-offline'):_0x3df039['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x38752b=this['editor']['plugins']['get'](i),_0x1ad38b=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x38752b['unregister'](this['_channelId']);const _0x25017a=await this['_service']['reconnect'](_0x1ad38b['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x25017a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4278b6=await this['_service']['getConnectedSessions']();_0x38752b['register'](this['_channelId'],_0x4278b6),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x498585){if(function(_0xada4d4){return'404'===_0xada4d4['code'];}(_0x498585)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x383ab8){return'409'===_0x383ab8['code'];}(_0x498585)){const _0x3906b9=W(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'](_0x3906b9);}else{if(!(_0x498585 instanceof $))throw _0x498585;this['_handleReconnectionError']();}}}}['destroy'](){const _0x23031a=this['editor']['plugins']['get'](n),_0x2299ba=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2299ba['channelSessions']['has'](this['_channelId'])&&_0x2299ba['unregister'](this['_channelId']),_0x23031a['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x10e05c){if(this['sessionId']!==_0x10e05c['sessionId']&&this['_lastSyncedOperationId']!==_0x10e05c['lastOperationId'])throw new $();return this['sessionId']=_0x10e05c['sessionId'],this['_handleServerResponse']([],{..._0x10e05c,'wereChangesApplied':!0x1,'data':_0x10e05c['data']},'reconnect');}async['_connectService'](_0x4cdfc5,_0x39cc12=!0x1){const {connection:_0x1ad701}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x1ad701,this['_channelId'])['then'](_0x5d63e8=>this['_initSessionsHandling'](_0x5d63e8))['catch'](_0x51dac3=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x51dac3);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x2973b2,_0xd88df2)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xd88df2);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x1401f8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4cdfc5);this['_isPendingUpdate']=!0x0;const _0x418092=await this['_service']['connect'](_0x1ad701,this['_compressOperations'](_0x4cdfc5),_0x1401f8);if(this['sessionId']=_0x418092['sessionId'],_0x39cc12){if(!_0x418092['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x418092['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4cdfc5,_0x418092,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x418092,_0x4cdfc5);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4f673b=this['editor']['plugins']['get'](i),_0x455052=this['editor']['plugins']['get'](V),_0x1dc7e8=_0x4f673b['channelSessions']['get'](this['_channelId']);_0x1dc7e8&&_0x1dc7e8['length']>0x1?_0x455052['createUserMarkerOperations']():this['listenTo'](_0x4f673b,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4f673b['channelSessions']['get'](this['_channelId'])['length']&&_0x455052['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3dfb37,_0x5e2408,_0x23a710,_0x42f79e){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x5e2408){const _0x2428b2=this['_decompressOperations'](_0x23a710,_0x42f79e);await this['_fetchMissingUsers'](_0x2428b2),this['_handleExternalOperations'](_0x2428b2,_0x5e2408,_0x23a710['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x10129c}=this['editor'];let _0x4c892f;try{_0x4c892f=await this['_service']['getDocumentDetails']();}catch{const _0x4d0128=W(_0x10129c,'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'](_0x4d0128);}const _0x745055=_0x4c892f['currentDocumentSession']||_0x4c892f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x745055['lastOperationId']){const _0x2d7f29=W(_0x10129c,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x2d7f29);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x40d28e){const _0x235a27=this['editor']['plugins']['get'](i);this['listenTo'](_0x235a27,'sessionAdd:'+this['_channelId'],(_0x5c293b,{session:_0x3dffe8})=>{if(_0x3dffe8['id']===_0x235a27['mySessionId']){_0x5c293b['off']();const _0x2c4f35=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x5074e4=_0x3dffe8['permissions'];_0x2c4f35&&_0x2c4f35['isEnabled']&&(_0x5074e4=_0x5074e4['filter'](_0x2695e2=>'document:write'!==_0x2695e2)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x5074e4,this['_channelId']);}}),_0x235a27['register'](this['_channelId'],_0x40d28e);}['_initThrowingOnDataSet'](){const _0x4b1788=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1035a3)=>{if(!_0x1035a3[_0x1035a3['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3c299b('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x4b1788['apply'](this['editor']['data'],_0x1035a3);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x37a2da,[_0x24c0a2])=>{if(this['_document']['version'])throw new _0x3c299b('realtimecollaborationclient-init-document-already-initialized',this);_0x37a2da['stop'](),this['_setPendingAction']();const _0x4fed2d=this['editor']['config']['get']('rootsAttributes'),_0x15bf76=this['_getOperationsFromInitData'](_0x24c0a2,_0x4fed2d);0x0==_0x15bf76['length']&&_0x15bf76['push'](new _0x249d09(0x0)),_0x37a2da['return']=this['_connectService'](_0x15bf76)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4fc7f=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4fc7f))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1d00f3,[_0x5a24bc,_0x56f058])=>{_0x1d00f3['stop']();const _0x3b911c=this['editor']['model']['document']['getRoot'](_0x5a24bc);if(!this['_knownRootNames']['has'](_0x5a24bc)){const _0x52c3ad=_0x56f058&&_0x56f058['data']?_0x56f058['data']:'',_0x504d46=_0x56f058&&_0x56f058['attributes']?_0x56f058['attributes']:{};await this['_loadRoot'](_0x5a24bc,_0x52c3ad,_0x504d46);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3b911c['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3b911c);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x287be1){const _0x25010b=this['editor']['plugins']['get'](_0x43f46f),{connection:_0x7aa01c}=this['editor']['plugins']['get'](n),_0x51e982=new Set();for(const _0x1883f9 of _0x287be1){const _0x4e05b2=_0x1883f9['_authorId'];_0x4e05b2&&!_0x25010b['getUser'](_0x4e05b2)&&_0x51e982['add'](_0x4e05b2);}if(0x0===_0x51e982['size'])return;const _0x247744=await lt['getMany'](_0x7aa01c,Array['from'](_0x51e982));for(const _0x5e2c5b of _0x247744)_0x25010b['getUser'](_0x5e2c5b['id'])||_0x25010b['addUser'](_0x5e2c5b);}['_getOperationsFromInitData'](_0x16d2a1,_0x307ed3={}){const _0x45c8e4=this['editor']['model'],_0x243966=[];let _0x374dd9=0x0;const _0x49eedb='string'==typeof _0x16d2a1?{'main':_0x16d2a1}:_0x16d2a1;for(const _0x2c31dc of Object['keys'](_0x49eedb)){if(!this['_document']['roots']['has'](_0x2c31dc))throw new _0x3c299b('realtimecollaborationclient-init-non-existent-root',this);const _0x50d998=this['editor']['data']['parse'](_0x49eedb[_0x2c31dc]),_0x47c138=this['_document']['getRoot'](_0x2c31dc),_0x15ee16=new _0xa284d2(_0x45c8e4['createPositionAt'](_0x47c138,0x0),_0x50d998,_0x374dd9++);_0x243966['push'](_0x15ee16);for(const [_0x59793a,_0xc00da3]of _0x50d998['markers']){const _0x22a70e=_0x45c8e4['createRange'](_0x45c8e4['createPositionFromPath'](_0x47c138,_0xc00da3['start']['path']['slice']()),_0x45c8e4['createPositionFromPath'](_0x47c138,_0xc00da3['end']['path']['slice']())),_0x50f702=new _0x552db8(_0x59793a,null,_0x22a70e,_0x45c8e4['markers'],!0x0,_0x374dd9++);_0x243966['push'](_0x50f702);}}if(_0x307ed3)for(const [_0xa6ef93,_0x489646]of Object['entries'](_0x307ed3)){const _0x4e106d=_0x45c8e4['document']['getRoot'](_0xa6ef93);if(!_0x4e106d)throw new _0x3c299b('multi-root-editor-root-attributes-no-root',null);for(const [_0x53bc4a,_0x30459a]of Object['entries'](_0x489646))if(null!==_0x30459a){const _0x17fe9d=new _0x1defe4(_0x4e106d,_0x53bc4a,null,_0x30459a,_0x374dd9++);_0x243966['push'](_0x17fe9d);}}return _0x243966;}async['_loadRoot'](_0x85cfce,_0x232440,_0x1143ff){this['_getOperationsFromInitData']({[_0x85cfce]:_0x232440},{[_0x85cfce]:_0x1143ff})['forEach']((_0x28608a,_0x3f35b9)=>{_0x28608a['baseVersion']=this['_document']['version']+_0x3f35b9,_0x28608a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x28608a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1a5dba,_0x4061f7){let _0x58b148;this['_offset']=_0x1a5dba['offset'];const _0x40cc99=_0x1a5dba['wereChangesApplied']&&!_0x1a5dba['initData'],_0xba3316=_0x40cc99?0x0:_0x1a5dba['data']['baseVersion'];if(_0x4061f7['forEach'](_0x484899=>{_0x484899['_isInit']=!0x0,_0x484899['createdAt']=_0x1a5dba['sessionCreatedAt'],_0x484899['_authorId']=null;}),_0x40cc99)_0x58b148=_0x4061f7,this['_applyOperationsSet'](_0x58b148,_0x40cc99);else{if(_0x1a5dba['initData']){const _0x4771c0=this['_getOperationsFromInitData'](_0x1a5dba['initData']);this['_document']['history']['version']=-_0x4771c0['length'],_0x4771c0['forEach'](_0x3b72fe=>{_0x3b72fe['baseVersion']-=_0x4771c0['length'],_0x3b72fe['createdAt']=_0x1a5dba['sessionCreatedAt'],_0x3b72fe['_isInit']=!0x0,_0x3b72fe['_authorId']=null;}),this['_applyOperationsSet'](_0x4771c0,!0x0),this['serverHistory']['version']=-_0x4771c0['length']+this['_offset'],this['_updateServerHistory'](_0x4771c0);}this['_document']['history']['version']=_0xba3316,_0x58b148=this['_decompressOperations'](_0x1a5dba['data'],_0x1a5dba['metadata']),await this['_fetchMissingUsers'](_0x58b148),this['_applyOperationsSet'](_0x58b148,_0x40cc99);}_0x1a5dba['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x58b148,_0x1a5dba['lastOperationId']),this['_lastSyncedOperationId']=_0x1a5dba['lastOperationId']),this['serverHistory']['version']=_0xba3316+this['_offset'],this['_updateServerHistory'](_0x58b148),_0x4061f7['filter'](_0x2bcd44=>{const _0x3ded98=this['_getAffectedRoot'](_0x2bcd44);return _0x3ded98&&!this['_knownRootNames']['has'](_0x3ded98);})['forEach']((_0x3b5556,_0x466a23)=>{_0x3b5556['baseVersion']=this['_document']['version']+_0x466a23,this['_saveOperationInBuffer'](_0x3b5556);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x346d3a,_0x49199c){const _0x53f155=_0x49199c&&_0x49199c['message'];if(_0x53f155&&_0x53f155['startsWith']('realtimecollaborationclient'))throw _0x49199c;const _0x247bd2=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x247bd2['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3c299b(_0x346d3a,this['editor'],_0x53f155?{'originalError':_0x53f155}:void 0x0);}['_saveOperationInBuffer'](_0x5e9a74){this['_knownOperations']['has'](_0x5e9a74)||(this['_knownOperations']['add'](_0x5e9a74),this['_bufferedOperations']['push'](_0x5e9a74),this['_pendingAction']||'marker'==_0x5e9a74['type']&&!_0x5e9a74['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x2a2ce5=!0x1){!_0x2a2ce5&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xc96ef9=>{_0xc96ef9&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x169f07=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xecca7f){return _0xecca7f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xecca7f['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xecca7f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x169f07)||this['_crash'](_0x169f07['message'],_0x169f07);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x264ec6=>{this['on']('change:_isPendingUpdate',()=>{_0x264ec6();});});}async['_sendBufferedOperations'](){const _0x3f6538=this['editor']['plugins']['get'](V);if(this['_shouldSendSelectionUpdate']()&&(_0x3f6538['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x24ad46=[...this['_bufferedOperations']];for(const _0x6c35a1 of _0x24ad46)_0x6c35a1['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x6c35a1);const _0x2a9ea9=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x24ad46),_0x52207d=G++,_0x191e20=this['_compressOperations'](_0x24ad46),_0x27ba10=await this['_service']['sendOperations'](_0x191e20,_0x191e20['baseVersion'],_0x2a9ea9);try{return await this['_handleServerResponse'](_0x24ad46,_0x27ba10,_0x52207d);}catch(_0x2d8ef7){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2d8ef7);}}async['_handleServerResponse'](_0x277a32,_0x5f4326,_0x38ddc4){if('error'in _0x5f4326)throw _0x5f4326['error'];let _0x39f87c=!0x1;if(_0x5f4326['wereChangesApplied']){_0x5f4326['lastOperationId']&&(this['_lastSyncedOperationId']=_0x5f4326['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x590616=>!_0x277a32['includes'](_0x590616));for(const _0x2677e1 of _0x277a32)_0x2677e1['createdAt']='lastOperationAcceptedAt'in _0x5f4326&&_0x5f4326['lastOperationAcceptedAt']||void 0x0;K(_0x277a32,_0x5f4326['version']-_0x277a32['length']),this['_updateServerHistory'](_0x277a32);const _0x2e96ad=_0x277a32['filter'](_0x40c01a=>{if(!_0x40c01a['_isInit'])return!0x1;const _0x9c49f5=this['_getAffectedRoot'](_0x40c01a);return _0x9c49f5&&!this['_knownRootNames']['has'](_0x9c49f5);});K(_0x2e96ad,this['_document']['version']),this['_applyOperationsSet'](_0x2e96ad),_0x39f87c=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x29e5bb=this['_decompressOperations'](_0x5f4326['data'],_0x5f4326['metadata'])['filter'](_0x4cd859=>_0x4cd859['baseVersion']>=this['_lastServerVersion']);_0x29e5bb['forEach'](_0xef53bd=>this['_addKnownRoot'](_0xef53bd)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2cc7b1=>!_0x2cc7b1['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2cc7b1))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x29e5bb),_0x39f87c=this['_handleExternalOperations'](_0x29e5bb,_0x5f4326['version'],_0x5f4326['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x39f87c?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2f27d6,_0x4fcc5d,_0x28f714){try{const _0xb80017={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5a9595,operationsB:_0x1bfb41,originalOperations:_0x3a581d}=_0x2ea55e(_0x2f27d6,this['_bufferedOperations'],_0xb80017);K(_0x5a9595,this['_document']['version']),K(_0x1bfb41,_0x4fcc5d);for(const _0x1f36de of _0x5a9595){const _0x3ee9e8=_0x3a581d['get'](_0x1f36de);_0x1f36de['_authorId']=_0x3ee9e8?_0x3ee9e8['_authorId']:null;}_0x28f714&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2f27d6,_0x28f714),this['_lastSyncedOperationId']=_0x28f714),this['_bufferedOperations']=[..._0x1bfb41],this['_applyOperationsSet'](_0x5a9595),this['_updateServerHistory'](_0x2f27d6);}catch(_0x28e776){return console['error'](_0x28e776),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2565d8,_0x21c9e2=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x463afc=>{for(const _0x27f27b of _0x2565d8)this['_knownOperations']['add'](_0x27f27b),this['_addKnownRoot'](_0x27f27b),_0x463afc['batch']['addOperation'](_0x27f27b),this['editor']['model']['applyOperation'](_0x27f27b);});}['_addKnownRoot'](_0x2ee1f4){const _0x5e487e=this['_getAffectedRoot'](_0x2ee1f4);_0x5e487e&&this['_knownRootNames']['add'](_0x5e487e);}['_getAffectedRoot'](_0x4ab26d){let _0x76a329,_0x4865cd;switch(_0x4ab26d['type']){case'insert':_0x76a329=_0x4ab26d['position']['root'];break;case'marker':if(_0x4865cd=_0x4ab26d['newRange'],!_0x4865cd)return null;_0x76a329=_0x4865cd['root'];break;case'addRootAttribute':_0x76a329=_0x4ab26d['root'];break;case'addRoot':_0x76a329=_0x4ab26d['affectedSelectable'];break;case'move':_0x76a329=_0x4ab26d['targetPosition']['root'];break;default:return null;}return _0x76a329['rootName'];}['_updateServerHistory'](_0x16a69c){_0x16a69c['forEach'](_0x4f290f=>{const _0x59ce02=_0x4f290f['clone']();_0x59ce02['_authorId']=_0x4f290f['_authorId'],_0x59ce02['_isInit']=!!_0x4f290f['_isInit'],_0x59ce02['createdAt']=_0x4f290f['createdAt'],_0x59ce02['baseVersion']+=this['_offset'],_0x4f290f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x59ce02),this['serverHistory']['addOperation'](_0x59ce02);});}['_handleReconnectionError'](_0x13691f){const _0x5dd0b5=this['editor']['plugins']['get']('Notification'),_0x3c7cc4=this['editor']['locale'];_0x13691f||(_0x13691f=W(_0x3c7cc4,'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.')),_0x5dd0b5['showWarning'](_0x13691f,{'title':W(_0x3c7cc4,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x353cb1)['add'](W(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x353cb1)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x45a028){const _0x17ba04=_0x45a028['map'](_0x481688=>_0x481688['toJSON']());return this['_compressor']['compress'](_0x17ba04);}['_decompressOperations'](_0x3337de,_0xce3501){return this['_compressor']['decompress'](_0x3337de)['map']((_0x557926,_0x328cec)=>{const _0x40fd5b='init'==_0xce3501[_0x328cec]['type'];if('InsertOperation'==_0x557926['__className']){const _0x18cfd5=_0x557926['position']['root'];!this['_document']['getRoot'](_0x18cfd5)&&(this['_document']['createRoot']('$root',_0x18cfd5)['_isAttached']=!0x1);}const _0x24d95f=_0x13e959['fromJSON'](_0x557926,this['_document']);return _0x24d95f['wasUndone']=_0x557926['wasUndone'],_0x24d95f['_isInit']=_0x40fd5b,_0x24d95f['_authorId']=_0x40fd5b?null:_0xce3501[_0x328cec]['userId'],_0x24d95f['_isDisconnection']='cs:removeUser'===_0xce3501[_0x328cec]['type'],_0x24d95f['createdAt']=_0xce3501[_0x328cec]['createdAt'],_0x24d95f;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4d824a=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4d824a&&_0x4d824a['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x1a97ae,_0x3cb570){for(const _0x803848 of _0x1a97ae)_0x803848['baseVersion']=_0x3cb570++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x2d6b32){this['_ignoredOperations']=_0x2d6b32,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x7b8b21){let _0x137060=_0x7b8b21['length'];for(;_0x137060--;){const _0x3fc279=_0x7b8b21[_0x137060];if(!this['_ignoredOperations']['has'](_0x3fc279)){if(!this['_operationToId']['has'](_0x3fc279)){const _0x4e1ee9=_0x1b3102()['slice'](0x1,0x12);this['_operationToId']['set'](_0x3fc279,_0x4e1ee9);}return this['_operationToId']['get'](_0x3fc279);}}}['setIdForTheLastOperation'](_0x5a86b8,_0x40e2d8){if(!_0x40e2d8)return;let _0x89d3cc=_0x5a86b8['length'];for(;_0x89d3cc--;){const _0x1ca504=_0x5a86b8[_0x89d3cc];this['_ignoredOperations']['has'](_0x1ca504)||this['_operationToId']['set'](_0x1ca504,_0x40e2d8);}}}class a extends _0x38fa51{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x5b3d3d{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x4b6acc)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x43f46f];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf4a818){super(_0xf4a818),this['_services']=new Map();}async['init'](){const _0x412d79=this['context'],_0x4a111e=_0x412d79['plugins']['get']('CommentsRepository');if(_0x412d79['plugins']['get'](n)['addToReconnectionStack'](this),_0x4a111e['adapter']={'addCommentThread':async({channelId:_0x4fc7dd,threadId:_0x248c74,comments:_0x3685bd,resolvedAt:_0x438fb3,resolvedBy:_0x150b5d,context:_0x34cca0,attributes:_0x5e9fcb})=>{const _0x4d94cd=await this['_getService'](_0x4fc7dd)['addCommentThread']({'commentThreadId':_0x248c74,'comments':_0x3685bd['map'](_0x51786e=>function(_0x57b7d0,_0x563199,_0x576b59){return{'commentThreadId':_0x576b59,'commentId':_0x57b7d0['commentId'],'userId':_0x57b7d0['authorId'],'content':_0x57b7d0['content'],'documentId':_0x563199,'createdAt':_0x57b7d0['createdAt'],'attributes':_0x57b7d0['attributes']||{}};}(_0x51786e,_0x4fc7dd,_0x248c74)),'resolvedAt':_0x438fb3,'resolvedBy':_0x150b5d,'context':_0x34cca0,'attributes':_0x5e9fcb})['catch'](dt);return{'threadId':_0x4d94cd['commentThreadId'],'comments':_0x4d94cd['comments']};},'getCommentThread':async({channelId:_0x5baba8,threadId:_0x1b0f9b})=>{const _0x9d9b85=await this['_getService'](_0x5baba8)['getCommentThread'](_0x1b0f9b)['catch'](f)['catch'](dt);return _0x9d9b85?_0x9d9b85['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x9d9b85]),{'threadId':_0x9d9b85['commentThreadId'],'comments':_0x9d9b85['comments']['map'](p),'context':_0x9d9b85['context'],'resolvedAt':_0x9d9b85['resolvedAt'],'resolvedBy':_0x9d9b85['resolvedBy'],'attributes':_0x9d9b85['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x56b6e1,threadId:_0x40b939,context:_0x4993ea,unlinkedAt:_0x336166,attributes:_0x364afc})=>this['_getService'](_0x56b6e1)['updateCommentThread']({'commentThreadId':_0x40b939,'context':_0x4993ea,'attributes':_0x364afc,'unlinkedAt':_0x336166})['catch'](f)['catch'](dt),'resolveCommentThread':async({channelId:_0x19c36e,threadId:_0x5803d6})=>{const _0x4e2fd4=await this['_getService'](_0x19c36e)['resolveCommentThread'](_0x5803d6)['catch'](f)['catch'](dt);return{'threadId':_0x4e2fd4['commentThreadId'],'resolvedAt':_0x4e2fd4['resolvedAt'],'resolvedBy':_0x4e2fd4['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3a22e6,threadId:_0x123c9d})=>this['_getService'](_0x3a22e6)['reopenCommentThread'](_0x123c9d)['catch'](f)['catch'](dt),'removeCommentThread':({channelId:_0x4b2da9,threadId:_0x58fa9b})=>this['_getService'](_0x4b2da9)['removeCommentThread'](_0x58fa9b)['catch'](f)['catch'](dt),'addComment':({channelId:_0x535696,threadId:_0x229fd1,commentId:_0x311fbc,content:_0x2307f5,attributes:_0x2fad47})=>this['_getService'](_0x535696)['addComment'](_0x229fd1,_0x311fbc,_0x2307f5,_0x2fad47)['catch'](dt),'updateComment':({channelId:_0x1ec321,threadId:_0x226ee8,commentId:_0x263169,content:_0x275f75,attributes:_0x9eaf09})=>this['_getService'](_0x1ec321)['updateComment'](_0x226ee8,_0x263169,_0x275f75,_0x9eaf09)['catch'](f)['catch'](dt),'removeComment':({channelId:_0x3e55df,threadId:_0x383578,commentId:_0x269eee})=>this['_getService'](_0x3e55df)['removeComment'](_0x383578,_0x269eee)['catch'](f)['catch'](dt)},_0x412d79 instanceof _0x39648d){const _0x3e0857=_0x412d79['config']['get']('collaboration.channelId'),_0x549106=_0x412d79['plugins']['get'](i);await this['_setUpService'](_0x3e0857);const _0x3d08f9=await this['_services']['get'](_0x3e0857)['getConnectedSessions']();this['listenTo'](_0x549106,'sessionAdd:'+_0x3e0857,(_0x4170de,{session:_0x458cc1})=>{_0x458cc1['id']===_0x549106['mySessionId']&&(_0x4170de['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x458cc1['permissions'],_0x3e0857));}),_0x549106['register'](_0x3e0857,_0x3d08f9);}}async['_setUpService'](_0x247cc5){if(this['_services']['has'](_0x247cc5))throw new _0x3c299b('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x247cc5});const _0x4cae21=this['context']['plugins']['get']('CommentsRepository'),_0x2b2be8=new s['CommentsService'](_0x247cc5);this['_services']['set'](_0x247cc5,_0x2b2be8),this['listenTo'](_0x2b2be8,'commentThreadAdded',(_0x26c3a0,_0xc09baa)=>{const {commentThreadId:_0x33a0fb,documentId:_0x1463f7,context:_0x1b5f91,attributes:_0x28622f,resolvedAt:_0x5b01d6,resolvedBy:_0x3fa029,comments:_0x9be504}=_0xc09baa;_0x4cae21['getCommentThread'](_0x33a0fb)||_0x4cae21['addCommentThread']({'threadId':_0x33a0fb,'channelId':_0x1463f7,'comments':_0x9be504?_0x9be504['map'](p):[],'context':_0x1b5f91,'attributes':_0x28622f,'resolvedAt':_0x5b01d6,'resolvedBy':_0x3fa029,'isFromAdapter':!0x0});}),this['listenTo'](_0x2b2be8,'commentThreadUpdated',(_0x2f93d7,{commentThreadId:_0x49925b,documentId:_0x4d72cc,context:_0x37740b,unlinkedAt:_0x1f530a,attributes:_0x55e555})=>{_0x4cae21['getCommentThread'](_0x49925b)&&_0x4cae21['updateCommentThread']({'threadId':_0x49925b,'channelId':_0x4d72cc,'context':_0x37740b,'unlinkedAt':_0x1f530a,'attributes':_0x55e555,'isFromAdapter':!0x0});}),this['listenTo'](_0x2b2be8,'commentThreadResolved',(_0x476e95,{commentThreadId:_0xcda4f6,resolvedBy:_0x274107,resolvedAt:_0xfffbe6})=>{const _0x6183c0=_0x4cae21['getCommentThread'](_0xcda4f6);_0x6183c0&&_0x6183c0['resolve']({'resolvedBy':_0x274107,'resolvedAt':_0xfffbe6,'isFromAdapter':!0x0});}),this['listenTo'](_0x2b2be8,'commentThreadReopened',(_0x157d72,{commentThreadId:_0x3dfa75})=>{const _0x12330e=_0x4cae21['getCommentThread'](_0x3dfa75);_0x12330e&&_0x12330e['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x2b2be8,'commentThreadRemoved',(_0x95209,{commentThreadId:_0xfacd4f})=>{const _0x2390d1=_0x4cae21['getCommentThread'](_0xfacd4f);_0x2390d1&&_0x2390d1['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x2b2be8,'commentAdded',(_0x553601,_0x8f94)=>{const _0x1e8c07=_0x8f94['commentThreadId'],_0x39004c=_0x4cae21['getCommentThread'](_0x1e8c07);_0x39004c&&_0x39004c['addComment']({...p(_0x8f94),'isFromAdapter':!0x0});}),this['listenTo'](_0x2b2be8,'commentUpdated',(_0x12484c,{commentThreadId:_0x20efde,commentId:_0x31a405,content:_0x53ea65,attributes:_0x152a73})=>{const _0x3bcf81=_0x4cae21['getCommentThread'](_0x20efde);if(_0x3bcf81){const _0x5cbcc0=_0x3bcf81['getComment'](_0x31a405);_0x5cbcc0&&_0x5cbcc0['update']({'content':_0x53ea65,'attributes':_0x152a73,'isFromAdapter':!0x0});}}),this['listenTo'](_0x2b2be8,'commentRemoved',(_0x379348,{commentThreadId:_0x3fd864,commentId:_0x4181b7})=>{const _0xf7b287=_0x4cae21['getCommentThread'](_0x3fd864);if(_0xf7b287){const _0x28a813=_0xf7b287['getComment'](_0x4181b7);_0x28a813&&_0x28a813['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x247cc5);}['destroy'](){if(this['context']instanceof _0x39648d){const _0x1ae4ad=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x1ae4ad);}}['_terminateService'](_0x596402){if(!this['_services']['has'](_0x596402))throw new _0x3c299b('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x596402});this['_getService'](_0x596402)['disconnect'](),this['_services']['delete'](_0x596402);}async['reconnect'](){for(const _0x27bc7d of this['_services']['keys']())await this['_connectService'](_0x27bc7d);if(this['context']instanceof _0x39648d){const _0x3936dd=this['context']['config']['get']('collaboration.channelId'),_0x16c3f0=this['context']['plugins']['get'](i);_0x16c3f0['unregister'](_0x3936dd);const _0x1d81fe=await this['_services']['get'](_0x3936dd)['getConnectedSessions']();_0x16c3f0['register'](_0x3936dd,_0x1d81fe);}}async['_connectService'](_0x2744dc){const {connection:_0x5beabb}=this['context']['plugins']['get'](n),_0x1bdb3c=this['context']['plugins']['get']('CommentsRepository'),_0x11bb60=this['_services']['get'](_0x2744dc),_0x533831=await _0x11bb60['connect'](_0x5beabb);await this['_fetchMissingUsersForThreads'](_0x533831);const _0x346e82=new Set(Array['from'](_0x1bdb3c['getCommentThreads']({'channelId':_0x2744dc}),_0x382b83=>_0x382b83['id']));for(const _0x4e8ed7 of _0x533831)_0x4e8ed7['deletedAt']||_0x346e82['delete'](_0x4e8ed7['commentThreadId']);for(const _0x6e8f7c of _0x346e82)_0x1bdb3c['getCommentThread'](_0x6e8f7c)['remove']({'isFromAdapter':!0x0});for(const _0x1c8f84 of _0x533831){let _0x4a50f0=_0x1bdb3c['getCommentThread'](_0x1c8f84['commentThreadId']);const {commentThreadId:_0x29b73d,context:_0xb0592e,attributes:_0xb4e8f6,resolvedBy:_0x1e0a83,resolvedAt:_0x53d85e,unlinkedAt:_0x11855b,deletedAt:_0x1188be}=_0x1c8f84;if(_0x1188be)continue;_0x4a50f0||(_0x4a50f0=_0x1bdb3c['addCommentThread']({'channelId':_0x2744dc,'threadId':_0x29b73d,'context':_0xb0592e,'attributes':_0xb4e8f6||{},'resolvedBy':_0x1e0a83,'resolvedAt':_0x53d85e,'unlinkedAt':_0x11855b,'isFromAdapter':!0x0}));const _0x215bfc=new Set(Array['from'](_0x4a50f0['comments'],_0x1c65fa=>_0x1c65fa['id']));for(const _0x1a4e2e of _0x1c8f84['comments'])_0x215bfc['delete'](_0x1a4e2e['commentId']);for(const _0x56997a of _0x215bfc)_0x4a50f0['getComment'](_0x56997a)['remove']({'isFromAdapter':!0x0});for(const _0x4a6e8e of _0x1c8f84['comments']){const _0x4543b2=_0x4a50f0['getComment'](_0x4a6e8e['commentId']);_0x4543b2?_0x4543b2['content']!==_0x4a6e8e['content']&&_0x4543b2['update']({'content':_0x4a6e8e['content'],'isFromAdapter':!0x0}):_0x4a50f0['addComment'](Object['assign'](p(_0x4a6e8e),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1a6919){if(!this['_services']['has'](_0x1a6919))throw new _0x3c299b('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1a6919});return this['_services']['get'](_0x1a6919);}async['_fetchMissingUsersForThreads'](_0x1f21a7){const _0x5afe59=this['context']['plugins']['get'](_0x43f46f),{connection:_0x4df564}=this['context']['plugins']['get'](n),_0x5571bd=new Set();for(const {resolvedBy:_0x41a24b,comments:_0x201843}of _0x1f21a7){_0x41a24b&&!_0x5afe59['getUser'](_0x41a24b)&&_0x5571bd['add'](_0x41a24b);for(const {userId:_0x13d581}of _0x201843)_0x5afe59['getUser'](_0x13d581)||_0x5571bd['add'](_0x13d581);}if(0x0===_0x5571bd['size'])return;const _0x56ad71=await lt['getMany'](_0x4df564,Array['from'](_0x5571bd));for(const _0x24f263 of _0x56ad71)_0x5afe59['getUser'](_0x24f263['id'])||_0x5afe59['addUser'](_0x24f263);}}async function f(_0x95e1d0){if('404'!==_0x95e1d0['code'])throw _0x95e1d0;}function dt(_0x23df25){if((_0x24d81a=_0x23df25)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x24d81a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x24d81a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x24d81a;throw _0x23df25;}function p(_0x34f00b){return{'threadId':_0x34f00b['commentThreadId'],'commentId':_0x34f00b['commentId'],'content':_0x34f00b['content'],'createdAt':_0x34f00b['createdAt'],'authorId':_0x34f00b['userId'],'attributes':_0x34f00b['attributes']||{}};}class m extends _0x38fa51{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ef06c){super(_0x3ef06c);const _0xafbf23=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0xafbf23);}['init'](){const _0x2c1fcf=this['editor']['plugins']['get'](n),_0x1c054d=this['editor']['plugins']['get']('TrackChangesEditing');return _0x1c054d['adapter']={'getSuggestion':async _0x2f45b2=>{await this['_waitForServiceReady']();const _0x39b01f=await this['_trackChangesService']['get'](_0x2f45b2)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x39b01f]),_0x39b01f;},'addSuggestion':async({id:_0x49ffa3,type:_0x5d6cd1,data:_0x264eac,originalSuggestionId:_0xd313cd,attributes:_0xa3533c})=>{await this['_waitForServiceReady']();const _0x466201={'id':_0x49ffa3,'type':_0x5d6cd1,'data':_0x264eac,'originalSuggestionId':_0xd313cd,'attributes':_0xa3533c},_0x412680=await this['_trackChangesService']['add'](_0x49ffa3,_0x5d6cd1,_0x264eac,_0xd313cd,_0xa3533c)['catch'](_0x4142e3=>{if(ut(_0x4142e3))return new Promise(_0x297cf6=>{this['_bufferedRequests']['set'](_0x49ffa3,{'resolve':_0x297cf6,'suggestionData':_0x466201});});throw _0x4142e3;});return this['_bufferedRequests']['delete'](_0x49ffa3),_0x412680;},'updateSuggestion':async(_0x45f065,_0x3ba249)=>{if(await this['_waitForServiceReady'](),'open'!==_0x3ba249['state'])return this['_trackChangesService']['update'](_0x45f065,_0x3ba249)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x2169b0,_0x1a35d3)=>{_0x1c054d['hasSuggestion'](_0x1a35d3['id'])&&(_0x1c054d['getSuggestion'](_0x1a35d3['id'])['attributes']=_0x1a35d3['attributes']);}),this['_trackChangesService']['connect'](_0x2c1fcf['connection'])['then'](_0x52b6f2=>(_0x2c1fcf['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x52b6f2)['then'](()=>{for(const _0x914321 of _0x52b6f2){_0x1c054d['addSuggestionData'](_0x914321)['_saved']=!0x0;}})));}async['reconnect'](){const _0xff5085=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x5cb5f6}=this['editor']['plugins']['get'](n),_0x352bb8=await this['_trackChangesService']['connect'](_0x5cb5f6);await this['_fetchMissingUsersForThreads'](_0x352bb8);for(const {suggestionData:_0x40ede0,resolve:_0x59a4ed}of this['_bufferedRequests']['values']()){let _0x222199=_0x352bb8['find'](_0x3a6773=>_0x3a6773['id']===_0x40ede0['id']);_0x222199||(_0x222199=await this['_trackChangesService']['add'](_0x40ede0['id'],_0x40ede0['type'],_0x40ede0['data'],_0x40ede0['originalSuggestionId'])),_0x59a4ed(_0x222199);}for(const _0x3bce3f of _0x352bb8)_0xff5085['hasSuggestion'](_0x3bce3f['id'])||_0xff5085['addSuggestionData'](_0x3bce3f);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0xe6e29a=>{this['listenTo'](this['_trackChangesService'],'connected',_0x3b2f66=>{_0x3b2f66['off'](),_0xe6e29a();});});}async['_fetchMissingUsersForThreads'](_0x590198){const _0x137a6c=this['editor']['plugins']['get'](_0x43f46f),{connection:_0x54e88c}=this['editor']['plugins']['get'](n),_0x5781e0=new Set();for(const {authorId:_0x23233a}of _0x590198)_0x137a6c['getUser'](_0x23233a)||_0x5781e0['add'](_0x23233a);if(0x0===_0x5781e0['size'])return;const _0x4eeb08=await lt['getMany'](_0x54e88c,Array['from'](_0x5781e0));for(const _0x1ef6b6 of _0x4eeb08)_0x137a6c['getUser'](_0x1ef6b6['id'])||_0x137a6c['addUser'](_0x1ef6b6);}}function A(_0x57af70){if(ut(_0x57af70))return new Promise(()=>{});throw _0x57af70;}function ut(_0x1ad8bd){return _0x1ad8bd['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1ad8bd['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x38fa51{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1a3897=this['editor']['plugins']['get'](n),_0xa8fd69=this['editor']['plugins']['get']('CommentsEditing'),_0x44bd47=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x1a3897,'change:state',(_0x1f86bd,_0x3975d6,_0x4d565c)=>{_0xa8fd69['isThreadsLoadingPaused']='connected'!==_0x4d565c;});}),this['listenTo'](_0x1a3897,'change:state',(_0x3b4804,_0x164402,_0x3d3b0c)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x3d3b0c);}),_0x44bd47['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0x38fa51{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x38fa51{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x43f46f];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x558324){super(_0x558324);const _0x5edaaf=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x5edaaf);}async['init'](){const _0x50c923=this['editor']['plugins']['get'](l),_0x126312=_0x50c923['serverHistory'],_0xf5bbe9=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x126312,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x50c923['sessionId']});const _0x399da7=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x33c77e=await tt['isBundleUploaded'](_0xf5bbe9['connection'],_0x399da7);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x2f1a70})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x2f1a70)),'updateRevisions':async _0x511b6d=>{await this['_waitForServiceReady']();const _0x3e0d4d=this['_revisionTracker']['currentRevision'];if(_0x33c77e&&0x1===_0x511b6d['length']&&_0x511b6d[0x0]['id']===_0x3e0d4d['id'])return _0x511b6d;for(const _0x335f36 of _0x511b6d)_0x335f36['id']===_0x3e0d4d['id']&&(_0x335f36['isEmptyCurrent']=_0x335f36['fromVersion']===_0x335f36['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x511b6d,this['_lastRequestId'])['then'](_0x252eed=>(this['_lastRequestId']=_0x252eed,_0x511b6d))['catch'](_0x416b50=>{if(st(_0x416b50)||'400'===_0x416b50['code']&&void 0x0!==_0x416b50['data']['wrongRequestId']){for(const _0x44ab15 of _0x511b6d){!this['_revisionTracker']['repository']['getRevision'](_0x44ab15['id'])||this['_revisionTracker']['_bufferUpdate'](_0x44ab15['id'],_0x44ab15,!0x1);}if(st(_0x416b50))throw _0x416b50;return _0x511b6d;}throw _0x416b50;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x58f87c,{revisionsData:_0x10850c,requestId:_0x250e0e})=>{Math['max'](..._0x10850c['map'](_0x505dfa=>_0x505dfa['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x10850c,_0x250e0e);}):this['_handleRevisionsUpdate'](_0x10850c,_0x250e0e);});const {revisions:_0x3ea80c,requestId:_0xa4ba79}=await this['_revisionHistoryService']['connect'](_0xf5bbe9['connection']);_0xf5bbe9['addToReconnectionStack'](this),this['_lastRequestId']=_0xa4ba79,await this['_fetchMissingUsers'](_0x3ea80c);for(const _0x51fb50 of _0x3ea80c)this['_revisionTracker']['addRevisionData'](_0x51fb50);this['listenTo'](_0x50c923,'change:_isConnected',(_0x3feb8f,_0x250975,_0x18c86a)=>{_0x18c86a&&(this['_oldOffset']=_0x50c923['_offset'],_0x3feb8f['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0xf5bbe9,'state',_0x23a567=>_0x23a567===te['CONNECTED']);}async['reconnect'](){const _0x4aef54=this['editor']['plugins']['get'](n),_0x4b71a6=this['editor']['plugins']['get'](l),_0x6ea021=async()=>{const _0x43f7c3=this['_revisionTracker']['currentRevision'],_0x738901=_0x43f7c3['id'],_0x4d4f50=_0x738901!==_0x4b71a6['sessionId'];if(_0x4d4f50){const _0x20ab9d=_0x4b71a6['_offset']-this['_oldOffset'],_0x1c8de9=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x43f7c3['toVersion']+_0x20ab9d!==_0x1c8de9){const _0x4a5734=_0x43f7c3['fromVersion']+_0x20ab9d,_0x3d5762=this['editor']['plugins']['get'](_0x43f46f),_0x28a604=this['_revisionTracker']['buildRevisionData']({'revision':_0x43f7c3,'from':_0x4a5734,'to':_0x1c8de9});_0x28a604['id']=_0x43f7c3['id'];const _0x3015f6=_0x28a604['authorsIds']['map'](_0x18ed40=>_0x3d5762['getUser'](_0x18ed40));_0x43f7c3['_update']({..._0x28a604,'authors':_0x3015f6},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x43f7c3['id'],_0x28a604,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1c8de9,(_0x43f7c3['toVersion']===_0x43f7c3['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x738901)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x738901),this['_revisionTracker']['_createCurrentRevision'](_0x1c8de9));}const {revisions:_0x959954,requestId:_0xc94111}=await this['_revisionHistoryService']['reconnect'](_0x4aef54['connection'],this['_lastRequestId']);_0x4d4f50&&_0x959954['length']>0x0?_0x4b71a6['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x959954),this['_handleRevisionsUpdate'](_0x959954,_0xc94111),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4b71a6['_isConnected']?_0x6ea021():new Promise((_0x34ddac,_0x2d165b)=>{_0x4b71a6['once']('change:_isConnected',()=>{_0x6ea021()['then'](_0x34ddac)['catch'](_0x2d165b);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x3eef89=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x638a6c=>{_0x638a6c['off'](),_0x3eef89();});});}['_getLatestVersionFromServerOperations'](){const _0x2ffa77=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0xc3f4b5 of _0x2ffa77)if('marker'!==_0xc3f4b5['type']||_0xc3f4b5['affectsData'])return _0xc3f4b5['baseVersion']+0x1;}['_getLatestVersion'](){const _0x5782f7=this['editor']['plugins']['get'](l);return new Promise(_0x406b11=>{_0x5782f7['_isPendingUpdate']?_0x5782f7['once']('change:_isPendingUpdate',()=>{_0x406b11(this['_getLatestVersionFromServerOperations']());}):_0x406b11(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x29a59e,_0x49b857){const _0x5b5d42=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x49b857;for(const _0xb3e0aa of _0x29a59e){const _0x31db8c=_0x5b5d42['getRevision'](_0xb3e0aa['id']);if(_0x31db8c){if((_0xb3e0aa['fromVersion']||_0xb3e0aa['toVersion'])&&(_0xb3e0aa['diffData']=null),_0x31db8c===this['_revisionTracker']['currentRevision']){const _0x1dc26a=Math['max'](_0x31db8c['toVersion'],_0xb3e0aa['toVersion']),_0x7039bc=Math['max'](_0x31db8c['fromVersion'],_0xb3e0aa['fromVersion']);let _0x134a5e;_0x31db8c['toVersion']===_0xb3e0aa['toVersion']&&_0x31db8c['fromVersion']===_0xb3e0aa['fromVersion']?(_0x134a5e=!0x0,this['_preventResendingRevisionData'](_0xb3e0aa)):_0xb3e0aa['toVersion']===_0x1dc26a&&_0xb3e0aa['fromVersion']===_0x7039bc?_0x134a5e=!0x1:(_0x31db8c['toVersion']===_0x1dc26a&&_0x31db8c['fromVersion']===_0x7039bc||this['_fixRevision']({'revision':_0x31db8c,'from':_0x7039bc,'to':_0x1dc26a}),_0x134a5e=!0x0),_0x134a5e&&(delete _0xb3e0aa['fromVersion'],delete _0xb3e0aa['toVersion'],delete _0xb3e0aa['diffData'],delete _0xb3e0aa['createdAt'],delete _0xb3e0aa['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0xb3e0aa),this['_preventResendingRevisionData'](_0xb3e0aa);}else this['_revisionTracker']['addRevisionData'](_0xb3e0aa);}const _0x5a81f2=_0x5b5d42['getRevisions']();_0x5a81f2['reverse']();for(let _0x49e645=0x0;_0x49e645<_0x5a81f2['length']-0x1;_0x49e645++){const _0x234856=_0x5a81f2[_0x49e645],_0x9e6365=_0x5a81f2[_0x49e645+0x1];if(_0x234856['fromVersion']<_0x9e6365['toVersion']){const _0xcba029=_0x9e6365['toVersion'],_0x4f332a=Math['max'](_0xcba029,_0x234856['toVersion']);this['_fixRevision']({'revision':_0x234856,'from':_0xcba029,'to':_0x4f332a});}}}['_fixRevision']({revision:_0x593e7b,from:_0x4d1498,to:_0x5c5a9a}={}){const _0xfffe0b=this['editor']['plugins']['get'](_0x43f46f),_0x4fc7b8=this['_revisionTracker']['buildRevisionData']({'revision':_0x593e7b,'from':_0x4d1498,'to':_0x5c5a9a});_0x4fc7b8['authors']=_0x4fc7b8['authorsIds']['map'](_0x701450=>_0xfffe0b['getUser'](_0x701450)),_0x593e7b['_update'](_0x4fc7b8);}['_preventResendingRevisionData'](_0x5eb1a4){const _0x115c75={};_0x115c75['id']=_0x5eb1a4['id'];for(const _0x2c474c of Object['keys'](_0x5eb1a4))'id'!==_0x2c474c&&(_0x115c75[_0x2c474c]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x115c75['id'],_0x115c75,!0x0);}async['_fetchMissingUsers'](_0x190e44){const _0x5a8a40=this['editor']['plugins']['get'](_0x43f46f),{connection:_0x3a02b3}=this['editor']['plugins']['get'](n),_0x1a17a2=new Set();for(const _0x96c0b7 of _0x190e44){for(const _0x2492eb of _0x96c0b7['authorsIds'])_0x4f7626(_0x2492eb);_0x96c0b7['creatorId']&&_0x4f7626(_0x96c0b7['creatorId']);}if(0x0===_0x1a17a2['size'])return;const _0x563441=await lt['getMany'](_0x3a02b3,Array['from'](_0x1a17a2));for(const _0x158902 of _0x563441)_0x5a8a40['getUser'](_0x158902['id'])||_0x5a8a40['addUser'](_0x158902);function _0x4f7626(_0x5ea992){_0x5a8a40['getUser'](_0x5ea992)||_0x1a17a2['add'](_0x5ea992);}}}function st(_0x5e3d02){return _0x5e3d02['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5e3d02['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5e3d02['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x38fa51{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0x2e7f59{['_collapseAt'];constructor(_0x1c2c60,_0x109b7b=0x6){super(_0x1c2c60);const _0x53a818=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x109b7b,this['bind']('isHidden')['to'](this,'usersCount',_0x18519b=>_0x18519b<_0x109b7b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x53a818['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':_0x53a818['to']('usersCount',_0x492ea0=>'+'+(_0x492ea0-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x2e7f59{['items'];['keystrokes'];constructor(_0x20de1f){super(_0x20de1f);const _0x51a2eb=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x4cb197(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x51a2eb['if']('hasPopup'),'aria-expanded':_0x51a2eb['to']('isExpanded',_0x31476b=>this['hasPopup']&&String(_0x31476b)),'aria-label':_0x51a2eb['to']('hasPopup',_0x7dce43=>W(_0x20de1f,_0x7dce43?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x51a2eb['to']('hasPopup',_0x4cc62c=>!!_0x4cc62c&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x51a2eb['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x51a2eb['to'](_0x43fc5a=>{const _0x5638ec=_0x43fc5a,_0xc2161=document['querySelector']('.ck-presence-list__dropdown-list'),_0x154641=document['querySelector']('.ck-balloon-panel_with-arrow');_0xc2161?.['contains'](_0x5638ec['relatedTarget'])||_0x154641?.['contains'](_0x5638ec['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x21c79f,_0x21c969,_0x485e8b)=>{this['element']&&(_0x485e8b?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 k extends _0x2e7f59{['counterView'];['inlineListView'];constructor(_0xe856c7,_0x35e030=0x6){super(_0xe856c7);const _0x190469=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0x35e030),this['inlineListView']=new is(_0xe856c7),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x59e2f7 of this['inlineListView']['items'])_0x59e2f7['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',_0x190469['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0x2e7f59{['listWrapperView'];constructor(_0x1d742e,_0x43392e){super(_0x1d742e);const _0x340a6c=this['bindTemplate'];this['listWrapperView']=new pt(_0x1d742e,_0x43392e),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':W(_0x1d742e,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x340a6c['to'](_0x40bb4b=>{const _0x43d3a7=_0x40bb4b,_0x356a2a=document['querySelector']('.ck-presence-list__list'),_0x2cb9d1=document['querySelector']('.ck-balloon-panel_with-arrow');_0x356a2a?.['contains'](_0x43d3a7['relatedTarget'])||_0x2cb9d1?.['contains'](_0x43d3a7['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x189eb0{constructor(_0x2613cc,_0x15c25a){super(_0x2613cc);const _0x29b3e1=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x15c25a?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x29b3e1['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x29b3e1['to']('role'),'aria-label':_0x29b3e1['to']('ariaLabel'),'aria-labelledby':_0x29b3e1['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x166590['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1a23e2=this['element'];_0x1a23e2&&(this['_isScrollable']=Math['max'](_0x1a23e2['scrollHeight'],_0x1a23e2['clientHeight'])>0.8*window['innerHeight']);}}class P extends rt{['userView'];constructor(_0x21b859,_0x3dcd56,_0x37c323){super(_0x21b859);const _0x1f5cd7=this['bindTemplate'];this['userView']=new ct(_0x21b859,_0x3dcd56);const _0x369772={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x3dcd56['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x3dcd56['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3dcd56['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x37c323&&(_0x369772['tag']='button',_0x369772['on']={'click':_0x1f5cd7['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x369772);}['focus'](){this['element']['focus']();}}class _ extends _0x2e7f59{['userView'];['markerView'];constructor(_0x5b500b,_0xd207ad,_0x5a0c6d){super(_0x5b500b);const _0x5c012c=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x5b500b,_0xd207ad),this['markerView']=new at(_0x5b500b,_0xd207ad);const _0x224544=new ot(_0x5b500b);_0x224544['template']['tag']='span',_0x224544['text']=_0xd207ad['name'];const _0x8a07aa={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5c012c['to']('isFocusable',_0x1f7d1f=>!!_0x1f7d1f&&0x0),'aria-labelledby':_0x224544['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5c012c['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5c012c['to']('hasTooltip',_0x2ccb40=>!_0x2ccb40),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x224544]};_0x5a0c6d&&(_0x8a07aa['tag']='button',_0x8a07aa['on']={'click':_0x5c012c['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x8a07aa);}}class at extends _0x2e7f59{constructor(_0x16c268,_0x4c70aa){super(_0x16c268),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4c70aa['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x5b3d3d{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2110ce){super(_0x2110ce),this['context']['config']['define']('presenceList',U);const _0x5eb063=_0x2110ce['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x5eb063)throw new _0x3c299b('presencelist-collapseat-invalid-format',this);if(_0x5eb063<0x1)throw new _0x3c299b('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x3e4b61(),this['balloonPanelView']=new _0x2f1aa7(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x632589 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x632589);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1d2348,_0x5fd832)=>{this['_handleUserAdd'](_0x5fd832);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x4ce645,_0x3d3469)=>{this['_handleUserRemove'](_0x3d3469);});}['_createView'](){const _0x5a6aec=this['context'],_0xab8233=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x596d4e=this['balloonPanelView'];if(!_0x420389(_0x5a6aec['config']['get']('presenceList.container')))throw new _0x3c299b('presencelist-missing-container',this);return _0xab8233['counterView']['bind']('usersCount')['to'](this),_0xab8233['bind']('isCollapsed')['to'](this,'usersCount',_0x41e5f5=>{const {collapseAt:_0x1d0437}=_0x5a6aec['config']['get']('presenceList'),_0x1024a4=_0x41e5f5>=_0x1d0437;if(_0x1024a4&&!_0xab8233['inlineListView']['items']['find'](_0x44c1cc=>_0x44c1cc instanceof y)){const _0x141f07=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x141f07&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0xab8233['inlineListView']['items']['add'](_0xab8233['counterView']);}return _0x1024a4||this['hideDropdown'](),_0x1024a4;}),_0xab8233['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x333ebf=>{const _0x46dfc8=_0x5a6aec['config']['get']('presenceList'),_0x51d377=new _(_0x5a6aec['locale'],_0x333ebf,!!_0x46dfc8['onClick']);return _0x51d377['bind']('hasTooltip')['to'](_0xab8233,'isCollapsed',_0x27e7d7=>!_0x27e7d7),_0x51d377['bind']('isFocusable')['to'](_0xab8233,'isCollapsed',_0x426ea4=>!_0x426ea4),_0x46dfc8['onClick']&&this['listenTo'](_0x51d377,'execute',()=>{this['view']['isCollapsed']||_0x46dfc8['onClick'](_0x333ebf,_0x51d377['element']);}),_0x51d377;}),this['listenTo'](_0xab8233['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0xab8233['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0xab8233['inlineListView']['keystrokes']['set']('Enter',(_0x453fff,_0x1eed1e)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x1eed1e());}),_0xab8233['render'](),_0x596d4e['render'](),_0x47fb05({'emitter':_0xab8233,'activator':()=>_0x596d4e['isVisible'],'contextElements':[_0x596d4e['element'],_0xab8233['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x5a6aec['config']['get']('presenceList.container')['appendChild'](_0xab8233['element']),this['_bodyCollection']=new _0x115a40(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0xab8233;}['_handleUserAdd'](_0x2b227c){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2b227c['isMe'])return;const _0xbd1d8=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0xbd1d8-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x2ffb7c=_0x2b227c['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2b227c,_0x2ffb7c);}['_handleUserRemove'](_0x5c862a){this['usersCount']--;const {collapseAt:_0x59d268}=this['context']['config']['get']('presenceList'),_0x14befb=this['usersCount']>=_0x59d268;if(this['currentDisplayedUsers']['get'](_0x5c862a['id']))this['currentDisplayedUsers']['remove'](_0x5c862a['id']);else{if(_0x14befb&&this['currentDisplayedUsers']['length']+0x1===_0x59d268-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x14befb?0x1:0x0)<this['usersCount']){for(const _0x45fb3f of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x45fb3f['id'])&&(this['currentDisplayedUsers']['add'](_0x45fb3f,Math['min'](this['currentDisplayedUsers']['length']-(_0x14befb?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x14befb?0x1:0x0)===_0x59d268-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x59f784=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0x59f784['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x5831c9}=this['presenceDropdownView'];_0x5831c9['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3227ad=>{if(!_0x59f784['displayMe']&&_0x3227ad['isMe'])return null;const _0x5ee37d=new P(this['context']['locale'],_0x3227ad,!!_0x59f784['onClick']);return _0x59f784['onClick']&&this['listenTo'](_0x5ee37d,'execute',()=>{_0x59f784['onClick'](_0x3227ad,_0x5ee37d['element']);}),_0x5ee37d;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x5831c9['focus'](),_0x5831c9['checkIfScrollable']();const _0x592156=(_0x5e540e,_0x4d1252)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x4d1252();};_0x5831c9['keystrokes']['set']('Esc',_0x592156),_0x5831c9['keystrokes']['set']('Shift+Tab',_0x592156),_0x5831c9['keystrokes']['set']('Tab',(_0x3e53dd,_0x292cf3)=>{!function(_0x4785f2){const _0x52d03a=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x649c11=>_0x649c11+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x39f671=[...document['body']['querySelectorAll'](_0x52d03a)]['filter'](_0x4a8857=>_0x4a8857===document['activeElement']||_0x4a8857['offsetWidth']+_0x4a8857['offsetHeight']>0x0)['sort']((_0x423911,_0x10317e)=>(_0x423911['tabIndex']||0x0)-(_0x10317e['tabIndex']||0x0)),_0x5965cd=_0x39f671['indexOf'](_0x4785f2),_0x33e797=_0x39f671[(_0x5965cd+0x1)%_0x39f671['length']];_0x33e797&&_0x33e797['focus']();}(this['view']['element']),this['hideDropdown'](),_0x292cf3();}),_0x5831c9['focusTracker']['add'](this['view']['element']),_0x5831c9['focusTracker']['on']('change:isFocused',(_0x13b931,_0x3e99b0,_0xa84577)=>{_0xa84577||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 gt extends _0x5b3d3d{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x11e548=>0x1!=_0x11e548}};
|