@ckeditor/ckeditor5-real-time-collaboration 47.7.1 → 47.7.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +15 -15
  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 _0x5e8b20,Plugin as _0x557c4d,PendingActions as _0xfbb467,Context as _0x1bb59e}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0xd53d60,CKEditorError as _0x57af79,Collection as _0x24e80c,global as _0xc2e3cd,version as nt,uid as _0x57fd7a,KeystrokeHandler as _0x422e84}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x47bdda,View as _0x1bd8e4,ListView as _0x472541,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x251752,clickOutsideHandler as _0x3bb7ab,BodyCollection as _0x18e462}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x12d738,History as _0xbc8d8b,NoOperation as _0x3f81d9,InsertOperation as _0x4d5892,MarkerOperation as _0x537134,RootAttributeOperation as _0x358314,transformOperationSets as _0xa8199,OperationFactory as _0x2bd62b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x42a611,User as lt,CommentsService as _0x4370fd,TrackChangesService as tt,RevisionHistoryService as st,EditorService as it}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x53d600,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x4c457e}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x285777}from'es-toolkit/compat';class n extends _0x5e8b20{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x47bdda];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x28aa21){super(_0x28aa21),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0xd53d60())();}['init'](){const _0x4e934b=this['context'],_0x1623a4=_0x4e934b['plugins']['get']('CloudServices'),_0x44d830=_0x4e934b['plugins']['get'](_0x47bdda);if(!_0x1623a4['token'])throw new _0x57af79('websocketgateway-missing-token',this);if(!_0x1623a4['webSocketUrl'])throw new _0x57af79('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x1623a4['token'],_0x1623a4['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x550b6a=>{if(this['connection']=_0x550b6a,this['bind']('state')['to'](_0x550b6a,'state',this,'_isBrowserOffline',(_0x13e171,_0x7ee369)=>('connected'!==_0x13e171&&(this['_shouldPluginsReconnect']=!0x0),_0x7ee369||_0x13e171!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x4ed0fd,_0x3bd180)=>{if('limitExceeded'!==_0x3bd180['code'])throw console['error'](_0x3bd180),new _0x57af79('cloudservices-init',null,{'originalError':_0x3bd180});_0x44d830['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'});}),!_0x550b6a['me'])return new Promise(_0x63d002=>_0x550b6a['on']('change:me',_0x63d002));})['catch'](_0x504be5=>{throw console['error'](_0x504be5),new _0x57af79('cloudservices-init',null,{'originalError':_0x504be5});});}['addToReconnectionStack'](_0x518017){if('function'!=typeof _0x518017['reconnect'])throw new _0x57af79('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x518017))throw new _0x57af79('websocketgateway-plugin-already-registered',this,{'name':_0x518017['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x518017);}['removeFromReconnectionStack'](_0x3d7cec){this['_reconnectionStack']['delete'](_0x3d7cec);}['isInReconnectionStack'](_0x2fa994){return this['_reconnectionStack']['has'](_0x2fa994);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x52a8d1=>_0x52a8d1['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x3f03ab=>{throw console['error'](_0x3f03ab),new _0x57af79('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x5e8b20{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x53d600];}constructor(_0x402cdd){super(_0x402cdd),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x24e80c(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x53d600);}['init'](){const _0x2f9f2b=this['context']['plugins']['get'](n);this['listenTo'](_0x2f9f2b,'change:state',(_0x49f64a,_0x4922e8,_0xc7ef2c)=>{if('connected'!==_0xc7ef2c)this['channelSessions']['forEach'](_0x1ff7f8=>_0x1ff7f8['clear']()),this['channelConnectedUsers']['forEach'](_0x46d26b=>_0x46d26b['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x4ea40b,_0x3aa918]of this['_registeredSessions'])for(const _0x595525 of _0x3aa918)this['_handleSessionAdd'](_0x4ea40b,_0x595525);}}),this['_createUser'](_0x2f9f2b['connection']['me'],!0x0);}['register'](_0x18e97a,_0x5245b1){if(this['_registeredSessions']['has'](_0x18e97a))throw new _0x57af79('sessions-register-already-registered',null,{'channelId':_0x18e97a});this['_registeredSessions']['set'](_0x18e97a,_0x5245b1),this['channelSessions']['set'](_0x18e97a,new _0x24e80c()),this['channelConnectedUsers']['set'](_0x18e97a,new _0x24e80c()),this['listenTo'](_0x5245b1,'add',(_0x3cda6d,_0x3ad9c7)=>this['_handleSessionAdd'](_0x18e97a,_0x3ad9c7)),this['listenTo'](_0x5245b1,'remove',(_0x11e83d,_0x4107d1)=>this['_handleSessionRemove'](_0x18e97a,_0x4107d1));for(const _0x4e0492 of _0x5245b1)this['_handleSessionAdd'](_0x18e97a,_0x4e0492);}['unregister'](_0x3b88ba){if(!this['_registeredSessions']['has'](_0x3b88ba))throw new _0x57af79('sessions-unregister-not-exist',null,{'channelId':_0x3b88ba});const _0x14de09=this['_registeredSessions']['get'](_0x3b88ba);this['stopListening'](_0x14de09);for(const _0x10cb52 of _0x14de09)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x3b88ba,_0x10cb52);this['_registeredSessions']['delete'](_0x3b88ba),this['channelSessions']['delete'](_0x3b88ba),this['channelConnectedUsers']['delete'](_0x3b88ba);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x4daa02){for(const _0x3401d9 of this['channelSessions']['values']())for(const _0x5ddbbc of _0x3401d9)if(_0x5ddbbc['id']===_0x4daa02)return _0x5ddbbc['user'];}['getUserSessions'](_0x242e15,_0x5e2ccd){const _0x5083ad=_0x5e2ccd?[this['channelSessions']['get'](_0x5e2ccd)]:this['channelSessions']['values'](),_0x38b36f=new Set();for(const _0x46509b of _0x5083ad)for(const _0x205dea of _0x46509b)_0x205dea['user']['id']===_0x242e15['id']&&_0x38b36f['add'](_0x205dea['id']);return _0x38b36f;}['getUserRole'](_0x445f9a){for(const _0x42fea2 of this['channelSessions']['values']())for(const _0x18a256 of _0x42fea2)if(_0x18a256['user']===_0x445f9a)return _0x18a256['role'];}['_handleSessionAdd'](_0x4edf4f,_0x4d9c20){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0xcddd86=_0x4d9c20['user'],_0x366841=this['_users']['getUser'](_0xcddd86['id'])||this['_createUser'](_0xcddd86),_0x1b5db6=Object['assign']({},_0x4d9c20,{'user':_0x366841});if(this['channelSessions']['get'](_0x4edf4f)['add'](_0x1b5db6),!_0xcddd86['hiddenInPresenceList']){const _0x5e2f9e=this['channelConnectedUsers']['get'](_0x4edf4f);_0x5e2f9e['has'](_0x366841['id'])||_0x5e2f9e['add'](_0x366841),this['allConnectedUsers']['has'](_0x366841['id'])||_0xcddd86['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x366841,_0x366841['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x4edf4f,{'channelId':_0x4edf4f,'session':_0x1b5db6});}['_handleSessionRemove'](_0x1551e4,_0x59e18e){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x5c0378=this['channelConnectedUsers']['get'](_0x1551e4),_0x336505=_0x59e18e['user'];_0x336505['id']&&(this['channelSessions']['get'](_0x1551e4)['remove'](_0x59e18e['id']),_0x5c0378['has'](_0x336505['id'])&&!this['getUserSessions'](_0x336505,_0x1551e4)['size']&&_0x5c0378['remove'](_0x336505['id']),this['allConnectedUsers']['get'](_0x336505['id'])&&!this['getUserSessions'](_0x336505)['size']&&this['allConnectedUsers']['remove'](_0x336505['id']));}['_createUser'](_0x12b060,_0x25814b){const _0x498084=this['_users']['addUser'](_0x12b060);return _0x25814b&&this['_users']['defineMe'](_0x12b060['id']),_0x498084['orderNumber']=this['_uniqueUsersCount']++,_0x498084;}}class H extends _0x557c4d{['_domEmitter']=new(_0xd53d60())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5dd978=this['editor'],_0x252a2f=_0x5dd978['plugins']['get'](i);_0x5dd978['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x116194,{writer:_0x3cbba1})=>function(_0x4f3cc3,_0x2a655e,_0xb53e24,_0x4ccdf0){const _0x3b75f0=_0x4f3cc3['markerName']['split'](':')[0x2],_0x475e13=_0xb53e24['getUserBySessionId'](_0x3b75f0);if(!_0x475e13||_0x3b75f0===_0xb53e24['mySessionId'])return;if(!_0x4ccdf0['model']['schema']['checkChild'](_0x4f3cc3['markerRange']['start'],'$text'))return;const _0x56bb4c={'class':'ck-user__marker\x20'+_0x475e13['color']['getMarkerClass'](),'data-name':_0x475e13['name'],'data-session-id':_0x3b75f0},_0x46afdf=_0x4ccdf0['model']['markers']['get'](_0x4f3cc3['markerName']),_0x228d6f=_0x46afdf['getStart'](),_0x1f7604=_0x228d6f['nodeAfter'],_0x2c1a1e=_0x4ccdf0['model']['schema'];if(_0x1f7604&&_0x2c1a1e['isObject'](_0x1f7604)&&_0x2c1a1e['isInline'](_0x1f7604)&&!_0x4ccdf0['model']['markers']['get']('user:range:'+_0x3b75f0)['getRange']()['isCollapsed'])return;const _0x261b6c=_0x228d6f['parent'];return _0x4ccdf0['model']['schema']['isLimit'](_0x261b6c)&&!_0x4ccdf0['model']['hasContent'](_0x261b6c)&&(_0x56bb4c['contenteditable']=!0x1),function(_0x5343ba,_0x22cf70,_0x2d86b0){const _0x1df194=_0x5343ba['createUIElement']('span',_0x22cf70);return _0x5343ba['setCustomProperty']('userPositionMarker',!0x0,_0x1df194),_0x1df194['render']=function(_0x18179e){const _0x211f2a=this['toDomElement'](_0x18179e),_0x3cd5ae=document['createElement']('span');return _0x3cd5ae['classList']['add']('ck-user__marker-tooltip'),_0x3cd5ae['setAttribute']('contenteditable','false'),_0x3cd5ae['setAttribute']('spellcheck','false'),_0x3cd5ae['textContent']=_0x2d86b0['name'],_0x211f2a['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3cd5ae['outerHTML']+'⁠',_0x211f2a['addEventListener']('mouseenter',()=>{_0x211f2a['classList']['add']('ck-user__marker_hovered');}),_0x211f2a['addEventListener']('mouseleave',()=>{_0x211f2a['classList']['remove']('ck-user__marker_hovered');}),_0x211f2a;},_0x1df194['isSimilar']=function(_0x325f3b){return!(!this['getCustomProperty']('userPositionMarker')||!_0x325f3b['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x325f3b['getAttribute']('data-session-id'));},_0x1df194;}(_0x2a655e,_0x56bb4c,_0x475e13);}(_0x116194,_0x3cbba1,_0x252a2f,_0x5dd978)}),_0x5dd978['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0xc0d483=>function(_0x116cb4,_0x44f025){const _0x5da85a=_0x116cb4['markerName']['split'](':')[0x2];if(_0x5da85a===_0x44f025['mySessionId'])return null;const _0x172b48=_0x44f025['getUserBySessionId'](_0x5da85a);if(!_0x172b48)return{'id':_0x5da85a,'classes':[]};return{'id':_0x5da85a,'classes':['ck-user__selection',_0x172b48['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x5da85a},'priority':0x7d0+_0x172b48['orderNumber']};}(_0xc0d483,_0x252a2f)}),function(_0x2d6216){const _0x13fd5a=_0x2d6216['model'],_0x20c05d=new Map(),_0x4565e1=_0x2d6216['plugins']['get'](i);_0x13fd5a['markers']['on']('update:user:range',(_0x1faffb,_0x35c7f1,_0x468c1e,_0x2b103a)=>{if(!_0x2b103a&&_0x20c05d['get'](_0x35c7f1['name']))return _0x20c05d['get'](_0x35c7f1['name'])['detach'](),void _0x20c05d['delete'](_0x35c7f1['name']);const _0x5f00ad=_0x35c7f1['name']['split'](':')[0x2];if(_0x5f00ad===_0x4565e1['mySessionId'])return;const _0x3c0332='user:position:'+_0x5f00ad;_0x13fd5a['markers']['has'](_0x3c0332)&&_0x2d6216['editing']['reconvertMarker'](_0x3c0332),_0x35c7f1['on']('change:range',(_0x7e8e2e,_0x25789,_0x40489e)=>{if('$graveyard'!=_0x25789['root']['rootName']&&'$graveyard'==_0x35c7f1['getRange']()['root']['rootName']&&!_0x20c05d['has'](_0x35c7f1['name'])){const _0x236014=_0x13fd5a['schema']['getNearestSelectionRange'](_0x40489e['deletionPosition']);if(_0x236014){const _0x5a0309=_0x12d738['fromRange'](_0x236014);_0x20c05d['set'](_0x35c7f1['name'],_0x5a0309),_0x5a0309['on']('change:range',(_0x203e01,_0x1030e1,_0x4a5290)=>{if('$graveyard'==_0x5a0309['root']['rootName']){const _0x48d1e1=_0x13fd5a['schema']['getNearestSelectionRange'](_0x4a5290['deletionPosition']);_0x48d1e1?(_0x5a0309['start']=_0x48d1e1['start'],_0x5a0309['end']=_0x48d1e1['end']):(_0x20c05d['delete'](_0x35c7f1['name']),_0x5a0309['detach']());}});}}});}),_0x13fd5a['document']['on']('change',()=>{_0x20c05d['size']>0x0&&_0x13fd5a['enqueueChange']({'isUndoable':!0x1},_0x54d08e=>{for(const [_0xfffbb9,_0xf24ef3]of _0x20c05d)'$graveyard'==_0x13fd5a['markers']['get'](_0xfffbb9)['getRange']()['root']['rootName']&&(Z(_0xfffbb9['split'](':')[0x2],_0xf24ef3['toRange'](),_0x13fd5a,_0x54d08e),_0xf24ef3['detach']());_0x20c05d['clear']();});});}(_0x5dd978),this['_domEmitter']['listenTo'](_0xc2e3cd['document'],'keydown',(_0x2efb00,{key:_0x3d9fcc})=>{'Escape'===_0x3d9fcc&&function(_0x438ae1){_0x438ae1['editing']['view']['change'](_0xa9d440=>{for(const _0xbb5e13 of _0x438ae1['model']['markers']){if(!_0xbb5e13['name']['startsWith']('user:position'))continue;const _0x3d2540=_0x438ae1['editing']['mapper']['markerNameToElements'](_0xbb5e13['name']);if(_0x3d2540){for(const _0x4e384b of _0x3d2540)_0xa9d440['removeClass']('ck-user__marker_hovered',_0x4e384b);}}});}(_0x5dd978);},{'useCapture':!0x0});}['afterInit'](){const _0xbe1732=this['editor'],_0x4caed4=_0xbe1732['commands']['get']('undo');_0x4caed4&&_0xbe1732['model']['on']('applyOperation',(_0x53adf5,_0x16c5b9)=>{const _0x3423ca=_0x16c5b9[0x0];if(!_0x3423ca['isDocumentOperation'])return;if('marker'!=_0x3423ca['type']||!_0x3423ca['name']['startsWith']('user:'))return;const _0x1e6371=_0x3423ca['batch'];_0x4caed4['_createdBatches']['has'](_0x1e6371)&&(_0x3423ca['newRange']=_0x3423ca['oldRange']?_0xbe1732['model']['createRange'](_0x3423ca['oldRange']['start'],_0x3423ca['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x4be958=this['editor'],_0x53c6c6=_0x4be958['model']['document'],_0x1e9c4f=_0x4be958['plugins']['get'](i);_0x4be958['model']['enqueueChange']({'isUndoable':!0x1},_0xbb67a6=>{const _0x522aeb='user:range:'+_0x1e9c4f['mySessionId'],_0x3e115c='user:position:'+_0x1e9c4f['mySessionId'],_0x566be5=_0x4be958['model']['markers']['has'](_0x522aeb);_0x4be958['editing']['view']['hasDomSelection']?Z(_0x1e9c4f['mySessionId'],_0x53c6c6['selection']['getFirstRange'](),_0x4be958['model'],_0xbb67a6):_0x566be5&&(_0xbb67a6['removeMarker'](_0x522aeb),_0xbb67a6['removeMarker'](_0x3e115c));});}}function Z(_0x1a48a8,_0x2a853c,_0x1eb77d,_0x210ccf){const _0x42021f='user:range:'+_0x1a48a8,_0x1f3a6a='user:position:'+_0x1a48a8,_0x121332=_0x2a853c['getContainedElement']();let _0x5c8697=_0x2a853c['start'];if(_0x121332&&_0x121332['is']('element','tableCell')){const _0x42fa1a=function(_0x382d84,_0x34ccc1){for(const _0x5cf833 of _0x382d84['getPositions']())if(_0x34ccc1['schema']['checkChild'](_0x5cf833,'$text'))return _0x5cf833;}(_0x2a853c,_0x1eb77d);_0x42fa1a&&(_0x5c8697=_0x42fa1a,_0x2a853c=_0x210ccf['createRange'](_0x5c8697));}const _0x101439=_0x210ccf['createRange'](_0x5c8697);_0x1eb77d['markers']['has'](_0x42021f)?(_0x210ccf['updateMarker'](_0x42021f,{'range':_0x2a853c}),_0x210ccf['updateMarker'](_0x1f3a6a,{'range':_0x101439})):(_0x210ccf['addMarker'](_0x42021f,{'range':_0x2a853c,'usingOperation':!0x0}),_0x210ccf['addMarker'](_0x1f3a6a,{'range':_0x101439,'usingOperation':!0x0}));}function V(_0x69639e,_0x275f4c,_0x14950e){const _0xff6674=_0x69639e['t'],t=_0x69639e['t'];switch(_0x275f4c){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 _0xff6674({'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'},_0x14950e);default:return'';}}let G=0x1;class l extends _0x557c4d{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x42a611)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,H,_0xfbb467,_0x53d600,_0x47bdda];}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 _0x1382e2=this['serverHistory']['getOperations']();for(let _0x2b33c0=_0x1382e2['length']-0x1;_0x2b33c0>=0x0;_0x2b33c0--){const _0x382b28=_0x1382e2[_0x2b33c0];if(!this['_disconnectionOperations']['has'](_0x382b28))return _0x382b28['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x288285){if(super(_0x288285),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0xbc8d8b(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x57af79('collaboration-missing-channelid',this);const _0x3987b4=_0x288285['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x3987b4,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x4c457e(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new J(this['_disconnectionOperations']);}['init'](){const _0x13f01b=this['editor'],_0x510723=_0x13f01b['plugins']['get'](_0x53d600),_0x193893=_0x13f01b['plugins']['get'](n);this['listenTo'](_0x510723,'getOperationAuthor',(_0x610589,_0x40af99)=>{const _0x391f5e=_0x40af99[0x0];_0x391f5e['_authorId']&&(_0x610589['return']=_0x510723['getUser'](_0x391f5e['_authorId']),_0x610589['stop']()),null===_0x391f5e['_authorId']&&(_0x610589['return']=null,_0x610589['stop']());},{'priority':'high'}),this['listenTo'](_0x13f01b['model']['document']['selection'],'change:range',(_0x36d445,_0x987506)=>{_0x987506['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x13f01b['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x13f01b['model']['on']('applyOperation',(_0x98d4,_0x590d23)=>{const _0x3f2a12=_0x590d23[0x0];_0x3f2a12['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x3f2a12),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x193893,'state',this,'_hasSynchronizationProblem',(_0x2bcd59,_0x2c0057)=>'connected'===_0x2bcd59&&!_0x2c0057),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x13f01b['disableReadOnlyMode']('rtc-offline'):_0x13f01b['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x13f01b['disableReadOnlyMode']('rtc-offline'):_0x13f01b['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x48561d=this['editor']['plugins']['get'](i),_0x32a828=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x48561d['unregister'](this['_channelId']);const _0x4ac9da=await this['_service']['reconnect'](_0x32a828['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4ac9da)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4d0a59=await this['_service']['getConnectedSessions']();_0x48561d['register'](this['_channelId'],_0x4d0a59),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x49c8f1){if(function(_0x1e5f3a){return'404'===_0x1e5f3a['code'];}(_0x49c8f1)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x1a98d6){return'409'===_0x1a98d6['code'];}(_0x49c8f1)){const _0x26b9c9=V(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'](_0x26b9c9);}else{if(!(_0x49c8f1 instanceof $))throw _0x49c8f1;this['_handleReconnectionError']();}}}}['destroy'](){const _0xabbf1e=this['editor']['plugins']['get'](n),_0x240a28=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x240a28['channelSessions']['has'](this['_channelId'])&&_0x240a28['unregister'](this['_channelId']),_0xabbf1e['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4553dc){if(this['sessionId']!==_0x4553dc['sessionId']&&this['_lastSyncedOperationId']!==_0x4553dc['lastOperationId'])throw new $();return this['sessionId']=_0x4553dc['sessionId'],this['_handleServerResponse']([],{..._0x4553dc,'wereChangesApplied':!0x1,'data':_0x4553dc['data']},'reconnect');}async['_connectService'](_0x4e369e,_0x2894f9=!0x1){const {connection:_0x324678}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x324678,this['_channelId'])['then'](_0x188e17=>this['_initSessionsHandling'](_0x188e17))['catch'](_0x371016=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x371016);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xb560b0,_0x51d6d3)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x51d6d3);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x300b6=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4e369e);this['_isPendingUpdate']=!0x0;const _0x4c167f=await this['_service']['connect'](_0x324678,this['_compressOperations'](_0x4e369e),_0x300b6);if(this['sessionId']=_0x4c167f['sessionId'],_0x2894f9){if(!_0x4c167f['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x4c167f['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4e369e,_0x4c167f,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x4c167f,_0x4e369e);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3f9719=this['editor']['plugins']['get'](i),_0x58105d=this['editor']['plugins']['get'](H),_0x4aaa54=_0x3f9719['channelSessions']['get'](this['_channelId']);_0x4aaa54&&_0x4aaa54['length']>0x1?_0x58105d['createUserMarkerOperations']():this['listenTo'](_0x3f9719,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3f9719['channelSessions']['get'](this['_channelId'])['length']&&_0x58105d['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x17066b,_0x34e7e3,_0x30cf35,_0x29980c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x34e7e3){const _0x4813b7=this['_decompressOperations'](_0x30cf35,_0x29980c);await this['_fetchMissingUsers'](_0x4813b7),this['_handleExternalOperations'](_0x4813b7,_0x34e7e3,_0x30cf35['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x45658b}=this['editor'];let _0xbc2b39;try{_0xbc2b39=await this['_service']['getDocumentDetails']();}catch{const _0x1c2452=V(_0x45658b,'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'](_0x1c2452);}const _0x3cc819=_0xbc2b39['currentDocumentSession']||_0xbc2b39['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x3cc819['lastOperationId']){const _0x44bb36=V(_0x45658b,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x44bb36);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x49418e){const _0x4b1e5b=this['editor']['plugins']['get'](i);this['listenTo'](_0x4b1e5b,'sessionAdd:'+this['_channelId'],(_0x4f5d2f,{session:_0x33f006})=>{if(_0x33f006['id']===_0x4b1e5b['mySessionId']){_0x4f5d2f['off']();const _0x256411=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x1c7db8=_0x33f006['permissions'];_0x256411&&_0x256411['isEnabled']&&(_0x1c7db8=_0x1c7db8['filter'](_0x2d8772=>'document:write'!==_0x2d8772)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x1c7db8,this['_channelId']);}}),_0x4b1e5b['register'](this['_channelId'],_0x49418e);}['_initThrowingOnDataSet'](){const _0x695205=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4defdc)=>{if(!_0x4defdc[_0x4defdc['length']-0x1]['suppressErrorInCollaboration'])throw new _0x57af79('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x695205['apply'](this['editor']['data'],_0x4defdc);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1dd1f0,[_0x326d7b])=>{if(this['_document']['version'])throw new _0x57af79('realtimecollaborationclient-init-document-already-initialized',this);_0x1dd1f0['stop'](),this['_setPendingAction']();const _0x585eef=this['editor']['config']['get']('rootsAttributes'),_0x382be9=this['_getOperationsFromInitData'](_0x326d7b,_0x585eef);0x0==_0x382be9['length']&&_0x382be9['push'](new _0x3f81d9(0x0)),_0x1dd1f0['return']=this['_connectService'](_0x382be9)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3019d3=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3019d3))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x2ca413,[_0xa488bf,_0x4b7173])=>{_0x2ca413['stop']();const _0x7ebb2a=this['editor']['model']['document']['getRoot'](_0xa488bf);if(!this['_knownRootNames']['has'](_0xa488bf)){const _0x49136=_0x4b7173&&_0x4b7173['data']?_0x4b7173['data']:'',_0x5cc970=_0x4b7173&&_0x4b7173['attributes']?_0x4b7173['attributes']:{};await this['_loadRoot'](_0xa488bf,_0x49136,_0x5cc970);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x7ebb2a['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x7ebb2a);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x1736e1){const _0x11a64e=this['editor']['plugins']['get'](_0x53d600),{connection:_0x19b972}=this['editor']['plugins']['get'](n),_0x31cdfd=new Set();for(const _0x16e328 of _0x1736e1){const _0x2f25cb=_0x16e328['_authorId'];_0x2f25cb&&!_0x11a64e['getUser'](_0x2f25cb)&&_0x31cdfd['add'](_0x2f25cb);}if(0x0===_0x31cdfd['size'])return;const _0x4e5e77=await lt['getMany'](_0x19b972,Array['from'](_0x31cdfd));for(const _0x4fa0aa of _0x4e5e77)_0x11a64e['getUser'](_0x4fa0aa['id'])||_0x11a64e['addUser'](_0x4fa0aa);}['_getOperationsFromInitData'](_0x5c52df,_0x3358b7={}){const _0x2b555f=this['editor']['model'],_0x5ba9bf=[];let _0x5989c2=0x0;const _0x58ad42='string'==typeof _0x5c52df?{'main':_0x5c52df}:_0x5c52df;for(const _0x25f13d of Object['keys'](_0x58ad42)){if(!this['_document']['roots']['has'](_0x25f13d))throw new _0x57af79('realtimecollaborationclient-init-non-existent-root',this);const _0x358849=this['editor']['data']['parse'](_0x58ad42[_0x25f13d]),_0x3d7b61=this['_document']['getRoot'](_0x25f13d),_0xc27cf=new _0x4d5892(_0x2b555f['createPositionAt'](_0x3d7b61,0x0),_0x358849,_0x5989c2++);_0x5ba9bf['push'](_0xc27cf);for(const [_0x48be0b,_0x294d5d]of _0x358849['markers']){const _0x2afcca=_0x2b555f['createRange'](_0x2b555f['createPositionFromPath'](_0x3d7b61,_0x294d5d['start']['path']['slice']()),_0x2b555f['createPositionFromPath'](_0x3d7b61,_0x294d5d['end']['path']['slice']())),_0x4c57ca=new _0x537134(_0x48be0b,null,_0x2afcca,_0x2b555f['markers'],!0x0,_0x5989c2++);_0x5ba9bf['push'](_0x4c57ca);}}if(_0x3358b7)for(const [_0x3fbef1,_0x1da5d4]of Object['entries'](_0x3358b7)){const _0x551632=_0x2b555f['document']['getRoot'](_0x3fbef1);if(!_0x551632)throw new _0x57af79('multi-root-editor-root-attributes-no-root',null);for(const [_0x57d65b,_0x1eab8e]of Object['entries'](_0x1da5d4))if(null!==_0x1eab8e){const _0x543740=new _0x358314(_0x551632,_0x57d65b,null,_0x1eab8e,_0x5989c2++);_0x5ba9bf['push'](_0x543740);}}return _0x5ba9bf;}async['_loadRoot'](_0x21c3f4,_0x525d67,_0x55641d){this['_getOperationsFromInitData']({[_0x21c3f4]:_0x525d67},{[_0x21c3f4]:_0x55641d})['forEach']((_0x3736c1,_0x5d12d7)=>{_0x3736c1['baseVersion']=this['_document']['version']+_0x5d12d7,_0x3736c1['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x3736c1);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x45d7f8,_0x309940){let _0xee86c5;this['_offset']=_0x45d7f8['offset'];const _0xee181c=_0x45d7f8['wereChangesApplied']&&!_0x45d7f8['initData'],_0x983474=_0xee181c?0x0:_0x45d7f8['data']['baseVersion'];if(_0x309940['forEach'](_0x5e8ed0=>{_0x5e8ed0['_isInit']=!0x0,_0x5e8ed0['createdAt']=_0x45d7f8['sessionCreatedAt'],_0x5e8ed0['_authorId']=null;}),_0xee181c)_0xee86c5=_0x309940,this['_applyOperationsSet'](_0xee86c5,_0xee181c);else{if(_0x45d7f8['initData']){const _0x3339e2=this['_getOperationsFromInitData'](_0x45d7f8['initData']);this['_document']['history']['version']=-_0x3339e2['length'],_0x3339e2['forEach'](_0x56e143=>{_0x56e143['baseVersion']-=_0x3339e2['length'],_0x56e143['createdAt']=_0x45d7f8['sessionCreatedAt'],_0x56e143['_isInit']=!0x0,_0x56e143['_authorId']=null;}),this['_applyOperationsSet'](_0x3339e2,!0x0),this['serverHistory']['version']=-_0x3339e2['length']+this['_offset'],this['_updateServerHistory'](_0x3339e2);}this['_document']['history']['version']=_0x983474,_0xee86c5=this['_decompressOperations'](_0x45d7f8['data'],_0x45d7f8['metadata']),await this['_fetchMissingUsers'](_0xee86c5),this['_applyOperationsSet'](_0xee86c5,_0xee181c);}_0x45d7f8['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xee86c5,_0x45d7f8['lastOperationId']),this['_lastSyncedOperationId']=_0x45d7f8['lastOperationId']),this['serverHistory']['version']=_0x983474+this['_offset'],this['_updateServerHistory'](_0xee86c5),_0x309940['filter'](_0x102408=>{const _0xb19378=this['_getAffectedRoot'](_0x102408);return _0xb19378&&!this['_knownRootNames']['has'](_0xb19378);})['forEach']((_0x2dae86,_0x3aa407)=>{_0x2dae86['baseVersion']=this['_document']['version']+_0x3aa407,this['_saveOperationInBuffer'](_0x2dae86);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x37f89b,_0x2c4c48){const _0x396add=_0x2c4c48&&_0x2c4c48['message'];if(_0x396add&&_0x396add['startsWith']('realtimecollaborationclient'))throw _0x2c4c48;const _0x2d3c2b=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x2d3c2b['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x57af79(_0x37f89b,this['editor'],_0x396add?{'originalError':_0x396add}:void 0x0);}['_saveOperationInBuffer'](_0xf9619c){this['_knownOperations']['has'](_0xf9619c)||(this['_knownOperations']['add'](_0xf9619c),this['_bufferedOperations']['push'](_0xf9619c),this['_pendingAction']||'marker'==_0xf9619c['type']&&!_0xf9619c['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x2e5715=!0x1){!_0x2e5715&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x449f25=>{_0x449f25&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x43ec85=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x45aaea){return _0x45aaea['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x45aaea['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x45aaea['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x43ec85)||this['_crash'](_0x43ec85['message'],_0x43ec85);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5f462e=>{this['on']('change:_isPendingUpdate',()=>{_0x5f462e();});});}async['_sendBufferedOperations'](){const _0x5574c6=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x5574c6['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x21cf30=[...this['_bufferedOperations']];for(const _0x2f4862 of _0x21cf30)_0x2f4862['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2f4862);const _0x107e2f=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x21cf30),_0x3eca45=G++,_0x388f03=this['_compressOperations'](_0x21cf30),_0xe4b619=await this['_service']['sendOperations'](_0x388f03,_0x388f03['baseVersion'],_0x107e2f);try{return await this['_handleServerResponse'](_0x21cf30,_0xe4b619,_0x3eca45);}catch(_0x3c43d5){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3c43d5);}}async['_handleServerResponse'](_0x39fd36,_0x39bfec,_0x2efc1e){if('error'in _0x39bfec)throw _0x39bfec['error'];let _0x23e55b=!0x1;if(_0x39bfec['wereChangesApplied']){_0x39bfec['lastOperationId']&&(this['_lastSyncedOperationId']=_0x39bfec['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5e3c09=>!_0x39fd36['includes'](_0x5e3c09));for(const _0x2123b8 of _0x39fd36)_0x2123b8['createdAt']='lastOperationAcceptedAt'in _0x39bfec&&_0x39bfec['lastOperationAcceptedAt']||void 0x0;K(_0x39fd36,_0x39bfec['version']-_0x39fd36['length']),this['_updateServerHistory'](_0x39fd36);const _0x51b193=_0x39fd36['filter'](_0x91d6ec=>{if(!_0x91d6ec['_isInit'])return!0x1;const _0x4f3091=this['_getAffectedRoot'](_0x91d6ec);return _0x4f3091&&!this['_knownRootNames']['has'](_0x4f3091);});K(_0x51b193,this['_document']['version']),this['_applyOperationsSet'](_0x51b193),_0x23e55b=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x272928=this['_decompressOperations'](_0x39bfec['data'],_0x39bfec['metadata'])['filter'](_0x5a086c=>_0x5a086c['baseVersion']>=this['_lastServerVersion']);_0x272928['forEach'](_0x3d6f60=>this['_addKnownRoot'](_0x3d6f60)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x7a7072=>!_0x7a7072['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x7a7072))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x272928),_0x23e55b=this['_handleExternalOperations'](_0x272928,_0x39bfec['version'],_0x39bfec['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x23e55b?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3902e0,_0x4225c5,_0x2d434b){try{const _0x68abc5={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4c254e,operationsB:_0x5019a4,originalOperations:_0x3c6126}=_0xa8199(_0x3902e0,this['_bufferedOperations'],_0x68abc5);K(_0x4c254e,this['_document']['version']),K(_0x5019a4,_0x4225c5);for(const _0x3ff899 of _0x4c254e){const _0x445283=_0x3c6126['get'](_0x3ff899);_0x3ff899['_authorId']=_0x445283?_0x445283['_authorId']:null;}_0x2d434b&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3902e0,_0x2d434b),this['_lastSyncedOperationId']=_0x2d434b),this['_bufferedOperations']=[..._0x5019a4],this['_applyOperationsSet'](_0x4c254e),this['_updateServerHistory'](_0x3902e0);}catch(_0x27bdaa){return console['error'](_0x27bdaa),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4b1d49,_0x28de52=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3f90fa=>{for(const _0x3fe2f0 of _0x4b1d49)this['_knownOperations']['add'](_0x3fe2f0),this['_addKnownRoot'](_0x3fe2f0),_0x3f90fa['batch']['addOperation'](_0x3fe2f0),this['editor']['model']['applyOperation'](_0x3fe2f0);});}['_addKnownRoot'](_0x43a0ae){const _0x3431d0=this['_getAffectedRoot'](_0x43a0ae);_0x3431d0&&this['_knownRootNames']['add'](_0x3431d0);}['_getAffectedRoot'](_0x1477c9){let _0x1e3f25,_0x55e152;switch(_0x1477c9['type']){case'insert':_0x1e3f25=_0x1477c9['position']['root'];break;case'marker':if(_0x55e152=_0x1477c9['newRange'],!_0x55e152)return null;_0x1e3f25=_0x55e152['root'];break;case'addRootAttribute':_0x1e3f25=_0x1477c9['root'];break;case'addRoot':_0x1e3f25=_0x1477c9['affectedSelectable'];break;case'move':_0x1e3f25=_0x1477c9['targetPosition']['root'];break;default:return null;}return _0x1e3f25['rootName'];}['_updateServerHistory'](_0x11bbc0){_0x11bbc0['forEach'](_0x4651bf=>{const _0x560658=_0x4651bf['clone']();_0x560658['_authorId']=_0x4651bf['_authorId'],_0x560658['_isInit']=!!_0x4651bf['_isInit'],_0x560658['createdAt']=_0x4651bf['createdAt'],_0x560658['baseVersion']+=this['_offset'],_0x4651bf['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x560658),this['serverHistory']['addOperation'](_0x560658);});}['_handleReconnectionError'](_0x5b5337){const _0x4d69d3=this['editor']['plugins']['get']('Notification'),_0x414d81=this['editor']['locale'];_0x5b5337||(_0x5b5337=V(_0x414d81,'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.')),_0x4d69d3['showWarning'](_0x5b5337,{'title':V(_0x414d81,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0xfbb467)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0xfbb467)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2a39a4){const _0x1a5f22=_0x2a39a4['map'](_0x32cd9a=>_0x32cd9a['toJSON']());return this['_compressor']['compress'](_0x1a5f22);}['_decompressOperations'](_0x4a38c4,_0x580020){return this['_compressor']['decompress'](_0x4a38c4)['map']((_0xaf07dd,_0x3b6c36)=>{const _0x5abe41='init'==_0x580020[_0x3b6c36]['type'];if('InsertOperation'==_0xaf07dd['__className']){const _0x34c8b9=_0xaf07dd['position']['root'];!this['_document']['getRoot'](_0x34c8b9)&&(this['_document']['createRoot']('$root',_0x34c8b9)['_isAttached']=!0x1);}const _0x79dee4=_0x2bd62b['fromJSON'](_0xaf07dd,this['_document']);return _0x79dee4['wasUndone']=_0xaf07dd['wasUndone'],_0x79dee4['_isInit']=_0x5abe41,_0x79dee4['_authorId']=_0x5abe41?null:_0x580020[_0x3b6c36]['userId'],_0x79dee4['_isDisconnection']='cs:removeUser'===_0x580020[_0x3b6c36]['type'],_0x79dee4['createdAt']=_0x580020[_0x3b6c36]['createdAt'],_0x79dee4;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x23bfdb=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x23bfdb&&_0x23bfdb['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x1ff3c5,_0x56afeb){for(const _0x5c1e88 of _0x1ff3c5)_0x5c1e88['baseVersion']=_0x56afeb++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x191067){this['_ignoredOperations']=_0x191067,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4fa1e3){let _0x37ef90=_0x4fa1e3['length'];for(;_0x37ef90--;){const _0x4e2972=_0x4fa1e3[_0x37ef90];if(!this['_ignoredOperations']['has'](_0x4e2972)){if(!this['_operationToId']['has'](_0x4e2972)){const _0x472581=_0x57fd7a()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4e2972,_0x472581);}return this['_operationToId']['get'](_0x4e2972);}}}['setIdForTheLastOperation'](_0x5046c8,_0x29b82d){if(!_0x29b82d)return;let _0x42e2c1=_0x5046c8['length'];for(;_0x42e2c1--;){const _0x201fd0=_0x5046c8[_0x42e2c1];this['_ignoredOperations']['has'](_0x201fd0)||this['_operationToId']['set'](_0x201fd0,_0x29b82d);}}}class a extends _0x557c4d{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x5e8b20{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x4370fd)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x53d600];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x108394){super(_0x108394),this['_services']=new Map();}async['init'](){const _0x4cab0a=this['context'],_0x422397=_0x4cab0a['plugins']['get']('CommentsRepository');if(_0x4cab0a['plugins']['get'](n)['addToReconnectionStack'](this),_0x422397['adapter']={'addCommentThread':async({channelId:_0x2e3c6b,threadId:_0x3e1238,comments:_0xf3837d,resolvedAt:_0x53c15d,resolvedBy:_0x45e4bf,context:_0x108f6d,attributes:_0x356428})=>{const _0x50dd29=await this['_getService'](_0x2e3c6b)['addCommentThread']({'commentThreadId':_0x3e1238,'comments':_0xf3837d['map'](_0x5ac4c=>function(_0x48cb05,_0x5adc36,_0x31ad72){return{'commentThreadId':_0x31ad72,'commentId':_0x48cb05['commentId'],'userId':_0x48cb05['authorId'],'content':_0x48cb05['content'],'documentId':_0x5adc36,'createdAt':_0x48cb05['createdAt'],'attributes':_0x48cb05['attributes']||{}};}(_0x5ac4c,_0x2e3c6b,_0x3e1238)),'resolvedAt':_0x53c15d,'resolvedBy':_0x45e4bf,'context':_0x108f6d,'attributes':_0x356428})['catch'](dt);return{'threadId':_0x50dd29['commentThreadId'],'comments':_0x50dd29['comments']};},'getCommentThread':async({channelId:_0x242770,threadId:_0x54e2ce})=>{const _0x9b22c5=await this['_getService'](_0x242770)['getCommentThread'](_0x54e2ce)['catch'](F)['catch'](dt);return _0x9b22c5?_0x9b22c5['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x9b22c5]),{'threadId':_0x9b22c5['commentThreadId'],'comments':_0x9b22c5['comments']['map'](S),'context':_0x9b22c5['context'],'resolvedAt':_0x9b22c5['resolvedAt'],'resolvedBy':_0x9b22c5['resolvedBy'],'attributes':_0x9b22c5['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x284ee6,threadId:_0x520075,context:_0x38e044,unlinkedAt:_0x287bd5,attributes:_0x3558c1})=>this['_getService'](_0x284ee6)['updateCommentThread']({'commentThreadId':_0x520075,'context':_0x38e044,'attributes':_0x3558c1,'unlinkedAt':_0x287bd5})['catch'](F)['catch'](dt),'resolveCommentThread':async({channelId:_0x5417f4,threadId:_0x1f8cff})=>{const _0x2f52cc=await this['_getService'](_0x5417f4)['resolveCommentThread'](_0x1f8cff)['catch'](F)['catch'](dt);return{'threadId':_0x2f52cc['commentThreadId'],'resolvedAt':_0x2f52cc['resolvedAt'],'resolvedBy':_0x2f52cc['resolvedBy']};},'reopenCommentThread':async({channelId:_0x18c089,threadId:_0x1d14b1})=>this['_getService'](_0x18c089)['reopenCommentThread'](_0x1d14b1)['catch'](F)['catch'](dt),'removeCommentThread':({channelId:_0x2cd59c,threadId:_0x46203c})=>this['_getService'](_0x2cd59c)['removeCommentThread'](_0x46203c)['catch'](F)['catch'](dt),'addComment':({channelId:_0x56ef78,threadId:_0x4cec0d,commentId:_0x10dc0b,content:_0xfab8c1,attributes:_0x50edbc})=>this['_getService'](_0x56ef78)['addComment'](_0x4cec0d,_0x10dc0b,_0xfab8c1,_0x50edbc)['catch'](dt),'updateComment':({channelId:_0x4ec7c8,threadId:_0x5a225e,commentId:_0x3faa33,content:_0x52dc42,attributes:_0x4b375c})=>this['_getService'](_0x4ec7c8)['updateComment'](_0x5a225e,_0x3faa33,_0x52dc42,_0x4b375c)['catch'](F)['catch'](dt),'removeComment':({channelId:_0x42d65a,threadId:_0x5e649e,commentId:_0x236c1a})=>this['_getService'](_0x42d65a)['removeComment'](_0x5e649e,_0x236c1a)['catch'](F)['catch'](dt)},_0x4cab0a instanceof _0x1bb59e){const _0x23317c=_0x4cab0a['config']['get']('collaboration.channelId'),_0x5839b2=_0x4cab0a['plugins']['get'](i);await this['_setUpService'](_0x23317c);const _0x4407d0=await this['_services']['get'](_0x23317c)['getConnectedSessions']();this['listenTo'](_0x5839b2,'sessionAdd:'+_0x23317c,(_0x2afb83,{session:_0x595d95})=>{_0x595d95['id']===_0x5839b2['mySessionId']&&(_0x2afb83['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x595d95['permissions'],_0x23317c));}),_0x5839b2['register'](_0x23317c,_0x4407d0);}}async['_setUpService'](_0x489de6){if(this['_services']['has'](_0x489de6))throw new _0x57af79('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x489de6});const _0xde5ab5=this['context']['plugins']['get']('CommentsRepository'),_0x46b07b=new s['CommentsService'](_0x489de6);this['_services']['set'](_0x489de6,_0x46b07b),this['listenTo'](_0x46b07b,'commentThreadAdded',(_0x307802,_0x5d0d32)=>{const {commentThreadId:_0x1adb7b,documentId:_0x18f532,context:_0x420b78,attributes:_0x43fb66,resolvedAt:_0x322cd1,resolvedBy:_0x119a4b,comments:_0x64ba88}=_0x5d0d32;_0xde5ab5['getCommentThread'](_0x1adb7b)||_0xde5ab5['addCommentThread']({'threadId':_0x1adb7b,'channelId':_0x18f532,'comments':_0x64ba88?_0x64ba88['map'](S):[],'context':_0x420b78,'attributes':_0x43fb66,'resolvedAt':_0x322cd1,'resolvedBy':_0x119a4b,'isFromAdapter':!0x0});}),this['listenTo'](_0x46b07b,'commentThreadUpdated',(_0x43b0b5,{commentThreadId:_0x2a900e,documentId:_0x4c2c17,context:_0x858945,unlinkedAt:_0x43d982,attributes:_0x34d944})=>{_0xde5ab5['getCommentThread'](_0x2a900e)&&_0xde5ab5['updateCommentThread']({'threadId':_0x2a900e,'channelId':_0x4c2c17,'context':_0x858945,'unlinkedAt':_0x43d982,'attributes':_0x34d944,'isFromAdapter':!0x0});}),this['listenTo'](_0x46b07b,'commentThreadResolved',(_0x1bddcb,{commentThreadId:_0x5906b5,resolvedBy:_0x48ec53,resolvedAt:_0x3fafb7})=>{const _0x2c2586=_0xde5ab5['getCommentThread'](_0x5906b5);_0x2c2586&&_0x2c2586['resolve']({'resolvedBy':_0x48ec53,'resolvedAt':_0x3fafb7,'isFromAdapter':!0x0});}),this['listenTo'](_0x46b07b,'commentThreadReopened',(_0x19e174,{commentThreadId:_0xf77366})=>{const _0x3f1cc8=_0xde5ab5['getCommentThread'](_0xf77366);_0x3f1cc8&&_0x3f1cc8['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x46b07b,'commentThreadRemoved',(_0x2b008d,{commentThreadId:_0x2e3e4b})=>{const _0x179a9a=_0xde5ab5['getCommentThread'](_0x2e3e4b);_0x179a9a&&_0x179a9a['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x46b07b,'commentAdded',(_0x2df09f,_0x56d4f8)=>{const _0xffd02c=_0x56d4f8['commentThreadId'],_0x395fe9=_0xde5ab5['getCommentThread'](_0xffd02c);_0x395fe9&&_0x395fe9['addComment']({...S(_0x56d4f8),'isFromAdapter':!0x0});}),this['listenTo'](_0x46b07b,'commentUpdated',(_0x373c1c,{commentThreadId:_0x149e8d,commentId:_0x276ef6,content:_0x1e5f5d,attributes:_0x390b0c})=>{const _0x3bc836=_0xde5ab5['getCommentThread'](_0x149e8d);if(_0x3bc836){const _0x4f150d=_0x3bc836['getComment'](_0x276ef6);_0x4f150d&&_0x4f150d['update']({'content':_0x1e5f5d,'attributes':_0x390b0c,'isFromAdapter':!0x0});}}),this['listenTo'](_0x46b07b,'commentRemoved',(_0x1b3e59,{commentThreadId:_0x59a161,commentId:_0x5f2282})=>{const _0x124a92=_0xde5ab5['getCommentThread'](_0x59a161);if(_0x124a92){const _0x590563=_0x124a92['getComment'](_0x5f2282);_0x590563&&_0x590563['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x489de6);}['destroy'](){if(this['context']instanceof _0x1bb59e){const _0x387f98=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x387f98);}}['_terminateService'](_0x20b704){if(!this['_services']['has'](_0x20b704))throw new _0x57af79('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x20b704});this['_getService'](_0x20b704)['disconnect'](),this['_services']['delete'](_0x20b704);}async['reconnect'](){for(const _0x204388 of this['_services']['keys']())await this['_connectService'](_0x204388);if(this['context']instanceof _0x1bb59e){const _0x583226=this['context']['config']['get']('collaboration.channelId'),_0x449da1=this['context']['plugins']['get'](i);_0x449da1['unregister'](_0x583226);const _0x30c466=await this['_services']['get'](_0x583226)['getConnectedSessions']();_0x449da1['register'](_0x583226,_0x30c466);}}async['_connectService'](_0x51552c){const {connection:_0x9c869c}=this['context']['plugins']['get'](n),_0x481ba1=this['context']['plugins']['get']('CommentsRepository'),_0x743c86=this['_services']['get'](_0x51552c),_0xd2f4dd=await _0x743c86['connect'](_0x9c869c);await this['_fetchMissingUsersForThreads'](_0xd2f4dd);const _0x4340b9=new Set(Array['from'](_0x481ba1['getCommentThreads']({'channelId':_0x51552c}),_0xecb070=>_0xecb070['id']));for(const _0x2a3e5d of _0xd2f4dd)_0x2a3e5d['deletedAt']||_0x4340b9['delete'](_0x2a3e5d['commentThreadId']);for(const _0x27eab4 of _0x4340b9)_0x481ba1['getCommentThread'](_0x27eab4)['remove']({'isFromAdapter':!0x0});for(const _0xea151 of _0xd2f4dd){let _0x3f5d0a=_0x481ba1['getCommentThread'](_0xea151['commentThreadId']);const {commentThreadId:_0x11082d,context:_0x25b5fb,attributes:_0x51be7e,resolvedBy:_0x5704ff,resolvedAt:_0x232ee8,unlinkedAt:_0x1737af,deletedAt:_0x513882}=_0xea151;if(_0x513882)continue;_0x3f5d0a||(_0x3f5d0a=_0x481ba1['addCommentThread']({'channelId':_0x51552c,'threadId':_0x11082d,'context':_0x25b5fb,'attributes':_0x51be7e||{},'resolvedBy':_0x5704ff,'resolvedAt':_0x232ee8,'unlinkedAt':_0x1737af,'isFromAdapter':!0x0}));const _0x556520=new Set(Array['from'](_0x3f5d0a['comments'],_0x193dfc=>_0x193dfc['id']));for(const _0x5da6b3 of _0xea151['comments'])_0x556520['delete'](_0x5da6b3['commentId']);for(const _0x435c87 of _0x556520)_0x3f5d0a['getComment'](_0x435c87)['remove']({'isFromAdapter':!0x0});for(const _0x19ce90 of _0xea151['comments']){const _0x8071b2=_0x3f5d0a['getComment'](_0x19ce90['commentId']);_0x8071b2?_0x8071b2['content']!==_0x19ce90['content']&&_0x8071b2['update']({'content':_0x19ce90['content'],'isFromAdapter':!0x0}):_0x3f5d0a['addComment'](Object['assign'](S(_0x19ce90),{'isFromAdapter':!0x0}));}}}['_getService'](_0x706de3){if(!this['_services']['has'](_0x706de3))throw new _0x57af79('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x706de3});return this['_services']['get'](_0x706de3);}async['_fetchMissingUsersForThreads'](_0x66b2e7){const _0x19934b=this['context']['plugins']['get'](_0x53d600),{connection:_0x48f34b}=this['context']['plugins']['get'](n),_0x12ca26=new Set();for(const {resolvedBy:_0x4f08b2,comments:_0x47f155}of _0x66b2e7){_0x4f08b2&&!_0x19934b['getUser'](_0x4f08b2)&&_0x12ca26['add'](_0x4f08b2);for(const {userId:_0x40b80a}of _0x47f155)_0x19934b['getUser'](_0x40b80a)||_0x12ca26['add'](_0x40b80a);}if(0x0===_0x12ca26['size'])return;const _0x964d55=await lt['getMany'](_0x48f34b,Array['from'](_0x12ca26));for(const _0x23593f of _0x964d55)_0x19934b['getUser'](_0x23593f['id'])||_0x19934b['addUser'](_0x23593f);}}async function F(_0xd017d4){if('404'!==_0xd017d4['code'])throw _0xd017d4;}function dt(_0x1ab956){if((_0x256fff=_0x1ab956)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x256fff['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x256fff['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x256fff;throw _0x1ab956;}function S(_0x130253){return{'threadId':_0x130253['commentThreadId'],'commentId':_0x130253['commentId'],'content':_0x130253['content'],'createdAt':_0x130253['createdAt'],'authorId':_0x130253['userId'],'attributes':_0x130253['attributes']||{}};}class m extends _0x557c4d{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x549b7a){super(_0x549b7a);const _0x5f28f1=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x5f28f1);}['init'](){const _0x235270=this['editor']['plugins']['get'](n),_0x2b8acb=this['editor']['plugins']['get']('TrackChangesEditing');return _0x2b8acb['adapter']={'getSuggestion':async _0x27b6b8=>{await this['_waitForServiceReady']();const _0x518fe4=await this['_trackChangesService']['get'](_0x27b6b8)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0x518fe4]),_0x518fe4;},'addSuggestion':async({id:_0x20d79e,type:_0x44251a,data:_0x3d6b0a,originalSuggestionId:_0x4d3cc5,attributes:_0x58a487})=>{await this['_waitForServiceReady']();const _0x3bcff9={'id':_0x20d79e,'type':_0x44251a,'data':_0x3d6b0a,'originalSuggestionId':_0x4d3cc5,'attributes':_0x58a487},_0x1e0453=await this['_trackChangesService']['add'](_0x20d79e,_0x44251a,_0x3d6b0a,_0x4d3cc5,_0x58a487)['catch'](_0x4d6f0=>{if(ut(_0x4d6f0))return new Promise(_0x40c37f=>{this['_bufferedRequests']['set'](_0x20d79e,{'resolve':_0x40c37f,'suggestionData':_0x3bcff9});});throw _0x4d6f0;});return this['_bufferedRequests']['delete'](_0x20d79e),_0x1e0453;},'updateSuggestion':async(_0x2f3f54,_0x1f0f50)=>{if(await this['_waitForServiceReady'](),'open'!==_0x1f0f50['state'])return this['_trackChangesService']['update'](_0x2f3f54,_0x1f0f50)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x3efa64,_0x4f1f4a)=>{_0x2b8acb['hasSuggestion'](_0x4f1f4a['id'])&&(_0x2b8acb['getSuggestion'](_0x4f1f4a['id'])['attributes']=_0x4f1f4a['attributes']);}),this['_trackChangesService']['connect'](_0x235270['connection'])['then'](_0x1ccd21=>(_0x235270['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1ccd21)['then'](()=>{for(const _0x109680 of _0x1ccd21){_0x2b8acb['addSuggestionData'](_0x109680)['_saved']=!0x0;}})));}async['reconnect'](){const _0x2247de=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x3db83e}=this['editor']['plugins']['get'](n),_0x386d24=await this['_trackChangesService']['connect'](_0x3db83e);await this['_fetchMissingUsersForThreads'](_0x386d24);for(const {suggestionData:_0x515867,resolve:_0x28a8b4}of this['_bufferedRequests']['values']()){let _0x33795c=_0x386d24['find'](_0x2dce36=>_0x2dce36['id']===_0x515867['id']);_0x33795c||(_0x33795c=await this['_trackChangesService']['add'](_0x515867['id'],_0x515867['type'],_0x515867['data'],_0x515867['originalSuggestionId'])),_0x28a8b4(_0x33795c);}for(const _0x510931 of _0x386d24)_0x2247de['hasSuggestion'](_0x510931['id'])||_0x2247de['addSuggestionData'](_0x510931);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1b98fb=>{this['listenTo'](this['_trackChangesService'],'connected',_0x204362=>{_0x204362['off'](),_0x1b98fb();});});}async['_fetchMissingUsersForThreads'](_0x284dac){const _0x11e7be=this['editor']['plugins']['get'](_0x53d600),{connection:_0x238df8}=this['editor']['plugins']['get'](n),_0x2bf1dd=new Set();for(const {authorId:_0x1333ad}of _0x284dac)_0x11e7be['getUser'](_0x1333ad)||_0x2bf1dd['add'](_0x1333ad);if(0x0===_0x2bf1dd['size'])return;const _0x1d5fa9=await lt['getMany'](_0x238df8,Array['from'](_0x2bf1dd));for(const _0x92defb of _0x1d5fa9)_0x11e7be['getUser'](_0x92defb['id'])||_0x11e7be['addUser'](_0x92defb);}}function k(_0x184ee5){if(ut(_0x184ee5))return new Promise(()=>{});throw _0x184ee5;}function ut(_0x8ccc60){return _0x8ccc60['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x8ccc60['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x557c4d{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4d7cbe=this['editor']['plugins']['get'](n),_0x2ba59e=this['editor']['plugins']['get']('CommentsEditing'),_0x47fb71=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x4d7cbe,'change:state',(_0x49eecb,_0x1e8c7d,_0x5a7bb7)=>{_0x2ba59e['isThreadsLoadingPaused']='connected'!==_0x5a7bb7;});}),this['listenTo'](_0x4d7cbe,'change:state',(_0x32255c,_0x1d0bdd,_0x5d379b)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x5d379b);}),_0x47fb71['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0x557c4d{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x557c4d{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>st)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x53d600];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x307f5e){super(_0x307f5e);const _0x4aa44f=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x4aa44f);}async['init'](){const _0x237871=this['editor']['plugins']['get'](l),_0x544d8b=_0x237871['serverHistory'],_0x7dee53=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x544d8b,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x237871['sessionId']});const _0x415878=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x19cc0d=await it['isBundleUploaded'](_0x7dee53['connection'],_0x415878);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x2c10e7})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x2c10e7)),'updateRevisions':async _0x37803a=>{await this['_waitForServiceReady']();const _0x5ad153=this['_revisionTracker']['currentRevision'];if(_0x19cc0d&&0x1===_0x37803a['length']&&_0x37803a[0x0]['id']===_0x5ad153['id'])return _0x37803a;for(const _0x42fd0d of _0x37803a)_0x42fd0d['id']===_0x5ad153['id']&&(_0x42fd0d['isEmptyCurrent']=_0x42fd0d['fromVersion']===_0x42fd0d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x37803a,this['_lastRequestId'])['then'](_0x1ed6ff=>(this['_lastRequestId']=_0x1ed6ff,_0x37803a))['catch'](_0x5b654c=>{if(et(_0x5b654c)||'400'===_0x5b654c['code']&&void 0x0!==_0x5b654c['data']['wrongRequestId']){for(const _0x412043 of _0x37803a){!this['_revisionTracker']['repository']['getRevision'](_0x412043['id'])||this['_revisionTracker']['_bufferUpdate'](_0x412043['id'],_0x412043,!0x1);}if(et(_0x5b654c))throw _0x5b654c;return _0x37803a;}throw _0x5b654c;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4f2aeb,{revisionsData:_0x24a64e,requestId:_0x32a543})=>{Math['max'](..._0x24a64e['map'](_0xfaba27=>_0xfaba27['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x24a64e,_0x32a543);}):this['_handleRevisionsUpdate'](_0x24a64e,_0x32a543);});const {revisions:_0x3e535f,requestId:_0x212c9d}=await this['_revisionHistoryService']['connect'](_0x7dee53['connection']);_0x7dee53['addToReconnectionStack'](this),this['_lastRequestId']=_0x212c9d,await this['_fetchMissingUsers'](_0x3e535f);for(const _0x351f47 of _0x3e535f)this['_revisionTracker']['addRevisionData'](_0x351f47);this['listenTo'](_0x237871,'change:_isConnected',(_0x134823,_0x153b44,_0x3f32be)=>{_0x3f32be&&(this['_oldOffset']=_0x237871['_offset'],_0x134823['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x7dee53,'state',_0x21fc73=>_0x21fc73===te['CONNECTED']);}async['reconnect'](){const _0x414886=this['editor']['plugins']['get'](n),_0xa0c909=this['editor']['plugins']['get'](l),_0x37bec2=async()=>{const _0x17d163=this['_revisionTracker']['currentRevision'],_0x43afc6=_0x17d163['id'],_0x568634=_0x43afc6!==_0xa0c909['sessionId'];if(_0x568634){const _0x1928dc=_0xa0c909['_offset']-this['_oldOffset'],_0x2a2f8c=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x17d163['toVersion']+_0x1928dc!==_0x2a2f8c){const _0x53c361=_0x17d163['fromVersion']+_0x1928dc,_0x5dc4a5=this['editor']['plugins']['get'](_0x53d600),_0xb0a7b=this['_revisionTracker']['buildRevisionData']({'revision':_0x17d163,'from':_0x53c361,'to':_0x2a2f8c});_0xb0a7b['id']=_0x17d163['id'];const _0x105b05=_0xb0a7b['authorsIds']['map'](_0x4d2ee1=>_0x5dc4a5['getUser'](_0x4d2ee1));_0x17d163['_update']({..._0xb0a7b,'authors':_0x105b05},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x17d163['id'],_0xb0a7b,!0x0);}this['_revisionTracker']['_startingVersion']=_0x2a2f8c,(_0x17d163['toVersion']===_0x17d163['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x43afc6)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x43afc6),this['_revisionTracker']['_createCurrentRevision'](_0x2a2f8c));}const {revisions:_0x218fc3,requestId:_0x20a032}=await this['_revisionHistoryService']['reconnect'](_0x414886['connection'],this['_lastRequestId']);_0x568634&&_0x218fc3['length']>0x0?_0xa0c909['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x218fc3),this['_handleRevisionsUpdate'](_0x218fc3,_0x20a032),this['_revisionTracker']['sendBufferedUpdates']());};return _0xa0c909['_isConnected']?_0x37bec2():new Promise((_0x387496,_0x3f8b65)=>{_0xa0c909['once']('change:_isConnected',()=>{_0x37bec2()['then'](_0x387496)['catch'](_0x3f8b65);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x33868f=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x560149=>{_0x560149['off'](),_0x33868f();});});}['_getLatestVersionFromServerOperations'](){const _0x29d7ab=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x565226 of _0x29d7ab)if('marker'!==_0x565226['type']||_0x565226['affectsData'])return _0x565226['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1da384=this['editor']['plugins']['get'](l);return new Promise(_0x3dafb9=>{_0x1da384['_isPendingUpdate']?_0x1da384['once']('change:_isPendingUpdate',()=>{_0x3dafb9(this['_getLatestVersionFromServerOperations']());}):_0x3dafb9(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3d5438,_0x39c9b8){const _0x153767=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x39c9b8;for(const _0x28b6b1 of _0x3d5438){const _0x27ec0b=_0x153767['getRevision'](_0x28b6b1['id']);if(_0x27ec0b){if((_0x28b6b1['fromVersion']||_0x28b6b1['toVersion'])&&(_0x28b6b1['diffData']=null),_0x27ec0b===this['_revisionTracker']['currentRevision']){const _0x20206c=Math['max'](_0x27ec0b['toVersion'],_0x28b6b1['toVersion']),_0x4de40d=Math['max'](_0x27ec0b['fromVersion'],_0x28b6b1['fromVersion']);let _0x27616a;_0x27ec0b['toVersion']===_0x28b6b1['toVersion']&&_0x27ec0b['fromVersion']===_0x28b6b1['fromVersion']?(_0x27616a=!0x0,this['_preventResendingRevisionData'](_0x28b6b1)):_0x28b6b1['toVersion']===_0x20206c&&_0x28b6b1['fromVersion']===_0x4de40d?_0x27616a=!0x1:(_0x27ec0b['toVersion']===_0x20206c&&_0x27ec0b['fromVersion']===_0x4de40d||this['_fixRevision']({'revision':_0x27ec0b,'from':_0x4de40d,'to':_0x20206c}),_0x27616a=!0x0),_0x27616a&&(delete _0x28b6b1['fromVersion'],delete _0x28b6b1['toVersion'],delete _0x28b6b1['diffData'],delete _0x28b6b1['createdAt'],delete _0x28b6b1['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x28b6b1),this['_preventResendingRevisionData'](_0x28b6b1);}else this['_revisionTracker']['addRevisionData'](_0x28b6b1);}const _0x4ce330=_0x153767['getRevisions']();_0x4ce330['reverse']();for(let _0x627c40=0x0;_0x627c40<_0x4ce330['length']-0x1;_0x627c40++){const _0x44b821=_0x4ce330[_0x627c40],_0x2e4e86=_0x4ce330[_0x627c40+0x1];if(_0x44b821['fromVersion']<_0x2e4e86['toVersion']){const _0x4794f0=_0x2e4e86['toVersion'],_0x4fc38b=Math['max'](_0x4794f0,_0x44b821['toVersion']);this['_fixRevision']({'revision':_0x44b821,'from':_0x4794f0,'to':_0x4fc38b});}}}['_fixRevision']({revision:_0x41e859,from:_0x5ed25e,to:_0x4606b0}={}){const _0x5c8a1f=this['editor']['plugins']['get'](_0x53d600),_0xafd8bc=this['_revisionTracker']['buildRevisionData']({'revision':_0x41e859,'from':_0x5ed25e,'to':_0x4606b0});_0xafd8bc['authors']=_0xafd8bc['authorsIds']['map'](_0x5aa9d8=>_0x5c8a1f['getUser'](_0x5aa9d8)),_0x41e859['_update'](_0xafd8bc);}['_preventResendingRevisionData'](_0x5e55f8){const _0x5abe3b={};_0x5abe3b['id']=_0x5e55f8['id'];for(const _0x11f6c6 of Object['keys'](_0x5e55f8))'id'!==_0x11f6c6&&(_0x5abe3b[_0x11f6c6]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5abe3b['id'],_0x5abe3b,!0x0);}async['_fetchMissingUsers'](_0x20182a){const _0x5d5930=this['editor']['plugins']['get'](_0x53d600),{connection:_0x59b884}=this['editor']['plugins']['get'](n),_0x159d22=new Set();for(const _0x2caefc of _0x20182a){for(const _0x328d26 of _0x2caefc['authorsIds'])_0x4a7578(_0x328d26);_0x2caefc['creatorId']&&_0x4a7578(_0x2caefc['creatorId']);}if(0x0===_0x159d22['size'])return;const _0x22669f=await lt['getMany'](_0x59b884,Array['from'](_0x159d22));for(const _0x1cb545 of _0x22669f)_0x5d5930['getUser'](_0x1cb545['id'])||_0x5d5930['addUser'](_0x1cb545);function _0x4a7578(_0x261a65){_0x5d5930['getUser'](_0x261a65)||_0x159d22['add'](_0x261a65);}}}function et(_0x11a36b){return _0x11a36b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x11a36b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x11a36b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x557c4d{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x1bd8e4{['_collapseAt'];constructor(_0x5c4953,_0x66c5ae=0x6){super(_0x5c4953);const _0x92eecd=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x66c5ae,this['bind']('isHidden')['to'](this,'usersCount',_0x626e34=>_0x626e34<_0x66c5ae),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x92eecd['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':_0x92eecd['to']('usersCount',_0x74073d=>'+'+(_0x74073d-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x1bd8e4{['items'];['keystrokes'];constructor(_0xbe9697){super(_0xbe9697);const _0x42a50f=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x422e84(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x42a50f['if']('hasPopup'),'aria-expanded':_0x42a50f['to']('isExpanded',_0x58c8ef=>this['hasPopup']&&String(_0x58c8ef)),'aria-label':_0x42a50f['to']('hasPopup',_0x4b08e6=>V(_0xbe9697,_0x4b08e6?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x42a50f['to']('hasPopup',_0x4813a4=>!!_0x4813a4&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x42a50f['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x42a50f['to'](_0x6ed6bf=>{const _0x547f1e=_0x6ed6bf,_0x6276d6=document['querySelector']('.ck-presence-list__dropdown-list'),_0x33c20b=document['querySelector']('.ck-balloon-panel_with-arrow');_0x6276d6?.['contains'](_0x547f1e['relatedTarget'])||_0x33c20b?.['contains'](_0x547f1e['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x254b78,_0x10792f,_0x53c57c)=>{this['element']&&(_0x53c57c?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x1bd8e4{['counterView'];['inlineListView'];constructor(_0x227ecd,_0x594a91=0x6){super(_0x227ecd);const _0x4ff5c4=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x594a91),this['inlineListView']=new is(_0x227ecd),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0xbd93c8 of this['inlineListView']['items'])_0xbd93c8['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',_0x4ff5c4['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x1bd8e4{['listWrapperView'];constructor(_0xf645b7,_0x3b548e){super(_0xf645b7);const _0x499532=this['bindTemplate'];this['listWrapperView']=new pt(_0xf645b7,_0x3b548e),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0xf645b7,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x499532['to'](_0x5168cd=>{const _0x5360eb=_0x5168cd,_0x1a2e04=document['querySelector']('.ck-presence-list__list'),_0x4cfd83=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1a2e04?.['contains'](_0x5360eb['relatedTarget'])||_0x4cfd83?.['contains'](_0x5360eb['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x472541{constructor(_0x2511d6,_0x338538){super(_0x2511d6);const _0x41cc6b=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x338538?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x41cc6b['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x41cc6b['to']('role'),'aria-label':_0x41cc6b['to']('ariaLabel'),'aria-labelledby':_0x41cc6b['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xc2e3cd['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x215255=this['element'];_0x215255&&(this['_isScrollable']=Math['max'](_0x215255['scrollHeight'],_0x215255['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x389aa1,_0x528c82,_0x327f78){super(_0x389aa1);const _0x509296=this['bindTemplate'];this['userView']=new ct(_0x389aa1,_0x528c82);const _0x5109ea={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x528c82['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x528c82['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x528c82['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x327f78&&(_0x5109ea['tag']='button',_0x5109ea['on']={'click':_0x509296['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5109ea);}['focus'](){this['element']['focus']();}}class A extends _0x1bd8e4{['userView'];['markerView'];constructor(_0x32ff65,_0x4c7d5b,_0x1fa154){super(_0x32ff65);const _0x4c078e=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x32ff65,_0x4c7d5b),this['markerView']=new at(_0x32ff65,_0x4c7d5b);const _0xda20ee=new ot(_0x32ff65);_0xda20ee['template']['tag']='span',_0xda20ee['text']=_0x4c7d5b['name'];const _0x4fe7d5={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x4c078e['to']('isFocusable',_0x884ade=>!!_0x884ade&&0x0),'aria-labelledby':_0xda20ee['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x4c078e['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x4c078e['to']('hasTooltip',_0x3407b0=>!_0x3407b0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0xda20ee]};_0x1fa154&&(_0x4fe7d5['tag']='button',_0x4fe7d5['on']={'click':_0x4c078e['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4fe7d5);}}class at extends _0x1bd8e4{constructor(_0xb9c71e,_0x1f0eaf){super(_0xb9c71e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1f0eaf['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x5e8b20{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x16100c){super(_0x16100c),this['context']['config']['define']('presenceList',x);const _0xbe6bca=_0x16100c['config']['get']('presenceList.collapseAt');if('number'!=typeof _0xbe6bca)throw new _0x57af79('presencelist-collapseat-invalid-format',this);if(_0xbe6bca<0x1)throw new _0x57af79('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x24e80c(),this['balloonPanelView']=new _0x251752(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x5d874e of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5d874e);this['listenTo'](this['_allConnectedUsers'],'add',(_0x2693af,_0x4176a7)=>{this['_handleUserAdd'](_0x4176a7);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2eeb2c,_0x2fceb8)=>{this['_handleUserRemove'](_0x2fceb8);});}['_createView'](){const _0x2eee23=this['context'],_0x4dbcdf=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xee2fbd=this['balloonPanelView'];if(!_0x285777(_0x2eee23['config']['get']('presenceList.container')))throw new _0x57af79('presencelist-missing-container',this);return _0x4dbcdf['counterView']['bind']('usersCount')['to'](this),_0x4dbcdf['bind']('isCollapsed')['to'](this,'usersCount',_0x194299=>{const {collapseAt:_0xab66ab}=_0x2eee23['config']['get']('presenceList'),_0x3da8c1=_0x194299>=_0xab66ab;if(_0x3da8c1&&!_0x4dbcdf['inlineListView']['items']['find'](_0x35fcdf=>_0x35fcdf instanceof b)){const _0x1f32c7=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x1f32c7&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x4dbcdf['inlineListView']['items']['add'](_0x4dbcdf['counterView']);}return _0x3da8c1||this['hideDropdown'](),_0x3da8c1;}),_0x4dbcdf['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x518f71=>{const _0x1a9d8f=_0x2eee23['config']['get']('presenceList'),_0x5e1d86=new A(_0x2eee23['locale'],_0x518f71,!!_0x1a9d8f['onClick']);return _0x5e1d86['bind']('hasTooltip')['to'](_0x4dbcdf,'isCollapsed',_0x2bd2aa=>!_0x2bd2aa),_0x5e1d86['bind']('isFocusable')['to'](_0x4dbcdf,'isCollapsed',_0x4ec49a=>!_0x4ec49a),_0x1a9d8f['onClick']&&this['listenTo'](_0x5e1d86,'execute',()=>{this['view']['isCollapsed']||_0x1a9d8f['onClick'](_0x518f71,_0x5e1d86['element']);}),_0x5e1d86;}),this['listenTo'](_0x4dbcdf['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x4dbcdf['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x4dbcdf['inlineListView']['keystrokes']['set']('Enter',(_0x351ff7,_0x3691d1)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3691d1());}),_0x4dbcdf['render'](),_0xee2fbd['render'](),_0x3bb7ab({'emitter':_0x4dbcdf,'activator':()=>_0xee2fbd['isVisible'],'contextElements':[_0xee2fbd['element'],_0x4dbcdf['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x2eee23['config']['get']('presenceList.container')['appendChild'](_0x4dbcdf['element']),this['_bodyCollection']=new _0x18e462(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x4dbcdf;}['_handleUserAdd'](_0x58edd5){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x58edd5['isMe'])return;const _0x21131a=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x21131a-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x1fe5a9=_0x58edd5['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x58edd5,_0x1fe5a9);}['_handleUserRemove'](_0x30bcda){this['usersCount']--;const {collapseAt:_0x157771}=this['context']['config']['get']('presenceList'),_0x327e36=this['usersCount']>=_0x157771;if(this['currentDisplayedUsers']['get'](_0x30bcda['id']))this['currentDisplayedUsers']['remove'](_0x30bcda['id']);else{if(_0x327e36&&this['currentDisplayedUsers']['length']+0x1===_0x157771-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x327e36?0x1:0x0)<this['usersCount']){for(const _0x124148 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x124148['id'])&&(this['currentDisplayedUsers']['add'](_0x124148,Math['min'](this['currentDisplayedUsers']['length']-(_0x327e36?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x327e36?0x1:0x0)===_0x157771-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x2125b4=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x2125b4['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x54d778}=this['presenceDropdownView'];_0x54d778['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x1fd7aa=>{if(!_0x2125b4['displayMe']&&_0x1fd7aa['isMe'])return null;const _0x556591=new j(this['context']['locale'],_0x1fd7aa,!!_0x2125b4['onClick']);return _0x2125b4['onClick']&&this['listenTo'](_0x556591,'execute',()=>{_0x2125b4['onClick'](_0x1fd7aa,_0x556591['element']);}),_0x556591;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x54d778['focus'](),_0x54d778['checkIfScrollable']();const _0x2815e3=(_0x38c345,_0xf176f3)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0xf176f3();};_0x54d778['keystrokes']['set']('Esc',_0x2815e3),_0x54d778['keystrokes']['set']('Shift+Tab',_0x2815e3),_0x54d778['keystrokes']['set']('Tab',(_0x11b8d9,_0x314a34)=>{!function(_0x37bca7){const _0x3111ed=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x21ec8a=>_0x21ec8a+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2a6ab7=[...document['body']['querySelectorAll'](_0x3111ed)]['filter'](_0x20cf78=>_0x20cf78===document['activeElement']||_0x20cf78['offsetWidth']+_0x20cf78['offsetHeight']>0x0)['sort']((_0x12434,_0x1b9ae1)=>(_0x12434['tabIndex']||0x0)-(_0x1b9ae1['tabIndex']||0x0)),_0xb39c9=_0x2a6ab7['indexOf'](_0x37bca7),_0x463791=_0x2a6ab7[(_0xb39c9+0x1)%_0x2a6ab7['length']];_0x463791&&_0x463791['focus']();}(this['view']['element']),this['hideDropdown'](),_0x314a34();}),_0x54d778['focusTracker']['add'](this['view']['element']),_0x54d778['focusTracker']['on']('change:isFocused',(_0x16d17b,_0x319918,_0x59de9d)=>{_0x59de9d||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class gt extends _0x5e8b20{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0xfd8900,Plugin as _0x30d29d,PendingActions as _0x2cbdaa,Context as _0x47a3c5}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x5278b2,CKEditorError as _0x1b0251,Collection as _0x51237b,global as _0x2b0da0,version as nt,uid as _0x2e65e8,KeystrokeHandler as _0xc8fed7}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x2d9d9d,View as _0x15eed3,ListView as _0x3f1de7,ListItemView as et,LabelView as it,BalloonPanelView as _0x212cdd,clickOutsideHandler as _0x545d85,BodyCollection as _0x4f1761}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x221838,History as _0x376331,NoOperation as _0x290d45,InsertOperation as _0xd00a9d,MarkerOperation as _0x151573,RootAttributeOperation as _0x12fae1,transformOperationSets as _0x1f0beb,OperationFactory as _0x2d25b5}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ot,WEB_SOCKET_GATEWAY_STATES as _0x3e236f,CollaborativeEditingService as _0x1992e4,User as rt,CommentsService as _0x3bed14,TrackChangesService as tt,RevisionHistoryService as _0x1946f6,EditorService as _0x107a0a}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1d3547,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x354552}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3a41f3}from'es-toolkit/compat';class n extends _0xfd8900{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ot)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x2d9d9d];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x6567d0){super(_0x6567d0),this['set']('state',_0x3e236f['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x5278b2())();}['init'](){const _0x20d725=this['context'],_0x1aea49=_0x20d725['plugins']['get']('CloudServices'),_0x18df6a=_0x20d725['plugins']['get'](_0x2d9d9d);if(!_0x1aea49['token'])throw new _0x1b0251('websocketgateway-missing-token',this);if(!_0x1aea49['webSocketUrl'])throw new _0x1b0251('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x1aea49['token'],_0x1aea49['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3b332c=>{if(this['connection']=_0x3b332c,this['bind']('state')['to'](_0x3b332c,'state',this,'_isBrowserOffline',(_0x43e0cd,_0x1fb412)=>('connected'!==_0x43e0cd&&(this['_shouldPluginsReconnect']=!0x0),_0x1fb412||_0x43e0cd!==_0x3e236f['CONNECTED']?_0x3e236f['DISCONNECTED']:this['state']==_0x3e236f['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3e236f['CONNECTING']):_0x3e236f['CONNECTED'])),this['connection']['on']('error',(_0xca1825,_0x523874)=>{if('limitExceeded'!==_0x523874['code'])throw console['error'](_0x523874),new _0x1b0251('cloudservices-init',null,{'originalError':_0x523874});_0x18df6a['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'});}),!_0x3b332c['me'])return new Promise(_0x6d6801=>_0x3b332c['on']('change:me',_0x6d6801));})['catch'](_0x4b23e5=>{throw console['error'](_0x4b23e5),new _0x1b0251('cloudservices-init',null,{'originalError':_0x4b23e5});});}['addToReconnectionStack'](_0x100763){if('function'!=typeof _0x100763['reconnect'])throw new _0x1b0251('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x100763))throw new _0x1b0251('websocketgateway-plugin-already-registered',this,{'name':_0x100763['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x100763);}['removeFromReconnectionStack'](_0x990d6){this['_reconnectionStack']['delete'](_0x990d6);}['isInReconnectionStack'](_0x55036c){return this['_reconnectionStack']['has'](_0x55036c);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x17f7cc=>_0x17f7cc['reconnect']())))['then'](()=>this['state']=_0x3e236f['CONNECTED'])['catch'](_0x5f46ce=>{throw console['error'](_0x5f46ce),new _0x1b0251('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3e236f['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0xfd8900{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x1d3547];}constructor(_0x312b81){super(_0x312b81),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x51237b(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d3547);}['init'](){const _0x28b9eb=this['context']['plugins']['get'](n);this['listenTo'](_0x28b9eb,'change:state',(_0x371feb,_0x4c8078,_0x2f7e77)=>{if('connected'!==_0x2f7e77)this['channelSessions']['forEach'](_0x5a7ed1=>_0x5a7ed1['clear']()),this['channelConnectedUsers']['forEach'](_0x5eb883=>_0x5eb883['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x110c19,_0x460b88]of this['_registeredSessions'])for(const _0x222ff8 of _0x460b88)this['_handleSessionAdd'](_0x110c19,_0x222ff8);}}),this['_createUser'](_0x28b9eb['connection']['me'],!0x0);}['register'](_0x27cd96,_0x50ce92){if(this['_registeredSessions']['has'](_0x27cd96))throw new _0x1b0251('sessions-register-already-registered',null,{'channelId':_0x27cd96});this['_registeredSessions']['set'](_0x27cd96,_0x50ce92),this['channelSessions']['set'](_0x27cd96,new _0x51237b()),this['channelConnectedUsers']['set'](_0x27cd96,new _0x51237b()),this['listenTo'](_0x50ce92,'add',(_0x544903,_0x4e60c0)=>this['_handleSessionAdd'](_0x27cd96,_0x4e60c0)),this['listenTo'](_0x50ce92,'remove',(_0x4bc755,_0x4be552)=>this['_handleSessionRemove'](_0x27cd96,_0x4be552));for(const _0x533c64 of _0x50ce92)this['_handleSessionAdd'](_0x27cd96,_0x533c64);}['unregister'](_0x182601){if(!this['_registeredSessions']['has'](_0x182601))throw new _0x1b0251('sessions-unregister-not-exist',null,{'channelId':_0x182601});const _0x39e9e9=this['_registeredSessions']['get'](_0x182601);this['stopListening'](_0x39e9e9);for(const _0x7ea4dd of _0x39e9e9)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x182601,_0x7ea4dd);this['_registeredSessions']['delete'](_0x182601),this['channelSessions']['delete'](_0x182601),this['channelConnectedUsers']['delete'](_0x182601);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x436209){for(const _0x33bfdf of this['channelSessions']['values']())for(const _0x3263ad of _0x33bfdf)if(_0x3263ad['id']===_0x436209)return _0x3263ad['user'];}['getUserSessions'](_0x1ad67e,_0x4ad84a){const _0x4add06=_0x4ad84a?[this['channelSessions']['get'](_0x4ad84a)]:this['channelSessions']['values'](),_0x306f02=new Set();for(const _0x7ddbed of _0x4add06)for(const _0x588b28 of _0x7ddbed)_0x588b28['user']['id']===_0x1ad67e['id']&&_0x306f02['add'](_0x588b28['id']);return _0x306f02;}['getUserRole'](_0x3bedc1){for(const _0x2cd92e of this['channelSessions']['values']())for(const _0x4376 of _0x2cd92e)if(_0x4376['user']===_0x3bedc1)return _0x4376['role'];}['_handleSessionAdd'](_0x52beea,_0x3c1bcd){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x552a1c=_0x3c1bcd['user'],_0x5c7368=this['_users']['getUser'](_0x552a1c['id'])||this['_createUser'](_0x552a1c),_0x102cc1=Object['assign']({},_0x3c1bcd,{'user':_0x5c7368});if(this['channelSessions']['get'](_0x52beea)['add'](_0x102cc1),!_0x552a1c['hiddenInPresenceList']){const _0x308bae=this['channelConnectedUsers']['get'](_0x52beea);_0x308bae['has'](_0x5c7368['id'])||_0x308bae['add'](_0x5c7368),this['allConnectedUsers']['has'](_0x5c7368['id'])||_0x552a1c['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x5c7368,_0x5c7368['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x52beea,{'channelId':_0x52beea,'session':_0x102cc1});}['_handleSessionRemove'](_0x47614e,_0x32bf1a){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x4d3f45=this['channelConnectedUsers']['get'](_0x47614e),_0x2634fd=_0x32bf1a['user'];_0x2634fd['id']&&(this['channelSessions']['get'](_0x47614e)['remove'](_0x32bf1a['id']),_0x4d3f45['has'](_0x2634fd['id'])&&!this['getUserSessions'](_0x2634fd,_0x47614e)['size']&&_0x4d3f45['remove'](_0x2634fd['id']),this['allConnectedUsers']['get'](_0x2634fd['id'])&&!this['getUserSessions'](_0x2634fd)['size']&&this['allConnectedUsers']['remove'](_0x2634fd['id']));}['_createUser'](_0x32bd9f,_0x5632e9){const _0x3754e4=this['_users']['addUser'](_0x32bd9f);return _0x5632e9&&this['_users']['defineMe'](_0x32bd9f['id']),_0x3754e4['orderNumber']=this['_uniqueUsersCount']++,_0x3754e4;}}class G extends _0x30d29d{['_domEmitter']=new(_0x5278b2())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1f5088=this['editor'],_0x5de332=_0x1f5088['plugins']['get'](i);_0x1f5088['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x54bc48,{writer:_0x241052})=>function(_0x148d5f,_0x5c06bc,_0x5ed2f5,_0x295f68){const _0x4ac57d=_0x148d5f['markerName']['split'](':')[0x2],_0x337ea6=_0x5ed2f5['getUserBySessionId'](_0x4ac57d);if(!_0x337ea6||_0x4ac57d===_0x5ed2f5['mySessionId'])return;if(!_0x295f68['model']['schema']['checkChild'](_0x148d5f['markerRange']['start'],'$text'))return;const _0x26b996={'class':'ck-user__marker\x20'+_0x337ea6['color']['getMarkerClass'](),'data-name':_0x337ea6['name'],'data-session-id':_0x4ac57d},_0x1c7bde=_0x295f68['model']['markers']['get'](_0x148d5f['markerName']),_0x3a6f5e=_0x1c7bde['getStart'](),_0x394848=_0x3a6f5e['nodeAfter'],_0x410b91=_0x295f68['model']['schema'];if(_0x394848&&_0x410b91['isObject'](_0x394848)&&_0x410b91['isInline'](_0x394848)&&!_0x295f68['model']['markers']['get']('user:range:'+_0x4ac57d)['getRange']()['isCollapsed'])return;const _0x1333a3=_0x3a6f5e['parent'];return _0x295f68['model']['schema']['isLimit'](_0x1333a3)&&!_0x295f68['model']['hasContent'](_0x1333a3)&&(_0x26b996['contenteditable']=!0x1),function(_0x34e858,_0x5e3217,_0x5aa3c6){const _0xac9e54=_0x34e858['createUIElement']('span',_0x5e3217);return _0x34e858['setCustomProperty']('userPositionMarker',!0x0,_0xac9e54),_0xac9e54['render']=function(_0xcf000d){const _0x2c7c9b=this['toDomElement'](_0xcf000d),_0x279fbb=document['createElement']('span');return _0x279fbb['classList']['add']('ck-user__marker-tooltip'),_0x279fbb['setAttribute']('contenteditable','false'),_0x279fbb['setAttribute']('spellcheck','false'),_0x279fbb['textContent']=_0x5aa3c6['name'],_0x2c7c9b['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x279fbb['outerHTML']+'⁠',_0x2c7c9b['addEventListener']('mouseenter',()=>{_0x2c7c9b['classList']['add']('ck-user__marker_hovered');}),_0x2c7c9b['addEventListener']('mouseleave',()=>{_0x2c7c9b['classList']['remove']('ck-user__marker_hovered');}),_0x2c7c9b;},_0xac9e54['isSimilar']=function(_0x40ef56){return!(!this['getCustomProperty']('userPositionMarker')||!_0x40ef56['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x40ef56['getAttribute']('data-session-id'));},_0xac9e54;}(_0x5c06bc,_0x26b996,_0x337ea6);}(_0x54bc48,_0x241052,_0x5de332,_0x1f5088)}),_0x1f5088['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x8bc35=>function(_0x40edef,_0x2730e3){const _0x5206b7=_0x40edef['markerName']['split'](':')[0x2];if(_0x5206b7===_0x2730e3['mySessionId'])return null;const _0x13e8c9=_0x2730e3['getUserBySessionId'](_0x5206b7);if(!_0x13e8c9)return{'id':_0x5206b7,'classes':[]};return{'id':_0x5206b7,'classes':['ck-user__selection',_0x13e8c9['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x5206b7},'priority':0x7d0+_0x13e8c9['orderNumber']};}(_0x8bc35,_0x5de332)}),function(_0x597067){const _0x5f5677=_0x597067['model'],_0x8f9bc5=new Map(),_0x170d96=_0x597067['plugins']['get'](i);_0x5f5677['markers']['on']('update:user:range',(_0x5b0302,_0x345821,_0x190c00,_0xef95c5)=>{if(!_0xef95c5&&_0x8f9bc5['get'](_0x345821['name']))return _0x8f9bc5['get'](_0x345821['name'])['detach'](),void _0x8f9bc5['delete'](_0x345821['name']);const _0x4f88b8=_0x345821['name']['split'](':')[0x2];if(_0x4f88b8===_0x170d96['mySessionId'])return;const _0x219095='user:position:'+_0x4f88b8;_0x5f5677['markers']['has'](_0x219095)&&_0x597067['editing']['reconvertMarker'](_0x219095),_0x345821['on']('change:range',(_0x25d341,_0x2d973b,_0x32ccce)=>{if('$graveyard'!=_0x2d973b['root']['rootName']&&'$graveyard'==_0x345821['getRange']()['root']['rootName']&&!_0x8f9bc5['has'](_0x345821['name'])){const _0x448ef0=_0x5f5677['schema']['getNearestSelectionRange'](_0x32ccce['deletionPosition']);if(_0x448ef0){const _0x484a84=_0x221838['fromRange'](_0x448ef0);_0x8f9bc5['set'](_0x345821['name'],_0x484a84),_0x484a84['on']('change:range',(_0x560d03,_0x479116,_0x32be4a)=>{if('$graveyard'==_0x484a84['root']['rootName']){const _0x97f43=_0x5f5677['schema']['getNearestSelectionRange'](_0x32be4a['deletionPosition']);_0x97f43?(_0x484a84['start']=_0x97f43['start'],_0x484a84['end']=_0x97f43['end']):(_0x8f9bc5['delete'](_0x345821['name']),_0x484a84['detach']());}});}}});}),_0x5f5677['document']['on']('change',()=>{_0x8f9bc5['size']>0x0&&_0x5f5677['enqueueChange']({'isUndoable':!0x1},_0xa73fad=>{for(const [_0x3efe0a,_0x1da1c7]of _0x8f9bc5)'$graveyard'==_0x5f5677['markers']['get'](_0x3efe0a)['getRange']()['root']['rootName']&&(re(_0x3efe0a['split'](':')[0x2],_0x1da1c7['toRange'](),_0x5f5677,_0xa73fad),_0x1da1c7['detach']());_0x8f9bc5['clear']();});});}(_0x1f5088),this['_domEmitter']['listenTo'](_0x2b0da0['document'],'keydown',(_0x461006,{key:_0x1f4240})=>{'Escape'===_0x1f4240&&function(_0x5cfbbd){_0x5cfbbd['editing']['view']['change'](_0x304847=>{for(const _0x19a42d of _0x5cfbbd['model']['markers']){if(!_0x19a42d['name']['startsWith']('user:position'))continue;const _0x45ca17=_0x5cfbbd['editing']['mapper']['markerNameToElements'](_0x19a42d['name']);if(_0x45ca17){for(const _0x5ccc78 of _0x45ca17)_0x304847['removeClass']('ck-user__marker_hovered',_0x5ccc78);}}});}(_0x1f5088);},{'useCapture':!0x0});}['afterInit'](){const _0x4e1bb6=this['editor'],_0xf701f0=_0x4e1bb6['commands']['get']('undo');_0xf701f0&&_0x4e1bb6['model']['on']('applyOperation',(_0x5bdcca,_0x105ace)=>{const _0x1fe453=_0x105ace[0x0];if(!_0x1fe453['isDocumentOperation'])return;if('marker'!=_0x1fe453['type']||!_0x1fe453['name']['startsWith']('user:'))return;const _0x441e73=_0x1fe453['batch'];_0xf701f0['_createdBatches']['has'](_0x441e73)&&(_0x1fe453['newRange']=_0x1fe453['oldRange']?_0x4e1bb6['model']['createRange'](_0x1fe453['oldRange']['start'],_0x1fe453['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x1073aa=this['editor'],_0x13b98b=_0x1073aa['model']['document'],_0x3a7ec5=_0x1073aa['plugins']['get'](i);_0x1073aa['model']['enqueueChange']({'isUndoable':!0x1},_0x4c15d3=>{const _0x1cc539='user:range:'+_0x3a7ec5['mySessionId'],_0x4e0941='user:position:'+_0x3a7ec5['mySessionId'],_0x145f1e=_0x1073aa['model']['markers']['has'](_0x1cc539);_0x1073aa['editing']['view']['hasDomSelection']?re(_0x3a7ec5['mySessionId'],_0x13b98b['selection']['getFirstRange'](),_0x1073aa['model'],_0x4c15d3):_0x145f1e&&(_0x4c15d3['removeMarker'](_0x1cc539),_0x4c15d3['removeMarker'](_0x4e0941));});}}function re(_0xcefcad,_0x5dd2f1,_0x58af40,_0x17036a){const _0x48a737='user:range:'+_0xcefcad,_0x5e18c5='user:position:'+_0xcefcad,_0x4f01de=_0x5dd2f1['getContainedElement']();let _0x2bb926=_0x5dd2f1['start'];if(_0x4f01de&&_0x4f01de['is']('element','tableCell')){const _0xc93ea0=function(_0x58ebef,_0x4c6b5d){for(const _0x179854 of _0x58ebef['getPositions']())if(_0x4c6b5d['schema']['checkChild'](_0x179854,'$text'))return _0x179854;}(_0x5dd2f1,_0x58af40);_0xc93ea0&&(_0x2bb926=_0xc93ea0,_0x5dd2f1=_0x17036a['createRange'](_0x2bb926));}const _0x46706f=_0x17036a['createRange'](_0x2bb926);_0x58af40['markers']['has'](_0x48a737)?(_0x17036a['updateMarker'](_0x48a737,{'range':_0x5dd2f1}),_0x17036a['updateMarker'](_0x5e18c5,{'range':_0x46706f})):(_0x17036a['addMarker'](_0x48a737,{'range':_0x5dd2f1,'usingOperation':!0x0}),_0x17036a['addMarker'](_0x5e18c5,{'range':_0x46706f,'usingOperation':!0x0}));}function $(_0xf1973d,_0x4a9c0c,_0x2d439e){const _0x2dac56=_0xf1973d['t'],t=_0xf1973d['t'];switch(_0x4a9c0c){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 _0x2dac56({'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'},_0x2d439e);default:return'';}}let Q=0x1;class l extends _0x30d29d{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x1992e4)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x2cbdaa,_0x1d3547,_0x2d9d9d];}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 _0x20e596=this['serverHistory']['getOperations']();for(let _0x4a1873=_0x20e596['length']-0x1;_0x4a1873>=0x0;_0x4a1873--){const _0x4de24b=_0x20e596[_0x4a1873];if(!this['_disconnectionOperations']['has'](_0x4de24b))return _0x4de24b['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x59ebb1){if(super(_0x59ebb1),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x376331(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x1b0251('collaboration-missing-channelid',this);const _0x357b89=_0x59ebb1['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x357b89,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x354552(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x465458=this['editor'],_0x1fe482=_0x465458['plugins']['get'](_0x1d3547),_0x358309=_0x465458['plugins']['get'](n);this['listenTo'](_0x1fe482,'getOperationAuthor',(_0x45d88d,_0x8f7327)=>{const _0x5b1725=_0x8f7327[0x0];_0x5b1725['_authorId']&&(_0x45d88d['return']=_0x1fe482['getUser'](_0x5b1725['_authorId']),_0x45d88d['stop']()),null===_0x5b1725['_authorId']&&(_0x45d88d['return']=null,_0x45d88d['stop']());},{'priority':'high'}),this['listenTo'](_0x465458['model']['document']['selection'],'change:range',(_0x1d0483,_0x610e20)=>{_0x610e20['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x465458['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x465458['model']['on']('applyOperation',(_0xdb3b44,_0x42fd94)=>{const _0x2e3f82=_0x42fd94[0x0];_0x2e3f82['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2e3f82),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x358309,'state',this,'_hasSynchronizationProblem',(_0x252692,_0x1cc776)=>'connected'===_0x252692&&!_0x1cc776),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x465458['disableReadOnlyMode']('rtc-offline'):_0x465458['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x465458['disableReadOnlyMode']('rtc-offline'):_0x465458['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x172db8=this['editor']['plugins']['get'](i),_0x2b278a=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x172db8['unregister'](this['_channelId']);const _0xe17376=await this['_service']['reconnect'](_0x2b278a['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0xe17376)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x13b0e5=await this['_service']['getConnectedSessions']();_0x172db8['register'](this['_channelId'],_0x13b0e5),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x3d020b){if(function(_0x450865){return'404'===_0x450865['code'];}(_0x3d020b)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x456086){return'409'===_0x456086['code'];}(_0x3d020b)){const _0x18b071=$(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'](_0x18b071);}else{if(!(_0x3d020b instanceof ReconnectionError))throw _0x3d020b;this['_handleReconnectionError']();}}}}['destroy'](){const _0x305c67=this['editor']['plugins']['get'](n),_0x51f172=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x51f172['channelSessions']['has'](this['_channelId'])&&_0x51f172['unregister'](this['_channelId']),_0x305c67['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0xbadc3a){if(this['sessionId']!==_0xbadc3a['sessionId']&&this['_lastSyncedOperationId']!==_0xbadc3a['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0xbadc3a['sessionId'],this['_handleServerResponse']([],{..._0xbadc3a,'wereChangesApplied':!0x1,'data':_0xbadc3a['data']},'reconnect');}async['_connectService'](_0x524dfe,_0x50f86f=!0x1){const {connection:_0x1ea880}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x1ea880,this['_channelId'])['then'](_0x30e4e4=>this['_initSessionsHandling'](_0x30e4e4))['catch'](_0x3cc173=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3cc173);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x59191d,_0x22c3e2)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x22c3e2);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x4ad5a3=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x524dfe);this['_isPendingUpdate']=!0x0;const _0x79958c=await this['_service']['connect'](_0x1ea880,this['_compressOperations'](_0x524dfe),_0x4ad5a3);if(this['sessionId']=_0x79958c['sessionId'],_0x50f86f){if(!_0x79958c['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x79958c['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x524dfe,_0x79958c,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x79958c,_0x524dfe);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x353b22=this['editor']['plugins']['get'](i),_0x2ebaa4=this['editor']['plugins']['get'](G),_0x2fd55b=_0x353b22['channelSessions']['get'](this['_channelId']);_0x2fd55b&&_0x2fd55b['length']>0x1?_0x2ebaa4['createUserMarkerOperations']():this['listenTo'](_0x353b22,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x353b22['channelSessions']['get'](this['_channelId'])['length']&&_0x2ebaa4['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0xa488bb,_0x1a28b6,_0x535040,_0x420e60){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1a28b6){const _0x4d2e24=this['_decompressOperations'](_0x535040,_0x420e60);await this['_fetchMissingUsers'](_0x4d2e24),this['_handleExternalOperations'](_0x4d2e24,_0x1a28b6,_0x535040['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x446cd3}=this['editor'];let _0x48213e;try{_0x48213e=await this['_service']['getDocumentDetails']();}catch{const _0x38ac85=$(_0x446cd3,'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'](_0x38ac85);}const _0x1faeb4=_0x48213e['currentDocumentSession']||_0x48213e['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x1faeb4['lastOperationId']){const _0xf0609f=$(_0x446cd3,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0xf0609f);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x2a2b04){const _0x2569e1=this['editor']['plugins']['get'](i);this['listenTo'](_0x2569e1,'sessionAdd:'+this['_channelId'],(_0x4e09ee,{session:_0x4bb762})=>{if(_0x4bb762['id']===_0x2569e1['mySessionId']){_0x4e09ee['off']();const _0x379225=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x9e13fd=_0x4bb762['permissions'];_0x379225&&_0x379225['isEnabled']&&(_0x9e13fd=_0x9e13fd['filter'](_0x41a969=>'document:write'!==_0x41a969)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x9e13fd,this['_channelId']);}}),_0x2569e1['register'](this['_channelId'],_0x2a2b04);}['_initThrowingOnDataSet'](){const _0x15c768=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2bc3a4)=>{if(!_0x2bc3a4[_0x2bc3a4['length']-0x1]['suppressErrorInCollaboration'])throw new _0x1b0251('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x15c768['apply'](this['editor']['data'],_0x2bc3a4);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4645cc,[_0x1c1c7f])=>{if(this['_document']['version'])throw new _0x1b0251('realtimecollaborationclient-init-document-already-initialized',this);_0x4645cc['stop'](),this['_setPendingAction']();const _0xa59049=this['editor']['config']['get']('rootsAttributes'),_0x4776e1=this['_getOperationsFromInitData'](_0x1c1c7f,_0xa59049);0x0==_0x4776e1['length']&&_0x4776e1['push'](new _0x290d45(0x0)),_0x4645cc['return']=this['_connectService'](_0x4776e1)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x47a702=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x47a702))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x2745df,[_0x426b94,_0x25c3e0])=>{_0x2745df['stop']();const _0x913dfc=this['editor']['model']['document']['getRoot'](_0x426b94);if(!this['_knownRootNames']['has'](_0x426b94)){const _0x29fefb=_0x25c3e0&&_0x25c3e0['data']?_0x25c3e0['data']:'',_0x4af848=_0x25c3e0&&_0x25c3e0['attributes']?_0x25c3e0['attributes']:{};await this['_loadRoot'](_0x426b94,_0x29fefb,_0x4af848);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x913dfc['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x913dfc);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x33d76a){const _0x4a97a1=this['editor']['plugins']['get'](_0x1d3547),{connection:_0x1cc005}=this['editor']['plugins']['get'](n),_0x5cc73c=new Set();for(const _0x5eb288 of _0x33d76a){const _0x19e06f=_0x5eb288['_authorId'];_0x19e06f&&!_0x4a97a1['getUser'](_0x19e06f)&&_0x5cc73c['add'](_0x19e06f);}if(0x0===_0x5cc73c['size'])return;const _0x13b249=await rt['getMany'](_0x1cc005,Array['from'](_0x5cc73c));for(const _0x53f54f of _0x13b249)_0x4a97a1['getUser'](_0x53f54f['id'])||_0x4a97a1['addUser'](_0x53f54f);}['_getOperationsFromInitData'](_0x4543c6,_0x416eeb={}){const _0x2faa1c=this['editor']['model'],_0x3f8861=[];let _0x42db8f=0x0;const _0x491161='string'==typeof _0x4543c6?{'main':_0x4543c6}:_0x4543c6;for(const _0x459811 of Object['keys'](_0x491161)){if(!this['_document']['roots']['has'](_0x459811))throw new _0x1b0251('realtimecollaborationclient-init-non-existent-root',this);const _0x519e4c=this['editor']['data']['parse'](_0x491161[_0x459811]),_0x1bee1d=this['_document']['getRoot'](_0x459811),_0x2597e9=new _0xd00a9d(_0x2faa1c['createPositionAt'](_0x1bee1d,0x0),_0x519e4c,_0x42db8f++);_0x3f8861['push'](_0x2597e9);for(const [_0x3ffcca,_0x37365b]of _0x519e4c['markers']){const _0x7898ff=_0x2faa1c['createRange'](_0x2faa1c['createPositionFromPath'](_0x1bee1d,_0x37365b['start']['path']['slice']()),_0x2faa1c['createPositionFromPath'](_0x1bee1d,_0x37365b['end']['path']['slice']())),_0x2deb06=new _0x151573(_0x3ffcca,null,_0x7898ff,_0x2faa1c['markers'],!0x0,_0x42db8f++);_0x3f8861['push'](_0x2deb06);}}if(_0x416eeb)for(const [_0x3ec3dc,_0x1ced86]of Object['entries'](_0x416eeb)){const _0x6a1fa=_0x2faa1c['document']['getRoot'](_0x3ec3dc);if(!_0x6a1fa)throw new _0x1b0251('multi-root-editor-root-attributes-no-root',null);for(const [_0x4d0c22,_0x5dc09a]of Object['entries'](_0x1ced86))if(null!==_0x5dc09a){const _0x269ba9=new _0x12fae1(_0x6a1fa,_0x4d0c22,null,_0x5dc09a,_0x42db8f++);_0x3f8861['push'](_0x269ba9);}}return _0x3f8861;}async['_loadRoot'](_0x25f2e0,_0x192b4e,_0x139ad8){this['_getOperationsFromInitData']({[_0x25f2e0]:_0x192b4e},{[_0x25f2e0]:_0x139ad8})['forEach']((_0x1a7303,_0x5df6be)=>{_0x1a7303['baseVersion']=this['_document']['version']+_0x5df6be,_0x1a7303['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x1a7303);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x53202f,_0x46ed08){let _0x3738b3;this['_offset']=_0x53202f['offset'];const _0x45466b=_0x53202f['wereChangesApplied']&&!_0x53202f['initData'],_0x293615=_0x45466b?0x0:_0x53202f['data']['baseVersion'];if(_0x46ed08['forEach'](_0x38b82c=>{_0x38b82c['_isInit']=!0x0,_0x38b82c['createdAt']=_0x53202f['sessionCreatedAt'],_0x38b82c['_authorId']=null;}),_0x45466b)_0x3738b3=_0x46ed08,this['_applyOperationsSet'](_0x3738b3,_0x45466b);else{if(_0x53202f['initData']){const _0x1ae11b=this['_getOperationsFromInitData'](_0x53202f['initData']);this['_document']['history']['version']=-_0x1ae11b['length'],_0x1ae11b['forEach'](_0x1d546b=>{_0x1d546b['baseVersion']-=_0x1ae11b['length'],_0x1d546b['createdAt']=_0x53202f['sessionCreatedAt'],_0x1d546b['_isInit']=!0x0,_0x1d546b['_authorId']=null;}),this['_applyOperationsSet'](_0x1ae11b,!0x0),this['serverHistory']['version']=-_0x1ae11b['length']+this['_offset'],this['_updateServerHistory'](_0x1ae11b);}this['_document']['history']['version']=_0x293615,_0x3738b3=this['_decompressOperations'](_0x53202f['data'],_0x53202f['metadata']),await this['_fetchMissingUsers'](_0x3738b3),this['_applyOperationsSet'](_0x3738b3,_0x45466b);}_0x53202f['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3738b3,_0x53202f['lastOperationId']),this['_lastSyncedOperationId']=_0x53202f['lastOperationId']),this['serverHistory']['version']=_0x293615+this['_offset'],this['_updateServerHistory'](_0x3738b3),_0x46ed08['filter'](_0x4540ab=>{const _0x3e5182=this['_getAffectedRoot'](_0x4540ab);return _0x3e5182&&!this['_knownRootNames']['has'](_0x3e5182);})['forEach']((_0x5ade00,_0x178a76)=>{_0x5ade00['baseVersion']=this['_document']['version']+_0x178a76,this['_saveOperationInBuffer'](_0x5ade00);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x1b0d62,_0x59e3dd){const _0x157ef9=_0x59e3dd&&_0x59e3dd['message'];if(_0x157ef9&&_0x157ef9['startsWith']('realtimecollaborationclient'))throw _0x59e3dd;const _0x4e2516=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x4e2516['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x1b0251(_0x1b0d62,this['editor'],_0x157ef9?{'originalError':_0x157ef9}:void 0x0);}['_saveOperationInBuffer'](_0x1dab77){this['_knownOperations']['has'](_0x1dab77)||(this['_knownOperations']['add'](_0x1dab77),this['_bufferedOperations']['push'](_0x1dab77),this['_pendingAction']||'marker'==_0x1dab77['type']&&!_0x1dab77['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0xb970f=!0x1){!_0xb970f&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x5338a0=>{_0x5338a0&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3cfd80=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x1e695e){return _0x1e695e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1e695e['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x1e695e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3cfd80)||this['_crash'](_0x3cfd80['message'],_0x3cfd80);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5c5c77=>{this['on']('change:_isPendingUpdate',()=>{_0x5c5c77();});});}async['_sendBufferedOperations'](){const _0xd70d8a=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0xd70d8a['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x40219d=[...this['_bufferedOperations']];for(const _0x4bb90d of _0x40219d)_0x4bb90d['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4bb90d);const _0x1d92f1=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x40219d),_0x2067ca=Q++,_0x567aed=this['_compressOperations'](_0x40219d),_0x5a5f7e=await this['_service']['sendOperations'](_0x567aed,_0x567aed['baseVersion'],_0x1d92f1);try{return await this['_handleServerResponse'](_0x40219d,_0x5a5f7e,_0x2067ca);}catch(_0x1e9e0e){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1e9e0e);}}async['_handleServerResponse'](_0x5a46f8,_0x4ca316,_0x5da878){if('error'in _0x4ca316)throw _0x4ca316['error'];let _0x4e9f2e=!0x1;if(_0x4ca316['wereChangesApplied']){_0x4ca316['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4ca316['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x509f19=>!_0x5a46f8['includes'](_0x509f19));for(const _0x433d67 of _0x5a46f8)_0x433d67['createdAt']='lastOperationAcceptedAt'in _0x4ca316&&_0x4ca316['lastOperationAcceptedAt']||void 0x0;X(_0x5a46f8,_0x4ca316['version']-_0x5a46f8['length']),this['_updateServerHistory'](_0x5a46f8);const _0x285089=_0x5a46f8['filter'](_0x4acf34=>{if(!_0x4acf34['_isInit'])return!0x1;const _0x14e789=this['_getAffectedRoot'](_0x4acf34);return _0x14e789&&!this['_knownRootNames']['has'](_0x14e789);});X(_0x285089,this['_document']['version']),this['_applyOperationsSet'](_0x285089),_0x4e9f2e=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x44af0c=this['_decompressOperations'](_0x4ca316['data'],_0x4ca316['metadata'])['filter'](_0x584b3b=>_0x584b3b['baseVersion']>=this['_lastServerVersion']);_0x44af0c['forEach'](_0x5ea924=>this['_addKnownRoot'](_0x5ea924)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x156fa7=>!_0x156fa7['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x156fa7))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x44af0c),_0x4e9f2e=this['_handleExternalOperations'](_0x44af0c,_0x4ca316['version'],_0x4ca316['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4e9f2e?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x501220,_0x3a0f7e,_0xd2964e){try{const _0x30c56e={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x43e1f6,operationsB:_0x377766,originalOperations:_0x2397f9}=_0x1f0beb(_0x501220,this['_bufferedOperations'],_0x30c56e);X(_0x43e1f6,this['_document']['version']),X(_0x377766,_0x3a0f7e);for(const _0x3e32bf of _0x43e1f6){const _0x4e131a=_0x2397f9['get'](_0x3e32bf);_0x3e32bf['_authorId']=_0x4e131a?_0x4e131a['_authorId']:null;}_0xd2964e&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x501220,_0xd2964e),this['_lastSyncedOperationId']=_0xd2964e),this['_bufferedOperations']=[..._0x377766],this['_applyOperationsSet'](_0x43e1f6),this['_updateServerHistory'](_0x501220);}catch(_0x164af9){return console['error'](_0x164af9),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2196b7,_0x4a0124=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3ac51e=>{for(const _0xd865d6 of _0x2196b7)this['_knownOperations']['add'](_0xd865d6),this['_addKnownRoot'](_0xd865d6),_0x3ac51e['batch']['addOperation'](_0xd865d6),this['editor']['model']['applyOperation'](_0xd865d6);});}['_addKnownRoot'](_0x11e083){const _0x25f295=this['_getAffectedRoot'](_0x11e083);_0x25f295&&this['_knownRootNames']['add'](_0x25f295);}['_getAffectedRoot'](_0x1edec0){let _0x40ed7d,_0x286222;switch(_0x1edec0['type']){case'insert':_0x40ed7d=_0x1edec0['position']['root'];break;case'marker':if(_0x286222=_0x1edec0['newRange'],!_0x286222)return null;_0x40ed7d=_0x286222['root'];break;case'addRootAttribute':_0x40ed7d=_0x1edec0['root'];break;case'addRoot':_0x40ed7d=_0x1edec0['affectedSelectable'];break;case'move':_0x40ed7d=_0x1edec0['targetPosition']['root'];break;default:return null;}return _0x40ed7d['rootName'];}['_updateServerHistory'](_0x318d39){_0x318d39['forEach'](_0x89a457=>{const _0x5c5670=_0x89a457['clone']();_0x5c5670['_authorId']=_0x89a457['_authorId'],_0x5c5670['_isInit']=!!_0x89a457['_isInit'],_0x5c5670['createdAt']=_0x89a457['createdAt'],_0x5c5670['baseVersion']+=this['_offset'],_0x89a457['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5c5670),this['serverHistory']['addOperation'](_0x5c5670);});}['_handleReconnectionError'](_0x9a2ca5){const _0x3ff19f=this['editor']['plugins']['get']('Notification'),_0x3aeee4=this['editor']['locale'];_0x9a2ca5||(_0x9a2ca5=$(_0x3aeee4,'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.')),_0x3ff19f['showWarning'](_0x9a2ca5,{'title':$(_0x3aeee4,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x2cbdaa)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x2cbdaa)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0xd3aefa){const _0x2ba213=_0xd3aefa['map'](_0xb1a0ed=>_0xb1a0ed['toJSON']());return this['_compressor']['compress'](_0x2ba213);}['_decompressOperations'](_0x3d4d84,_0x21a018){return this['_compressor']['decompress'](_0x3d4d84)['map']((_0x56d86d,_0x41166e)=>{const _0x15bfec='init'==_0x21a018[_0x41166e]['type'];if('InsertOperation'==_0x56d86d['__className']){const _0x4328e9=_0x56d86d['position']['root'];!this['_document']['getRoot'](_0x4328e9)&&(this['_document']['createRoot']('$root',_0x4328e9)['_isAttached']=!0x1);}const _0x5b2e62=_0x2d25b5['fromJSON'](_0x56d86d,this['_document']);return _0x5b2e62['wasUndone']=_0x56d86d['wasUndone'],_0x5b2e62['_isInit']=_0x15bfec,_0x5b2e62['_authorId']=_0x15bfec?null:_0x21a018[_0x41166e]['userId'],_0x5b2e62['_isDisconnection']='cs:removeUser'===_0x21a018[_0x41166e]['type'],_0x5b2e62['createdAt']=_0x21a018[_0x41166e]['createdAt'],_0x5b2e62;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4fa32b=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4fa32b&&_0x4fa32b['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function X(_0x4bc525,_0x52b279){for(const _0x48a2a3 of _0x4bc525)_0x48a2a3['baseVersion']=_0x52b279++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x252daa){this['_ignoredOperations']=_0x252daa,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x13ac7e){let _0x1bce46=_0x13ac7e['length'];for(;_0x1bce46--;){const _0x3e13cf=_0x13ac7e[_0x1bce46];if(!this['_ignoredOperations']['has'](_0x3e13cf)){if(!this['_operationToId']['has'](_0x3e13cf)){const _0x247d64=_0x2e65e8()['slice'](0x1,0x12);this['_operationToId']['set'](_0x3e13cf,_0x247d64);}return this['_operationToId']['get'](_0x3e13cf);}}}['setIdForTheLastOperation'](_0x1526b8,_0xcb47b5){if(!_0xcb47b5)return;let _0x3545b5=_0x1526b8['length'];for(;_0x3545b5--;){const _0x118c81=_0x1526b8[_0x3545b5];this['_ignoredOperations']['has'](_0x118c81)||this['_operationToId']['set'](_0x118c81,_0xcb47b5);}}}class a extends _0x30d29d{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0xfd8900{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x3bed14)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x1d3547];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5285eb){super(_0x5285eb),this['_services']=new Map();}async['init'](){const _0x5ed162=this['context'],_0x201f06=_0x5ed162['plugins']['get']('CommentsRepository');if(_0x5ed162['plugins']['get'](n)['addToReconnectionStack'](this),_0x201f06['adapter']={'addCommentThread':async({channelId:_0x2d5b29,threadId:_0x248701,comments:_0xcc9a68,resolvedAt:_0x25f88b,resolvedBy:_0x780099,context:_0x1f4e2c,attributes:_0x174267})=>{const _0x1e581b=await this['_getService'](_0x2d5b29)['addCommentThread']({'commentThreadId':_0x248701,'comments':_0xcc9a68['map'](_0x595490=>function(_0x3773c6,_0x457f08,_0xf42100){return{'commentThreadId':_0xf42100,'commentId':_0x3773c6['commentId'],'userId':_0x3773c6['authorId'],'content':_0x3773c6['content'],'documentId':_0x457f08,'createdAt':_0x3773c6['createdAt'],'attributes':_0x3773c6['attributes']||{}};}(_0x595490,_0x2d5b29,_0x248701)),'resolvedAt':_0x25f88b,'resolvedBy':_0x780099,'context':_0x1f4e2c,'attributes':_0x174267})['catch'](at);return{'threadId':_0x1e581b['commentThreadId'],'comments':_0x1e581b['comments']};},'getCommentThread':async({channelId:_0x5e8131,threadId:_0x1f6b4a})=>{const _0x4ffda9=await this['_getService'](_0x5e8131)['getCommentThread'](_0x1f6b4a)['catch'](F)['catch'](at);return _0x4ffda9?_0x4ffda9['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x4ffda9]),{'threadId':_0x4ffda9['commentThreadId'],'comments':_0x4ffda9['comments']['map'](P),'context':_0x4ffda9['context'],'resolvedAt':_0x4ffda9['resolvedAt'],'resolvedBy':_0x4ffda9['resolvedBy'],'attributes':_0x4ffda9['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x2944d8,threadId:_0x50ba78,context:_0x5a3a80,unlinkedAt:_0x14ee5e,attributes:_0x3882e8})=>this['_getService'](_0x2944d8)['updateCommentThread']({'commentThreadId':_0x50ba78,'context':_0x5a3a80,'attributes':_0x3882e8,'unlinkedAt':_0x14ee5e})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x5993db,threadId:_0x2c654d})=>{const _0x5a7a8d=await this['_getService'](_0x5993db)['resolveCommentThread'](_0x2c654d)['catch'](F)['catch'](at);return{'threadId':_0x5a7a8d['commentThreadId'],'resolvedAt':_0x5a7a8d['resolvedAt'],'resolvedBy':_0x5a7a8d['resolvedBy']};},'reopenCommentThread':async({channelId:_0x207378,threadId:_0x12d7ab})=>this['_getService'](_0x207378)['reopenCommentThread'](_0x12d7ab)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x1d3a75,threadId:_0x40cff1})=>this['_getService'](_0x1d3a75)['removeCommentThread'](_0x40cff1)['catch'](F)['catch'](at),'addComment':({channelId:_0x110377,threadId:_0x1b6417,commentId:_0x4fa3a1,content:_0x2608b2,attributes:_0x1a0525})=>this['_getService'](_0x110377)['addComment'](_0x1b6417,_0x4fa3a1,_0x2608b2,_0x1a0525)['catch'](at),'updateComment':({channelId:_0x2665a7,threadId:_0x49fbf8,commentId:_0x420d81,content:_0x4975ef,attributes:_0x33c64b})=>this['_getService'](_0x2665a7)['updateComment'](_0x49fbf8,_0x420d81,_0x4975ef,_0x33c64b)['catch'](F)['catch'](at),'removeComment':({channelId:_0x340445,threadId:_0x4569b0,commentId:_0x5e82c8})=>this['_getService'](_0x340445)['removeComment'](_0x4569b0,_0x5e82c8)['catch'](F)['catch'](at)},_0x5ed162 instanceof _0x47a3c5){const _0x223051=_0x5ed162['config']['get']('collaboration.channelId'),_0x5dd904=_0x5ed162['plugins']['get'](i);await this['_setUpService'](_0x223051);const _0x358d2d=await this['_services']['get'](_0x223051)['getConnectedSessions']();this['listenTo'](_0x5dd904,'sessionAdd:'+_0x223051,(_0x443de2,{session:_0x351655})=>{_0x351655['id']===_0x5dd904['mySessionId']&&(_0x443de2['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x351655['permissions'],_0x223051));}),_0x5dd904['register'](_0x223051,_0x358d2d);}}async['_setUpService'](_0x9beea9){if(this['_services']['has'](_0x9beea9))throw new _0x1b0251('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x9beea9});const _0xaec489=this['context']['plugins']['get']('CommentsRepository'),_0x1e983e=new s['CommentsService'](_0x9beea9);this['_services']['set'](_0x9beea9,_0x1e983e),this['listenTo'](_0x1e983e,'commentThreadAdded',(_0x58d8b3,_0x584923)=>{const {commentThreadId:_0x1f96dd,documentId:_0xa0bdef,context:_0x4e0e5f,attributes:_0x510c08,resolvedAt:_0x251b46,resolvedBy:_0x3a4609,comments:_0x1a985c}=_0x584923;_0xaec489['getCommentThread'](_0x1f96dd)||_0xaec489['addCommentThread']({'threadId':_0x1f96dd,'channelId':_0xa0bdef,'comments':_0x1a985c?_0x1a985c['map'](P):[],'context':_0x4e0e5f,'attributes':_0x510c08,'resolvedAt':_0x251b46,'resolvedBy':_0x3a4609,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e983e,'commentThreadUpdated',(_0x3667db,{commentThreadId:_0x4548a9,documentId:_0x1bf12,context:_0x238f82,unlinkedAt:_0x5d2d44,attributes:_0x5e5056})=>{_0xaec489['getCommentThread'](_0x4548a9)&&_0xaec489['updateCommentThread']({'threadId':_0x4548a9,'channelId':_0x1bf12,'context':_0x238f82,'unlinkedAt':_0x5d2d44,'attributes':_0x5e5056,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e983e,'commentThreadResolved',(_0x4b309d,{commentThreadId:_0x45ee18,resolvedBy:_0x205986,resolvedAt:_0x43de39})=>{const _0x11cf3e=_0xaec489['getCommentThread'](_0x45ee18);_0x11cf3e&&_0x11cf3e['resolve']({'resolvedBy':_0x205986,'resolvedAt':_0x43de39,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e983e,'commentThreadReopened',(_0x3b726f,{commentThreadId:_0x3e6e43})=>{const _0x48afd8=_0xaec489['getCommentThread'](_0x3e6e43);_0x48afd8&&_0x48afd8['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e983e,'commentThreadRemoved',(_0x55eff5,{commentThreadId:_0x4b04be})=>{const _0x59dae8=_0xaec489['getCommentThread'](_0x4b04be);_0x59dae8&&_0x59dae8['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e983e,'commentAdded',(_0xa81a7,_0x477fb2)=>{const _0x50f429=_0x477fb2['commentThreadId'],_0xbc6211=_0xaec489['getCommentThread'](_0x50f429);_0xbc6211&&_0xbc6211['addComment']({...P(_0x477fb2),'isFromAdapter':!0x0});}),this['listenTo'](_0x1e983e,'commentUpdated',(_0x543e8c,{commentThreadId:_0x57ad47,commentId:_0x433fbc,content:_0x3a0cc2,attributes:_0x2c4819})=>{const _0x59f554=_0xaec489['getCommentThread'](_0x57ad47);if(_0x59f554){const _0x38ed95=_0x59f554['getComment'](_0x433fbc);_0x38ed95&&_0x38ed95['update']({'content':_0x3a0cc2,'attributes':_0x2c4819,'isFromAdapter':!0x0});}}),this['listenTo'](_0x1e983e,'commentRemoved',(_0x53a2c5,{commentThreadId:_0x5f10f5,commentId:_0x2c8ef5})=>{const _0x23dd03=_0xaec489['getCommentThread'](_0x5f10f5);if(_0x23dd03){const _0x269397=_0x23dd03['getComment'](_0x2c8ef5);_0x269397&&_0x269397['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x9beea9);}['destroy'](){if(this['context']instanceof _0x47a3c5){const _0x55992a=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x55992a);}}['_terminateService'](_0x53acc4){if(!this['_services']['has'](_0x53acc4))throw new _0x1b0251('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x53acc4});this['_getService'](_0x53acc4)['disconnect'](),this['_services']['delete'](_0x53acc4);}async['reconnect'](){for(const _0x2b54fb of this['_services']['keys']())await this['_connectService'](_0x2b54fb);if(this['context']instanceof _0x47a3c5){const _0x3751b1=this['context']['config']['get']('collaboration.channelId'),_0x1aad8=this['context']['plugins']['get'](i);_0x1aad8['unregister'](_0x3751b1);const _0x14d6f2=await this['_services']['get'](_0x3751b1)['getConnectedSessions']();_0x1aad8['register'](_0x3751b1,_0x14d6f2);}}async['_connectService'](_0x5efdbf){const {connection:_0x4d7f1f}=this['context']['plugins']['get'](n),_0x28451d=this['context']['plugins']['get']('CommentsRepository'),_0x3353e2=this['_services']['get'](_0x5efdbf),_0xca42cc=await _0x3353e2['connect'](_0x4d7f1f);await this['_fetchMissingUsersForThreads'](_0xca42cc);const _0x33ab17=new Set(Array['from'](_0x28451d['getCommentThreads']({'channelId':_0x5efdbf}),_0x3d05b7=>_0x3d05b7['id']));for(const _0x36c6fd of _0xca42cc)_0x36c6fd['deletedAt']||_0x33ab17['delete'](_0x36c6fd['commentThreadId']);for(const _0x1ec53d of _0x33ab17)_0x28451d['getCommentThread'](_0x1ec53d)['remove']({'isFromAdapter':!0x0});for(const _0x5a4d6f of _0xca42cc){let _0x37c348=_0x28451d['getCommentThread'](_0x5a4d6f['commentThreadId']);const {commentThreadId:_0x582891,context:_0x2b20d0,attributes:_0x41d6da,resolvedBy:_0x199709,resolvedAt:_0x2643ea,unlinkedAt:_0x5dc372,deletedAt:_0x2937ec}=_0x5a4d6f;if(_0x2937ec)continue;_0x37c348||(_0x37c348=_0x28451d['addCommentThread']({'channelId':_0x5efdbf,'threadId':_0x582891,'context':_0x2b20d0,'attributes':_0x41d6da||{},'resolvedBy':_0x199709,'resolvedAt':_0x2643ea,'unlinkedAt':_0x5dc372,'isFromAdapter':!0x0}));const _0x39c709=new Set(Array['from'](_0x37c348['comments'],_0xb2ee4e=>_0xb2ee4e['id']));for(const _0x15a839 of _0x5a4d6f['comments'])_0x39c709['delete'](_0x15a839['commentId']);for(const _0x33dff9 of _0x39c709)_0x37c348['getComment'](_0x33dff9)['remove']({'isFromAdapter':!0x0});for(const _0x1a64a1 of _0x5a4d6f['comments']){const _0xaf7da1=_0x37c348['getComment'](_0x1a64a1['commentId']);_0xaf7da1?_0xaf7da1['content']!==_0x1a64a1['content']&&_0xaf7da1['update']({'content':_0x1a64a1['content'],'isFromAdapter':!0x0}):_0x37c348['addComment'](Object['assign'](P(_0x1a64a1),{'isFromAdapter':!0x0}));}}}['_getService'](_0x422d60){if(!this['_services']['has'](_0x422d60))throw new _0x1b0251('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x422d60});return this['_services']['get'](_0x422d60);}async['_fetchMissingUsersForThreads'](_0x594501){const _0x71129d=this['context']['plugins']['get'](_0x1d3547),{connection:_0xa57c7c}=this['context']['plugins']['get'](n),_0x44ddcd=new Set();for(const {resolvedBy:_0x5e8119,comments:_0x122955}of _0x594501){_0x5e8119&&!_0x71129d['getUser'](_0x5e8119)&&_0x44ddcd['add'](_0x5e8119);for(const {userId:_0x3183a5}of _0x122955)_0x71129d['getUser'](_0x3183a5)||_0x44ddcd['add'](_0x3183a5);}if(0x0===_0x44ddcd['size'])return;const _0x2ead28=await rt['getMany'](_0xa57c7c,Array['from'](_0x44ddcd));for(const _0x31fcd6 of _0x2ead28)_0x71129d['getUser'](_0x31fcd6['id'])||_0x71129d['addUser'](_0x31fcd6);}}async function F(_0x1a9263){if('404'!==_0x1a9263['code'])throw _0x1a9263;}function at(_0x287791){if((_0x4d6796=_0x287791)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x4d6796['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4d6796['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x4d6796;throw _0x287791;}function P(_0x39d7d3){return{'threadId':_0x39d7d3['commentThreadId'],'commentId':_0x39d7d3['commentId'],'content':_0x39d7d3['content'],'createdAt':_0x39d7d3['createdAt'],'authorId':_0x39d7d3['userId'],'attributes':_0x39d7d3['attributes']||{}};}class m extends _0x30d29d{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x432d35){super(_0x432d35);const _0x301450=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x301450);}['init'](){const _0x5bae5a=this['editor']['plugins']['get'](n),_0x5b094d=this['editor']['plugins']['get']('TrackChangesEditing');return _0x5b094d['adapter']={'getSuggestion':async _0x429891=>{await this['_waitForServiceReady']();const _0x5cfaf4=await this['_trackChangesService']['get'](_0x429891)['catch'](B);return await this['_fetchMissingUsersForThreads']([_0x5cfaf4]),_0x5cfaf4;},'addSuggestion':async({id:_0x384a1f,type:_0x837274,data:_0x6ead27,originalSuggestionId:_0x1dfd60,attributes:_0x1df7f8})=>{await this['_waitForServiceReady']();const _0x596707={'id':_0x384a1f,'type':_0x837274,'data':_0x6ead27,'originalSuggestionId':_0x1dfd60,'attributes':_0x1df7f8},_0x141451=await this['_trackChangesService']['add'](_0x384a1f,_0x837274,_0x6ead27,_0x1dfd60,_0x1df7f8)['catch'](_0x5c382c=>{if(ct(_0x5c382c))return new Promise(_0x319e02=>{this['_bufferedRequests']['set'](_0x384a1f,{'resolve':_0x319e02,'suggestionData':_0x596707});});throw _0x5c382c;});return this['_bufferedRequests']['delete'](_0x384a1f),_0x141451;},'updateSuggestion':async(_0x27d42b,_0x33c495)=>{if(await this['_waitForServiceReady'](),'open'!==_0x33c495['state'])return this['_trackChangesService']['update'](_0x27d42b,_0x33c495)['catch'](B);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x5af701,_0x239624)=>{_0x5b094d['hasSuggestion'](_0x239624['id'])&&(_0x5b094d['getSuggestion'](_0x239624['id'])['attributes']=_0x239624['attributes']);}),this['_trackChangesService']['connect'](_0x5bae5a['connection'])['then'](_0x1b7dc2=>(_0x5bae5a['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1b7dc2)['then'](()=>{for(const _0x466297 of _0x1b7dc2){_0x5b094d['addSuggestionData'](_0x466297)['_saved']=!0x0;}})));}async['reconnect'](){const _0x24798d=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x4a2aae}=this['editor']['plugins']['get'](n),_0x493fc8=await this['_trackChangesService']['connect'](_0x4a2aae);await this['_fetchMissingUsersForThreads'](_0x493fc8);for(const {suggestionData:_0x5756d7,resolve:_0x426237}of this['_bufferedRequests']['values']()){let _0x118746=_0x493fc8['find'](_0x30f6e5=>_0x30f6e5['id']===_0x5756d7['id']);_0x118746||(_0x118746=await this['_trackChangesService']['add'](_0x5756d7['id'],_0x5756d7['type'],_0x5756d7['data'],_0x5756d7['originalSuggestionId'])),_0x426237(_0x118746);}for(const _0x120f5e of _0x493fc8)_0x24798d['hasSuggestion'](_0x120f5e['id'])||_0x24798d['addSuggestionData'](_0x120f5e);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x4d33e3=>{this['listenTo'](this['_trackChangesService'],'connected',_0x2e178f=>{_0x2e178f['off'](),_0x4d33e3();});});}async['_fetchMissingUsersForThreads'](_0x4b40d9){const _0x580abb=this['editor']['plugins']['get'](_0x1d3547),{connection:_0x5d99ac}=this['editor']['plugins']['get'](n),_0x56f770=new Set();for(const {authorId:_0xae5b65}of _0x4b40d9)_0x580abb['getUser'](_0xae5b65)||_0x56f770['add'](_0xae5b65);if(0x0===_0x56f770['size'])return;const _0x110f80=await rt['getMany'](_0x5d99ac,Array['from'](_0x56f770));for(const _0x5a27f7 of _0x110f80)_0x580abb['getUser'](_0x5a27f7['id'])||_0x580abb['addUser'](_0x5a27f7);}}function B(_0x22ac78){if(ct(_0x22ac78))return new Promise(()=>{});throw _0x22ac78;}function ct(_0x464a3c){return _0x464a3c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x464a3c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x30d29d{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5887a7=this['editor']['plugins']['get'](n),_0x5abc8a=this['editor']['plugins']['get']('CommentsEditing'),_0x44d37b=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x5887a7,'change:state',(_0x288175,_0x38caa6,_0x49af14)=>{_0x5abc8a['isThreadsLoadingPaused']='connected'!==_0x49af14;});}),this['listenTo'](_0x5887a7,'change:state',(_0x21d934,_0x2c59a6,_0x53db5e)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x53db5e);}),_0x44d37b['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class RealTimeCollaborativeTrackChanges extends _0x30d29d{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x30d29d{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x1946f6)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x1d3547];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2d150f){super(_0x2d150f);const _0x7e3f07=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x7e3f07);}async['init'](){const _0x4f547c=this['editor']['plugins']['get'](l),_0xbf68ed=_0x4f547c['serverHistory'],_0x4e8606=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xbf68ed,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4f547c['sessionId']});const _0x3739f9=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x1f4047=await _0x107a0a['isBundleUploaded'](_0x4e8606['connection'],_0x3739f9);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1c9eb4})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1c9eb4)),'updateRevisions':async _0x3d0b0e=>{await this['_waitForServiceReady']();const _0x57a95d=this['_revisionTracker']['currentRevision'];if(_0x1f4047&&0x1===_0x3d0b0e['length']&&_0x3d0b0e[0x0]['id']===_0x57a95d['id'])return _0x3d0b0e;for(const _0xfaf2c1 of _0x3d0b0e)_0xfaf2c1['id']===_0x57a95d['id']&&(_0xfaf2c1['isEmptyCurrent']=_0xfaf2c1['fromVersion']===_0xfaf2c1['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3d0b0e,this['_lastRequestId'])['then'](_0x4a9cd3=>(this['_lastRequestId']=_0x4a9cd3,_0x3d0b0e))['catch'](_0x401fc8=>{if(I(_0x401fc8)||'400'===_0x401fc8['code']&&void 0x0!==_0x401fc8['data']['wrongRequestId']){for(const _0xa2f431 of _0x3d0b0e){!this['_revisionTracker']['repository']['getRevision'](_0xa2f431['id'])||this['_revisionTracker']['_bufferUpdate'](_0xa2f431['id'],_0xa2f431,!0x1);}if(I(_0x401fc8))throw _0x401fc8;return _0x3d0b0e;}throw _0x401fc8;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1703a1,{revisionsData:_0x45ccd0,requestId:_0x6c3f93})=>{Math['max'](..._0x45ccd0['map'](_0x502af2=>_0x502af2['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x45ccd0,_0x6c3f93);}):this['_handleRevisionsUpdate'](_0x45ccd0,_0x6c3f93);});const {revisions:_0x26a48b,requestId:_0x1bc6d9}=await this['_revisionHistoryService']['connect'](_0x4e8606['connection']);_0x4e8606['addToReconnectionStack'](this),this['_lastRequestId']=_0x1bc6d9,await this['_fetchMissingUsers'](_0x26a48b);for(const _0x3822c3 of _0x26a48b)this['_revisionTracker']['addRevisionData'](_0x3822c3);this['listenTo'](_0x4f547c,'change:_isConnected',(_0x1e7732,_0x46f640,_0x20d9e7)=>{_0x20d9e7&&(this['_oldOffset']=_0x4f547c['_offset'],_0x1e7732['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4e8606,'state',_0xa0436a=>_0xa0436a===_0x3e236f['CONNECTED']);}async['reconnect'](){const _0x58caf9=this['editor']['plugins']['get'](n),_0x43526c=this['editor']['plugins']['get'](l),_0x5ec5e4=async()=>{const _0x2f52ce=this['_revisionTracker']['currentRevision'],_0xa9c44b=_0x2f52ce['id'],_0x396fed=_0xa9c44b!==_0x43526c['sessionId'];if(_0x396fed){const _0x93e7c0=_0x43526c['_offset']-this['_oldOffset'],_0x4c2e4a=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2f52ce['toVersion']+_0x93e7c0!==_0x4c2e4a){const _0x1aff58=_0x2f52ce['fromVersion']+_0x93e7c0,_0x3e2b08=this['editor']['plugins']['get'](_0x1d3547),_0x268cef=this['_revisionTracker']['buildRevisionData']({'revision':_0x2f52ce,'from':_0x1aff58,'to':_0x4c2e4a});_0x268cef['id']=_0x2f52ce['id'];const _0x68782f=_0x268cef['authorsIds']['map'](_0x57db9a=>_0x3e2b08['getUser'](_0x57db9a));_0x2f52ce['_update']({..._0x268cef,'authors':_0x68782f},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2f52ce['id'],_0x268cef,!0x0);}this['_revisionTracker']['_startingVersion']=_0x4c2e4a,(_0x2f52ce['toVersion']===_0x2f52ce['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xa9c44b)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xa9c44b),this['_revisionTracker']['_createCurrentRevision'](_0x4c2e4a));}const {revisions:_0x412cd9,requestId:_0x15466b}=await this['_revisionHistoryService']['reconnect'](_0x58caf9['connection'],this['_lastRequestId']);_0x396fed&&_0x412cd9['length']>0x0?_0x43526c['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x412cd9),this['_handleRevisionsUpdate'](_0x412cd9,_0x15466b),this['_revisionTracker']['sendBufferedUpdates']());};return _0x43526c['_isConnected']?_0x5ec5e4():new Promise((_0x2acb4d,_0xcd2f84)=>{_0x43526c['once']('change:_isConnected',()=>{_0x5ec5e4()['then'](_0x2acb4d)['catch'](_0xcd2f84);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x183f8f=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x24d859=>{_0x24d859['off'](),_0x183f8f();});});}['_getLatestVersionFromServerOperations'](){const _0x2e30ca=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x12bc4 of _0x2e30ca)if('marker'!==_0x12bc4['type']||_0x12bc4['affectsData'])return _0x12bc4['baseVersion']+0x1;}['_getLatestVersion'](){const _0x15ec9d=this['editor']['plugins']['get'](l);return new Promise(_0x40622a=>{_0x15ec9d['_isPendingUpdate']?_0x15ec9d['once']('change:_isPendingUpdate',()=>{_0x40622a(this['_getLatestVersionFromServerOperations']());}):_0x40622a(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x488f2c,_0x162242){const _0x12de40=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x162242;for(const _0x8acab4 of _0x488f2c){const _0x1e848d=_0x12de40['getRevision'](_0x8acab4['id']);if(_0x1e848d){if((_0x8acab4['fromVersion']||_0x8acab4['toVersion'])&&(_0x8acab4['diffData']=null),_0x1e848d===this['_revisionTracker']['currentRevision']){const _0x158950=Math['max'](_0x1e848d['toVersion'],_0x8acab4['toVersion']),_0x247992=Math['max'](_0x1e848d['fromVersion'],_0x8acab4['fromVersion']);let _0x874aa6;_0x1e848d['toVersion']===_0x8acab4['toVersion']&&_0x1e848d['fromVersion']===_0x8acab4['fromVersion']?(_0x874aa6=!0x0,this['_preventResendingRevisionData'](_0x8acab4)):_0x8acab4['toVersion']===_0x158950&&_0x8acab4['fromVersion']===_0x247992?_0x874aa6=!0x1:(_0x1e848d['toVersion']===_0x158950&&_0x1e848d['fromVersion']===_0x247992||this['_fixRevision']({'revision':_0x1e848d,'from':_0x247992,'to':_0x158950}),_0x874aa6=!0x0),_0x874aa6&&(delete _0x8acab4['fromVersion'],delete _0x8acab4['toVersion'],delete _0x8acab4['diffData'],delete _0x8acab4['createdAt'],delete _0x8acab4['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x8acab4),this['_preventResendingRevisionData'](_0x8acab4);}else this['_revisionTracker']['addRevisionData'](_0x8acab4);}const _0x4141c2=_0x12de40['getRevisions']();_0x4141c2['reverse']();for(let _0xa9883e=0x0;_0xa9883e<_0x4141c2['length']-0x1;_0xa9883e++){const _0x15fc7e=_0x4141c2[_0xa9883e],_0x4f4ad3=_0x4141c2[_0xa9883e+0x1];if(_0x15fc7e['fromVersion']<_0x4f4ad3['toVersion']){const _0x578f9e=_0x4f4ad3['toVersion'],_0x629941=Math['max'](_0x578f9e,_0x15fc7e['toVersion']);this['_fixRevision']({'revision':_0x15fc7e,'from':_0x578f9e,'to':_0x629941});}}}['_fixRevision']({revision:_0x5bbd8b,from:_0xf0e913,to:_0x3690d5}={}){const _0x250c78=this['editor']['plugins']['get'](_0x1d3547),_0x764a31=this['_revisionTracker']['buildRevisionData']({'revision':_0x5bbd8b,'from':_0xf0e913,'to':_0x3690d5});_0x764a31['authors']=_0x764a31['authorsIds']['map'](_0x2a0499=>_0x250c78['getUser'](_0x2a0499)),_0x5bbd8b['_update'](_0x764a31);}['_preventResendingRevisionData'](_0x1fd86f){const _0x291982={};_0x291982['id']=_0x1fd86f['id'];for(const _0x3f81b7 of Object['keys'](_0x1fd86f))'id'!==_0x3f81b7&&(_0x291982[_0x3f81b7]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x291982['id'],_0x291982,!0x0);}async['_fetchMissingUsers'](_0x153391){const _0x237f74=this['editor']['plugins']['get'](_0x1d3547),{connection:_0x621c9d}=this['editor']['plugins']['get'](n),_0x570eeb=new Set();for(const _0x12e86a of _0x153391){for(const _0x91a529 of _0x12e86a['authorsIds'])_0x471e29(_0x91a529);_0x12e86a['creatorId']&&_0x471e29(_0x12e86a['creatorId']);}if(0x0===_0x570eeb['size'])return;const _0x46192c=await rt['getMany'](_0x621c9d,Array['from'](_0x570eeb));for(const _0x4ef356 of _0x46192c)_0x237f74['getUser'](_0x4ef356['id'])||_0x237f74['addUser'](_0x4ef356);function _0x471e29(_0x2b0e19){_0x237f74['getUser'](_0x2b0e19)||_0x570eeb['add'](_0x2b0e19);}}}function I(_0x5682a9){return _0x5682a9['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5682a9['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5682a9['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x30d29d{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x15eed3{['_collapseAt'];constructor(_0x44a6f1,_0x22f79f=0x6){super(_0x44a6f1);const _0x2b958d=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x22f79f,this['bind']('isHidden')['to'](this,'usersCount',_0x307bd8=>_0x307bd8<_0x22f79f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x2b958d['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':_0x2b958d['to']('usersCount',_0x2a173e=>'+'+(_0x2a173e-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x15eed3{['items'];['keystrokes'];constructor(_0x107cff){super(_0x107cff);const _0x143f10=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0xc8fed7(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x143f10['if']('hasPopup'),'aria-expanded':_0x143f10['to']('isExpanded',_0x480320=>this['hasPopup']&&String(_0x480320)),'aria-label':_0x143f10['to']('hasPopup',_0x42db41=>$(_0x107cff,_0x42db41?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x143f10['to']('hasPopup',_0x23a039=>!!_0x23a039&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x143f10['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x143f10['to'](_0x45d308=>{const _0xe32267=_0x45d308,_0x510fb0=document['querySelector']('.ck-presence-list__dropdown-list'),_0x3f202e=document['querySelector']('.ck-balloon-panel_with-arrow');_0x510fb0?.['contains'](_0xe32267['relatedTarget'])||_0x3f202e?.['contains'](_0xe32267['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2aab24,_0x2b1c5c,_0x11a193)=>{this['element']&&(_0x11a193?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x15eed3{['counterView'];['inlineListView'];constructor(_0x691aef,_0xebd6a3=0x6){super(_0x691aef);const _0x538a7a=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0xebd6a3),this['inlineListView']=new is(_0x691aef),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5bc2c2 of this['inlineListView']['items'])_0x5bc2c2['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',_0x538a7a['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x15eed3{['listWrapperView'];constructor(_0x55c0a6,_0x3fc365){super(_0x55c0a6);const _0x12bcba=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x55c0a6,_0x3fc365),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x55c0a6,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x12bcba['to'](_0xebaf48=>{const _0x343cdb=_0xebaf48,_0x164d4b=document['querySelector']('.ck-presence-list__list'),_0x181d2a=document['querySelector']('.ck-balloon-panel_with-arrow');_0x164d4b?.['contains'](_0x343cdb['relatedTarget'])||_0x181d2a?.['contains'](_0x343cdb['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x3f1de7{constructor(_0xa1b391,_0x233b80){super(_0xa1b391);const _0x32f7fc=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x233b80?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x32f7fc['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x32f7fc['to']('role'),'aria-label':_0x32f7fc['to']('ariaLabel'),'aria-labelledby':_0x32f7fc['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x2b0da0['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5d5ed8=this['element'];_0x5d5ed8&&(this['_isScrollable']=Math['max'](_0x5d5ed8['scrollHeight'],_0x5d5ed8['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x23859c,_0x2594a2,_0x4edace){super(_0x23859c);const _0x3552c9=this['bindTemplate'];this['userView']=new st(_0x23859c,_0x2594a2);const _0x2b9c39={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x2594a2['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x2594a2['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2594a2['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4edace&&(_0x2b9c39['tag']='button',_0x2b9c39['on']={'click':_0x3552c9['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2b9c39);}['focus'](){this['element']['focus']();}}class A extends _0x15eed3{['userView'];['markerView'];constructor(_0x4d81bf,_0x35a716,_0xf3785c){super(_0x4d81bf);const _0x279308=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x4d81bf,_0x35a716),this['markerView']=new MarkerView(_0x4d81bf,_0x35a716);const _0x2210cf=new it(_0x4d81bf);_0x2210cf['template']['tag']='span',_0x2210cf['text']=_0x35a716['name'];const _0x4c4dce={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x279308['to']('isFocusable',_0x143c9e=>!!_0x143c9e&&0x0),'aria-labelledby':_0x2210cf['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x279308['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x279308['to']('hasTooltip',_0x1ddd2a=>!_0x1ddd2a),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2210cf]};_0xf3785c&&(_0x4c4dce['tag']='button',_0x4c4dce['on']={'click':_0x279308['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4c4dce);}}class MarkerView extends _0x15eed3{constructor(_0x383cee,_0x432284){super(_0x383cee),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x432284['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0xfd8900{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d1902){super(_0x4d1902),this['context']['config']['define']('presenceList',x);const _0x3ae5c5=_0x4d1902['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3ae5c5)throw new _0x1b0251('presencelist-collapseat-invalid-format',this);if(_0x3ae5c5<0x1)throw new _0x1b0251('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x51237b(),this['balloonPanelView']=new _0x212cdd(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0xf9a9d0 of this['_allConnectedUsers'])this['_handleUserAdd'](_0xf9a9d0);this['listenTo'](this['_allConnectedUsers'],'add',(_0x3eba9c,_0x59e703)=>{this['_handleUserAdd'](_0x59e703);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1e3d95,_0x5175ec)=>{this['_handleUserRemove'](_0x5175ec);});}['_createView'](){const _0x7c2423=this['context'],_0x1a0620=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xdac1e4=this['balloonPanelView'];if(!_0x3a41f3(_0x7c2423['config']['get']('presenceList.container')))throw new _0x1b0251('presencelist-missing-container',this);return _0x1a0620['counterView']['bind']('usersCount')['to'](this),_0x1a0620['bind']('isCollapsed')['to'](this,'usersCount',_0x456320=>{const {collapseAt:_0xfcb73f}=_0x7c2423['config']['get']('presenceList'),_0x5af6d7=_0x456320>=_0xfcb73f;if(_0x5af6d7&&!_0x1a0620['inlineListView']['items']['find'](_0x155757=>_0x155757 instanceof b)){const _0x34f89e=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x34f89e&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x1a0620['inlineListView']['items']['add'](_0x1a0620['counterView']);}return _0x5af6d7||this['hideDropdown'](),_0x5af6d7;}),_0x1a0620['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1b663b=>{const _0x64984b=_0x7c2423['config']['get']('presenceList'),_0x110e1e=new A(_0x7c2423['locale'],_0x1b663b,!!_0x64984b['onClick']);return _0x110e1e['bind']('hasTooltip')['to'](_0x1a0620,'isCollapsed',_0x3d4b77=>!_0x3d4b77),_0x110e1e['bind']('isFocusable')['to'](_0x1a0620,'isCollapsed',_0x4353e0=>!_0x4353e0),_0x64984b['onClick']&&this['listenTo'](_0x110e1e,'execute',()=>{this['view']['isCollapsed']||_0x64984b['onClick'](_0x1b663b,_0x110e1e['element']);}),_0x110e1e;}),this['listenTo'](_0x1a0620['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x1a0620['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x1a0620['inlineListView']['keystrokes']['set']('Enter',(_0x404eae,_0x4230a8)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4230a8());}),_0x1a0620['render'](),_0xdac1e4['render'](),_0x545d85({'emitter':_0x1a0620,'activator':()=>_0xdac1e4['isVisible'],'contextElements':[_0xdac1e4['element'],_0x1a0620['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x7c2423['config']['get']('presenceList.container')['appendChild'](_0x1a0620['element']),this['_bodyCollection']=new _0x4f1761(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x1a0620;}['_handleUserAdd'](_0x4c4ac1){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x4c4ac1['isMe'])return;const _0x17c055=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x17c055-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0xfd1151=_0x4c4ac1['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x4c4ac1,_0xfd1151);}['_handleUserRemove'](_0x41d4d4){this['usersCount']--;const {collapseAt:_0x24559d}=this['context']['config']['get']('presenceList'),_0x156594=this['usersCount']>=_0x24559d;if(this['currentDisplayedUsers']['get'](_0x41d4d4['id']))this['currentDisplayedUsers']['remove'](_0x41d4d4['id']);else{if(_0x156594&&this['currentDisplayedUsers']['length']+0x1===_0x24559d-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x156594?0x1:0x0)<this['usersCount']){for(const _0x5119f8 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5119f8['id'])&&(this['currentDisplayedUsers']['add'](_0x5119f8,Math['min'](this['currentDisplayedUsers']['length']-(_0x156594?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x156594?0x1:0x0)===_0x24559d-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0xc69707=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0xc69707['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x247ea1}=this['presenceDropdownView'];_0x247ea1['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x489670=>{if(!_0xc69707['displayMe']&&_0x489670['isMe'])return null;const _0x3b9596=new j(this['context']['locale'],_0x489670,!!_0xc69707['onClick']);return _0xc69707['onClick']&&this['listenTo'](_0x3b9596,'execute',()=>{_0xc69707['onClick'](_0x489670,_0x3b9596['element']);}),_0x3b9596;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x247ea1['focus'](),_0x247ea1['checkIfScrollable']();const _0x3fd6d8=(_0x4877d0,_0x126285)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x126285();};_0x247ea1['keystrokes']['set']('Esc',_0x3fd6d8),_0x247ea1['keystrokes']['set']('Shift+Tab',_0x3fd6d8),_0x247ea1['keystrokes']['set']('Tab',(_0x2fa745,_0x32c7de)=>{!function(_0x54599a){const _0xbb4b37=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x1402ef=>_0x1402ef+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x320da3=[...document['body']['querySelectorAll'](_0xbb4b37)]['filter'](_0x2eeaa3=>_0x2eeaa3===document['activeElement']||_0x2eeaa3['offsetWidth']+_0x2eeaa3['offsetHeight']>0x0)['sort']((_0x4cc9a,_0x192e37)=>(_0x4cc9a['tabIndex']||0x0)-(_0x192e37['tabIndex']||0x0)),_0x1c1c0=_0x320da3['indexOf'](_0x54599a),_0x4ac689=_0x320da3[(_0x1c1c0+0x1)%_0x320da3['length']];_0x4ac689&&_0x4ac689['focus']();}(this['view']['element']),this['hideDropdown'](),_0x32c7de();}),_0x247ea1['focusTracker']['add'](this['view']['element']),_0x247ea1['focusTracker']['on']('change:isFocused',(_0x5639e6,_0x30c9e1,_0x53df2e)=>{_0x53df2e||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class PresenceList extends _0xfd8900{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
@@ -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':_0x127c8d=>0x1!=_0x127c8d}};
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':_0x30392a=>0x1!=_0x30392a}};