@ckeditor/ckeditor5-real-time-collaboration 47.7.5 → 47.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +14 -14
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x3bdf57,Plugin as _0x3332be,PendingActions as _0x442f90,Context as _0x1dce13}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x353b8b,CKEditorError as _0x5d0ce2,Collection as _0x9d9df4,global as _0x1b8319,version as nt,uid as _0x91b62c,KeystrokeHandler as _0x45cc9b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x452da1,View as _0x512b3c,ListView as _0x477aad,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x4371c1,clickOutsideHandler as _0x2a979d,BodyCollection as _0x2b3d32}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x2bf042,History as _0x5d395f,NoOperation as _0x5dd696,InsertOperation as _0x44c460,MarkerOperation as _0xc8e293,RootAttributeOperation as _0x53ed4f,transformOperationSets as _0x4179bf,OperationFactory as _0x287ee3}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as at,WEB_SOCKET_GATEWAY_STATES as _0x495437,CollaborativeEditingService as _0x660943,User as ht,CommentsService as _0x35a16d,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1d83a7,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x28cf58}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3063f7}from'es-toolkit/compat';class n extends _0x3bdf57{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>at)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x452da1];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9b4bbc){super(_0x9b4bbc),this['set']('state',_0x495437['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x353b8b())();}['init'](){const _0x505a07=this['context'],_0x23904d=_0x505a07['plugins']['get']('CloudServices'),_0x2e0f30=_0x505a07['plugins']['get'](_0x452da1);if(!_0x23904d['token'])throw new _0x5d0ce2('websocketgateway-missing-token',this);if(!_0x23904d['webSocketUrl'])throw new _0x5d0ce2('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'](_0x23904d['token'],_0x23904d['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x25fed1=>{if(this['connection']=_0x25fed1,this['bind']('state')['to'](_0x25fed1,'state',this,'_isBrowserOffline',(_0x2308cc,_0x36c2a8)=>('connected'!==_0x2308cc&&(this['_shouldPluginsReconnect']=!0x0),_0x36c2a8||_0x2308cc!==_0x495437['CONNECTED']?_0x495437['DISCONNECTED']:this['state']==_0x495437['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x495437['CONNECTING']):_0x495437['CONNECTED'])),this['connection']['on']('error',(_0x941424,_0x21c707)=>{if('limitExceeded'!==_0x21c707['code'])throw console['error'](_0x21c707),new _0x5d0ce2('cloudservices-init',null,{'originalError':_0x21c707});_0x2e0f30['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'});}),!_0x25fed1['me'])return new Promise(_0x22d250=>_0x25fed1['on']('change:me',_0x22d250));})['catch'](_0x8f65b3=>{throw console['error'](_0x8f65b3),new _0x5d0ce2('cloudservices-init',null,{'originalError':_0x8f65b3});});}['addToReconnectionStack'](_0x4cebff){if('function'!=typeof _0x4cebff['reconnect'])throw new _0x5d0ce2('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4cebff))throw new _0x5d0ce2('websocketgateway-plugin-already-registered',this,{'name':_0x4cebff['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4cebff);}['removeFromReconnectionStack'](_0x597577){this['_reconnectionStack']['delete'](_0x597577);}['isInReconnectionStack'](_0x5df197){return this['_reconnectionStack']['has'](_0x5df197);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1572fa=>_0x1572fa['reconnect']())))['then'](()=>this['state']=_0x495437['CONNECTED'])['catch'](_0x55c51b=>{throw console['error'](_0x55c51b),new _0x5d0ce2('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x495437['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x3bdf57{['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,_0x1d83a7];}constructor(_0x4c3b95){super(_0x4c3b95),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x9d9df4(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d83a7);}['init'](){const _0x4b00f3=this['context']['plugins']['get'](n);this['listenTo'](_0x4b00f3,'change:state',(_0x2b0dc3,_0x216d35,_0xa59dd5)=>{if('connected'!==_0xa59dd5)this['channelSessions']['forEach'](_0x5d6005=>_0x5d6005['clear']()),this['channelConnectedUsers']['forEach'](_0x2ef3e2=>_0x2ef3e2['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x114a92,_0x26f7ba]of this['_registeredSessions'])for(const _0x48bcae of _0x26f7ba)this['_handleSessionAdd'](_0x114a92,_0x48bcae);}}),this['_createUser'](_0x4b00f3['connection']['me'],!0x0);}['register'](_0x27df37,_0x170725){if(this['_registeredSessions']['has'](_0x27df37))throw new _0x5d0ce2('sessions-register-already-registered',null,{'channelId':_0x27df37});this['_registeredSessions']['set'](_0x27df37,_0x170725),this['channelSessions']['set'](_0x27df37,new _0x9d9df4()),this['channelConnectedUsers']['set'](_0x27df37,new _0x9d9df4()),this['listenTo'](_0x170725,'add',(_0x10cc86,_0x31b0f4)=>this['_handleSessionAdd'](_0x27df37,_0x31b0f4)),this['listenTo'](_0x170725,'remove',(_0x94d45e,_0x3717f1)=>this['_handleSessionRemove'](_0x27df37,_0x3717f1));for(const _0x5d49df of _0x170725)this['_handleSessionAdd'](_0x27df37,_0x5d49df);}['unregister'](_0x1cbd39){if(!this['_registeredSessions']['has'](_0x1cbd39))throw new _0x5d0ce2('sessions-unregister-not-exist',null,{'channelId':_0x1cbd39});const _0x33f692=this['_registeredSessions']['get'](_0x1cbd39);this['stopListening'](_0x33f692);for(const _0x3d1e5c of _0x33f692)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x1cbd39,_0x3d1e5c);this['_registeredSessions']['delete'](_0x1cbd39),this['channelSessions']['delete'](_0x1cbd39),this['channelConnectedUsers']['delete'](_0x1cbd39);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0xe0e1db){for(const _0x1df18b of this['channelSessions']['values']())for(const _0x9eacad of _0x1df18b)if(_0x9eacad['id']===_0xe0e1db)return _0x9eacad['user'];}['getUserSessions'](_0xbfcb2c,_0xe621d1){const _0x82b693=_0xe621d1?[this['channelSessions']['get'](_0xe621d1)]:this['channelSessions']['values'](),_0x123aa2=new Set();for(const _0x40b4f7 of _0x82b693)for(const _0x158cc7 of _0x40b4f7)_0x158cc7['user']['id']===_0xbfcb2c['id']&&_0x123aa2['add'](_0x158cc7['id']);return _0x123aa2;}['getUserRole'](_0x4180ae){for(const _0x3e7aa9 of this['channelSessions']['values']())for(const _0x588af3 of _0x3e7aa9)if(_0x588af3['user']===_0x4180ae)return _0x588af3['role'];}['_handleSessionAdd'](_0x33697a,_0x113bd2){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x5b3107=_0x113bd2['user'],_0x5b19b1=this['_users']['getUser'](_0x5b3107['id'])||this['_createUser'](_0x5b3107),_0x4917d5=Object['assign']({},_0x113bd2,{'user':_0x5b19b1});if(this['channelSessions']['get'](_0x33697a)['add'](_0x4917d5),!_0x5b3107['hiddenInPresenceList']){const _0x642f05=this['channelConnectedUsers']['get'](_0x33697a);_0x642f05['has'](_0x5b19b1['id'])||_0x642f05['add'](_0x5b19b1),this['allConnectedUsers']['has'](_0x5b19b1['id'])||_0x5b3107['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x5b19b1,_0x5b19b1['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x33697a,{'channelId':_0x33697a,'session':_0x4917d5});}['_handleSessionRemove'](_0x139445,_0x2ae7d1){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x679de1=this['channelConnectedUsers']['get'](_0x139445),_0x228036=_0x2ae7d1['user'];_0x228036['id']&&(this['channelSessions']['get'](_0x139445)['remove'](_0x2ae7d1['id']),_0x679de1['has'](_0x228036['id'])&&!this['getUserSessions'](_0x228036,_0x139445)['size']&&_0x679de1['remove'](_0x228036['id']),this['allConnectedUsers']['get'](_0x228036['id'])&&!this['getUserSessions'](_0x228036)['size']&&this['allConnectedUsers']['remove'](_0x228036['id']));}['_createUser'](_0x5cac7c,_0x2d0256){const _0x54e8e7=this['_users']['addUser'](_0x5cac7c);return _0x2d0256&&this['_users']['defineMe'](_0x5cac7c['id']),_0x54e8e7['orderNumber']=this['_uniqueUsersCount']++,_0x54e8e7;}}class k extends _0x3332be{['_domEmitter']=new(_0x353b8b())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x47b9c3=this['editor'],_0x19ca72=_0x47b9c3['plugins']['get'](i);_0x47b9c3['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x1a74d0,{writer:_0x2ad035})=>function(_0x2fc635,_0x4043d,_0x31a83a,_0x11bdf0){const _0x26570e=_0x2fc635['markerName']['split'](':')[0x2],_0x89f437=_0x31a83a['getUserBySessionId'](_0x26570e);if(!_0x89f437||_0x26570e===_0x31a83a['mySessionId'])return;if(!_0x11bdf0['model']['schema']['checkChild'](_0x2fc635['markerRange']['start'],'$text'))return;const _0x3ccff0={'class':'ck-user__marker\x20'+_0x89f437['color']['getMarkerClass'](),'data-name':_0x89f437['name'],'data-session-id':_0x26570e},_0xc52b65=_0x11bdf0['model']['markers']['get'](_0x2fc635['markerName']),_0x6a96bd=_0xc52b65['getStart'](),_0x3befd5=_0x6a96bd['nodeAfter'],_0x4b4e24=_0x11bdf0['model']['schema'];if(_0x3befd5&&_0x4b4e24['isObject'](_0x3befd5)&&_0x4b4e24['isInline'](_0x3befd5)&&!_0x11bdf0['model']['markers']['get']('user:range:'+_0x26570e)['getRange']()['isCollapsed'])return;const _0x1e04d6=_0x6a96bd['parent'];return _0x11bdf0['model']['schema']['isLimit'](_0x1e04d6)&&!_0x11bdf0['model']['hasContent'](_0x1e04d6)&&(_0x3ccff0['contenteditable']=!0x1),function(_0x1b97b4,_0xf78131,_0x58253a){const _0x3575cd=_0x1b97b4['createUIElement']('span',_0xf78131);return _0x1b97b4['setCustomProperty']('userPositionMarker',!0x0,_0x3575cd),_0x3575cd['render']=function(_0x235f6b){const _0x5d4b3f=this['toDomElement'](_0x235f6b),_0x539fcd=document['createElement']('span');return _0x539fcd['classList']['add']('ck-user__marker-tooltip'),_0x539fcd['setAttribute']('contenteditable','false'),_0x539fcd['setAttribute']('spellcheck','false'),_0x539fcd['textContent']=_0x58253a['name'],_0x5d4b3f['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x539fcd['outerHTML']+'⁠',_0x5d4b3f['addEventListener']('mouseenter',()=>{_0x5d4b3f['classList']['add']('ck-user__marker_hovered');}),_0x5d4b3f['addEventListener']('mouseleave',()=>{_0x5d4b3f['classList']['remove']('ck-user__marker_hovered');}),_0x5d4b3f;},_0x3575cd['isSimilar']=function(_0xbf74cb){return!(!this['getCustomProperty']('userPositionMarker')||!_0xbf74cb['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xbf74cb['getAttribute']('data-session-id'));},_0x3575cd;}(_0x4043d,_0x3ccff0,_0x89f437);}(_0x1a74d0,_0x2ad035,_0x19ca72,_0x47b9c3)}),_0x47b9c3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x331303=>function(_0x8edeaf,_0x180390){const _0x16469c=_0x8edeaf['markerName']['split'](':')[0x2];if(_0x16469c===_0x180390['mySessionId'])return null;const _0x578cd6=_0x180390['getUserBySessionId'](_0x16469c);if(!_0x578cd6)return{'id':_0x16469c,'classes':[]};return{'id':_0x16469c,'classes':['ck-user__selection',_0x578cd6['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x16469c},'priority':0x7d0+_0x578cd6['orderNumber']};}(_0x331303,_0x19ca72)}),function(_0x2a5ee9){const _0x48c828=_0x2a5ee9['model'],_0x19221a=new Map(),_0x206450=_0x2a5ee9['plugins']['get'](i);_0x48c828['markers']['on']('update:user:range',(_0x47fb6e,_0x276cb5,_0x581f55,_0x19f1b8)=>{if(!_0x19f1b8&&_0x19221a['get'](_0x276cb5['name']))return _0x19221a['get'](_0x276cb5['name'])['detach'](),void _0x19221a['delete'](_0x276cb5['name']);const _0x27034b=_0x276cb5['name']['split'](':')[0x2];if(_0x27034b===_0x206450['mySessionId'])return;const _0x26e7e6='user:position:'+_0x27034b;_0x48c828['markers']['has'](_0x26e7e6)&&_0x2a5ee9['editing']['reconvertMarker'](_0x26e7e6),_0x276cb5['on']('change:range',(_0x5f0ead,_0x4da703,_0x1a8886)=>{if('$graveyard'!=_0x4da703['root']['rootName']&&'$graveyard'==_0x276cb5['getRange']()['root']['rootName']&&!_0x19221a['has'](_0x276cb5['name'])){const _0x2f8c1b=_0x48c828['schema']['getNearestSelectionRange'](_0x1a8886['deletionPosition']);if(_0x2f8c1b){const _0x36c0ec=_0x2bf042['fromRange'](_0x2f8c1b);_0x19221a['set'](_0x276cb5['name'],_0x36c0ec),_0x36c0ec['on']('change:range',(_0x2d23d5,_0xc23baf,_0x2fcdcd)=>{if('$graveyard'==_0x36c0ec['root']['rootName']){const _0x5e4cb3=_0x48c828['schema']['getNearestSelectionRange'](_0x2fcdcd['deletionPosition']);_0x5e4cb3?(_0x36c0ec['start']=_0x5e4cb3['start'],_0x36c0ec['end']=_0x5e4cb3['end']):(_0x19221a['delete'](_0x276cb5['name']),_0x36c0ec['detach']());}});}}});}),_0x48c828['document']['on']('change',()=>{_0x19221a['size']>0x0&&_0x48c828['enqueueChange']({'isUndoable':!0x1},_0x293b05=>{for(const [_0x404cd5,_0x447937]of _0x19221a)'$graveyard'==_0x48c828['markers']['get'](_0x404cd5)['getRange']()['root']['rootName']&&(x(_0x404cd5['split'](':')[0x2],_0x447937['toRange'](),_0x48c828,_0x293b05),_0x447937['detach']());_0x19221a['clear']();});});}(_0x47b9c3),this['_domEmitter']['listenTo'](_0x1b8319['document'],'keydown',(_0x152eab,{key:_0x56f6bf})=>{'Escape'===_0x56f6bf&&function(_0x28aad8){_0x28aad8['editing']['view']['change'](_0x5a8117=>{for(const _0x4e275e of _0x28aad8['model']['markers']){if(!_0x4e275e['name']['startsWith']('user:position'))continue;const _0x54668a=_0x28aad8['editing']['mapper']['markerNameToElements'](_0x4e275e['name']);if(_0x54668a){for(const _0x29653d of _0x54668a)_0x5a8117['removeClass']('ck-user__marker_hovered',_0x29653d);}}});}(_0x47b9c3);},{'useCapture':!0x0});}['afterInit'](){const _0x249a60=this['editor'],_0x232bf6=_0x249a60['commands']['get']('undo');_0x232bf6&&_0x249a60['model']['on']('applyOperation',(_0x457326,_0x3e4d8d)=>{const _0x15c3f3=_0x3e4d8d[0x0];if(!_0x15c3f3['isDocumentOperation'])return;if('marker'!=_0x15c3f3['type']||!_0x15c3f3['name']['startsWith']('user:'))return;const _0x35d055=_0x15c3f3['batch'];_0x232bf6['_createdBatches']['has'](_0x35d055)&&(_0x15c3f3['newRange']=_0x15c3f3['oldRange']?_0x249a60['model']['createRange'](_0x15c3f3['oldRange']['start'],_0x15c3f3['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x383a9b=this['editor'],_0xfe5c3f=_0x383a9b['model']['document'],_0x37dd4a=_0x383a9b['plugins']['get'](i);_0x383a9b['model']['enqueueChange']({'isUndoable':!0x1},_0x56d30a=>{const _0x37113c='user:range:'+_0x37dd4a['mySessionId'],_0x5a4c98='user:position:'+_0x37dd4a['mySessionId'],_0x32b148=_0x383a9b['model']['markers']['has'](_0x37113c);_0x383a9b['editing']['view']['hasDomSelection']?x(_0x37dd4a['mySessionId'],_0xfe5c3f['selection']['getFirstRange'](),_0x383a9b['model'],_0x56d30a):_0x32b148&&(_0x56d30a['removeMarker'](_0x37113c),_0x56d30a['removeMarker'](_0x5a4c98));});}}function x(_0x28b303,_0xf949a0,_0x2a6e63,_0x25e47e){const _0x48e2f4='user:range:'+_0x28b303,_0x4b4f47='user:position:'+_0x28b303,_0x4868f3=_0xf949a0['getContainedElement']();let _0x5c95b9=_0xf949a0['start'];if(_0x4868f3&&_0x4868f3['is']('element','tableCell')){const _0x2f68d1=function(_0x58a4cc,_0x32af22){for(const _0x5ecf9d of _0x58a4cc['getPositions']())if(_0x32af22['schema']['checkChild'](_0x5ecf9d,'$text'))return _0x5ecf9d;}(_0xf949a0,_0x2a6e63);_0x2f68d1&&(_0x5c95b9=_0x2f68d1,_0xf949a0=_0x25e47e['createRange'](_0x5c95b9));}const _0x1aa3a5=_0x25e47e['createRange'](_0x5c95b9);_0x2a6e63['markers']['has'](_0x48e2f4)?(_0x25e47e['updateMarker'](_0x48e2f4,{'range':_0xf949a0}),_0x25e47e['updateMarker'](_0x4b4f47,{'range':_0x1aa3a5})):(_0x25e47e['addMarker'](_0x48e2f4,{'range':_0xf949a0,'usingOperation':!0x0}),_0x25e47e['addMarker'](_0x4b4f47,{'range':_0x1aa3a5,'usingOperation':!0x0}));}function R(_0x185dab,_0x28b1b7,_0x8b8799){const _0x435f5e=_0x185dab['t'],t=_0x185dab['t'];switch(_0x28b1b7){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 _0x435f5e({'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'},_0x8b8799);default:return'';}}let j=0x1;class l extends _0x3332be{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x660943)());['_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,_0x442f90,_0x1d83a7,_0x452da1];}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 _0x3fdb34=this['serverHistory']['getOperations']();for(let _0x29e414=_0x3fdb34['length']-0x1;_0x29e414>=0x0;_0x29e414--){const _0x346a40=_0x3fdb34[_0x29e414];if(!this['_disconnectionOperations']['has'](_0x346a40))return _0x346a40['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x30c291){if(super(_0x30c291),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5d395f(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x5d0ce2('collaboration-missing-channelid',this);const _0x554c0e=_0x30c291['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x554c0e,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x28cf58(),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 _0x1d03ec=this['editor'],_0x478588=_0x1d03ec['plugins']['get'](_0x1d83a7),_0x1bee79=_0x1d03ec['plugins']['get'](n);this['listenTo'](_0x478588,'getOperationAuthor',(_0xa610,_0x419f50)=>{const _0x3d74d0=_0x419f50[0x0];_0x3d74d0['_authorId']&&(_0xa610['return']=_0x478588['getUser'](_0x3d74d0['_authorId']),_0xa610['stop']()),null===_0x3d74d0['_authorId']&&(_0xa610['return']=null,_0xa610['stop']());},{'priority':'high'}),this['listenTo'](_0x1d03ec['model']['document']['selection'],'change:range',(_0x4044b7,_0x1bb5c2)=>{_0x1bb5c2['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1d03ec['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1d03ec['model']['on']('applyOperation',(_0x225fd0,_0x13da4e)=>{const _0x2eaba2=_0x13da4e[0x0];_0x2eaba2['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2eaba2),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x1bee79,'state',this,'_hasSynchronizationProblem',(_0x37d2f4,_0x4ba3a9)=>'connected'===_0x37d2f4&&!_0x4ba3a9),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1d03ec['disableReadOnlyMode']('rtc-offline'):_0x1d03ec['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1d03ec['disableReadOnlyMode']('rtc-offline'):_0x1d03ec['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xbf7d69=this['editor']['plugins']['get'](i),_0x4668ab=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0xbf7d69['unregister'](this['_channelId']);const _0x1c550a=await this['_service']['reconnect'](_0x4668ab['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1c550a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x5ed837=await this['_service']['getConnectedSessions']();_0xbf7d69['register'](this['_channelId'],_0x5ed837),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2575a4){if(function(_0xaa76fa){return'404'===_0xaa76fa['code'];}(_0x2575a4)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x350e5f){return'409'===_0x350e5f['code'];}(_0x2575a4)){const _0x219549=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'](_0x219549);}else{if(!(_0x2575a4 instanceof ReconnectionError))throw _0x2575a4;this['_handleReconnectionError']();}}}}['destroy'](){const _0x25b645=this['editor']['plugins']['get'](n),_0x4597d6=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4597d6['channelSessions']['has'](this['_channelId'])&&_0x4597d6['unregister'](this['_channelId']),_0x25b645['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x1e5de8){if(this['sessionId']!==_0x1e5de8['sessionId']&&this['_lastSyncedOperationId']!==_0x1e5de8['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x1e5de8['sessionId'],this['_handleServerResponse']([],{..._0x1e5de8,'wereChangesApplied':!0x1,'data':_0x1e5de8['data']},'reconnect');}async['_connectService'](_0x31752d,_0x1aaf5f=!0x1){const {connection:_0x16fcad}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x16fcad,this['_channelId'])['then'](_0x582dee=>this['_initSessionsHandling'](_0x582dee))['catch'](_0x4a6aa3=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4a6aa3);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xff5fd9,_0x2f88ac)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x2f88ac);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x7844=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x31752d);this['_isPendingUpdate']=!0x0;const _0x202fad=await this['_service']['connect'](_0x16fcad,this['_compressOperations'](_0x31752d),_0x7844);if(this['sessionId']=_0x202fad['sessionId'],_0x1aaf5f){if(!_0x202fad['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x202fad['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x31752d,_0x202fad,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x202fad,_0x31752d);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0xa3bb79=this['editor']['plugins']['get'](i),_0xcd2ef7=this['editor']['plugins']['get'](k),_0x314274=_0xa3bb79['channelSessions']['get'](this['_channelId']);_0x314274&&_0x314274['length']>0x1?_0xcd2ef7['createUserMarkerOperations']():this['listenTo'](_0xa3bb79,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xa3bb79['channelSessions']['get'](this['_channelId'])['length']&&_0xcd2ef7['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x36b97b,_0x3fe60a,_0x1c6d1d,_0x881d4c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3fe60a){const _0x11ad3a=this['_decompressOperations'](_0x1c6d1d,_0x881d4c);await this['_fetchMissingUsers'](_0x11ad3a),this['_handleExternalOperations'](_0x11ad3a,_0x3fe60a,_0x1c6d1d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x44d53b}=this['editor'];let _0x4cec64;try{_0x4cec64=await this['_service']['getDocumentDetails']();}catch{const _0x274d3e=R(_0x44d53b,'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'](_0x274d3e);}const _0x3a1759=_0x4cec64['currentDocumentSession']||_0x4cec64['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x3a1759['lastOperationId']){const _0x58eb22=R(_0x44d53b,'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'](_0x58eb22);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x3d9a06){const _0x4f38fb=this['editor']['plugins']['get'](i);this['listenTo'](_0x4f38fb,'sessionAdd:'+this['_channelId'],(_0x312e91,{session:_0x8bd5db})=>{if(_0x8bd5db['id']===_0x4f38fb['mySessionId']){_0x312e91['off']();const _0x41e86f=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x41e760=_0x8bd5db['permissions'];_0x41e86f&&_0x41e86f['isEnabled']&&(_0x41e760=_0x41e760['filter'](_0x32b567=>'document:write'!==_0x32b567)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x41e760,this['_channelId']);}}),_0x4f38fb['register'](this['_channelId'],_0x3d9a06);}['_initThrowingOnDataSet'](){const _0x30810c=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x8b6c9c)=>{if(!_0x8b6c9c[_0x8b6c9c['length']-0x1]['suppressErrorInCollaboration'])throw new _0x5d0ce2('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x30810c['apply'](this['editor']['data'],_0x8b6c9c);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x218568,[_0x45c54a])=>{if(this['_document']['version'])throw new _0x5d0ce2('realtimecollaborationclient-init-document-already-initialized',this);_0x218568['stop'](),this['_setPendingAction']();const _0x5e0249=this['editor']['config']['get']('rootsAttributes'),_0x5a96c2=this['_getOperationsFromInitData'](_0x45c54a,_0x5e0249);0x0==_0x5a96c2['length']&&_0x5a96c2['push'](new _0x5dd696(0x0)),_0x218568['return']=this['_connectService'](_0x5a96c2)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x53ba17=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x53ba17))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x451241,[_0x21f9b8,_0x37d630])=>{_0x451241['stop']();const _0x17b12f=this['editor']['model']['document']['getRoot'](_0x21f9b8);if(!this['_knownRootNames']['has'](_0x21f9b8)){const _0x28a1d5=_0x37d630&&_0x37d630['data']?_0x37d630['data']:'',_0xe0d6f7=_0x37d630&&_0x37d630['attributes']?_0x37d630['attributes']:{};await this['_loadRoot'](_0x21f9b8,_0x28a1d5,_0xe0d6f7);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x17b12f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x17b12f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x155326){const _0x7d7bc9=this['editor']['plugins']['get'](_0x1d83a7),{connection:_0x2a4c7c}=this['editor']['plugins']['get'](n),_0x556b2f=new Set();for(const _0x4be550 of _0x155326){const _0x30a567=_0x4be550['_authorId'];_0x30a567&&!_0x7d7bc9['getUser'](_0x30a567)&&_0x556b2f['add'](_0x30a567);}if(0x0===_0x556b2f['size'])return;const _0x20b7de=await ht['getMany'](_0x2a4c7c,Array['from'](_0x556b2f));for(const _0x4d6447 of _0x20b7de)_0x7d7bc9['getUser'](_0x4d6447['id'])||_0x7d7bc9['addUser'](_0x4d6447);}['_getOperationsFromInitData'](_0x505307,_0x432d28={}){const _0x28ede4=this['editor']['model'],_0x4f7be9=[];let _0x3556bd=0x0;const _0x472eb2='string'==typeof _0x505307?{'main':_0x505307}:_0x505307;for(const _0x2ce86a of Object['keys'](_0x472eb2)){if(!this['_document']['roots']['has'](_0x2ce86a))throw new _0x5d0ce2('realtimecollaborationclient-init-non-existent-root',this);const _0x20af55=this['editor']['data']['parse'](_0x472eb2[_0x2ce86a]),_0x5bc084=this['_document']['getRoot'](_0x2ce86a),_0x6f61d9=new _0x44c460(_0x28ede4['createPositionAt'](_0x5bc084,0x0),_0x20af55,_0x3556bd++);_0x4f7be9['push'](_0x6f61d9);for(const [_0x309b1a,_0x5f4121]of _0x20af55['markers']){const _0x37f9cf=_0x28ede4['createRange'](_0x28ede4['createPositionFromPath'](_0x5bc084,_0x5f4121['start']['path']['slice']()),_0x28ede4['createPositionFromPath'](_0x5bc084,_0x5f4121['end']['path']['slice']())),_0x3a6222=new _0xc8e293(_0x309b1a,null,_0x37f9cf,_0x28ede4['markers'],!0x0,_0x3556bd++);_0x4f7be9['push'](_0x3a6222);}}if(_0x432d28)for(const [_0x3d031d,_0x35d64f]of Object['entries'](_0x432d28)){const _0x576a92=_0x28ede4['document']['getRoot'](_0x3d031d);if(!_0x576a92)throw new _0x5d0ce2('multi-root-editor-root-attributes-no-root',null);for(const [_0x1a61cb,_0x1a2ca9]of Object['entries'](_0x35d64f))if(null!==_0x1a2ca9){const _0x580479=new _0x53ed4f(_0x576a92,_0x1a61cb,null,_0x1a2ca9,_0x3556bd++);_0x4f7be9['push'](_0x580479);}}return _0x4f7be9;}async['_loadRoot'](_0x17b26b,_0x2b72df,_0x24251f){this['_getOperationsFromInitData']({[_0x17b26b]:_0x2b72df},{[_0x17b26b]:_0x24251f})['forEach']((_0x2af9b8,_0x55bf4f)=>{_0x2af9b8['baseVersion']=this['_document']['version']+_0x55bf4f,_0x2af9b8['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2af9b8);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1b5ffd,_0x34ea2d){let _0x53a5f0;this['_offset']=_0x1b5ffd['offset'];const _0x4ae5e8=_0x1b5ffd['wereChangesApplied']&&!_0x1b5ffd['initData'],_0x1428b8=_0x4ae5e8?0x0:_0x1b5ffd['data']['baseVersion'];if(_0x34ea2d['forEach'](_0x30f3ff=>{_0x30f3ff['_isInit']=!0x0,_0x30f3ff['createdAt']=_0x1b5ffd['sessionCreatedAt'],_0x30f3ff['_authorId']=null;}),_0x4ae5e8)_0x53a5f0=_0x34ea2d,this['_applyOperationsSet'](_0x53a5f0,_0x4ae5e8);else{if(_0x1b5ffd['initData']){const _0x568197=this['_getOperationsFromInitData'](_0x1b5ffd['initData']);this['_document']['history']['version']=-_0x568197['length'],_0x568197['forEach'](_0x1bc938=>{_0x1bc938['baseVersion']-=_0x568197['length'],_0x1bc938['createdAt']=_0x1b5ffd['sessionCreatedAt'],_0x1bc938['_isInit']=!0x0,_0x1bc938['_authorId']=null;}),this['_applyOperationsSet'](_0x568197,!0x0),this['serverHistory']['version']=-_0x568197['length']+this['_offset'],this['_updateServerHistory'](_0x568197);}this['_document']['history']['version']=_0x1428b8,_0x53a5f0=this['_decompressOperations'](_0x1b5ffd['data'],_0x1b5ffd['metadata']),await this['_fetchMissingUsers'](_0x53a5f0),this['_applyOperationsSet'](_0x53a5f0,_0x4ae5e8);}_0x1b5ffd['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x53a5f0,_0x1b5ffd['lastOperationId']),this['_lastSyncedOperationId']=_0x1b5ffd['lastOperationId']),this['serverHistory']['version']=_0x1428b8+this['_offset'],this['_updateServerHistory'](_0x53a5f0),_0x34ea2d['filter'](_0x3e56b7=>{const _0x1a5cd8=this['_getAffectedRoot'](_0x3e56b7);return _0x1a5cd8&&!this['_knownRootNames']['has'](_0x1a5cd8);})['forEach']((_0x3a93e2,_0x282e59)=>{_0x3a93e2['baseVersion']=this['_document']['version']+_0x282e59,this['_saveOperationInBuffer'](_0x3a93e2);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x48f353,_0x19042c){const _0x14510a=_0x19042c&&_0x19042c['message'];if(_0x14510a&&_0x14510a['startsWith']('realtimecollaborationclient'))throw _0x19042c;const _0x4da8cb=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x4da8cb['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x5d0ce2(_0x48f353,this['editor'],_0x14510a?{'originalError':_0x14510a}:void 0x0);}['_saveOperationInBuffer'](_0x2de4e1){this['_knownOperations']['has'](_0x2de4e1)||(this['_knownOperations']['add'](_0x2de4e1),this['_bufferedOperations']['push'](_0x2de4e1),this['_pendingAction']||'marker'==_0x2de4e1['type']&&!_0x2de4e1['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3ed6c0=!0x1){!_0x3ed6c0&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3e1ca6=>{_0x3e1ca6&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x66851b=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x969358){return _0x969358['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x969358['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x969358['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x66851b)||this['_crash'](_0x66851b['message'],_0x66851b);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x1256f0=>{this['on']('change:_isPendingUpdate',()=>{_0x1256f0();});});}async['_sendBufferedOperations'](){const _0x7780a6=this['editor']['plugins']['get'](k);if(this['_shouldSendSelectionUpdate']()&&(_0x7780a6['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x12009a=[...this['_bufferedOperations']];for(const _0x351707 of _0x12009a)_0x351707['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x351707);const _0x45c072=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x12009a),_0x3ef26e=j++,_0x5e779c=this['_compressOperations'](_0x12009a),_0x54a56c=await this['_service']['sendOperations'](_0x5e779c,_0x5e779c['baseVersion'],_0x45c072);try{return await this['_handleServerResponse'](_0x12009a,_0x54a56c,_0x3ef26e);}catch(_0x409fc1){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x409fc1);}}async['_handleServerResponse'](_0x384c0c,_0x923a5d,_0x373c06){if('error'in _0x923a5d)throw _0x923a5d['error'];let _0x5d0e83=!0x1;if(_0x923a5d['wereChangesApplied']){_0x923a5d['lastOperationId']&&(this['_lastSyncedOperationId']=_0x923a5d['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x42fffd=>!_0x384c0c['includes'](_0x42fffd));for(const _0x42eb12 of _0x384c0c)_0x42eb12['createdAt']='lastOperationAcceptedAt'in _0x923a5d&&_0x923a5d['lastOperationAcceptedAt']||void 0x0;D(_0x384c0c,_0x923a5d['version']-_0x384c0c['length']),this['_updateServerHistory'](_0x384c0c);const _0x26fd45=_0x384c0c['filter'](_0x5278ed=>{if(!_0x5278ed['_isInit'])return!0x1;const _0x43fbb2=this['_getAffectedRoot'](_0x5278ed);return _0x43fbb2&&!this['_knownRootNames']['has'](_0x43fbb2);});D(_0x26fd45,this['_document']['version']),this['_applyOperationsSet'](_0x26fd45),_0x5d0e83=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3c139e=this['_decompressOperations'](_0x923a5d['data'],_0x923a5d['metadata'])['filter'](_0x4cd877=>_0x4cd877['baseVersion']>=this['_lastServerVersion']);_0x3c139e['forEach'](_0x39d374=>this['_addKnownRoot'](_0x39d374)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x351e13=>!_0x351e13['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x351e13))),this['_bufferedOperations']['length']&&D(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3c139e),_0x5d0e83=this['_handleExternalOperations'](_0x3c139e,_0x923a5d['version'],_0x923a5d['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5d0e83?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x1f0c9f,_0x534012,_0x3e9637){try{const _0x547d8a={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5ae186,operationsB:_0x390b68,originalOperations:_0xd5ebee}=_0x4179bf(_0x1f0c9f,this['_bufferedOperations'],_0x547d8a);D(_0x5ae186,this['_document']['version']),D(_0x390b68,_0x534012);for(const _0x9d6a64 of _0x5ae186){const _0x377811=_0xd5ebee['get'](_0x9d6a64);_0x9d6a64['_authorId']=_0x377811?_0x377811['_authorId']:null;}_0x3e9637&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1f0c9f,_0x3e9637),this['_lastSyncedOperationId']=_0x3e9637),this['_bufferedOperations']=[..._0x390b68],this['_applyOperationsSet'](_0x5ae186),this['_updateServerHistory'](_0x1f0c9f);}catch(_0x443a7d){return console['error'](_0x443a7d),!0x1;}return!0x0;}['_applyOperationsSet'](_0x37e4c1,_0x9b230f=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1523da=>{for(const _0x22d2a6 of _0x37e4c1)this['_knownOperations']['add'](_0x22d2a6),this['_addKnownRoot'](_0x22d2a6),_0x1523da['batch']['addOperation'](_0x22d2a6),this['editor']['model']['applyOperation'](_0x22d2a6);});}['_addKnownRoot'](_0x1fc8b8){const _0x47ac2d=this['_getAffectedRoot'](_0x1fc8b8);_0x47ac2d&&this['_knownRootNames']['add'](_0x47ac2d);}['_getAffectedRoot'](_0x46356a){let _0x257f6b,_0x4cf0ea;switch(_0x46356a['type']){case'insert':_0x257f6b=_0x46356a['position']['root'];break;case'marker':if(_0x4cf0ea=_0x46356a['newRange'],!_0x4cf0ea)return null;_0x257f6b=_0x4cf0ea['root'];break;case'addRootAttribute':_0x257f6b=_0x46356a['root'];break;case'addRoot':_0x257f6b=_0x46356a['affectedSelectable'];break;case'move':_0x257f6b=_0x46356a['targetPosition']['root'];break;default:return null;}return _0x257f6b['rootName'];}['_updateServerHistory'](_0x119183){_0x119183['forEach'](_0x14ad68=>{const _0xe2bc5b=_0x14ad68['clone']();_0xe2bc5b['_authorId']=_0x14ad68['_authorId'],_0xe2bc5b['_isInit']=!!_0x14ad68['_isInit'],_0xe2bc5b['createdAt']=_0x14ad68['createdAt'],_0xe2bc5b['baseVersion']+=this['_offset'],_0x14ad68['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xe2bc5b),this['serverHistory']['addOperation'](_0xe2bc5b);});}['_handleReconnectionError'](_0x598977){const _0x3da053=this['editor']['plugins']['get']('Notification'),_0xfdcfcd=this['editor']['locale'];_0x598977||(_0x598977=R(_0xfdcfcd,'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.')),_0x3da053['showWarning'](_0x598977,{'title':R(_0xfdcfcd,'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'](_0x442f90)['add'](R(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x442f90)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x39a549){const _0xdb2945=_0x39a549['map'](_0x111a05=>_0x111a05['toJSON']());return this['_compressor']['compress'](_0xdb2945);}['_decompressOperations'](_0x1a15d0,_0x21317d){return this['_compressor']['decompress'](_0x1a15d0)['map']((_0x2e6db9,_0x5754af)=>{const _0x22d7f7='init'==_0x21317d[_0x5754af]['type'];if('InsertOperation'==_0x2e6db9['__className']){const _0x3afad5=_0x2e6db9['position']['root'];!this['_document']['getRoot'](_0x3afad5)&&(this['_document']['createRoot']('$root',_0x3afad5)['_isAttached']=!0x1);}const _0x564f13=_0x287ee3['fromJSON'](_0x2e6db9,this['_document']);return _0x564f13['wasUndone']=_0x2e6db9['wasUndone'],_0x564f13['_isInit']=_0x22d7f7,_0x564f13['_authorId']=_0x22d7f7?null:_0x21317d[_0x5754af]['userId'],_0x564f13['_isDisconnection']='cs:removeUser'===_0x21317d[_0x5754af]['type'],_0x564f13['createdAt']=_0x21317d[_0x5754af]['createdAt'],_0x564f13;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4ae32e=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4ae32e&&_0x4ae32e['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function D(_0x2b6dfc,_0x3eb5a7){for(const _0xdde325 of _0x2b6dfc)_0xdde325['baseVersion']=_0x3eb5a7++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x11c7d3){this['_ignoredOperations']=_0x11c7d3,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x3bf7c4){let _0xf9f0c3=_0x3bf7c4['length'];for(;_0xf9f0c3--;){const _0x2a78e2=_0x3bf7c4[_0xf9f0c3];if(!this['_ignoredOperations']['has'](_0x2a78e2)){if(!this['_operationToId']['has'](_0x2a78e2)){const _0x3b3564=_0x91b62c()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2a78e2,_0x3b3564);}return this['_operationToId']['get'](_0x2a78e2);}}}['setIdForTheLastOperation'](_0x57da7e,_0x5a9a31){if(!_0x5a9a31)return;let _0x1111bd=_0x57da7e['length'];for(;_0x1111bd--;){const _0x4d36c4=_0x57da7e[_0x1111bd];this['_ignoredOperations']['has'](_0x4d36c4)||this['_operationToId']['set'](_0x4d36c4,_0x5a9a31);}}}class a extends _0x3332be{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x3bdf57{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x35a16d)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x1d83a7];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x392bb1){super(_0x392bb1),this['_services']=new Map();}async['init'](){const _0x1d8716=this['context'],_0xd6e760=_0x1d8716['plugins']['get']('CommentsRepository');if(_0x1d8716['plugins']['get'](n)['addToReconnectionStack'](this),_0xd6e760['adapter']={'addCommentThread':async({channelId:_0x216dcd,threadId:_0x2eb5e0,comments:_0x31d136,resolvedAt:_0x401226,resolvedBy:_0x402355,context:_0x974e3f,attributes:_0x451db1})=>{const _0x2a0f84=await this['_getService'](_0x216dcd)['addCommentThread']({'commentThreadId':_0x2eb5e0,'comments':_0x31d136['map'](_0x4576ba=>function(_0x66fd1c,_0x86835b,_0x113fa0){return{'commentThreadId':_0x113fa0,'commentId':_0x66fd1c['commentId'],'userId':_0x66fd1c['authorId'],'content':_0x66fd1c['content'],'documentId':_0x86835b,'createdAt':_0x66fd1c['createdAt'],'attributes':_0x66fd1c['attributes']||{}};}(_0x4576ba,_0x216dcd,_0x2eb5e0)),'resolvedAt':_0x401226,'resolvedBy':_0x402355,'context':_0x974e3f,'attributes':_0x451db1})['catch'](lt);return{'threadId':_0x2a0f84['commentThreadId'],'comments':_0x2a0f84['comments']};},'getCommentThread':async({channelId:_0x1c91e2,threadId:_0x4a2143})=>{const _0x1dc964=await this['_getService'](_0x1c91e2)['getCommentThread'](_0x4a2143)['catch'](X)['catch'](lt);return _0x1dc964?_0x1dc964['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x1dc964]),{'threadId':_0x1dc964['commentThreadId'],'comments':_0x1dc964['comments']['map'](Z),'context':_0x1dc964['context'],'resolvedAt':_0x1dc964['resolvedAt'],'resolvedBy':_0x1dc964['resolvedBy'],'attributes':_0x1dc964['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x37a873,threadId:_0x284d79,context:_0x236cab,unlinkedAt:_0x487808,attributes:_0x5e3b8d})=>this['_getService'](_0x37a873)['updateCommentThread']({'commentThreadId':_0x284d79,'context':_0x236cab,'attributes':_0x5e3b8d,'unlinkedAt':_0x487808})['catch'](X)['catch'](lt),'resolveCommentThread':async({channelId:_0x351e26,threadId:_0x5542ff})=>{const _0x16ca63=await this['_getService'](_0x351e26)['resolveCommentThread'](_0x5542ff)['catch'](X)['catch'](lt);return{'threadId':_0x16ca63['commentThreadId'],'resolvedAt':_0x16ca63['resolvedAt'],'resolvedBy':_0x16ca63['resolvedBy']};},'reopenCommentThread':async({channelId:_0x116865,threadId:_0x555c4c})=>this['_getService'](_0x116865)['reopenCommentThread'](_0x555c4c)['catch'](X)['catch'](lt),'removeCommentThread':({channelId:_0x54ca7d,threadId:_0x13535b})=>this['_getService'](_0x54ca7d)['removeCommentThread'](_0x13535b)['catch'](X)['catch'](lt),'addComment':({channelId:_0x3b3358,threadId:_0x89fbb0,commentId:_0xc81d8a,content:_0x220c09,attributes:_0x53a4a1})=>this['_getService'](_0x3b3358)['addComment'](_0x89fbb0,_0xc81d8a,_0x220c09,_0x53a4a1)['catch'](lt),'updateComment':({channelId:_0x37688b,threadId:_0x5f261d,commentId:_0x36d62e,content:_0xc77c03,attributes:_0x4d08d7})=>this['_getService'](_0x37688b)['updateComment'](_0x5f261d,_0x36d62e,_0xc77c03,_0x4d08d7)['catch'](X)['catch'](lt),'removeComment':({channelId:_0x1780ae,threadId:_0x1cef70,commentId:_0x1b3d97})=>this['_getService'](_0x1780ae)['removeComment'](_0x1cef70,_0x1b3d97)['catch'](X)['catch'](lt)},_0x1d8716 instanceof _0x1dce13){const _0x1da2e4=_0x1d8716['config']['get']('collaboration.channelId'),_0x2ba257=_0x1d8716['plugins']['get'](i);await this['_setUpService'](_0x1da2e4);const _0x221096=await this['_services']['get'](_0x1da2e4)['getConnectedSessions']();this['listenTo'](_0x2ba257,'sessionAdd:'+_0x1da2e4,(_0x2cb42e,{session:_0x503bab})=>{_0x503bab['id']===_0x2ba257['mySessionId']&&(_0x2cb42e['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x503bab['permissions'],_0x1da2e4));}),_0x2ba257['register'](_0x1da2e4,_0x221096);}}async['_setUpService'](_0xc638b9){if(this['_services']['has'](_0xc638b9))throw new _0x5d0ce2('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0xc638b9});const _0x48d998=this['context']['plugins']['get']('CommentsRepository'),_0x13c413=new s['CommentsService'](_0xc638b9);this['_services']['set'](_0xc638b9,_0x13c413),this['listenTo'](_0x13c413,'commentThreadAdded',(_0x1f9e70,_0x1a1f73)=>{const {commentThreadId:_0x19a61c,documentId:_0x5b8bca,context:_0x2fed02,attributes:_0x35e456,resolvedAt:_0x33ef3,resolvedBy:_0x50fea0,comments:_0x2db765}=_0x1a1f73;_0x48d998['getCommentThread'](_0x19a61c)||_0x48d998['addCommentThread']({'threadId':_0x19a61c,'channelId':_0x5b8bca,'comments':_0x2db765?_0x2db765['map'](Z):[],'context':_0x2fed02,'attributes':_0x35e456,'resolvedAt':_0x33ef3,'resolvedBy':_0x50fea0,'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadUpdated',(_0x4ae9a6,{commentThreadId:_0x9d39cc,documentId:_0x222cd3,context:_0x122503,unlinkedAt:_0x501b7a,attributes:_0x51a10c})=>{_0x48d998['getCommentThread'](_0x9d39cc)&&_0x48d998['updateCommentThread']({'threadId':_0x9d39cc,'channelId':_0x222cd3,'context':_0x122503,'unlinkedAt':_0x501b7a,'attributes':_0x51a10c,'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadResolved',(_0x49a380,{commentThreadId:_0x2b5b3d,resolvedBy:_0x20f9aa,resolvedAt:_0x3696d7})=>{const _0x19a660=_0x48d998['getCommentThread'](_0x2b5b3d);_0x19a660&&_0x19a660['resolve']({'resolvedBy':_0x20f9aa,'resolvedAt':_0x3696d7,'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadReopened',(_0x19bb11,{commentThreadId:_0x4dfd6a})=>{const _0x26a2dd=_0x48d998['getCommentThread'](_0x4dfd6a);_0x26a2dd&&_0x26a2dd['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentThreadRemoved',(_0x3a107c,{commentThreadId:_0x462415})=>{const _0x5c3c8c=_0x48d998['getCommentThread'](_0x462415);_0x5c3c8c&&_0x5c3c8c['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentAdded',(_0x4789a8,_0x12e69a)=>{const _0x3122ba=_0x12e69a['commentThreadId'],_0x1d9642=_0x48d998['getCommentThread'](_0x3122ba);_0x1d9642&&_0x1d9642['addComment']({...Z(_0x12e69a),'isFromAdapter':!0x0});}),this['listenTo'](_0x13c413,'commentUpdated',(_0xe39273,{commentThreadId:_0x50e91e,commentId:_0x10fdee,content:_0x2513a1,attributes:_0x1d526b})=>{const _0x423fa4=_0x48d998['getCommentThread'](_0x50e91e);if(_0x423fa4){const _0x504eff=_0x423fa4['getComment'](_0x10fdee);_0x504eff&&_0x504eff['update']({'content':_0x2513a1,'attributes':_0x1d526b,'isFromAdapter':!0x0});}}),this['listenTo'](_0x13c413,'commentRemoved',(_0x3d4f7d,{commentThreadId:_0x18dc14,commentId:_0x2ac99b})=>{const _0x1732d1=_0x48d998['getCommentThread'](_0x18dc14);if(_0x1732d1){const _0x4eb53a=_0x1732d1['getComment'](_0x2ac99b);_0x4eb53a&&_0x4eb53a['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0xc638b9);}['destroy'](){if(this['context']instanceof _0x1dce13){const _0x49ff67=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x49ff67);}}['_terminateService'](_0x30c04d){if(!this['_services']['has'](_0x30c04d))throw new _0x5d0ce2('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x30c04d});this['_getService'](_0x30c04d)['disconnect'](),this['_services']['delete'](_0x30c04d);}async['reconnect'](){for(const _0x4a0bad of this['_services']['keys']())await this['_connectService'](_0x4a0bad);if(this['context']instanceof _0x1dce13){const _0x3bd3dc=this['context']['config']['get']('collaboration.channelId'),_0x4398da=this['context']['plugins']['get'](i);_0x4398da['unregister'](_0x3bd3dc);const _0x501616=await this['_services']['get'](_0x3bd3dc)['getConnectedSessions']();_0x4398da['register'](_0x3bd3dc,_0x501616);}}async['_connectService'](_0x7468d0){const {connection:_0xd77112}=this['context']['plugins']['get'](n),_0x50cf70=this['context']['plugins']['get']('CommentsRepository'),_0x2c812b=this['_services']['get'](_0x7468d0),_0x30e5af=await _0x2c812b['connect'](_0xd77112);await this['_fetchMissingUsersForThreads'](_0x30e5af);const _0xe2a77a=new Set(Array['from'](_0x50cf70['getCommentThreads']({'channelId':_0x7468d0}),_0x5255f3=>_0x5255f3['id']));for(const _0x40965f of _0x30e5af)_0x40965f['deletedAt']||_0xe2a77a['delete'](_0x40965f['commentThreadId']);for(const _0xd746fb of _0xe2a77a)_0x50cf70['getCommentThread'](_0xd746fb)['remove']({'isFromAdapter':!0x0});for(const _0x15e92c of _0x30e5af){let _0x1c8108=_0x50cf70['getCommentThread'](_0x15e92c['commentThreadId']);const {commentThreadId:_0x47694e,context:_0x48eb93,attributes:_0x1c60a0,resolvedBy:_0x4103a6,resolvedAt:_0xbdb24a,unlinkedAt:_0x5a411d,deletedAt:_0x102c1d}=_0x15e92c;if(_0x102c1d)continue;_0x1c8108||(_0x1c8108=_0x50cf70['addCommentThread']({'channelId':_0x7468d0,'threadId':_0x47694e,'context':_0x48eb93,'attributes':_0x1c60a0||{},'resolvedBy':_0x4103a6,'resolvedAt':_0xbdb24a,'unlinkedAt':_0x5a411d,'isFromAdapter':!0x0}));const _0x39b23e=new Set(Array['from'](_0x1c8108['comments'],_0x2749ed=>_0x2749ed['id']));for(const _0x343f78 of _0x15e92c['comments'])_0x39b23e['delete'](_0x343f78['commentId']);for(const _0x2132ac of _0x39b23e)_0x1c8108['getComment'](_0x2132ac)['remove']({'isFromAdapter':!0x0});for(const _0x1a388c of _0x15e92c['comments']){const _0x4832ba=_0x1c8108['getComment'](_0x1a388c['commentId']);_0x4832ba?_0x4832ba['content']!==_0x1a388c['content']&&_0x4832ba['update']({'content':_0x1a388c['content'],'isFromAdapter':!0x0}):_0x1c8108['addComment'](Object['assign'](Z(_0x1a388c),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5a8e65){if(!this['_services']['has'](_0x5a8e65))throw new _0x5d0ce2('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5a8e65});return this['_services']['get'](_0x5a8e65);}async['_fetchMissingUsersForThreads'](_0xa3960c){const _0x90344e=this['context']['plugins']['get'](_0x1d83a7),{connection:_0x1ad0d3}=this['context']['plugins']['get'](n),_0x1069f8=new Set();for(const {resolvedBy:_0x2269c7,comments:_0x1487c2}of _0xa3960c){_0x2269c7&&!_0x90344e['getUser'](_0x2269c7)&&_0x1069f8['add'](_0x2269c7);for(const {userId:_0x55846c}of _0x1487c2)_0x90344e['getUser'](_0x55846c)||_0x1069f8['add'](_0x55846c);}if(0x0===_0x1069f8['size'])return;const _0x22b964=await ht['getMany'](_0x1ad0d3,Array['from'](_0x1069f8));for(const _0x311138 of _0x22b964)_0x90344e['getUser'](_0x311138['id'])||_0x90344e['addUser'](_0x311138);}}async function X(_0x182606){if('404'!==_0x182606['code'])throw _0x182606;}function lt(_0x295cb5){if((_0x4d532c=_0x295cb5)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x4d532c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4d532c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x4d532c;throw _0x295cb5;}function Z(_0x576bd8){return{'threadId':_0x576bd8['commentThreadId'],'commentId':_0x576bd8['commentId'],'content':_0x576bd8['content'],'createdAt':_0x576bd8['createdAt'],'authorId':_0x576bd8['userId'],'attributes':_0x576bd8['attributes']||{}};}class m extends _0x3332be{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1011fb){super(_0x1011fb);const _0x19acde=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x19acde);}['init'](){const _0x5856f8=this['editor']['plugins']['get'](n),_0x11c1a6=this['editor']['plugins']['get']('TrackChangesEditing');return _0x11c1a6['adapter']={'getSuggestion':async _0x8986c2=>{await this['_waitForServiceReady']();const _0x51962e=await this['_trackChangesService']['get'](_0x8986c2)['catch'](Y);return await this['_fetchMissingUsersForThreads']([_0x51962e]),_0x51962e;},'addSuggestion':async({id:_0x5bc14c,type:_0x50290d,data:_0x3615a5,originalSuggestionId:_0x3a8c2e,attributes:_0x676985})=>{await this['_waitForServiceReady']();const _0x48bdbc={'id':_0x5bc14c,'type':_0x50290d,'data':_0x3615a5,'originalSuggestionId':_0x3a8c2e,'attributes':_0x676985},_0x4524dc=await this['_trackChangesService']['add'](_0x5bc14c,_0x50290d,_0x3615a5,_0x3a8c2e,_0x676985)['catch'](_0x5701dc=>{if(dt(_0x5701dc))return new Promise(_0x40a7cb=>{this['_bufferedRequests']['set'](_0x5bc14c,{'resolve':_0x40a7cb,'suggestionData':_0x48bdbc});});throw _0x5701dc;});return this['_bufferedRequests']['delete'](_0x5bc14c),_0x4524dc;},'updateSuggestion':async(_0x13bdd8,_0x4a5613)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4a5613['state'])return this['_trackChangesService']['update'](_0x13bdd8,_0x4a5613)['catch'](Y);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1c4d9c,_0x11b2b3)=>{_0x11c1a6['hasSuggestion'](_0x11b2b3['id'])&&(_0x11c1a6['getSuggestion'](_0x11b2b3['id'])['attributes']=_0x11b2b3['attributes']);}),this['_trackChangesService']['connect'](_0x5856f8['connection'])['then'](_0x42dcc1=>(_0x5856f8['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x42dcc1)['then'](()=>{for(const _0x270d3d of _0x42dcc1){_0x11c1a6['addSuggestionData'](_0x270d3d)['_saved']=!0x0;}})));}async['reconnect'](){const _0x42ced0=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1b718d}=this['editor']['plugins']['get'](n),_0xa2b766=await this['_trackChangesService']['connect'](_0x1b718d);await this['_fetchMissingUsersForThreads'](_0xa2b766);for(const {suggestionData:_0xe976f2,resolve:_0x553ee7}of this['_bufferedRequests']['values']()){let _0x241add=_0xa2b766['find'](_0x539a98=>_0x539a98['id']===_0xe976f2['id']);_0x241add||(_0x241add=await this['_trackChangesService']['add'](_0xe976f2['id'],_0xe976f2['type'],_0xe976f2['data'],_0xe976f2['originalSuggestionId'])),_0x553ee7(_0x241add);}for(const _0x35f86c of _0xa2b766)_0x42ced0['hasSuggestion'](_0x35f86c['id'])||_0x42ced0['addSuggestionData'](_0x35f86c);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1c83cd=>{this['listenTo'](this['_trackChangesService'],'connected',_0x42a8a2=>{_0x42a8a2['off'](),_0x1c83cd();});});}async['_fetchMissingUsersForThreads'](_0x41a0be){const _0x59df4a=this['editor']['plugins']['get'](_0x1d83a7),{connection:_0x23fdc4}=this['editor']['plugins']['get'](n),_0xcc34cc=new Set();for(const {authorId:_0x55a90a}of _0x41a0be)_0x59df4a['getUser'](_0x55a90a)||_0xcc34cc['add'](_0x55a90a);if(0x0===_0xcc34cc['size'])return;const _0x19b2ad=await ht['getMany'](_0x23fdc4,Array['from'](_0xcc34cc));for(const _0x3489db of _0x19b2ad)_0x59df4a['getUser'](_0x3489db['id'])||_0x59df4a['addUser'](_0x3489db);}}function Y(_0x31cf09){if(dt(_0x31cf09))return new Promise(()=>{});throw _0x31cf09;}function dt(_0x5a6a30){return _0x5a6a30['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5a6a30['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x3332be{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 _0x3090dd=this['editor']['plugins']['get'](n),_0x1c510b=this['editor']['plugins']['get']('CommentsEditing'),_0x17125b=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3090dd,'change:state',(_0x49bd19,_0x4829d2,_0x211d86)=>{_0x1c510b['isThreadsLoadingPaused']='connected'!==_0x211d86;});}),this['listenTo'](_0x3090dd,'change:state',(_0x2981cf,_0x1862bc,_0x334239)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x334239);}),_0x17125b['_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 _0x3332be{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 _0x3332be{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x1d83a7];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x80fd00){super(_0x80fd00);const _0x29d053=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x29d053);}async['init'](){const _0xd8c3c2=this['editor']['plugins']['get'](l),_0x39270a=_0xd8c3c2['serverHistory'],_0x221076=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x39270a,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xd8c3c2['sessionId']});const _0x4607b0=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x2385c7=await tt['isBundleUploaded'](_0x221076['connection'],_0x4607b0);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x5073a1})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5073a1)),'updateRevisions':async _0xa9fb55=>{await this['_waitForServiceReady']();const _0x89fcb5=this['_revisionTracker']['currentRevision'];if(_0x2385c7&&0x1===_0xa9fb55['length']&&_0xa9fb55[0x0]['id']===_0x89fcb5['id'])return _0xa9fb55;for(const _0x544a7d of _0xa9fb55)_0x544a7d['id']===_0x89fcb5['id']&&(_0x544a7d['isEmptyCurrent']=_0x544a7d['fromVersion']===_0x544a7d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0xa9fb55,this['_lastRequestId'])['then'](_0x58b01b=>(this['_lastRequestId']=_0x58b01b,_0xa9fb55))['catch'](_0x19782b=>{if(st(_0x19782b)||'400'===_0x19782b['code']&&void 0x0!==_0x19782b['data']['wrongRequestId']){for(const _0x3ec713 of _0xa9fb55){!this['_revisionTracker']['repository']['getRevision'](_0x3ec713['id'])||this['_revisionTracker']['_bufferUpdate'](_0x3ec713['id'],_0x3ec713,!0x1);}if(st(_0x19782b))throw _0x19782b;return _0xa9fb55;}throw _0x19782b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x44e11d,{revisionsData:_0xed2875,requestId:_0x48c1b5})=>{Math['max'](..._0xed2875['map'](_0x17a5dd=>_0x17a5dd['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0xed2875,_0x48c1b5);}):this['_handleRevisionsUpdate'](_0xed2875,_0x48c1b5);});const {revisions:_0x101be8,requestId:_0x401e4a}=await this['_revisionHistoryService']['connect'](_0x221076['connection']);_0x221076['addToReconnectionStack'](this),this['_lastRequestId']=_0x401e4a,await this['_fetchMissingUsers'](_0x101be8);for(const _0x3ebc7c of _0x101be8)this['_revisionTracker']['addRevisionData'](_0x3ebc7c);this['listenTo'](_0xd8c3c2,'change:_isConnected',(_0x283754,_0x14567b,_0x5106d6)=>{_0x5106d6&&(this['_oldOffset']=_0xd8c3c2['_offset'],_0x283754['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x221076,'state',_0x459dc8=>_0x459dc8===_0x495437['CONNECTED']);}async['reconnect'](){const _0x39d052=this['editor']['plugins']['get'](n),_0x4dda0d=this['editor']['plugins']['get'](l),_0xa6ee07=async()=>{const _0x4e0979=this['_revisionTracker']['currentRevision'],_0x223878=_0x4e0979['id'],_0x5a485a=_0x223878!==_0x4dda0d['sessionId'];if(_0x5a485a){const _0x21951f=_0x4dda0d['_offset']-this['_oldOffset'],_0x1b944e=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x4e0979['toVersion']+_0x21951f!==_0x1b944e){const _0x309f61=_0x4e0979['fromVersion']+_0x21951f,_0x3cce7b=this['editor']['plugins']['get'](_0x1d83a7),_0x53a9b3=this['_revisionTracker']['buildRevisionData']({'revision':_0x4e0979,'from':_0x309f61,'to':_0x1b944e});_0x53a9b3['id']=_0x4e0979['id'];const _0x421463=_0x53a9b3['authorsIds']['map'](_0x1c1d49=>_0x3cce7b['getUser'](_0x1c1d49));_0x4e0979['_update']({..._0x53a9b3,'authors':_0x421463},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4e0979['id'],_0x53a9b3,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1b944e,(_0x4e0979['toVersion']===_0x4e0979['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x223878)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x223878),this['_revisionTracker']['_createCurrentRevision'](_0x1b944e));}const {revisions:_0x4bc677,requestId:_0x3ac256}=await this['_revisionHistoryService']['reconnect'](_0x39d052['connection'],this['_lastRequestId']);_0x5a485a&&_0x4bc677['length']>0x0?_0x4dda0d['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x4bc677),this['_handleRevisionsUpdate'](_0x4bc677,_0x3ac256),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4dda0d['_isConnected']?_0xa6ee07():new Promise((_0x1819b1,_0x1e9589)=>{_0x4dda0d['once']('change:_isConnected',()=>{_0xa6ee07()['then'](_0x1819b1)['catch'](_0x1e9589);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4eacea=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5c2a3b=>{_0x5c2a3b['off'](),_0x4eacea();});});}['_getLatestVersionFromServerOperations'](){const _0x525a20=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x79d24b of _0x525a20)if('marker'!==_0x79d24b['type']||_0x79d24b['affectsData'])return _0x79d24b['baseVersion']+0x1;}['_getLatestVersion'](){const _0x12bfaf=this['editor']['plugins']['get'](l);return new Promise(_0x24d763=>{_0x12bfaf['_isPendingUpdate']?_0x12bfaf['once']('change:_isPendingUpdate',()=>{_0x24d763(this['_getLatestVersionFromServerOperations']());}):_0x24d763(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x1e0161,_0x3ba2ad){const _0x466b2f=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3ba2ad;for(const _0x296797 of _0x1e0161){const _0x47fb97=_0x466b2f['getRevision'](_0x296797['id']);if(_0x47fb97){if((_0x296797['fromVersion']||_0x296797['toVersion'])&&(_0x296797['diffData']=null),_0x47fb97===this['_revisionTracker']['currentRevision']){const _0x1f7a33=Math['max'](_0x47fb97['toVersion'],_0x296797['toVersion']),_0x1a324c=Math['max'](_0x47fb97['fromVersion'],_0x296797['fromVersion']);let _0x4672bd;_0x47fb97['toVersion']===_0x296797['toVersion']&&_0x47fb97['fromVersion']===_0x296797['fromVersion']?(_0x4672bd=!0x0,this['_preventResendingRevisionData'](_0x296797)):_0x296797['toVersion']===_0x1f7a33&&_0x296797['fromVersion']===_0x1a324c?_0x4672bd=!0x1:(_0x47fb97['toVersion']===_0x1f7a33&&_0x47fb97['fromVersion']===_0x1a324c||this['_fixRevision']({'revision':_0x47fb97,'from':_0x1a324c,'to':_0x1f7a33}),_0x4672bd=!0x0),_0x4672bd&&(delete _0x296797['fromVersion'],delete _0x296797['toVersion'],delete _0x296797['diffData'],delete _0x296797['createdAt'],delete _0x296797['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x296797),this['_preventResendingRevisionData'](_0x296797);}else this['_revisionTracker']['addRevisionData'](_0x296797);}const _0x212144=_0x466b2f['getRevisions']();_0x212144['reverse']();for(let _0x3fd9f6=0x0;_0x3fd9f6<_0x212144['length']-0x1;_0x3fd9f6++){const _0x25d846=_0x212144[_0x3fd9f6],_0x25a613=_0x212144[_0x3fd9f6+0x1];if(_0x25d846['fromVersion']<_0x25a613['toVersion']){const _0x533082=_0x25a613['toVersion'],_0x34d20b=Math['max'](_0x533082,_0x25d846['toVersion']);this['_fixRevision']({'revision':_0x25d846,'from':_0x533082,'to':_0x34d20b});}}}['_fixRevision']({revision:_0x4827d0,from:_0x710838,to:_0x1ca8b7}={}){const _0x1b527a=this['editor']['plugins']['get'](_0x1d83a7),_0x25e8da=this['_revisionTracker']['buildRevisionData']({'revision':_0x4827d0,'from':_0x710838,'to':_0x1ca8b7});_0x25e8da['authors']=_0x25e8da['authorsIds']['map'](_0x3c50f8=>_0x1b527a['getUser'](_0x3c50f8)),_0x4827d0['_update'](_0x25e8da);}['_preventResendingRevisionData'](_0x326297){const _0x46caa4={};_0x46caa4['id']=_0x326297['id'];for(const _0x2b4185 of Object['keys'](_0x326297))'id'!==_0x2b4185&&(_0x46caa4[_0x2b4185]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x46caa4['id'],_0x46caa4,!0x0);}async['_fetchMissingUsers'](_0x24eb16){const _0x339a50=this['editor']['plugins']['get'](_0x1d83a7),{connection:_0x47e00f}=this['editor']['plugins']['get'](n),_0x2ef23e=new Set();for(const _0x15655f of _0x24eb16){for(const _0x5aab58 of _0x15655f['authorsIds'])_0x473443(_0x5aab58);_0x15655f['creatorId']&&_0x473443(_0x15655f['creatorId']);}if(0x0===_0x2ef23e['size'])return;const _0x2382af=await ht['getMany'](_0x47e00f,Array['from'](_0x2ef23e));for(const _0x245742 of _0x2382af)_0x339a50['getUser'](_0x245742['id'])||_0x339a50['addUser'](_0x245742);function _0x473443(_0x53f97e){_0x339a50['getUser'](_0x53f97e)||_0x2ef23e['add'](_0x53f97e);}}}function st(_0x39be54){return _0x39be54['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x39be54['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x39be54['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x3332be{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class N extends _0x512b3c{['_collapseAt'];constructor(_0x87c68,_0x12b3b5=0x6){super(_0x87c68);const _0x3fae1a=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x12b3b5,this['bind']('isHidden')['to'](this,'usersCount',_0x359fcd=>_0x359fcd<_0x12b3b5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x3fae1a['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':_0x3fae1a['to']('usersCount',_0x1d4d9f=>'+'+(_0x1d4d9f-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x512b3c{['items'];['keystrokes'];constructor(_0x358187){super(_0x358187);const _0x160548=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x45cc9b(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x160548['if']('hasPopup'),'aria-expanded':_0x160548['to']('isExpanded',_0x26ce3b=>this['hasPopup']&&String(_0x26ce3b)),'aria-label':_0x160548['to']('hasPopup',_0x2e9966=>R(_0x358187,_0x2e9966?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x160548['to']('hasPopup',_0x303076=>!!_0x303076&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x160548['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x160548['to'](_0x4c3088=>{const _0x3032d9=_0x4c3088,_0x3eb32b=document['querySelector']('.ck-presence-list__dropdown-list'),_0x281689=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3eb32b?.['contains'](_0x3032d9['relatedTarget'])||_0x281689?.['contains'](_0x3032d9['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0xa1674a,_0x59afaa,_0x2c1b64)=>{this['element']&&(_0x2c1b64?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 q extends _0x512b3c{['counterView'];['inlineListView'];constructor(_0x48f538,_0x18b20c=0x6){super(_0x48f538);const _0x381196=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new N(this['locale'],_0x18b20c),this['inlineListView']=new is(_0x48f538),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2a2fd6 of this['inlineListView']['items'])_0x2a2fd6['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',_0x381196['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class z extends _0x512b3c{['listWrapperView'];constructor(_0xeafbe,_0x27e3cc){super(_0xeafbe);const _0x5eefbb=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0xeafbe,_0x27e3cc),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':R(_0xeafbe,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5eefbb['to'](_0x284952=>{const _0x5ab49b=_0x284952,_0x2a302b=document['querySelector']('.ck-presence-list__list'),_0x49f1ab=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2a302b?.['contains'](_0x5ab49b['relatedTarget'])||_0x49f1ab?.['contains'](_0x5ab49b['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x477aad{constructor(_0x56cf01,_0x268b42){super(_0x56cf01);const _0x25692a=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x268b42?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x25692a['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x25692a['to']('role'),'aria-label':_0x25692a['to']('ariaLabel'),'aria-labelledby':_0x25692a['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1b8319['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x20467c=this['element'];_0x20467c&&(this['_isScrollable']=Math['max'](_0x20467c['scrollHeight'],_0x20467c['clientHeight'])>0.8*window['innerHeight']);}}class B extends rt{['userView'];constructor(_0xf3108b,_0x419518,_0x2915a2){super(_0xf3108b);const _0x4a8e6c=this['bindTemplate'];this['userView']=new ct(_0xf3108b,_0x419518);const _0x4ae608={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x419518['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x419518['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x419518['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x2915a2&&(_0x4ae608['tag']='button',_0x4ae608['on']={'click':_0x4a8e6c['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4ae608);}['focus'](){this['element']['focus']();}}class H extends _0x512b3c{['userView'];['markerView'];constructor(_0x564b27,_0x1d49a9,_0x4934e2){super(_0x564b27);const _0x23f9f0=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x564b27,_0x1d49a9),this['markerView']=new MarkerView(_0x564b27,_0x1d49a9);const _0x37562e=new ot(_0x564b27);_0x37562e['template']['tag']='span',_0x37562e['text']=_0x1d49a9['name'];const _0x3d35bb={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x23f9f0['to']('isFocusable',_0x3d91de=>!!_0x3d91de&&0x0),'aria-labelledby':_0x37562e['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x23f9f0['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x23f9f0['to']('hasTooltip',_0x38ab5e=>!_0x38ab5e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x37562e]};_0x4934e2&&(_0x3d35bb['tag']='button',_0x3d35bb['on']={'click':_0x23f9f0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3d35bb);}}class MarkerView extends _0x512b3c{constructor(_0x201073,_0x1a0e1d){super(_0x201073),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1a0e1d['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const J={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x3bdf57{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2348f4){super(_0x2348f4),this['context']['config']['define']('presenceList',J);const _0x2b1674=_0x2348f4['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2b1674)throw new _0x5d0ce2('presencelist-collapseat-invalid-format',this);if(_0x2b1674<0x1)throw new _0x5d0ce2('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x9d9df4(),this['balloonPanelView']=new _0x4371c1(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4be74d of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4be74d);this['listenTo'](this['_allConnectedUsers'],'add',(_0x293e8b,_0x18b53a)=>{this['_handleUserAdd'](_0x18b53a);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0xd2088b,_0x49f1e3)=>{this['_handleUserRemove'](_0x49f1e3);});}['_createView'](){const _0x36c438=this['context'],_0x2f9f90=new q(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3afcba=this['balloonPanelView'];if(!_0x3063f7(_0x36c438['config']['get']('presenceList.container')))throw new _0x5d0ce2('presencelist-missing-container',this);return _0x2f9f90['counterView']['bind']('usersCount')['to'](this),_0x2f9f90['bind']('isCollapsed')['to'](this,'usersCount',_0x382519=>{const {collapseAt:_0x32e27f}=_0x36c438['config']['get']('presenceList'),_0x53901d=_0x382519>=_0x32e27f;if(_0x53901d&&!_0x2f9f90['inlineListView']['items']['find'](_0x9a6d49=>_0x9a6d49 instanceof N)){const _0x6090bb=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x6090bb&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x2f9f90['inlineListView']['items']['add'](_0x2f9f90['counterView']);}return _0x53901d||this['hideDropdown'](),_0x53901d;}),_0x2f9f90['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x425ca4=>{const _0xadf46e=_0x36c438['config']['get']('presenceList'),_0x30c4b9=new H(_0x36c438['locale'],_0x425ca4,!!_0xadf46e['onClick']);return _0x30c4b9['bind']('hasTooltip')['to'](_0x2f9f90,'isCollapsed',_0x2fb0e0=>!_0x2fb0e0),_0x30c4b9['bind']('isFocusable')['to'](_0x2f9f90,'isCollapsed',_0x3e794b=>!_0x3e794b),_0xadf46e['onClick']&&this['listenTo'](_0x30c4b9,'execute',()=>{this['view']['isCollapsed']||_0xadf46e['onClick'](_0x425ca4,_0x30c4b9['element']);}),_0x30c4b9;}),this['listenTo'](_0x2f9f90['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x2f9f90['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x2f9f90['inlineListView']['keystrokes']['set']('Enter',(_0xce6258,_0x5e292d)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x5e292d());}),_0x2f9f90['render'](),_0x3afcba['render'](),_0x2a979d({'emitter':_0x2f9f90,'activator':()=>_0x3afcba['isVisible'],'contextElements':[_0x3afcba['element'],_0x2f9f90['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x36c438['config']['get']('presenceList.container')['appendChild'](_0x2f9f90['element']),this['_bodyCollection']=new _0x2b3d32(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2f9f90;}['_handleUserAdd'](_0x41b07a){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x41b07a['isMe'])return;const _0x596e7c=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x596e7c-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x4c683e=_0x41b07a['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x41b07a,_0x4c683e);}['_handleUserRemove'](_0x3934cb){this['usersCount']--;const {collapseAt:_0x18c347}=this['context']['config']['get']('presenceList'),_0x328e7d=this['usersCount']>=_0x18c347;if(this['currentDisplayedUsers']['get'](_0x3934cb['id']))this['currentDisplayedUsers']['remove'](_0x3934cb['id']);else{if(_0x328e7d&&this['currentDisplayedUsers']['length']+0x1===_0x18c347-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x328e7d?0x1:0x0)<this['usersCount']){for(const _0x91933b of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x91933b['id'])&&(this['currentDisplayedUsers']['add'](_0x91933b,Math['min'](this['currentDisplayedUsers']['length']-(_0x328e7d?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x328e7d?0x1:0x0)===_0x18c347-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x25b84f=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new z(this['context']['locale'],!!_0x25b84f['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x282a36}=this['presenceDropdownView'];_0x282a36['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4638af=>{if(!_0x25b84f['displayMe']&&_0x4638af['isMe'])return null;const _0x3a6c6e=new B(this['context']['locale'],_0x4638af,!!_0x25b84f['onClick']);return _0x25b84f['onClick']&&this['listenTo'](_0x3a6c6e,'execute',()=>{_0x25b84f['onClick'](_0x4638af,_0x3a6c6e['element']);}),_0x3a6c6e;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x282a36['focus'](),_0x282a36['checkIfScrollable']();const _0x35256f=(_0x3346f8,_0x595934)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x595934();};_0x282a36['keystrokes']['set']('Esc',_0x35256f),_0x282a36['keystrokes']['set']('Shift+Tab',_0x35256f),_0x282a36['keystrokes']['set']('Tab',(_0x50e8c1,_0x256015)=>{!function(_0x4989ce){const _0x273628=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x40c637=>_0x40c637+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x1737c1=[...document['body']['querySelectorAll'](_0x273628)]['filter'](_0x194362=>_0x194362===document['activeElement']||_0x194362['offsetWidth']+_0x194362['offsetHeight']>0x0)['sort']((_0x5f40be,_0x37f212)=>(_0x5f40be['tabIndex']||0x0)-(_0x37f212['tabIndex']||0x0)),_0x4c939d=_0x1737c1['indexOf'](_0x4989ce),_0x9d0e50=_0x1737c1[(_0x4c939d+0x1)%_0x1737c1['length']];_0x9d0e50&&_0x9d0e50['focus']();}(this['view']['element']),this['hideDropdown'](),_0x256015();}),_0x282a36['focusTracker']['add'](this['view']['element']),_0x282a36['focusTracker']['on']('change:isFocused',(_0x4e7fc2,_0x27beef,_0x223957)=>{_0x223957||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 _0x3bdf57{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 _0x102a7b,Plugin as _0x17b805,PendingActions as _0x33cbb5,Context as _0x1c4fa0}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x12d6ac,CKEditorError as _0x332ad6,Collection as _0x8f9c91,global as _0x118f19,version as nt,uid as _0x1bb2ae,KeystrokeHandler as _0x5f3935}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1ba0ff,View as _0x561787,ListView as _0x556b7c,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x34bd64,clickOutsideHandler as _0x3b1e31,BodyCollection as _0x402400}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x3333b7,History as _0x5cc23b,NoOperation as _0x12cea3,InsertOperation as _0x277805,MarkerOperation as _0x40d6ff,RootAttributeOperation as _0x23d727,transformOperationSets as _0x163cfc,OperationFactory as _0x2ad745}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as at,WEB_SOCKET_GATEWAY_STATES as _0x42ae72,CollaborativeEditingService as _0x4ed1bd,User as ht,CommentsService as _0x27047f,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x20df76,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xa4e653}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x544931}from'es-toolkit/compat';class n extends _0x102a7b{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>at)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1ba0ff];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44abcf){super(_0x44abcf),this['set']('state',_0x42ae72['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x12d6ac())();}['init'](){const _0x3083d6=this['context'],_0x3a4138=_0x3083d6['plugins']['get']('CloudServices'),_0xc8fc8e=_0x3083d6['plugins']['get'](_0x1ba0ff);if(!_0x3a4138['token'])throw new _0x332ad6('websocketgateway-missing-token',this);if(!_0x3a4138['webSocketUrl'])throw new _0x332ad6('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'](_0x3a4138['token'],_0x3a4138['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2c3c8e=>{if(this['connection']=_0x2c3c8e,this['bind']('state')['to'](_0x2c3c8e,'state',this,'_isBrowserOffline',(_0x35ed8e,_0x52d39d)=>('connected'!==_0x35ed8e&&(this['_shouldPluginsReconnect']=!0x0),_0x52d39d||_0x35ed8e!==_0x42ae72['CONNECTED']?_0x42ae72['DISCONNECTED']:this['state']==_0x42ae72['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x42ae72['CONNECTING']):_0x42ae72['CONNECTED'])),this['connection']['on']('error',(_0x1d0176,_0x1fc873)=>{if('limitExceeded'!==_0x1fc873['code'])throw console['error'](_0x1fc873),new _0x332ad6('cloudservices-init',null,{'originalError':_0x1fc873});_0xc8fc8e['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'});}),!_0x2c3c8e['me'])return new Promise(_0x433bb2=>_0x2c3c8e['on']('change:me',_0x433bb2));})['catch'](_0x1d5eb9=>{throw console['error'](_0x1d5eb9),new _0x332ad6('cloudservices-init',null,{'originalError':_0x1d5eb9});});}['addToReconnectionStack'](_0x4cfeda){if('function'!=typeof _0x4cfeda['reconnect'])throw new _0x332ad6('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4cfeda))throw new _0x332ad6('websocketgateway-plugin-already-registered',this,{'name':_0x4cfeda['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4cfeda);}['removeFromReconnectionStack'](_0x8ff6a9){this['_reconnectionStack']['delete'](_0x8ff6a9);}['isInReconnectionStack'](_0x52a2c9){return this['_reconnectionStack']['has'](_0x52a2c9);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x144438=>_0x144438['reconnect']())))['then'](()=>this['state']=_0x42ae72['CONNECTED'])['catch'](_0x50f140=>{throw console['error'](_0x50f140),new _0x332ad6('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x42ae72['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x102a7b{['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,_0x20df76];}constructor(_0x24fb91){super(_0x24fb91),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x8f9c91(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x20df76);}['init'](){const _0x433f19=this['context']['plugins']['get'](n);this['listenTo'](_0x433f19,'change:state',(_0x354573,_0x49f64a,_0x22fb7d)=>{if('connected'!==_0x22fb7d)this['channelSessions']['forEach'](_0x534eb6=>_0x534eb6['clear']()),this['channelConnectedUsers']['forEach'](_0x4deac2=>_0x4deac2['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x25147e,_0x45c440]of this['_registeredSessions'])for(const _0x5b77f2 of _0x45c440)this['_handleSessionAdd'](_0x25147e,_0x5b77f2);}}),this['_createUser'](_0x433f19['connection']['me'],!0x0);}['register'](_0x2c4761,_0x5224df){if(this['_registeredSessions']['has'](_0x2c4761))throw new _0x332ad6('sessions-register-already-registered',null,{'channelId':_0x2c4761});this['_registeredSessions']['set'](_0x2c4761,_0x5224df),this['channelSessions']['set'](_0x2c4761,new _0x8f9c91()),this['channelConnectedUsers']['set'](_0x2c4761,new _0x8f9c91()),this['listenTo'](_0x5224df,'add',(_0x141d77,_0x413003)=>this['_handleSessionAdd'](_0x2c4761,_0x413003)),this['listenTo'](_0x5224df,'remove',(_0x2645e3,_0x1730f0)=>this['_handleSessionRemove'](_0x2c4761,_0x1730f0));for(const _0x359861 of _0x5224df)this['_handleSessionAdd'](_0x2c4761,_0x359861);}['unregister'](_0x13ffea){if(!this['_registeredSessions']['has'](_0x13ffea))throw new _0x332ad6('sessions-unregister-not-exist',null,{'channelId':_0x13ffea});const _0x3d6f75=this['_registeredSessions']['get'](_0x13ffea);this['stopListening'](_0x3d6f75);for(const _0x2e94b1 of _0x3d6f75)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x13ffea,_0x2e94b1);this['_registeredSessions']['delete'](_0x13ffea),this['channelSessions']['delete'](_0x13ffea),this['channelConnectedUsers']['delete'](_0x13ffea);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x212fe0){for(const _0x4eba9e of this['channelSessions']['values']())for(const _0xb7399 of _0x4eba9e)if(_0xb7399['id']===_0x212fe0)return _0xb7399['user'];}['getUserSessions'](_0x3439bf,_0x1dc1f7){const _0x214a1c=_0x1dc1f7?[this['channelSessions']['get'](_0x1dc1f7)]:this['channelSessions']['values'](),_0x27de08=new Set();for(const _0x509ae2 of _0x214a1c)for(const _0x372a94 of _0x509ae2)_0x372a94['user']['id']===_0x3439bf['id']&&_0x27de08['add'](_0x372a94['id']);return _0x27de08;}['getUserRole'](_0x46f310){for(const _0x40f9cd of this['channelSessions']['values']())for(const _0x28b4ab of _0x40f9cd)if(_0x28b4ab['user']===_0x46f310)return _0x28b4ab['role'];}['_handleSessionAdd'](_0x5d827b,_0x42294c){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x328543=_0x42294c['user'],_0x106de0=this['_users']['getUser'](_0x328543['id'])||this['_createUser'](_0x328543),_0x5697a9=Object['assign']({},_0x42294c,{'user':_0x106de0});if(this['channelSessions']['get'](_0x5d827b)['add'](_0x5697a9),!_0x328543['hiddenInPresenceList']){const _0x14033c=this['channelConnectedUsers']['get'](_0x5d827b);_0x14033c['has'](_0x106de0['id'])||_0x14033c['add'](_0x106de0),this['allConnectedUsers']['has'](_0x106de0['id'])||_0x328543['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x106de0,_0x106de0['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x5d827b,{'channelId':_0x5d827b,'session':_0x5697a9});}['_handleSessionRemove'](_0xfbc546,_0x4e773){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x11d1e7=this['channelConnectedUsers']['get'](_0xfbc546),_0x21357e=_0x4e773['user'];_0x21357e['id']&&(this['channelSessions']['get'](_0xfbc546)['remove'](_0x4e773['id']),_0x11d1e7['has'](_0x21357e['id'])&&!this['getUserSessions'](_0x21357e,_0xfbc546)['size']&&_0x11d1e7['remove'](_0x21357e['id']),this['allConnectedUsers']['get'](_0x21357e['id'])&&!this['getUserSessions'](_0x21357e)['size']&&this['allConnectedUsers']['remove'](_0x21357e['id']));}['_createUser'](_0x34069b,_0x1a8929){const _0x13d3c1=this['_users']['addUser'](_0x34069b);return _0x1a8929&&this['_users']['defineMe'](_0x34069b['id']),_0x13d3c1['orderNumber']=this['_uniqueUsersCount']++,_0x13d3c1;}}class k extends _0x17b805{['_domEmitter']=new(_0x12d6ac())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3e74ff=this['editor'],_0x2650f6=_0x3e74ff['plugins']['get'](i);_0x3e74ff['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5e90d6,{writer:_0x134432})=>function(_0x2af23c,_0x4890c9,_0x55a6d0,_0x44e7ee){const _0x2f6e8f=_0x2af23c['markerName']['split'](':')[0x2],_0x50cd93=_0x55a6d0['getUserBySessionId'](_0x2f6e8f);if(!_0x50cd93||_0x2f6e8f===_0x55a6d0['mySessionId'])return;if(!_0x44e7ee['model']['schema']['checkChild'](_0x2af23c['markerRange']['start'],'$text'))return;const _0x87920f={'class':'ck-user__marker\x20'+_0x50cd93['color']['getMarkerClass'](),'data-name':_0x50cd93['name'],'data-session-id':_0x2f6e8f},_0x492d3c=_0x44e7ee['model']['markers']['get'](_0x2af23c['markerName']),_0xd8a8d6=_0x492d3c['getStart'](),_0x5d3ac0=_0xd8a8d6['nodeAfter'],_0x2cd13b=_0x44e7ee['model']['schema'];if(_0x5d3ac0&&_0x2cd13b['isObject'](_0x5d3ac0)&&_0x2cd13b['isInline'](_0x5d3ac0)&&!_0x44e7ee['model']['markers']['get']('user:range:'+_0x2f6e8f)['getRange']()['isCollapsed'])return;const _0x3081a1=_0xd8a8d6['parent'];return _0x44e7ee['model']['schema']['isLimit'](_0x3081a1)&&!_0x44e7ee['model']['hasContent'](_0x3081a1)&&(_0x87920f['contenteditable']=!0x1),function(_0x3a8e21,_0x3503c9,_0x24a95b){const _0x53344d=_0x3a8e21['createUIElement']('span',_0x3503c9);return _0x3a8e21['setCustomProperty']('userPositionMarker',!0x0,_0x53344d),_0x53344d['render']=function(_0x3ad8f3){const _0x2c505f=this['toDomElement'](_0x3ad8f3),_0x134428=document['createElement']('span');return _0x134428['classList']['add']('ck-user__marker-tooltip'),_0x134428['setAttribute']('contenteditable','false'),_0x134428['setAttribute']('spellcheck','false'),_0x134428['textContent']=_0x24a95b['name'],_0x2c505f['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x134428['outerHTML']+'⁠',_0x2c505f['addEventListener']('mouseenter',()=>{_0x2c505f['classList']['add']('ck-user__marker_hovered');}),_0x2c505f['addEventListener']('mouseleave',()=>{_0x2c505f['classList']['remove']('ck-user__marker_hovered');}),_0x2c505f;},_0x53344d['isSimilar']=function(_0x245bac){return!(!this['getCustomProperty']('userPositionMarker')||!_0x245bac['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x245bac['getAttribute']('data-session-id'));},_0x53344d;}(_0x4890c9,_0x87920f,_0x50cd93);}(_0x5e90d6,_0x134432,_0x2650f6,_0x3e74ff)}),_0x3e74ff['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1f3885=>function(_0x5d31ed,_0x29236e){const _0x499aba=_0x5d31ed['markerName']['split'](':')[0x2];if(_0x499aba===_0x29236e['mySessionId'])return null;const _0x3bb49a=_0x29236e['getUserBySessionId'](_0x499aba);if(!_0x3bb49a)return{'id':_0x499aba,'classes':[]};return{'id':_0x499aba,'classes':['ck-user__selection',_0x3bb49a['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x499aba},'priority':0x7d0+_0x3bb49a['orderNumber']};}(_0x1f3885,_0x2650f6)}),function(_0xa9c76e){const _0x4586d3=_0xa9c76e['model'],_0x3a71f9=new Map(),_0x2f7df6=_0xa9c76e['plugins']['get'](i);_0x4586d3['markers']['on']('update:user:range',(_0x2fb3bd,_0x497b54,_0x5b7b91,_0x29f627)=>{if(!_0x29f627&&_0x3a71f9['get'](_0x497b54['name']))return _0x3a71f9['get'](_0x497b54['name'])['detach'](),void _0x3a71f9['delete'](_0x497b54['name']);const _0x1328df=_0x497b54['name']['split'](':')[0x2];if(_0x1328df===_0x2f7df6['mySessionId'])return;const _0x5538fb='user:position:'+_0x1328df;_0x4586d3['markers']['has'](_0x5538fb)&&_0xa9c76e['editing']['reconvertMarker'](_0x5538fb),_0x497b54['on']('change:range',(_0x2bc8ed,_0x3d5224,_0x9ea547)=>{if('$graveyard'!=_0x3d5224['root']['rootName']&&'$graveyard'==_0x497b54['getRange']()['root']['rootName']&&!_0x3a71f9['has'](_0x497b54['name'])){const _0x881004=_0x4586d3['schema']['getNearestSelectionRange'](_0x9ea547['deletionPosition']);if(_0x881004){const _0x26f85c=_0x3333b7['fromRange'](_0x881004);_0x3a71f9['set'](_0x497b54['name'],_0x26f85c),_0x26f85c['on']('change:range',(_0x512220,_0x2357ed,_0x581f64)=>{if('$graveyard'==_0x26f85c['root']['rootName']){const _0x526e52=_0x4586d3['schema']['getNearestSelectionRange'](_0x581f64['deletionPosition']);_0x526e52?(_0x26f85c['start']=_0x526e52['start'],_0x26f85c['end']=_0x526e52['end']):(_0x3a71f9['delete'](_0x497b54['name']),_0x26f85c['detach']());}});}}});}),_0x4586d3['document']['on']('change',()=>{_0x3a71f9['size']>0x0&&_0x4586d3['enqueueChange']({'isUndoable':!0x1},_0x119d90=>{for(const [_0x4a227c,_0xbe4390]of _0x3a71f9)'$graveyard'==_0x4586d3['markers']['get'](_0x4a227c)['getRange']()['root']['rootName']&&(x(_0x4a227c['split'](':')[0x2],_0xbe4390['toRange'](),_0x4586d3,_0x119d90),_0xbe4390['detach']());_0x3a71f9['clear']();});});}(_0x3e74ff),this['_domEmitter']['listenTo'](_0x118f19['document'],'keydown',(_0x4f8845,{key:_0xf2d280})=>{'Escape'===_0xf2d280&&function(_0x2633d7){_0x2633d7['editing']['view']['change'](_0x17d444=>{for(const _0xd2a909 of _0x2633d7['model']['markers']){if(!_0xd2a909['name']['startsWith']('user:position'))continue;const _0x837034=_0x2633d7['editing']['mapper']['markerNameToElements'](_0xd2a909['name']);if(_0x837034){for(const _0x37ceaa of _0x837034)_0x17d444['removeClass']('ck-user__marker_hovered',_0x37ceaa);}}});}(_0x3e74ff);},{'useCapture':!0x0});}['afterInit'](){const _0x46baa8=this['editor'],_0x57b460=_0x46baa8['commands']['get']('undo');_0x57b460&&_0x46baa8['model']['on']('applyOperation',(_0x475112,_0x5edd91)=>{const _0x1abd34=_0x5edd91[0x0];if(!_0x1abd34['isDocumentOperation'])return;if('marker'!=_0x1abd34['type']||!_0x1abd34['name']['startsWith']('user:'))return;const _0x368a65=_0x1abd34['batch'];_0x57b460['_createdBatches']['has'](_0x368a65)&&(_0x1abd34['newRange']=_0x1abd34['oldRange']?_0x46baa8['model']['createRange'](_0x1abd34['oldRange']['start'],_0x1abd34['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0xf180c4=this['editor'],_0xcd5a99=_0xf180c4['model']['document'],_0x15127e=_0xf180c4['plugins']['get'](i);_0xf180c4['model']['enqueueChange']({'isUndoable':!0x1},_0x3b8fa4=>{const _0x222dbf='user:range:'+_0x15127e['mySessionId'],_0x138096='user:position:'+_0x15127e['mySessionId'],_0x2e8824=_0xf180c4['model']['markers']['has'](_0x222dbf);_0xf180c4['editing']['view']['hasDomSelection']?x(_0x15127e['mySessionId'],_0xcd5a99['selection']['getFirstRange'](),_0xf180c4['model'],_0x3b8fa4):_0x2e8824&&(_0x3b8fa4['removeMarker'](_0x222dbf),_0x3b8fa4['removeMarker'](_0x138096));});}}function x(_0xbff87e,_0xfcfc81,_0x58ccc5,_0x5cd521){const _0x2ea6fd='user:range:'+_0xbff87e,_0x5b804a='user:position:'+_0xbff87e,_0x3062a2=_0xfcfc81['getContainedElement']();let _0xf0394c=_0xfcfc81['start'];if(_0x3062a2&&_0x3062a2['is']('element','tableCell')){const _0x4ffbc8=function(_0x26ece1,_0x1c3867){for(const _0x1e84cf of _0x26ece1['getPositions']())if(_0x1c3867['schema']['checkChild'](_0x1e84cf,'$text'))return _0x1e84cf;}(_0xfcfc81,_0x58ccc5);_0x4ffbc8&&(_0xf0394c=_0x4ffbc8,_0xfcfc81=_0x5cd521['createRange'](_0xf0394c));}const _0x146c06=_0x5cd521['createRange'](_0xf0394c);_0x58ccc5['markers']['has'](_0x2ea6fd)?(_0x5cd521['updateMarker'](_0x2ea6fd,{'range':_0xfcfc81}),_0x5cd521['updateMarker'](_0x5b804a,{'range':_0x146c06})):(_0x5cd521['addMarker'](_0x2ea6fd,{'range':_0xfcfc81,'usingOperation':!0x0}),_0x5cd521['addMarker'](_0x5b804a,{'range':_0x146c06,'usingOperation':!0x0}));}function R(_0x471ea4,_0x20200e,_0x42c52d){const _0x4038b4=_0x471ea4['t'],t=_0x471ea4['t'];switch(_0x20200e){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 _0x4038b4({'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'},_0x42c52d);default:return'';}}let j=0x1;class l extends _0x17b805{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x4ed1bd)());['_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,_0x33cbb5,_0x20df76,_0x1ba0ff];}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 _0x4954fa=this['serverHistory']['getOperations']();for(let _0x3f1742=_0x4954fa['length']-0x1;_0x3f1742>=0x0;_0x3f1742--){const _0x1633c7=_0x4954fa[_0x3f1742];if(!this['_disconnectionOperations']['has'](_0x1633c7))return _0x1633c7['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x548cda){if(super(_0x548cda),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5cc23b(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x332ad6('collaboration-missing-channelid',this);const _0xbdf3da=_0x548cda['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xbdf3da,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xa4e653(),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 _0x4dd44d=this['editor'],_0x2d243b=_0x4dd44d['plugins']['get'](_0x20df76),_0x126010=_0x4dd44d['plugins']['get'](n);this['listenTo'](_0x2d243b,'getOperationAuthor',(_0x1e4cfd,_0x44b3e7)=>{const _0xb80dbc=_0x44b3e7[0x0];_0xb80dbc['_authorId']&&(_0x1e4cfd['return']=_0x2d243b['getUser'](_0xb80dbc['_authorId']),_0x1e4cfd['stop']()),null===_0xb80dbc['_authorId']&&(_0x1e4cfd['return']=null,_0x1e4cfd['stop']());},{'priority':'high'}),this['listenTo'](_0x4dd44d['model']['document']['selection'],'change:range',(_0x55bd02,_0x3d43cf)=>{_0x3d43cf['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4dd44d['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4dd44d['model']['on']('applyOperation',(_0x358885,_0x45cdf5)=>{const _0x557c64=_0x45cdf5[0x0];_0x557c64['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x557c64),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x126010,'state',this,'_hasSynchronizationProblem',(_0x125ba1,_0x1e15fc)=>'connected'===_0x125ba1&&!_0x1e15fc),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4dd44d['disableReadOnlyMode']('rtc-offline'):_0x4dd44d['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4dd44d['disableReadOnlyMode']('rtc-offline'):_0x4dd44d['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1151bd=this['editor']['plugins']['get'](i),_0x4eda7a=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x1151bd['unregister'](this['_channelId']);const _0x577e12=await this['_service']['reconnect'](_0x4eda7a['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x577e12)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3ba02d=await this['_service']['getConnectedSessions']();_0x1151bd['register'](this['_channelId'],_0x3ba02d),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x27a2a6){if(function(_0xb8b9a){return'404'===_0xb8b9a['code'];}(_0x27a2a6)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x551cbd){return'409'===_0x551cbd['code'];}(_0x27a2a6)){const _0x47992f=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'](_0x47992f);}else{if(!(_0x27a2a6 instanceof ReconnectionError))throw _0x27a2a6;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1667d2=this['editor']['plugins']['get'](n),_0x20dd3a=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x20dd3a['channelSessions']['has'](this['_channelId'])&&_0x20dd3a['unregister'](this['_channelId']),_0x1667d2['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4fb040){if(this['sessionId']!==_0x4fb040['sessionId']&&this['_lastSyncedOperationId']!==_0x4fb040['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x4fb040['sessionId'],this['_handleServerResponse']([],{..._0x4fb040,'wereChangesApplied':!0x1,'data':_0x4fb040['data']},'reconnect');}async['_connectService'](_0x2f0173,_0x556d42=!0x1){const {connection:_0xea7ab}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0xea7ab,this['_channelId'])['then'](_0x3bd1ac=>this['_initSessionsHandling'](_0x3bd1ac))['catch'](_0x2d18b4=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x2d18b4);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x126ed3,_0x1c8156)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1c8156);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x55b0dd=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2f0173);this['_isPendingUpdate']=!0x0;const _0x32f059=await this['_service']['connect'](_0xea7ab,this['_compressOperations'](_0x2f0173),_0x55b0dd);if(this['sessionId']=_0x32f059['sessionId'],_0x556d42){if(!_0x32f059['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x32f059['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2f0173,_0x32f059,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x32f059,_0x2f0173);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x5c02a5=this['editor']['plugins']['get'](i),_0x363bbb=this['editor']['plugins']['get'](k),_0x23be08=_0x5c02a5['channelSessions']['get'](this['_channelId']);_0x23be08&&_0x23be08['length']>0x1?_0x363bbb['createUserMarkerOperations']():this['listenTo'](_0x5c02a5,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x5c02a5['channelSessions']['get'](this['_channelId'])['length']&&_0x363bbb['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2a0798,_0x2b7342,_0x3d1b72,_0x18f62a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2b7342){const _0x53f4b1=this['_decompressOperations'](_0x3d1b72,_0x18f62a);await this['_fetchMissingUsers'](_0x53f4b1),this['_handleExternalOperations'](_0x53f4b1,_0x2b7342,_0x3d1b72['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1f0442}=this['editor'];let _0x59190b;try{_0x59190b=await this['_service']['getDocumentDetails']();}catch{const _0x307bf3=R(_0x1f0442,'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'](_0x307bf3);}const _0x5cbe54=_0x59190b['currentDocumentSession']||_0x59190b['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5cbe54['lastOperationId']){const _0x4acb7d=R(_0x1f0442,'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'](_0x4acb7d);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x5a4847){const _0x2750e1=this['editor']['plugins']['get'](i);this['listenTo'](_0x2750e1,'sessionAdd:'+this['_channelId'],(_0x4350b9,{session:_0x3b03d3})=>{if(_0x3b03d3['id']===_0x2750e1['mySessionId']){_0x4350b9['off']();const _0x4b9ca5=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x247bed=_0x3b03d3['permissions'];_0x4b9ca5&&_0x4b9ca5['isEnabled']&&(_0x247bed=_0x247bed['filter'](_0x10003=>'document:write'!==_0x10003)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x247bed,this['_channelId']);}}),_0x2750e1['register'](this['_channelId'],_0x5a4847);}['_initThrowingOnDataSet'](){const _0x2df05e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0xad16e6)=>{if(!_0xad16e6[_0xad16e6['length']-0x1]['suppressErrorInCollaboration'])throw new _0x332ad6('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2df05e['apply'](this['editor']['data'],_0xad16e6);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x5584cb,[_0xb37db8])=>{if(this['_document']['version'])throw new _0x332ad6('realtimecollaborationclient-init-document-already-initialized',this);_0x5584cb['stop'](),this['_setPendingAction']();const _0x3206aa=this['editor']['config']['get']('rootsAttributes'),_0x3ad3e0=this['_getOperationsFromInitData'](_0xb37db8,_0x3206aa);0x0==_0x3ad3e0['length']&&_0x3ad3e0['push'](new _0x12cea3(0x0)),_0x5584cb['return']=this['_connectService'](_0x3ad3e0)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1dda5d=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1dda5d))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1aaea3,[_0x1d722d,_0x58bbfa])=>{_0x1aaea3['stop']();const _0x3f7f2f=this['editor']['model']['document']['getRoot'](_0x1d722d);if(!this['_knownRootNames']['has'](_0x1d722d)){const _0x438809=_0x58bbfa&&_0x58bbfa['data']?_0x58bbfa['data']:'',_0xa5d0f5=_0x58bbfa&&_0x58bbfa['attributes']?_0x58bbfa['attributes']:{};await this['_loadRoot'](_0x1d722d,_0x438809,_0xa5d0f5);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3f7f2f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3f7f2f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x2af798){const _0x103e94=this['editor']['plugins']['get'](_0x20df76),{connection:_0x2ac832}=this['editor']['plugins']['get'](n),_0x47b1e6=new Set();for(const _0x14388c of _0x2af798){const _0x32ecb1=_0x14388c['_authorId'];_0x32ecb1&&!_0x103e94['getUser'](_0x32ecb1)&&_0x47b1e6['add'](_0x32ecb1);}if(0x0===_0x47b1e6['size'])return;const _0x3d731c=await ht['getMany'](_0x2ac832,Array['from'](_0x47b1e6));for(const _0x2bb1c3 of _0x3d731c)_0x103e94['getUser'](_0x2bb1c3['id'])||_0x103e94['addUser'](_0x2bb1c3);}['_getOperationsFromInitData'](_0x53216c,_0x1b2d3d={}){const _0x155702=this['editor']['model'],_0x19c14f=[];let _0x24b3f2=0x0;const _0xcd0dc1='string'==typeof _0x53216c?{'main':_0x53216c}:_0x53216c;for(const _0x562266 of Object['keys'](_0xcd0dc1)){if(!this['_document']['roots']['has'](_0x562266))throw new _0x332ad6('realtimecollaborationclient-init-non-existent-root',this);const _0x32b251=this['editor']['data']['parse'](_0xcd0dc1[_0x562266]),_0x533622=this['_document']['getRoot'](_0x562266),_0x13fbca=new _0x277805(_0x155702['createPositionAt'](_0x533622,0x0),_0x32b251,_0x24b3f2++);_0x19c14f['push'](_0x13fbca);for(const [_0x2d1265,_0x64eb04]of _0x32b251['markers']){const _0x7d0e17=_0x155702['createRange'](_0x155702['createPositionFromPath'](_0x533622,_0x64eb04['start']['path']['slice']()),_0x155702['createPositionFromPath'](_0x533622,_0x64eb04['end']['path']['slice']())),_0x5e106=new _0x40d6ff(_0x2d1265,null,_0x7d0e17,_0x155702['markers'],!0x0,_0x24b3f2++);_0x19c14f['push'](_0x5e106);}}if(_0x1b2d3d)for(const [_0x55292a,_0x5b74d5]of Object['entries'](_0x1b2d3d)){const _0x357089=_0x155702['document']['getRoot'](_0x55292a);if(!_0x357089)throw new _0x332ad6('multi-root-editor-root-attributes-no-root',null);for(const [_0x3b8f3e,_0x4b06e3]of Object['entries'](_0x5b74d5))if(null!==_0x4b06e3){const _0x366d95=new _0x23d727(_0x357089,_0x3b8f3e,null,_0x4b06e3,_0x24b3f2++);_0x19c14f['push'](_0x366d95);}}return _0x19c14f;}async['_loadRoot'](_0x1d3a24,_0x4c608d,_0x71dde4){this['_getOperationsFromInitData']({[_0x1d3a24]:_0x4c608d},{[_0x1d3a24]:_0x71dde4})['forEach']((_0x306f98,_0x52cffd)=>{_0x306f98['baseVersion']=this['_document']['version']+_0x52cffd,_0x306f98['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x306f98);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x56bbf6,_0x2212eb){let _0x58e717;this['_offset']=_0x56bbf6['offset'];const _0xa52df6=_0x56bbf6['wereChangesApplied']&&!_0x56bbf6['initData'],_0x37d4d1=_0xa52df6?0x0:_0x56bbf6['data']['baseVersion'];if(_0x2212eb['forEach'](_0x43dfdf=>{_0x43dfdf['_isInit']=!0x0,_0x43dfdf['createdAt']=_0x56bbf6['sessionCreatedAt'],_0x43dfdf['_authorId']=null;}),_0xa52df6)_0x58e717=_0x2212eb,this['_applyOperationsSet'](_0x58e717,_0xa52df6);else{if(_0x56bbf6['initData']){const _0x5a2e34=this['_getOperationsFromInitData'](_0x56bbf6['initData']);this['_document']['history']['version']=-_0x5a2e34['length'],_0x5a2e34['forEach'](_0x4c4547=>{_0x4c4547['baseVersion']-=_0x5a2e34['length'],_0x4c4547['createdAt']=_0x56bbf6['sessionCreatedAt'],_0x4c4547['_isInit']=!0x0,_0x4c4547['_authorId']=null;}),this['_applyOperationsSet'](_0x5a2e34,!0x0),this['serverHistory']['version']=-_0x5a2e34['length']+this['_offset'],this['_updateServerHistory'](_0x5a2e34);}this['_document']['history']['version']=_0x37d4d1,_0x58e717=this['_decompressOperations'](_0x56bbf6['data'],_0x56bbf6['metadata']),await this['_fetchMissingUsers'](_0x58e717),this['_applyOperationsSet'](_0x58e717,_0xa52df6);}_0x56bbf6['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x58e717,_0x56bbf6['lastOperationId']),this['_lastSyncedOperationId']=_0x56bbf6['lastOperationId']),this['serverHistory']['version']=_0x37d4d1+this['_offset'],this['_updateServerHistory'](_0x58e717),_0x2212eb['filter'](_0x4a6f84=>{const _0x31f633=this['_getAffectedRoot'](_0x4a6f84);return _0x31f633&&!this['_knownRootNames']['has'](_0x31f633);})['forEach']((_0x3f3978,_0x97d647)=>{_0x3f3978['baseVersion']=this['_document']['version']+_0x97d647,this['_saveOperationInBuffer'](_0x3f3978);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x5a8ca6,_0x75bf23){const _0x3a46d5=_0x75bf23&&_0x75bf23['message'];if(_0x3a46d5&&_0x3a46d5['startsWith']('realtimecollaborationclient'))throw _0x75bf23;const _0x324498=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x324498['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x332ad6(_0x5a8ca6,this['editor'],_0x3a46d5?{'originalError':_0x3a46d5}:void 0x0);}['_saveOperationInBuffer'](_0x399f46){this['_knownOperations']['has'](_0x399f46)||(this['_knownOperations']['add'](_0x399f46),this['_bufferedOperations']['push'](_0x399f46),this['_pendingAction']||'marker'==_0x399f46['type']&&!_0x399f46['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x417bfa=!0x1){!_0x417bfa&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x495de5=>{_0x495de5&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x305037=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x9c7579){return _0x9c7579['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x9c7579['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x9c7579['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x305037)||this['_crash'](_0x305037['message'],_0x305037);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2b620f=>{this['on']('change:_isPendingUpdate',()=>{_0x2b620f();});});}async['_sendBufferedOperations'](){const _0x587617=this['editor']['plugins']['get'](k);if(this['_shouldSendSelectionUpdate']()&&(_0x587617['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x474f5e=[...this['_bufferedOperations']];for(const _0x14be25 of _0x474f5e)_0x14be25['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x14be25);const _0x28e5c4=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x474f5e),_0x2fc5e3=j++,_0x5e64fd=this['_compressOperations'](_0x474f5e),_0x25debe=await this['_service']['sendOperations'](_0x5e64fd,_0x5e64fd['baseVersion'],_0x28e5c4);try{return await this['_handleServerResponse'](_0x474f5e,_0x25debe,_0x2fc5e3);}catch(_0x3049a8){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3049a8);}}async['_handleServerResponse'](_0x4d7e60,_0x514558,_0x481669){if('error'in _0x514558)throw _0x514558['error'];let _0x35a779=!0x1;if(_0x514558['wereChangesApplied']){_0x514558['lastOperationId']&&(this['_lastSyncedOperationId']=_0x514558['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2e4b42=>!_0x4d7e60['includes'](_0x2e4b42));for(const _0x100c03 of _0x4d7e60)_0x100c03['createdAt']='lastOperationAcceptedAt'in _0x514558&&_0x514558['lastOperationAcceptedAt']||void 0x0;D(_0x4d7e60,_0x514558['version']-_0x4d7e60['length']),this['_updateServerHistory'](_0x4d7e60);const _0x2286c2=_0x4d7e60['filter'](_0x1801f9=>{if(!_0x1801f9['_isInit'])return!0x1;const _0xe37c15=this['_getAffectedRoot'](_0x1801f9);return _0xe37c15&&!this['_knownRootNames']['has'](_0xe37c15);});D(_0x2286c2,this['_document']['version']),this['_applyOperationsSet'](_0x2286c2),_0x35a779=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xfd10a7=this['_decompressOperations'](_0x514558['data'],_0x514558['metadata'])['filter'](_0x4acc58=>_0x4acc58['baseVersion']>=this['_lastServerVersion']);_0xfd10a7['forEach'](_0x5586b3=>this['_addKnownRoot'](_0x5586b3)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x250729=>!_0x250729['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x250729))),this['_bufferedOperations']['length']&&D(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xfd10a7),_0x35a779=this['_handleExternalOperations'](_0xfd10a7,_0x514558['version'],_0x514558['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x35a779?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x699227,_0x5ea3a2,_0x2e5dd9){try{const _0x504784={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x22e934,operationsB:_0x2a68c4,originalOperations:_0x357223}=_0x163cfc(_0x699227,this['_bufferedOperations'],_0x504784);D(_0x22e934,this['_document']['version']),D(_0x2a68c4,_0x5ea3a2);for(const _0x42af16 of _0x22e934){const _0x473ab8=_0x357223['get'](_0x42af16);_0x42af16['_authorId']=_0x473ab8?_0x473ab8['_authorId']:null;}_0x2e5dd9&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x699227,_0x2e5dd9),this['_lastSyncedOperationId']=_0x2e5dd9),this['_bufferedOperations']=[..._0x2a68c4],this['_applyOperationsSet'](_0x22e934),this['_updateServerHistory'](_0x699227);}catch(_0x5f55c7){return console['error'](_0x5f55c7),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1d0a01,_0x50e08e=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5eeaa9=>{for(const _0x96819e of _0x1d0a01)this['_knownOperations']['add'](_0x96819e),this['_addKnownRoot'](_0x96819e),_0x5eeaa9['batch']['addOperation'](_0x96819e),this['editor']['model']['applyOperation'](_0x96819e);});}['_addKnownRoot'](_0x2116fd){const _0x36cb17=this['_getAffectedRoot'](_0x2116fd);_0x36cb17&&this['_knownRootNames']['add'](_0x36cb17);}['_getAffectedRoot'](_0x302501){let _0x4334a1,_0x1f369b;switch(_0x302501['type']){case'insert':_0x4334a1=_0x302501['position']['root'];break;case'marker':if(_0x1f369b=_0x302501['newRange'],!_0x1f369b)return null;_0x4334a1=_0x1f369b['root'];break;case'addRootAttribute':_0x4334a1=_0x302501['root'];break;case'addRoot':_0x4334a1=_0x302501['affectedSelectable'];break;case'move':_0x4334a1=_0x302501['targetPosition']['root'];break;default:return null;}return _0x4334a1['rootName'];}['_updateServerHistory'](_0x19b7bb){_0x19b7bb['forEach'](_0x27fd6f=>{const _0x2919dd=_0x27fd6f['clone']();_0x2919dd['_authorId']=_0x27fd6f['_authorId'],_0x2919dd['_isInit']=!!_0x27fd6f['_isInit'],_0x2919dd['createdAt']=_0x27fd6f['createdAt'],_0x2919dd['baseVersion']+=this['_offset'],_0x27fd6f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x2919dd),this['serverHistory']['addOperation'](_0x2919dd);});}['_handleReconnectionError'](_0x5ac2f1){const _0x492e23=this['editor']['plugins']['get']('Notification'),_0x107cfa=this['editor']['locale'];_0x5ac2f1||(_0x5ac2f1=R(_0x107cfa,'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.')),_0x492e23['showWarning'](_0x5ac2f1,{'title':R(_0x107cfa,'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'](_0x33cbb5)['add'](R(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x33cbb5)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x1397e4){const _0x4f2dea=_0x1397e4['map'](_0x107bfd=>_0x107bfd['toJSON']());return this['_compressor']['compress'](_0x4f2dea);}['_decompressOperations'](_0x3e7034,_0x356244){return this['_compressor']['decompress'](_0x3e7034)['map']((_0xeb627e,_0x25f2fa)=>{const _0x3d1538='init'==_0x356244[_0x25f2fa]['type'];if('InsertOperation'==_0xeb627e['__className']){const _0x29a9fd=_0xeb627e['position']['root'];!this['_document']['getRoot'](_0x29a9fd)&&(this['_document']['createRoot']('$root',_0x29a9fd)['_isAttached']=!0x1);}const _0xe30dd9=_0x2ad745['fromJSON'](_0xeb627e,this['_document']);return _0xe30dd9['wasUndone']=_0xeb627e['wasUndone'],_0xe30dd9['_isInit']=_0x3d1538,_0xe30dd9['_authorId']=_0x3d1538?null:_0x356244[_0x25f2fa]['userId'],_0xe30dd9['_isDisconnection']='cs:removeUser'===_0x356244[_0x25f2fa]['type'],_0xe30dd9['createdAt']=_0x356244[_0x25f2fa]['createdAt'],_0xe30dd9;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2ebfd0=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2ebfd0&&_0x2ebfd0['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function D(_0x3c7fb1,_0x18e8f2){for(const _0x302761 of _0x3c7fb1)_0x302761['baseVersion']=_0x18e8f2++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0xf22001){this['_ignoredOperations']=_0xf22001,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xac1c69){let _0x5a3ac3=_0xac1c69['length'];for(;_0x5a3ac3--;){const _0x1283bb=_0xac1c69[_0x5a3ac3];if(!this['_ignoredOperations']['has'](_0x1283bb)){if(!this['_operationToId']['has'](_0x1283bb)){const _0x4f867d=_0x1bb2ae()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1283bb,_0x4f867d);}return this['_operationToId']['get'](_0x1283bb);}}}['setIdForTheLastOperation'](_0x2bcdf4,_0x1a4bef){if(!_0x1a4bef)return;let _0x9b5b5f=_0x2bcdf4['length'];for(;_0x9b5b5f--;){const _0x25688b=_0x2bcdf4[_0x9b5b5f];this['_ignoredOperations']['has'](_0x25688b)||this['_operationToId']['set'](_0x25688b,_0x1a4bef);}}}class a extends _0x17b805{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x102a7b{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x27047f)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x20df76];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57013f){super(_0x57013f),this['_services']=new Map();}async['init'](){const _0x46ee41=this['context'],_0x4935e4=_0x46ee41['plugins']['get']('CommentsRepository');if(_0x46ee41['plugins']['get'](n)['addToReconnectionStack'](this),_0x4935e4['adapter']={'addCommentThread':async({channelId:_0x592881,threadId:_0xefc483,comments:_0x4f08e6,resolvedAt:_0x362a3b,resolvedBy:_0x429bab,context:_0x10a1b8,attributes:_0x30b3f4})=>{const _0x45bb1b=await this['_getService'](_0x592881)['addCommentThread']({'commentThreadId':_0xefc483,'comments':_0x4f08e6['map'](_0x33d7b0=>function(_0x588107,_0x339f41,_0x37e9c7){return{'commentThreadId':_0x37e9c7,'commentId':_0x588107['commentId'],'userId':_0x588107['authorId'],'content':_0x588107['content'],'documentId':_0x339f41,'createdAt':_0x588107['createdAt'],'attributes':_0x588107['attributes']||{}};}(_0x33d7b0,_0x592881,_0xefc483)),'resolvedAt':_0x362a3b,'resolvedBy':_0x429bab,'context':_0x10a1b8,'attributes':_0x30b3f4})['catch'](lt);return{'threadId':_0x45bb1b['commentThreadId'],'comments':_0x45bb1b['comments']};},'getCommentThread':async({channelId:_0x146d4b,threadId:_0x3023da})=>{const _0x1e95ce=await this['_getService'](_0x146d4b)['getCommentThread'](_0x3023da)['catch'](q)['catch'](lt);return _0x1e95ce?_0x1e95ce['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x1e95ce]),{'threadId':_0x1e95ce['commentThreadId'],'comments':_0x1e95ce['comments']['map'](z),'context':_0x1e95ce['context'],'resolvedAt':_0x1e95ce['resolvedAt'],'resolvedBy':_0x1e95ce['resolvedBy'],'attributes':_0x1e95ce['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x21b1df,threadId:_0x241179,context:_0x1f3f8e,unlinkedAt:_0x58b748,attributes:_0x539871})=>this['_getService'](_0x21b1df)['updateCommentThread']({'commentThreadId':_0x241179,'context':_0x1f3f8e,'attributes':_0x539871,'unlinkedAt':_0x58b748})['catch'](q)['catch'](lt),'resolveCommentThread':async({channelId:_0xb07627,threadId:_0x5eb095})=>{const _0x3b30d9=await this['_getService'](_0xb07627)['resolveCommentThread'](_0x5eb095)['catch'](q)['catch'](lt);return{'threadId':_0x3b30d9['commentThreadId'],'resolvedAt':_0x3b30d9['resolvedAt'],'resolvedBy':_0x3b30d9['resolvedBy']};},'reopenCommentThread':async({channelId:_0x25220c,threadId:_0x17f8d8})=>this['_getService'](_0x25220c)['reopenCommentThread'](_0x17f8d8)['catch'](q)['catch'](lt),'removeCommentThread':({channelId:_0x538107,threadId:_0x4da25b})=>this['_getService'](_0x538107)['removeCommentThread'](_0x4da25b)['catch'](q)['catch'](lt),'addComment':({channelId:_0x38a6e4,threadId:_0x203351,commentId:_0x3d1f98,content:_0x520e72,attributes:_0x1bf0ad})=>this['_getService'](_0x38a6e4)['addComment'](_0x203351,_0x3d1f98,_0x520e72,_0x1bf0ad)['catch'](lt),'updateComment':({channelId:_0x36664b,threadId:_0x5b1418,commentId:_0x291685,content:_0x2cbae9,attributes:_0x5d3ee7})=>this['_getService'](_0x36664b)['updateComment'](_0x5b1418,_0x291685,_0x2cbae9,_0x5d3ee7)['catch'](q)['catch'](lt),'removeComment':({channelId:_0xe962a4,threadId:_0x4772c5,commentId:_0x52a8e4})=>this['_getService'](_0xe962a4)['removeComment'](_0x4772c5,_0x52a8e4)['catch'](q)['catch'](lt)},_0x46ee41 instanceof _0x1c4fa0){const _0x191670=_0x46ee41['config']['get']('collaboration.channelId'),_0x2d7557=_0x46ee41['plugins']['get'](i);await this['_setUpService'](_0x191670);const _0x2d660b=await this['_services']['get'](_0x191670)['getConnectedSessions']();this['listenTo'](_0x2d7557,'sessionAdd:'+_0x191670,(_0x441620,{session:_0x2ebd43})=>{_0x2ebd43['id']===_0x2d7557['mySessionId']&&(_0x441620['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2ebd43['permissions'],_0x191670));}),_0x2d7557['register'](_0x191670,_0x2d660b);}}async['_setUpService'](_0x27d295){if(this['_services']['has'](_0x27d295))throw new _0x332ad6('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x27d295});const _0x158a1a=this['context']['plugins']['get']('CommentsRepository'),_0x28fc5c=new s['CommentsService'](_0x27d295);this['_services']['set'](_0x27d295,_0x28fc5c),this['listenTo'](_0x28fc5c,'commentThreadAdded',(_0x413b22,_0x5d2090)=>{const {commentThreadId:_0xc33d0a,documentId:_0xdce2fc,context:_0x2301d3,attributes:_0x2abaff,resolvedAt:_0x35a9c0,resolvedBy:_0x2b6031,comments:_0x16ac61}=_0x5d2090;_0x158a1a['getCommentThread'](_0xc33d0a)||_0x158a1a['addCommentThread']({'threadId':_0xc33d0a,'channelId':_0xdce2fc,'comments':_0x16ac61?_0x16ac61['map'](z):[],'context':_0x2301d3,'attributes':_0x2abaff,'resolvedAt':_0x35a9c0,'resolvedBy':_0x2b6031,'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadUpdated',(_0x3d4e57,{commentThreadId:_0x4e66f1,documentId:_0x6a779b,context:_0x5b4c33,unlinkedAt:_0x4fb9df,attributes:_0x1f1ff0})=>{_0x158a1a['getCommentThread'](_0x4e66f1)&&_0x158a1a['updateCommentThread']({'threadId':_0x4e66f1,'channelId':_0x6a779b,'context':_0x5b4c33,'unlinkedAt':_0x4fb9df,'attributes':_0x1f1ff0,'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadResolved',(_0x491adc,{commentThreadId:_0x5acbc3,resolvedBy:_0x1d6d38,resolvedAt:_0x53fe5b})=>{const _0x4cd54e=_0x158a1a['getCommentThread'](_0x5acbc3);_0x4cd54e&&_0x4cd54e['resolve']({'resolvedBy':_0x1d6d38,'resolvedAt':_0x53fe5b,'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadReopened',(_0xb427e9,{commentThreadId:_0x3469d7})=>{const _0x5c6336=_0x158a1a['getCommentThread'](_0x3469d7);_0x5c6336&&_0x5c6336['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentThreadRemoved',(_0x5e10af,{commentThreadId:_0x15da98})=>{const _0x59c096=_0x158a1a['getCommentThread'](_0x15da98);_0x59c096&&_0x59c096['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentAdded',(_0x1e6a77,_0x3c2e2c)=>{const _0xbb6a1d=_0x3c2e2c['commentThreadId'],_0x44004a=_0x158a1a['getCommentThread'](_0xbb6a1d);_0x44004a&&_0x44004a['addComment']({...z(_0x3c2e2c),'isFromAdapter':!0x0});}),this['listenTo'](_0x28fc5c,'commentUpdated',(_0x3c8f16,{commentThreadId:_0x27002e,commentId:_0x44f483,content:_0xdb2a27,attributes:_0x32c805})=>{const _0x4a9c0a=_0x158a1a['getCommentThread'](_0x27002e);if(_0x4a9c0a){const _0x1e5c4a=_0x4a9c0a['getComment'](_0x44f483);_0x1e5c4a&&_0x1e5c4a['update']({'content':_0xdb2a27,'attributes':_0x32c805,'isFromAdapter':!0x0});}}),this['listenTo'](_0x28fc5c,'commentRemoved',(_0x2efec8,{commentThreadId:_0x36c95f,commentId:_0x3df945})=>{const _0x2d8d0b=_0x158a1a['getCommentThread'](_0x36c95f);if(_0x2d8d0b){const _0x2bf37a=_0x2d8d0b['getComment'](_0x3df945);_0x2bf37a&&_0x2bf37a['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x27d295);}['destroy'](){if(this['context']instanceof _0x1c4fa0){const _0x4b7de5=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4b7de5);}}['_terminateService'](_0x396fa6){if(!this['_services']['has'](_0x396fa6))throw new _0x332ad6('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x396fa6});this['_getService'](_0x396fa6)['disconnect'](),this['_services']['delete'](_0x396fa6);}async['reconnect'](){for(const _0x4e0f97 of this['_services']['keys']())await this['_connectService'](_0x4e0f97);if(this['context']instanceof _0x1c4fa0){const _0x8d2e64=this['context']['config']['get']('collaboration.channelId'),_0x44c8eb=this['context']['plugins']['get'](i);_0x44c8eb['unregister'](_0x8d2e64);const _0x27dbe5=await this['_services']['get'](_0x8d2e64)['getConnectedSessions']();_0x44c8eb['register'](_0x8d2e64,_0x27dbe5);}}async['_connectService'](_0x117d63){const {connection:_0x43eb9f}=this['context']['plugins']['get'](n),_0x4c06c3=this['context']['plugins']['get']('CommentsRepository'),_0x5b17a6=this['_services']['get'](_0x117d63),_0x5a942e=await _0x5b17a6['connect'](_0x43eb9f);await this['_fetchMissingUsersForThreads'](_0x5a942e);const _0xec13a9=new Set(Array['from'](_0x4c06c3['getCommentThreads']({'channelId':_0x117d63}),_0x310a4b=>_0x310a4b['id']));for(const _0x2a18d3 of _0x5a942e)_0x2a18d3['deletedAt']||_0xec13a9['delete'](_0x2a18d3['commentThreadId']);for(const _0x429c67 of _0xec13a9)_0x4c06c3['getCommentThread'](_0x429c67)['remove']({'isFromAdapter':!0x0});for(const _0x5371b5 of _0x5a942e){let _0x39c369=_0x4c06c3['getCommentThread'](_0x5371b5['commentThreadId']);const {commentThreadId:_0x670203,context:_0x2e00d3,attributes:_0x3d539f,resolvedBy:_0x1b0ce4,resolvedAt:_0x3bd762,unlinkedAt:_0x12c80d,deletedAt:_0x520c3c}=_0x5371b5;if(_0x520c3c)continue;_0x39c369||(_0x39c369=_0x4c06c3['addCommentThread']({'channelId':_0x117d63,'threadId':_0x670203,'context':_0x2e00d3,'attributes':_0x3d539f||{},'resolvedBy':_0x1b0ce4,'resolvedAt':_0x3bd762,'unlinkedAt':_0x12c80d,'isFromAdapter':!0x0}));const _0x1995de=new Set(Array['from'](_0x39c369['comments'],_0x5a53f0=>_0x5a53f0['id']));for(const _0xa3e88b of _0x5371b5['comments'])_0x1995de['delete'](_0xa3e88b['commentId']);for(const _0x502556 of _0x1995de)_0x39c369['getComment'](_0x502556)['remove']({'isFromAdapter':!0x0});for(const _0xa9d780 of _0x5371b5['comments']){const _0x36f38f=_0x39c369['getComment'](_0xa9d780['commentId']);_0x36f38f?_0x36f38f['content']!==_0xa9d780['content']&&_0x36f38f['update']({'content':_0xa9d780['content'],'isFromAdapter':!0x0}):_0x39c369['addComment'](Object['assign'](z(_0xa9d780),{'isFromAdapter':!0x0}));}}}['_getService'](_0x47717d){if(!this['_services']['has'](_0x47717d))throw new _0x332ad6('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x47717d});return this['_services']['get'](_0x47717d);}async['_fetchMissingUsersForThreads'](_0x548e6f){const _0x49b34b=this['context']['plugins']['get'](_0x20df76),{connection:_0x24ca09}=this['context']['plugins']['get'](n),_0x1e96ac=new Set();for(const {resolvedBy:_0x458add,comments:_0x2424f1}of _0x548e6f){_0x458add&&!_0x49b34b['getUser'](_0x458add)&&_0x1e96ac['add'](_0x458add);for(const {userId:_0xbc0df1}of _0x2424f1)_0x49b34b['getUser'](_0xbc0df1)||_0x1e96ac['add'](_0xbc0df1);}if(0x0===_0x1e96ac['size'])return;const _0x125a2d=await ht['getMany'](_0x24ca09,Array['from'](_0x1e96ac));for(const _0x21aded of _0x125a2d)_0x49b34b['getUser'](_0x21aded['id'])||_0x49b34b['addUser'](_0x21aded);}}async function q(_0xc04ed6){if('404'!==_0xc04ed6['code'])throw _0xc04ed6;}function lt(_0x1ea56b){if((_0x494d04=_0x1ea56b)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x494d04['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x494d04['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x494d04;throw _0x1ea56b;}function z(_0x153a72){return{'threadId':_0x153a72['commentThreadId'],'commentId':_0x153a72['commentId'],'content':_0x153a72['content'],'createdAt':_0x153a72['createdAt'],'authorId':_0x153a72['userId'],'attributes':_0x153a72['attributes']||{}};}class m extends _0x17b805{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe5bdca){super(_0xe5bdca);const _0x4c57de=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4c57de);}['init'](){const _0x197b92=this['editor']['plugins']['get'](n),_0x1ff3a4=this['editor']['plugins']['get']('TrackChangesEditing');return _0x1ff3a4['adapter']={'getSuggestion':async _0x33281e=>{await this['_waitForServiceReady']();const _0x48e7c2=await this['_trackChangesService']['get'](_0x33281e)['catch'](N);return await this['_fetchMissingUsersForThreads']([_0x48e7c2]),_0x48e7c2;},'addSuggestion':async({id:_0x4758cf,type:_0x5032c8,data:_0x197417,originalSuggestionId:_0x4d703d,attributes:_0x27c0d2})=>{await this['_waitForServiceReady']();const _0x3a3048={'id':_0x4758cf,'type':_0x5032c8,'data':_0x197417,'originalSuggestionId':_0x4d703d,'attributes':_0x27c0d2},_0x1e8ead=await this['_trackChangesService']['add'](_0x4758cf,_0x5032c8,_0x197417,_0x4d703d,_0x27c0d2)['catch'](_0x2fddb2=>{if(dt(_0x2fddb2))return new Promise(_0x230a28=>{this['_bufferedRequests']['set'](_0x4758cf,{'resolve':_0x230a28,'suggestionData':_0x3a3048});});throw _0x2fddb2;});return this['_bufferedRequests']['delete'](_0x4758cf),_0x1e8ead;},'updateSuggestion':async(_0x579fa2,_0x338142)=>{if(await this['_waitForServiceReady'](),'open'!==_0x338142['state'])return this['_trackChangesService']['update'](_0x579fa2,_0x338142)['catch'](N);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x21dde4,_0x2581f1)=>{_0x1ff3a4['hasSuggestion'](_0x2581f1['id'])&&(_0x1ff3a4['getSuggestion'](_0x2581f1['id'])['attributes']=_0x2581f1['attributes']);}),this['_trackChangesService']['connect'](_0x197b92['connection'])['then'](_0x565394=>(_0x197b92['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x565394)['then'](()=>{for(const _0x3d3140 of _0x565394){_0x1ff3a4['addSuggestionData'](_0x3d3140)['_saved']=!0x0;}})));}async['reconnect'](){const _0x4bfd45=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x53afb3}=this['editor']['plugins']['get'](n),_0x4e1ac6=await this['_trackChangesService']['connect'](_0x53afb3);await this['_fetchMissingUsersForThreads'](_0x4e1ac6);for(const {suggestionData:_0x30372d,resolve:_0x3f1073}of this['_bufferedRequests']['values']()){let _0x263193=_0x4e1ac6['find'](_0xe0500a=>_0xe0500a['id']===_0x30372d['id']);_0x263193||(_0x263193=await this['_trackChangesService']['add'](_0x30372d['id'],_0x30372d['type'],_0x30372d['data'],_0x30372d['originalSuggestionId'])),_0x3f1073(_0x263193);}for(const _0x1de2c2 of _0x4e1ac6)_0x4bfd45['hasSuggestion'](_0x1de2c2['id'])||_0x4bfd45['addSuggestionData'](_0x1de2c2);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x17dceb=>{this['listenTo'](this['_trackChangesService'],'connected',_0x57a7e1=>{_0x57a7e1['off'](),_0x17dceb();});});}async['_fetchMissingUsersForThreads'](_0x2ecfb3){const _0x378056=this['editor']['plugins']['get'](_0x20df76),{connection:_0x3f98b1}=this['editor']['plugins']['get'](n),_0x53add1=new Set();for(const {authorId:_0x35724e}of _0x2ecfb3)_0x378056['getUser'](_0x35724e)||_0x53add1['add'](_0x35724e);if(0x0===_0x53add1['size'])return;const _0x4b0e58=await ht['getMany'](_0x3f98b1,Array['from'](_0x53add1));for(const _0xeb74ae of _0x4b0e58)_0x378056['getUser'](_0xeb74ae['id'])||_0x378056['addUser'](_0xeb74ae);}}function N(_0x8255cf){if(dt(_0x8255cf))return new Promise(()=>{});throw _0x8255cf;}function dt(_0x36b0dd){return _0x36b0dd['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x36b0dd['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x17b805{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 _0x2f4837=this['editor']['plugins']['get'](n),_0x25c88c=this['editor']['plugins']['get']('CommentsEditing'),_0x388d80=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2f4837,'change:state',(_0x410192,_0x3a8818,_0x2a6264)=>{_0x25c88c['isThreadsLoadingPaused']='connected'!==_0x2a6264;});}),this['listenTo'](_0x2f4837,'change:state',(_0x2a905a,_0x5b851e,_0x2f8f5a)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x2f8f5a);}),_0x388d80['_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 _0x17b805{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 _0x17b805{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x20df76];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45df89){super(_0x45df89);const _0x964d43=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x964d43);}async['init'](){const _0x49aa9b=this['editor']['plugins']['get'](l),_0x1b1145=_0x49aa9b['serverHistory'],_0x3a7253=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x1b1145,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x49aa9b['sessionId']});const _0x50d73d=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x448a43=await tt['isBundleUploaded'](_0x3a7253['connection'],_0x50d73d);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x679a32})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x679a32)),'updateRevisions':async _0x225d12=>{await this['_waitForServiceReady']();const _0x5e59ae=this['_revisionTracker']['currentRevision'];if(_0x448a43&&0x1===_0x225d12['length']&&_0x225d12[0x0]['id']===_0x5e59ae['id'])return _0x225d12;for(const _0x2c10fa of _0x225d12)_0x2c10fa['id']===_0x5e59ae['id']&&(_0x2c10fa['isEmptyCurrent']=_0x2c10fa['fromVersion']===_0x2c10fa['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x225d12,this['_lastRequestId'])['then'](_0x1fae17=>(this['_lastRequestId']=_0x1fae17,_0x225d12))['catch'](_0x5eb71b=>{if(st(_0x5eb71b)||'400'===_0x5eb71b['code']&&void 0x0!==_0x5eb71b['data']['wrongRequestId']){for(const _0x146456 of _0x225d12){!this['_revisionTracker']['repository']['getRevision'](_0x146456['id'])||this['_revisionTracker']['_bufferUpdate'](_0x146456['id'],_0x146456,!0x1);}if(st(_0x5eb71b))throw _0x5eb71b;return _0x225d12;}throw _0x5eb71b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3327e9,{revisionsData:_0x24ffc1,requestId:_0xab65dc})=>{Math['max'](..._0x24ffc1['map'](_0x17c8e2=>_0x17c8e2['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x24ffc1,_0xab65dc);}):this['_handleRevisionsUpdate'](_0x24ffc1,_0xab65dc);});const {revisions:_0x5b13cc,requestId:_0x922f43}=await this['_revisionHistoryService']['connect'](_0x3a7253['connection']);_0x3a7253['addToReconnectionStack'](this),this['_lastRequestId']=_0x922f43,await this['_fetchMissingUsers'](_0x5b13cc);for(const _0x3fbbeb of _0x5b13cc)this['_revisionTracker']['addRevisionData'](_0x3fbbeb);this['listenTo'](_0x49aa9b,'change:_isConnected',(_0x329630,_0x5e9507,_0x4a42a5)=>{_0x4a42a5&&(this['_oldOffset']=_0x49aa9b['_offset'],_0x329630['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3a7253,'state',_0x3bd9e5=>_0x3bd9e5===_0x42ae72['CONNECTED']);}async['reconnect'](){const _0x3ab232=this['editor']['plugins']['get'](n),_0x5899f6=this['editor']['plugins']['get'](l),_0x1b2e19=async()=>{const _0x58f975=this['_revisionTracker']['currentRevision'],_0x5b627f=_0x58f975['id'],_0x332b21=_0x5b627f!==_0x5899f6['sessionId'];if(_0x332b21){const _0x515330=_0x5899f6['_offset']-this['_oldOffset'],_0x595845=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x58f975['toVersion']+_0x515330!==_0x595845){const _0x22f5fc=_0x58f975['fromVersion']+_0x515330,_0x15d1a5=this['editor']['plugins']['get'](_0x20df76),_0x2fac8f=this['_revisionTracker']['buildRevisionData']({'revision':_0x58f975,'from':_0x22f5fc,'to':_0x595845});_0x2fac8f['id']=_0x58f975['id'];const _0x49ef4d=_0x2fac8f['authorsIds']['map'](_0x28717e=>_0x15d1a5['getUser'](_0x28717e));_0x58f975['_update']({..._0x2fac8f,'authors':_0x49ef4d},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x58f975['id'],_0x2fac8f,!0x0);}this['_revisionTracker']['_startingVersion']=_0x595845,(_0x58f975['toVersion']===_0x58f975['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x5b627f)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x5b627f),this['_revisionTracker']['_createCurrentRevision'](_0x595845));}const {revisions:_0x1d00ec,requestId:_0x130075}=await this['_revisionHistoryService']['reconnect'](_0x3ab232['connection'],this['_lastRequestId']);_0x332b21&&_0x1d00ec['length']>0x0?_0x5899f6['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x1d00ec),this['_handleRevisionsUpdate'](_0x1d00ec,_0x130075),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5899f6['_isConnected']?_0x1b2e19():new Promise((_0x498907,_0x40a1c2)=>{_0x5899f6['once']('change:_isConnected',()=>{_0x1b2e19()['then'](_0x498907)['catch'](_0x40a1c2);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0xef82e2=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5e0cba=>{_0x5e0cba['off'](),_0xef82e2();});});}['_getLatestVersionFromServerOperations'](){const _0x366066=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1aa0ac of _0x366066)if('marker'!==_0x1aa0ac['type']||_0x1aa0ac['affectsData'])return _0x1aa0ac['baseVersion']+0x1;}['_getLatestVersion'](){const _0x10c8d8=this['editor']['plugins']['get'](l);return new Promise(_0x18b4cc=>{_0x10c8d8['_isPendingUpdate']?_0x10c8d8['once']('change:_isPendingUpdate',()=>{_0x18b4cc(this['_getLatestVersionFromServerOperations']());}):_0x18b4cc(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x2684ea,_0xb0a3fd){const _0x6b1711=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xb0a3fd;for(const _0x555599 of _0x2684ea){const _0x36be7a=_0x6b1711['getRevision'](_0x555599['id']);if(_0x36be7a){if((_0x555599['fromVersion']||_0x555599['toVersion'])&&(_0x555599['diffData']=null),_0x36be7a===this['_revisionTracker']['currentRevision']){const _0x47da26=Math['max'](_0x36be7a['toVersion'],_0x555599['toVersion']),_0x3c776d=Math['max'](_0x36be7a['fromVersion'],_0x555599['fromVersion']);let _0x2b6da2;_0x36be7a['toVersion']===_0x555599['toVersion']&&_0x36be7a['fromVersion']===_0x555599['fromVersion']?(_0x2b6da2=!0x0,this['_preventResendingRevisionData'](_0x555599)):_0x555599['toVersion']===_0x47da26&&_0x555599['fromVersion']===_0x3c776d?_0x2b6da2=!0x1:(_0x36be7a['toVersion']===_0x47da26&&_0x36be7a['fromVersion']===_0x3c776d||this['_fixRevision']({'revision':_0x36be7a,'from':_0x3c776d,'to':_0x47da26}),_0x2b6da2=!0x0),_0x2b6da2&&(delete _0x555599['fromVersion'],delete _0x555599['toVersion'],delete _0x555599['diffData'],delete _0x555599['createdAt'],delete _0x555599['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x555599),this['_preventResendingRevisionData'](_0x555599);}else this['_revisionTracker']['addRevisionData'](_0x555599);}const _0x36cee0=_0x6b1711['getRevisions']();_0x36cee0['reverse']();for(let _0x1cde44=0x0;_0x1cde44<_0x36cee0['length']-0x1;_0x1cde44++){const _0x1daa13=_0x36cee0[_0x1cde44],_0x27c61b=_0x36cee0[_0x1cde44+0x1];if(_0x1daa13['fromVersion']<_0x27c61b['toVersion']){const _0x5d773f=_0x27c61b['toVersion'],_0xf593e9=Math['max'](_0x5d773f,_0x1daa13['toVersion']);this['_fixRevision']({'revision':_0x1daa13,'from':_0x5d773f,'to':_0xf593e9});}}}['_fixRevision']({revision:_0x5256b0,from:_0x3d258b,to:_0x3c3be5}={}){const _0x60efe3=this['editor']['plugins']['get'](_0x20df76),_0x556d2c=this['_revisionTracker']['buildRevisionData']({'revision':_0x5256b0,'from':_0x3d258b,'to':_0x3c3be5});_0x556d2c['authors']=_0x556d2c['authorsIds']['map'](_0x2b106d=>_0x60efe3['getUser'](_0x2b106d)),_0x5256b0['_update'](_0x556d2c);}['_preventResendingRevisionData'](_0x2881b7){const _0x232b7f={};_0x232b7f['id']=_0x2881b7['id'];for(const _0x1ab9c9 of Object['keys'](_0x2881b7))'id'!==_0x1ab9c9&&(_0x232b7f[_0x1ab9c9]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x232b7f['id'],_0x232b7f,!0x0);}async['_fetchMissingUsers'](_0x2cf81c){const _0x30ede7=this['editor']['plugins']['get'](_0x20df76),{connection:_0x457d10}=this['editor']['plugins']['get'](n),_0x53208d=new Set();for(const _0x26964e of _0x2cf81c){for(const _0x401033 of _0x26964e['authorsIds'])_0x233060(_0x401033);_0x26964e['creatorId']&&_0x233060(_0x26964e['creatorId']);}if(0x0===_0x53208d['size'])return;const _0x45381a=await ht['getMany'](_0x457d10,Array['from'](_0x53208d));for(const _0x205a54 of _0x45381a)_0x30ede7['getUser'](_0x205a54['id'])||_0x30ede7['addUser'](_0x205a54);function _0x233060(_0x3c3063){_0x30ede7['getUser'](_0x3c3063)||_0x53208d['add'](_0x3c3063);}}}function st(_0x577cfa){return _0x577cfa['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x577cfa['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x577cfa['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x17b805{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class K extends _0x561787{['_collapseAt'];constructor(_0x2fc3e4,_0x242eee=0x6){super(_0x2fc3e4);const _0x10a42d=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x242eee,this['bind']('isHidden')['to'](this,'usersCount',_0x5dbe5f=>_0x5dbe5f<_0x242eee),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x10a42d['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':_0x10a42d['to']('usersCount',_0x2a5a22=>'+'+(_0x2a5a22-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x561787{['items'];['keystrokes'];constructor(_0x4d681c){super(_0x4d681c);const _0x21c05e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5f3935(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x21c05e['if']('hasPopup'),'aria-expanded':_0x21c05e['to']('isExpanded',_0x25ece7=>this['hasPopup']&&String(_0x25ece7)),'aria-label':_0x21c05e['to']('hasPopup',_0x512870=>R(_0x4d681c,_0x512870?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x21c05e['to']('hasPopup',_0xab87d9=>!!_0xab87d9&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x21c05e['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x21c05e['to'](_0x22b08e=>{const _0x37fbc0=_0x22b08e,_0x56c4d9=document['querySelector']('.ck-presence-list__dropdown-list'),_0x3d9dfd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x56c4d9?.['contains'](_0x37fbc0['relatedTarget'])||_0x3d9dfd?.['contains'](_0x37fbc0['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2ad03c,_0x324dc5,_0x12f9db)=>{this['element']&&(_0x12f9db?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class J extends _0x561787{['counterView'];['inlineListView'];constructor(_0x4c1c5f,_0x11ad05=0x6){super(_0x4c1c5f);const _0x3b7806=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new K(this['locale'],_0x11ad05),this['inlineListView']=new is(_0x4c1c5f),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3cdd38 of this['inlineListView']['items'])_0x3cdd38['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',_0x3b7806['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class Q extends _0x561787{['listWrapperView'];constructor(_0x3f96ea,_0x28bca5){super(_0x3f96ea);const _0x12d38f=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x3f96ea,_0x28bca5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':R(_0x3f96ea,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x12d38f['to'](_0x184177=>{const _0x2573b6=_0x184177,_0x5f002b=document['querySelector']('.ck-presence-list__list'),_0x8a9e57=document['querySelector']('.ck-balloon-panel_with-arrow');_0x5f002b?.['contains'](_0x2573b6['relatedTarget'])||_0x8a9e57?.['contains'](_0x2573b6['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x556b7c{constructor(_0x4ca857,_0x52185e){super(_0x4ca857);const _0x785971=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x52185e?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x785971['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x785971['to']('role'),'aria-label':_0x785971['to']('ariaLabel'),'aria-labelledby':_0x785971['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x118f19['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x28c221=this['element'];_0x28c221&&(this['_isScrollable']=Math['max'](_0x28c221['scrollHeight'],_0x28c221['clientHeight'])>0.8*window['innerHeight']);}}class X extends rt{['userView'];constructor(_0x1da916,_0x627c7a,_0xeaa614){super(_0x1da916);const _0x3fc5c2=this['bindTemplate'];this['userView']=new ct(_0x1da916,_0x627c7a);const _0xd7328a={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x627c7a['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x627c7a['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x627c7a['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xeaa614&&(_0xd7328a['tag']='button',_0xd7328a['on']={'click':_0x3fc5c2['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xd7328a);}['focus'](){this['element']['focus']();}}class Y extends _0x561787{['userView'];['markerView'];constructor(_0x35c53a,_0x18dd86,_0x47c62b){super(_0x35c53a);const _0x50ae52=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x35c53a,_0x18dd86),this['markerView']=new MarkerView(_0x35c53a,_0x18dd86);const _0xbcfec5=new ot(_0x35c53a);_0xbcfec5['template']['tag']='span',_0xbcfec5['text']=_0x18dd86['name'];const _0x519a43={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x50ae52['to']('isFocusable',_0x500e36=>!!_0x500e36&&0x0),'aria-labelledby':_0xbcfec5['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x50ae52['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x50ae52['to']('hasTooltip',_0x130df0=>!_0x130df0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0xbcfec5]};_0x47c62b&&(_0x519a43['tag']='button',_0x519a43['on']={'click':_0x50ae52['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x519a43);}}class MarkerView extends _0x561787{constructor(_0x637e74,_0x1bda55){super(_0x637e74),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1bda55['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const Z={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x102a7b{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51c515){super(_0x51c515),this['context']['config']['define']('presenceList',Z);const _0x22f68f=_0x51c515['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x22f68f)throw new _0x332ad6('presencelist-collapseat-invalid-format',this);if(_0x22f68f<0x1)throw new _0x332ad6('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x8f9c91(),this['balloonPanelView']=new _0x34bd64(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x640ebc of this['_allConnectedUsers'])this['_handleUserAdd'](_0x640ebc);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5768e5,_0x3cf5b0)=>{this['_handleUserAdd'](_0x3cf5b0);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x487ab2,_0x46ddaa)=>{this['_handleUserRemove'](_0x46ddaa);});}['_createView'](){const _0xf4dac0=this['context'],_0x847505=new J(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x44dec8=this['balloonPanelView'];if(!_0x544931(_0xf4dac0['config']['get']('presenceList.container')))throw new _0x332ad6('presencelist-missing-container',this);return _0x847505['counterView']['bind']('usersCount')['to'](this),_0x847505['bind']('isCollapsed')['to'](this,'usersCount',_0x2a9803=>{const {collapseAt:_0x46ba02}=_0xf4dac0['config']['get']('presenceList'),_0x497b18=_0x2a9803>=_0x46ba02;if(_0x497b18&&!_0x847505['inlineListView']['items']['find'](_0x2dbd57=>_0x2dbd57 instanceof K)){const _0x53a1b8=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x53a1b8&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x847505['inlineListView']['items']['add'](_0x847505['counterView']);}return _0x497b18||this['hideDropdown'](),_0x497b18;}),_0x847505['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x588cfe=>{const _0x1fb409=_0xf4dac0['config']['get']('presenceList'),_0x18b0f4=new Y(_0xf4dac0['locale'],_0x588cfe,!!_0x1fb409['onClick']);return _0x18b0f4['bind']('hasTooltip')['to'](_0x847505,'isCollapsed',_0x20127e=>!_0x20127e),_0x18b0f4['bind']('isFocusable')['to'](_0x847505,'isCollapsed',_0x4b419b=>!_0x4b419b),_0x1fb409['onClick']&&this['listenTo'](_0x18b0f4,'execute',()=>{this['view']['isCollapsed']||_0x1fb409['onClick'](_0x588cfe,_0x18b0f4['element']);}),_0x18b0f4;}),this['listenTo'](_0x847505['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x847505['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x847505['inlineListView']['keystrokes']['set']('Enter',(_0x85e4ab,_0x289f0b)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x289f0b());}),_0x847505['render'](),_0x44dec8['render'](),_0x3b1e31({'emitter':_0x847505,'activator':()=>_0x44dec8['isVisible'],'contextElements':[_0x44dec8['element'],_0x847505['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0xf4dac0['config']['get']('presenceList.container')['appendChild'](_0x847505['element']),this['_bodyCollection']=new _0x402400(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x847505;}['_handleUserAdd'](_0x1d65cf){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x1d65cf['isMe'])return;const _0x5c0e59=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x5c0e59-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x14a363=_0x1d65cf['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x1d65cf,_0x14a363);}['_handleUserRemove'](_0x22020c){this['usersCount']--;const {collapseAt:_0x7dde5}=this['context']['config']['get']('presenceList'),_0x29c54f=this['usersCount']>=_0x7dde5;if(this['currentDisplayedUsers']['get'](_0x22020c['id']))this['currentDisplayedUsers']['remove'](_0x22020c['id']);else{if(_0x29c54f&&this['currentDisplayedUsers']['length']+0x1===_0x7dde5-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x29c54f?0x1:0x0)<this['usersCount']){for(const _0xd6e9e8 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0xd6e9e8['id'])&&(this['currentDisplayedUsers']['add'](_0xd6e9e8,Math['min'](this['currentDisplayedUsers']['length']-(_0x29c54f?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x29c54f?0x1:0x0)===_0x7dde5-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x47642d=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new Q(this['context']['locale'],!!_0x47642d['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x14118e}=this['presenceDropdownView'];_0x14118e['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x1a72f7=>{if(!_0x47642d['displayMe']&&_0x1a72f7['isMe'])return null;const _0x15ca49=new X(this['context']['locale'],_0x1a72f7,!!_0x47642d['onClick']);return _0x47642d['onClick']&&this['listenTo'](_0x15ca49,'execute',()=>{_0x47642d['onClick'](_0x1a72f7,_0x15ca49['element']);}),_0x15ca49;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x14118e['focus'](),_0x14118e['checkIfScrollable']();const _0x3151ae=(_0x28311b,_0x7301d9)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x7301d9();};_0x14118e['keystrokes']['set']('Esc',_0x3151ae),_0x14118e['keystrokes']['set']('Shift+Tab',_0x3151ae),_0x14118e['keystrokes']['set']('Tab',(_0x1a5198,_0x753df4)=>{!function(_0x2263c1){const _0x325a77=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x17f786=>_0x17f786+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x8eeffe=[...document['body']['querySelectorAll'](_0x325a77)]['filter'](_0x418849=>_0x418849===document['activeElement']||_0x418849['offsetWidth']+_0x418849['offsetHeight']>0x0)['sort']((_0x36f0fd,_0x5c034a)=>(_0x36f0fd['tabIndex']||0x0)-(_0x5c034a['tabIndex']||0x0)),_0x5c835f=_0x8eeffe['indexOf'](_0x2263c1),_0x48b876=_0x8eeffe[(_0x5c835f+0x1)%_0x8eeffe['length']];_0x48b876&&_0x48b876['focus']();}(this['view']['element']),this['hideDropdown'](),_0x753df4();}),_0x14118e['focusTracker']['add'](this['view']['element']),_0x14118e['focusTracker']['on']('change:isFocused',(_0x258f05,_0x5b8b08,_0x4b9b21)=>{_0x4b9b21||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 _0x102a7b{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':_0x559048=>0x1!=_0x559048}};
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':_0x48fe99=>0x1!=_0x48fe99}};