@ckeditor/ckeditor5-real-time-collaboration 45.1.0-alpha.5 → 45.1.0-alpha.7

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.
Files changed (170) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +14 -14
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. 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 _0x191ba5,Plugin as _0x12cabc,PendingActions as _0x41d3fc,Context as tt}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x5a4a16,CKEditorError as _0x3ddc56,Collection as _0x4b426b,global as _0x1686f2,version as ht,uid as _0x5cb9c1,KeystrokeHandler as _0x4733e4}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x95186,View as _0x58240d,ListView as _0x5f11c8,ListItemView as lt,LabelView as pt,BalloonPanelView as _0x5d639d,clickOutsideHandler as _0x1b51db,BodyCollection as _0x1d3b66}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ft,History as _0x523900,NoOperation as _0x108116,InsertOperation as _0x226075,MarkerOperation as _0x1ab205,RootAttributeOperation as _0x229d03,transformSets as _0x1eec30,OperationFactory as _0x2e4736}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as mt,WEB_SOCKET_GATEWAY_STATES as _0x1f4b62,CollaborativeEditingService as _0x43271b,User as gt,CommentsService as et,TrackChangesService as at,RevisionHistoryService as rt,EditorService as it}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x50fdcb,UserView as ut}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x53e424}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3744a5}from'es-toolkit/compat';class c extends _0x191ba5{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>mt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x95186];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x22a07d){super(_0x22a07d),this['set']('state',_0x1f4b62['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x5a4a16);}['init'](){const _0x38488f=this['context'],_0xf7e682=_0x38488f['plugins']['get']('CloudServices'),_0x10df4f=_0x38488f['plugins']['get'](_0x95186);if(!_0xf7e682['token'])throw new _0x3ddc56('websocketgateway-missing-token',this);if(!_0xf7e682['webSocketUrl'])throw new _0x3ddc56('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0xf7e682['token'],_0xf7e682['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0xd4fbf2=>{if(this['connection']=_0xd4fbf2,this['bind']('state')['to'](_0xd4fbf2,'state',this,'_isBrowserOffline',(_0x36238c,_0x235cf7)=>('connected'!==_0x36238c&&(this['_shouldPluginsReconnect']=!0x0),_0x235cf7||_0x36238c!==_0x1f4b62['CONNECTED']?_0x1f4b62['DISCONNECTED']:this['state']==_0x1f4b62['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x1f4b62['CONNECTING']):_0x1f4b62['CONNECTED'])),this['connection']['on']('error',(_0x38c9e1,_0x468fe7)=>{if('limitExceeded'!==_0x468fe7['code'])throw console['error'](_0x468fe7),new _0x3ddc56('cloudservices-init',null,{'originalError':_0x468fe7});_0x10df4f['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'});}),!_0xd4fbf2['me'])return new Promise(_0x38444b=>_0xd4fbf2['on']('change:me',_0x38444b));})['catch'](_0xa35161=>{throw console['error'](_0xa35161),new _0x3ddc56('cloudservices-init',null,{'originalError':_0xa35161});});}['addToReconnectionStack'](_0x11a2ad){if('function'!=typeof _0x11a2ad['reconnect'])throw new _0x3ddc56('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x11a2ad))throw new _0x3ddc56('websocketgateway-plugin-already-registered',this,{'name':_0x11a2ad['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x11a2ad);}['removeFromReconnectionStack'](_0x5440cf){this['_reconnectionStack']['delete'](_0x5440cf);}['isInReconnectionStack'](_0x9ee179){return this['_reconnectionStack']['has'](_0x9ee179);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x75da62=>_0x75da62['reconnect']())))['then'](()=>this['state']=_0x1f4b62['CONNECTED'])['catch'](_0x1346cc=>{throw console['error'](_0x1346cc),new _0x3ddc56('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x1f4b62['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x191ba5{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x50fdcb];}constructor(_0x10e6cb){super(_0x10e6cb),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x4b426b(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x50fdcb);}['init'](){const _0x26ddc0=this['context']['plugins']['get'](c);this['listenTo'](_0x26ddc0,'change:state',(_0x28ce8b,_0x3f7136,_0x49a641)=>{if('connected'!==_0x49a641)this['channelSessions']['forEach'](_0x5518ba=>_0x5518ba['clear']()),this['channelConnectedUsers']['forEach'](_0x408136=>_0x408136['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5e8112,_0x723b35]of this['_registeredSessions'])for(const _0x183228 of _0x723b35)this['_handleSessionAdd'](_0x5e8112,_0x183228);}}),this['_createUser'](_0x26ddc0['connection']['me'],!0x0);}['register'](_0x49f7f2,_0x323756){if(this['_registeredSessions']['has'](_0x49f7f2))throw new _0x3ddc56('sessions-register-already-registered',null,{'channelId':_0x49f7f2});this['_registeredSessions']['set'](_0x49f7f2,_0x323756),this['channelSessions']['set'](_0x49f7f2,new _0x4b426b()),this['channelConnectedUsers']['set'](_0x49f7f2,new _0x4b426b()),this['listenTo'](_0x323756,'add',(_0x1056f7,_0x4db3c2)=>this['_handleSessionAdd'](_0x49f7f2,_0x4db3c2)),this['listenTo'](_0x323756,'remove',(_0x5c7443,_0x1e8dea)=>this['_handleSessionRemove'](_0x49f7f2,_0x1e8dea));for(const _0x34c8ab of _0x323756)this['_handleSessionAdd'](_0x49f7f2,_0x34c8ab);}['unregister'](_0x2c7893){if(!this['_registeredSessions']['has'](_0x2c7893))throw new _0x3ddc56('sessions-unregister-not-exist',null,{'channelId':_0x2c7893});const _0x35ae9d=this['_registeredSessions']['get'](_0x2c7893);this['stopListening'](_0x35ae9d);for(const _0xd48541 of _0x35ae9d)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x2c7893,_0xd48541);this['_registeredSessions']['delete'](_0x2c7893),this['channelSessions']['delete'](_0x2c7893),this['channelConnectedUsers']['delete'](_0x2c7893);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x574795){for(const _0x49e50d of this['channelSessions']['values']())for(const _0x5efc64 of _0x49e50d)if(_0x5efc64['id']===_0x574795)return _0x5efc64['user'];}['getUserSessions'](_0xa76f35,_0x1e5023){const _0x3d5db4=_0x1e5023?[this['channelSessions']['get'](_0x1e5023)]:this['channelSessions']['values'](),_0x556bc7=new Set();for(const _0x5eb9e5 of _0x3d5db4)for(const _0x25a316 of _0x5eb9e5)_0x25a316['user']['id']===_0xa76f35['id']&&_0x556bc7['add'](_0x25a316['id']);return _0x556bc7;}['getUserRole'](_0x4f534b){for(const _0x2606dc of this['channelSessions']['values']())for(const _0x17850d of _0x2606dc)if(_0x17850d['user']===_0x4f534b)return _0x17850d['role'];}['_handleSessionAdd'](_0x4ac809,_0x55e631){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x23d50c=_0x55e631['user'],_0x370328=this['_users']['getUser'](_0x23d50c['id'])||this['_createUser'](_0x23d50c),_0x2c9ad3=Object['assign']({},_0x55e631,{'user':_0x370328});this['channelSessions']['get'](_0x4ac809)['add'](_0x2c9ad3);const _0x106ee6=this['channelConnectedUsers']['get'](_0x4ac809);_0x106ee6['has'](_0x370328['id'])||_0x106ee6['add'](_0x370328),this['allConnectedUsers']['has'](_0x370328['id'])||this['allConnectedUsers']['add'](_0x370328,_0x370328['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x4ac809,{'channelId':_0x4ac809,'session':_0x2c9ad3});}['_handleSessionRemove'](_0x18c909,_0x32d654){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x59f0c1=this['channelConnectedUsers']['get'](_0x18c909),_0x57e22f=_0x32d654['user'];_0x57e22f['id']&&(this['channelSessions']['get'](_0x18c909)['remove'](_0x32d654['id']),_0x59f0c1['has'](_0x57e22f['id'])&&!this['getUserSessions'](_0x57e22f,_0x18c909)['size']&&_0x59f0c1['remove'](_0x57e22f['id']),this['allConnectedUsers']['get'](_0x57e22f['id'])&&!this['getUserSessions'](_0x57e22f)['size']&&this['allConnectedUsers']['remove'](_0x57e22f['id']));}['_createUser'](_0x1fcfd1,_0x961504){const _0x28a430=this['_users']['addUser'](_0x1fcfd1);return _0x961504&&this['_users']['defineMe'](_0x1fcfd1['id']),_0x28a430['orderNumber']=this['_uniqueUsersCount']++,_0x28a430;}}class B extends _0x12cabc{['_domEmitter']=new(_0x5a4a16())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5f0d86=this['editor'],_0x12a59f=_0x5f0d86['plugins']['get'](i);_0x5f0d86['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x19cca5,{writer:_0x3b15f8})=>function(_0x10a5fe,_0x4cd053,_0x58df04,_0x1b978c){const _0x5822fe=_0x10a5fe['markerName']['split'](':')[0x2],_0x5e957b=_0x58df04['getUserBySessionId'](_0x5822fe);if(!_0x5e957b||_0x5822fe===_0x58df04['mySessionId'])return;if(!_0x1b978c['model']['schema']['checkChild'](_0x10a5fe['markerRange']['start'],'$text'))return;const _0x3817c2={'class':'ck-user__marker\x20'+_0x5e957b['color']['getMarkerClass'](),'data-name':_0x5e957b['name'],'data-session-id':_0x5822fe},_0x3bb676=_0x1b978c['model']['markers']['get'](_0x10a5fe['markerName']),_0x24475b=_0x3bb676['getStart'](),_0xaab0f4=_0x24475b['nodeAfter'],_0x336706=_0x1b978c['model']['schema'];if(_0xaab0f4&&_0x336706['isObject'](_0xaab0f4)&&_0x336706['isInline'](_0xaab0f4)&&!_0x1b978c['model']['markers']['get']('user:range:'+_0x5822fe)['getRange']()['isCollapsed'])return;const _0xd1b4b8=_0x24475b['parent'];return _0x1b978c['model']['schema']['isLimit'](_0xd1b4b8)&&!_0x1b978c['model']['hasContent'](_0xd1b4b8)&&(_0x3817c2['contenteditable']=!0x1),function(_0x45a3c9,_0x532821,_0x4d269e){const _0x4c7ad6=_0x45a3c9['createUIElement']('span',_0x532821);return _0x45a3c9['setCustomProperty']('userPositionMarker',!0x0,_0x4c7ad6),_0x4c7ad6['render']=function(_0x199d71){const _0x37413e=this['toDomElement'](_0x199d71),_0x48bc18=document['createElement']('span');return _0x48bc18['classList']['add']('ck-user__marker-tooltip'),_0x48bc18['setAttribute']('contenteditable','false'),_0x48bc18['setAttribute']('spellcheck','false'),_0x48bc18['textContent']=_0x4d269e['name'],_0x37413e['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x48bc18['outerHTML']+'⁠',_0x37413e['addEventListener']('mouseenter',()=>{_0x37413e['classList']['add']('ck-user__marker_hovered');}),_0x37413e['addEventListener']('mouseleave',()=>{_0x37413e['classList']['remove']('ck-user__marker_hovered');}),_0x37413e;},_0x4c7ad6['isSimilar']=function(_0x427fbf){return!(!this['getCustomProperty']('userPositionMarker')||!_0x427fbf['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x427fbf['getAttribute']('data-session-id'));},_0x4c7ad6;}(_0x4cd053,_0x3817c2,_0x5e957b);}(_0x19cca5,_0x3b15f8,_0x12a59f,_0x5f0d86)}),_0x5f0d86['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x38e1a0=>function(_0x58b355,_0x3ca184){const _0x313988=_0x58b355['markerName']['split'](':')[0x2];if(_0x313988===_0x3ca184['mySessionId'])return null;const _0x37f5d8=_0x3ca184['getUserBySessionId'](_0x313988);if(!_0x37f5d8)return{'id':_0x313988,'classes':[]};return{'id':_0x313988,'classes':['ck-user__selection',_0x37f5d8['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x313988},'priority':0x7d0+_0x37f5d8['orderNumber']};}(_0x38e1a0,_0x12a59f)}),function(_0x1b10e7){const _0x10ba3f=_0x1b10e7['model'],_0x32e6ce=new Map(),_0x2b385a=_0x1b10e7['plugins']['get'](i);_0x10ba3f['markers']['on']('update:user:range',(_0x4ad7fa,_0x22413c,_0x4a2628,_0x169cf9)=>{if(!_0x169cf9&&_0x32e6ce['get'](_0x22413c['name']))return _0x32e6ce['get'](_0x22413c['name'])['detach'](),void _0x32e6ce['delete'](_0x22413c['name']);const _0x351814=_0x22413c['name']['split'](':')[0x2];if(_0x351814===_0x2b385a['mySessionId'])return;const _0x51bc2f='user:position:'+_0x351814;_0x10ba3f['markers']['has'](_0x51bc2f)&&_0x1b10e7['editing']['reconvertMarker'](_0x51bc2f),_0x22413c['on']('change:range',(_0x258d1c,_0x4b7029,_0x4123a0)=>{if('$graveyard'!=_0x4b7029['root']['rootName']&&'$graveyard'==_0x22413c['getRange']()['root']['rootName']&&!_0x32e6ce['has'](_0x22413c['name'])){const _0x2c6053=_0x10ba3f['schema']['getNearestSelectionRange'](_0x4123a0['deletionPosition']);if(_0x2c6053){const _0x28b64a=ft['fromRange'](_0x2c6053);_0x32e6ce['set'](_0x22413c['name'],_0x28b64a),_0x28b64a['on']('change:range',(_0x3e11a5,_0x76cad2,_0x59d053)=>{if('$graveyard'==_0x28b64a['root']['rootName']){const _0x3c51cc=_0x10ba3f['schema']['getNearestSelectionRange'](_0x59d053['deletionPosition']);_0x3c51cc?(_0x28b64a['start']=_0x3c51cc['start'],_0x28b64a['end']=_0x3c51cc['end']):(_0x32e6ce['delete'](_0x22413c['name']),_0x28b64a['detach']());}});}}});}),_0x10ba3f['document']['on']('change',()=>{_0x32e6ce['size']>0x0&&_0x10ba3f['enqueueChange']({'isUndoable':!0x1},_0x48db22=>{for(const [_0x29f3e6,_0x295fb3]of _0x32e6ce)'$graveyard'==_0x10ba3f['markers']['get'](_0x29f3e6)['getRange']()['root']['rootName']&&(X(_0x29f3e6['split'](':')[0x2],_0x295fb3['toRange'](),_0x10ba3f,_0x48db22),_0x295fb3['detach']());_0x32e6ce['clear']();});});}(_0x5f0d86),this['_domEmitter']['listenTo'](_0x1686f2['document'],'keydown',(_0x516d88,{key:_0x32f740})=>{'Escape'===_0x32f740&&function(_0x49918c){_0x49918c['editing']['view']['change'](_0x4e0f24=>{for(const _0x2182c7 of _0x49918c['model']['markers']){if(!_0x2182c7['name']['startsWith']('user:position'))continue;const _0x4e9dac=_0x49918c['editing']['mapper']['markerNameToElements'](_0x2182c7['name']);if(_0x4e9dac){for(const _0x18eeb6 of _0x4e9dac)_0x4e0f24['removeClass']('ck-user__marker_hovered',_0x18eeb6);}}});}(_0x5f0d86);},{'useCapture':!0x0});}['afterInit'](){const _0x9b2e2a=this['editor'],_0x144f9e=_0x9b2e2a['commands']['get']('undo');_0x144f9e&&_0x9b2e2a['model']['on']('applyOperation',(_0x393343,_0x5d9346)=>{const _0xdb9052=_0x5d9346[0x0];if(!_0xdb9052['isDocumentOperation'])return;if('marker'!=_0xdb9052['type']||!_0xdb9052['name']['startsWith']('user:'))return;const _0x12bb3e=_0xdb9052['batch'];_0x144f9e['_createdBatches']['has'](_0x12bb3e)&&(_0xdb9052['newRange']=_0xdb9052['oldRange']?_0x9b2e2a['model']['createRange'](_0xdb9052['oldRange']['start'],_0xdb9052['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x290a3a=this['editor'],_0x34f044=_0x290a3a['model']['document'],_0x1a2020=_0x290a3a['plugins']['get'](i);_0x290a3a['model']['enqueueChange']({'isUndoable':!0x1},_0x10e00f=>{const _0x2b91c5='user:range:'+_0x1a2020['mySessionId'],_0x41a6ba='user:position:'+_0x1a2020['mySessionId'],_0x2cdf7c=_0x290a3a['model']['markers']['has'](_0x2b91c5);_0x290a3a['editing']['view']['hasDomSelection']?X(_0x1a2020['mySessionId'],_0x34f044['selection']['getFirstRange'](),_0x290a3a['model'],_0x10e00f):_0x2cdf7c&&(_0x10e00f['removeMarker'](_0x2b91c5),_0x10e00f['removeMarker'](_0x41a6ba));});}}function X(_0x1b70ff,_0x4ce889,_0x2f0881,_0x5ea24c){const _0x357e08='user:range:'+_0x1b70ff,_0x43d3a4='user:position:'+_0x1b70ff,_0x2e372f=_0x4ce889['getContainedElement']();let _0x30ce9c=_0x4ce889['start'];_0x2e372f&&_0x2e372f['is']('element','tableCell')&&(_0x30ce9c=function(_0x24d3e3,_0x1291bb){for(const _0x1ebefe of _0x24d3e3['getPositions']())if(_0x1291bb['schema']['checkChild'](_0x1ebefe,'$text'))return _0x1ebefe;}(_0x4ce889,_0x2f0881),_0x4ce889=_0x5ea24c['createRange'](_0x30ce9c));const _0x219391=_0x5ea24c['createRange'](_0x30ce9c);_0x2f0881['markers']['has'](_0x357e08)?(_0x5ea24c['updateMarker'](_0x357e08,{'range':_0x4ce889}),_0x5ea24c['updateMarker'](_0x43d3a4,{'range':_0x219391})):(_0x5ea24c['addMarker'](_0x357e08,{'range':_0x4ce889,'usingOperation':!0x0}),_0x5ea24c['addMarker'](_0x43d3a4,{'range':_0x219391,'usingOperation':!0x0}));}function M(_0x611d3a,_0x3755bd,_0x227212){const _0x4daf2f=_0x611d3a['t'],t=_0x611d3a['t'];switch(_0x3755bd){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 _0x4daf2f({'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'},_0x227212);default:return'';}}let F=0x1;class l extends _0x12cabc{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x43271b)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,B,_0x41d3fc,_0x50fdcb,_0x95186];}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 _0x207d70=this['serverHistory']['getOperations']();for(let _0x37c77e=_0x207d70['length']-0x1;_0x37c77e>=0x0;_0x37c77e--){const _0x4a795e=_0x207d70[_0x37c77e];if(!this['_disconnectionOperations']['has'](_0x4a795e))return _0x4a795e['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2a20b8){if(super(_0x2a20b8),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x523900(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3ddc56('collaboration-missing-channelid',this);const _0x5ef343=_0x2a20b8['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x5ef343,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x53e424(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new $(this['_disconnectionOperations']);}['init'](){const _0xe42816=this['editor'],_0x116446=_0xe42816['plugins']['get'](_0x50fdcb),_0x2d10fd=_0xe42816['plugins']['get'](c);this['listenTo'](_0x116446,'getOperationAuthor',(_0xb2b9e5,_0x251641)=>{const _0x121f6e=_0x251641[0x0];_0x121f6e['_authorId']&&(_0xb2b9e5['return']=_0x116446['getUser'](_0x121f6e['_authorId']),_0xb2b9e5['stop']()),null===_0x121f6e['_authorId']&&(_0xb2b9e5['return']=null,_0xb2b9e5['stop']());},{'priority':'high'}),this['listenTo'](_0xe42816['model']['document']['selection'],'change:range',(_0x2ffeaf,_0x7c77d7)=>{_0x7c77d7['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xe42816['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xe42816['model']['on']('applyOperation',(_0x3ab08e,_0x1a059f)=>{const _0x87ee58=_0x1a059f[0x0];_0x87ee58['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x87ee58),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2d10fd,'state',this,'_hasSynchronizationProblem',(_0x5c89f1,_0x2ba9b8)=>'connected'===_0x5c89f1&&!_0x2ba9b8),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xe42816['disableReadOnlyMode']('rtc-offline'):_0xe42816['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xe42816['disableReadOnlyMode']('rtc-offline'):_0xe42816['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x588579=this['editor']['plugins']['get'](i),_0x56e8d0=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x588579['unregister'](this['_channelId']);const _0x439083=await this['_service']['reconnect'](_0x56e8d0['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x439083)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x5ef3ba=await this['_service']['getConnectedSessions']();_0x588579['register'](this['_channelId'],_0x5ef3ba),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x1b4b4a){if(function(_0x42176c){return'404'===_0x42176c['code'];}(_0x1b4b4a)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x24757a){return'409'===_0x24757a['code'];}(_0x1b4b4a)){const _0xf595d6=M(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0xf595d6);}else{if(!(_0x1b4b4a instanceof q))throw _0x1b4b4a;this['_handleReconnectionError']();}}}}['destroy'](){const _0x28f2ba=this['editor']['plugins']['get'](c),_0x5e338d=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x5e338d['channelSessions']['has'](this['_channelId'])&&_0x5e338d['unregister'](this['_channelId']),_0x28f2ba['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x540330){if(this['sessionId']!==_0x540330['sessionId']&&this['_lastSyncedOperationId']!==_0x540330['lastOperationId'])throw new q();return this['sessionId']=_0x540330['sessionId'],this['_handleServerResponse']([],{..._0x540330,'wereChangesApplied':!0x1,'data':_0x540330['data']},'reconnect');}async['_connectService'](_0x314cda,_0x1dbb0a=!0x1){const {connection:_0x11bd01}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x11bd01,this['_channelId'])['then'](_0x4168cb=>this['_initSessionsHandling'](_0x4168cb))['catch'](_0x3cf15b=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3cf15b);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x12954a,_0x32cfec)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x32cfec);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x469ce1=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x314cda);this['_isPendingUpdate']=!0x0;const _0x590407=await this['_service']['connect'](_0x11bd01,this['_compressOperations'](_0x314cda),_0x469ce1);if(this['sessionId']=_0x590407['sessionId'],_0x1dbb0a){if(!_0x590407['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x590407['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x314cda,_0x590407,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x590407,_0x314cda);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0xc37fe9=this['editor']['plugins']['get'](i),_0xf4a1c2=this['editor']['plugins']['get'](B),_0x2a31c2=_0xc37fe9['channelSessions']['get'](this['_channelId']);_0x2a31c2&&_0x2a31c2['length']>0x1?_0xf4a1c2['createUserMarkerOperations']():this['listenTo'](_0xc37fe9,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xc37fe9['channelSessions']['get'](this['_channelId'])['length']&&_0xf4a1c2['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3892d6,_0x2628ef,_0x575820,_0x469e62){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2628ef){const _0x517a9b=this['_decompressOperations'](_0x575820,_0x469e62);await this['_fetchMissingUsers'](_0x517a9b),this['_handleExternalOperations'](_0x517a9b,_0x2628ef,_0x575820['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1b5929}=this['editor'];let _0x3d1a81;try{_0x3d1a81=await this['_service']['getDocumentDetails']();}catch(_0x5f97be){const _0x224a64=M(_0x1b5929,'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'](_0x224a64);}const _0x39fd70=_0x3d1a81['currentDocumentSession']||_0x3d1a81['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x39fd70['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x1a83e2=M(_0x1b5929,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x1a83e2);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x8a916e){const _0x3cf79c=this['editor']['plugins']['get'](i);this['listenTo'](_0x3cf79c,'sessionAdd:'+this['_channelId'],(_0xb5e65c,{session:_0xe1974a})=>{if(_0xe1974a['id']===_0x3cf79c['mySessionId']){_0xb5e65c['off']();const _0x20f8e7=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2f59f0=_0xe1974a['permissions'];_0x20f8e7&&_0x20f8e7['isEnabled']&&(_0x2f59f0=_0x2f59f0['filter'](_0x5450e1=>'document:write'!==_0x5450e1)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2f59f0,this['_channelId']);}}),_0x3cf79c['register'](this['_channelId'],_0x8a916e);}['_initThrowingOnDataSet'](){const _0x4c9fe0=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5b97ea)=>{if(!_0x5b97ea[_0x5b97ea['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3ddc56('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x4c9fe0['apply'](this['editor']['data'],_0x5b97ea);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x312d33,[_0x504c63])=>{if(this['_document']['version'])throw new _0x3ddc56('realtimecollaborationclient-init-document-already-initialized',this);_0x312d33['stop'](),this['_setPendingAction']();const _0x33e86a=this['editor']['config']['get']('rootsAttributes'),_0x5607df=this['_getOperationsFromInitData'](_0x504c63,_0x33e86a);0x0==_0x5607df['length']&&_0x5607df['push'](new _0x108116(0x0)),_0x312d33['return']=this['_connectService'](_0x5607df)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x44edf8=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x44edf8))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x17b493,[_0x28946f,_0x2d267d])=>{_0x17b493['stop']();const _0x37ee30=this['editor']['model']['document']['getRoot'](_0x28946f);if(!this['_knownRootNames']['has'](_0x28946f)){const _0xc76269=_0x2d267d&&_0x2d267d['data']?_0x2d267d['data']:'',_0x957254=_0x2d267d&&_0x2d267d['attributes']?_0x2d267d['attributes']:{};await this['_loadRoot'](_0x28946f,_0xc76269,_0x957254);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x37ee30['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x37ee30);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xbca6ec){const _0x46a445=this['editor']['plugins']['get'](_0x50fdcb),{connection:_0x521d28}=this['editor']['plugins']['get'](c),_0x121c42=new Set();for(const _0x42444b of _0xbca6ec){const _0x48bb93=_0x42444b['_authorId'];_0x48bb93&&!_0x46a445['getUser'](_0x48bb93)&&_0x121c42['add'](_0x48bb93);}if(0x0===_0x121c42['size'])return;const _0xaf3612=await gt['getMany'](_0x521d28,Array['from'](_0x121c42));for(const _0x23cb82 of _0xaf3612)_0x46a445['getUser'](_0x23cb82['id'])||_0x46a445['addUser'](_0x23cb82);}['_getOperationsFromInitData'](_0x4d26b4,_0x35ec71={}){const _0x22cc38=this['editor']['model'],_0x1ea2dc=[];let _0x15c741=0x0;const _0x51ea54='string'==typeof _0x4d26b4?{'main':_0x4d26b4}:_0x4d26b4;for(const _0xb0018d of Object['keys'](_0x51ea54)){if(!this['_document']['roots']['has'](_0xb0018d))throw new _0x3ddc56('realtimecollaborationclient-init-non-existent-root',this);const _0x301d89=this['editor']['data']['parse'](_0x51ea54[_0xb0018d]),_0x17a7c7=this['_document']['getRoot'](_0xb0018d),_0x2efaac=new _0x226075(_0x22cc38['createPositionAt'](_0x17a7c7,0x0),_0x301d89,_0x15c741++);_0x1ea2dc['push'](_0x2efaac);for(const [_0x2fa5db,_0x4e1bf3]of _0x301d89['markers']){const _0x4f360f=_0x22cc38['createRange'](_0x22cc38['createPositionFromPath'](_0x17a7c7,_0x4e1bf3['start']['path']['slice']()),_0x22cc38['createPositionFromPath'](_0x17a7c7,_0x4e1bf3['end']['path']['slice']())),_0x173b19=new _0x1ab205(_0x2fa5db,null,_0x4f360f,_0x22cc38['markers'],!0x0,_0x15c741++);_0x1ea2dc['push'](_0x173b19);}}if(_0x35ec71)for(const [_0x1cf1b3,_0x201fdf]of Object['entries'](_0x35ec71)){const _0x301304=_0x22cc38['document']['getRoot'](_0x1cf1b3);if(!_0x301304)throw new _0x3ddc56('multi-root-editor-root-attributes-no-root',null);for(const [_0x46db0e,_0x8ca9e9]of Object['entries'](_0x201fdf))if(null!==_0x8ca9e9){const _0x2d7e0f=new _0x229d03(_0x301304,_0x46db0e,null,_0x8ca9e9,_0x15c741++);_0x1ea2dc['push'](_0x2d7e0f);}}return _0x1ea2dc;}async['_loadRoot'](_0x5cf729,_0x44d069,_0x57a6c2){this['_getOperationsFromInitData']({[_0x5cf729]:_0x44d069},{[_0x5cf729]:_0x57a6c2})['forEach']((_0x44909c,_0x57b46f)=>{_0x44909c['baseVersion']=this['_document']['version']+_0x57b46f,_0x44909c['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x44909c);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x53b4e4,_0x3679af){let _0xd5440c;this['_offset']=_0x53b4e4['offset'];const _0x4e7167=_0x53b4e4['wereChangesApplied']&&!_0x53b4e4['initData'],_0x121639=_0x4e7167?0x0:_0x53b4e4['data']['baseVersion'];if(_0x3679af['forEach'](_0x51171f=>{_0x51171f['_isInit']=!0x0,_0x51171f['createdAt']=_0x53b4e4['sessionCreatedAt'],_0x51171f['_authorId']=null;}),_0x4e7167)_0xd5440c=_0x3679af,this['_applyOperationsSet'](_0xd5440c,_0x4e7167);else{if(_0x53b4e4['initData']){const _0xbf699f=this['_getOperationsFromInitData'](_0x53b4e4['initData']);this['_document']['history']['version']=-_0xbf699f['length'],_0xbf699f['forEach'](_0x4f78b2=>{_0x4f78b2['baseVersion']-=_0xbf699f['length'],_0x4f78b2['createdAt']=_0x53b4e4['sessionCreatedAt'],_0x4f78b2['_isInit']=!0x0,_0x4f78b2['_authorId']=null;}),this['_applyOperationsSet'](_0xbf699f,!0x0),this['serverHistory']['version']=-_0xbf699f['length']+this['_offset'],this['_updateServerHistory'](_0xbf699f);}this['_document']['history']['version']=_0x121639,_0xd5440c=this['_decompressOperations'](_0x53b4e4['data'],_0x53b4e4['metadata']),await this['_fetchMissingUsers'](_0xd5440c),this['_applyOperationsSet'](_0xd5440c,_0x4e7167);}_0x53b4e4['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xd5440c,_0x53b4e4['lastOperationId']),this['_lastSyncedOperationId']=_0x53b4e4['lastOperationId']),this['serverHistory']['version']=_0x121639+this['_offset'],this['_updateServerHistory'](_0xd5440c),_0x3679af['filter'](_0x3be6af=>{const _0x4a644e=this['_getAffectedRoot'](_0x3be6af);return _0x4a644e&&!this['_knownRootNames']['has'](_0x4a644e);})['forEach']((_0x578bc1,_0x237dec)=>{_0x578bc1['baseVersion']=this['_document']['version']+_0x237dec,this['_saveOperationInBuffer'](_0x578bc1);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x1741cb,_0x12ee20){const _0x1aa126=_0x12ee20&&_0x12ee20['message'];if(_0x1aa126&&_0x1aa126['startsWith']('realtimecollaborationclient'))throw _0x12ee20;const _0x2203e=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x2203e['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3ddc56(_0x1741cb,this['editor'],_0x1aa126?{'originalError':_0x1aa126}:void 0x0);}['_saveOperationInBuffer'](_0x18b44b){this['_knownOperations']['has'](_0x18b44b)||(this['_knownOperations']['add'](_0x18b44b),this['_bufferedOperations']['push'](_0x18b44b),this['_pendingAction']||'marker'==_0x18b44b['type']&&!_0x18b44b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x5c1637=!0x1){!_0x5c1637&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x167099=>{_0x167099&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2523df=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x41f862){return _0x41f862['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41f862['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x41f862['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2523df)||this['_crash'](_0x2523df['message'],_0x2523df);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x175f67=>{this['on']('change:_isPendingUpdate',()=>{_0x175f67();});});}async['_sendBufferedOperations'](){const _0x29dec0=this['editor']['plugins']['get'](B);if(this['_shouldSendSelectionUpdate']()&&(_0x29dec0['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x45ce03=[...this['_bufferedOperations']];for(const _0x12df3c of _0x45ce03)_0x12df3c['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x12df3c);const _0x9c4da1=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x45ce03),_0x5a66a6=F++,_0x13e7ba=this['_compressOperations'](_0x45ce03),_0x22aa60=await this['_service']['sendOperations'](_0x13e7ba,_0x13e7ba['baseVersion'],_0x9c4da1);try{return await this['_handleServerResponse'](_0x45ce03,_0x22aa60,_0x5a66a6);}catch(_0x46cd6c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x46cd6c);}}async['_handleServerResponse'](_0xebc9b5,_0x5097fe,_0x3344b5){if('error'in _0x5097fe)throw _0x5097fe['error'];let _0x44e1f5=!0x1;if(_0x5097fe['wereChangesApplied']){_0x5097fe['lastOperationId']&&(this['_lastSyncedOperationId']=_0x5097fe['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3747be=>!_0xebc9b5['includes'](_0x3747be));for(const _0x5748f5 of _0xebc9b5)_0x5748f5['createdAt']='lastOperationAcceptedAt'in _0x5097fe&&_0x5097fe['lastOperationAcceptedAt']||void 0x0;G(_0xebc9b5,_0x5097fe['version']-_0xebc9b5['length']),this['_updateServerHistory'](_0xebc9b5);const _0x427dcf=_0xebc9b5['filter'](_0x291264=>{if(!_0x291264['_isInit'])return!0x1;const _0x647705=this['_getAffectedRoot'](_0x291264);return _0x647705&&!this['_knownRootNames']['has'](_0x647705);});G(_0x427dcf,this['_document']['version']),this['_applyOperationsSet'](_0x427dcf),_0x44e1f5=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x16f27c=this['_decompressOperations'](_0x5097fe['data'],_0x5097fe['metadata'])['filter'](_0x5188db=>_0x5188db['baseVersion']>=this['_lastServerVersion']);_0x16f27c['forEach'](_0x487a8b=>this['_addKnownRoot'](_0x487a8b)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5e4ca2=>!_0x5e4ca2['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5e4ca2))),this['_bufferedOperations']['length']&&G(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x16f27c),_0x44e1f5=this['_handleExternalOperations'](_0x16f27c,_0x5097fe['version'],_0x5097fe['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x44e1f5?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x38d1d7,_0x289cab,_0xf0b547){try{const _0x47dbeb={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x378307,operationsB:_0x55f934,originalOperations:_0x42e3b9}=_0x1eec30(_0x38d1d7,this['_bufferedOperations'],_0x47dbeb);G(_0x378307,this['_document']['version']),G(_0x55f934,_0x289cab);for(const _0xc0eb9f of _0x378307){const _0x1210c2=_0x42e3b9['get'](_0xc0eb9f);_0xc0eb9f['_authorId']=_0x1210c2?_0x1210c2['_authorId']:null;}_0xf0b547&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x38d1d7,_0xf0b547),this['_lastSyncedOperationId']=_0xf0b547),this['_bufferedOperations']=[..._0x55f934],this['_applyOperationsSet'](_0x378307),this['_updateServerHistory'](_0x38d1d7);}catch(_0x19385d){return console['error'](_0x19385d),!0x1;}return!0x0;}['_applyOperationsSet'](_0x15218b,_0x31bffb=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x551773=>{for(const _0x1a6e03 of _0x15218b)this['_knownOperations']['add'](_0x1a6e03),this['_addKnownRoot'](_0x1a6e03),_0x551773['batch']['addOperation'](_0x1a6e03),this['editor']['model']['applyOperation'](_0x1a6e03);});}['_addKnownRoot'](_0x48490f){const _0x1b38b4=this['_getAffectedRoot'](_0x48490f);_0x1b38b4&&this['_knownRootNames']['add'](_0x1b38b4);}['_getAffectedRoot'](_0x36f920){let _0x9bb0db,_0x525562;switch(_0x36f920['type']){case'insert':_0x9bb0db=_0x36f920['position']['root'];break;case'marker':if(_0x525562=_0x36f920['newRange'],!_0x525562)return null;_0x9bb0db=_0x525562['root'];break;case'addRootAttribute':_0x9bb0db=_0x36f920['root'];break;case'addRoot':_0x9bb0db=_0x36f920['affectedSelectable'];break;case'move':_0x9bb0db=_0x36f920['targetPosition']['root'];break;default:return null;}return _0x9bb0db['rootName'];}['_updateServerHistory'](_0x332e6d){_0x332e6d['forEach'](_0xd24213=>{const _0x2b2a95=_0xd24213['clone']();_0x2b2a95['_authorId']=_0xd24213['_authorId'],_0x2b2a95['_isInit']=!!_0xd24213['_isInit'],_0x2b2a95['createdAt']=_0xd24213['createdAt'],_0x2b2a95['baseVersion']+=this['_offset'],_0xd24213['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x2b2a95),this['serverHistory']['addOperation'](_0x2b2a95);});}['_handleReconnectionError'](_0xcc5e9d){const _0x1c4df9=this['editor']['plugins']['get']('Notification'),_0x1db35b=this['editor']['locale'];_0xcc5e9d||(_0xcc5e9d=M(_0x1db35b,'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.')),_0x1c4df9['showWarning'](_0xcc5e9d,{'title':M(_0x1db35b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x41d3fc)['add'](M(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x41d3fc)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x1561bc){const _0xc3a7c0=_0x1561bc['map'](_0xd7244c=>_0xd7244c['toJSON']());return this['_compressor']['compress'](_0xc3a7c0);}['_decompressOperations'](_0x464732,_0x13d9ad){return this['_compressor']['decompress'](_0x464732)['map']((_0xff5fc3,_0x23b9e7)=>{const _0x54e489='init'==_0x13d9ad[_0x23b9e7]['type'];if('InsertOperation'==_0xff5fc3['__className']){const _0x252460=_0xff5fc3['position']['root'];!this['_document']['getRoot'](_0x252460)&&(this['_document']['createRoot']('$root',_0x252460)['_isAttached']=!0x1);}const _0x24b1a0=_0x2e4736['fromJSON'](_0xff5fc3,this['_document']);return _0x24b1a0['wasUndone']=_0xff5fc3['wasUndone'],_0x24b1a0['_isInit']=_0x54e489,_0x24b1a0['_authorId']=_0x54e489?null:_0x13d9ad[_0x23b9e7]['userId'],_0x24b1a0['_isDisconnection']='cs:removeUser'===_0x13d9ad[_0x23b9e7]['type'],_0x24b1a0['createdAt']=_0x13d9ad[_0x23b9e7]['createdAt'],_0x24b1a0;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3819db=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3819db&&_0x3819db['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class q extends Error{}function G(_0x35f4b,_0x3b2bc0){for(const _0x142688 of _0x35f4b)_0x142688['baseVersion']=_0x3b2bc0++;}class ${['_ignoredOperations'];['_operationToId'];constructor(_0x4c36dd){this['_ignoredOperations']=_0x4c36dd,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x2d9b63){let _0x3e3efc=_0x2d9b63['length'];for(;_0x3e3efc--;){const _0x412465=_0x2d9b63[_0x3e3efc];if(!this['_ignoredOperations']['has'](_0x412465)){if(!this['_operationToId']['has'](_0x412465)){const _0x4898df=_0x5cb9c1()['slice'](0x1,0x12);this['_operationToId']['set'](_0x412465,_0x4898df);}return this['_operationToId']['get'](_0x412465);}}}['setIdForTheLastOperation'](_0x51ca5d,_0x1fd6da){if(!_0x1fd6da)return;let _0x22c2d0=_0x51ca5d['length'];for(;_0x22c2d0--;){const _0x5ee39f=_0x51ca5d[_0x22c2d0];this['_ignoredOperations']['has'](_0x5ee39f)||this['_operationToId']['set'](_0x5ee39f,_0x1fd6da);}}}class n extends _0x12cabc{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x191ba5{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>et)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x50fdcb];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5c1302){super(_0x5c1302),this['_services']=new Map();}async['init'](){const _0x54b16c=this['context'],_0x477940=_0x54b16c['plugins']['get']('CommentsRepository');if(_0x54b16c['plugins']['get'](c)['addToReconnectionStack'](this),_0x477940['adapter']={'addCommentThread':async({channelId:_0x426457,threadId:_0x1623a9,comments:_0x774268,resolvedAt:_0x366eea,resolvedBy:_0x3fb138,context:_0x4d1bdb,attributes:_0x50d4da})=>{const _0x294228=await this['_getService'](_0x426457)['addCommentThread']({'commentThreadId':_0x1623a9,'comments':_0x774268['map'](_0x1cced7=>function(_0x4bd066,_0x4bdb7c,_0x134f9f){return{'commentThreadId':_0x134f9f,'commentId':_0x4bd066['commentId'],'userId':_0x4bd066['authorId'],'content':_0x4bd066['content'],'documentId':_0x4bdb7c,'createdAt':_0x4bd066['createdAt'],'attributes':_0x4bd066['attributes']||{}};}(_0x1cced7,_0x426457,_0x1623a9)),'resolvedAt':_0x366eea,'resolvedBy':_0x3fb138,'context':_0x4d1bdb,'attributes':_0x50d4da})['catch'](wt);return{'threadId':_0x294228['commentThreadId'],'comments':_0x294228['comments']};},'getCommentThread':async({channelId:_0x4c350c,threadId:_0x5c117d})=>{const _0x516b80=await this['_getService'](_0x4c350c)['getCommentThread'](_0x5c117d)['catch'](wt);return _0x516b80['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x516b80]),{'threadId':_0x516b80['commentThreadId'],'comments':_0x516b80['comments']['map'](st),'context':_0x516b80['context'],'resolvedAt':_0x516b80['resolvedAt'],'resolvedBy':_0x516b80['resolvedBy'],'attributes':_0x516b80['attributes']||{}});},'updateCommentThread':async({channelId:_0x56bc8f,threadId:_0x5c5cab,context:_0x3f69ac,unlinkedAt:_0x2d983e,attributes:_0x565aac})=>this['_getService'](_0x56bc8f)['updateCommentThread']({'commentThreadId':_0x5c5cab,'context':_0x3f69ac,'attributes':_0x565aac,'unlinkedAt':_0x2d983e})['catch'](ot)['catch'](wt),'resolveCommentThread':async({channelId:_0x9ce457,threadId:_0x27d61d})=>{const _0x306272=await this['_getService'](_0x9ce457)['resolveCommentThread'](_0x27d61d)['catch'](ot)['catch'](wt);return{'threadId':_0x306272['commentThreadId'],'resolvedAt':_0x306272['resolvedAt'],'resolvedBy':_0x306272['resolvedBy']};},'reopenCommentThread':async({channelId:_0x563278,threadId:_0x7c3e37})=>this['_getService'](_0x563278)['reopenCommentThread'](_0x7c3e37)['catch'](ot)['catch'](wt),'removeCommentThread':({channelId:_0x2c5222,threadId:_0x55343e})=>this['_getService'](_0x2c5222)['removeCommentThread'](_0x55343e)['catch'](ot)['catch'](wt),'addComment':({channelId:_0x1c53c1,threadId:_0x3ef737,commentId:_0x55abb5,content:_0x1f903b,attributes:_0x335e91})=>this['_getService'](_0x1c53c1)['addComment'](_0x3ef737,_0x55abb5,_0x1f903b,_0x335e91)['catch'](wt),'updateComment':({channelId:_0x2c6feb,threadId:_0x1589fa,commentId:_0x7ef82d,content:_0x415d94,attributes:_0x54c67c})=>this['_getService'](_0x2c6feb)['updateComment'](_0x1589fa,_0x7ef82d,_0x415d94,_0x54c67c)['catch'](ot)['catch'](wt),'removeComment':({channelId:_0x36b238,threadId:_0x5c6491,commentId:_0xc1c712})=>this['_getService'](_0x36b238)['removeComment'](_0x5c6491,_0xc1c712)['catch'](ot)['catch'](wt)},_0x54b16c instanceof tt){const _0x496a58=_0x54b16c['config']['get']('collaboration.channelId'),_0xb22e17=_0x54b16c['plugins']['get'](i);await this['_setUpService'](_0x496a58);const _0x5c5d54=await this['_services']['get'](_0x496a58)['getConnectedSessions']();this['listenTo'](_0xb22e17,'sessionAdd:'+_0x496a58,(_0x5d8aa6,{session:_0x35432d})=>{_0x35432d['id']===_0xb22e17['mySessionId']&&(_0x5d8aa6['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x35432d['permissions'],_0x496a58));}),_0xb22e17['register'](_0x496a58,_0x5c5d54);}}async['_setUpService'](_0x33a29c){if(this['_services']['has'](_0x33a29c))throw new _0x3ddc56('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x33a29c});const _0x470beb=this['context']['plugins']['get']('CommentsRepository'),_0x168303=new a['CommentsService'](_0x33a29c);this['_services']['set'](_0x33a29c,_0x168303),this['listenTo'](_0x168303,'commentThreadAdded',(_0x34102b,_0x3b5dd1)=>{const {commentThreadId:_0x1838bf,documentId:_0x27d10b,context:_0x56d1f4,attributes:_0x31fcb3,resolvedAt:_0x3a06f1,resolvedBy:_0x1f99e2,comments:_0x7dab21}=_0x3b5dd1;_0x470beb['getCommentThread'](_0x1838bf)||_0x470beb['addCommentThread']({'threadId':_0x1838bf,'channelId':_0x27d10b,'comments':_0x7dab21?_0x7dab21['map'](st):[],'context':_0x56d1f4,'attributes':_0x31fcb3,'resolvedAt':_0x3a06f1,'resolvedBy':_0x1f99e2,'isFromAdapter':!0x0});}),this['listenTo'](_0x168303,'commentThreadUpdated',(_0x142f1c,{commentThreadId:_0x362e68,documentId:_0x5e588c,context:_0x411d37,unlinkedAt:_0x4a1cae,attributes:_0x1a8360})=>{_0x470beb['getCommentThread'](_0x362e68)&&_0x470beb['updateCommentThread']({'threadId':_0x362e68,'channelId':_0x5e588c,'context':_0x411d37,'unlinkedAt':_0x4a1cae,'attributes':_0x1a8360,'isFromAdapter':!0x0});}),this['listenTo'](_0x168303,'commentThreadResolved',(_0x447616,{commentThreadId:_0xb33b2,resolvedBy:_0x48e30b,resolvedAt:_0x51fca6})=>{const _0x45b73b=_0x470beb['getCommentThread'](_0xb33b2);_0x45b73b&&_0x45b73b['resolve']({'resolvedBy':_0x48e30b,'resolvedAt':_0x51fca6,'isFromAdapter':!0x0});}),this['listenTo'](_0x168303,'commentThreadReopened',(_0x316ab8,{commentThreadId:_0x2a9d91})=>{const _0x36f32=_0x470beb['getCommentThread'](_0x2a9d91);_0x36f32&&_0x36f32['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x168303,'commentThreadRemoved',(_0x1aa89e,{commentThreadId:_0x4245a5})=>{const _0x5dacec=_0x470beb['getCommentThread'](_0x4245a5);_0x5dacec&&_0x5dacec['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x168303,'commentAdded',(_0x5ca8f5,_0x847461)=>{const _0x20f425=_0x847461['commentThreadId'],_0x2d83c2=_0x470beb['getCommentThread'](_0x20f425);_0x2d83c2&&_0x2d83c2['addComment']({...st(_0x847461),'isFromAdapter':!0x0});}),this['listenTo'](_0x168303,'commentUpdated',(_0x40c0db,{commentThreadId:_0x44ec2c,commentId:_0x315362,content:_0x510201,attributes:_0x5319c4})=>{const _0x1fcafd=_0x470beb['getCommentThread'](_0x44ec2c);if(_0x1fcafd){const _0x54be6d=_0x1fcafd['getComment'](_0x315362);_0x54be6d&&_0x54be6d['update']({'content':_0x510201,'attributes':_0x5319c4,'isFromAdapter':!0x0});}}),this['listenTo'](_0x168303,'commentRemoved',(_0x2cd584,{commentThreadId:_0x366efb,commentId:_0x386748})=>{const _0x40cdda=_0x470beb['getCommentThread'](_0x366efb);if(_0x40cdda){const _0x42e0c4=_0x40cdda['getComment'](_0x386748);_0x42e0c4&&_0x42e0c4['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x33a29c);}['destroy'](){if(this['context']instanceof tt){const _0x2c13b7=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x2c13b7);}}['_terminateService'](_0x5105ea){if(!this['_services']['has'](_0x5105ea))throw new _0x3ddc56('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x5105ea});this['_getService'](_0x5105ea)['disconnect'](),this['_services']['delete'](_0x5105ea);}async['reconnect'](){for(const _0x66cd55 of this['_services']['keys']())await this['_connectService'](_0x66cd55);if(this['context']instanceof tt){const _0x4ffaeb=this['context']['config']['get']('collaboration.channelId'),_0x1c27ff=this['context']['plugins']['get'](i);_0x1c27ff['unregister'](_0x4ffaeb);const _0x51864c=await this['_services']['get'](_0x4ffaeb)['getConnectedSessions']();_0x1c27ff['register'](_0x4ffaeb,_0x51864c);}}async['_connectService'](_0xd58324){const {connection:_0xa2df8}=this['context']['plugins']['get'](c),_0x31f715=this['context']['plugins']['get']('CommentsRepository'),_0x3cbeb0=this['_services']['get'](_0xd58324),_0xfb33dd=await _0x3cbeb0['connect'](_0xa2df8);await this['_fetchMissingUsersForThreads'](_0xfb33dd);const _0x2d8e6a=new Set(Array['from'](_0x31f715['getCommentThreads']({'channelId':_0xd58324}),_0x4067d0=>_0x4067d0['id']));for(const _0x2b0bdd of _0xfb33dd)_0x2b0bdd['deletedAt']||_0x2d8e6a['delete'](_0x2b0bdd['commentThreadId']);for(const _0x251151 of _0x2d8e6a)_0x31f715['getCommentThread'](_0x251151)['remove']({'isFromAdapter':!0x0});for(const _0x2aeb58 of _0xfb33dd){let _0x164a4d=_0x31f715['getCommentThread'](_0x2aeb58['commentThreadId']);const {commentThreadId:_0x5740c0,context:_0x4e3ef4,attributes:_0x40cf29,resolvedBy:_0x1cb8f0,resolvedAt:_0x489ad7,unlinkedAt:_0x5db607,deletedAt:_0x1dbf5e}=_0x2aeb58;if(_0x1dbf5e)continue;_0x164a4d||(_0x164a4d=_0x31f715['addCommentThread']({'channelId':_0xd58324,'threadId':_0x5740c0,'context':_0x4e3ef4,'attributes':_0x40cf29||{},'resolvedBy':_0x1cb8f0,'resolvedAt':_0x489ad7,'unlinkedAt':_0x5db607,'isFromAdapter':!0x0}));const _0x21bf57=new Set(Array['from'](_0x164a4d['comments'],_0x6a92c9=>_0x6a92c9['id']));for(const _0x39958d of _0x2aeb58['comments'])_0x21bf57['delete'](_0x39958d['commentId']);for(const _0xf523e7 of _0x21bf57)_0x164a4d['getComment'](_0xf523e7)['remove']({'isFromAdapter':!0x0});for(const _0x3f5d75 of _0x2aeb58['comments']){const _0x46b91b=_0x164a4d['getComment'](_0x3f5d75['commentId']);_0x46b91b?_0x46b91b['content']!==_0x3f5d75['content']&&_0x46b91b['update']({'content':_0x3f5d75['content'],'isFromAdapter':!0x0}):_0x164a4d['addComment'](Object['assign'](st(_0x3f5d75),{'isFromAdapter':!0x0}));}}}['_getService'](_0x365e3e){if(!this['_services']['has'](_0x365e3e))throw new _0x3ddc56('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x365e3e});return this['_services']['get'](_0x365e3e);}async['_fetchMissingUsersForThreads'](_0x2cbddb){const _0x14bbc1=this['context']['plugins']['get'](_0x50fdcb),{connection:_0x2b5f5e}=this['context']['plugins']['get'](c),_0x2d95e9=new Set();for(const {resolvedBy:_0x2bc230,comments:_0x3a486a}of _0x2cbddb){_0x2bc230&&!_0x14bbc1['getUser'](_0x2bc230)&&_0x2d95e9['add'](_0x2bc230);for(const {userId:_0x47e22c}of _0x3a486a)_0x14bbc1['getUser'](_0x47e22c)||_0x2d95e9['add'](_0x47e22c);}if(0x0===_0x2d95e9['size'])return;const _0x3ae57a=await gt['getMany'](_0x2b5f5e,Array['from'](_0x2d95e9));for(const _0x590f9f of _0x3ae57a)_0x14bbc1['getUser'](_0x590f9f['id'])||_0x14bbc1['addUser'](_0x590f9f);}}async function ot(_0xdbc04c){if('404'!==_0xdbc04c['code'])throw _0xdbc04c;}function wt(_0x98edb3){if((_0x3d725c=_0x98edb3)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x3d725c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3d725c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x3d725c;throw _0x98edb3;}function st(_0x1eab5e){return{'threadId':_0x1eab5e['commentThreadId'],'commentId':_0x1eab5e['commentId'],'content':_0x1eab5e['content'],'createdAt':_0x1eab5e['createdAt'],'authorId':_0x1eab5e['userId'],'attributes':_0x1eab5e['attributes']||{}};}class f extends _0x12cabc{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x43f583){super(_0x43f583);const _0x31f057=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x31f057);}['init'](){const _0x4b327e=this['editor']['plugins']['get'](c),_0x13a170=this['editor']['plugins']['get']('TrackChangesEditing');return _0x13a170['adapter']={'getSuggestion':async _0x32f2c9=>{await this['_waitForServiceReady']();const _0x434623=await this['_trackChangesService']['get'](_0x32f2c9)['catch'](nt);return await this['_fetchMissingUsersForThreads']([_0x434623]),_0x434623;},'addSuggestion':async({id:_0xdbeb1f,type:_0x2b519e,data:_0xc6b56d,originalSuggestionId:_0x47eb46,attributes:_0x1bb528})=>{await this['_waitForServiceReady']();const _0x2d0f50={'id':_0xdbeb1f,'type':_0x2b519e,'data':_0xc6b56d,'originalSuggestionId':_0x47eb46,'attributes':_0x1bb528},_0x3754ac=await this['_trackChangesService']['add'](_0xdbeb1f,_0x2b519e,_0xc6b56d,_0x47eb46,_0x1bb528)['catch'](_0x1acc59=>{if(vt(_0x1acc59))return new Promise(_0x53e1c9=>{this['_bufferedRequests']['set'](_0xdbeb1f,{'resolve':_0x53e1c9,'suggestionData':_0x2d0f50});});throw _0x1acc59;});return this['_bufferedRequests']['delete'](_0xdbeb1f),_0x3754ac;},'updateSuggestion':async(_0x38f6e3,_0x4e6f9a)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4e6f9a['state'])return this['_trackChangesService']['update'](_0x38f6e3,_0x4e6f9a)['catch'](nt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x29f302,_0x2d03c0)=>{_0x13a170['hasSuggestion'](_0x2d03c0['id'])&&(_0x13a170['getSuggestion'](_0x2d03c0['id'])['attributes']=_0x2d03c0['attributes']);}),this['_trackChangesService']['connect'](_0x4b327e['connection'])['then'](_0x3693df=>(_0x4b327e['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x3693df)['then'](()=>{for(const _0x2cf77e of _0x3693df){_0x13a170['addSuggestionData'](_0x2cf77e)['_saved']=!0x0;}})));}async['reconnect'](){const _0x261998=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x4d1e0c}=this['editor']['plugins']['get'](c),_0x426949=await this['_trackChangesService']['connect'](_0x4d1e0c);await this['_fetchMissingUsersForThreads'](_0x426949);for(const {suggestionData:_0x25c2f3,resolve:_0x1903cd}of this['_bufferedRequests']['values']()){let _0x3d191b=_0x426949['find'](_0x4002b4=>_0x4002b4['id']===_0x25c2f3['id']);_0x3d191b||(_0x3d191b=await this['_trackChangesService']['add'](_0x25c2f3['id'],_0x25c2f3['type'],_0x25c2f3['data'],_0x25c2f3['originalSuggestionId'])),_0x1903cd(_0x3d191b);}for(const _0x388430 of _0x426949)_0x261998['hasSuggestion'](_0x388430['id'])||_0x261998['addSuggestionData'](_0x388430);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x5f1cee=>{this['listenTo'](this['_trackChangesService'],'connected',_0x573346=>{_0x573346['off'](),_0x5f1cee();});});}async['_fetchMissingUsersForThreads'](_0x54e1bb){const _0x4de367=this['editor']['plugins']['get'](_0x50fdcb),{connection:_0x5cce75}=this['editor']['plugins']['get'](c),_0x3f17d1=new Set();for(const {authorId:_0x2c07f3}of _0x54e1bb)_0x4de367['getUser'](_0x2c07f3)||_0x3f17d1['add'](_0x2c07f3);if(0x0===_0x3f17d1['size'])return;const _0x291a1f=await gt['getMany'](_0x5cce75,Array['from'](_0x3f17d1));for(const _0x540218 of _0x291a1f)_0x4de367['getUser'](_0x540218['id'])||_0x4de367['addUser'](_0x540218);}}function nt(_0x3767ff){if(vt(_0x3767ff))return new Promise(()=>{});throw _0x3767ff;}function vt(_0xa1a062){return _0xa1a062['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xa1a062['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x12cabc{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2e2bd3=this['editor']['plugins']['get'](c),_0x4debe8=this['editor']['plugins']['get']('CommentsEditing'),_0x17e7a8=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2e2bd3,'change:state',(_0x2e3e81,_0x251bac,_0x101a5a)=>{_0x4debe8['isThreadsLoadingPaused']='connected'!==_0x101a5a;});}),this['listenTo'](_0x2e2bd3,'change:state',(_0x3ce81f,_0x19b457,_0x1a2fbe)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x1a2fbe);}),_0x17e7a8['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x12cabc{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x12cabc{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>rt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x50fdcb];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xb54c3f){super(_0xb54c3f);const _0x540578=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x540578);}async['init'](){const _0x287532=this['editor']['plugins']['get'](l),_0x478d4d=_0x287532['serverHistory'],_0x1cccb0=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x478d4d,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x287532['sessionId']});const _0x3a9670=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x1bfeb0=await it['isBundleUploaded'](_0x1cccb0['connection'],_0x3a9670);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x207a44})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x207a44)),'updateRevisions':async _0x3349b9=>{await this['_waitForServiceReady']();const _0xb7cf65=this['_revisionTracker']['currentRevision'];if(_0x1bfeb0&&0x1===_0x3349b9['length']&&_0x3349b9[0x0]['id']===_0xb7cf65['id'])return _0x3349b9;for(const _0x1c32db of _0x3349b9)_0x1c32db['id']===_0xb7cf65['id']&&(_0x1c32db['isEmptyCurrent']=_0x1c32db['fromVersion']===_0x1c32db['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3349b9,this['_lastRequestId'])['then'](_0x5c4f50=>(this['_lastRequestId']=_0x5c4f50,_0x3349b9))['catch'](_0x10da0e=>{if(ct(_0x10da0e)||'400'===_0x10da0e['code']&&void 0x0!==_0x10da0e['data']['wrongRequestId']){for(const _0x1d5495 of _0x3349b9){!this['_revisionTracker']['repository']['getRevision'](_0x1d5495['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1d5495['id'],_0x1d5495,!0x1);}if(ct(_0x10da0e))throw _0x10da0e;return _0x3349b9;}throw _0x10da0e;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x38c900,{revisionsData:_0x135092,requestId:_0x2e86bc})=>{Math['max'](..._0x135092['map'](_0x21df5b=>_0x21df5b['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x135092,_0x2e86bc);}):this['_handleRevisionsUpdate'](_0x135092,_0x2e86bc);});const {revisions:_0xac93e4,requestId:_0x2a1a9e}=await this['_revisionHistoryService']['connect'](_0x1cccb0['connection']);_0x1cccb0['addToReconnectionStack'](this),this['_lastRequestId']=_0x2a1a9e,await this['_fetchMissingUsers'](_0xac93e4);for(const _0x53dfbd of _0xac93e4)this['_revisionTracker']['addRevisionData'](_0x53dfbd);this['listenTo'](_0x287532,'change:_isConnected',(_0x3c49eb,_0x23c540,_0x451555)=>{_0x451555&&(this['_oldOffset']=_0x287532['_offset'],_0x3c49eb['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x1cccb0,'state',_0x444d04=>_0x444d04===_0x1f4b62['CONNECTED']);}async['reconnect'](){const _0x515f0e=this['editor']['plugins']['get'](c),_0x5592f8=this['editor']['plugins']['get'](l),_0x5d7312=async()=>{const _0x5af11c=this['_revisionTracker']['currentRevision'],_0x2f0985=_0x5af11c['id'],_0x4f371c=_0x2f0985!==_0x5592f8['sessionId'];if(_0x4f371c){const _0x4d20c2=_0x5592f8['_offset']-this['_oldOffset'],_0x364e67=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x5af11c['toVersion']+_0x4d20c2!==_0x364e67){const _0x3e0951=_0x5af11c['fromVersion']+_0x4d20c2,_0x3a3303=this['editor']['plugins']['get'](_0x50fdcb),_0x3f28fc=this['_revisionTracker']['buildRevisionData']({'revision':_0x5af11c,'from':_0x3e0951,'to':_0x364e67});_0x3f28fc['id']=_0x5af11c['id'];const _0x326dc5=_0x3f28fc['authorsIds']['map'](_0x506d10=>_0x3a3303['getUser'](_0x506d10));_0x5af11c['_update']({..._0x3f28fc,'authors':_0x326dc5},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x5af11c['id'],_0x3f28fc,!0x0);}this['_revisionTracker']['_startingVersion']=_0x364e67,(_0x5af11c['toVersion']===_0x5af11c['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x2f0985)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x2f0985),this['_revisionTracker']['_createCurrentRevision'](_0x364e67));}const {revisions:_0x37457b,requestId:_0x399ca3}=await this['_revisionHistoryService']['reconnect'](_0x515f0e['connection'],this['_lastRequestId']);_0x4f371c&&_0x37457b['length']>0x0?_0x5592f8['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x37457b),this['_handleRevisionsUpdate'](_0x37457b,_0x399ca3),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5592f8['_isConnected']?_0x5d7312():new Promise((_0x21e202,_0x5ccae7)=>{_0x5592f8['once']('change:_isConnected',()=>{_0x5d7312()['then'](_0x21e202)['catch'](_0x5ccae7);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x3e8745=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x56b41b=>{_0x56b41b['off'](),_0x3e8745();});});}['_getLatestVersionFromServerOperations'](){const _0x41314a=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x418daa of _0x41314a)if('marker'!==_0x418daa['type']||_0x418daa['affectsData'])return _0x418daa['baseVersion']+0x1;}['_getLatestVersion'](){const _0x28e182=this['editor']['plugins']['get'](l);return new Promise(_0x24ce2b=>{_0x28e182['_isPendingUpdate']?_0x28e182['once']('change:_isPendingUpdate',()=>{_0x24ce2b(this['_getLatestVersionFromServerOperations']());}):_0x24ce2b(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x155188,_0x5cdf82){const _0x495d36=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5cdf82;for(const _0x1fb6a7 of _0x155188){const _0x25be47=_0x495d36['getRevision'](_0x1fb6a7['id']);if(_0x25be47){if((_0x1fb6a7['fromVersion']||_0x1fb6a7['toVersion'])&&(_0x1fb6a7['diffData']=null),_0x25be47===this['_revisionTracker']['currentRevision']){const _0x574f18=Math['max'](_0x25be47['toVersion'],_0x1fb6a7['toVersion']),_0xbe4282=Math['max'](_0x25be47['fromVersion'],_0x1fb6a7['fromVersion']);let _0x1afe65;_0x25be47['toVersion']===_0x1fb6a7['toVersion']&&_0x25be47['fromVersion']===_0x1fb6a7['fromVersion']?(_0x1afe65=!0x0,this['_preventResendingRevisionData'](_0x1fb6a7)):_0x1fb6a7['toVersion']===_0x574f18&&_0x1fb6a7['fromVersion']===_0xbe4282?_0x1afe65=!0x1:(_0x25be47['toVersion']===_0x574f18&&_0x25be47['fromVersion']===_0xbe4282||this['_fixRevision']({'revision':_0x25be47,'from':_0xbe4282,'to':_0x574f18}),_0x1afe65=!0x0),_0x1afe65&&(delete _0x1fb6a7['fromVersion'],delete _0x1fb6a7['toVersion'],delete _0x1fb6a7['diffData'],delete _0x1fb6a7['createdAt'],delete _0x1fb6a7['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1fb6a7),this['_preventResendingRevisionData'](_0x1fb6a7);}else this['_revisionTracker']['addRevisionData'](_0x1fb6a7);}const _0x21c416=_0x495d36['getRevisions']();_0x21c416['reverse']();for(let _0x51883b=0x0;_0x51883b<_0x21c416['length']-0x1;_0x51883b++){const _0x46dc39=_0x21c416[_0x51883b],_0x5f22bc=_0x21c416[_0x51883b+0x1];if(_0x46dc39['fromVersion']<_0x5f22bc['toVersion']){const _0x4c5dde=_0x5f22bc['toVersion'],_0x3dc173=Math['max'](_0x4c5dde,_0x46dc39['toVersion']);this['_fixRevision']({'revision':_0x46dc39,'from':_0x4c5dde,'to':_0x3dc173});}}}['_fixRevision']({revision:_0x40da1c,from:_0x4abbbe,to:_0x2c4817}={}){const _0x5390bf=this['editor']['plugins']['get'](_0x50fdcb),_0x4d2c4c=this['_revisionTracker']['buildRevisionData']({'revision':_0x40da1c,'from':_0x4abbbe,'to':_0x2c4817});_0x4d2c4c['authors']=_0x4d2c4c['authorsIds']['map'](_0x165df9=>_0x5390bf['getUser'](_0x165df9)),_0x40da1c['_update'](_0x4d2c4c);}['_preventResendingRevisionData'](_0x35c385){const _0x32f9e4={};_0x32f9e4['id']=_0x35c385['id'];for(const _0x4c71c3 of Object['keys'](_0x35c385))'id'!==_0x4c71c3&&(_0x32f9e4[_0x4c71c3]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x32f9e4['id'],_0x32f9e4,!0x0);}async['_fetchMissingUsers'](_0x480cbc){const _0x28c9f9=this['editor']['plugins']['get'](_0x50fdcb),{connection:_0x47892d}=this['editor']['plugins']['get'](c),_0x597be4=new Set();for(const _0x507ac5 of _0x480cbc){for(const _0x44e6ba of _0x507ac5['authorsIds'])_0x5312c5(_0x44e6ba);_0x507ac5['creatorId']&&_0x5312c5(_0x507ac5['creatorId']);}if(0x0===_0x597be4['size'])return;const _0x29e347=await gt['getMany'](_0x47892d,Array['from'](_0x597be4));for(const _0x41b4b4 of _0x29e347)_0x28c9f9['getUser'](_0x41b4b4['id'])||_0x28c9f9['addUser'](_0x41b4b4);function _0x5312c5(_0x4b8b45){_0x28c9f9['getUser'](_0x4b8b45)||_0x597be4['add'](_0x4b8b45);}}}function ct(_0x3c2180){return _0x3c2180['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x3c2180['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3c2180['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x12cabc{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x58240d{['_collapseAt'];constructor(_0x544c6c,_0x1449c1=0x6){super(_0x544c6c);const _0x8f09b6=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1449c1,this['bind']('isHidden')['to'](this,'usersCount',_0x5a9a57=>_0x5a9a57<_0x1449c1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x8f09b6['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':_0x8f09b6['to']('usersCount',_0x433cd9=>'+'+(_0x433cd9-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x58240d{['items'];['keystrokes'];constructor(_0x5e04a8){super(_0x5e04a8);const _0xebec5=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x4733e4(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0xebec5['if']('hasPopup'),'aria-expanded':_0xebec5['to']('isExpanded',_0x473e2d=>this['hasPopup']&&String(_0x473e2d)),'aria-label':_0xebec5['to']('hasPopup',_0x1c0800=>M(_0x5e04a8,_0x1c0800?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0xebec5['to']('hasPopup',_0x1f95bf=>!!_0x1f95bf&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0xebec5['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0xebec5['to'](_0x1e21e7=>{const _0x40e074=_0x1e21e7,_0x336f31=document['querySelector']('.ck-presence-list__dropdown-list'),_0x329994=document['querySelector']('.ck-balloon-panel_with-arrow');_0x336f31?.['contains'](_0x40e074['relatedTarget'])||_0x329994?.['contains'](_0x40e074['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x204323,_0x4dfdac,_0x970297)=>{this['element']&&(_0x970297?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x58240d{['counterView'];['inlineListView'];constructor(_0x3a7a00,_0x1b7ae1=0x6){super(_0x3a7a00);const _0x241f54=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x1b7ae1),this['inlineListView']=new ts(_0x3a7a00),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4a7202 of this['inlineListView']['items'])_0x4a7202['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',_0x241f54['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x58240d{['listWrapperView'];constructor(_0x507e32,_0x367735){super(_0x507e32);const _0x3d54c1=this['bindTemplate'];this['listWrapperView']=new _t(_0x507e32,_0x367735),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':M(_0x507e32,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x3d54c1['to'](_0x2ecbcf=>{const _0x284f6c=_0x2ecbcf,_0x3136bb=document['querySelector']('.ck-presence-list__list'),_0x484162=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3136bb?.['contains'](_0x284f6c['relatedTarget'])||_0x484162?.['contains'](_0x284f6c['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class _t extends _0x5f11c8{constructor(_0x59b12f,_0x15ca8d){super(_0x59b12f);const _0x16859a=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x15ca8d?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x16859a['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x16859a['to']('role'),'aria-label':_0x16859a['to']('ariaLabel'),'aria-labelledby':_0x16859a['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1686f2['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x30d908=this['element'];_0x30d908&&(this['_isScrollable']=Math['max'](_0x30d908['scrollHeight'],_0x30d908['clientHeight'])>0.8*window['innerHeight']);}}class k extends lt{['userView'];constructor(_0x30710b,_0x32f64e,_0x95afe6){super(_0x30710b);const _0x5210ac=this['bindTemplate'];this['userView']=new ut(_0x30710b,_0x32f64e);const _0x4953d9={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x32f64e['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x32f64e['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x32f64e['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x95afe6&&(_0x4953d9['tag']='button',_0x4953d9['on']={'click':_0x5210ac['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4953d9);}['focus'](){this['element']['focus']();}}class y extends _0x58240d{['userView'];['markerView'];constructor(_0x3a3989,_0x3d1633,_0x3af8eb){super(_0x3a3989);const _0x1f09ac=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ut(_0x3a3989,_0x3d1633),this['markerView']=new dt(_0x3a3989,_0x3d1633);const _0x1d8848=new pt(_0x3a3989);_0x1d8848['template']['tag']='span',_0x1d8848['text']=_0x3d1633['name'];const _0x336676={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1f09ac['to']('isFocusable',_0x42cbd5=>!!_0x42cbd5&&0x0),'aria-labelledby':_0x1d8848['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1f09ac['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1f09ac['to']('hasTooltip',_0x597900=>!_0x597900),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1d8848]};_0x3af8eb&&(_0x336676['tag']='button',_0x336676['on']={'click':_0x1f09ac['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x336676);}}class dt extends _0x58240d{constructor(_0x59dafc,_0xb3c143){super(_0x59dafc),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xb3c143['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x191ba5{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x12ee77){super(_0x12ee77),this['context']['config']['define']('presenceList',C);const _0x1739a8=_0x12ee77['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1739a8)throw new _0x3ddc56('presencelist-collapseat-invalid-format',this);if(_0x1739a8<0x1)throw new _0x3ddc56('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x4b426b(),this['balloonPanelView']=new _0x5d639d(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x341c5f of this['_allConnectedUsers'])this['_handleUserAdd'](_0x341c5f);this['listenTo'](this['_allConnectedUsers'],'add',(_0x46afa1,_0x47d2b6)=>{this['_handleUserAdd'](_0x47d2b6);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x48e0da,_0x26fc9e)=>{this['_handleUserRemove'](_0x26fc9e);});}['_createView'](){const _0x171367=this['context'],_0xd40fe5=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3fb582=this['balloonPanelView'];if(!_0x3744a5(_0x171367['config']['get']('presenceList.container')))throw new _0x3ddc56('presencelist-missing-container',this);return _0xd40fe5['counterView']['bind']('usersCount')['to'](this),_0xd40fe5['bind']('isCollapsed')['to'](this,'usersCount',_0x4702fa=>{const {collapseAt:_0x5532a3}=_0x171367['config']['get']('presenceList'),_0x3d0d32=_0x4702fa>=_0x5532a3;if(_0x3d0d32&&!_0xd40fe5['inlineListView']['items']['find'](_0x2dd9b3=>_0x2dd9b3 instanceof A)){const _0x46eb74=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x46eb74&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0xd40fe5['inlineListView']['items']['add'](_0xd40fe5['counterView']);}return _0x3d0d32||this['hideDropdown'](),_0x3d0d32;}),_0xd40fe5['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xbef49b=>{const _0x2ccaa8=_0x171367['config']['get']('presenceList'),_0x476433=new y(_0x171367['locale'],_0xbef49b,!!_0x2ccaa8['onClick']);return _0x476433['bind']('hasTooltip')['to'](_0xd40fe5,'isCollapsed',_0x4c9e05=>!_0x4c9e05),_0x476433['bind']('isFocusable')['to'](_0xd40fe5,'isCollapsed',_0x228914=>!_0x228914),_0x2ccaa8['onClick']&&this['listenTo'](_0x476433,'execute',()=>{this['view']['isCollapsed']||_0x2ccaa8['onClick'](_0xbef49b,_0x476433['element']);}),_0x476433;}),this['listenTo'](_0xd40fe5['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0xd40fe5['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0xd40fe5['inlineListView']['keystrokes']['set']('Enter',(_0xda4ea4,_0x1de983)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x1de983());}),_0xd40fe5['render'](),_0x3fb582['render'](),_0x1b51db({'emitter':_0xd40fe5,'activator':()=>_0x3fb582['isVisible'],'contextElements':[_0x3fb582['element'],_0xd40fe5['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x171367['config']['get']('presenceList.container')['appendChild'](_0xd40fe5['element']),this['_bodyCollection']=new _0x1d3b66(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0xd40fe5;}['_handleUserAdd'](_0x3156f5){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3156f5['isMe'])return;const _0x49e39d=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x49e39d-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x432382=_0x3156f5['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3156f5,_0x432382);}['_handleUserRemove'](_0x3ac85d){this['usersCount']--;const {collapseAt:_0x15fce2}=this['context']['config']['get']('presenceList'),_0x2e49d3=this['usersCount']>=_0x15fce2;if(this['currentDisplayedUsers']['get'](_0x3ac85d['id']))this['currentDisplayedUsers']['remove'](_0x3ac85d['id']);else{if(_0x2e49d3&&this['currentDisplayedUsers']['length']+0x1===_0x15fce2-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x2e49d3?0x1:0x0)<this['usersCount']){for(const _0x24ba97 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x24ba97['id'])&&(this['currentDisplayedUsers']['add'](_0x24ba97,Math['min'](this['currentDisplayedUsers']['length']-(_0x2e49d3?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x2e49d3?0x1:0x0)===_0x15fce2-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x551f5b=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x551f5b['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x32f8a8}=this['presenceDropdownView'];_0x32f8a8['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x2b91ab=>{if(!_0x551f5b['displayMe']&&_0x2b91ab['isMe'])return null;const _0x5f0177=new k(this['context']['locale'],_0x2b91ab,!!_0x551f5b['onClick']);return _0x551f5b['onClick']&&this['listenTo'](_0x5f0177,'execute',()=>{_0x551f5b['onClick'](_0x2b91ab,_0x5f0177['element']);}),_0x5f0177;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x32f8a8['focus'](),_0x32f8a8['checkIfScrollable']();const _0x2569e6=(_0xc980dc,_0x267d5c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x267d5c();};_0x32f8a8['keystrokes']['set']('Esc',_0x2569e6),_0x32f8a8['keystrokes']['set']('Shift+Tab',_0x2569e6),_0x32f8a8['keystrokes']['set']('Tab',(_0x2ef6bc,_0x754437)=>{!function(_0x32dbc4){const _0x6f3cf2=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xca6efa=>_0xca6efa+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x20d2da=[...document['body']['querySelectorAll'](_0x6f3cf2)]['filter'](_0x2e32be=>_0x2e32be===document['activeElement']||_0x2e32be['offsetWidth']+_0x2e32be['offsetHeight']>0x0)['sort']((_0xe4272f,_0x5131c1)=>(_0xe4272f['tabIndex']||0x0)-(_0x5131c1['tabIndex']||0x0)),_0x5e3e29=_0x20d2da['indexOf'](_0x32dbc4),_0x2072b8=_0x20d2da[(_0x5e3e29+0x1)%_0x20d2da['length']];_0x2072b8&&_0x2072b8['focus']();}(this['view']['element']),this['hideDropdown'](),_0x754437();}),_0x32f8a8['focusTracker']['add'](this['view']['element']),_0x32f8a8['focusTracker']['on']('change:isFocused',(_0x194f37,_0x3f46b1,_0x29dcd3)=>{_0x29dcd3||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x191ba5{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
23
+ import{ContextPlugin as _0x39c302,Plugin as _0x36ec84,PendingActions as _0x2c0263,Context as _0xe4df37}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x814dac,CKEditorError as _0x450af5,Collection as _0x2886d5,global as _0x40b117,version as nt,uid as _0x1d673a,KeystrokeHandler as _0x223d85}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x385a83,View as _0x2331df,ListView as _0x1df070,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x19634d,clickOutsideHandler as _0x1b96bb,BodyCollection as _0x24c7b0}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x1c34fa,NoOperation as _0x8511da,InsertOperation as _0x19f267,MarkerOperation as _0x37404d,RootAttributeOperation as _0x6cd20a,transformSets as _0x43930a,OperationFactory as _0x25d184}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x307b4a,CollaborativeEditingService as _0x1b6b62,User as dt,CommentsService as _0x30f710,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1b46b3,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x40c424}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x4e63ad}from'es-toolkit/compat';class c extends _0x39c302{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x385a83];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x219370){super(_0x219370),this['set']('state',_0x307b4a['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x814dac);}['init'](){const _0x104841=this['context'],_0x5c467a=_0x104841['plugins']['get']('CloudServices'),_0x26d487=_0x104841['plugins']['get'](_0x385a83);if(!_0x5c467a['token'])throw new _0x450af5('websocketgateway-missing-token',this);if(!_0x5c467a['webSocketUrl'])throw new _0x450af5('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x5c467a['token'],_0x5c467a['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0xc95460=>{if(this['connection']=_0xc95460,this['bind']('state')['to'](_0xc95460,'state',this,'_isBrowserOffline',(_0x515a55,_0x574260)=>('connected'!==_0x515a55&&(this['_shouldPluginsReconnect']=!0x0),_0x574260||_0x515a55!==_0x307b4a['CONNECTED']?_0x307b4a['DISCONNECTED']:this['state']==_0x307b4a['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x307b4a['CONNECTING']):_0x307b4a['CONNECTED'])),this['connection']['on']('error',(_0x4902cf,_0x22f014)=>{if('limitExceeded'!==_0x22f014['code'])throw console['error'](_0x22f014),new _0x450af5('cloudservices-init',null,{'originalError':_0x22f014});_0x26d487['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'});}),!_0xc95460['me'])return new Promise(_0x41a352=>_0xc95460['on']('change:me',_0x41a352));})['catch'](_0x406255=>{throw console['error'](_0x406255),new _0x450af5('cloudservices-init',null,{'originalError':_0x406255});});}['addToReconnectionStack'](_0x45cb76){if('function'!=typeof _0x45cb76['reconnect'])throw new _0x450af5('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x45cb76))throw new _0x450af5('websocketgateway-plugin-already-registered',this,{'name':_0x45cb76['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x45cb76);}['removeFromReconnectionStack'](_0x2c040c){this['_reconnectionStack']['delete'](_0x2c040c);}['isInReconnectionStack'](_0x3feb6d){return this['_reconnectionStack']['has'](_0x3feb6d);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x4639bb=>_0x4639bb['reconnect']())))['then'](()=>this['state']=_0x307b4a['CONNECTED'])['catch'](_0xef381f=>{throw console['error'](_0xef381f),new _0x450af5('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x307b4a['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x39c302{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x1b46b3];}constructor(_0x204e00){super(_0x204e00),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2886d5(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1b46b3);}['init'](){const _0x3d5bca=this['context']['plugins']['get'](c);this['listenTo'](_0x3d5bca,'change:state',(_0x5a560b,_0x4c627c,_0x5bf5c5)=>{if('connected'!==_0x5bf5c5)this['channelSessions']['forEach'](_0x50212b=>_0x50212b['clear']()),this['channelConnectedUsers']['forEach'](_0x1a367f=>_0x1a367f['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5d3f7d,_0x9c1eaf]of this['_registeredSessions'])for(const _0x3d8d3b of _0x9c1eaf)this['_handleSessionAdd'](_0x5d3f7d,_0x3d8d3b);}}),this['_createUser'](_0x3d5bca['connection']['me'],!0x0);}['register'](_0x43b19a,_0x3d969d){if(this['_registeredSessions']['has'](_0x43b19a))throw new _0x450af5('sessions-register-already-registered',null,{'channelId':_0x43b19a});this['_registeredSessions']['set'](_0x43b19a,_0x3d969d),this['channelSessions']['set'](_0x43b19a,new _0x2886d5()),this['channelConnectedUsers']['set'](_0x43b19a,new _0x2886d5()),this['listenTo'](_0x3d969d,'add',(_0x4e536e,_0x1a5612)=>this['_handleSessionAdd'](_0x43b19a,_0x1a5612)),this['listenTo'](_0x3d969d,'remove',(_0x1e2461,_0x10531d)=>this['_handleSessionRemove'](_0x43b19a,_0x10531d));for(const _0x42b68e of _0x3d969d)this['_handleSessionAdd'](_0x43b19a,_0x42b68e);}['unregister'](_0x2d1ba2){if(!this['_registeredSessions']['has'](_0x2d1ba2))throw new _0x450af5('sessions-unregister-not-exist',null,{'channelId':_0x2d1ba2});const _0x20ae80=this['_registeredSessions']['get'](_0x2d1ba2);this['stopListening'](_0x20ae80);for(const _0x3c43d6 of _0x20ae80)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x2d1ba2,_0x3c43d6);this['_registeredSessions']['delete'](_0x2d1ba2),this['channelSessions']['delete'](_0x2d1ba2),this['channelConnectedUsers']['delete'](_0x2d1ba2);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x2680e2){for(const _0x1ba36d of this['channelSessions']['values']())for(const _0x26a919 of _0x1ba36d)if(_0x26a919['id']===_0x2680e2)return _0x26a919['user'];}['getUserSessions'](_0x44cda6,_0x3e262f){const _0x4b7c5c=_0x3e262f?[this['channelSessions']['get'](_0x3e262f)]:this['channelSessions']['values'](),_0x305917=new Set();for(const _0x15113a of _0x4b7c5c)for(const _0x5684ca of _0x15113a)_0x5684ca['user']['id']===_0x44cda6['id']&&_0x305917['add'](_0x5684ca['id']);return _0x305917;}['getUserRole'](_0x26d9ca){for(const _0x3c3185 of this['channelSessions']['values']())for(const _0x17891b of _0x3c3185)if(_0x17891b['user']===_0x26d9ca)return _0x17891b['role'];}['_handleSessionAdd'](_0x4c08dd,_0x2b28f5){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x200be0=_0x2b28f5['user'],_0x469ea8=this['_users']['getUser'](_0x200be0['id'])||this['_createUser'](_0x200be0),_0x1e0e4d=Object['assign']({},_0x2b28f5,{'user':_0x469ea8});this['channelSessions']['get'](_0x4c08dd)['add'](_0x1e0e4d);const _0x3b8751=this['channelConnectedUsers']['get'](_0x4c08dd);_0x3b8751['has'](_0x469ea8['id'])||_0x3b8751['add'](_0x469ea8),this['allConnectedUsers']['has'](_0x469ea8['id'])||this['allConnectedUsers']['add'](_0x469ea8,_0x469ea8['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x4c08dd,{'channelId':_0x4c08dd,'session':_0x1e0e4d});}['_handleSessionRemove'](_0x359827,_0x519f5a){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x49f6d0=this['channelConnectedUsers']['get'](_0x359827),_0x482e2c=_0x519f5a['user'];_0x482e2c['id']&&(this['channelSessions']['get'](_0x359827)['remove'](_0x519f5a['id']),_0x49f6d0['has'](_0x482e2c['id'])&&!this['getUserSessions'](_0x482e2c,_0x359827)['size']&&_0x49f6d0['remove'](_0x482e2c['id']),this['allConnectedUsers']['get'](_0x482e2c['id'])&&!this['getUserSessions'](_0x482e2c)['size']&&this['allConnectedUsers']['remove'](_0x482e2c['id']));}['_createUser'](_0x7165c7,_0x56c57f){const _0x31dc5a=this['_users']['addUser'](_0x7165c7);return _0x56c57f&&this['_users']['defineMe'](_0x7165c7['id']),_0x31dc5a['orderNumber']=this['_uniqueUsersCount']++,_0x31dc5a;}}class q extends _0x36ec84{['_domEmitter']=new(_0x814dac())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x11e557=this['editor'],_0x81b8fa=_0x11e557['plugins']['get'](i);_0x11e557['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x4c4f,{writer:_0x1b07f7})=>function(_0x50a94e,_0x24069c,_0xfd8827,_0x13dccf){const _0x41b463=_0x50a94e['markerName']['split'](':')[0x2],_0x31c0fa=_0xfd8827['getUserBySessionId'](_0x41b463);if(!_0x31c0fa||_0x41b463===_0xfd8827['mySessionId'])return;if(!_0x13dccf['model']['schema']['checkChild'](_0x50a94e['markerRange']['start'],'$text'))return;const _0x3ece49={'class':'ck-user__marker\x20'+_0x31c0fa['color']['getMarkerClass'](),'data-name':_0x31c0fa['name'],'data-session-id':_0x41b463},_0x3596f3=_0x13dccf['model']['markers']['get'](_0x50a94e['markerName']),_0x32bd1d=_0x3596f3['getStart'](),_0x17b45a=_0x32bd1d['nodeAfter'],_0x307174=_0x13dccf['model']['schema'];if(_0x17b45a&&_0x307174['isObject'](_0x17b45a)&&_0x307174['isInline'](_0x17b45a)&&!_0x13dccf['model']['markers']['get']('user:range:'+_0x41b463)['getRange']()['isCollapsed'])return;const _0x44acb4=_0x32bd1d['parent'];return _0x13dccf['model']['schema']['isLimit'](_0x44acb4)&&!_0x13dccf['model']['hasContent'](_0x44acb4)&&(_0x3ece49['contenteditable']=!0x1),function(_0x2c7385,_0x485876,_0x6a74a6){const _0x537de1=_0x2c7385['createUIElement']('span',_0x485876);return _0x2c7385['setCustomProperty']('userPositionMarker',!0x0,_0x537de1),_0x537de1['render']=function(_0x487e25){const _0x4fc9d4=this['toDomElement'](_0x487e25),_0x4c31c0=document['createElement']('span');return _0x4c31c0['classList']['add']('ck-user__marker-tooltip'),_0x4c31c0['setAttribute']('contenteditable','false'),_0x4c31c0['setAttribute']('spellcheck','false'),_0x4c31c0['textContent']=_0x6a74a6['name'],_0x4fc9d4['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x4c31c0['outerHTML']+'⁠',_0x4fc9d4['addEventListener']('mouseenter',()=>{_0x4fc9d4['classList']['add']('ck-user__marker_hovered');}),_0x4fc9d4['addEventListener']('mouseleave',()=>{_0x4fc9d4['classList']['remove']('ck-user__marker_hovered');}),_0x4fc9d4;},_0x537de1['isSimilar']=function(_0x4f8123){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4f8123['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4f8123['getAttribute']('data-session-id'));},_0x537de1;}(_0x24069c,_0x3ece49,_0x31c0fa);}(_0x4c4f,_0x1b07f7,_0x81b8fa,_0x11e557)}),_0x11e557['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x598127=>function(_0x35a82f,_0x4b8f79){const _0x5186ab=_0x35a82f['markerName']['split'](':')[0x2];if(_0x5186ab===_0x4b8f79['mySessionId'])return null;const _0x282535=_0x4b8f79['getUserBySessionId'](_0x5186ab);if(!_0x282535)return{'id':_0x5186ab,'classes':[]};return{'id':_0x5186ab,'classes':['ck-user__selection',_0x282535['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x5186ab},'priority':0x7d0+_0x282535['orderNumber']};}(_0x598127,_0x81b8fa)}),function(_0x3519fb){const _0x49d8ba=_0x3519fb['model'],_0x2ad37d=new Map(),_0xed2b05=_0x3519fb['plugins']['get'](i);_0x49d8ba['markers']['on']('update:user:range',(_0x59b12f,_0x143f45,_0x17410b,_0x1acae0)=>{if(!_0x1acae0&&_0x2ad37d['get'](_0x143f45['name']))return _0x2ad37d['get'](_0x143f45['name'])['detach'](),void _0x2ad37d['delete'](_0x143f45['name']);const _0x45940f=_0x143f45['name']['split'](':')[0x2];if(_0x45940f===_0xed2b05['mySessionId'])return;const _0x14fc81='user:position:'+_0x45940f;_0x49d8ba['markers']['has'](_0x14fc81)&&_0x3519fb['editing']['reconvertMarker'](_0x14fc81),_0x143f45['on']('change:range',(_0x38c926,_0x16f59b,_0x3ee6ba)=>{if('$graveyard'!=_0x16f59b['root']['rootName']&&'$graveyard'==_0x143f45['getRange']()['root']['rootName']&&!_0x2ad37d['has'](_0x143f45['name'])){const _0x1b0993=_0x49d8ba['schema']['getNearestSelectionRange'](_0x3ee6ba['deletionPosition']);if(_0x1b0993){const _0x194aca=ht['fromRange'](_0x1b0993);_0x2ad37d['set'](_0x143f45['name'],_0x194aca),_0x194aca['on']('change:range',(_0x5e9e17,_0x58b5da,_0x5c28c3)=>{if('$graveyard'==_0x194aca['root']['rootName']){const _0x571ebd=_0x49d8ba['schema']['getNearestSelectionRange'](_0x5c28c3['deletionPosition']);_0x571ebd?(_0x194aca['start']=_0x571ebd['start'],_0x194aca['end']=_0x571ebd['end']):(_0x2ad37d['delete'](_0x143f45['name']),_0x194aca['detach']());}});}}});}),_0x49d8ba['document']['on']('change',()=>{_0x2ad37d['size']>0x0&&_0x49d8ba['enqueueChange']({'isUndoable':!0x1},_0x3f4f2d=>{for(const [_0x31b3fb,_0x3cdc4e]of _0x2ad37d)'$graveyard'==_0x49d8ba['markers']['get'](_0x31b3fb)['getRange']()['root']['rootName']&&(te(_0x31b3fb['split'](':')[0x2],_0x3cdc4e['toRange'](),_0x49d8ba,_0x3f4f2d),_0x3cdc4e['detach']());_0x2ad37d['clear']();});});}(_0x11e557),this['_domEmitter']['listenTo'](_0x40b117['document'],'keydown',(_0x367c96,{key:_0x54ff73})=>{'Escape'===_0x54ff73&&function(_0x635f7b){_0x635f7b['editing']['view']['change'](_0x430e6a=>{for(const _0x39a308 of _0x635f7b['model']['markers']){if(!_0x39a308['name']['startsWith']('user:position'))continue;const _0x3bd43f=_0x635f7b['editing']['mapper']['markerNameToElements'](_0x39a308['name']);if(_0x3bd43f){for(const _0x30be3f of _0x3bd43f)_0x430e6a['removeClass']('ck-user__marker_hovered',_0x30be3f);}}});}(_0x11e557);},{'useCapture':!0x0});}['afterInit'](){const _0x591c7b=this['editor'],_0x215e02=_0x591c7b['commands']['get']('undo');_0x215e02&&_0x591c7b['model']['on']('applyOperation',(_0x52a7aa,_0xaea3fd)=>{const _0x3ba0cf=_0xaea3fd[0x0];if(!_0x3ba0cf['isDocumentOperation'])return;if('marker'!=_0x3ba0cf['type']||!_0x3ba0cf['name']['startsWith']('user:'))return;const _0x2b1568=_0x3ba0cf['batch'];_0x215e02['_createdBatches']['has'](_0x2b1568)&&(_0x3ba0cf['newRange']=_0x3ba0cf['oldRange']?_0x591c7b['model']['createRange'](_0x3ba0cf['oldRange']['start'],_0x3ba0cf['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x226f83=this['editor'],_0x4f9116=_0x226f83['model']['document'],_0x2a1359=_0x226f83['plugins']['get'](i);_0x226f83['model']['enqueueChange']({'isUndoable':!0x1},_0x238fbc=>{const _0x3e43af='user:range:'+_0x2a1359['mySessionId'],_0x4ac38c='user:position:'+_0x2a1359['mySessionId'],_0x2a1d2b=_0x226f83['model']['markers']['has'](_0x3e43af);_0x226f83['editing']['view']['hasDomSelection']?te(_0x2a1359['mySessionId'],_0x4f9116['selection']['getFirstRange'](),_0x226f83['model'],_0x238fbc):_0x2a1d2b&&(_0x238fbc['removeMarker'](_0x3e43af),_0x238fbc['removeMarker'](_0x4ac38c));});}}function te(_0x153e11,_0x3aebea,_0xf2a1a4,_0xbe13ed){const _0x2a2e25='user:range:'+_0x153e11,_0x4628e9='user:position:'+_0x153e11,_0xfb6e51=_0x3aebea['getContainedElement']();let _0x1f559d=_0x3aebea['start'];_0xfb6e51&&_0xfb6e51['is']('element','tableCell')&&(_0x1f559d=function(_0x20c614,_0xd8f075){for(const _0x1f5f34 of _0x20c614['getPositions']())if(_0xd8f075['schema']['checkChild'](_0x1f5f34,'$text'))return _0x1f5f34;}(_0x3aebea,_0xf2a1a4),_0x3aebea=_0xbe13ed['createRange'](_0x1f559d));const _0x5692d3=_0xbe13ed['createRange'](_0x1f559d);_0xf2a1a4['markers']['has'](_0x2a2e25)?(_0xbe13ed['updateMarker'](_0x2a2e25,{'range':_0x3aebea}),_0xbe13ed['updateMarker'](_0x4628e9,{'range':_0x5692d3})):(_0xbe13ed['addMarker'](_0x2a2e25,{'range':_0x3aebea,'usingOperation':!0x0}),_0xbe13ed['addMarker'](_0x4628e9,{'range':_0x5692d3,'usingOperation':!0x0}));}function G(_0xc0953d,_0x4310ef,_0x127ee5){const _0x4a15f1=_0xc0953d['t'],t=_0xc0953d['t'];switch(_0x4310ef){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 _0x4a15f1({'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'},_0x127ee5);default:return'';}}let J=0x1;class l extends _0x36ec84{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x1b6b62)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,q,_0x2c0263,_0x1b46b3,_0x385a83];}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 _0x4664aa=this['serverHistory']['getOperations']();for(let _0x2b2eb4=_0x4664aa['length']-0x1;_0x2b2eb4>=0x0;_0x2b2eb4--){const _0x32cbec=_0x4664aa[_0x2b2eb4];if(!this['_disconnectionOperations']['has'](_0x32cbec))return _0x32cbec['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2d38c0){if(super(_0x2d38c0),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x1c34fa(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x450af5('collaboration-missing-channelid',this);const _0x493acf=_0x2d38c0['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x493acf,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x40c424(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new Y(this['_disconnectionOperations']);}['init'](){const _0x422deb=this['editor'],_0x3047bd=_0x422deb['plugins']['get'](_0x1b46b3),_0x49fd67=_0x422deb['plugins']['get'](c);this['listenTo'](_0x3047bd,'getOperationAuthor',(_0x5e9761,_0x1b2fc1)=>{const _0x2ea2b5=_0x1b2fc1[0x0];_0x2ea2b5['_authorId']&&(_0x5e9761['return']=_0x3047bd['getUser'](_0x2ea2b5['_authorId']),_0x5e9761['stop']()),null===_0x2ea2b5['_authorId']&&(_0x5e9761['return']=null,_0x5e9761['stop']());},{'priority':'high'}),this['listenTo'](_0x422deb['model']['document']['selection'],'change:range',(_0x385973,_0x1e2477)=>{_0x1e2477['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x422deb['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x422deb['model']['on']('applyOperation',(_0x5440fd,_0x2b4490)=>{const _0x59d251=_0x2b4490[0x0];_0x59d251['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x59d251),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x49fd67,'state',this,'_hasSynchronizationProblem',(_0x26ad84,_0x20b2a4)=>'connected'===_0x26ad84&&!_0x20b2a4),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x422deb['disableReadOnlyMode']('rtc-offline'):_0x422deb['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x422deb['disableReadOnlyMode']('rtc-offline'):_0x422deb['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5db7f7=this['editor']['plugins']['get'](i),_0x4a2f9e=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x5db7f7['unregister'](this['_channelId']);const _0x5eeeca=await this['_service']['reconnect'](_0x4a2f9e['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5eeeca)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2e8823=await this['_service']['getConnectedSessions']();_0x5db7f7['register'](this['_channelId'],_0x2e8823),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x395155){if(function(_0x2ffa2f){return'404'===_0x2ffa2f['code'];}(_0x395155)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x36bca7){return'409'===_0x36bca7['code'];}(_0x395155)){const _0x2af268=G(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x2af268);}else{if(!(_0x395155 instanceof Q))throw _0x395155;this['_handleReconnectionError']();}}}}['destroy'](){const _0x4fdf21=this['editor']['plugins']['get'](c),_0x1d1e75=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x1d1e75['channelSessions']['has'](this['_channelId'])&&_0x1d1e75['unregister'](this['_channelId']),_0x4fdf21['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x330894){if(this['sessionId']!==_0x330894['sessionId']&&this['_lastSyncedOperationId']!==_0x330894['lastOperationId'])throw new Q();return this['sessionId']=_0x330894['sessionId'],this['_handleServerResponse']([],{..._0x330894,'wereChangesApplied':!0x1,'data':_0x330894['data']},'reconnect');}async['_connectService'](_0x28bf6d,_0x3a594d=!0x1){const {connection:_0x34092f}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x34092f,this['_channelId'])['then'](_0x4587e5=>this['_initSessionsHandling'](_0x4587e5))['catch'](_0x2324fb=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x2324fb);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xd07038,_0x2a1128)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x2a1128);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x13718b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x28bf6d);this['_isPendingUpdate']=!0x0;const _0x4d4efd=await this['_service']['connect'](_0x34092f,this['_compressOperations'](_0x28bf6d),_0x13718b);if(this['sessionId']=_0x4d4efd['sessionId'],_0x3a594d){if(!_0x4d4efd['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x4d4efd['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x28bf6d,_0x4d4efd,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x4d4efd,_0x28bf6d);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x122361=this['editor']['plugins']['get'](i),_0x1946c4=this['editor']['plugins']['get'](q),_0x1de934=_0x122361['channelSessions']['get'](this['_channelId']);_0x1de934&&_0x1de934['length']>0x1?_0x1946c4['createUserMarkerOperations']():this['listenTo'](_0x122361,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x122361['channelSessions']['get'](this['_channelId'])['length']&&_0x1946c4['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x488c0d,_0x8b3f9b,_0x4ccbff,_0x50227f){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x8b3f9b){const _0x3d0b7a=this['_decompressOperations'](_0x4ccbff,_0x50227f);await this['_fetchMissingUsers'](_0x3d0b7a),this['_handleExternalOperations'](_0x3d0b7a,_0x8b3f9b,_0x4ccbff['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x4cd9fb}=this['editor'];let _0x26eb7d;try{_0x26eb7d=await this['_service']['getDocumentDetails']();}catch(_0x435fe4){const _0x22b7e6=G(_0x4cd9fb,'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'](_0x22b7e6);}const _0x1f601c=_0x26eb7d['currentDocumentSession']||_0x26eb7d['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x1f601c['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x3f11a6=G(_0x4cd9fb,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x3f11a6);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x31acc3){const _0x3dcacd=this['editor']['plugins']['get'](i);this['listenTo'](_0x3dcacd,'sessionAdd:'+this['_channelId'],(_0x20decc,{session:_0x12ae59})=>{if(_0x12ae59['id']===_0x3dcacd['mySessionId']){_0x20decc['off']();const _0x10ee43=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x79583f=_0x12ae59['permissions'];_0x10ee43&&_0x10ee43['isEnabled']&&(_0x79583f=_0x79583f['filter'](_0x29a895=>'document:write'!==_0x29a895)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x79583f,this['_channelId']);}}),_0x3dcacd['register'](this['_channelId'],_0x31acc3);}['_initThrowingOnDataSet'](){const _0x5c4600=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5e13cb)=>{if(!_0x5e13cb[_0x5e13cb['length']-0x1]['suppressErrorInCollaboration'])throw new _0x450af5('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5c4600['apply'](this['editor']['data'],_0x5e13cb);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x58f72e,[_0x1fad60])=>{if(this['_document']['version'])throw new _0x450af5('realtimecollaborationclient-init-document-already-initialized',this);_0x58f72e['stop'](),this['_setPendingAction']();const _0x4411d1=this['editor']['config']['get']('rootsAttributes'),_0x425559=this['_getOperationsFromInitData'](_0x1fad60,_0x4411d1);0x0==_0x425559['length']&&_0x425559['push'](new _0x8511da(0x0)),_0x58f72e['return']=this['_connectService'](_0x425559)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3bf062=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3bf062))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x4bdec6,[_0x280fe8,_0x53dc74])=>{_0x4bdec6['stop']();const _0x34d1aa=this['editor']['model']['document']['getRoot'](_0x280fe8);if(!this['_knownRootNames']['has'](_0x280fe8)){const _0xc5b8f1=_0x53dc74&&_0x53dc74['data']?_0x53dc74['data']:'',_0x5cfd7e=_0x53dc74&&_0x53dc74['attributes']?_0x53dc74['attributes']:{};await this['_loadRoot'](_0x280fe8,_0xc5b8f1,_0x5cfd7e);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x34d1aa['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x34d1aa);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x1b741a){const _0xa8a06c=this['editor']['plugins']['get'](_0x1b46b3),{connection:_0xe83b49}=this['editor']['plugins']['get'](c),_0xd5f904=new Set();for(const _0x5725bd of _0x1b741a){const _0x4fb956=_0x5725bd['_authorId'];_0x4fb956&&!_0xa8a06c['getUser'](_0x4fb956)&&_0xd5f904['add'](_0x4fb956);}if(0x0===_0xd5f904['size'])return;const _0x39f5fa=await dt['getMany'](_0xe83b49,Array['from'](_0xd5f904));for(const _0x38fcc8 of _0x39f5fa)_0xa8a06c['getUser'](_0x38fcc8['id'])||_0xa8a06c['addUser'](_0x38fcc8);}['_getOperationsFromInitData'](_0xee2057,_0xa0b27b={}){const _0x29294a=this['editor']['model'],_0x267d01=[];let _0x4b8100=0x0;const _0x1daa62='string'==typeof _0xee2057?{'main':_0xee2057}:_0xee2057;for(const _0x239570 of Object['keys'](_0x1daa62)){if(!this['_document']['roots']['has'](_0x239570))throw new _0x450af5('realtimecollaborationclient-init-non-existent-root',this);const _0x140043=this['editor']['data']['parse'](_0x1daa62[_0x239570]),_0xdd4a26=this['_document']['getRoot'](_0x239570),_0x11e669=new _0x19f267(_0x29294a['createPositionAt'](_0xdd4a26,0x0),_0x140043,_0x4b8100++);_0x267d01['push'](_0x11e669);for(const [_0x17de61,_0x5452c3]of _0x140043['markers']){const _0xd40a45=_0x29294a['createRange'](_0x29294a['createPositionFromPath'](_0xdd4a26,_0x5452c3['start']['path']['slice']()),_0x29294a['createPositionFromPath'](_0xdd4a26,_0x5452c3['end']['path']['slice']())),_0x347957=new _0x37404d(_0x17de61,null,_0xd40a45,_0x29294a['markers'],!0x0,_0x4b8100++);_0x267d01['push'](_0x347957);}}if(_0xa0b27b)for(const [_0x41790f,_0x356fec]of Object['entries'](_0xa0b27b)){const _0x380f07=_0x29294a['document']['getRoot'](_0x41790f);if(!_0x380f07)throw new _0x450af5('multi-root-editor-root-attributes-no-root',null);for(const [_0x4ddc81,_0x3fb309]of Object['entries'](_0x356fec))if(null!==_0x3fb309){const _0x106498=new _0x6cd20a(_0x380f07,_0x4ddc81,null,_0x3fb309,_0x4b8100++);_0x267d01['push'](_0x106498);}}return _0x267d01;}async['_loadRoot'](_0x2b0180,_0x1bf295,_0x130197){this['_getOperationsFromInitData']({[_0x2b0180]:_0x1bf295},{[_0x2b0180]:_0x130197})['forEach']((_0x29c373,_0x17f6fe)=>{_0x29c373['baseVersion']=this['_document']['version']+_0x17f6fe,_0x29c373['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x29c373);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1c4b52,_0x3cc331){let _0x1b6f3f;this['_offset']=_0x1c4b52['offset'];const _0x1774f2=_0x1c4b52['wereChangesApplied']&&!_0x1c4b52['initData'],_0xf9b636=_0x1774f2?0x0:_0x1c4b52['data']['baseVersion'];if(_0x3cc331['forEach'](_0x1c49bb=>{_0x1c49bb['_isInit']=!0x0,_0x1c49bb['createdAt']=_0x1c4b52['sessionCreatedAt'],_0x1c49bb['_authorId']=null;}),_0x1774f2)_0x1b6f3f=_0x3cc331,this['_applyOperationsSet'](_0x1b6f3f,_0x1774f2);else{if(_0x1c4b52['initData']){const _0x96e6b0=this['_getOperationsFromInitData'](_0x1c4b52['initData']);this['_document']['history']['version']=-_0x96e6b0['length'],_0x96e6b0['forEach'](_0x2fdc0a=>{_0x2fdc0a['baseVersion']-=_0x96e6b0['length'],_0x2fdc0a['createdAt']=_0x1c4b52['sessionCreatedAt'],_0x2fdc0a['_isInit']=!0x0,_0x2fdc0a['_authorId']=null;}),this['_applyOperationsSet'](_0x96e6b0,!0x0),this['serverHistory']['version']=-_0x96e6b0['length']+this['_offset'],this['_updateServerHistory'](_0x96e6b0);}this['_document']['history']['version']=_0xf9b636,_0x1b6f3f=this['_decompressOperations'](_0x1c4b52['data'],_0x1c4b52['metadata']),await this['_fetchMissingUsers'](_0x1b6f3f),this['_applyOperationsSet'](_0x1b6f3f,_0x1774f2);}_0x1c4b52['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1b6f3f,_0x1c4b52['lastOperationId']),this['_lastSyncedOperationId']=_0x1c4b52['lastOperationId']),this['serverHistory']['version']=_0xf9b636+this['_offset'],this['_updateServerHistory'](_0x1b6f3f),_0x3cc331['filter'](_0x16c18c=>{const _0x1dc434=this['_getAffectedRoot'](_0x16c18c);return _0x1dc434&&!this['_knownRootNames']['has'](_0x1dc434);})['forEach']((_0x2beaa3,_0x785e45)=>{_0x2beaa3['baseVersion']=this['_document']['version']+_0x785e45,this['_saveOperationInBuffer'](_0x2beaa3);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x1b36ef,_0x1b8482){const _0xc9eac3=_0x1b8482&&_0x1b8482['message'];if(_0xc9eac3&&_0xc9eac3['startsWith']('realtimecollaborationclient'))throw _0x1b8482;const _0x982999=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x982999['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x450af5(_0x1b36ef,this['editor'],_0xc9eac3?{'originalError':_0xc9eac3}:void 0x0);}['_saveOperationInBuffer'](_0x5af2bb){this['_knownOperations']['has'](_0x5af2bb)||(this['_knownOperations']['add'](_0x5af2bb),this['_bufferedOperations']['push'](_0x5af2bb),this['_pendingAction']||'marker'==_0x5af2bb['type']&&!_0x5af2bb['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x5f30f6=!0x1){!_0x5f30f6&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2b327f=>{_0x2b327f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x572a60=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x57d6e1){return _0x57d6e1['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x57d6e1['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x57d6e1['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x572a60)||this['_crash'](_0x572a60['message'],_0x572a60);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x34d81c=>{this['on']('change:_isPendingUpdate',()=>{_0x34d81c();});});}async['_sendBufferedOperations'](){const _0x5469f9=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x5469f9['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x4ee29c=[...this['_bufferedOperations']];for(const _0x14221b of _0x4ee29c)_0x14221b['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x14221b);const _0x16d447=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4ee29c),_0x29345f=J++,_0xc730de=this['_compressOperations'](_0x4ee29c),_0x399e97=await this['_service']['sendOperations'](_0xc730de,_0xc730de['baseVersion'],_0x16d447);try{return await this['_handleServerResponse'](_0x4ee29c,_0x399e97,_0x29345f);}catch(_0x24d224){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x24d224);}}async['_handleServerResponse'](_0x3f538f,_0x5aa3a9,_0x37cec0){if('error'in _0x5aa3a9)throw _0x5aa3a9['error'];let _0x4dec0e=!0x1;if(_0x5aa3a9['wereChangesApplied']){_0x5aa3a9['lastOperationId']&&(this['_lastSyncedOperationId']=_0x5aa3a9['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x49086a=>!_0x3f538f['includes'](_0x49086a));for(const _0xb275ac of _0x3f538f)_0xb275ac['createdAt']='lastOperationAcceptedAt'in _0x5aa3a9&&_0x5aa3a9['lastOperationAcceptedAt']||void 0x0;X(_0x3f538f,_0x5aa3a9['version']-_0x3f538f['length']),this['_updateServerHistory'](_0x3f538f);const _0x10a376=_0x3f538f['filter'](_0x2762f5=>{if(!_0x2762f5['_isInit'])return!0x1;const _0x1c0b78=this['_getAffectedRoot'](_0x2762f5);return _0x1c0b78&&!this['_knownRootNames']['has'](_0x1c0b78);});X(_0x10a376,this['_document']['version']),this['_applyOperationsSet'](_0x10a376),_0x4dec0e=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x264750=this['_decompressOperations'](_0x5aa3a9['data'],_0x5aa3a9['metadata'])['filter'](_0x2e3899=>_0x2e3899['baseVersion']>=this['_lastServerVersion']);_0x264750['forEach'](_0x316d0f=>this['_addKnownRoot'](_0x316d0f)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1742d1=>!_0x1742d1['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1742d1))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x264750),_0x4dec0e=this['_handleExternalOperations'](_0x264750,_0x5aa3a9['version'],_0x5aa3a9['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4dec0e?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x38369a,_0x5f828e,_0x325e9f){try{const _0x2247d1={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x508b51,operationsB:_0x237afd,originalOperations:_0x326f07}=_0x43930a(_0x38369a,this['_bufferedOperations'],_0x2247d1);X(_0x508b51,this['_document']['version']),X(_0x237afd,_0x5f828e);for(const _0x591018 of _0x508b51){const _0x3ef6e0=_0x326f07['get'](_0x591018);_0x591018['_authorId']=_0x3ef6e0?_0x3ef6e0['_authorId']:null;}_0x325e9f&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x38369a,_0x325e9f),this['_lastSyncedOperationId']=_0x325e9f),this['_bufferedOperations']=[..._0x237afd],this['_applyOperationsSet'](_0x508b51),this['_updateServerHistory'](_0x38369a);}catch(_0x3ee20e){return console['error'](_0x3ee20e),!0x1;}return!0x0;}['_applyOperationsSet'](_0x22370a,_0x26768a=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x57c9b2=>{for(const _0x4521e0 of _0x22370a)this['_knownOperations']['add'](_0x4521e0),this['_addKnownRoot'](_0x4521e0),_0x57c9b2['batch']['addOperation'](_0x4521e0),this['editor']['model']['applyOperation'](_0x4521e0);});}['_addKnownRoot'](_0x2a4bbc){const _0x106103=this['_getAffectedRoot'](_0x2a4bbc);_0x106103&&this['_knownRootNames']['add'](_0x106103);}['_getAffectedRoot'](_0x144f05){let _0x1f59f9,_0x1bf95f;switch(_0x144f05['type']){case'insert':_0x1f59f9=_0x144f05['position']['root'];break;case'marker':if(_0x1bf95f=_0x144f05['newRange'],!_0x1bf95f)return null;_0x1f59f9=_0x1bf95f['root'];break;case'addRootAttribute':_0x1f59f9=_0x144f05['root'];break;case'addRoot':_0x1f59f9=_0x144f05['affectedSelectable'];break;case'move':_0x1f59f9=_0x144f05['targetPosition']['root'];break;default:return null;}return _0x1f59f9['rootName'];}['_updateServerHistory'](_0x32908e){_0x32908e['forEach'](_0x2a7c79=>{const _0x552022=_0x2a7c79['clone']();_0x552022['_authorId']=_0x2a7c79['_authorId'],_0x552022['_isInit']=!!_0x2a7c79['_isInit'],_0x552022['createdAt']=_0x2a7c79['createdAt'],_0x552022['baseVersion']+=this['_offset'],_0x2a7c79['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x552022),this['serverHistory']['addOperation'](_0x552022);});}['_handleReconnectionError'](_0x1010f4){const _0x2aece3=this['editor']['plugins']['get']('Notification'),_0xafbe76=this['editor']['locale'];_0x1010f4||(_0x1010f4=G(_0xafbe76,'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.')),_0x2aece3['showWarning'](_0x1010f4,{'title':G(_0xafbe76,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x2c0263)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x2c0263)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0xc66763){const _0x4ae49e=_0xc66763['map'](_0x4f0126=>_0x4f0126['toJSON']());return this['_compressor']['compress'](_0x4ae49e);}['_decompressOperations'](_0x3d03ec,_0x7cd7b5){return this['_compressor']['decompress'](_0x3d03ec)['map']((_0x1ec4aa,_0x337cf9)=>{const _0x151f72='init'==_0x7cd7b5[_0x337cf9]['type'];if('InsertOperation'==_0x1ec4aa['__className']){const _0x58cd1e=_0x1ec4aa['position']['root'];!this['_document']['getRoot'](_0x58cd1e)&&(this['_document']['createRoot']('$root',_0x58cd1e)['_isAttached']=!0x1);}const _0x5032e=_0x25d184['fromJSON'](_0x1ec4aa,this['_document']);return _0x5032e['wasUndone']=_0x1ec4aa['wasUndone'],_0x5032e['_isInit']=_0x151f72,_0x5032e['_authorId']=_0x151f72?null:_0x7cd7b5[_0x337cf9]['userId'],_0x5032e['_isDisconnection']='cs:removeUser'===_0x7cd7b5[_0x337cf9]['type'],_0x5032e['createdAt']=_0x7cd7b5[_0x337cf9]['createdAt'],_0x5032e;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4fe35c=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4fe35c&&_0x4fe35c['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x10c616,_0x3d6075){for(const _0x4698c4 of _0x10c616)_0x4698c4['baseVersion']=_0x3d6075++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x532e9e){this['_ignoredOperations']=_0x532e9e,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x3fc2cb){let _0x236ca5=_0x3fc2cb['length'];for(;_0x236ca5--;){const _0x49ba82=_0x3fc2cb[_0x236ca5];if(!this['_ignoredOperations']['has'](_0x49ba82)){if(!this['_operationToId']['has'](_0x49ba82)){const _0x3c45a1=_0x1d673a()['slice'](0x1,0x12);this['_operationToId']['set'](_0x49ba82,_0x3c45a1);}return this['_operationToId']['get'](_0x49ba82);}}}['setIdForTheLastOperation'](_0x5aaafa,_0xdb3e4d){if(!_0xdb3e4d)return;let _0x57b517=_0x5aaafa['length'];for(;_0x57b517--;){const _0x10e09d=_0x5aaafa[_0x57b517];this['_ignoredOperations']['has'](_0x10e09d)||this['_operationToId']['set'](_0x10e09d,_0xdb3e4d);}}}class n extends _0x36ec84{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x39c302{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x30f710)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x1b46b3];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f1283){super(_0x5f1283),this['_services']=new Map();}async['init'](){const _0x55fb5f=this['context'],_0x4d74aa=_0x55fb5f['plugins']['get']('CommentsRepository');if(_0x55fb5f['plugins']['get'](c)['addToReconnectionStack'](this),_0x4d74aa['adapter']={'addCommentThread':async({channelId:_0x582591,threadId:_0x5aaddc,comments:_0xc9075a,resolvedAt:_0x5a4ed9,resolvedBy:_0x7b4e6d,context:_0x30f41d,attributes:_0x3afca4})=>{const _0x54b140=await this['_getService'](_0x582591)['addCommentThread']({'commentThreadId':_0x5aaddc,'comments':_0xc9075a['map'](_0x2876c4=>function(_0x1aa978,_0x4cc19d,_0x15f624){return{'commentThreadId':_0x15f624,'commentId':_0x1aa978['commentId'],'userId':_0x1aa978['authorId'],'content':_0x1aa978['content'],'documentId':_0x4cc19d,'createdAt':_0x1aa978['createdAt'],'attributes':_0x1aa978['attributes']||{}};}(_0x2876c4,_0x582591,_0x5aaddc)),'resolvedAt':_0x5a4ed9,'resolvedBy':_0x7b4e6d,'context':_0x30f41d,'attributes':_0x3afca4})['catch'](ut);return{'threadId':_0x54b140['commentThreadId'],'comments':_0x54b140['comments']};},'getCommentThread':async({channelId:_0x3b390c,threadId:_0x369b81})=>{const _0x4d8097=await this['_getService'](_0x3b390c)['getCommentThread'](_0x369b81)['catch'](ut);return _0x4d8097['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x4d8097]),{'threadId':_0x4d8097['commentThreadId'],'comments':_0x4d8097['comments']['map'](_),'context':_0x4d8097['context'],'resolvedAt':_0x4d8097['resolvedAt'],'resolvedBy':_0x4d8097['resolvedBy'],'attributes':_0x4d8097['attributes']||{}});},'updateCommentThread':async({channelId:_0x11e085,threadId:_0x4f78ed,context:_0x1a6edd,unlinkedAt:_0x25eabe,attributes:_0x14beae})=>this['_getService'](_0x11e085)['updateCommentThread']({'commentThreadId':_0x4f78ed,'context':_0x1a6edd,'attributes':_0x14beae,'unlinkedAt':_0x25eabe})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0xb5070c,threadId:_0x29cd77})=>{const _0x1827f4=await this['_getService'](_0xb5070c)['resolveCommentThread'](_0x29cd77)['catch'](S)['catch'](ut);return{'threadId':_0x1827f4['commentThreadId'],'resolvedAt':_0x1827f4['resolvedAt'],'resolvedBy':_0x1827f4['resolvedBy']};},'reopenCommentThread':async({channelId:_0x7edc04,threadId:_0x2cf4ba})=>this['_getService'](_0x7edc04)['reopenCommentThread'](_0x2cf4ba)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x1f619e,threadId:_0x1e26d6})=>this['_getService'](_0x1f619e)['removeCommentThread'](_0x1e26d6)['catch'](S)['catch'](ut),'addComment':({channelId:_0x481b40,threadId:_0x274d5a,commentId:_0x466609,content:_0xc3c998,attributes:_0xb2da5e})=>this['_getService'](_0x481b40)['addComment'](_0x274d5a,_0x466609,_0xc3c998,_0xb2da5e)['catch'](ut),'updateComment':({channelId:_0x2221d6,threadId:_0x257567,commentId:_0x218695,content:_0x404446,attributes:_0x32eee3})=>this['_getService'](_0x2221d6)['updateComment'](_0x257567,_0x218695,_0x404446,_0x32eee3)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x326a85,threadId:_0x4bf7b0,commentId:_0x55f666})=>this['_getService'](_0x326a85)['removeComment'](_0x4bf7b0,_0x55f666)['catch'](S)['catch'](ut)},_0x55fb5f instanceof _0xe4df37){const _0x5c672c=_0x55fb5f['config']['get']('collaboration.channelId'),_0x5528ee=_0x55fb5f['plugins']['get'](i);await this['_setUpService'](_0x5c672c);const _0x5bed4e=await this['_services']['get'](_0x5c672c)['getConnectedSessions']();this['listenTo'](_0x5528ee,'sessionAdd:'+_0x5c672c,(_0x2d9209,{session:_0x3576ec})=>{_0x3576ec['id']===_0x5528ee['mySessionId']&&(_0x2d9209['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3576ec['permissions'],_0x5c672c));}),_0x5528ee['register'](_0x5c672c,_0x5bed4e);}}async['_setUpService'](_0x2eb503){if(this['_services']['has'](_0x2eb503))throw new _0x450af5('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x2eb503});const _0x3083bf=this['context']['plugins']['get']('CommentsRepository'),_0x53f64a=new a['CommentsService'](_0x2eb503);this['_services']['set'](_0x2eb503,_0x53f64a),this['listenTo'](_0x53f64a,'commentThreadAdded',(_0x1bd161,_0x321364)=>{const {commentThreadId:_0x14bc66,documentId:_0x59d76a,context:_0x365792,attributes:_0xf6ca1e,resolvedAt:_0x54b23a,resolvedBy:_0x193449,comments:_0x1b519a}=_0x321364;_0x3083bf['getCommentThread'](_0x14bc66)||_0x3083bf['addCommentThread']({'threadId':_0x14bc66,'channelId':_0x59d76a,'comments':_0x1b519a?_0x1b519a['map'](_):[],'context':_0x365792,'attributes':_0xf6ca1e,'resolvedAt':_0x54b23a,'resolvedBy':_0x193449,'isFromAdapter':!0x0});}),this['listenTo'](_0x53f64a,'commentThreadUpdated',(_0x568231,{commentThreadId:_0x26c969,documentId:_0x1e3f22,context:_0x23aee3,unlinkedAt:_0x1d8a5e,attributes:_0x38a06f})=>{_0x3083bf['getCommentThread'](_0x26c969)&&_0x3083bf['updateCommentThread']({'threadId':_0x26c969,'channelId':_0x1e3f22,'context':_0x23aee3,'unlinkedAt':_0x1d8a5e,'attributes':_0x38a06f,'isFromAdapter':!0x0});}),this['listenTo'](_0x53f64a,'commentThreadResolved',(_0x2402c4,{commentThreadId:_0x493bd4,resolvedBy:_0x3a0087,resolvedAt:_0x5a953e})=>{const _0x48aca5=_0x3083bf['getCommentThread'](_0x493bd4);_0x48aca5&&_0x48aca5['resolve']({'resolvedBy':_0x3a0087,'resolvedAt':_0x5a953e,'isFromAdapter':!0x0});}),this['listenTo'](_0x53f64a,'commentThreadReopened',(_0x17f077,{commentThreadId:_0x1f90cb})=>{const _0x15a41f=_0x3083bf['getCommentThread'](_0x1f90cb);_0x15a41f&&_0x15a41f['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53f64a,'commentThreadRemoved',(_0x89bd91,{commentThreadId:_0x19375e})=>{const _0x40889e=_0x3083bf['getCommentThread'](_0x19375e);_0x40889e&&_0x40889e['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53f64a,'commentAdded',(_0x556784,_0x314e2b)=>{const _0x515aec=_0x314e2b['commentThreadId'],_0x2b4734=_0x3083bf['getCommentThread'](_0x515aec);_0x2b4734&&_0x2b4734['addComment']({..._(_0x314e2b),'isFromAdapter':!0x0});}),this['listenTo'](_0x53f64a,'commentUpdated',(_0xdece46,{commentThreadId:_0x293eb8,commentId:_0x518e3d,content:_0x2e7847,attributes:_0x1805a0})=>{const _0x369644=_0x3083bf['getCommentThread'](_0x293eb8);if(_0x369644){const _0x29e487=_0x369644['getComment'](_0x518e3d);_0x29e487&&_0x29e487['update']({'content':_0x2e7847,'attributes':_0x1805a0,'isFromAdapter':!0x0});}}),this['listenTo'](_0x53f64a,'commentRemoved',(_0x5a9bd0,{commentThreadId:_0x3202f0,commentId:_0x2322c3})=>{const _0x5d34f3=_0x3083bf['getCommentThread'](_0x3202f0);if(_0x5d34f3){const _0x343c3e=_0x5d34f3['getComment'](_0x2322c3);_0x343c3e&&_0x343c3e['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x2eb503);}['destroy'](){if(this['context']instanceof _0xe4df37){const _0x25cd4d=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x25cd4d);}}['_terminateService'](_0x576425){if(!this['_services']['has'](_0x576425))throw new _0x450af5('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x576425});this['_getService'](_0x576425)['disconnect'](),this['_services']['delete'](_0x576425);}async['reconnect'](){for(const _0x3d4025 of this['_services']['keys']())await this['_connectService'](_0x3d4025);if(this['context']instanceof _0xe4df37){const _0x120ebd=this['context']['config']['get']('collaboration.channelId'),_0x2d2256=this['context']['plugins']['get'](i);_0x2d2256['unregister'](_0x120ebd);const _0x1e3473=await this['_services']['get'](_0x120ebd)['getConnectedSessions']();_0x2d2256['register'](_0x120ebd,_0x1e3473);}}async['_connectService'](_0x101b33){const {connection:_0x3be628}=this['context']['plugins']['get'](c),_0xd1dbd1=this['context']['plugins']['get']('CommentsRepository'),_0x2e69f4=this['_services']['get'](_0x101b33),_0x36dca7=await _0x2e69f4['connect'](_0x3be628);await this['_fetchMissingUsersForThreads'](_0x36dca7);const _0x5e5aa7=new Set(Array['from'](_0xd1dbd1['getCommentThreads']({'channelId':_0x101b33}),_0x4d0be6=>_0x4d0be6['id']));for(const _0x324c33 of _0x36dca7)_0x324c33['deletedAt']||_0x5e5aa7['delete'](_0x324c33['commentThreadId']);for(const _0x24df14 of _0x5e5aa7)_0xd1dbd1['getCommentThread'](_0x24df14)['remove']({'isFromAdapter':!0x0});for(const _0x279d10 of _0x36dca7){let _0x33bbb6=_0xd1dbd1['getCommentThread'](_0x279d10['commentThreadId']);const {commentThreadId:_0x5015c9,context:_0x868c65,attributes:_0x5d9482,resolvedBy:_0x50b219,resolvedAt:_0x48ee85,unlinkedAt:_0x25ce9a,deletedAt:_0x201f91}=_0x279d10;if(_0x201f91)continue;_0x33bbb6||(_0x33bbb6=_0xd1dbd1['addCommentThread']({'channelId':_0x101b33,'threadId':_0x5015c9,'context':_0x868c65,'attributes':_0x5d9482||{},'resolvedBy':_0x50b219,'resolvedAt':_0x48ee85,'unlinkedAt':_0x25ce9a,'isFromAdapter':!0x0}));const _0x244089=new Set(Array['from'](_0x33bbb6['comments'],_0x3f1b41=>_0x3f1b41['id']));for(const _0x239cea of _0x279d10['comments'])_0x244089['delete'](_0x239cea['commentId']);for(const _0xb43a2 of _0x244089)_0x33bbb6['getComment'](_0xb43a2)['remove']({'isFromAdapter':!0x0});for(const _0xe5b3b7 of _0x279d10['comments']){const _0x2fb990=_0x33bbb6['getComment'](_0xe5b3b7['commentId']);_0x2fb990?_0x2fb990['content']!==_0xe5b3b7['content']&&_0x2fb990['update']({'content':_0xe5b3b7['content'],'isFromAdapter':!0x0}):_0x33bbb6['addComment'](Object['assign'](_(_0xe5b3b7),{'isFromAdapter':!0x0}));}}}['_getService'](_0xa83a63){if(!this['_services']['has'](_0xa83a63))throw new _0x450af5('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xa83a63});return this['_services']['get'](_0xa83a63);}async['_fetchMissingUsersForThreads'](_0x59fb5a){const _0x3d1c53=this['context']['plugins']['get'](_0x1b46b3),{connection:_0x150c1a}=this['context']['plugins']['get'](c),_0x2c7b67=new Set();for(const {resolvedBy:_0x44ca72,comments:_0x44d2c2}of _0x59fb5a){_0x44ca72&&!_0x3d1c53['getUser'](_0x44ca72)&&_0x2c7b67['add'](_0x44ca72);for(const {userId:_0x3867e4}of _0x44d2c2)_0x3d1c53['getUser'](_0x3867e4)||_0x2c7b67['add'](_0x3867e4);}if(0x0===_0x2c7b67['size'])return;const _0x503fd3=await dt['getMany'](_0x150c1a,Array['from'](_0x2c7b67));for(const _0x102039 of _0x503fd3)_0x3d1c53['getUser'](_0x102039['id'])||_0x3d1c53['addUser'](_0x102039);}}async function S(_0x4f6f88){if('404'!==_0x4f6f88['code'])throw _0x4f6f88;}function ut(_0x529cfb){if((_0x3ded76=_0x529cfb)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x3ded76['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3ded76['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x3ded76;throw _0x529cfb;}function _(_0x347008){return{'threadId':_0x347008['commentThreadId'],'commentId':_0x347008['commentId'],'content':_0x347008['content'],'createdAt':_0x347008['createdAt'],'authorId':_0x347008['userId'],'attributes':_0x347008['attributes']||{}};}class f extends _0x36ec84{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x480eff){super(_0x480eff);const _0x1a8b07=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x1a8b07);}['init'](){const _0x39cb63=this['editor']['plugins']['get'](c),_0x4ab684=this['editor']['plugins']['get']('TrackChangesEditing');return _0x4ab684['adapter']={'getSuggestion':async _0x1c630c=>{await this['_waitForServiceReady']();const _0x4e5fca=await this['_trackChangesService']['get'](_0x1c630c)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x4e5fca]),_0x4e5fca;},'addSuggestion':async({id:_0x2f30f5,type:_0xfdeb09,data:_0x5af279,originalSuggestionId:_0xbb9455,attributes:_0x3fd1ad})=>{await this['_waitForServiceReady']();const _0x33acef={'id':_0x2f30f5,'type':_0xfdeb09,'data':_0x5af279,'originalSuggestionId':_0xbb9455,'attributes':_0x3fd1ad},_0x18c942=await this['_trackChangesService']['add'](_0x2f30f5,_0xfdeb09,_0x5af279,_0xbb9455,_0x3fd1ad)['catch'](_0xd5568=>{if(ft(_0xd5568))return new Promise(_0x4cd40d=>{this['_bufferedRequests']['set'](_0x2f30f5,{'resolve':_0x4cd40d,'suggestionData':_0x33acef});});throw _0xd5568;});return this['_bufferedRequests']['delete'](_0x2f30f5),_0x18c942;},'updateSuggestion':async(_0x384739,_0x1c93e4)=>{if(await this['_waitForServiceReady'](),'open'!==_0x1c93e4['state'])return this['_trackChangesService']['update'](_0x384739,_0x1c93e4)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x5b9926,_0x4b2325)=>{_0x4ab684['hasSuggestion'](_0x4b2325['id'])&&(_0x4ab684['getSuggestion'](_0x4b2325['id'])['attributes']=_0x4b2325['attributes']);}),this['_trackChangesService']['connect'](_0x39cb63['connection'])['then'](_0xb4506a=>(_0x39cb63['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0xb4506a)['then'](()=>{for(const _0x394a4d of _0xb4506a){_0x4ab684['addSuggestionData'](_0x394a4d)['_saved']=!0x0;}})));}async['reconnect'](){const _0x4f3196=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x3abaee}=this['editor']['plugins']['get'](c),_0x22c277=await this['_trackChangesService']['connect'](_0x3abaee);await this['_fetchMissingUsersForThreads'](_0x22c277);for(const {suggestionData:_0xd70265,resolve:_0x504251}of this['_bufferedRequests']['values']()){let _0x300033=_0x22c277['find'](_0x236067=>_0x236067['id']===_0xd70265['id']);_0x300033||(_0x300033=await this['_trackChangesService']['add'](_0xd70265['id'],_0xd70265['type'],_0xd70265['data'],_0xd70265['originalSuggestionId'])),_0x504251(_0x300033);}for(const _0x4142e1 of _0x22c277)_0x4f3196['hasSuggestion'](_0x4142e1['id'])||_0x4f3196['addSuggestionData'](_0x4142e1);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x7ee853=>{this['listenTo'](this['_trackChangesService'],'connected',_0x121756=>{_0x121756['off'](),_0x7ee853();});});}async['_fetchMissingUsersForThreads'](_0x3a93af){const _0x3dc768=this['editor']['plugins']['get'](_0x1b46b3),{connection:_0x11447}=this['editor']['plugins']['get'](c),_0x380bf5=new Set();for(const {authorId:_0x516c0a}of _0x3a93af)_0x3dc768['getUser'](_0x516c0a)||_0x380bf5['add'](_0x516c0a);if(0x0===_0x380bf5['size'])return;const _0x297e0d=await dt['getMany'](_0x11447,Array['from'](_0x380bf5));for(const _0x3e5877 of _0x297e0d)_0x3dc768['getUser'](_0x3e5877['id'])||_0x3dc768['addUser'](_0x3e5877);}}function R(_0x49f3be){if(ft(_0x49f3be))return new Promise(()=>{});throw _0x49f3be;}function ft(_0x86b1ae){return _0x86b1ae['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x86b1ae['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x36ec84{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5baa1c=this['editor']['plugins']['get'](c),_0x26d33f=this['editor']['plugins']['get']('CommentsEditing'),_0x2af817=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x5baa1c,'change:state',(_0x11440b,_0x3c919c,_0x260ad9)=>{_0x26d33f['isThreadsLoadingPaused']='connected'!==_0x260ad9;});}),this['listenTo'](_0x5baa1c,'change:state',(_0xce1db0,_0x430980,_0x4fbba4)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x4fbba4);}),_0x2af817['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x36ec84{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x36ec84{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x1b46b3];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4e1e9e){super(_0x4e1e9e);const _0x174f41=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x174f41);}async['init'](){const _0x4d4946=this['editor']['plugins']['get'](l),_0x3fbb08=_0x4d4946['serverHistory'],_0x1e37ad=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x3fbb08,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4d4946['sessionId']});const _0x35adee=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x4866f3=await tt['isBundleUploaded'](_0x1e37ad['connection'],_0x35adee);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x38d732})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x38d732)),'updateRevisions':async _0x3685fc=>{await this['_waitForServiceReady']();const _0x1bb3d9=this['_revisionTracker']['currentRevision'];if(_0x4866f3&&0x1===_0x3685fc['length']&&_0x3685fc[0x0]['id']===_0x1bb3d9['id'])return _0x3685fc;for(const _0x32f985 of _0x3685fc)_0x32f985['id']===_0x1bb3d9['id']&&(_0x32f985['isEmptyCurrent']=_0x32f985['fromVersion']===_0x32f985['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3685fc,this['_lastRequestId'])['then'](_0x50f356=>(this['_lastRequestId']=_0x50f356,_0x3685fc))['catch'](_0x1d7c10=>{if(st(_0x1d7c10)||'400'===_0x1d7c10['code']&&void 0x0!==_0x1d7c10['data']['wrongRequestId']){for(const _0x2d2afa of _0x3685fc){!this['_revisionTracker']['repository']['getRevision'](_0x2d2afa['id'])||this['_revisionTracker']['_bufferUpdate'](_0x2d2afa['id'],_0x2d2afa,!0x1);}if(st(_0x1d7c10))throw _0x1d7c10;return _0x3685fc;}throw _0x1d7c10;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x26636f,{revisionsData:_0xf7fae6,requestId:_0x18e30d})=>{Math['max'](..._0xf7fae6['map'](_0x2d51f1=>_0x2d51f1['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0xf7fae6,_0x18e30d);}):this['_handleRevisionsUpdate'](_0xf7fae6,_0x18e30d);});const {revisions:_0x5ce620,requestId:_0x200f3f}=await this['_revisionHistoryService']['connect'](_0x1e37ad['connection']);_0x1e37ad['addToReconnectionStack'](this),this['_lastRequestId']=_0x200f3f,await this['_fetchMissingUsers'](_0x5ce620);for(const _0xffcaa7 of _0x5ce620)this['_revisionTracker']['addRevisionData'](_0xffcaa7);this['listenTo'](_0x4d4946,'change:_isConnected',(_0x48b1f9,_0x5ef71f,_0x2697a2)=>{_0x2697a2&&(this['_oldOffset']=_0x4d4946['_offset'],_0x48b1f9['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x1e37ad,'state',_0x5c3aeb=>_0x5c3aeb===_0x307b4a['CONNECTED']);}async['reconnect'](){const _0x43782a=this['editor']['plugins']['get'](c),_0x583e28=this['editor']['plugins']['get'](l),_0x41472d=async()=>{const _0x2757e3=this['_revisionTracker']['currentRevision'],_0x15ccc4=_0x2757e3['id'],_0x2ff2f0=_0x15ccc4!==_0x583e28['sessionId'];if(_0x2ff2f0){const _0x1c98b7=_0x583e28['_offset']-this['_oldOffset'],_0x2dafab=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2757e3['toVersion']+_0x1c98b7!==_0x2dafab){const _0xfd3d80=_0x2757e3['fromVersion']+_0x1c98b7,_0x21f5f3=this['editor']['plugins']['get'](_0x1b46b3),_0x50568f=this['_revisionTracker']['buildRevisionData']({'revision':_0x2757e3,'from':_0xfd3d80,'to':_0x2dafab});_0x50568f['id']=_0x2757e3['id'];const _0x5943ad=_0x50568f['authorsIds']['map'](_0x441471=>_0x21f5f3['getUser'](_0x441471));_0x2757e3['_update']({..._0x50568f,'authors':_0x5943ad},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2757e3['id'],_0x50568f,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2dafab,(_0x2757e3['toVersion']===_0x2757e3['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x15ccc4)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x15ccc4),this['_revisionTracker']['_createCurrentRevision'](_0x2dafab));}const {revisions:_0x678514,requestId:_0x2c1a22}=await this['_revisionHistoryService']['reconnect'](_0x43782a['connection'],this['_lastRequestId']);_0x2ff2f0&&_0x678514['length']>0x0?_0x583e28['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x678514),this['_handleRevisionsUpdate'](_0x678514,_0x2c1a22),this['_revisionTracker']['sendBufferedUpdates']());};return _0x583e28['_isConnected']?_0x41472d():new Promise((_0x58b5a7,_0x2cbde2)=>{_0x583e28['once']('change:_isConnected',()=>{_0x41472d()['then'](_0x58b5a7)['catch'](_0x2cbde2);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x36344a=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x9da17c=>{_0x9da17c['off'](),_0x36344a();});});}['_getLatestVersionFromServerOperations'](){const _0x380208=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x12be55 of _0x380208)if('marker'!==_0x12be55['type']||_0x12be55['affectsData'])return _0x12be55['baseVersion']+0x1;}['_getLatestVersion'](){const _0x239b7c=this['editor']['plugins']['get'](l);return new Promise(_0x5ff58a=>{_0x239b7c['_isPendingUpdate']?_0x239b7c['once']('change:_isPendingUpdate',()=>{_0x5ff58a(this['_getLatestVersionFromServerOperations']());}):_0x5ff58a(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x421186,_0x2a2b8c){const _0x199b48=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2a2b8c;for(const _0x28da4a of _0x421186){const _0x591ce5=_0x199b48['getRevision'](_0x28da4a['id']);if(_0x591ce5){if((_0x28da4a['fromVersion']||_0x28da4a['toVersion'])&&(_0x28da4a['diffData']=null),_0x591ce5===this['_revisionTracker']['currentRevision']){const _0xacfdb=Math['max'](_0x591ce5['toVersion'],_0x28da4a['toVersion']),_0x36caa6=Math['max'](_0x591ce5['fromVersion'],_0x28da4a['fromVersion']);let _0x3caca6;_0x591ce5['toVersion']===_0x28da4a['toVersion']&&_0x591ce5['fromVersion']===_0x28da4a['fromVersion']?(_0x3caca6=!0x0,this['_preventResendingRevisionData'](_0x28da4a)):_0x28da4a['toVersion']===_0xacfdb&&_0x28da4a['fromVersion']===_0x36caa6?_0x3caca6=!0x1:(_0x591ce5['toVersion']===_0xacfdb&&_0x591ce5['fromVersion']===_0x36caa6||this['_fixRevision']({'revision':_0x591ce5,'from':_0x36caa6,'to':_0xacfdb}),_0x3caca6=!0x0),_0x3caca6&&(delete _0x28da4a['fromVersion'],delete _0x28da4a['toVersion'],delete _0x28da4a['diffData'],delete _0x28da4a['createdAt'],delete _0x28da4a['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x28da4a),this['_preventResendingRevisionData'](_0x28da4a);}else this['_revisionTracker']['addRevisionData'](_0x28da4a);}const _0x5738b6=_0x199b48['getRevisions']();_0x5738b6['reverse']();for(let _0x58b476=0x0;_0x58b476<_0x5738b6['length']-0x1;_0x58b476++){const _0x4c01e0=_0x5738b6[_0x58b476],_0x1ea52c=_0x5738b6[_0x58b476+0x1];if(_0x4c01e0['fromVersion']<_0x1ea52c['toVersion']){const _0x447ed6=_0x1ea52c['toVersion'],_0x4905eb=Math['max'](_0x447ed6,_0x4c01e0['toVersion']);this['_fixRevision']({'revision':_0x4c01e0,'from':_0x447ed6,'to':_0x4905eb});}}}['_fixRevision']({revision:_0x43d04d,from:_0x15141d,to:_0x172470}={}){const _0xbf79df=this['editor']['plugins']['get'](_0x1b46b3),_0x18a3ec=this['_revisionTracker']['buildRevisionData']({'revision':_0x43d04d,'from':_0x15141d,'to':_0x172470});_0x18a3ec['authors']=_0x18a3ec['authorsIds']['map'](_0x56b645=>_0xbf79df['getUser'](_0x56b645)),_0x43d04d['_update'](_0x18a3ec);}['_preventResendingRevisionData'](_0x1f7e4a){const _0x1a5384={};_0x1a5384['id']=_0x1f7e4a['id'];for(const _0x2ca46b of Object['keys'](_0x1f7e4a))'id'!==_0x2ca46b&&(_0x1a5384[_0x2ca46b]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1a5384['id'],_0x1a5384,!0x0);}async['_fetchMissingUsers'](_0x5bba1c){const _0x44281d=this['editor']['plugins']['get'](_0x1b46b3),{connection:_0x3cc6a7}=this['editor']['plugins']['get'](c),_0xcd795=new Set();for(const _0x3ba0aa of _0x5bba1c){for(const _0x2fc9aa of _0x3ba0aa['authorsIds'])_0x5440b9(_0x2fc9aa);_0x3ba0aa['creatorId']&&_0x5440b9(_0x3ba0aa['creatorId']);}if(0x0===_0xcd795['size'])return;const _0x57e197=await dt['getMany'](_0x3cc6a7,Array['from'](_0xcd795));for(const _0x4742cd of _0x57e197)_0x44281d['getUser'](_0x4742cd['id'])||_0x44281d['addUser'](_0x4742cd);function _0x5440b9(_0x47ac8b){_0x44281d['getUser'](_0x47ac8b)||_0xcd795['add'](_0x47ac8b);}}}function st(_0x4d33e2){return _0x4d33e2['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4d33e2['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4d33e2['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x36ec84{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x2331df{['_collapseAt'];constructor(_0x1eadae,_0x38f141=0x6){super(_0x1eadae);const _0x23486e=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x38f141,this['bind']('isHidden')['to'](this,'usersCount',_0x4e8835=>_0x4e8835<_0x38f141),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x23486e['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':_0x23486e['to']('usersCount',_0x12a830=>'+'+(_0x12a830-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x2331df{['items'];['keystrokes'];constructor(_0xb0db52){super(_0xb0db52);const _0x477896=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x223d85(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x477896['if']('hasPopup'),'aria-expanded':_0x477896['to']('isExpanded',_0x598b9d=>this['hasPopup']&&String(_0x598b9d)),'aria-label':_0x477896['to']('hasPopup',_0x3a8b11=>G(_0xb0db52,_0x3a8b11?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x477896['to']('hasPopup',_0x1c4531=>!!_0x1c4531&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x477896['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x477896['to'](_0x4a69b0=>{const _0x62ff4f=_0x4a69b0,_0x405c02=document['querySelector']('.ck-presence-list__dropdown-list'),_0x436b1c=document['querySelector']('.ck-balloon-panel_with-arrow');_0x405c02?.['contains'](_0x62ff4f['relatedTarget'])||_0x436b1c?.['contains'](_0x62ff4f['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x35379d,_0x1b8990,_0xec4971)=>{this['element']&&(_0xec4971?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x2331df{['counterView'];['inlineListView'];constructor(_0x351b26,_0x45b129=0x6){super(_0x351b26);const _0x1fbaed=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x45b129),this['inlineListView']=new ts(_0x351b26),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x51d345 of this['inlineListView']['items'])_0x51d345['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',_0x1fbaed['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x2331df{['listWrapperView'];constructor(_0x2569d6,_0xd045e5){super(_0x2569d6);const _0x2522b6=this['bindTemplate'];this['listWrapperView']=new mt(_0x2569d6,_0xd045e5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x2569d6,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x2522b6['to'](_0x3d569c=>{const _0x15a187=_0x3d569c,_0x330138=document['querySelector']('.ck-presence-list__list'),_0x545797=document['querySelector']('.ck-balloon-panel_with-arrow');_0x330138?.['contains'](_0x15a187['relatedTarget'])||_0x545797?.['contains'](_0x15a187['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x1df070{constructor(_0x533e3d,_0x11a2f0){super(_0x533e3d);const _0x2467e2=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x11a2f0?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x2467e2['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x2467e2['to']('role'),'aria-label':_0x2467e2['to']('ariaLabel'),'aria-labelledby':_0x2467e2['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x40b117['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3cc98b=this['element'];_0x3cc98b&&(this['_isScrollable']=Math['max'](_0x3cc98b['scrollHeight'],_0x3cc98b['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x28fb57,_0x121154,_0x355e41){super(_0x28fb57);const _0x102a9c=this['bindTemplate'];this['userView']=new ct(_0x28fb57,_0x121154);const _0x39e9d3={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x121154['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x121154['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x121154['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x355e41&&(_0x39e9d3['tag']='button',_0x39e9d3['on']={'click':_0x102a9c['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x39e9d3);}['focus'](){this['element']['focus']();}}class y extends _0x2331df{['userView'];['markerView'];constructor(_0x4abee2,_0x2c2889,_0x23ef94){super(_0x4abee2);const _0x448095=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x4abee2,_0x2c2889),this['markerView']=new at(_0x4abee2,_0x2c2889);const _0x27c06d=new ot(_0x4abee2);_0x27c06d['template']['tag']='span',_0x27c06d['text']=_0x2c2889['name'];const _0x136619={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x448095['to']('isFocusable',_0x53ea09=>!!_0x53ea09&&0x0),'aria-labelledby':_0x27c06d['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x448095['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x448095['to']('hasTooltip',_0x245380=>!_0x245380),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x27c06d]};_0x23ef94&&(_0x136619['tag']='button',_0x136619['on']={'click':_0x448095['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x136619);}}class at extends _0x2331df{constructor(_0x3720e7,_0x599bb4){super(_0x3720e7),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x599bb4['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x39c302{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x26c166){super(_0x26c166),this['context']['config']['define']('presenceList',C);const _0x20fdcf=_0x26c166['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x20fdcf)throw new _0x450af5('presencelist-collapseat-invalid-format',this);if(_0x20fdcf<0x1)throw new _0x450af5('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2886d5(),this['balloonPanelView']=new _0x19634d(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x57d785 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x57d785);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5e94bb,_0x184da1)=>{this['_handleUserAdd'](_0x184da1);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2693fc,_0x503862)=>{this['_handleUserRemove'](_0x503862);});}['_createView'](){const _0x5edd6a=this['context'],_0x153f20=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x388920=this['balloonPanelView'];if(!_0x4e63ad(_0x5edd6a['config']['get']('presenceList.container')))throw new _0x450af5('presencelist-missing-container',this);return _0x153f20['counterView']['bind']('usersCount')['to'](this),_0x153f20['bind']('isCollapsed')['to'](this,'usersCount',_0x28574d=>{const {collapseAt:_0x3bbed6}=_0x5edd6a['config']['get']('presenceList'),_0x57cf58=_0x28574d>=_0x3bbed6;if(_0x57cf58&&!_0x153f20['inlineListView']['items']['find'](_0x5ebdf9=>_0x5ebdf9 instanceof A)){const _0x2c1e2d=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x2c1e2d&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x153f20['inlineListView']['items']['add'](_0x153f20['counterView']);}return _0x57cf58||this['hideDropdown'](),_0x57cf58;}),_0x153f20['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x2b9ddc=>{const _0xfe5947=_0x5edd6a['config']['get']('presenceList'),_0x4434ec=new y(_0x5edd6a['locale'],_0x2b9ddc,!!_0xfe5947['onClick']);return _0x4434ec['bind']('hasTooltip')['to'](_0x153f20,'isCollapsed',_0x3b6080=>!_0x3b6080),_0x4434ec['bind']('isFocusable')['to'](_0x153f20,'isCollapsed',_0x35a5d0=>!_0x35a5d0),_0xfe5947['onClick']&&this['listenTo'](_0x4434ec,'execute',()=>{this['view']['isCollapsed']||_0xfe5947['onClick'](_0x2b9ddc,_0x4434ec['element']);}),_0x4434ec;}),this['listenTo'](_0x153f20['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x153f20['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x153f20['inlineListView']['keystrokes']['set']('Enter',(_0x3cbecf,_0x34fd73)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x34fd73());}),_0x153f20['render'](),_0x388920['render'](),_0x1b96bb({'emitter':_0x153f20,'activator':()=>_0x388920['isVisible'],'contextElements':[_0x388920['element'],_0x153f20['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x5edd6a['config']['get']('presenceList.container')['appendChild'](_0x153f20['element']),this['_bodyCollection']=new _0x24c7b0(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x153f20;}['_handleUserAdd'](_0x3c2da6){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3c2da6['isMe'])return;const _0x12ce18=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x12ce18-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4e5563=_0x3c2da6['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3c2da6,_0x4e5563);}['_handleUserRemove'](_0x18df80){this['usersCount']--;const {collapseAt:_0x2c95b8}=this['context']['config']['get']('presenceList'),_0x1f36cb=this['usersCount']>=_0x2c95b8;if(this['currentDisplayedUsers']['get'](_0x18df80['id']))this['currentDisplayedUsers']['remove'](_0x18df80['id']);else{if(_0x1f36cb&&this['currentDisplayedUsers']['length']+0x1===_0x2c95b8-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1f36cb?0x1:0x0)<this['usersCount']){for(const _0x3d87e9 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x3d87e9['id'])&&(this['currentDisplayedUsers']['add'](_0x3d87e9,Math['min'](this['currentDisplayedUsers']['length']-(_0x1f36cb?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1f36cb?0x1:0x0)===_0x2c95b8-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x5789cc=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x5789cc['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x5ea7a2}=this['presenceDropdownView'];_0x5ea7a2['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x474362=>{if(!_0x5789cc['displayMe']&&_0x474362['isMe'])return null;const _0x48c18a=new k(this['context']['locale'],_0x474362,!!_0x5789cc['onClick']);return _0x5789cc['onClick']&&this['listenTo'](_0x48c18a,'execute',()=>{_0x5789cc['onClick'](_0x474362,_0x48c18a['element']);}),_0x48c18a;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x5ea7a2['focus'](),_0x5ea7a2['checkIfScrollable']();const _0x383ae4=(_0x4fc46e,_0x3f369b)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3f369b();};_0x5ea7a2['keystrokes']['set']('Esc',_0x383ae4),_0x5ea7a2['keystrokes']['set']('Shift+Tab',_0x383ae4),_0x5ea7a2['keystrokes']['set']('Tab',(_0x30f71f,_0x3fc251)=>{!function(_0x38a7e4){const _0x90a6eb=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x1626c7=>_0x1626c7+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2111f0=[...document['body']['querySelectorAll'](_0x90a6eb)]['filter'](_0x4f1503=>_0x4f1503===document['activeElement']||_0x4f1503['offsetWidth']+_0x4f1503['offsetHeight']>0x0)['sort']((_0x52d49d,_0x13276b)=>(_0x52d49d['tabIndex']||0x0)-(_0x13276b['tabIndex']||0x0)),_0x138c28=_0x2111f0['indexOf'](_0x38a7e4),_0x10fe68=_0x2111f0[(_0x138c28+0x1)%_0x2111f0['length']];_0x10fe68&&_0x10fe68['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3fc251();}),_0x5ea7a2['focusTracker']['add'](this['view']['element']),_0x5ea7a2['focusTracker']['on']('change:isFocused',(_0x3b9bcc,_0x4000d9,_0x3840ec)=>{_0x3840ec||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x39c302{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
@@ -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':_0x3e01fb=>0x1!=_0x3e01fb}};
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':_0x4c7733=>0x1!=_0x4c7733}};