@ckeditor/ckeditor5-real-time-collaboration 47.7.3 → 47.7.5-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 _0x57ac80,Plugin as _0x38ec35,PendingActions as _0x40cd9a,Context as _0xaf36e6}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x47e8bf,CKEditorError as _0x533522,Collection as _0x5510de,global as _0x3be0ca,version as nt,uid as _0x404c20,KeystrokeHandler as _0x4b7810}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1764ff,View as _0x422411,ListView as _0x462fd8,ListItemView as st,LabelView as at,BalloonPanelView as _0x21eb1a,clickOutsideHandler as _0x32589f,BodyCollection as _0x272992}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x151155,History as _0x41fb4f,NoOperation as _0x5f0d00,InsertOperation as _0x43fa61,MarkerOperation as _0x596344,RootAttributeOperation as _0x5c298c,transformOperationSets as _0x3f9ccd,OperationFactory as _0x327378}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ct,WEB_SOCKET_GATEWAY_STATES as _0x207676,CollaborativeEditingService as _0x46b370,User as ht,CommentsService as _0x1e0da1,TrackChangesService as it,RevisionHistoryService as _0x1b1037,EditorService as _0x3eecac}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x14383d,UserView as rt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xb0c797}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x5b9bb3}from'es-toolkit/compat';class n extends _0x57ac80{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ct)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1764ff];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ea4bc){super(_0x4ea4bc),this['set']('state',_0x207676['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x47e8bf())();}['init'](){const _0x31a5e8=this['context'],_0x19d571=_0x31a5e8['plugins']['get']('CloudServices'),_0x1fa388=_0x31a5e8['plugins']['get'](_0x1764ff);if(!_0x19d571['token'])throw new _0x533522('websocketgateway-missing-token',this);if(!_0x19d571['webSocketUrl'])throw new _0x533522('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'](_0x19d571['token'],_0x19d571['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x326c79=>{if(this['connection']=_0x326c79,this['bind']('state')['to'](_0x326c79,'state',this,'_isBrowserOffline',(_0x49581a,_0x24a136)=>('connected'!==_0x49581a&&(this['_shouldPluginsReconnect']=!0x0),_0x24a136||_0x49581a!==_0x207676['CONNECTED']?_0x207676['DISCONNECTED']:this['state']==_0x207676['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x207676['CONNECTING']):_0x207676['CONNECTED'])),this['connection']['on']('error',(_0x37308b,_0x29fc62)=>{if('limitExceeded'!==_0x29fc62['code'])throw console['error'](_0x29fc62),new _0x533522('cloudservices-init',null,{'originalError':_0x29fc62});_0x1fa388['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'});}),!_0x326c79['me'])return new Promise(_0x5b91f8=>_0x326c79['on']('change:me',_0x5b91f8));})['catch'](_0x424412=>{throw console['error'](_0x424412),new _0x533522('cloudservices-init',null,{'originalError':_0x424412});});}['addToReconnectionStack'](_0x58d860){if('function'!=typeof _0x58d860['reconnect'])throw new _0x533522('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x58d860))throw new _0x533522('websocketgateway-plugin-already-registered',this,{'name':_0x58d860['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x58d860);}['removeFromReconnectionStack'](_0x8ff7a2){this['_reconnectionStack']['delete'](_0x8ff7a2);}['isInReconnectionStack'](_0x6d3060){return this['_reconnectionStack']['has'](_0x6d3060);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x17122d=>_0x17122d['reconnect']())))['then'](()=>this['state']=_0x207676['CONNECTED'])['catch'](_0x5b22d7=>{throw console['error'](_0x5b22d7),new _0x533522('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x207676['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x57ac80{['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,_0x14383d];}constructor(_0x17b5a2){super(_0x17b5a2),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5510de(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x14383d);}['init'](){const _0x2b06f8=this['context']['plugins']['get'](n);this['listenTo'](_0x2b06f8,'change:state',(_0x2ba0ce,_0x5e4472,_0x5d7d9b)=>{if('connected'!==_0x5d7d9b)this['channelSessions']['forEach'](_0x1204b3=>_0x1204b3['clear']()),this['channelConnectedUsers']['forEach'](_0x546915=>_0x546915['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2cde34,_0xb45071]of this['_registeredSessions'])for(const _0x108e67 of _0xb45071)this['_handleSessionAdd'](_0x2cde34,_0x108e67);}}),this['_createUser'](_0x2b06f8['connection']['me'],!0x0);}['register'](_0x38bae8,_0x13b398){if(this['_registeredSessions']['has'](_0x38bae8))throw new _0x533522('sessions-register-already-registered',null,{'channelId':_0x38bae8});this['_registeredSessions']['set'](_0x38bae8,_0x13b398),this['channelSessions']['set'](_0x38bae8,new _0x5510de()),this['channelConnectedUsers']['set'](_0x38bae8,new _0x5510de()),this['listenTo'](_0x13b398,'add',(_0x1d43ee,_0x17c361)=>this['_handleSessionAdd'](_0x38bae8,_0x17c361)),this['listenTo'](_0x13b398,'remove',(_0x5bfdb4,_0x26bfa9)=>this['_handleSessionRemove'](_0x38bae8,_0x26bfa9));for(const _0x34f531 of _0x13b398)this['_handleSessionAdd'](_0x38bae8,_0x34f531);}['unregister'](_0x33fa18){if(!this['_registeredSessions']['has'](_0x33fa18))throw new _0x533522('sessions-unregister-not-exist',null,{'channelId':_0x33fa18});const _0x58bba6=this['_registeredSessions']['get'](_0x33fa18);this['stopListening'](_0x58bba6);for(const _0x5a8b90 of _0x58bba6)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x33fa18,_0x5a8b90);this['_registeredSessions']['delete'](_0x33fa18),this['channelSessions']['delete'](_0x33fa18),this['channelConnectedUsers']['delete'](_0x33fa18);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x342023){for(const _0x166cdc of this['channelSessions']['values']())for(const _0x3c1bcc of _0x166cdc)if(_0x3c1bcc['id']===_0x342023)return _0x3c1bcc['user'];}['getUserSessions'](_0x267164,_0x53db15){const _0x56c6e7=_0x53db15?[this['channelSessions']['get'](_0x53db15)]:this['channelSessions']['values'](),_0xa002df=new Set();for(const _0x15bc74 of _0x56c6e7)for(const _0x2a1363 of _0x15bc74)_0x2a1363['user']['id']===_0x267164['id']&&_0xa002df['add'](_0x2a1363['id']);return _0xa002df;}['getUserRole'](_0x53a904){for(const _0x2ca419 of this['channelSessions']['values']())for(const _0x445d6d of _0x2ca419)if(_0x445d6d['user']===_0x53a904)return _0x445d6d['role'];}['_handleSessionAdd'](_0x249e07,_0x28758f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1e322a=_0x28758f['user'],_0x5e4ddf=this['_users']['getUser'](_0x1e322a['id'])||this['_createUser'](_0x1e322a),_0x5bb888=Object['assign']({},_0x28758f,{'user':_0x5e4ddf});if(this['channelSessions']['get'](_0x249e07)['add'](_0x5bb888),!_0x1e322a['hiddenInPresenceList']){const _0x5c4489=this['channelConnectedUsers']['get'](_0x249e07);_0x5c4489['has'](_0x5e4ddf['id'])||_0x5c4489['add'](_0x5e4ddf),this['allConnectedUsers']['has'](_0x5e4ddf['id'])||_0x1e322a['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x5e4ddf,_0x5e4ddf['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x249e07,{'channelId':_0x249e07,'session':_0x5bb888});}['_handleSessionRemove'](_0x10decd,_0x38734f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1512bc=this['channelConnectedUsers']['get'](_0x10decd),_0x52225c=_0x38734f['user'];_0x52225c['id']&&(this['channelSessions']['get'](_0x10decd)['remove'](_0x38734f['id']),_0x1512bc['has'](_0x52225c['id'])&&!this['getUserSessions'](_0x52225c,_0x10decd)['size']&&_0x1512bc['remove'](_0x52225c['id']),this['allConnectedUsers']['get'](_0x52225c['id'])&&!this['getUserSessions'](_0x52225c)['size']&&this['allConnectedUsers']['remove'](_0x52225c['id']));}['_createUser'](_0x185dc4,_0xe49257){const _0x6bc89e=this['_users']['addUser'](_0x185dc4);return _0xe49257&&this['_users']['defineMe'](_0x185dc4['id']),_0x6bc89e['orderNumber']=this['_uniqueUsersCount']++,_0x6bc89e;}}class k extends _0x38ec35{['_domEmitter']=new(_0x47e8bf())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xb36323=this['editor'],_0x39b7e9=_0xb36323['plugins']['get'](i);_0xb36323['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x49d342,{writer:_0x18a363})=>function(_0x4a4f3f,_0x411df7,_0x500f00,_0x5f119){const _0x3f8c3e=_0x4a4f3f['markerName']['split'](':')[0x2],_0x59532c=_0x500f00['getUserBySessionId'](_0x3f8c3e);if(!_0x59532c||_0x3f8c3e===_0x500f00['mySessionId'])return;if(!_0x5f119['model']['schema']['checkChild'](_0x4a4f3f['markerRange']['start'],'$text'))return;const _0x4280ba={'class':'ck-user__marker\x20'+_0x59532c['color']['getMarkerClass'](),'data-name':_0x59532c['name'],'data-session-id':_0x3f8c3e},_0x166b2=_0x5f119['model']['markers']['get'](_0x4a4f3f['markerName']),_0x31167c=_0x166b2['getStart'](),_0x4eedda=_0x31167c['nodeAfter'],_0x529ff5=_0x5f119['model']['schema'];if(_0x4eedda&&_0x529ff5['isObject'](_0x4eedda)&&_0x529ff5['isInline'](_0x4eedda)&&!_0x5f119['model']['markers']['get']('user:range:'+_0x3f8c3e)['getRange']()['isCollapsed'])return;const _0x4da7c0=_0x31167c['parent'];return _0x5f119['model']['schema']['isLimit'](_0x4da7c0)&&!_0x5f119['model']['hasContent'](_0x4da7c0)&&(_0x4280ba['contenteditable']=!0x1),function(_0x1eb7c9,_0x198e08,_0x2cbe7e){const _0x21bf0a=_0x1eb7c9['createUIElement']('span',_0x198e08);return _0x1eb7c9['setCustomProperty']('userPositionMarker',!0x0,_0x21bf0a),_0x21bf0a['render']=function(_0x172367){const _0x32f834=this['toDomElement'](_0x172367),_0x145aa1=document['createElement']('span');return _0x145aa1['classList']['add']('ck-user__marker-tooltip'),_0x145aa1['setAttribute']('contenteditable','false'),_0x145aa1['setAttribute']('spellcheck','false'),_0x145aa1['textContent']=_0x2cbe7e['name'],_0x32f834['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x145aa1['outerHTML']+'⁠',_0x32f834['addEventListener']('mouseenter',()=>{_0x32f834['classList']['add']('ck-user__marker_hovered');}),_0x32f834['addEventListener']('mouseleave',()=>{_0x32f834['classList']['remove']('ck-user__marker_hovered');}),_0x32f834;},_0x21bf0a['isSimilar']=function(_0x43d9ca){return!(!this['getCustomProperty']('userPositionMarker')||!_0x43d9ca['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x43d9ca['getAttribute']('data-session-id'));},_0x21bf0a;}(_0x411df7,_0x4280ba,_0x59532c);}(_0x49d342,_0x18a363,_0x39b7e9,_0xb36323)}),_0xb36323['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5cd897=>function(_0xac4523,_0x241802){const _0x21be76=_0xac4523['markerName']['split'](':')[0x2];if(_0x21be76===_0x241802['mySessionId'])return null;const _0x3bfe02=_0x241802['getUserBySessionId'](_0x21be76);if(!_0x3bfe02)return{'id':_0x21be76,'classes':[]};return{'id':_0x21be76,'classes':['ck-user__selection',_0x3bfe02['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x21be76},'priority':0x7d0+_0x3bfe02['orderNumber']};}(_0x5cd897,_0x39b7e9)}),function(_0x11f68f){const _0x343435=_0x11f68f['model'],_0x2a0854=new Map(),_0x334029=_0x11f68f['plugins']['get'](i);_0x343435['markers']['on']('update:user:range',(_0x8ec179,_0x13e0f7,_0x756ef1,_0x3a0bea)=>{if(!_0x3a0bea&&_0x2a0854['get'](_0x13e0f7['name']))return _0x2a0854['get'](_0x13e0f7['name'])['detach'](),void _0x2a0854['delete'](_0x13e0f7['name']);const _0xefa6a4=_0x13e0f7['name']['split'](':')[0x2];if(_0xefa6a4===_0x334029['mySessionId'])return;const _0x2ef644='user:position:'+_0xefa6a4;_0x343435['markers']['has'](_0x2ef644)&&_0x11f68f['editing']['reconvertMarker'](_0x2ef644),_0x13e0f7['on']('change:range',(_0x5406b1,_0x363ae7,_0x38cfb5)=>{if('$graveyard'!=_0x363ae7['root']['rootName']&&'$graveyard'==_0x13e0f7['getRange']()['root']['rootName']&&!_0x2a0854['has'](_0x13e0f7['name'])){const _0x519567=_0x343435['schema']['getNearestSelectionRange'](_0x38cfb5['deletionPosition']);if(_0x519567){const _0x9a818f=_0x151155['fromRange'](_0x519567);_0x2a0854['set'](_0x13e0f7['name'],_0x9a818f),_0x9a818f['on']('change:range',(_0x3f2aa4,_0x264216,_0x5f08eb)=>{if('$graveyard'==_0x9a818f['root']['rootName']){const _0x194d27=_0x343435['schema']['getNearestSelectionRange'](_0x5f08eb['deletionPosition']);_0x194d27?(_0x9a818f['start']=_0x194d27['start'],_0x9a818f['end']=_0x194d27['end']):(_0x2a0854['delete'](_0x13e0f7['name']),_0x9a818f['detach']());}});}}});}),_0x343435['document']['on']('change',()=>{_0x2a0854['size']>0x0&&_0x343435['enqueueChange']({'isUndoable':!0x1},_0x2b2f5e=>{for(const [_0x42b0da,_0x2e5847]of _0x2a0854)'$graveyard'==_0x343435['markers']['get'](_0x42b0da)['getRange']()['root']['rootName']&&(x(_0x42b0da['split'](':')[0x2],_0x2e5847['toRange'](),_0x343435,_0x2b2f5e),_0x2e5847['detach']());_0x2a0854['clear']();});});}(_0xb36323),this['_domEmitter']['listenTo'](_0x3be0ca['document'],'keydown',(_0xda8123,{key:_0x5a2860})=>{'Escape'===_0x5a2860&&function(_0x5bfc2b){_0x5bfc2b['editing']['view']['change'](_0xc7697b=>{for(const _0x4d7718 of _0x5bfc2b['model']['markers']){if(!_0x4d7718['name']['startsWith']('user:position'))continue;const _0x1dbeea=_0x5bfc2b['editing']['mapper']['markerNameToElements'](_0x4d7718['name']);if(_0x1dbeea){for(const _0x353fbc of _0x1dbeea)_0xc7697b['removeClass']('ck-user__marker_hovered',_0x353fbc);}}});}(_0xb36323);},{'useCapture':!0x0});}['afterInit'](){const _0x529f8d=this['editor'],_0x47322d=_0x529f8d['commands']['get']('undo');_0x47322d&&_0x529f8d['model']['on']('applyOperation',(_0x131466,_0x3be613)=>{const _0x3edcf0=_0x3be613[0x0];if(!_0x3edcf0['isDocumentOperation'])return;if('marker'!=_0x3edcf0['type']||!_0x3edcf0['name']['startsWith']('user:'))return;const _0x21d1af=_0x3edcf0['batch'];_0x47322d['_createdBatches']['has'](_0x21d1af)&&(_0x3edcf0['newRange']=_0x3edcf0['oldRange']?_0x529f8d['model']['createRange'](_0x3edcf0['oldRange']['start'],_0x3edcf0['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x55f4ee=this['editor'],_0x418e13=_0x55f4ee['model']['document'],_0x1dc636=_0x55f4ee['plugins']['get'](i);_0x55f4ee['model']['enqueueChange']({'isUndoable':!0x1},_0x5484d8=>{const _0x3ab9f0='user:range:'+_0x1dc636['mySessionId'],_0x117623='user:position:'+_0x1dc636['mySessionId'],_0x1ed0c8=_0x55f4ee['model']['markers']['has'](_0x3ab9f0);_0x55f4ee['editing']['view']['hasDomSelection']?x(_0x1dc636['mySessionId'],_0x418e13['selection']['getFirstRange'](),_0x55f4ee['model'],_0x5484d8):_0x1ed0c8&&(_0x5484d8['removeMarker'](_0x3ab9f0),_0x5484d8['removeMarker'](_0x117623));});}}function x(_0xb4c816,_0x5396fe,_0x333436,_0x41d789){const _0x381da8='user:range:'+_0xb4c816,_0x861d1f='user:position:'+_0xb4c816,_0x20ab22=_0x5396fe['getContainedElement']();let _0x385cc3=_0x5396fe['start'];if(_0x20ab22&&_0x20ab22['is']('element','tableCell')){const _0x5a2e8c=function(_0x14476f,_0x4d516a){for(const _0x4db255 of _0x14476f['getPositions']())if(_0x4d516a['schema']['checkChild'](_0x4db255,'$text'))return _0x4db255;}(_0x5396fe,_0x333436);_0x5a2e8c&&(_0x385cc3=_0x5a2e8c,_0x5396fe=_0x41d789['createRange'](_0x385cc3));}const _0x6b184f=_0x41d789['createRange'](_0x385cc3);_0x333436['markers']['has'](_0x381da8)?(_0x41d789['updateMarker'](_0x381da8,{'range':_0x5396fe}),_0x41d789['updateMarker'](_0x861d1f,{'range':_0x6b184f})):(_0x41d789['addMarker'](_0x381da8,{'range':_0x5396fe,'usingOperation':!0x0}),_0x41d789['addMarker'](_0x861d1f,{'range':_0x6b184f,'usingOperation':!0x0}));}function R(_0x1aa0e5,_0x4d112e,_0x555b7a){const _0x5f3972=_0x1aa0e5['t'],t=_0x1aa0e5['t'];switch(_0x4d112e){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 _0x5f3972({'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'},_0x555b7a);default:return'';}}let j=0x1;class l extends _0x38ec35{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x46b370)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,k,_0x40cd9a,_0x14383d,_0x1764ff];}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 _0x112e0d=this['serverHistory']['getOperations']();for(let _0x5575fd=_0x112e0d['length']-0x1;_0x5575fd>=0x0;_0x5575fd--){const _0x8c4251=_0x112e0d[_0x5575fd];if(!this['_disconnectionOperations']['has'](_0x8c4251))return _0x8c4251['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x28bed0){if(super(_0x28bed0),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x41fb4f(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x533522('collaboration-missing-channelid',this);const _0x2998d4=_0x28bed0['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x2998d4,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xb0c797(),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 _0x2e3841=this['editor'],_0x4b06e4=_0x2e3841['plugins']['get'](_0x14383d),_0x14ace6=_0x2e3841['plugins']['get'](n);this['listenTo'](_0x4b06e4,'getOperationAuthor',(_0x3b261d,_0x59447f)=>{const _0x25b695=_0x59447f[0x0];_0x25b695['_authorId']&&(_0x3b261d['return']=_0x4b06e4['getUser'](_0x25b695['_authorId']),_0x3b261d['stop']()),null===_0x25b695['_authorId']&&(_0x3b261d['return']=null,_0x3b261d['stop']());},{'priority':'high'}),this['listenTo'](_0x2e3841['model']['document']['selection'],'change:range',(_0x1942e3,_0x3c91ea)=>{_0x3c91ea['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x2e3841['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x2e3841['model']['on']('applyOperation',(_0x74dbdd,_0x3912f0)=>{const _0x560e0d=_0x3912f0[0x0];_0x560e0d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x560e0d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x14ace6,'state',this,'_hasSynchronizationProblem',(_0x3f8d9f,_0x144e87)=>'connected'===_0x3f8d9f&&!_0x144e87),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x2e3841['disableReadOnlyMode']('rtc-offline'):_0x2e3841['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x2e3841['disableReadOnlyMode']('rtc-offline'):_0x2e3841['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5ceac2=this['editor']['plugins']['get'](i),_0x58d5f8=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x5ceac2['unregister'](this['_channelId']);const _0x1b7c0e=await this['_service']['reconnect'](_0x58d5f8['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1b7c0e)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2092f3=await this['_service']['getConnectedSessions']();_0x5ceac2['register'](this['_channelId'],_0x2092f3),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2e6793){if(function(_0x32afa1){return'404'===_0x32afa1['code'];}(_0x2e6793)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3cc451){return'409'===_0x3cc451['code'];}(_0x2e6793)){const _0xad9452=R(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0xad9452);}else{if(!(_0x2e6793 instanceof ReconnectionError))throw _0x2e6793;this['_handleReconnectionError']();}}}}['destroy'](){const _0x61c27e=this['editor']['plugins']['get'](n),_0x2fbc6c=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2fbc6c['channelSessions']['has'](this['_channelId'])&&_0x2fbc6c['unregister'](this['_channelId']),_0x61c27e['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x5d3087){if(this['sessionId']!==_0x5d3087['sessionId']&&this['_lastSyncedOperationId']!==_0x5d3087['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x5d3087['sessionId'],this['_handleServerResponse']([],{..._0x5d3087,'wereChangesApplied':!0x1,'data':_0x5d3087['data']},'reconnect');}async['_connectService'](_0x727a59,_0x4ed546=!0x1){const {connection:_0x4836}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x4836,this['_channelId'])['then'](_0x4178ad=>this['_initSessionsHandling'](_0x4178ad))['catch'](_0x47e125=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x47e125);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3241de,_0x3a79a2)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3a79a2);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x618b9d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x727a59);this['_isPendingUpdate']=!0x0;const _0x37cf61=await this['_service']['connect'](_0x4836,this['_compressOperations'](_0x727a59),_0x618b9d);if(this['sessionId']=_0x37cf61['sessionId'],_0x4ed546){if(!_0x37cf61['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x37cf61['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x727a59,_0x37cf61,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x37cf61,_0x727a59);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4a1755=this['editor']['plugins']['get'](i),_0x11d7ab=this['editor']['plugins']['get'](k),_0x404fa3=_0x4a1755['channelSessions']['get'](this['_channelId']);_0x404fa3&&_0x404fa3['length']>0x1?_0x11d7ab['createUserMarkerOperations']():this['listenTo'](_0x4a1755,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4a1755['channelSessions']['get'](this['_channelId'])['length']&&_0x11d7ab['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x5bd086,_0x43170c,_0x4e1a52,_0x20c333){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x43170c){const _0x1f97ef=this['_decompressOperations'](_0x4e1a52,_0x20c333);await this['_fetchMissingUsers'](_0x1f97ef),this['_handleExternalOperations'](_0x1f97ef,_0x43170c,_0x4e1a52['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0xb87d22}=this['editor'];let _0x56fa8a;try{_0x56fa8a=await this['_service']['getDocumentDetails']();}catch{const _0x5bba55=R(_0xb87d22,'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'](_0x5bba55);}const _0x40cd8e=_0x56fa8a['currentDocumentSession']||_0x56fa8a['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x40cd8e['lastOperationId']){const _0x4e2c3a=R(_0xb87d22,'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'](_0x4e2c3a);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x1d73ff){const _0x34ce57=this['editor']['plugins']['get'](i);this['listenTo'](_0x34ce57,'sessionAdd:'+this['_channelId'],(_0x1a6447,{session:_0x30c255})=>{if(_0x30c255['id']===_0x34ce57['mySessionId']){_0x1a6447['off']();const _0x30cce9=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x50f240=_0x30c255['permissions'];_0x30cce9&&_0x30cce9['isEnabled']&&(_0x50f240=_0x50f240['filter'](_0x1703d3=>'document:write'!==_0x1703d3)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x50f240,this['_channelId']);}}),_0x34ce57['register'](this['_channelId'],_0x1d73ff);}['_initThrowingOnDataSet'](){const _0x5ed38e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2e49c3)=>{if(!_0x2e49c3[_0x2e49c3['length']-0x1]['suppressErrorInCollaboration'])throw new _0x533522('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5ed38e['apply'](this['editor']['data'],_0x2e49c3);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x19a078,[_0xda7361])=>{if(this['_document']['version'])throw new _0x533522('realtimecollaborationclient-init-document-already-initialized',this);_0x19a078['stop'](),this['_setPendingAction']();const _0x2b9437=this['editor']['config']['get']('rootsAttributes'),_0x42fee0=this['_getOperationsFromInitData'](_0xda7361,_0x2b9437);0x0==_0x42fee0['length']&&_0x42fee0['push'](new _0x5f0d00(0x0)),_0x19a078['return']=this['_connectService'](_0x42fee0)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4098ab=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4098ab))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x57bf4b,[_0x39946a,_0x4f6dda])=>{_0x57bf4b['stop']();const _0x171a6f=this['editor']['model']['document']['getRoot'](_0x39946a);if(!this['_knownRootNames']['has'](_0x39946a)){const _0x2ec0c4=_0x4f6dda&&_0x4f6dda['data']?_0x4f6dda['data']:'',_0x5eeee8=_0x4f6dda&&_0x4f6dda['attributes']?_0x4f6dda['attributes']:{};await this['_loadRoot'](_0x39946a,_0x2ec0c4,_0x5eeee8);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x171a6f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x171a6f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x41e10d){const _0xeba898=this['editor']['plugins']['get'](_0x14383d),{connection:_0x1aaf5c}=this['editor']['plugins']['get'](n),_0x56a9e9=new Set();for(const _0x11bcb5 of _0x41e10d){const _0x47d472=_0x11bcb5['_authorId'];_0x47d472&&!_0xeba898['getUser'](_0x47d472)&&_0x56a9e9['add'](_0x47d472);}if(0x0===_0x56a9e9['size'])return;const _0x187ff7=await ht['getMany'](_0x1aaf5c,Array['from'](_0x56a9e9));for(const _0x3165dd of _0x187ff7)_0xeba898['getUser'](_0x3165dd['id'])||_0xeba898['addUser'](_0x3165dd);}['_getOperationsFromInitData'](_0x4165d5,_0x11f751={}){const _0x5dce9e=this['editor']['model'],_0x61fefa=[];let _0x1088e6=0x0;const _0x567ed5='string'==typeof _0x4165d5?{'main':_0x4165d5}:_0x4165d5;for(const _0x382603 of Object['keys'](_0x567ed5)){if(!this['_document']['roots']['has'](_0x382603))throw new _0x533522('realtimecollaborationclient-init-non-existent-root',this);const _0x1fbda9=this['editor']['data']['parse'](_0x567ed5[_0x382603]),_0x26126f=this['_document']['getRoot'](_0x382603),_0x5b1dda=new _0x43fa61(_0x5dce9e['createPositionAt'](_0x26126f,0x0),_0x1fbda9,_0x1088e6++);_0x61fefa['push'](_0x5b1dda);for(const [_0x23e7cb,_0x481035]of _0x1fbda9['markers']){const _0x2a9742=_0x5dce9e['createRange'](_0x5dce9e['createPositionFromPath'](_0x26126f,_0x481035['start']['path']['slice']()),_0x5dce9e['createPositionFromPath'](_0x26126f,_0x481035['end']['path']['slice']())),_0x5297f8=new _0x596344(_0x23e7cb,null,_0x2a9742,_0x5dce9e['markers'],!0x0,_0x1088e6++);_0x61fefa['push'](_0x5297f8);}}if(_0x11f751)for(const [_0x8288ba,_0x1a883d]of Object['entries'](_0x11f751)){const _0x33b86d=_0x5dce9e['document']['getRoot'](_0x8288ba);if(!_0x33b86d)throw new _0x533522('multi-root-editor-root-attributes-no-root',null);for(const [_0x474890,_0x5d7040]of Object['entries'](_0x1a883d))if(null!==_0x5d7040){const _0x2d9550=new _0x5c298c(_0x33b86d,_0x474890,null,_0x5d7040,_0x1088e6++);_0x61fefa['push'](_0x2d9550);}}return _0x61fefa;}async['_loadRoot'](_0x142caa,_0x39f344,_0x147c81){this['_getOperationsFromInitData']({[_0x142caa]:_0x39f344},{[_0x142caa]:_0x147c81})['forEach']((_0x9b105d,_0x12ab50)=>{_0x9b105d['baseVersion']=this['_document']['version']+_0x12ab50,_0x9b105d['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x9b105d);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x503c6c,_0x2eb7f0){let _0x4ccd66;this['_offset']=_0x503c6c['offset'];const _0x1b5e36=_0x503c6c['wereChangesApplied']&&!_0x503c6c['initData'],_0x15f036=_0x1b5e36?0x0:_0x503c6c['data']['baseVersion'];if(_0x2eb7f0['forEach'](_0x493ecb=>{_0x493ecb['_isInit']=!0x0,_0x493ecb['createdAt']=_0x503c6c['sessionCreatedAt'],_0x493ecb['_authorId']=null;}),_0x1b5e36)_0x4ccd66=_0x2eb7f0,this['_applyOperationsSet'](_0x4ccd66,_0x1b5e36);else{if(_0x503c6c['initData']){const _0x53479e=this['_getOperationsFromInitData'](_0x503c6c['initData']);this['_document']['history']['version']=-_0x53479e['length'],_0x53479e['forEach'](_0x3b3399=>{_0x3b3399['baseVersion']-=_0x53479e['length'],_0x3b3399['createdAt']=_0x503c6c['sessionCreatedAt'],_0x3b3399['_isInit']=!0x0,_0x3b3399['_authorId']=null;}),this['_applyOperationsSet'](_0x53479e,!0x0),this['serverHistory']['version']=-_0x53479e['length']+this['_offset'],this['_updateServerHistory'](_0x53479e);}this['_document']['history']['version']=_0x15f036,_0x4ccd66=this['_decompressOperations'](_0x503c6c['data'],_0x503c6c['metadata']),await this['_fetchMissingUsers'](_0x4ccd66),this['_applyOperationsSet'](_0x4ccd66,_0x1b5e36);}_0x503c6c['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4ccd66,_0x503c6c['lastOperationId']),this['_lastSyncedOperationId']=_0x503c6c['lastOperationId']),this['serverHistory']['version']=_0x15f036+this['_offset'],this['_updateServerHistory'](_0x4ccd66),_0x2eb7f0['filter'](_0x40947d=>{const _0x3370c4=this['_getAffectedRoot'](_0x40947d);return _0x3370c4&&!this['_knownRootNames']['has'](_0x3370c4);})['forEach']((_0x5ca292,_0x3c2a34)=>{_0x5ca292['baseVersion']=this['_document']['version']+_0x3c2a34,this['_saveOperationInBuffer'](_0x5ca292);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x6abf9f,_0x4d91fa){const _0x1bee65=_0x4d91fa&&_0x4d91fa['message'];if(_0x1bee65&&_0x1bee65['startsWith']('realtimecollaborationclient'))throw _0x4d91fa;const _0xf74f8=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0xf74f8['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x533522(_0x6abf9f,this['editor'],_0x1bee65?{'originalError':_0x1bee65}:void 0x0);}['_saveOperationInBuffer'](_0xf9a21e){this['_knownOperations']['has'](_0xf9a21e)||(this['_knownOperations']['add'](_0xf9a21e),this['_bufferedOperations']['push'](_0xf9a21e),this['_pendingAction']||'marker'==_0xf9a21e['type']&&!_0xf9a21e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x14e10b=!0x1){!_0x14e10b&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x347d10=>{_0x347d10&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x5b1086=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x203d37){return _0x203d37['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x203d37['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x203d37['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x5b1086)||this['_crash'](_0x5b1086['message'],_0x5b1086);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2c01ec=>{this['on']('change:_isPendingUpdate',()=>{_0x2c01ec();});});}async['_sendBufferedOperations'](){const _0x2b6fc0=this['editor']['plugins']['get'](k);if(this['_shouldSendSelectionUpdate']()&&(_0x2b6fc0['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x349339=[...this['_bufferedOperations']];for(const _0xf7dee3 of _0x349339)_0xf7dee3['wasUndone']=this['_document']['history']['isUndoneOperation'](_0xf7dee3);const _0x4c723b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x349339),_0x1e0601=j++,_0x41aa32=this['_compressOperations'](_0x349339),_0x53c59f=await this['_service']['sendOperations'](_0x41aa32,_0x41aa32['baseVersion'],_0x4c723b);try{return await this['_handleServerResponse'](_0x349339,_0x53c59f,_0x1e0601);}catch(_0x3f2cd3){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3f2cd3);}}async['_handleServerResponse'](_0x1c3f55,_0x262f01,_0x2e6bcf){if('error'in _0x262f01)throw _0x262f01['error'];let _0x1608e1=!0x1;if(_0x262f01['wereChangesApplied']){_0x262f01['lastOperationId']&&(this['_lastSyncedOperationId']=_0x262f01['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3a1885=>!_0x1c3f55['includes'](_0x3a1885));for(const _0x51e4b9 of _0x1c3f55)_0x51e4b9['createdAt']='lastOperationAcceptedAt'in _0x262f01&&_0x262f01['lastOperationAcceptedAt']||void 0x0;D(_0x1c3f55,_0x262f01['version']-_0x1c3f55['length']),this['_updateServerHistory'](_0x1c3f55);const _0x187c62=_0x1c3f55['filter'](_0x25352b=>{if(!_0x25352b['_isInit'])return!0x1;const _0x651e17=this['_getAffectedRoot'](_0x25352b);return _0x651e17&&!this['_knownRootNames']['has'](_0x651e17);});D(_0x187c62,this['_document']['version']),this['_applyOperationsSet'](_0x187c62),_0x1608e1=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xfed8f5=this['_decompressOperations'](_0x262f01['data'],_0x262f01['metadata'])['filter'](_0x4ead6b=>_0x4ead6b['baseVersion']>=this['_lastServerVersion']);_0xfed8f5['forEach'](_0x40df96=>this['_addKnownRoot'](_0x40df96)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3c590f=>!_0x3c590f['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3c590f))),this['_bufferedOperations']['length']&&D(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xfed8f5),_0x1608e1=this['_handleExternalOperations'](_0xfed8f5,_0x262f01['version'],_0x262f01['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1608e1?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x283619,_0x43a213,_0x5956ea){try{const _0x498ae2={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x455089,operationsB:_0x685b68,originalOperations:_0x51384c}=_0x3f9ccd(_0x283619,this['_bufferedOperations'],_0x498ae2);D(_0x455089,this['_document']['version']),D(_0x685b68,_0x43a213);for(const _0x36573f of _0x455089){const _0x2c5ff4=_0x51384c['get'](_0x36573f);_0x36573f['_authorId']=_0x2c5ff4?_0x2c5ff4['_authorId']:null;}_0x5956ea&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x283619,_0x5956ea),this['_lastSyncedOperationId']=_0x5956ea),this['_bufferedOperations']=[..._0x685b68],this['_applyOperationsSet'](_0x455089),this['_updateServerHistory'](_0x283619);}catch(_0x33ff98){return console['error'](_0x33ff98),!0x1;}return!0x0;}['_applyOperationsSet'](_0x517f9a,_0x32e92d=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x23ce79=>{for(const _0x26b536 of _0x517f9a)this['_knownOperations']['add'](_0x26b536),this['_addKnownRoot'](_0x26b536),_0x23ce79['batch']['addOperation'](_0x26b536),this['editor']['model']['applyOperation'](_0x26b536);});}['_addKnownRoot'](_0x18812a){const _0x3bda36=this['_getAffectedRoot'](_0x18812a);_0x3bda36&&this['_knownRootNames']['add'](_0x3bda36);}['_getAffectedRoot'](_0x1f9f0d){let _0x4894ac,_0xdebdac;switch(_0x1f9f0d['type']){case'insert':_0x4894ac=_0x1f9f0d['position']['root'];break;case'marker':if(_0xdebdac=_0x1f9f0d['newRange'],!_0xdebdac)return null;_0x4894ac=_0xdebdac['root'];break;case'addRootAttribute':_0x4894ac=_0x1f9f0d['root'];break;case'addRoot':_0x4894ac=_0x1f9f0d['affectedSelectable'];break;case'move':_0x4894ac=_0x1f9f0d['targetPosition']['root'];break;default:return null;}return _0x4894ac['rootName'];}['_updateServerHistory'](_0x3d99af){_0x3d99af['forEach'](_0x2b57cb=>{const _0x4bee53=_0x2b57cb['clone']();_0x4bee53['_authorId']=_0x2b57cb['_authorId'],_0x4bee53['_isInit']=!!_0x2b57cb['_isInit'],_0x4bee53['createdAt']=_0x2b57cb['createdAt'],_0x4bee53['baseVersion']+=this['_offset'],_0x2b57cb['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4bee53),this['serverHistory']['addOperation'](_0x4bee53);});}['_handleReconnectionError'](_0x39b5d6){const _0x4d0ca3=this['editor']['plugins']['get']('Notification'),_0x43965b=this['editor']['locale'];_0x39b5d6||(_0x39b5d6=R(_0x43965b,'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.')),_0x4d0ca3['showWarning'](_0x39b5d6,{'title':R(_0x43965b,'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'](_0x40cd9a)['add'](R(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x40cd9a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x208e78){const _0x50f136=_0x208e78['map'](_0x3d23e9=>_0x3d23e9['toJSON']());return this['_compressor']['compress'](_0x50f136);}['_decompressOperations'](_0x4ae516,_0x475d33){return this['_compressor']['decompress'](_0x4ae516)['map']((_0x5da784,_0x20eb3f)=>{const _0x44fb63='init'==_0x475d33[_0x20eb3f]['type'];if('InsertOperation'==_0x5da784['__className']){const _0x293167=_0x5da784['position']['root'];!this['_document']['getRoot'](_0x293167)&&(this['_document']['createRoot']('$root',_0x293167)['_isAttached']=!0x1);}const _0x28882f=_0x327378['fromJSON'](_0x5da784,this['_document']);return _0x28882f['wasUndone']=_0x5da784['wasUndone'],_0x28882f['_isInit']=_0x44fb63,_0x28882f['_authorId']=_0x44fb63?null:_0x475d33[_0x20eb3f]['userId'],_0x28882f['_isDisconnection']='cs:removeUser'===_0x475d33[_0x20eb3f]['type'],_0x28882f['createdAt']=_0x475d33[_0x20eb3f]['createdAt'],_0x28882f;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2a0015=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2a0015&&_0x2a0015['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function D(_0x455edd,_0x271bf0){for(const _0x5bca4d of _0x455edd)_0x5bca4d['baseVersion']=_0x271bf0++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x2cb0a4){this['_ignoredOperations']=_0x2cb0a4,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x501d92){let _0x169220=_0x501d92['length'];for(;_0x169220--;){const _0x2f5191=_0x501d92[_0x169220];if(!this['_ignoredOperations']['has'](_0x2f5191)){if(!this['_operationToId']['has'](_0x2f5191)){const _0x4ccf9e=_0x404c20()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2f5191,_0x4ccf9e);}return this['_operationToId']['get'](_0x2f5191);}}}['setIdForTheLastOperation'](_0x5e7e5d,_0x58a4fc){if(!_0x58a4fc)return;let _0x22802=_0x5e7e5d['length'];for(;_0x22802--;){const _0x4a0e06=_0x5e7e5d[_0x22802];this['_ignoredOperations']['has'](_0x4a0e06)||this['_operationToId']['set'](_0x4a0e06,_0x58a4fc);}}}class a extends _0x38ec35{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x57ac80{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x1e0da1)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x14383d];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2159a3){super(_0x2159a3),this['_services']=new Map();}async['init'](){const _0x59e0e2=this['context'],_0x12fb4e=_0x59e0e2['plugins']['get']('CommentsRepository');if(_0x59e0e2['plugins']['get'](n)['addToReconnectionStack'](this),_0x12fb4e['adapter']={'addCommentThread':async({channelId:_0xc821c4,threadId:_0x48b835,comments:_0x680b6e,resolvedAt:_0x291d7f,resolvedBy:_0x5e9a6b,context:_0x555c33,attributes:_0x2b7970})=>{const _0x41a8d2=await this['_getService'](_0xc821c4)['addCommentThread']({'commentThreadId':_0x48b835,'comments':_0x680b6e['map'](_0x3bb846=>function(_0x2819bc,_0x1bcaf8,_0xd6631e){return{'commentThreadId':_0xd6631e,'commentId':_0x2819bc['commentId'],'userId':_0x2819bc['authorId'],'content':_0x2819bc['content'],'documentId':_0x1bcaf8,'createdAt':_0x2819bc['createdAt'],'attributes':_0x2819bc['attributes']||{}};}(_0x3bb846,_0xc821c4,_0x48b835)),'resolvedAt':_0x291d7f,'resolvedBy':_0x5e9a6b,'context':_0x555c33,'attributes':_0x2b7970})['catch'](lt);return{'threadId':_0x41a8d2['commentThreadId'],'comments':_0x41a8d2['comments']};},'getCommentThread':async({channelId:_0x2eb857,threadId:_0x24828e})=>{const _0x835a91=await this['_getService'](_0x2eb857)['getCommentThread'](_0x24828e)['catch'](tt)['catch'](lt);return _0x835a91?_0x835a91['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x835a91]),{'threadId':_0x835a91['commentThreadId'],'comments':_0x835a91['comments']['map'](ot),'context':_0x835a91['context'],'resolvedAt':_0x835a91['resolvedAt'],'resolvedBy':_0x835a91['resolvedBy'],'attributes':_0x835a91['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x564f4a,threadId:_0x235cf3,context:_0x5a1f24,unlinkedAt:_0x24d272,attributes:_0x8f798a})=>this['_getService'](_0x564f4a)['updateCommentThread']({'commentThreadId':_0x235cf3,'context':_0x5a1f24,'attributes':_0x8f798a,'unlinkedAt':_0x24d272})['catch'](tt)['catch'](lt),'resolveCommentThread':async({channelId:_0x72a05e,threadId:_0x26a9a8})=>{const _0x556e61=await this['_getService'](_0x72a05e)['resolveCommentThread'](_0x26a9a8)['catch'](tt)['catch'](lt);return{'threadId':_0x556e61['commentThreadId'],'resolvedAt':_0x556e61['resolvedAt'],'resolvedBy':_0x556e61['resolvedBy']};},'reopenCommentThread':async({channelId:_0xfd3697,threadId:_0x5c343f})=>this['_getService'](_0xfd3697)['reopenCommentThread'](_0x5c343f)['catch'](tt)['catch'](lt),'removeCommentThread':({channelId:_0x194c1e,threadId:_0x4e08b2})=>this['_getService'](_0x194c1e)['removeCommentThread'](_0x4e08b2)['catch'](tt)['catch'](lt),'addComment':({channelId:_0x223f30,threadId:_0x42dadf,commentId:_0x2e211b,content:_0x13b952,attributes:_0x34d9db})=>this['_getService'](_0x223f30)['addComment'](_0x42dadf,_0x2e211b,_0x13b952,_0x34d9db)['catch'](lt),'updateComment':({channelId:_0x1a3354,threadId:_0x294b55,commentId:_0x5a8f56,content:_0x21f5c9,attributes:_0x5b97be})=>this['_getService'](_0x1a3354)['updateComment'](_0x294b55,_0x5a8f56,_0x21f5c9,_0x5b97be)['catch'](tt)['catch'](lt),'removeComment':({channelId:_0x2dd463,threadId:_0x5834b1,commentId:_0x5b3951})=>this['_getService'](_0x2dd463)['removeComment'](_0x5834b1,_0x5b3951)['catch'](tt)['catch'](lt)},_0x59e0e2 instanceof _0xaf36e6){const _0x57e0ba=_0x59e0e2['config']['get']('collaboration.channelId'),_0x32a795=_0x59e0e2['plugins']['get'](i);await this['_setUpService'](_0x57e0ba);const _0x1e4769=await this['_services']['get'](_0x57e0ba)['getConnectedSessions']();this['listenTo'](_0x32a795,'sessionAdd:'+_0x57e0ba,(_0x53f4fe,{session:_0x3e64ad})=>{_0x3e64ad['id']===_0x32a795['mySessionId']&&(_0x53f4fe['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3e64ad['permissions'],_0x57e0ba));}),_0x32a795['register'](_0x57e0ba,_0x1e4769);}}async['_setUpService'](_0x206481){if(this['_services']['has'](_0x206481))throw new _0x533522('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x206481});const _0x4ce775=this['context']['plugins']['get']('CommentsRepository'),_0x39e30a=new s['CommentsService'](_0x206481);this['_services']['set'](_0x206481,_0x39e30a),this['listenTo'](_0x39e30a,'commentThreadAdded',(_0x2c6b47,_0x552e13)=>{const {commentThreadId:_0x2cad33,documentId:_0x502712,context:_0x18baf8,attributes:_0x3c988a,resolvedAt:_0x12b35b,resolvedBy:_0xb6dbc3,comments:_0x59ab46}=_0x552e13;_0x4ce775['getCommentThread'](_0x2cad33)||_0x4ce775['addCommentThread']({'threadId':_0x2cad33,'channelId':_0x502712,'comments':_0x59ab46?_0x59ab46['map'](ot):[],'context':_0x18baf8,'attributes':_0x3c988a,'resolvedAt':_0x12b35b,'resolvedBy':_0xb6dbc3,'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadUpdated',(_0x201460,{commentThreadId:_0x4551ec,documentId:_0x62b936,context:_0x4e3c0e,unlinkedAt:_0x1a1008,attributes:_0x33dd74})=>{_0x4ce775['getCommentThread'](_0x4551ec)&&_0x4ce775['updateCommentThread']({'threadId':_0x4551ec,'channelId':_0x62b936,'context':_0x4e3c0e,'unlinkedAt':_0x1a1008,'attributes':_0x33dd74,'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadResolved',(_0x3c9ddc,{commentThreadId:_0xd23732,resolvedBy:_0xd3bb0f,resolvedAt:_0x49dd60})=>{const _0x11ebad=_0x4ce775['getCommentThread'](_0xd23732);_0x11ebad&&_0x11ebad['resolve']({'resolvedBy':_0xd3bb0f,'resolvedAt':_0x49dd60,'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadReopened',(_0x303ae0,{commentThreadId:_0x48155c})=>{const _0x24b9a0=_0x4ce775['getCommentThread'](_0x48155c);_0x24b9a0&&_0x24b9a0['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentThreadRemoved',(_0x251c42,{commentThreadId:_0x5aad9a})=>{const _0xca6fa0=_0x4ce775['getCommentThread'](_0x5aad9a);_0xca6fa0&&_0xca6fa0['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentAdded',(_0x3230d7,_0x548302)=>{const _0x1eab55=_0x548302['commentThreadId'],_0xb89b46=_0x4ce775['getCommentThread'](_0x1eab55);_0xb89b46&&_0xb89b46['addComment']({...ot(_0x548302),'isFromAdapter':!0x0});}),this['listenTo'](_0x39e30a,'commentUpdated',(_0x256940,{commentThreadId:_0x538555,commentId:_0x5db5e3,content:_0xaf75a6,attributes:_0x3c427d})=>{const _0x3ef030=_0x4ce775['getCommentThread'](_0x538555);if(_0x3ef030){const _0x575d11=_0x3ef030['getComment'](_0x5db5e3);_0x575d11&&_0x575d11['update']({'content':_0xaf75a6,'attributes':_0x3c427d,'isFromAdapter':!0x0});}}),this['listenTo'](_0x39e30a,'commentRemoved',(_0x439185,{commentThreadId:_0x547245,commentId:_0x1e6dff})=>{const _0x3f5e5b=_0x4ce775['getCommentThread'](_0x547245);if(_0x3f5e5b){const _0x4c7574=_0x3f5e5b['getComment'](_0x1e6dff);_0x4c7574&&_0x4c7574['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x206481);}['destroy'](){if(this['context']instanceof _0xaf36e6){const _0x51ab22=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x51ab22);}}['_terminateService'](_0x1c527e){if(!this['_services']['has'](_0x1c527e))throw new _0x533522('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1c527e});this['_getService'](_0x1c527e)['disconnect'](),this['_services']['delete'](_0x1c527e);}async['reconnect'](){for(const _0x136fb0 of this['_services']['keys']())await this['_connectService'](_0x136fb0);if(this['context']instanceof _0xaf36e6){const _0x506ac=this['context']['config']['get']('collaboration.channelId'),_0x9131bd=this['context']['plugins']['get'](i);_0x9131bd['unregister'](_0x506ac);const _0x39171f=await this['_services']['get'](_0x506ac)['getConnectedSessions']();_0x9131bd['register'](_0x506ac,_0x39171f);}}async['_connectService'](_0x2db7c9){const {connection:_0x3be3c7}=this['context']['plugins']['get'](n),_0x4eb9ad=this['context']['plugins']['get']('CommentsRepository'),_0x109602=this['_services']['get'](_0x2db7c9),_0x3125fa=await _0x109602['connect'](_0x3be3c7);await this['_fetchMissingUsersForThreads'](_0x3125fa);const _0x1d1dc8=new Set(Array['from'](_0x4eb9ad['getCommentThreads']({'channelId':_0x2db7c9}),_0x15b330=>_0x15b330['id']));for(const _0x2f803d of _0x3125fa)_0x2f803d['deletedAt']||_0x1d1dc8['delete'](_0x2f803d['commentThreadId']);for(const _0x4dd47a of _0x1d1dc8)_0x4eb9ad['getCommentThread'](_0x4dd47a)['remove']({'isFromAdapter':!0x0});for(const _0x24fdd4 of _0x3125fa){let _0x1e0408=_0x4eb9ad['getCommentThread'](_0x24fdd4['commentThreadId']);const {commentThreadId:_0x23bd9f,context:_0x2a60da,attributes:_0x4a473a,resolvedBy:_0x32c061,resolvedAt:_0x16392e,unlinkedAt:_0x26aa2c,deletedAt:_0x5bf652}=_0x24fdd4;if(_0x5bf652)continue;_0x1e0408||(_0x1e0408=_0x4eb9ad['addCommentThread']({'channelId':_0x2db7c9,'threadId':_0x23bd9f,'context':_0x2a60da,'attributes':_0x4a473a||{},'resolvedBy':_0x32c061,'resolvedAt':_0x16392e,'unlinkedAt':_0x26aa2c,'isFromAdapter':!0x0}));const _0x23e723=new Set(Array['from'](_0x1e0408['comments'],_0x5102f6=>_0x5102f6['id']));for(const _0x29ec75 of _0x24fdd4['comments'])_0x23e723['delete'](_0x29ec75['commentId']);for(const _0x4fe1a1 of _0x23e723)_0x1e0408['getComment'](_0x4fe1a1)['remove']({'isFromAdapter':!0x0});for(const _0xaaf948 of _0x24fdd4['comments']){const _0x1304b6=_0x1e0408['getComment'](_0xaaf948['commentId']);_0x1304b6?_0x1304b6['content']!==_0xaaf948['content']&&_0x1304b6['update']({'content':_0xaaf948['content'],'isFromAdapter':!0x0}):_0x1e0408['addComment'](Object['assign'](ot(_0xaaf948),{'isFromAdapter':!0x0}));}}}['_getService'](_0xd03367){if(!this['_services']['has'](_0xd03367))throw new _0x533522('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xd03367});return this['_services']['get'](_0xd03367);}async['_fetchMissingUsersForThreads'](_0x141c90){const _0xb828d3=this['context']['plugins']['get'](_0x14383d),{connection:_0x1974cf}=this['context']['plugins']['get'](n),_0x2c9292=new Set();for(const {resolvedBy:_0x19767c,comments:_0x5cd7f6}of _0x141c90){_0x19767c&&!_0xb828d3['getUser'](_0x19767c)&&_0x2c9292['add'](_0x19767c);for(const {userId:_0x5cfa4c}of _0x5cd7f6)_0xb828d3['getUser'](_0x5cfa4c)||_0x2c9292['add'](_0x5cfa4c);}if(0x0===_0x2c9292['size'])return;const _0x48d07b=await ht['getMany'](_0x1974cf,Array['from'](_0x2c9292));for(const _0x2410d0 of _0x48d07b)_0xb828d3['getUser'](_0x2410d0['id'])||_0xb828d3['addUser'](_0x2410d0);}}async function tt(_0x331e30){if('404'!==_0x331e30['code'])throw _0x331e30;}function lt(_0x13dae1){if((_0x15b791=_0x13dae1)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x15b791['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x15b791['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x15b791;throw _0x13dae1;}function ot(_0x412d33){return{'threadId':_0x412d33['commentThreadId'],'commentId':_0x412d33['commentId'],'content':_0x412d33['content'],'createdAt':_0x412d33['createdAt'],'authorId':_0x412d33['userId'],'attributes':_0x412d33['attributes']||{}};}class m extends _0x38ec35{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>it)());['_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(_0x4c8875){super(_0x4c8875);const _0x160f70=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x160f70);}['init'](){const _0xb8ce67=this['editor']['plugins']['get'](n),_0xdcdfd=this['editor']['plugins']['get']('TrackChangesEditing');return _0xdcdfd['adapter']={'getSuggestion':async _0x2e5da7=>{await this['_waitForServiceReady']();const _0x59f9c4=await this['_trackChangesService']['get'](_0x2e5da7)['catch'](et);return await this['_fetchMissingUsersForThreads']([_0x59f9c4]),_0x59f9c4;},'addSuggestion':async({id:_0x2d2267,type:_0x502054,data:_0x9774d0,originalSuggestionId:_0x238f01,attributes:_0x137016})=>{await this['_waitForServiceReady']();const _0x2d508f={'id':_0x2d2267,'type':_0x502054,'data':_0x9774d0,'originalSuggestionId':_0x238f01,'attributes':_0x137016},_0x1aa081=await this['_trackChangesService']['add'](_0x2d2267,_0x502054,_0x9774d0,_0x238f01,_0x137016)['catch'](_0x4db040=>{if(dt(_0x4db040))return new Promise(_0x39ba06=>{this['_bufferedRequests']['set'](_0x2d2267,{'resolve':_0x39ba06,'suggestionData':_0x2d508f});});throw _0x4db040;});return this['_bufferedRequests']['delete'](_0x2d2267),_0x1aa081;},'updateSuggestion':async(_0x103d40,_0x227096)=>{if(await this['_waitForServiceReady'](),'open'!==_0x227096['state'])return this['_trackChangesService']['update'](_0x103d40,_0x227096)['catch'](et);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1061d0,_0x4ac4ff)=>{_0xdcdfd['hasSuggestion'](_0x4ac4ff['id'])&&(_0xdcdfd['getSuggestion'](_0x4ac4ff['id'])['attributes']=_0x4ac4ff['attributes']);}),this['_trackChangesService']['connect'](_0xb8ce67['connection'])['then'](_0x31223d=>(_0xb8ce67['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x31223d)['then'](()=>{for(const _0x1057b1 of _0x31223d){_0xdcdfd['addSuggestionData'](_0x1057b1)['_saved']=!0x0;}})));}async['reconnect'](){const _0xb46e43=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x28d24c}=this['editor']['plugins']['get'](n),_0x7ad195=await this['_trackChangesService']['connect'](_0x28d24c);await this['_fetchMissingUsersForThreads'](_0x7ad195);for(const {suggestionData:_0x315a57,resolve:_0xbbf854}of this['_bufferedRequests']['values']()){let _0x8d6bcd=_0x7ad195['find'](_0x2658cd=>_0x2658cd['id']===_0x315a57['id']);_0x8d6bcd||(_0x8d6bcd=await this['_trackChangesService']['add'](_0x315a57['id'],_0x315a57['type'],_0x315a57['data'],_0x315a57['originalSuggestionId'])),_0xbbf854(_0x8d6bcd);}for(const _0x42beb6 of _0x7ad195)_0xb46e43['hasSuggestion'](_0x42beb6['id'])||_0xb46e43['addSuggestionData'](_0x42beb6);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x42e07c=>{this['listenTo'](this['_trackChangesService'],'connected',_0x3df8ce=>{_0x3df8ce['off'](),_0x42e07c();});});}async['_fetchMissingUsersForThreads'](_0x182da4){const _0x4b6a2f=this['editor']['plugins']['get'](_0x14383d),{connection:_0x4447ec}=this['editor']['plugins']['get'](n),_0x47c286=new Set();for(const {authorId:_0x365743}of _0x182da4)_0x4b6a2f['getUser'](_0x365743)||_0x47c286['add'](_0x365743);if(0x0===_0x47c286['size'])return;const _0x145534=await ht['getMany'](_0x4447ec,Array['from'](_0x47c286));for(const _0x4fa9e2 of _0x145534)_0x4b6a2f['getUser'](_0x4fa9e2['id'])||_0x4b6a2f['addUser'](_0x4fa9e2);}}function et(_0x3708e5){if(dt(_0x3708e5))return new Promise(()=>{});throw _0x3708e5;}function dt(_0x1b132f){return _0x1b132f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1b132f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x38ec35{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 _0x318d10=this['editor']['plugins']['get'](n),_0x4c5d7d=this['editor']['plugins']['get']('CommentsEditing'),_0x1ab1e3=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x318d10,'change:state',(_0x230fa1,_0x5afbe0,_0x531597)=>{_0x4c5d7d['isThreadsLoadingPaused']='connected'!==_0x531597;});}),this['listenTo'](_0x318d10,'change:state',(_0x18de2e,_0x287efb,_0x582ebe)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x582ebe);}),_0x1ab1e3['_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 _0x38ec35{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 _0x38ec35{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x1b1037)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x14383d];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4962bb){super(_0x4962bb);const _0x411ed7=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x411ed7);}async['init'](){const _0x29d6b8=this['editor']['plugins']['get'](l),_0x1efd95=_0x29d6b8['serverHistory'],_0x35e7b4=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x1efd95,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x29d6b8['sessionId']});const _0x518ee4=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x302edf=await _0x3eecac['isBundleUploaded'](_0x35e7b4['connection'],_0x518ee4);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x131b0d})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x131b0d)),'updateRevisions':async _0x7ad703=>{await this['_waitForServiceReady']();const _0x49d60e=this['_revisionTracker']['currentRevision'];if(_0x302edf&&0x1===_0x7ad703['length']&&_0x7ad703[0x0]['id']===_0x49d60e['id'])return _0x7ad703;for(const _0x5e8f3f of _0x7ad703)_0x5e8f3f['id']===_0x49d60e['id']&&(_0x5e8f3f['isEmptyCurrent']=_0x5e8f3f['fromVersion']===_0x5e8f3f['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x7ad703,this['_lastRequestId'])['then'](_0x1df29c=>(this['_lastRequestId']=_0x1df29c,_0x7ad703))['catch'](_0x35437a=>{if(V(_0x35437a)||'400'===_0x35437a['code']&&void 0x0!==_0x35437a['data']['wrongRequestId']){for(const _0x419f28 of _0x7ad703){!this['_revisionTracker']['repository']['getRevision'](_0x419f28['id'])||this['_revisionTracker']['_bufferUpdate'](_0x419f28['id'],_0x419f28,!0x1);}if(V(_0x35437a))throw _0x35437a;return _0x7ad703;}throw _0x35437a;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4905dc,{revisionsData:_0x3eb8d8,requestId:_0xe16d44})=>{Math['max'](..._0x3eb8d8['map'](_0x5b4666=>_0x5b4666['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3eb8d8,_0xe16d44);}):this['_handleRevisionsUpdate'](_0x3eb8d8,_0xe16d44);});const {revisions:_0x26c800,requestId:_0x13da6c}=await this['_revisionHistoryService']['connect'](_0x35e7b4['connection']);_0x35e7b4['addToReconnectionStack'](this),this['_lastRequestId']=_0x13da6c,await this['_fetchMissingUsers'](_0x26c800);for(const _0x4da523 of _0x26c800)this['_revisionTracker']['addRevisionData'](_0x4da523);this['listenTo'](_0x29d6b8,'change:_isConnected',(_0x52f773,_0x56c403,_0x2c85a4)=>{_0x2c85a4&&(this['_oldOffset']=_0x29d6b8['_offset'],_0x52f773['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x35e7b4,'state',_0x4cdd56=>_0x4cdd56===_0x207676['CONNECTED']);}async['reconnect'](){const _0x54d0b3=this['editor']['plugins']['get'](n),_0xbe566e=this['editor']['plugins']['get'](l),_0x298a22=async()=>{const _0x99eb89=this['_revisionTracker']['currentRevision'],_0x14d980=_0x99eb89['id'],_0x4ac747=_0x14d980!==_0xbe566e['sessionId'];if(_0x4ac747){const _0x2fb4b2=_0xbe566e['_offset']-this['_oldOffset'],_0x29b83b=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x99eb89['toVersion']+_0x2fb4b2!==_0x29b83b){const _0x5b2c55=_0x99eb89['fromVersion']+_0x2fb4b2,_0x89560a=this['editor']['plugins']['get'](_0x14383d),_0x2b92f5=this['_revisionTracker']['buildRevisionData']({'revision':_0x99eb89,'from':_0x5b2c55,'to':_0x29b83b});_0x2b92f5['id']=_0x99eb89['id'];const _0xd553d5=_0x2b92f5['authorsIds']['map'](_0x1fbb52=>_0x89560a['getUser'](_0x1fbb52));_0x99eb89['_update']({..._0x2b92f5,'authors':_0xd553d5},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x99eb89['id'],_0x2b92f5,!0x0);}this['_revisionTracker']['_startingVersion']=_0x29b83b,(_0x99eb89['toVersion']===_0x99eb89['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x14d980)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x14d980),this['_revisionTracker']['_createCurrentRevision'](_0x29b83b));}const {revisions:_0x278acc,requestId:_0x394ed8}=await this['_revisionHistoryService']['reconnect'](_0x54d0b3['connection'],this['_lastRequestId']);_0x4ac747&&_0x278acc['length']>0x0?_0xbe566e['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x278acc),this['_handleRevisionsUpdate'](_0x278acc,_0x394ed8),this['_revisionTracker']['sendBufferedUpdates']());};return _0xbe566e['_isConnected']?_0x298a22():new Promise((_0x4f9e59,_0x87e05)=>{_0xbe566e['once']('change:_isConnected',()=>{_0x298a22()['then'](_0x4f9e59)['catch'](_0x87e05);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x67ba50=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3cb3bd=>{_0x3cb3bd['off'](),_0x67ba50();});});}['_getLatestVersionFromServerOperations'](){const _0x4916e6=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x157055 of _0x4916e6)if('marker'!==_0x157055['type']||_0x157055['affectsData'])return _0x157055['baseVersion']+0x1;}['_getLatestVersion'](){const _0x5df0ea=this['editor']['plugins']['get'](l);return new Promise(_0x7444d2=>{_0x5df0ea['_isPendingUpdate']?_0x5df0ea['once']('change:_isPendingUpdate',()=>{_0x7444d2(this['_getLatestVersionFromServerOperations']());}):_0x7444d2(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x375b96,_0x3d2edf){const _0x5afd40=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3d2edf;for(const _0x5683a8 of _0x375b96){const _0x24cc7d=_0x5afd40['getRevision'](_0x5683a8['id']);if(_0x24cc7d){if((_0x5683a8['fromVersion']||_0x5683a8['toVersion'])&&(_0x5683a8['diffData']=null),_0x24cc7d===this['_revisionTracker']['currentRevision']){const _0x429411=Math['max'](_0x24cc7d['toVersion'],_0x5683a8['toVersion']),_0x1d3b03=Math['max'](_0x24cc7d['fromVersion'],_0x5683a8['fromVersion']);let _0x143c47;_0x24cc7d['toVersion']===_0x5683a8['toVersion']&&_0x24cc7d['fromVersion']===_0x5683a8['fromVersion']?(_0x143c47=!0x0,this['_preventResendingRevisionData'](_0x5683a8)):_0x5683a8['toVersion']===_0x429411&&_0x5683a8['fromVersion']===_0x1d3b03?_0x143c47=!0x1:(_0x24cc7d['toVersion']===_0x429411&&_0x24cc7d['fromVersion']===_0x1d3b03||this['_fixRevision']({'revision':_0x24cc7d,'from':_0x1d3b03,'to':_0x429411}),_0x143c47=!0x0),_0x143c47&&(delete _0x5683a8['fromVersion'],delete _0x5683a8['toVersion'],delete _0x5683a8['diffData'],delete _0x5683a8['createdAt'],delete _0x5683a8['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x5683a8),this['_preventResendingRevisionData'](_0x5683a8);}else this['_revisionTracker']['addRevisionData'](_0x5683a8);}const _0x3c9a59=_0x5afd40['getRevisions']();_0x3c9a59['reverse']();for(let _0x4ae714=0x0;_0x4ae714<_0x3c9a59['length']-0x1;_0x4ae714++){const _0xb45451=_0x3c9a59[_0x4ae714],_0x3ba652=_0x3c9a59[_0x4ae714+0x1];if(_0xb45451['fromVersion']<_0x3ba652['toVersion']){const _0x534239=_0x3ba652['toVersion'],_0x521ed6=Math['max'](_0x534239,_0xb45451['toVersion']);this['_fixRevision']({'revision':_0xb45451,'from':_0x534239,'to':_0x521ed6});}}}['_fixRevision']({revision:_0x24751c,from:_0xf32546,to:_0xa10870}={}){const _0x4f4452=this['editor']['plugins']['get'](_0x14383d),_0x21543c=this['_revisionTracker']['buildRevisionData']({'revision':_0x24751c,'from':_0xf32546,'to':_0xa10870});_0x21543c['authors']=_0x21543c['authorsIds']['map'](_0x1e5c9b=>_0x4f4452['getUser'](_0x1e5c9b)),_0x24751c['_update'](_0x21543c);}['_preventResendingRevisionData'](_0x1b8b89){const _0x5d18f3={};_0x5d18f3['id']=_0x1b8b89['id'];for(const _0x579cbe of Object['keys'](_0x1b8b89))'id'!==_0x579cbe&&(_0x5d18f3[_0x579cbe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5d18f3['id'],_0x5d18f3,!0x0);}async['_fetchMissingUsers'](_0x4b9d84){const _0x42d2ee=this['editor']['plugins']['get'](_0x14383d),{connection:_0x142750}=this['editor']['plugins']['get'](n),_0x37fc7d=new Set();for(const _0x167407 of _0x4b9d84){for(const _0x1ea203 of _0x167407['authorsIds'])_0x24970b(_0x1ea203);_0x167407['creatorId']&&_0x24970b(_0x167407['creatorId']);}if(0x0===_0x37fc7d['size'])return;const _0x392f0f=await ht['getMany'](_0x142750,Array['from'](_0x37fc7d));for(const _0x49c00a of _0x392f0f)_0x42d2ee['getUser'](_0x49c00a['id'])||_0x42d2ee['addUser'](_0x49c00a);function _0x24970b(_0x17c7cf){_0x42d2ee['getUser'](_0x17c7cf)||_0x37fc7d['add'](_0x17c7cf);}}}function V(_0x440a22){return _0x440a22['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x440a22['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x440a22['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x38ec35{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 _0x422411{['_collapseAt'];constructor(_0x4b6937,_0x10b85f=0x6){super(_0x4b6937);const _0x28b059=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x10b85f,this['bind']('isHidden')['to'](this,'usersCount',_0x594ce5=>_0x594ce5<_0x10b85f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x28b059['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':_0x28b059['to']('usersCount',_0x1f5d4f=>'+'+(_0x1f5d4f-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x422411{['items'];['keystrokes'];constructor(_0x3476c0){super(_0x3476c0);const _0xf5571=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x4b7810(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0xf5571['if']('hasPopup'),'aria-expanded':_0xf5571['to']('isExpanded',_0x49f3f3=>this['hasPopup']&&String(_0x49f3f3)),'aria-label':_0xf5571['to']('hasPopup',_0x5ea2cc=>R(_0x3476c0,_0x5ea2cc?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0xf5571['to']('hasPopup',_0x2ec318=>!!_0x2ec318&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0xf5571['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0xf5571['to'](_0x1149c2=>{const _0x40ae94=_0x1149c2,_0x2e2c3c=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4469d2=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2e2c3c?.['contains'](_0x40ae94['relatedTarget'])||_0x4469d2?.['contains'](_0x40ae94['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x3e021c,_0x324e52,_0x6de396)=>{this['element']&&(_0x6de396?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class z extends _0x422411{['counterView'];['inlineListView'];constructor(_0x3938c4,_0x499062=0x6){super(_0x3938c4);const _0x250579=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new B(this['locale'],_0x499062),this['inlineListView']=new is(_0x3938c4),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x51fd36 of this['inlineListView']['items'])_0x51fd36['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',_0x250579['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class J extends _0x422411{['listWrapperView'];constructor(_0x14451b,_0x11d5a5){super(_0x14451b);const _0x4efc48=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x14451b,_0x11d5a5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':R(_0x14451b,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x4efc48['to'](_0x1b8a6d=>{const _0x43126c=_0x1b8a6d,_0x34f587=document['querySelector']('.ck-presence-list__list'),_0x52b994=document['querySelector']('.ck-balloon-panel_with-arrow');_0x34f587?.['contains'](_0x43126c['relatedTarget'])||_0x52b994?.['contains'](_0x43126c['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x462fd8{constructor(_0x1a8ba2,_0x312ea8){super(_0x1a8ba2);const _0x35dba6=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x312ea8?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x35dba6['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x35dba6['to']('role'),'aria-label':_0x35dba6['to']('ariaLabel'),'aria-labelledby':_0x35dba6['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3be0ca['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x32c1dd=this['element'];_0x32c1dd&&(this['_isScrollable']=Math['max'](_0x32c1dd['scrollHeight'],_0x32c1dd['clientHeight'])>0.8*window['innerHeight']);}}class K extends st{['userView'];constructor(_0x153273,_0x3c7fbf,_0x401228){super(_0x153273);const _0x3dba76=this['bindTemplate'];this['userView']=new rt(_0x153273,_0x3c7fbf);const _0x59c840={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x3c7fbf['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x3c7fbf['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3c7fbf['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x401228&&(_0x59c840['tag']='button',_0x59c840['on']={'click':_0x3dba76['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x59c840);}['focus'](){this['element']['focus']();}}class Q extends _0x422411{['userView'];['markerView'];constructor(_0x47646a,_0x383fb1,_0xcd190b){super(_0x47646a);const _0x26f448=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new rt(_0x47646a,_0x383fb1),this['markerView']=new MarkerView(_0x47646a,_0x383fb1);const _0x4f4329=new at(_0x47646a);_0x4f4329['template']['tag']='span',_0x4f4329['text']=_0x383fb1['name'];const _0x47d768={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x26f448['to']('isFocusable',_0x587fa9=>!!_0x587fa9&&0x0),'aria-labelledby':_0x4f4329['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x26f448['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x26f448['to']('hasTooltip',_0x3c3489=>!_0x3c3489),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4f4329]};_0xcd190b&&(_0x47d768['tag']='button',_0x47d768['on']={'click':_0x26f448['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x47d768);}}class MarkerView extends _0x422411{constructor(_0x18402e,_0x4f895c){super(_0x18402e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4f895c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const X={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x57ac80{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x37c5e2){super(_0x37c5e2),this['context']['config']['define']('presenceList',X);const _0x35f7e4=_0x37c5e2['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x35f7e4)throw new _0x533522('presencelist-collapseat-invalid-format',this);if(_0x35f7e4<0x1)throw new _0x533522('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5510de(),this['balloonPanelView']=new _0x21eb1a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x440468 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x440468);this['listenTo'](this['_allConnectedUsers'],'add',(_0x472297,_0xc41ff5)=>{this['_handleUserAdd'](_0xc41ff5);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5ac3b2,_0x1552fd)=>{this['_handleUserRemove'](_0x1552fd);});}['_createView'](){const _0x53ca01=this['context'],_0x1850ab=new z(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xe8efa=this['balloonPanelView'];if(!_0x5b9bb3(_0x53ca01['config']['get']('presenceList.container')))throw new _0x533522('presencelist-missing-container',this);return _0x1850ab['counterView']['bind']('usersCount')['to'](this),_0x1850ab['bind']('isCollapsed')['to'](this,'usersCount',_0x4ae286=>{const {collapseAt:_0x1cf2e3}=_0x53ca01['config']['get']('presenceList'),_0x1c661e=_0x4ae286>=_0x1cf2e3;if(_0x1c661e&&!_0x1850ab['inlineListView']['items']['find'](_0x1ab609=>_0x1ab609 instanceof B)){const _0x264e00=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x264e00&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x1850ab['inlineListView']['items']['add'](_0x1850ab['counterView']);}return _0x1c661e||this['hideDropdown'](),_0x1c661e;}),_0x1850ab['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x37e96c=>{const _0x23778c=_0x53ca01['config']['get']('presenceList'),_0x402d1c=new Q(_0x53ca01['locale'],_0x37e96c,!!_0x23778c['onClick']);return _0x402d1c['bind']('hasTooltip')['to'](_0x1850ab,'isCollapsed',_0x265010=>!_0x265010),_0x402d1c['bind']('isFocusable')['to'](_0x1850ab,'isCollapsed',_0x49e4c8=>!_0x49e4c8),_0x23778c['onClick']&&this['listenTo'](_0x402d1c,'execute',()=>{this['view']['isCollapsed']||_0x23778c['onClick'](_0x37e96c,_0x402d1c['element']);}),_0x402d1c;}),this['listenTo'](_0x1850ab['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x1850ab['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x1850ab['inlineListView']['keystrokes']['set']('Enter',(_0x5e4c72,_0x33f12c)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x33f12c());}),_0x1850ab['render'](),_0xe8efa['render'](),_0x32589f({'emitter':_0x1850ab,'activator':()=>_0xe8efa['isVisible'],'contextElements':[_0xe8efa['element'],_0x1850ab['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x53ca01['config']['get']('presenceList.container')['appendChild'](_0x1850ab['element']),this['_bodyCollection']=new _0x272992(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x1850ab;}['_handleUserAdd'](_0x95f052){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x95f052['isMe'])return;const _0x28a5e2=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x28a5e2-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x5df605=_0x95f052['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x95f052,_0x5df605);}['_handleUserRemove'](_0x235aa3){this['usersCount']--;const {collapseAt:_0x3f3f6e}=this['context']['config']['get']('presenceList'),_0x154daa=this['usersCount']>=_0x3f3f6e;if(this['currentDisplayedUsers']['get'](_0x235aa3['id']))this['currentDisplayedUsers']['remove'](_0x235aa3['id']);else{if(_0x154daa&&this['currentDisplayedUsers']['length']+0x1===_0x3f3f6e-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x154daa?0x1:0x0)<this['usersCount']){for(const _0x2a7ea0 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x2a7ea0['id'])&&(this['currentDisplayedUsers']['add'](_0x2a7ea0,Math['min'](this['currentDisplayedUsers']['length']-(_0x154daa?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x154daa?0x1:0x0)===_0x3f3f6e-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x276fef=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new J(this['context']['locale'],!!_0x276fef['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x202021}=this['presenceDropdownView'];_0x202021['items']['bindTo'](this['_allConnectedUsers'])['using'](_0xc012d7=>{if(!_0x276fef['displayMe']&&_0xc012d7['isMe'])return null;const _0x3bd835=new K(this['context']['locale'],_0xc012d7,!!_0x276fef['onClick']);return _0x276fef['onClick']&&this['listenTo'](_0x3bd835,'execute',()=>{_0x276fef['onClick'](_0xc012d7,_0x3bd835['element']);}),_0x3bd835;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x202021['focus'](),_0x202021['checkIfScrollable']();const _0x292f07=(_0x4844d0,_0x59ea25)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x59ea25();};_0x202021['keystrokes']['set']('Esc',_0x292f07),_0x202021['keystrokes']['set']('Shift+Tab',_0x292f07),_0x202021['keystrokes']['set']('Tab',(_0x59edc4,_0x2fb99d)=>{!function(_0x1a937d){const _0x5b7cef=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x5dbb19=>_0x5dbb19+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x35d515=[...document['body']['querySelectorAll'](_0x5b7cef)]['filter'](_0x5aba77=>_0x5aba77===document['activeElement']||_0x5aba77['offsetWidth']+_0x5aba77['offsetHeight']>0x0)['sort']((_0x2a5064,_0x281f05)=>(_0x2a5064['tabIndex']||0x0)-(_0x281f05['tabIndex']||0x0)),_0x48d9f1=_0x35d515['indexOf'](_0x1a937d),_0x24ace9=_0x35d515[(_0x48d9f1+0x1)%_0x35d515['length']];_0x24ace9&&_0x24ace9['focus']();}(this['view']['element']),this['hideDropdown'](),_0x2fb99d();}),_0x202021['focusTracker']['add'](this['view']['element']),_0x202021['focusTracker']['on']('change:isFocused',(_0x423361,_0x1d63c1,_0x3f4dc1)=>{_0x3f4dc1||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 _0x57ac80{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x6f804a,Plugin as _0x25b979,PendingActions as _0x235b6b,Context as _0x506ccb}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x2dbd2e,CKEditorError as _0xb4ae54,Collection as _0x247fc3,global as _0x57f3d3,version as nt,uid as _0x525198,KeystrokeHandler as _0x5360be}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3e1d7c,View as _0x1c3372,ListView as _0x4de888,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x146574,clickOutsideHandler as _0x144a34,BodyCollection as _0x5c43da}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x59bb9f,History as _0x49c641,NoOperation as _0x566909,InsertOperation as _0x4dfc76,MarkerOperation as _0x7b3172,RootAttributeOperation as _0x3b01b0,transformOperationSets as _0x3283fc,OperationFactory as _0x2f9f6e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as at,WEB_SOCKET_GATEWAY_STATES as _0x36321a,CollaborativeEditingService as _0x21cc40,User as ht,CommentsService as _0x3a26f5,TrackChangesService as _0x1035fa,RevisionHistoryService as _0x16dd6a,EditorService as _0x25c22d}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x4fba0e,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x504bc6}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x245a67}from'es-toolkit/compat';class n extends _0x6f804a{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>at)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3e1d7c];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xb23052){super(_0xb23052),this['set']('state',_0x36321a['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2dbd2e())();}['init'](){const _0x145201=this['context'],_0x1857a9=_0x145201['plugins']['get']('CloudServices'),_0x854bd4=_0x145201['plugins']['get'](_0x3e1d7c);if(!_0x1857a9['token'])throw new _0xb4ae54('websocketgateway-missing-token',this);if(!_0x1857a9['webSocketUrl'])throw new _0xb4ae54('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x1857a9['token'],_0x1857a9['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5134aa=>{if(this['connection']=_0x5134aa,this['bind']('state')['to'](_0x5134aa,'state',this,'_isBrowserOffline',(_0x3da22f,_0x54ba08)=>('connected'!==_0x3da22f&&(this['_shouldPluginsReconnect']=!0x0),_0x54ba08||_0x3da22f!==_0x36321a['CONNECTED']?_0x36321a['DISCONNECTED']:this['state']==_0x36321a['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x36321a['CONNECTING']):_0x36321a['CONNECTED'])),this['connection']['on']('error',(_0x3084f0,_0x38c974)=>{if('limitExceeded'!==_0x38c974['code'])throw console['error'](_0x38c974),new _0xb4ae54('cloudservices-init',null,{'originalError':_0x38c974});_0x854bd4['showWarning']('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':'real-time-collaboration'});}),!_0x5134aa['me'])return new Promise(_0x3e48a0=>_0x5134aa['on']('change:me',_0x3e48a0));})['catch'](_0xc1c03b=>{throw console['error'](_0xc1c03b),new _0xb4ae54('cloudservices-init',null,{'originalError':_0xc1c03b});});}['addToReconnectionStack'](_0x5b7927){if('function'!=typeof _0x5b7927['reconnect'])throw new _0xb4ae54('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5b7927))throw new _0xb4ae54('websocketgateway-plugin-already-registered',this,{'name':_0x5b7927['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5b7927);}['removeFromReconnectionStack'](_0x1ac1ac){this['_reconnectionStack']['delete'](_0x1ac1ac);}['isInReconnectionStack'](_0x103f81){return this['_reconnectionStack']['has'](_0x103f81);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x495a72=>_0x495a72['reconnect']())))['then'](()=>this['state']=_0x36321a['CONNECTED'])['catch'](_0x182ae8=>{throw console['error'](_0x182ae8),new _0xb4ae54('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x36321a['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x6f804a{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x4fba0e];}constructor(_0x50ebb1){super(_0x50ebb1),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x247fc3(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4fba0e);}['init'](){const _0x278446=this['context']['plugins']['get'](n);this['listenTo'](_0x278446,'change:state',(_0xf474e9,_0x1412e9,_0x14a3bf)=>{if('connected'!==_0x14a3bf)this['channelSessions']['forEach'](_0x346632=>_0x346632['clear']()),this['channelConnectedUsers']['forEach'](_0x206cd6=>_0x206cd6['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x23792b,_0x13acf1]of this['_registeredSessions'])for(const _0x55121d of _0x13acf1)this['_handleSessionAdd'](_0x23792b,_0x55121d);}}),this['_createUser'](_0x278446['connection']['me'],!0x0);}['register'](_0x550fd9,_0x37d088){if(this['_registeredSessions']['has'](_0x550fd9))throw new _0xb4ae54('sessions-register-already-registered',null,{'channelId':_0x550fd9});this['_registeredSessions']['set'](_0x550fd9,_0x37d088),this['channelSessions']['set'](_0x550fd9,new _0x247fc3()),this['channelConnectedUsers']['set'](_0x550fd9,new _0x247fc3()),this['listenTo'](_0x37d088,'add',(_0x3963d2,_0x221931)=>this['_handleSessionAdd'](_0x550fd9,_0x221931)),this['listenTo'](_0x37d088,'remove',(_0xc44466,_0x3640a4)=>this['_handleSessionRemove'](_0x550fd9,_0x3640a4));for(const _0x2ca5a5 of _0x37d088)this['_handleSessionAdd'](_0x550fd9,_0x2ca5a5);}['unregister'](_0x11fc63){if(!this['_registeredSessions']['has'](_0x11fc63))throw new _0xb4ae54('sessions-unregister-not-exist',null,{'channelId':_0x11fc63});const _0x1944cd=this['_registeredSessions']['get'](_0x11fc63);this['stopListening'](_0x1944cd);for(const _0xce34fb of _0x1944cd)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x11fc63,_0xce34fb);this['_registeredSessions']['delete'](_0x11fc63),this['channelSessions']['delete'](_0x11fc63),this['channelConnectedUsers']['delete'](_0x11fc63);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x3ca925){for(const _0x3ffab3 of this['channelSessions']['values']())for(const _0xac68cc of _0x3ffab3)if(_0xac68cc['id']===_0x3ca925)return _0xac68cc['user'];}['getUserSessions'](_0x2dbb8e,_0x553a00){const _0x41e212=_0x553a00?[this['channelSessions']['get'](_0x553a00)]:this['channelSessions']['values'](),_0x26fc40=new Set();for(const _0x28d43a of _0x41e212)for(const _0x9fee79 of _0x28d43a)_0x9fee79['user']['id']===_0x2dbb8e['id']&&_0x26fc40['add'](_0x9fee79['id']);return _0x26fc40;}['getUserRole'](_0x557a0c){for(const _0x5598ef of this['channelSessions']['values']())for(const _0x351c1e of _0x5598ef)if(_0x351c1e['user']===_0x557a0c)return _0x351c1e['role'];}['_handleSessionAdd'](_0x51ba5f,_0x4afe19){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x4bff60=_0x4afe19['user'],_0x3f480f=this['_users']['getUser'](_0x4bff60['id'])||this['_createUser'](_0x4bff60),_0x204f30=Object['assign']({},_0x4afe19,{'user':_0x3f480f});if(this['channelSessions']['get'](_0x51ba5f)['add'](_0x204f30),!_0x4bff60['hiddenInPresenceList']){const _0x284e30=this['channelConnectedUsers']['get'](_0x51ba5f);_0x284e30['has'](_0x3f480f['id'])||_0x284e30['add'](_0x3f480f),this['allConnectedUsers']['has'](_0x3f480f['id'])||_0x4bff60['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x3f480f,_0x3f480f['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x51ba5f,{'channelId':_0x51ba5f,'session':_0x204f30});}['_handleSessionRemove'](_0x2c0a90,_0x323c43){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x529989=this['channelConnectedUsers']['get'](_0x2c0a90),_0x108d78=_0x323c43['user'];_0x108d78['id']&&(this['channelSessions']['get'](_0x2c0a90)['remove'](_0x323c43['id']),_0x529989['has'](_0x108d78['id'])&&!this['getUserSessions'](_0x108d78,_0x2c0a90)['size']&&_0x529989['remove'](_0x108d78['id']),this['allConnectedUsers']['get'](_0x108d78['id'])&&!this['getUserSessions'](_0x108d78)['size']&&this['allConnectedUsers']['remove'](_0x108d78['id']));}['_createUser'](_0x2373a0,_0xa3572){const _0xff6cda=this['_users']['addUser'](_0x2373a0);return _0xa3572&&this['_users']['defineMe'](_0x2373a0['id']),_0xff6cda['orderNumber']=this['_uniqueUsersCount']++,_0xff6cda;}}class N extends _0x25b979{['_domEmitter']=new(_0x2dbd2e())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3e01d0=this['editor'],_0xb19470=_0x3e01d0['plugins']['get'](i);_0x3e01d0['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3c62d4,{writer:_0x39fea8})=>function(_0xd435bb,_0x45e02f,_0x26ac71,_0x472f6d){const _0x1a8827=_0xd435bb['markerName']['split'](':')[0x2],_0x12dd32=_0x26ac71['getUserBySessionId'](_0x1a8827);if(!_0x12dd32||_0x1a8827===_0x26ac71['mySessionId'])return;if(!_0x472f6d['model']['schema']['checkChild'](_0xd435bb['markerRange']['start'],'$text'))return;const _0x5653aa={'class':'ck-user__marker\x20'+_0x12dd32['color']['getMarkerClass'](),'data-name':_0x12dd32['name'],'data-session-id':_0x1a8827},_0x10cef2=_0x472f6d['model']['markers']['get'](_0xd435bb['markerName']),_0x520ac1=_0x10cef2['getStart'](),_0x3116e1=_0x520ac1['nodeAfter'],_0x16caef=_0x472f6d['model']['schema'];if(_0x3116e1&&_0x16caef['isObject'](_0x3116e1)&&_0x16caef['isInline'](_0x3116e1)&&!_0x472f6d['model']['markers']['get']('user:range:'+_0x1a8827)['getRange']()['isCollapsed'])return;const _0x4fba67=_0x520ac1['parent'];return _0x472f6d['model']['schema']['isLimit'](_0x4fba67)&&!_0x472f6d['model']['hasContent'](_0x4fba67)&&(_0x5653aa['contenteditable']=!0x1),function(_0x236131,_0x5ea949,_0x3dfe47){const _0x1f5f46=_0x236131['createUIElement']('span',_0x5ea949);return _0x236131['setCustomProperty']('userPositionMarker',!0x0,_0x1f5f46),_0x1f5f46['render']=function(_0x266e41){const _0x9b3418=this['toDomElement'](_0x266e41),_0x1ec3ed=document['createElement']('span');return _0x1ec3ed['classList']['add']('ck-user__marker-tooltip'),_0x1ec3ed['setAttribute']('contenteditable','false'),_0x1ec3ed['setAttribute']('spellcheck','false'),_0x1ec3ed['textContent']=_0x3dfe47['name'],_0x9b3418['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x1ec3ed['outerHTML']+'⁠',_0x9b3418['addEventListener']('mouseenter',()=>{_0x9b3418['classList']['add']('ck-user__marker_hovered');}),_0x9b3418['addEventListener']('mouseleave',()=>{_0x9b3418['classList']['remove']('ck-user__marker_hovered');}),_0x9b3418;},_0x1f5f46['isSimilar']=function(_0x1e9d22){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1e9d22['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1e9d22['getAttribute']('data-session-id'));},_0x1f5f46;}(_0x45e02f,_0x5653aa,_0x12dd32);}(_0x3c62d4,_0x39fea8,_0xb19470,_0x3e01d0)}),_0x3e01d0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0xddbd27=>function(_0x29d85b,_0x1f39eb){const _0x82bdb7=_0x29d85b['markerName']['split'](':')[0x2];if(_0x82bdb7===_0x1f39eb['mySessionId'])return null;const _0x485ed0=_0x1f39eb['getUserBySessionId'](_0x82bdb7);if(!_0x485ed0)return{'id':_0x82bdb7,'classes':[]};return{'id':_0x82bdb7,'classes':['ck-user__selection',_0x485ed0['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x82bdb7},'priority':0x7d0+_0x485ed0['orderNumber']};}(_0xddbd27,_0xb19470)}),function(_0x91ff2c){const _0x32a3e2=_0x91ff2c['model'],_0x431652=new Map(),_0x33f71f=_0x91ff2c['plugins']['get'](i);_0x32a3e2['markers']['on']('update:user:range',(_0x2f953d,_0x18d6ad,_0x197dff,_0x27b530)=>{if(!_0x27b530&&_0x431652['get'](_0x18d6ad['name']))return _0x431652['get'](_0x18d6ad['name'])['detach'](),void _0x431652['delete'](_0x18d6ad['name']);const _0x26afcf=_0x18d6ad['name']['split'](':')[0x2];if(_0x26afcf===_0x33f71f['mySessionId'])return;const _0xfbeefb='user:position:'+_0x26afcf;_0x32a3e2['markers']['has'](_0xfbeefb)&&_0x91ff2c['editing']['reconvertMarker'](_0xfbeefb),_0x18d6ad['on']('change:range',(_0x3fa395,_0x5cbf91,_0xa733c0)=>{if('$graveyard'!=_0x5cbf91['root']['rootName']&&'$graveyard'==_0x18d6ad['getRange']()['root']['rootName']&&!_0x431652['has'](_0x18d6ad['name'])){const _0x31e4a4=_0x32a3e2['schema']['getNearestSelectionRange'](_0xa733c0['deletionPosition']);if(_0x31e4a4){const _0x47e4e8=_0x59bb9f['fromRange'](_0x31e4a4);_0x431652['set'](_0x18d6ad['name'],_0x47e4e8),_0x47e4e8['on']('change:range',(_0x3c647b,_0x44db0,_0x5545f1)=>{if('$graveyard'==_0x47e4e8['root']['rootName']){const _0x26a344=_0x32a3e2['schema']['getNearestSelectionRange'](_0x5545f1['deletionPosition']);_0x26a344?(_0x47e4e8['start']=_0x26a344['start'],_0x47e4e8['end']=_0x26a344['end']):(_0x431652['delete'](_0x18d6ad['name']),_0x47e4e8['detach']());}});}}});}),_0x32a3e2['document']['on']('change',()=>{_0x431652['size']>0x0&&_0x32a3e2['enqueueChange']({'isUndoable':!0x1},_0x3316ea=>{for(const [_0x359703,_0x1dd5e2]of _0x431652)'$graveyard'==_0x32a3e2['markers']['get'](_0x359703)['getRange']()['root']['rootName']&&(J(_0x359703['split'](':')[0x2],_0x1dd5e2['toRange'](),_0x32a3e2,_0x3316ea),_0x1dd5e2['detach']());_0x431652['clear']();});});}(_0x3e01d0),this['_domEmitter']['listenTo'](_0x57f3d3['document'],'keydown',(_0x36e32a,{key:_0x56010c})=>{'Escape'===_0x56010c&&function(_0x5dca6d){_0x5dca6d['editing']['view']['change'](_0x4b47a7=>{for(const _0x4cf76d of _0x5dca6d['model']['markers']){if(!_0x4cf76d['name']['startsWith']('user:position'))continue;const _0x41140c=_0x5dca6d['editing']['mapper']['markerNameToElements'](_0x4cf76d['name']);if(_0x41140c){for(const _0x349a8a of _0x41140c)_0x4b47a7['removeClass']('ck-user__marker_hovered',_0x349a8a);}}});}(_0x3e01d0);},{'useCapture':!0x0});}['afterInit'](){const _0x259daf=this['editor'],_0x3bb581=_0x259daf['commands']['get']('undo');_0x3bb581&&_0x259daf['model']['on']('applyOperation',(_0x592e87,_0x1132d3)=>{const _0x2e8e67=_0x1132d3[0x0];if(!_0x2e8e67['isDocumentOperation'])return;if('marker'!=_0x2e8e67['type']||!_0x2e8e67['name']['startsWith']('user:'))return;const _0x16baab=_0x2e8e67['batch'];_0x3bb581['_createdBatches']['has'](_0x16baab)&&(_0x2e8e67['newRange']=_0x2e8e67['oldRange']?_0x259daf['model']['createRange'](_0x2e8e67['oldRange']['start'],_0x2e8e67['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x17ad26=this['editor'],_0x31be4a=_0x17ad26['model']['document'],_0x4813db=_0x17ad26['plugins']['get'](i);_0x17ad26['model']['enqueueChange']({'isUndoable':!0x1},_0x209d3b=>{const _0x5eb139='user:range:'+_0x4813db['mySessionId'],_0x56377e='user:position:'+_0x4813db['mySessionId'],_0x1f220a=_0x17ad26['model']['markers']['has'](_0x5eb139);_0x17ad26['editing']['view']['hasDomSelection']?J(_0x4813db['mySessionId'],_0x31be4a['selection']['getFirstRange'](),_0x17ad26['model'],_0x209d3b):_0x1f220a&&(_0x209d3b['removeMarker'](_0x5eb139),_0x209d3b['removeMarker'](_0x56377e));});}}function J(_0x131c55,_0x2f8199,_0x11f359,_0x4da829){const _0xe6a6a1='user:range:'+_0x131c55,_0x5d5ff3='user:position:'+_0x131c55,_0x176f18=_0x2f8199['getContainedElement']();let _0x422bcc=_0x2f8199['start'];if(_0x176f18&&_0x176f18['is']('element','tableCell')){const _0x5612a7=function(_0x3a09d1,_0x37232b){for(const _0x198ccc of _0x3a09d1['getPositions']())if(_0x37232b['schema']['checkChild'](_0x198ccc,'$text'))return _0x198ccc;}(_0x2f8199,_0x11f359);_0x5612a7&&(_0x422bcc=_0x5612a7,_0x2f8199=_0x4da829['createRange'](_0x422bcc));}const _0x5180e0=_0x4da829['createRange'](_0x422bcc);_0x11f359['markers']['has'](_0xe6a6a1)?(_0x4da829['updateMarker'](_0xe6a6a1,{'range':_0x2f8199}),_0x4da829['updateMarker'](_0x5d5ff3,{'range':_0x5180e0})):(_0x4da829['addMarker'](_0xe6a6a1,{'range':_0x2f8199,'usingOperation':!0x0}),_0x4da829['addMarker'](_0x5d5ff3,{'range':_0x5180e0,'usingOperation':!0x0}));}function B(_0x4ddb1f,_0x4b2f6d,_0x147b33){const _0x3f4958=_0x4ddb1f['t'],t=_0x4ddb1f['t'];switch(_0x4b2f6d){case'PENDING_ACTION_SENDING_DATA':return t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'});case'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'Synchronization\x20issue':return t('Synchronization\x20issue');case'Connected\x20users\x20list\x20dropdown\x20menu':return t('Connected\x20users\x20list\x20dropdown\x20menu');case'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':return t('Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)');case'Connected\x20users\x20list':return t('Connected\x20users\x20list');case'PENDING_ACTION_REVISION_HISTORY':return _0x3f4958({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'CONNECTED_USERS':return t({'string':'1\x20connected\x20user\x20(me)','plural':'%0\x20connected\x20users','id':'CONNECTED_USERS'},_0x147b33);default:return'';}}let z=0x1;class l extends _0x25b979{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x21cc40)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,N,_0x235b6b,_0x4fba0e,_0x3e1d7c];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x345825=this['serverHistory']['getOperations']();for(let _0x3b158=_0x345825['length']-0x1;_0x3b158>=0x0;_0x3b158--){const _0x2f547a=_0x345825[_0x3b158];if(!this['_disconnectionOperations']['has'](_0x2f547a))return _0x2f547a['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3b9df9){if(super(_0x3b9df9),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x49c641(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0xb4ae54('collaboration-missing-channelid',this);const _0xaaadf6=_0x3b9df9['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xaaadf6,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x504bc6(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x540954=this['editor'],_0x17f4b4=_0x540954['plugins']['get'](_0x4fba0e),_0x18d655=_0x540954['plugins']['get'](n);this['listenTo'](_0x17f4b4,'getOperationAuthor',(_0x509fe0,_0x1fcae7)=>{const _0x14bda3=_0x1fcae7[0x0];_0x14bda3['_authorId']&&(_0x509fe0['return']=_0x17f4b4['getUser'](_0x14bda3['_authorId']),_0x509fe0['stop']()),null===_0x14bda3['_authorId']&&(_0x509fe0['return']=null,_0x509fe0['stop']());},{'priority':'high'}),this['listenTo'](_0x540954['model']['document']['selection'],'change:range',(_0x59fc11,_0x5c3aaf)=>{_0x5c3aaf['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x540954['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x540954['model']['on']('applyOperation',(_0x1b818b,_0x5ceee2)=>{const _0x3d1b42=_0x5ceee2[0x0];_0x3d1b42['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x3d1b42),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x18d655,'state',this,'_hasSynchronizationProblem',(_0x1c23e3,_0x18096c)=>'connected'===_0x1c23e3&&!_0x18096c),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x540954['disableReadOnlyMode']('rtc-offline'):_0x540954['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x540954['disableReadOnlyMode']('rtc-offline'):_0x540954['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1e595e=this['editor']['plugins']['get'](i),_0x16d362=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x1e595e['unregister'](this['_channelId']);const _0x5f4cd8=await this['_service']['reconnect'](_0x16d362['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5f4cd8)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x152cf2=await this['_service']['getConnectedSessions']();_0x1e595e['register'](this['_channelId'],_0x152cf2),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x3ac4bb){if(function(_0x10f1e2){return'404'===_0x10f1e2['code'];}(_0x3ac4bb)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5dca9c){return'409'===_0x5dca9c['code'];}(_0x3ac4bb)){const _0x46fae2=B(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x46fae2);}else{if(!(_0x3ac4bb instanceof ReconnectionError))throw _0x3ac4bb;this['_handleReconnectionError']();}}}}['destroy'](){const _0x677b6=this['editor']['plugins']['get'](n),_0x205e60=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x205e60['channelSessions']['has'](this['_channelId'])&&_0x205e60['unregister'](this['_channelId']),_0x677b6['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x1b0e59){if(this['sessionId']!==_0x1b0e59['sessionId']&&this['_lastSyncedOperationId']!==_0x1b0e59['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x1b0e59['sessionId'],this['_handleServerResponse']([],{..._0x1b0e59,'wereChangesApplied':!0x1,'data':_0x1b0e59['data']},'reconnect');}async['_connectService'](_0x357ee7,_0x30ab1d=!0x1){const {connection:_0x46e7ad}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x46e7ad,this['_channelId'])['then'](_0x3f99d7=>this['_initSessionsHandling'](_0x3f99d7))['catch'](_0x23a8dd=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x23a8dd);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xeaf0d2,_0xb35574)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xb35574);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xeb945c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x357ee7);this['_isPendingUpdate']=!0x0;const _0x572731=await this['_service']['connect'](_0x46e7ad,this['_compressOperations'](_0x357ee7),_0xeb945c);if(this['sessionId']=_0x572731['sessionId'],_0x30ab1d){if(!_0x572731['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x572731['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x357ee7,_0x572731,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x572731,_0x357ee7);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3a3c00=this['editor']['plugins']['get'](i),_0x1fd868=this['editor']['plugins']['get'](N),_0x359073=_0x3a3c00['channelSessions']['get'](this['_channelId']);_0x359073&&_0x359073['length']>0x1?_0x1fd868['createUserMarkerOperations']():this['listenTo'](_0x3a3c00,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3a3c00['channelSessions']['get'](this['_channelId'])['length']&&_0x1fd868['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x51a602,_0x40cfb4,_0x31973d,_0xfeb6bb){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x40cfb4){const _0x5172c2=this['_decompressOperations'](_0x31973d,_0xfeb6bb);await this['_fetchMissingUsers'](_0x5172c2),this['_handleExternalOperations'](_0x5172c2,_0x40cfb4,_0x31973d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x49a3f2}=this['editor'];let _0x57305f;try{_0x57305f=await this['_service']['getDocumentDetails']();}catch{const _0xb93821=B(_0x49a3f2,'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0xb93821);}const _0x5220dc=_0x57305f['currentDocumentSession']||_0x57305f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5220dc['lastOperationId']){const _0x5129ec=B(_0x49a3f2,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x5129ec);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x57f56a){const _0x58ba57=this['editor']['plugins']['get'](i);this['listenTo'](_0x58ba57,'sessionAdd:'+this['_channelId'],(_0x4e22a1,{session:_0x562630})=>{if(_0x562630['id']===_0x58ba57['mySessionId']){_0x4e22a1['off']();const _0x2bac27=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0xe1587e=_0x562630['permissions'];_0x2bac27&&_0x2bac27['isEnabled']&&(_0xe1587e=_0xe1587e['filter'](_0x222c50=>'document:write'!==_0x222c50)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0xe1587e,this['_channelId']);}}),_0x58ba57['register'](this['_channelId'],_0x57f56a);}['_initThrowingOnDataSet'](){const _0x49dd77=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4ef11e)=>{if(!_0x4ef11e[_0x4ef11e['length']-0x1]['suppressErrorInCollaboration'])throw new _0xb4ae54('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x49dd77['apply'](this['editor']['data'],_0x4ef11e);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4795ff,[_0x41d118])=>{if(this['_document']['version'])throw new _0xb4ae54('realtimecollaborationclient-init-document-already-initialized',this);_0x4795ff['stop'](),this['_setPendingAction']();const _0x3ca150=this['editor']['config']['get']('rootsAttributes'),_0x2162e7=this['_getOperationsFromInitData'](_0x41d118,_0x3ca150);0x0==_0x2162e7['length']&&_0x2162e7['push'](new _0x566909(0x0)),_0x4795ff['return']=this['_connectService'](_0x2162e7)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x46b213=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x46b213))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3e4d76,[_0x3e1168,_0x326e2])=>{_0x3e4d76['stop']();const _0x26f291=this['editor']['model']['document']['getRoot'](_0x3e1168);if(!this['_knownRootNames']['has'](_0x3e1168)){const _0x171efd=_0x326e2&&_0x326e2['data']?_0x326e2['data']:'',_0x147379=_0x326e2&&_0x326e2['attributes']?_0x326e2['attributes']:{};await this['_loadRoot'](_0x3e1168,_0x171efd,_0x147379);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x26f291['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x26f291);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x14d1e6){const _0xe3652b=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x407c24}=this['editor']['plugins']['get'](n),_0x17c24e=new Set();for(const _0x5084a of _0x14d1e6){const _0x87008d=_0x5084a['_authorId'];_0x87008d&&!_0xe3652b['getUser'](_0x87008d)&&_0x17c24e['add'](_0x87008d);}if(0x0===_0x17c24e['size'])return;const _0x47ab62=await ht['getMany'](_0x407c24,Array['from'](_0x17c24e));for(const _0x2f7865 of _0x47ab62)_0xe3652b['getUser'](_0x2f7865['id'])||_0xe3652b['addUser'](_0x2f7865);}['_getOperationsFromInitData'](_0x2c5438,_0x249893={}){const _0x37ed97=this['editor']['model'],_0x661660=[];let _0x33ab38=0x0;const _0x4e3895='string'==typeof _0x2c5438?{'main':_0x2c5438}:_0x2c5438;for(const _0x19d887 of Object['keys'](_0x4e3895)){if(!this['_document']['roots']['has'](_0x19d887))throw new _0xb4ae54('realtimecollaborationclient-init-non-existent-root',this);const _0x3b470c=this['editor']['data']['parse'](_0x4e3895[_0x19d887]),_0x14869b=this['_document']['getRoot'](_0x19d887),_0x45c20a=new _0x4dfc76(_0x37ed97['createPositionAt'](_0x14869b,0x0),_0x3b470c,_0x33ab38++);_0x661660['push'](_0x45c20a);for(const [_0x4718a8,_0xc03d36]of _0x3b470c['markers']){const _0x1627a7=_0x37ed97['createRange'](_0x37ed97['createPositionFromPath'](_0x14869b,_0xc03d36['start']['path']['slice']()),_0x37ed97['createPositionFromPath'](_0x14869b,_0xc03d36['end']['path']['slice']())),_0x24c85e=new _0x7b3172(_0x4718a8,null,_0x1627a7,_0x37ed97['markers'],!0x0,_0x33ab38++);_0x661660['push'](_0x24c85e);}}if(_0x249893)for(const [_0xb91e5f,_0x4ec710]of Object['entries'](_0x249893)){const _0x2a90b6=_0x37ed97['document']['getRoot'](_0xb91e5f);if(!_0x2a90b6)throw new _0xb4ae54('multi-root-editor-root-attributes-no-root',null);for(const [_0x23d38e,_0x3df3c1]of Object['entries'](_0x4ec710))if(null!==_0x3df3c1){const _0x12be2b=new _0x3b01b0(_0x2a90b6,_0x23d38e,null,_0x3df3c1,_0x33ab38++);_0x661660['push'](_0x12be2b);}}return _0x661660;}async['_loadRoot'](_0x56b140,_0x3333a4,_0x49fe52){this['_getOperationsFromInitData']({[_0x56b140]:_0x3333a4},{[_0x56b140]:_0x49fe52})['forEach']((_0x4fac65,_0x44ae69)=>{_0x4fac65['baseVersion']=this['_document']['version']+_0x44ae69,_0x4fac65['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x4fac65);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5e9e49,_0x2be744){let _0x5f1ca7;this['_offset']=_0x5e9e49['offset'];const _0x1e82ea=_0x5e9e49['wereChangesApplied']&&!_0x5e9e49['initData'],_0x522d99=_0x1e82ea?0x0:_0x5e9e49['data']['baseVersion'];if(_0x2be744['forEach'](_0x47efb2=>{_0x47efb2['_isInit']=!0x0,_0x47efb2['createdAt']=_0x5e9e49['sessionCreatedAt'],_0x47efb2['_authorId']=null;}),_0x1e82ea)_0x5f1ca7=_0x2be744,this['_applyOperationsSet'](_0x5f1ca7,_0x1e82ea);else{if(_0x5e9e49['initData']){const _0x83b04d=this['_getOperationsFromInitData'](_0x5e9e49['initData']);this['_document']['history']['version']=-_0x83b04d['length'],_0x83b04d['forEach'](_0x567481=>{_0x567481['baseVersion']-=_0x83b04d['length'],_0x567481['createdAt']=_0x5e9e49['sessionCreatedAt'],_0x567481['_isInit']=!0x0,_0x567481['_authorId']=null;}),this['_applyOperationsSet'](_0x83b04d,!0x0),this['serverHistory']['version']=-_0x83b04d['length']+this['_offset'],this['_updateServerHistory'](_0x83b04d);}this['_document']['history']['version']=_0x522d99,_0x5f1ca7=this['_decompressOperations'](_0x5e9e49['data'],_0x5e9e49['metadata']),await this['_fetchMissingUsers'](_0x5f1ca7),this['_applyOperationsSet'](_0x5f1ca7,_0x1e82ea);}_0x5e9e49['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5f1ca7,_0x5e9e49['lastOperationId']),this['_lastSyncedOperationId']=_0x5e9e49['lastOperationId']),this['serverHistory']['version']=_0x522d99+this['_offset'],this['_updateServerHistory'](_0x5f1ca7),_0x2be744['filter'](_0x26f2fa=>{const _0x2aa8ab=this['_getAffectedRoot'](_0x26f2fa);return _0x2aa8ab&&!this['_knownRootNames']['has'](_0x2aa8ab);})['forEach']((_0x1f5590,_0x5e6e0f)=>{_0x1f5590['baseVersion']=this['_document']['version']+_0x5e6e0f,this['_saveOperationInBuffer'](_0x1f5590);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x313452,_0x381fdb){const _0x4ebf80=_0x381fdb&&_0x381fdb['message'];if(_0x4ebf80&&_0x4ebf80['startsWith']('realtimecollaborationclient'))throw _0x381fdb;const _0x219db1=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x219db1['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0xb4ae54(_0x313452,this['editor'],_0x4ebf80?{'originalError':_0x4ebf80}:void 0x0);}['_saveOperationInBuffer'](_0x57738b){this['_knownOperations']['has'](_0x57738b)||(this['_knownOperations']['add'](_0x57738b),this['_bufferedOperations']['push'](_0x57738b),this['_pendingAction']||'marker'==_0x57738b['type']&&!_0x57738b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x493a4f=!0x1){!_0x493a4f&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4629ca=>{_0x4629ca&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x335304=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3a861f){return _0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3a861f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x335304)||this['_crash'](_0x335304['message'],_0x335304);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x55f140=>{this['on']('change:_isPendingUpdate',()=>{_0x55f140();});});}async['_sendBufferedOperations'](){const _0x305385=this['editor']['plugins']['get'](N);if(this['_shouldSendSelectionUpdate']()&&(_0x305385['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5f22b4=[...this['_bufferedOperations']];for(const _0x5e33cb of _0x5f22b4)_0x5e33cb['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x5e33cb);const _0x4c1e80=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5f22b4),_0x50ab91=z++,_0x2d7e4c=this['_compressOperations'](_0x5f22b4),_0x5f3b27=await this['_service']['sendOperations'](_0x2d7e4c,_0x2d7e4c['baseVersion'],_0x4c1e80);try{return await this['_handleServerResponse'](_0x5f22b4,_0x5f3b27,_0x50ab91);}catch(_0x368908){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x368908);}}async['_handleServerResponse'](_0xeeee15,_0x485877,_0x4e4c4a){if('error'in _0x485877)throw _0x485877['error'];let _0x149003=!0x1;if(_0x485877['wereChangesApplied']){_0x485877['lastOperationId']&&(this['_lastSyncedOperationId']=_0x485877['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x189afd=>!_0xeeee15['includes'](_0x189afd));for(const _0x234286 of _0xeeee15)_0x234286['createdAt']='lastOperationAcceptedAt'in _0x485877&&_0x485877['lastOperationAcceptedAt']||void 0x0;H(_0xeeee15,_0x485877['version']-_0xeeee15['length']),this['_updateServerHistory'](_0xeeee15);const _0x5bdcc7=_0xeeee15['filter'](_0xbeff4f=>{if(!_0xbeff4f['_isInit'])return!0x1;const _0x51471b=this['_getAffectedRoot'](_0xbeff4f);return _0x51471b&&!this['_knownRootNames']['has'](_0x51471b);});H(_0x5bdcc7,this['_document']['version']),this['_applyOperationsSet'](_0x5bdcc7),_0x149003=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3af6f6=this['_decompressOperations'](_0x485877['data'],_0x485877['metadata'])['filter'](_0x222ee5=>_0x222ee5['baseVersion']>=this['_lastServerVersion']);_0x3af6f6['forEach'](_0x584b2c=>this['_addKnownRoot'](_0x584b2c)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xf520d8=>!_0xf520d8['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xf520d8))),this['_bufferedOperations']['length']&&H(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3af6f6),_0x149003=this['_handleExternalOperations'](_0x3af6f6,_0x485877['version'],_0x485877['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x149003?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x37a5ba,_0x251df1,_0x7c83c2){try{const _0x3f9f14={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x98152c,operationsB:_0x1e634c,originalOperations:_0x3fa4ad}=_0x3283fc(_0x37a5ba,this['_bufferedOperations'],_0x3f9f14);H(_0x98152c,this['_document']['version']),H(_0x1e634c,_0x251df1);for(const _0x2124b9 of _0x98152c){const _0x43a760=_0x3fa4ad['get'](_0x2124b9);_0x2124b9['_authorId']=_0x43a760?_0x43a760['_authorId']:null;}_0x7c83c2&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x37a5ba,_0x7c83c2),this['_lastSyncedOperationId']=_0x7c83c2),this['_bufferedOperations']=[..._0x1e634c],this['_applyOperationsSet'](_0x98152c),this['_updateServerHistory'](_0x37a5ba);}catch(_0x7b0030){return console['error'](_0x7b0030),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1aea17,_0x4f4a8f=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3c1316=>{for(const _0x46cebf of _0x1aea17)this['_knownOperations']['add'](_0x46cebf),this['_addKnownRoot'](_0x46cebf),_0x3c1316['batch']['addOperation'](_0x46cebf),this['editor']['model']['applyOperation'](_0x46cebf);});}['_addKnownRoot'](_0x279e95){const _0x3417c=this['_getAffectedRoot'](_0x279e95);_0x3417c&&this['_knownRootNames']['add'](_0x3417c);}['_getAffectedRoot'](_0x1b912b){let _0x317df4,_0x1b9ef9;switch(_0x1b912b['type']){case'insert':_0x317df4=_0x1b912b['position']['root'];break;case'marker':if(_0x1b9ef9=_0x1b912b['newRange'],!_0x1b9ef9)return null;_0x317df4=_0x1b9ef9['root'];break;case'addRootAttribute':_0x317df4=_0x1b912b['root'];break;case'addRoot':_0x317df4=_0x1b912b['affectedSelectable'];break;case'move':_0x317df4=_0x1b912b['targetPosition']['root'];break;default:return null;}return _0x317df4['rootName'];}['_updateServerHistory'](_0x5df474){_0x5df474['forEach'](_0x45a6f6=>{const _0xc0fb25=_0x45a6f6['clone']();_0xc0fb25['_authorId']=_0x45a6f6['_authorId'],_0xc0fb25['_isInit']=!!_0x45a6f6['_isInit'],_0xc0fb25['createdAt']=_0x45a6f6['createdAt'],_0xc0fb25['baseVersion']+=this['_offset'],_0x45a6f6['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xc0fb25),this['serverHistory']['addOperation'](_0xc0fb25);});}['_handleReconnectionError'](_0x5f306f){const _0x58a2ed=this['editor']['plugins']['get']('Notification'),_0x2a63fa=this['editor']['locale'];_0x5f306f||(_0x5f306f=B(_0x2a63fa,'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.')),_0x58a2ed['showWarning'](_0x5f306f,{'title':B(_0x2a63fa,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x235b6b)['add'](B(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x235b6b)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2d5c58){const _0x51b171=_0x2d5c58['map'](_0x10941c=>_0x10941c['toJSON']());return this['_compressor']['compress'](_0x51b171);}['_decompressOperations'](_0x35f415,_0x359214){return this['_compressor']['decompress'](_0x35f415)['map']((_0x2e67f2,_0x23d322)=>{const _0x5d6196='init'==_0x359214[_0x23d322]['type'];if('InsertOperation'==_0x2e67f2['__className']){const _0x19b85c=_0x2e67f2['position']['root'];!this['_document']['getRoot'](_0x19b85c)&&(this['_document']['createRoot']('$root',_0x19b85c)['_isAttached']=!0x1);}const _0x1b518c=_0x2f9f6e['fromJSON'](_0x2e67f2,this['_document']);return _0x1b518c['wasUndone']=_0x2e67f2['wasUndone'],_0x1b518c['_isInit']=_0x5d6196,_0x1b518c['_authorId']=_0x5d6196?null:_0x359214[_0x23d322]['userId'],_0x1b518c['_isDisconnection']='cs:removeUser'===_0x359214[_0x23d322]['type'],_0x1b518c['createdAt']=_0x359214[_0x23d322]['createdAt'],_0x1b518c;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x7a3f18=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x7a3f18&&_0x7a3f18['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function H(_0x2ebd14,_0x26e98b){for(const _0x35d48e of _0x2ebd14)_0x35d48e['baseVersion']=_0x26e98b++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x59ec0a){this['_ignoredOperations']=_0x59ec0a,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x258177){let _0x41014a=_0x258177['length'];for(;_0x41014a--;){const _0xa60319=_0x258177[_0x41014a];if(!this['_ignoredOperations']['has'](_0xa60319)){if(!this['_operationToId']['has'](_0xa60319)){const _0x2ce520=_0x525198()['slice'](0x1,0x12);this['_operationToId']['set'](_0xa60319,_0x2ce520);}return this['_operationToId']['get'](_0xa60319);}}}['setIdForTheLastOperation'](_0x37e157,_0xacf77c){if(!_0xacf77c)return;let _0x4faaa5=_0x37e157['length'];for(;_0x4faaa5--;){const _0x3f1180=_0x37e157[_0x4faaa5];this['_ignoredOperations']['has'](_0x3f1180)||this['_operationToId']['set'](_0x3f1180,_0xacf77c);}}}class a extends _0x25b979{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x6f804a{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x3a26f5)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x4fba0e];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x221e66){super(_0x221e66),this['_services']=new Map();}async['init'](){const _0x37e86a=this['context'],_0x203228=_0x37e86a['plugins']['get']('CommentsRepository');if(_0x37e86a['plugins']['get'](n)['addToReconnectionStack'](this),_0x203228['adapter']={'addCommentThread':async({channelId:_0x396b0c,threadId:_0x42ac52,comments:_0x2113a4,resolvedAt:_0x389818,resolvedBy:_0x44f9ea,context:_0xa39db3,attributes:_0x9afce8})=>{const _0x13d852=await this['_getService'](_0x396b0c)['addCommentThread']({'commentThreadId':_0x42ac52,'comments':_0x2113a4['map'](_0x576995=>function(_0x5014f4,_0x393d4b,_0x1dbd06){return{'commentThreadId':_0x1dbd06,'commentId':_0x5014f4['commentId'],'userId':_0x5014f4['authorId'],'content':_0x5014f4['content'],'documentId':_0x393d4b,'createdAt':_0x5014f4['createdAt'],'attributes':_0x5014f4['attributes']||{}};}(_0x576995,_0x396b0c,_0x42ac52)),'resolvedAt':_0x389818,'resolvedBy':_0x44f9ea,'context':_0xa39db3,'attributes':_0x9afce8})['catch'](lt);return{'threadId':_0x13d852['commentThreadId'],'comments':_0x13d852['comments']};},'getCommentThread':async({channelId:_0x54d7e6,threadId:_0xcef519})=>{const _0x2c8fe7=await this['_getService'](_0x54d7e6)['getCommentThread'](_0xcef519)['catch'](f)['catch'](lt);return _0x2c8fe7?_0x2c8fe7['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2c8fe7]),{'threadId':_0x2c8fe7['commentThreadId'],'comments':_0x2c8fe7['comments']['map'](p),'context':_0x2c8fe7['context'],'resolvedAt':_0x2c8fe7['resolvedAt'],'resolvedBy':_0x2c8fe7['resolvedBy'],'attributes':_0x2c8fe7['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x24be81,threadId:_0x184c17,context:_0x28eea9,unlinkedAt:_0x1426f2,attributes:_0x21fdf0})=>this['_getService'](_0x24be81)['updateCommentThread']({'commentThreadId':_0x184c17,'context':_0x28eea9,'attributes':_0x21fdf0,'unlinkedAt':_0x1426f2})['catch'](f)['catch'](lt),'resolveCommentThread':async({channelId:_0x587672,threadId:_0x57b12e})=>{const _0x2a546f=await this['_getService'](_0x587672)['resolveCommentThread'](_0x57b12e)['catch'](f)['catch'](lt);return{'threadId':_0x2a546f['commentThreadId'],'resolvedAt':_0x2a546f['resolvedAt'],'resolvedBy':_0x2a546f['resolvedBy']};},'reopenCommentThread':async({channelId:_0x233cb0,threadId:_0x16dd60})=>this['_getService'](_0x233cb0)['reopenCommentThread'](_0x16dd60)['catch'](f)['catch'](lt),'removeCommentThread':({channelId:_0x3d23f8,threadId:_0x9e332b})=>this['_getService'](_0x3d23f8)['removeCommentThread'](_0x9e332b)['catch'](f)['catch'](lt),'addComment':({channelId:_0x3d071c,threadId:_0x1ad221,commentId:_0x24028f,content:_0x12810d,attributes:_0xafd23})=>this['_getService'](_0x3d071c)['addComment'](_0x1ad221,_0x24028f,_0x12810d,_0xafd23)['catch'](lt),'updateComment':({channelId:_0x22bdc0,threadId:_0x210e64,commentId:_0xe78022,content:_0x2f1e5d,attributes:_0x16291d})=>this['_getService'](_0x22bdc0)['updateComment'](_0x210e64,_0xe78022,_0x2f1e5d,_0x16291d)['catch'](f)['catch'](lt),'removeComment':({channelId:_0x548745,threadId:_0x4e7bc5,commentId:_0x108129})=>this['_getService'](_0x548745)['removeComment'](_0x4e7bc5,_0x108129)['catch'](f)['catch'](lt)},_0x37e86a instanceof _0x506ccb){const _0x3349cd=_0x37e86a['config']['get']('collaboration.channelId'),_0x34bb37=_0x37e86a['plugins']['get'](i);await this['_setUpService'](_0x3349cd);const _0x4ccf96=await this['_services']['get'](_0x3349cd)['getConnectedSessions']();this['listenTo'](_0x34bb37,'sessionAdd:'+_0x3349cd,(_0x481fd5,{session:_0x24b635})=>{_0x24b635['id']===_0x34bb37['mySessionId']&&(_0x481fd5['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x24b635['permissions'],_0x3349cd));}),_0x34bb37['register'](_0x3349cd,_0x4ccf96);}}async['_setUpService'](_0xa63e35){if(this['_services']['has'](_0xa63e35))throw new _0xb4ae54('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0xa63e35});const _0x43830e=this['context']['plugins']['get']('CommentsRepository'),_0x3d7838=new s['CommentsService'](_0xa63e35);this['_services']['set'](_0xa63e35,_0x3d7838),this['listenTo'](_0x3d7838,'commentThreadAdded',(_0x7d70bc,_0x22d4c7)=>{const {commentThreadId:_0x2aeeb0,documentId:_0x625929,context:_0x527c7b,attributes:_0x4c9275,resolvedAt:_0x1ff0fe,resolvedBy:_0x1ad205,comments:_0x19600b}=_0x22d4c7;_0x43830e['getCommentThread'](_0x2aeeb0)||_0x43830e['addCommentThread']({'threadId':_0x2aeeb0,'channelId':_0x625929,'comments':_0x19600b?_0x19600b['map'](p):[],'context':_0x527c7b,'attributes':_0x4c9275,'resolvedAt':_0x1ff0fe,'resolvedBy':_0x1ad205,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadUpdated',(_0x1c6d3d,{commentThreadId:_0x7d6762,documentId:_0x907741,context:_0x42d5d0,unlinkedAt:_0x344e54,attributes:_0xb11611})=>{_0x43830e['getCommentThread'](_0x7d6762)&&_0x43830e['updateCommentThread']({'threadId':_0x7d6762,'channelId':_0x907741,'context':_0x42d5d0,'unlinkedAt':_0x344e54,'attributes':_0xb11611,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadResolved',(_0x183dd9,{commentThreadId:_0x4c07cb,resolvedBy:_0x3e9e14,resolvedAt:_0x12e5f0})=>{const _0x45bb89=_0x43830e['getCommentThread'](_0x4c07cb);_0x45bb89&&_0x45bb89['resolve']({'resolvedBy':_0x3e9e14,'resolvedAt':_0x12e5f0,'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadReopened',(_0xa1363a,{commentThreadId:_0x4cdd81})=>{const _0x560714=_0x43830e['getCommentThread'](_0x4cdd81);_0x560714&&_0x560714['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentThreadRemoved',(_0x3899aa,{commentThreadId:_0x4764ae})=>{const _0x47b0cc=_0x43830e['getCommentThread'](_0x4764ae);_0x47b0cc&&_0x47b0cc['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentAdded',(_0x3f85c5,_0x330168)=>{const _0x37f7ab=_0x330168['commentThreadId'],_0x3db75a=_0x43830e['getCommentThread'](_0x37f7ab);_0x3db75a&&_0x3db75a['addComment']({...p(_0x330168),'isFromAdapter':!0x0});}),this['listenTo'](_0x3d7838,'commentUpdated',(_0x403fca,{commentThreadId:_0x1120d4,commentId:_0x146fe5,content:_0x411193,attributes:_0x2b0e50})=>{const _0x32c085=_0x43830e['getCommentThread'](_0x1120d4);if(_0x32c085){const _0x5d4b1e=_0x32c085['getComment'](_0x146fe5);_0x5d4b1e&&_0x5d4b1e['update']({'content':_0x411193,'attributes':_0x2b0e50,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3d7838,'commentRemoved',(_0x2055cc,{commentThreadId:_0x345dbc,commentId:_0xa899d8})=>{const _0x4de994=_0x43830e['getCommentThread'](_0x345dbc);if(_0x4de994){const _0x133ddd=_0x4de994['getComment'](_0xa899d8);_0x133ddd&&_0x133ddd['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0xa63e35);}['destroy'](){if(this['context']instanceof _0x506ccb){const _0x12636c=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x12636c);}}['_terminateService'](_0x97c675){if(!this['_services']['has'](_0x97c675))throw new _0xb4ae54('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x97c675});this['_getService'](_0x97c675)['disconnect'](),this['_services']['delete'](_0x97c675);}async['reconnect'](){for(const _0x304da5 of this['_services']['keys']())await this['_connectService'](_0x304da5);if(this['context']instanceof _0x506ccb){const _0x2b7fae=this['context']['config']['get']('collaboration.channelId'),_0x575866=this['context']['plugins']['get'](i);_0x575866['unregister'](_0x2b7fae);const _0x30e47c=await this['_services']['get'](_0x2b7fae)['getConnectedSessions']();_0x575866['register'](_0x2b7fae,_0x30e47c);}}async['_connectService'](_0x1e2675){const {connection:_0x3c7838}=this['context']['plugins']['get'](n),_0x1ccce8=this['context']['plugins']['get']('CommentsRepository'),_0x1e185e=this['_services']['get'](_0x1e2675),_0x50e894=await _0x1e185e['connect'](_0x3c7838);await this['_fetchMissingUsersForThreads'](_0x50e894);const _0x22b7ce=new Set(Array['from'](_0x1ccce8['getCommentThreads']({'channelId':_0x1e2675}),_0x2f62ba=>_0x2f62ba['id']));for(const _0xb51728 of _0x50e894)_0xb51728['deletedAt']||_0x22b7ce['delete'](_0xb51728['commentThreadId']);for(const _0x5bfdf3 of _0x22b7ce)_0x1ccce8['getCommentThread'](_0x5bfdf3)['remove']({'isFromAdapter':!0x0});for(const _0xfa3b56 of _0x50e894){let _0x4f6abe=_0x1ccce8['getCommentThread'](_0xfa3b56['commentThreadId']);const {commentThreadId:_0x6e241d,context:_0x234307,attributes:_0x1e8d55,resolvedBy:_0x496c3d,resolvedAt:_0x3d7bc6,unlinkedAt:_0x19d69a,deletedAt:_0x5d775e}=_0xfa3b56;if(_0x5d775e)continue;_0x4f6abe||(_0x4f6abe=_0x1ccce8['addCommentThread']({'channelId':_0x1e2675,'threadId':_0x6e241d,'context':_0x234307,'attributes':_0x1e8d55||{},'resolvedBy':_0x496c3d,'resolvedAt':_0x3d7bc6,'unlinkedAt':_0x19d69a,'isFromAdapter':!0x0}));const _0x24f30d=new Set(Array['from'](_0x4f6abe['comments'],_0x56e736=>_0x56e736['id']));for(const _0x277802 of _0xfa3b56['comments'])_0x24f30d['delete'](_0x277802['commentId']);for(const _0x33b219 of _0x24f30d)_0x4f6abe['getComment'](_0x33b219)['remove']({'isFromAdapter':!0x0});for(const _0xe80118 of _0xfa3b56['comments']){const _0x40d03a=_0x4f6abe['getComment'](_0xe80118['commentId']);_0x40d03a?_0x40d03a['content']!==_0xe80118['content']&&_0x40d03a['update']({'content':_0xe80118['content'],'isFromAdapter':!0x0}):_0x4f6abe['addComment'](Object['assign'](p(_0xe80118),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1721c4){if(!this['_services']['has'](_0x1721c4))throw new _0xb4ae54('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1721c4});return this['_services']['get'](_0x1721c4);}async['_fetchMissingUsersForThreads'](_0x2000fb){const _0x5e24b0=this['context']['plugins']['get'](_0x4fba0e),{connection:_0x5b2fe6}=this['context']['plugins']['get'](n),_0x2d035b=new Set();for(const {resolvedBy:_0x3e34a4,comments:_0x53ff3e}of _0x2000fb){_0x3e34a4&&!_0x5e24b0['getUser'](_0x3e34a4)&&_0x2d035b['add'](_0x3e34a4);for(const {userId:_0xd1b7a4}of _0x53ff3e)_0x5e24b0['getUser'](_0xd1b7a4)||_0x2d035b['add'](_0xd1b7a4);}if(0x0===_0x2d035b['size'])return;const _0x2051a1=await ht['getMany'](_0x5b2fe6,Array['from'](_0x2d035b));for(const _0x16894f of _0x2051a1)_0x5e24b0['getUser'](_0x16894f['id'])||_0x5e24b0['addUser'](_0x16894f);}}async function f(_0x4fb759){if('404'!==_0x4fb759['code'])throw _0x4fb759;}function lt(_0x4715f7){if((_0x1f6911=_0x4715f7)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1f6911['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1f6911['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1f6911;throw _0x4715f7;}function p(_0x5bbe51){return{'threadId':_0x5bbe51['commentThreadId'],'commentId':_0x5bbe51['commentId'],'content':_0x5bbe51['content'],'createdAt':_0x5bbe51['createdAt'],'authorId':_0x5bbe51['userId'],'attributes':_0x5bbe51['attributes']||{}};}class m extends _0x25b979{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x1035fa)());['_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(_0x17852b){super(_0x17852b);const _0x4ba712=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4ba712);}['init'](){const _0xd58ac7=this['editor']['plugins']['get'](n),_0x2533a3=this['editor']['plugins']['get']('TrackChangesEditing');return _0x2533a3['adapter']={'getSuggestion':async _0x18708f=>{await this['_waitForServiceReady']();const _0x4bff16=await this['_trackChangesService']['get'](_0x18708f)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x4bff16]),_0x4bff16;},'addSuggestion':async({id:_0x4dcfa6,type:_0xf26695,data:_0x4b6945,originalSuggestionId:_0x385244,attributes:_0x3da32d})=>{await this['_waitForServiceReady']();const _0x3d346d={'id':_0x4dcfa6,'type':_0xf26695,'data':_0x4b6945,'originalSuggestionId':_0x385244,'attributes':_0x3da32d},_0x58eccc=await this['_trackChangesService']['add'](_0x4dcfa6,_0xf26695,_0x4b6945,_0x385244,_0x3da32d)['catch'](_0x2fb464=>{if(dt(_0x2fb464))return new Promise(_0x2b56a7=>{this['_bufferedRequests']['set'](_0x4dcfa6,{'resolve':_0x2b56a7,'suggestionData':_0x3d346d});});throw _0x2fb464;});return this['_bufferedRequests']['delete'](_0x4dcfa6),_0x58eccc;},'updateSuggestion':async(_0x4a651d,_0x10d2ab)=>{if(await this['_waitForServiceReady'](),'open'!==_0x10d2ab['state'])return this['_trackChangesService']['update'](_0x4a651d,_0x10d2ab)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x12c1bb,_0x1375b0)=>{_0x2533a3['hasSuggestion'](_0x1375b0['id'])&&(_0x2533a3['getSuggestion'](_0x1375b0['id'])['attributes']=_0x1375b0['attributes']);}),this['_trackChangesService']['connect'](_0xd58ac7['connection'])['then'](_0x8073f7=>(_0xd58ac7['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x8073f7)['then'](()=>{for(const _0x289f65 of _0x8073f7){_0x2533a3['addSuggestionData'](_0x289f65)['_saved']=!0x0;}})));}async['reconnect'](){const _0x438db8=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x3537f4}=this['editor']['plugins']['get'](n),_0x264a7d=await this['_trackChangesService']['connect'](_0x3537f4);await this['_fetchMissingUsersForThreads'](_0x264a7d);for(const {suggestionData:_0x550a83,resolve:_0x25ec99}of this['_bufferedRequests']['values']()){let _0x690eb7=_0x264a7d['find'](_0x5a6d89=>_0x5a6d89['id']===_0x550a83['id']);_0x690eb7||(_0x690eb7=await this['_trackChangesService']['add'](_0x550a83['id'],_0x550a83['type'],_0x550a83['data'],_0x550a83['originalSuggestionId'])),_0x25ec99(_0x690eb7);}for(const _0x5b4a6c of _0x264a7d)_0x438db8['hasSuggestion'](_0x5b4a6c['id'])||_0x438db8['addSuggestionData'](_0x5b4a6c);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x5d4afb=>{this['listenTo'](this['_trackChangesService'],'connected',_0x40e1a4=>{_0x40e1a4['off'](),_0x5d4afb();});});}async['_fetchMissingUsersForThreads'](_0x533990){const _0x83b023=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x9b6a82}=this['editor']['plugins']['get'](n),_0x51f5ab=new Set();for(const {authorId:_0x32bcee}of _0x533990)_0x83b023['getUser'](_0x32bcee)||_0x51f5ab['add'](_0x32bcee);if(0x0===_0x51f5ab['size'])return;const _0x527d48=await ht['getMany'](_0x9b6a82,Array['from'](_0x51f5ab));for(const _0x29f68f of _0x527d48)_0x83b023['getUser'](_0x29f68f['id'])||_0x83b023['addUser'](_0x29f68f);}}function A(_0x30bb06){if(dt(_0x30bb06))return new Promise(()=>{});throw _0x30bb06;}function dt(_0x802f70){return _0x802f70['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x802f70['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x25b979{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 _0x577f78=this['editor']['plugins']['get'](n),_0x2362a5=this['editor']['plugins']['get']('CommentsEditing'),_0x8b7220=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x577f78,'change:state',(_0x47c22c,_0x56ed14,_0x5f67a5)=>{_0x2362a5['isThreadsLoadingPaused']='connected'!==_0x5f67a5;});}),this['listenTo'](_0x577f78,'change:state',(_0x5fa135,_0x1c57c0,_0x413971)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x413971);}),_0x8b7220['_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 _0x25b979{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 _0x25b979{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x16dd6a)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x4fba0e];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x477479){super(_0x477479);const _0x15bd8f=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x15bd8f);}async['init'](){const _0x39d88a=this['editor']['plugins']['get'](l),_0xe111aa=_0x39d88a['serverHistory'],_0x3b2647=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xe111aa,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x39d88a['sessionId']});const _0x1feb35=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x5b349d=await _0x25c22d['isBundleUploaded'](_0x3b2647['connection'],_0x1feb35);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x3e87f1})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x3e87f1)),'updateRevisions':async _0x204858=>{await this['_waitForServiceReady']();const _0x47bfa9=this['_revisionTracker']['currentRevision'];if(_0x5b349d&&0x1===_0x204858['length']&&_0x204858[0x0]['id']===_0x47bfa9['id'])return _0x204858;for(const _0x1c305b of _0x204858)_0x1c305b['id']===_0x47bfa9['id']&&(_0x1c305b['isEmptyCurrent']=_0x1c305b['fromVersion']===_0x1c305b['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x204858,this['_lastRequestId'])['then'](_0x9d8fc9=>(this['_lastRequestId']=_0x9d8fc9,_0x204858))['catch'](_0x36d865=>{if(b(_0x36d865)||'400'===_0x36d865['code']&&void 0x0!==_0x36d865['data']['wrongRequestId']){for(const _0x41e2d0 of _0x204858){!this['_revisionTracker']['repository']['getRevision'](_0x41e2d0['id'])||this['_revisionTracker']['_bufferUpdate'](_0x41e2d0['id'],_0x41e2d0,!0x1);}if(b(_0x36d865))throw _0x36d865;return _0x204858;}throw _0x36d865;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x65f68a,{revisionsData:_0x18c58c,requestId:_0x539926})=>{Math['max'](..._0x18c58c['map'](_0x32a7a7=>_0x32a7a7['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x18c58c,_0x539926);}):this['_handleRevisionsUpdate'](_0x18c58c,_0x539926);});const {revisions:_0x93e961,requestId:_0x502fdf}=await this['_revisionHistoryService']['connect'](_0x3b2647['connection']);_0x3b2647['addToReconnectionStack'](this),this['_lastRequestId']=_0x502fdf,await this['_fetchMissingUsers'](_0x93e961);for(const _0x177c3d of _0x93e961)this['_revisionTracker']['addRevisionData'](_0x177c3d);this['listenTo'](_0x39d88a,'change:_isConnected',(_0x58bb1d,_0x9162d2,_0x1b6dfc)=>{_0x1b6dfc&&(this['_oldOffset']=_0x39d88a['_offset'],_0x58bb1d['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3b2647,'state',_0x67fdc1=>_0x67fdc1===_0x36321a['CONNECTED']);}async['reconnect'](){const _0x280788=this['editor']['plugins']['get'](n),_0x117192=this['editor']['plugins']['get'](l),_0x28f8f7=async()=>{const _0x31d7d6=this['_revisionTracker']['currentRevision'],_0x2d8d85=_0x31d7d6['id'],_0x56b7e7=_0x2d8d85!==_0x117192['sessionId'];if(_0x56b7e7){const _0x5a7b4a=_0x117192['_offset']-this['_oldOffset'],_0x22c727=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x31d7d6['toVersion']+_0x5a7b4a!==_0x22c727){const _0x45a79a=_0x31d7d6['fromVersion']+_0x5a7b4a,_0xb3c4bd=this['editor']['plugins']['get'](_0x4fba0e),_0x168414=this['_revisionTracker']['buildRevisionData']({'revision':_0x31d7d6,'from':_0x45a79a,'to':_0x22c727});_0x168414['id']=_0x31d7d6['id'];const _0x2655c7=_0x168414['authorsIds']['map'](_0x226102=>_0xb3c4bd['getUser'](_0x226102));_0x31d7d6['_update']({..._0x168414,'authors':_0x2655c7},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x31d7d6['id'],_0x168414,!0x0);}this['_revisionTracker']['_startingVersion']=_0x22c727,(_0x31d7d6['toVersion']===_0x31d7d6['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x2d8d85)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x2d8d85),this['_revisionTracker']['_createCurrentRevision'](_0x22c727));}const {revisions:_0x99da9c,requestId:_0x18f9c7}=await this['_revisionHistoryService']['reconnect'](_0x280788['connection'],this['_lastRequestId']);_0x56b7e7&&_0x99da9c['length']>0x0?_0x117192['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x99da9c),this['_handleRevisionsUpdate'](_0x99da9c,_0x18f9c7),this['_revisionTracker']['sendBufferedUpdates']());};return _0x117192['_isConnected']?_0x28f8f7():new Promise((_0x113bf9,_0x5e5a55)=>{_0x117192['once']('change:_isConnected',()=>{_0x28f8f7()['then'](_0x113bf9)['catch'](_0x5e5a55);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0xa89520=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5e8325=>{_0x5e8325['off'](),_0xa89520();});});}['_getLatestVersionFromServerOperations'](){const _0x55ddd9=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x302613 of _0x55ddd9)if('marker'!==_0x302613['type']||_0x302613['affectsData'])return _0x302613['baseVersion']+0x1;}['_getLatestVersion'](){const _0x2cc296=this['editor']['plugins']['get'](l);return new Promise(_0x5314e7=>{_0x2cc296['_isPendingUpdate']?_0x2cc296['once']('change:_isPendingUpdate',()=>{_0x5314e7(this['_getLatestVersionFromServerOperations']());}):_0x5314e7(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x57386c,_0x17c7fc){const _0x400794=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x17c7fc;for(const _0x48d000 of _0x57386c){const _0x21e1bd=_0x400794['getRevision'](_0x48d000['id']);if(_0x21e1bd){if((_0x48d000['fromVersion']||_0x48d000['toVersion'])&&(_0x48d000['diffData']=null),_0x21e1bd===this['_revisionTracker']['currentRevision']){const _0x46b05e=Math['max'](_0x21e1bd['toVersion'],_0x48d000['toVersion']),_0x2d80cc=Math['max'](_0x21e1bd['fromVersion'],_0x48d000['fromVersion']);let _0x5d7028;_0x21e1bd['toVersion']===_0x48d000['toVersion']&&_0x21e1bd['fromVersion']===_0x48d000['fromVersion']?(_0x5d7028=!0x0,this['_preventResendingRevisionData'](_0x48d000)):_0x48d000['toVersion']===_0x46b05e&&_0x48d000['fromVersion']===_0x2d80cc?_0x5d7028=!0x1:(_0x21e1bd['toVersion']===_0x46b05e&&_0x21e1bd['fromVersion']===_0x2d80cc||this['_fixRevision']({'revision':_0x21e1bd,'from':_0x2d80cc,'to':_0x46b05e}),_0x5d7028=!0x0),_0x5d7028&&(delete _0x48d000['fromVersion'],delete _0x48d000['toVersion'],delete _0x48d000['diffData'],delete _0x48d000['createdAt'],delete _0x48d000['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x48d000),this['_preventResendingRevisionData'](_0x48d000);}else this['_revisionTracker']['addRevisionData'](_0x48d000);}const _0x57baaf=_0x400794['getRevisions']();_0x57baaf['reverse']();for(let _0x4344e5=0x0;_0x4344e5<_0x57baaf['length']-0x1;_0x4344e5++){const _0x660bb9=_0x57baaf[_0x4344e5],_0x35cad4=_0x57baaf[_0x4344e5+0x1];if(_0x660bb9['fromVersion']<_0x35cad4['toVersion']){const _0x50483f=_0x35cad4['toVersion'],_0x5740fb=Math['max'](_0x50483f,_0x660bb9['toVersion']);this['_fixRevision']({'revision':_0x660bb9,'from':_0x50483f,'to':_0x5740fb});}}}['_fixRevision']({revision:_0x515260,from:_0x35a6a8,to:_0x1f744e}={}){const _0x901358=this['editor']['plugins']['get'](_0x4fba0e),_0x43fdaf=this['_revisionTracker']['buildRevisionData']({'revision':_0x515260,'from':_0x35a6a8,'to':_0x1f744e});_0x43fdaf['authors']=_0x43fdaf['authorsIds']['map'](_0x25e4fc=>_0x901358['getUser'](_0x25e4fc)),_0x515260['_update'](_0x43fdaf);}['_preventResendingRevisionData'](_0x44e278){const _0x162662={};_0x162662['id']=_0x44e278['id'];for(const _0x4db6fe of Object['keys'](_0x44e278))'id'!==_0x4db6fe&&(_0x162662[_0x4db6fe]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x162662['id'],_0x162662,!0x0);}async['_fetchMissingUsers'](_0x35799e){const _0x5071c5=this['editor']['plugins']['get'](_0x4fba0e),{connection:_0x82124c}=this['editor']['plugins']['get'](n),_0x68e5dc=new Set();for(const _0x32b4f6 of _0x35799e){for(const _0x169be3 of _0x32b4f6['authorsIds'])_0x17992e(_0x169be3);_0x32b4f6['creatorId']&&_0x17992e(_0x32b4f6['creatorId']);}if(0x0===_0x68e5dc['size'])return;const _0x49218=await ht['getMany'](_0x82124c,Array['from'](_0x68e5dc));for(const _0x388184 of _0x49218)_0x5071c5['getUser'](_0x388184['id'])||_0x5071c5['addUser'](_0x388184);function _0x17992e(_0x2edf8e){_0x5071c5['getUser'](_0x2edf8e)||_0x68e5dc['add'](_0x2edf8e);}}}function b(_0x295dc0){return _0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x295dc0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x25b979{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Z extends _0x1c3372{['_collapseAt'];constructor(_0x4607a5,_0x44cc6c=0x6){super(_0x4607a5);const _0x28527c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x44cc6c,this['bind']('isHidden')['to'](this,'usersCount',_0x17a4c2=>_0x17a4c2<_0x44cc6c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x28527c['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x28527c['to']('usersCount',_0x2db5b2=>'+'+(_0x2db5b2-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x1c3372{['items'];['keystrokes'];constructor(_0x7b63){super(_0x7b63);const _0x5a45c1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5360be(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5a45c1['if']('hasPopup'),'aria-expanded':_0x5a45c1['to']('isExpanded',_0x5bb8b0=>this['hasPopup']&&String(_0x5bb8b0)),'aria-label':_0x5a45c1['to']('hasPopup',_0x58c25e=>B(_0x7b63,_0x58c25e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5a45c1['to']('hasPopup',_0x33df25=>!!_0x33df25&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x5a45c1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x5a45c1['to'](_0x6cd37=>{const _0x5ea4bc=_0x6cd37,_0x2da6d1=document['querySelector']('.ck-presence-list__dropdown-list'),_0x1107cd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2da6d1?.['contains'](_0x5ea4bc['relatedTarget'])||_0x1107cd?.['contains'](_0x5ea4bc['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x333b88,_0xe63128,_0x32c3a1)=>{this['element']&&(_0x32c3a1?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class Y extends _0x1c3372{['counterView'];['inlineListView'];constructor(_0x8d3b9e,_0x151b8c=0x6){super(_0x8d3b9e);const _0x111f7b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new Z(this['locale'],_0x151b8c),this['inlineListView']=new is(_0x8d3b9e),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x14b91c of this['inlineListView']['items'])_0x14b91c['tooltipPosition']='s';this['inlineListView']['items']['first']&&(this['inlineListView']['items']['first']['tooltipPosition']='se');}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list','ck-reset','ck-rounded-corners',_0x111f7b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class tt extends _0x1c3372{['listWrapperView'];constructor(_0x3711e9,_0x237b33){super(_0x3711e9);const _0x3c4577=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x3711e9,_0x237b33),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':B(_0x3711e9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x3c4577['to'](_0x10d3d8=>{const _0x1743bb=_0x10d3d8,_0x4434f3=document['querySelector']('.ck-presence-list__list'),_0x395e25=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4434f3?.['contains'](_0x1743bb['relatedTarget'])||_0x395e25?.['contains'](_0x1743bb['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x4de888{constructor(_0x2c5149,_0x182271){super(_0x2c5149);const _0x7a8e13=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x182271?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x7a8e13['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x7a8e13['to']('role'),'aria-label':_0x7a8e13['to']('ariaLabel'),'aria-labelledby':_0x7a8e13['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x57f3d3['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4cd10f=this['element'];_0x4cd10f&&(this['_isScrollable']=Math['max'](_0x4cd10f['scrollHeight'],_0x4cd10f['clientHeight'])>0.8*window['innerHeight']);}}class st extends rt{['userView'];constructor(_0xfd44e4,_0x464d5b,_0x4f093a){super(_0xfd44e4);const _0x47798e=this['bindTemplate'];this['userView']=new ct(_0xfd44e4,_0x464d5b);const _0x246048={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x464d5b['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x464d5b['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x464d5b['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4f093a&&(_0x246048['tag']='button',_0x246048['on']={'click':_0x47798e['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x246048);}['focus'](){this['element']['focus']();}}class it extends _0x1c3372{['userView'];['markerView'];constructor(_0x4900f9,_0x11ebe9,_0x56c5fc){super(_0x4900f9);const _0x488512=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x4900f9,_0x11ebe9),this['markerView']=new MarkerView(_0x4900f9,_0x11ebe9);const _0x2cc920=new ot(_0x4900f9);_0x2cc920['template']['tag']='span',_0x2cc920['text']=_0x11ebe9['name'];const _0x12ead6={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x488512['to']('isFocusable',_0xcaed44=>!!_0xcaed44&&0x0),'aria-labelledby':_0x2cc920['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x488512['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x488512['to']('hasTooltip',_0x2b7d71=>!_0x2b7d71),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2cc920]};_0x56c5fc&&(_0x12ead6['tag']='button',_0x12ead6['on']={'click':_0x488512['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x12ead6);}}class MarkerView extends _0x1c3372{constructor(_0x258691,_0x3bf991){super(_0x258691),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3bf991['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const et={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x6f804a{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xad3726){super(_0xad3726),this['context']['config']['define']('presenceList',et);const _0x494f30=_0xad3726['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x494f30)throw new _0xb4ae54('presencelist-collapseat-invalid-format',this);if(_0x494f30<0x1)throw new _0xb4ae54('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x247fc3(),this['balloonPanelView']=new _0x146574(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x2bf566 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x2bf566);this['listenTo'](this['_allConnectedUsers'],'add',(_0x37f636,_0x47e298)=>{this['_handleUserAdd'](_0x47e298);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2efb9b,_0x177acb)=>{this['_handleUserRemove'](_0x177acb);});}['_createView'](){const _0x4a8fce=this['context'],_0x388caa=new Y(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x385da9=this['balloonPanelView'];if(!_0x245a67(_0x4a8fce['config']['get']('presenceList.container')))throw new _0xb4ae54('presencelist-missing-container',this);return _0x388caa['counterView']['bind']('usersCount')['to'](this),_0x388caa['bind']('isCollapsed')['to'](this,'usersCount',_0x14b98c=>{const {collapseAt:_0x314b8a}=_0x4a8fce['config']['get']('presenceList'),_0x1de2d4=_0x14b98c>=_0x314b8a;if(_0x1de2d4&&!_0x388caa['inlineListView']['items']['find'](_0x52ac15=>_0x52ac15 instanceof Z)){const _0x580540=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x580540&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x388caa['inlineListView']['items']['add'](_0x388caa['counterView']);}return _0x1de2d4||this['hideDropdown'](),_0x1de2d4;}),_0x388caa['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x420d31=>{const _0x127a66=_0x4a8fce['config']['get']('presenceList'),_0x714f12=new it(_0x4a8fce['locale'],_0x420d31,!!_0x127a66['onClick']);return _0x714f12['bind']('hasTooltip')['to'](_0x388caa,'isCollapsed',_0x4fd4f7=>!_0x4fd4f7),_0x714f12['bind']('isFocusable')['to'](_0x388caa,'isCollapsed',_0x5c6e72=>!_0x5c6e72),_0x127a66['onClick']&&this['listenTo'](_0x714f12,'execute',()=>{this['view']['isCollapsed']||_0x127a66['onClick'](_0x420d31,_0x714f12['element']);}),_0x714f12;}),this['listenTo'](_0x388caa['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x388caa['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x388caa['inlineListView']['keystrokes']['set']('Enter',(_0x33b79d,_0x3c5329)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3c5329());}),_0x388caa['render'](),_0x385da9['render'](),_0x144a34({'emitter':_0x388caa,'activator':()=>_0x385da9['isVisible'],'contextElements':[_0x385da9['element'],_0x388caa['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4a8fce['config']['get']('presenceList.container')['appendChild'](_0x388caa['element']),this['_bodyCollection']=new _0x5c43da(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x388caa;}['_handleUserAdd'](_0xdbaba){if(!this['context']['config']['get']('presenceList.displayMe')&&_0xdbaba['isMe'])return;const _0x2c59f1=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2c59f1-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4947df=_0xdbaba['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0xdbaba,_0x4947df);}['_handleUserRemove'](_0x4b20f6){this['usersCount']--;const {collapseAt:_0x56e1fc}=this['context']['config']['get']('presenceList'),_0x1fa543=this['usersCount']>=_0x56e1fc;if(this['currentDisplayedUsers']['get'](_0x4b20f6['id']))this['currentDisplayedUsers']['remove'](_0x4b20f6['id']);else{if(_0x1fa543&&this['currentDisplayedUsers']['length']+0x1===_0x56e1fc-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1fa543?0x1:0x0)<this['usersCount']){for(const _0x362447 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x362447['id'])&&(this['currentDisplayedUsers']['add'](_0x362447,Math['min'](this['currentDisplayedUsers']['length']-(_0x1fa543?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1fa543?0x1:0x0)===_0x56e1fc-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x261efe=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new tt(this['context']['locale'],!!_0x261efe['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x25ec65}=this['presenceDropdownView'];_0x25ec65['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x35f8e0=>{if(!_0x261efe['displayMe']&&_0x35f8e0['isMe'])return null;const _0x23c584=new st(this['context']['locale'],_0x35f8e0,!!_0x261efe['onClick']);return _0x261efe['onClick']&&this['listenTo'](_0x23c584,'execute',()=>{_0x261efe['onClick'](_0x35f8e0,_0x23c584['element']);}),_0x23c584;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x25ec65['focus'](),_0x25ec65['checkIfScrollable']();const _0x5500a7=(_0x54e6a4,_0x19a30c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x19a30c();};_0x25ec65['keystrokes']['set']('Esc',_0x5500a7),_0x25ec65['keystrokes']['set']('Shift+Tab',_0x5500a7),_0x25ec65['keystrokes']['set']('Tab',(_0x5834f7,_0x425799)=>{!function(_0x28a6e0){const _0x3459cd=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x32f569=>_0x32f569+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x55005d=[...document['body']['querySelectorAll'](_0x3459cd)]['filter'](_0x59dd5a=>_0x59dd5a===document['activeElement']||_0x59dd5a['offsetWidth']+_0x59dd5a['offsetHeight']>0x0)['sort']((_0x112acf,_0x12544d)=>(_0x112acf['tabIndex']||0x0)-(_0x12544d['tabIndex']||0x0)),_0x5dde6c=_0x55005d['indexOf'](_0x28a6e0),_0x451aac=_0x55005d[(_0x5dde6c+0x1)%_0x55005d['length']];_0x451aac&&_0x451aac['focus']();}(this['view']['element']),this['hideDropdown'](),_0x425799();}),_0x25ec65['focusTracker']['add'](this['view']['element']),_0x25ec65['focusTracker']['on']('change:isFocused',(_0x34302c,_0x15bcbe,_0x54ddc0)=>{_0x54ddc0||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class PresenceList extends _0x6f804a{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
@@ -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':_0x1ea514=>0x1!=_0x1ea514}};
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':_0x11150d=>0x1!=_0x11150d}};