@ckeditor/ckeditor5-real-time-collaboration 46.0.3 → 46.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +15 -15
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x42e0c3,Plugin as _0x56d523,PendingActions as _0x10f688,Context as _0x5380b3}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x2f8b62,CKEditorError as _0x473271,Collection as _0x304907,global as _0x5948fe,version as nt,uid as _0x42f7ba,KeystrokeHandler as _0x58c74d}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3c93d3,View as _0x59972a,ListView as _0x37a0d4,ListItemView as et,LabelView as it,BalloonPanelView as _0x415734,clickOutsideHandler as _0x1679a7,BodyCollection as _0x474ae1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x566f0a,History as _0x30354d,NoOperation as _0x3d3dc0,InsertOperation as _0x15971e,MarkerOperation as _0x3de259,RootAttributeOperation as _0x2f4256,transformOperationSets as _0x597b15,OperationFactory as _0x3a9837}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0xd27bcb,CollaborativeEditingService as _0x413c4a,User as ct,CommentsService as _0x9b7287,TrackChangesService as tt,RevisionHistoryService as _0x4745a8,EditorService as _0x1ca6ba}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x58220,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x32d1c7}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3fffd7}from'es-toolkit/compat';class n extends _0x42e0c3{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3c93d3];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x880b6){super(_0x880b6),this['set']('state',_0xd27bcb['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2f8b62())();}['init'](){const _0x4c2c7e=this['context'],_0x37941c=_0x4c2c7e['plugins']['get']('CloudServices'),_0x50b94b=_0x4c2c7e['plugins']['get'](_0x3c93d3);if(!_0x37941c['token'])throw new _0x473271('websocketgateway-missing-token',this);if(!_0x37941c['webSocketUrl'])throw new _0x473271('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'](_0x37941c['token'],_0x37941c['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5849f6=>{if(this['connection']=_0x5849f6,this['bind']('state')['to'](_0x5849f6,'state',this,'_isBrowserOffline',(_0x677b4c,_0x6366d8)=>('connected'!==_0x677b4c&&(this['_shouldPluginsReconnect']=!0x0),_0x6366d8||_0x677b4c!==_0xd27bcb['CONNECTED']?_0xd27bcb['DISCONNECTED']:this['state']==_0xd27bcb['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0xd27bcb['CONNECTING']):_0xd27bcb['CONNECTED'])),this['connection']['on']('error',(_0x1c34ee,_0x404d91)=>{if('limitExceeded'!==_0x404d91['code'])throw console['error'](_0x404d91),new _0x473271('cloudservices-init',null,{'originalError':_0x404d91});_0x50b94b['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'});}),!_0x5849f6['me'])return new Promise(_0x4040a5=>_0x5849f6['on']('change:me',_0x4040a5));})['catch'](_0x3f6a89=>{throw console['error'](_0x3f6a89),new _0x473271('cloudservices-init',null,{'originalError':_0x3f6a89});});}['addToReconnectionStack'](_0x8187fc){if('function'!=typeof _0x8187fc['reconnect'])throw new _0x473271('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x8187fc))throw new _0x473271('websocketgateway-plugin-already-registered',this,{'name':_0x8187fc['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x8187fc);}['removeFromReconnectionStack'](_0x7abf79){this['_reconnectionStack']['delete'](_0x7abf79);}['isInReconnectionStack'](_0x5197ae){return this['_reconnectionStack']['has'](_0x5197ae);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x44ff1d=>_0x44ff1d['reconnect']())))['then'](()=>this['state']=_0xd27bcb['CONNECTED'])['catch'](_0x5bd4f6=>{throw console['error'](_0x5bd4f6),new _0x473271('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0xd27bcb['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x42e0c3{['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,_0x58220];}constructor(_0x5d4b0e){super(_0x5d4b0e),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x304907(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x58220);}['init'](){const _0x5f531a=this['context']['plugins']['get'](n);this['listenTo'](_0x5f531a,'change:state',(_0x5c3c62,_0x2a4765,_0x209529)=>{if('connected'!==_0x209529)this['channelSessions']['forEach'](_0x5e0a49=>_0x5e0a49['clear']()),this['channelConnectedUsers']['forEach'](_0x4df192=>_0x4df192['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x13952a,_0x4b9af5]of this['_registeredSessions'])for(const _0x441a44 of _0x4b9af5)this['_handleSessionAdd'](_0x13952a,_0x441a44);}}),this['_createUser'](_0x5f531a['connection']['me'],!0x0);}['register'](_0x512d94,_0xc3718e){if(this['_registeredSessions']['has'](_0x512d94))throw new _0x473271('sessions-register-already-registered',null,{'channelId':_0x512d94});this['_registeredSessions']['set'](_0x512d94,_0xc3718e),this['channelSessions']['set'](_0x512d94,new _0x304907()),this['channelConnectedUsers']['set'](_0x512d94,new _0x304907()),this['listenTo'](_0xc3718e,'add',(_0x1ae5c6,_0x4e4485)=>this['_handleSessionAdd'](_0x512d94,_0x4e4485)),this['listenTo'](_0xc3718e,'remove',(_0x3c82c8,_0x412ad3)=>this['_handleSessionRemove'](_0x512d94,_0x412ad3));for(const _0x5316b4 of _0xc3718e)this['_handleSessionAdd'](_0x512d94,_0x5316b4);}['unregister'](_0x8d7839){if(!this['_registeredSessions']['has'](_0x8d7839))throw new _0x473271('sessions-unregister-not-exist',null,{'channelId':_0x8d7839});const _0x7eeb17=this['_registeredSessions']['get'](_0x8d7839);this['stopListening'](_0x7eeb17);for(const _0x3be0d4 of _0x7eeb17)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x8d7839,_0x3be0d4);this['_registeredSessions']['delete'](_0x8d7839),this['channelSessions']['delete'](_0x8d7839),this['channelConnectedUsers']['delete'](_0x8d7839);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x14eeb5){for(const _0x7e616 of this['channelSessions']['values']())for(const _0xe88fb4 of _0x7e616)if(_0xe88fb4['id']===_0x14eeb5)return _0xe88fb4['user'];}['getUserSessions'](_0x41556c,_0x235edd){const _0x4d252a=_0x235edd?[this['channelSessions']['get'](_0x235edd)]:this['channelSessions']['values'](),_0x83f74=new Set();for(const _0x1664b0 of _0x4d252a)for(const _0x507f72 of _0x1664b0)_0x507f72['user']['id']===_0x41556c['id']&&_0x83f74['add'](_0x507f72['id']);return _0x83f74;}['getUserRole'](_0x3cdc52){for(const _0x532397 of this['channelSessions']['values']())for(const _0x1bba59 of _0x532397)if(_0x1bba59['user']===_0x3cdc52)return _0x1bba59['role'];}['_handleSessionAdd'](_0x39676d,_0x4db0ec){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x177d2=_0x4db0ec['user'],_0x95de49=this['_users']['getUser'](_0x177d2['id'])||this['_createUser'](_0x177d2),_0x4584bd=Object['assign']({},_0x4db0ec,{'user':_0x95de49});this['channelSessions']['get'](_0x39676d)['add'](_0x4584bd);const _0x1c29be=this['channelConnectedUsers']['get'](_0x39676d);_0x1c29be['has'](_0x95de49['id'])||_0x1c29be['add'](_0x95de49),this['allConnectedUsers']['has'](_0x95de49['id'])||this['allConnectedUsers']['add'](_0x95de49,_0x95de49['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x39676d,{'channelId':_0x39676d,'session':_0x4584bd});}['_handleSessionRemove'](_0x18d09c,_0x360868){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x558227=this['channelConnectedUsers']['get'](_0x18d09c),_0xef127b=_0x360868['user'];_0xef127b['id']&&(this['channelSessions']['get'](_0x18d09c)['remove'](_0x360868['id']),_0x558227['has'](_0xef127b['id'])&&!this['getUserSessions'](_0xef127b,_0x18d09c)['size']&&_0x558227['remove'](_0xef127b['id']),this['allConnectedUsers']['get'](_0xef127b['id'])&&!this['getUserSessions'](_0xef127b)['size']&&this['allConnectedUsers']['remove'](_0xef127b['id']));}['_createUser'](_0x5adda1,_0x5b191e){const _0x431788=this['_users']['addUser'](_0x5adda1);return _0x5b191e&&this['_users']['defineMe'](_0x5adda1['id']),_0x431788['orderNumber']=this['_uniqueUsersCount']++,_0x431788;}}class G extends _0x56d523{['_domEmitter']=new(_0x2f8b62())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x24ae05=this['editor'],_0x116fd4=_0x24ae05['plugins']['get'](i);_0x24ae05['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x1dab7e,{writer:_0x2e9c8c})=>function(_0x5929df,_0x334a53,_0x53b4a9,_0x375a95){const _0xb83443=_0x5929df['markerName']['split'](':')[0x2],_0x17758a=_0x53b4a9['getUserBySessionId'](_0xb83443);if(!_0x17758a||_0xb83443===_0x53b4a9['mySessionId'])return;if(!_0x375a95['model']['schema']['checkChild'](_0x5929df['markerRange']['start'],'$text'))return;const _0x8612ad={'class':'ck-user__marker\x20'+_0x17758a['color']['getMarkerClass'](),'data-name':_0x17758a['name'],'data-session-id':_0xb83443},_0x56927d=_0x375a95['model']['markers']['get'](_0x5929df['markerName']),_0x4db9b9=_0x56927d['getStart'](),_0x2fe364=_0x4db9b9['nodeAfter'],_0x343966=_0x375a95['model']['schema'];if(_0x2fe364&&_0x343966['isObject'](_0x2fe364)&&_0x343966['isInline'](_0x2fe364)&&!_0x375a95['model']['markers']['get']('user:range:'+_0xb83443)['getRange']()['isCollapsed'])return;const _0x4d4638=_0x4db9b9['parent'];return _0x375a95['model']['schema']['isLimit'](_0x4d4638)&&!_0x375a95['model']['hasContent'](_0x4d4638)&&(_0x8612ad['contenteditable']=!0x1),function(_0x2984bc,_0x1fa767,_0xb51850){const _0x55e9cd=_0x2984bc['createUIElement']('span',_0x1fa767);return _0x2984bc['setCustomProperty']('userPositionMarker',!0x0,_0x55e9cd),_0x55e9cd['render']=function(_0x2f18da){const _0x35b3a2=this['toDomElement'](_0x2f18da),_0x33289f=document['createElement']('span');return _0x33289f['classList']['add']('ck-user__marker-tooltip'),_0x33289f['setAttribute']('contenteditable','false'),_0x33289f['setAttribute']('spellcheck','false'),_0x33289f['textContent']=_0xb51850['name'],_0x35b3a2['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x33289f['outerHTML']+'⁠',_0x35b3a2['addEventListener']('mouseenter',()=>{_0x35b3a2['classList']['add']('ck-user__marker_hovered');}),_0x35b3a2['addEventListener']('mouseleave',()=>{_0x35b3a2['classList']['remove']('ck-user__marker_hovered');}),_0x35b3a2;},_0x55e9cd['isSimilar']=function(_0x5f1e5b){return!(!this['getCustomProperty']('userPositionMarker')||!_0x5f1e5b['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x5f1e5b['getAttribute']('data-session-id'));},_0x55e9cd;}(_0x334a53,_0x8612ad,_0x17758a);}(_0x1dab7e,_0x2e9c8c,_0x116fd4,_0x24ae05)}),_0x24ae05['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x15c266=>function(_0x498df8,_0x1769cc){const _0x4f5f79=_0x498df8['markerName']['split'](':')[0x2];if(_0x4f5f79===_0x1769cc['mySessionId'])return null;const _0x5b990e=_0x1769cc['getUserBySessionId'](_0x4f5f79);if(!_0x5b990e)return{'id':_0x4f5f79,'classes':[]};return{'id':_0x4f5f79,'classes':['ck-user__selection',_0x5b990e['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x4f5f79},'priority':0x7d0+_0x5b990e['orderNumber']};}(_0x15c266,_0x116fd4)}),function(_0x1f5a0c){const _0x347e86=_0x1f5a0c['model'],_0x408f6c=new Map(),_0x2883c7=_0x1f5a0c['plugins']['get'](i);_0x347e86['markers']['on']('update:user:range',(_0x217945,_0x40d107,_0x46831d,_0x415c4a)=>{if(!_0x415c4a&&_0x408f6c['get'](_0x40d107['name']))return _0x408f6c['get'](_0x40d107['name'])['detach'](),void _0x408f6c['delete'](_0x40d107['name']);const _0x22cdd2=_0x40d107['name']['split'](':')[0x2];if(_0x22cdd2===_0x2883c7['mySessionId'])return;const _0x4cfedb='user:position:'+_0x22cdd2;_0x347e86['markers']['has'](_0x4cfedb)&&_0x1f5a0c['editing']['reconvertMarker'](_0x4cfedb),_0x40d107['on']('change:range',(_0x759f9b,_0x2cbc2f,_0x2e2a78)=>{if('$graveyard'!=_0x2cbc2f['root']['rootName']&&'$graveyard'==_0x40d107['getRange']()['root']['rootName']&&!_0x408f6c['has'](_0x40d107['name'])){const _0x264d29=_0x347e86['schema']['getNearestSelectionRange'](_0x2e2a78['deletionPosition']);if(_0x264d29){const _0x47c8b0=_0x566f0a['fromRange'](_0x264d29);_0x408f6c['set'](_0x40d107['name'],_0x47c8b0),_0x47c8b0['on']('change:range',(_0x3fb6b8,_0x32d6a1,_0x15a4b7)=>{if('$graveyard'==_0x47c8b0['root']['rootName']){const _0x3c160d=_0x347e86['schema']['getNearestSelectionRange'](_0x15a4b7['deletionPosition']);_0x3c160d?(_0x47c8b0['start']=_0x3c160d['start'],_0x47c8b0['end']=_0x3c160d['end']):(_0x408f6c['delete'](_0x40d107['name']),_0x47c8b0['detach']());}});}}});}),_0x347e86['document']['on']('change',()=>{_0x408f6c['size']>0x0&&_0x347e86['enqueueChange']({'isUndoable':!0x1},_0x59de2e=>{for(const [_0x2ce1d9,_0x27f311]of _0x408f6c)'$graveyard'==_0x347e86['markers']['get'](_0x2ce1d9)['getRange']()['root']['rootName']&&(te(_0x2ce1d9['split'](':')[0x2],_0x27f311['toRange'](),_0x347e86,_0x59de2e),_0x27f311['detach']());_0x408f6c['clear']();});});}(_0x24ae05),this['_domEmitter']['listenTo'](_0x5948fe['document'],'keydown',(_0x11d135,{key:_0x36d55b})=>{'Escape'===_0x36d55b&&function(_0x5a5164){_0x5a5164['editing']['view']['change'](_0x3f4ca1=>{for(const _0x2fc459 of _0x5a5164['model']['markers']){if(!_0x2fc459['name']['startsWith']('user:position'))continue;const _0x57e06f=_0x5a5164['editing']['mapper']['markerNameToElements'](_0x2fc459['name']);if(_0x57e06f){for(const _0x5c58d6 of _0x57e06f)_0x3f4ca1['removeClass']('ck-user__marker_hovered',_0x5c58d6);}}});}(_0x24ae05);},{'useCapture':!0x0});}['afterInit'](){const _0x5a5b64=this['editor'],_0x2c2d1e=_0x5a5b64['commands']['get']('undo');_0x2c2d1e&&_0x5a5b64['model']['on']('applyOperation',(_0x1a32d2,_0x2d221a)=>{const _0x52de00=_0x2d221a[0x0];if(!_0x52de00['isDocumentOperation'])return;if('marker'!=_0x52de00['type']||!_0x52de00['name']['startsWith']('user:'))return;const _0xd73179=_0x52de00['batch'];_0x2c2d1e['_createdBatches']['has'](_0xd73179)&&(_0x52de00['newRange']=_0x52de00['oldRange']?_0x5a5b64['model']['createRange'](_0x52de00['oldRange']['start'],_0x52de00['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x5216a9=this['editor'],_0x4cda26=_0x5216a9['model']['document'],_0x3d9a53=_0x5216a9['plugins']['get'](i);_0x5216a9['model']['enqueueChange']({'isUndoable':!0x1},_0x6950e1=>{const _0x3147fd='user:range:'+_0x3d9a53['mySessionId'],_0x345681='user:position:'+_0x3d9a53['mySessionId'],_0x4f869a=_0x5216a9['model']['markers']['has'](_0x3147fd);_0x5216a9['editing']['view']['hasDomSelection']?te(_0x3d9a53['mySessionId'],_0x4cda26['selection']['getFirstRange'](),_0x5216a9['model'],_0x6950e1):_0x4f869a&&(_0x6950e1['removeMarker'](_0x3147fd),_0x6950e1['removeMarker'](_0x345681));});}}function te(_0x320456,_0x306b55,_0x3bdfcd,_0x4f32e9){const _0x28add3='user:range:'+_0x320456,_0x1e0023='user:position:'+_0x320456,_0x57fea5=_0x306b55['getContainedElement']();let _0x21d2f4=_0x306b55['start'];if(_0x57fea5&&_0x57fea5['is']('element','tableCell')){const _0x2fb469=function(_0x45317b,_0x49474c){for(const _0x477b55 of _0x45317b['getPositions']())if(_0x49474c['schema']['checkChild'](_0x477b55,'$text'))return _0x477b55;}(_0x306b55,_0x3bdfcd);_0x2fb469&&(_0x21d2f4=_0x2fb469,_0x306b55=_0x4f32e9['createRange'](_0x21d2f4));}const _0x55eb60=_0x4f32e9['createRange'](_0x21d2f4);_0x3bdfcd['markers']['has'](_0x28add3)?(_0x4f32e9['updateMarker'](_0x28add3,{'range':_0x306b55}),_0x4f32e9['updateMarker'](_0x1e0023,{'range':_0x55eb60})):(_0x4f32e9['addMarker'](_0x28add3,{'range':_0x306b55,'usingOperation':!0x0}),_0x4f32e9['addMarker'](_0x1e0023,{'range':_0x55eb60,'usingOperation':!0x0}));}function $(_0x239580,_0x51e55,_0x43fc67){const _0x154fe8=_0x239580['t'],t=_0x239580['t'];switch(_0x51e55){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 _0x154fe8({'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'},_0x43fc67);default:return'';}}let Q=0x1;class l extends _0x56d523{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x413c4a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x10f688,_0x58220,_0x3c93d3];}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 _0x2f6d95=this['serverHistory']['getOperations']();for(let _0x1b186e=_0x2f6d95['length']-0x1;_0x1b186e>=0x0;_0x1b186e--){const _0x3f94fc=_0x2f6d95[_0x1b186e];if(!this['_disconnectionOperations']['has'](_0x3f94fc))return _0x3f94fc['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3f6d40){if(super(_0x3f6d40),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x30354d(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x473271('collaboration-missing-channelid',this);const _0x11955e=_0x3f6d40['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x11955e,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x32d1c7(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new Z(this['_disconnectionOperations']);}['init'](){const _0x9d29f4=this['editor'],_0x4376d4=_0x9d29f4['plugins']['get'](_0x58220),_0x1ee38c=_0x9d29f4['plugins']['get'](n);this['listenTo'](_0x4376d4,'getOperationAuthor',(_0x3b7a5f,_0x157b16)=>{const _0x4be1c7=_0x157b16[0x0];_0x4be1c7['_authorId']&&(_0x3b7a5f['return']=_0x4376d4['getUser'](_0x4be1c7['_authorId']),_0x3b7a5f['stop']()),null===_0x4be1c7['_authorId']&&(_0x3b7a5f['return']=null,_0x3b7a5f['stop']());},{'priority':'high'}),this['listenTo'](_0x9d29f4['model']['document']['selection'],'change:range',(_0x37a35c,_0xba7a6e)=>{_0xba7a6e['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x9d29f4['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x9d29f4['model']['on']('applyOperation',(_0x1b9c37,_0x37bf63)=>{const _0x14965e=_0x37bf63[0x0];_0x14965e['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x14965e),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x1ee38c,'state',this,'_hasSynchronizationProblem',(_0x6bec2,_0x298b57)=>'connected'===_0x6bec2&&!_0x298b57),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x9d29f4['disableReadOnlyMode']('rtc-offline'):_0x9d29f4['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x9d29f4['disableReadOnlyMode']('rtc-offline'):_0x9d29f4['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x50a44a=this['editor']['plugins']['get'](i),_0x122db3=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x50a44a['unregister'](this['_channelId']);const _0x4b1674=await this['_service']['reconnect'](_0x122db3['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4b1674)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3d557d=await this['_service']['getConnectedSessions']();_0x50a44a['register'](this['_channelId'],_0x3d557d),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x34b4fe){if(function(_0x4419c7){return'404'===_0x4419c7['code'];}(_0x34b4fe)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3389aa){return'409'===_0x3389aa['code'];}(_0x34b4fe)){const _0x47c3fa=$(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'](_0x47c3fa);}else{if(!(_0x34b4fe instanceof X))throw _0x34b4fe;this['_handleReconnectionError']();}}}}['destroy'](){const _0x54917b=this['editor']['plugins']['get'](n),_0x107df9=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x107df9['channelSessions']['has'](this['_channelId'])&&_0x107df9['unregister'](this['_channelId']),_0x54917b['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x185c1f){if(this['sessionId']!==_0x185c1f['sessionId']&&this['_lastSyncedOperationId']!==_0x185c1f['lastOperationId'])throw new X();return this['sessionId']=_0x185c1f['sessionId'],this['_handleServerResponse']([],{..._0x185c1f,'wereChangesApplied':!0x1,'data':_0x185c1f['data']},'reconnect');}async['_connectService'](_0x214545,_0x3780d8=!0x1){const {connection:_0x4769e4}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x4769e4,this['_channelId'])['then'](_0x2cd6cb=>this['_initSessionsHandling'](_0x2cd6cb))['catch'](_0x2debe2=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x2debe2);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x7c1bb5,_0x52da0d)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x52da0d);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x2cfaa2=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x214545);this['_isPendingUpdate']=!0x0;const _0xae4b2b=await this['_service']['connect'](_0x4769e4,this['_compressOperations'](_0x214545),_0x2cfaa2);if(this['sessionId']=_0xae4b2b['sessionId'],_0x3780d8){if(!_0xae4b2b['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xae4b2b['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x214545,_0xae4b2b,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xae4b2b,_0x214545);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3b9aab=this['editor']['plugins']['get'](i),_0x307d94=this['editor']['plugins']['get'](G),_0x330dfb=_0x3b9aab['channelSessions']['get'](this['_channelId']);_0x330dfb&&_0x330dfb['length']>0x1?_0x307d94['createUserMarkerOperations']():this['listenTo'](_0x3b9aab,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3b9aab['channelSessions']['get'](this['_channelId'])['length']&&_0x307d94['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x26ae4d,_0x47fba0,_0x8506b1,_0x2af30f){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x47fba0){const _0x486f33=this['_decompressOperations'](_0x8506b1,_0x2af30f);await this['_fetchMissingUsers'](_0x486f33),this['_handleExternalOperations'](_0x486f33,_0x47fba0,_0x8506b1['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x14d2d5}=this['editor'];let _0x5123a1;try{_0x5123a1=await this['_service']['getDocumentDetails']();}catch{const _0xfae429=$(_0x14d2d5,'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'](_0xfae429);}const _0x211ff4=_0x5123a1['currentDocumentSession']||_0x5123a1['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x211ff4['lastOperationId']){const _0x2a968c=$(_0x14d2d5,'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'](_0x2a968c);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x1d2591){const _0x551770=this['editor']['plugins']['get'](i);this['listenTo'](_0x551770,'sessionAdd:'+this['_channelId'],(_0x276bca,{session:_0x19dfb0})=>{if(_0x19dfb0['id']===_0x551770['mySessionId']){_0x276bca['off']();const _0x16efda=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x40d1da=_0x19dfb0['permissions'];_0x16efda&&_0x16efda['isEnabled']&&(_0x40d1da=_0x40d1da['filter'](_0x1e93bc=>'document:write'!==_0x1e93bc)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x40d1da,this['_channelId']);}}),_0x551770['register'](this['_channelId'],_0x1d2591);}['_initThrowingOnDataSet'](){const _0x2de9cc=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x71bbb)=>{if(!_0x71bbb[_0x71bbb['length']-0x1]['suppressErrorInCollaboration'])throw new _0x473271('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2de9cc['apply'](this['editor']['data'],_0x71bbb);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2f76e6,[_0x476848])=>{if(this['_document']['version'])throw new _0x473271('realtimecollaborationclient-init-document-already-initialized',this);_0x2f76e6['stop'](),this['_setPendingAction']();const _0x40b269=this['editor']['config']['get']('rootsAttributes'),_0x1bb6ac=this['_getOperationsFromInitData'](_0x476848,_0x40b269);0x0==_0x1bb6ac['length']&&_0x1bb6ac['push'](new _0x3d3dc0(0x0)),_0x2f76e6['return']=this['_connectService'](_0x1bb6ac)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x55a93a=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x55a93a))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x365818,[_0x119044,_0x779e5d])=>{_0x365818['stop']();const _0x24a2f5=this['editor']['model']['document']['getRoot'](_0x119044);if(!this['_knownRootNames']['has'](_0x119044)){const _0x19264a=_0x779e5d&&_0x779e5d['data']?_0x779e5d['data']:'',_0x166e00=_0x779e5d&&_0x779e5d['attributes']?_0x779e5d['attributes']:{};await this['_loadRoot'](_0x119044,_0x19264a,_0x166e00);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x24a2f5['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x24a2f5);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x27a321){const _0x73c2fb=this['editor']['plugins']['get'](_0x58220),{connection:_0x425b9e}=this['editor']['plugins']['get'](n),_0x4ee309=new Set();for(const _0x316e38 of _0x27a321){const _0x2ead73=_0x316e38['_authorId'];_0x2ead73&&!_0x73c2fb['getUser'](_0x2ead73)&&_0x4ee309['add'](_0x2ead73);}if(0x0===_0x4ee309['size'])return;const _0x5dae58=await ct['getMany'](_0x425b9e,Array['from'](_0x4ee309));for(const _0x466d1e of _0x5dae58)_0x73c2fb['getUser'](_0x466d1e['id'])||_0x73c2fb['addUser'](_0x466d1e);}['_getOperationsFromInitData'](_0x271b46,_0x44d1cb={}){const _0x191a04=this['editor']['model'],_0x12bceb=[];let _0x3dc2a3=0x0;const _0x40cafc='string'==typeof _0x271b46?{'main':_0x271b46}:_0x271b46;for(const _0x35cddf of Object['keys'](_0x40cafc)){if(!this['_document']['roots']['has'](_0x35cddf))throw new _0x473271('realtimecollaborationclient-init-non-existent-root',this);const _0x2bbb88=this['editor']['data']['parse'](_0x40cafc[_0x35cddf]),_0x1e681e=this['_document']['getRoot'](_0x35cddf),_0x3d9203=new _0x15971e(_0x191a04['createPositionAt'](_0x1e681e,0x0),_0x2bbb88,_0x3dc2a3++);_0x12bceb['push'](_0x3d9203);for(const [_0x519cf8,_0x4f4ea8]of _0x2bbb88['markers']){const _0x5167a0=_0x191a04['createRange'](_0x191a04['createPositionFromPath'](_0x1e681e,_0x4f4ea8['start']['path']['slice']()),_0x191a04['createPositionFromPath'](_0x1e681e,_0x4f4ea8['end']['path']['slice']())),_0x1a58bb=new _0x3de259(_0x519cf8,null,_0x5167a0,_0x191a04['markers'],!0x0,_0x3dc2a3++);_0x12bceb['push'](_0x1a58bb);}}if(_0x44d1cb)for(const [_0x1c5971,_0x4627c8]of Object['entries'](_0x44d1cb)){const _0x154b82=_0x191a04['document']['getRoot'](_0x1c5971);if(!_0x154b82)throw new _0x473271('multi-root-editor-root-attributes-no-root',null);for(const [_0x4c4191,_0x28ac80]of Object['entries'](_0x4627c8))if(null!==_0x28ac80){const _0x5f407a=new _0x2f4256(_0x154b82,_0x4c4191,null,_0x28ac80,_0x3dc2a3++);_0x12bceb['push'](_0x5f407a);}}return _0x12bceb;}async['_loadRoot'](_0x2f4284,_0x4b3d94,_0x18eaa5){this['_getOperationsFromInitData']({[_0x2f4284]:_0x4b3d94},{[_0x2f4284]:_0x18eaa5})['forEach']((_0x46c149,_0x1336c9)=>{_0x46c149['baseVersion']=this['_document']['version']+_0x1336c9,_0x46c149['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x46c149);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x16a0db,_0xc76307){let _0x117b22;this['_offset']=_0x16a0db['offset'];const _0x45f518=_0x16a0db['wereChangesApplied']&&!_0x16a0db['initData'],_0x3923de=_0x45f518?0x0:_0x16a0db['data']['baseVersion'];if(_0xc76307['forEach'](_0x1021a3=>{_0x1021a3['_isInit']=!0x0,_0x1021a3['createdAt']=_0x16a0db['sessionCreatedAt'],_0x1021a3['_authorId']=null;}),_0x45f518)_0x117b22=_0xc76307,this['_applyOperationsSet'](_0x117b22,_0x45f518);else{if(_0x16a0db['initData']){const _0x5a95ff=this['_getOperationsFromInitData'](_0x16a0db['initData']);this['_document']['history']['version']=-_0x5a95ff['length'],_0x5a95ff['forEach'](_0x4a60e8=>{_0x4a60e8['baseVersion']-=_0x5a95ff['length'],_0x4a60e8['createdAt']=_0x16a0db['sessionCreatedAt'],_0x4a60e8['_isInit']=!0x0,_0x4a60e8['_authorId']=null;}),this['_applyOperationsSet'](_0x5a95ff,!0x0),this['serverHistory']['version']=-_0x5a95ff['length']+this['_offset'],this['_updateServerHistory'](_0x5a95ff);}this['_document']['history']['version']=_0x3923de,_0x117b22=this['_decompressOperations'](_0x16a0db['data'],_0x16a0db['metadata']),await this['_fetchMissingUsers'](_0x117b22),this['_applyOperationsSet'](_0x117b22,_0x45f518);}_0x16a0db['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x117b22,_0x16a0db['lastOperationId']),this['_lastSyncedOperationId']=_0x16a0db['lastOperationId']),this['serverHistory']['version']=_0x3923de+this['_offset'],this['_updateServerHistory'](_0x117b22),_0xc76307['filter'](_0x53b38b=>{const _0x10f402=this['_getAffectedRoot'](_0x53b38b);return _0x10f402&&!this['_knownRootNames']['has'](_0x10f402);})['forEach']((_0x924bbc,_0xf1bcfb)=>{_0x924bbc['baseVersion']=this['_document']['version']+_0xf1bcfb,this['_saveOperationInBuffer'](_0x924bbc);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x27c341,_0x14f550){const _0x35cf2e=_0x14f550&&_0x14f550['message'];if(_0x35cf2e&&_0x35cf2e['startsWith']('realtimecollaborationclient'))throw _0x14f550;const _0x32bc53=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x32bc53['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x473271(_0x27c341,this['editor'],_0x35cf2e?{'originalError':_0x35cf2e}:void 0x0);}['_saveOperationInBuffer'](_0x579bfd){this['_knownOperations']['has'](_0x579bfd)||(this['_knownOperations']['add'](_0x579bfd),this['_bufferedOperations']['push'](_0x579bfd),this['_pendingAction']||'marker'==_0x579bfd['type']&&!_0x579bfd['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x24c9db=!0x1){!_0x24c9db&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x23a3fd=>{_0x23a3fd&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x47d502=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3f0b37){return _0x3f0b37['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3f0b37['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3f0b37['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x47d502)||this['_crash'](_0x47d502['message'],_0x47d502);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5364af=>{this['on']('change:_isPendingUpdate',()=>{_0x5364af();});});}async['_sendBufferedOperations'](){const _0xe2a662=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0xe2a662['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5ecc94=[...this['_bufferedOperations']];for(const _0x4a49cf of _0x5ecc94)_0x4a49cf['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4a49cf);const _0x1a2287=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5ecc94),_0x534fde=Q++,_0x28d0de=this['_compressOperations'](_0x5ecc94),_0x89fd21=await this['_service']['sendOperations'](_0x28d0de,_0x28d0de['baseVersion'],_0x1a2287);try{return await this['_handleServerResponse'](_0x5ecc94,_0x89fd21,_0x534fde);}catch(_0x58ec34){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x58ec34);}}async['_handleServerResponse'](_0x4c6c76,_0x297eb0,_0x51ac5a){if('error'in _0x297eb0)throw _0x297eb0['error'];let _0x45e69f=!0x1;if(_0x297eb0['wereChangesApplied']){_0x297eb0['lastOperationId']&&(this['_lastSyncedOperationId']=_0x297eb0['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4545ae=>!_0x4c6c76['includes'](_0x4545ae));for(const _0x43d63b of _0x4c6c76)_0x43d63b['createdAt']='lastOperationAcceptedAt'in _0x297eb0&&_0x297eb0['lastOperationAcceptedAt']||void 0x0;Y(_0x4c6c76,_0x297eb0['version']-_0x4c6c76['length']),this['_updateServerHistory'](_0x4c6c76);const _0xb5d03a=_0x4c6c76['filter'](_0x54f1cb=>{if(!_0x54f1cb['_isInit'])return!0x1;const _0x3aa818=this['_getAffectedRoot'](_0x54f1cb);return _0x3aa818&&!this['_knownRootNames']['has'](_0x3aa818);});Y(_0xb5d03a,this['_document']['version']),this['_applyOperationsSet'](_0xb5d03a),_0x45e69f=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x103f29=this['_decompressOperations'](_0x297eb0['data'],_0x297eb0['metadata'])['filter'](_0x1f514c=>_0x1f514c['baseVersion']>=this['_lastServerVersion']);_0x103f29['forEach'](_0x56f7cd=>this['_addKnownRoot'](_0x56f7cd)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4ef05f=>!_0x4ef05f['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4ef05f))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x103f29),_0x45e69f=this['_handleExternalOperations'](_0x103f29,_0x297eb0['version'],_0x297eb0['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x45e69f?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5d27e8,_0x289378,_0x4e8b1e){try{const _0x12b45b={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3c9a0f,operationsB:_0x5bb8d3,originalOperations:_0x4841d4}=_0x597b15(_0x5d27e8,this['_bufferedOperations'],_0x12b45b);Y(_0x3c9a0f,this['_document']['version']),Y(_0x5bb8d3,_0x289378);for(const _0x3aa4a2 of _0x3c9a0f){const _0x1691cf=_0x4841d4['get'](_0x3aa4a2);_0x3aa4a2['_authorId']=_0x1691cf?_0x1691cf['_authorId']:null;}_0x4e8b1e&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5d27e8,_0x4e8b1e),this['_lastSyncedOperationId']=_0x4e8b1e),this['_bufferedOperations']=[..._0x5bb8d3],this['_applyOperationsSet'](_0x3c9a0f),this['_updateServerHistory'](_0x5d27e8);}catch(_0x566e6a){return console['error'](_0x566e6a),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5254a1,_0x92648e=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5a851a=>{for(const _0x198d2c of _0x5254a1)this['_knownOperations']['add'](_0x198d2c),this['_addKnownRoot'](_0x198d2c),_0x5a851a['batch']['addOperation'](_0x198d2c),this['editor']['model']['applyOperation'](_0x198d2c);});}['_addKnownRoot'](_0x5a8701){const _0x10948a=this['_getAffectedRoot'](_0x5a8701);_0x10948a&&this['_knownRootNames']['add'](_0x10948a);}['_getAffectedRoot'](_0xc0d4bf){let _0x498cac,_0x12b61d;switch(_0xc0d4bf['type']){case'insert':_0x498cac=_0xc0d4bf['position']['root'];break;case'marker':if(_0x12b61d=_0xc0d4bf['newRange'],!_0x12b61d)return null;_0x498cac=_0x12b61d['root'];break;case'addRootAttribute':_0x498cac=_0xc0d4bf['root'];break;case'addRoot':_0x498cac=_0xc0d4bf['affectedSelectable'];break;case'move':_0x498cac=_0xc0d4bf['targetPosition']['root'];break;default:return null;}return _0x498cac['rootName'];}['_updateServerHistory'](_0x56d632){_0x56d632['forEach'](_0x2b4b69=>{const _0x22a5e4=_0x2b4b69['clone']();_0x22a5e4['_authorId']=_0x2b4b69['_authorId'],_0x22a5e4['_isInit']=!!_0x2b4b69['_isInit'],_0x22a5e4['createdAt']=_0x2b4b69['createdAt'],_0x22a5e4['baseVersion']+=this['_offset'],_0x2b4b69['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x22a5e4),this['serverHistory']['addOperation'](_0x22a5e4);});}['_handleReconnectionError'](_0x3c2da5){const _0x3e3163=this['editor']['plugins']['get']('Notification'),_0x3a90b8=this['editor']['locale'];_0x3c2da5||(_0x3c2da5=$(_0x3a90b8,'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.')),_0x3e3163['showWarning'](_0x3c2da5,{'title':$(_0x3a90b8,'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'](_0x10f688)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x10f688)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5c9f75){const _0x57bf5d=_0x5c9f75['map'](_0x52aa51=>_0x52aa51['toJSON']());return this['_compressor']['compress'](_0x57bf5d);}['_decompressOperations'](_0x4db029,_0x2a9f32){return this['_compressor']['decompress'](_0x4db029)['map']((_0x5e637c,_0x3f49a1)=>{const _0x28a87f='init'==_0x2a9f32[_0x3f49a1]['type'];if('InsertOperation'==_0x5e637c['__className']){const _0x20e051=_0x5e637c['position']['root'];!this['_document']['getRoot'](_0x20e051)&&(this['_document']['createRoot']('$root',_0x20e051)['_isAttached']=!0x1);}const _0x3d1c2f=_0x3a9837['fromJSON'](_0x5e637c,this['_document']);return _0x3d1c2f['wasUndone']=_0x5e637c['wasUndone'],_0x3d1c2f['_isInit']=_0x28a87f,_0x3d1c2f['_authorId']=_0x28a87f?null:_0x2a9f32[_0x3f49a1]['userId'],_0x3d1c2f['_isDisconnection']='cs:removeUser'===_0x2a9f32[_0x3f49a1]['type'],_0x3d1c2f['createdAt']=_0x2a9f32[_0x3f49a1]['createdAt'],_0x3d1c2f;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x13d0f1=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x13d0f1&&_0x13d0f1['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x33407a,_0xd92be1){for(const _0x1c5840 of _0x33407a)_0x1c5840['baseVersion']=_0xd92be1++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0xf952fc){this['_ignoredOperations']=_0xf952fc,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xe3648b){let _0x581a19=_0xe3648b['length'];for(;_0x581a19--;){const _0x24eaf7=_0xe3648b[_0x581a19];if(!this['_ignoredOperations']['has'](_0x24eaf7)){if(!this['_operationToId']['has'](_0x24eaf7)){const _0x10900c=_0x42f7ba()['slice'](0x1,0x12);this['_operationToId']['set'](_0x24eaf7,_0x10900c);}return this['_operationToId']['get'](_0x24eaf7);}}}['setIdForTheLastOperation'](_0x1caf5a,_0x476023){if(!_0x476023)return;let _0x336807=_0x1caf5a['length'];for(;_0x336807--;){const _0x3b8ab4=_0x1caf5a[_0x336807];this['_ignoredOperations']['has'](_0x3b8ab4)||this['_operationToId']['set'](_0x3b8ab4,_0x476023);}}}class a extends _0x56d523{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x42e0c3{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x9b7287)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x58220];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f86bd){super(_0x4f86bd),this['_services']=new Map();}async['init'](){const _0x3be4cc=this['context'],_0x454b46=_0x3be4cc['plugins']['get']('CommentsRepository');if(_0x3be4cc['plugins']['get'](n)['addToReconnectionStack'](this),_0x454b46['adapter']={'addCommentThread':async({channelId:_0x58d64e,threadId:_0x284657,comments:_0x5eaec4,resolvedAt:_0x4c698a,resolvedBy:_0x3a6b0f,context:_0xcac280,attributes:_0x52fda2})=>{const _0x54494b=await this['_getService'](_0x58d64e)['addCommentThread']({'commentThreadId':_0x284657,'comments':_0x5eaec4['map'](_0x24bc72=>function(_0x572101,_0x28d72b,_0x53f6c5){return{'commentThreadId':_0x53f6c5,'commentId':_0x572101['commentId'],'userId':_0x572101['authorId'],'content':_0x572101['content'],'documentId':_0x28d72b,'createdAt':_0x572101['createdAt'],'attributes':_0x572101['attributes']||{}};}(_0x24bc72,_0x58d64e,_0x284657)),'resolvedAt':_0x4c698a,'resolvedBy':_0x3a6b0f,'context':_0xcac280,'attributes':_0x52fda2})['catch'](at);return{'threadId':_0x54494b['commentThreadId'],'comments':_0x54494b['comments']};},'getCommentThread':async({channelId:_0xbc292d,threadId:_0x3d57e4})=>{const _0x16776b=await this['_getService'](_0xbc292d)['getCommentThread'](_0x3d57e4)['catch'](at);return _0x16776b['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x16776b]),{'threadId':_0x16776b['commentThreadId'],'comments':_0x16776b['comments']['map'](U),'context':_0x16776b['context'],'resolvedAt':_0x16776b['resolvedAt'],'resolvedBy':_0x16776b['resolvedBy'],'attributes':_0x16776b['attributes']||{}});},'updateCommentThread':async({channelId:_0x10ef99,threadId:_0x1fe5a3,context:_0x26c0ce,unlinkedAt:_0x254160,attributes:_0x598197})=>this['_getService'](_0x10ef99)['updateCommentThread']({'commentThreadId':_0x1fe5a3,'context':_0x26c0ce,'attributes':_0x598197,'unlinkedAt':_0x254160})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x401f8e,threadId:_0x1ac29c})=>{const _0x396a7c=await this['_getService'](_0x401f8e)['resolveCommentThread'](_0x1ac29c)['catch'](F)['catch'](at);return{'threadId':_0x396a7c['commentThreadId'],'resolvedAt':_0x396a7c['resolvedAt'],'resolvedBy':_0x396a7c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3a5014,threadId:_0xf200ea})=>this['_getService'](_0x3a5014)['reopenCommentThread'](_0xf200ea)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x437a23,threadId:_0x5d3523})=>this['_getService'](_0x437a23)['removeCommentThread'](_0x5d3523)['catch'](F)['catch'](at),'addComment':({channelId:_0x56df0c,threadId:_0x2202d1,commentId:_0x34de5c,content:_0x396b91,attributes:_0x563ce0})=>this['_getService'](_0x56df0c)['addComment'](_0x2202d1,_0x34de5c,_0x396b91,_0x563ce0)['catch'](at),'updateComment':({channelId:_0x4a3ccb,threadId:_0x335494,commentId:_0x1dcdda,content:_0x198cfa,attributes:_0x578c6c})=>this['_getService'](_0x4a3ccb)['updateComment'](_0x335494,_0x1dcdda,_0x198cfa,_0x578c6c)['catch'](F)['catch'](at),'removeComment':({channelId:_0x1752ee,threadId:_0xa792bd,commentId:_0x501259})=>this['_getService'](_0x1752ee)['removeComment'](_0xa792bd,_0x501259)['catch'](F)['catch'](at)},_0x3be4cc instanceof _0x5380b3){const _0x3ccb70=_0x3be4cc['config']['get']('collaboration.channelId'),_0x106151=_0x3be4cc['plugins']['get'](i);await this['_setUpService'](_0x3ccb70);const _0x1c6e33=await this['_services']['get'](_0x3ccb70)['getConnectedSessions']();this['listenTo'](_0x106151,'sessionAdd:'+_0x3ccb70,(_0x89f223,{session:_0x4dff2c})=>{_0x4dff2c['id']===_0x106151['mySessionId']&&(_0x89f223['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4dff2c['permissions'],_0x3ccb70));}),_0x106151['register'](_0x3ccb70,_0x1c6e33);}}async['_setUpService'](_0x37ee73){if(this['_services']['has'](_0x37ee73))throw new _0x473271('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x37ee73});const _0x408fce=this['context']['plugins']['get']('CommentsRepository'),_0x1e2b77=new s['CommentsService'](_0x37ee73);this['_services']['set'](_0x37ee73,_0x1e2b77),this['listenTo'](_0x1e2b77,'commentThreadAdded',(_0x473216,_0x3a92ca)=>{const {commentThreadId:_0x347922,documentId:_0x275091,context:_0x44b0d2,attributes:_0x1349c1,resolvedAt:_0x32201c,resolvedBy:_0x3799b7,comments:_0x11bfee}=_0x3a92ca;_0x408fce['getCommentThread'](_0x347922)||_0x408fce['addCommentThread']({'threadId':_0x347922,'channelId':_0x275091,'comments':_0x11bfee?_0x11bfee['map'](U):[],'context':_0x44b0d2,'attributes':_0x1349c1,'resolvedAt':_0x32201c,'resolvedBy':_0x3799b7,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e2b77,'commentThreadUpdated',(_0x3a86da,{commentThreadId:_0x227a94,documentId:_0x4974e4,context:_0x5ec9cb,unlinkedAt:_0x5b75c6,attributes:_0x26515e})=>{_0x408fce['getCommentThread'](_0x227a94)&&_0x408fce['updateCommentThread']({'threadId':_0x227a94,'channelId':_0x4974e4,'context':_0x5ec9cb,'unlinkedAt':_0x5b75c6,'attributes':_0x26515e,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e2b77,'commentThreadResolved',(_0x22ab4a,{commentThreadId:_0x97852,resolvedBy:_0xee9d61,resolvedAt:_0x3f37c4})=>{const _0xee32fa=_0x408fce['getCommentThread'](_0x97852);_0xee32fa&&_0xee32fa['resolve']({'resolvedBy':_0xee9d61,'resolvedAt':_0x3f37c4,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e2b77,'commentThreadReopened',(_0x3125e9,{commentThreadId:_0x3fd1c7})=>{const _0xd52da3=_0x408fce['getCommentThread'](_0x3fd1c7);_0xd52da3&&_0xd52da3['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e2b77,'commentThreadRemoved',(_0x573b88,{commentThreadId:_0x2a26a2})=>{const _0x1c321a=_0x408fce['getCommentThread'](_0x2a26a2);_0x1c321a&&_0x1c321a['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e2b77,'commentAdded',(_0x189058,_0x49da8a)=>{const _0x5a750a=_0x49da8a['commentThreadId'],_0xde354f=_0x408fce['getCommentThread'](_0x5a750a);_0xde354f&&_0xde354f['addComment']({...U(_0x49da8a),'isFromAdapter':!0x0});}),this['listenTo'](_0x1e2b77,'commentUpdated',(_0x195125,{commentThreadId:_0x5b03fc,commentId:_0x5732ab,content:_0x486d02,attributes:_0x1b12a6})=>{const _0x5b0e45=_0x408fce['getCommentThread'](_0x5b03fc);if(_0x5b0e45){const _0x4daff1=_0x5b0e45['getComment'](_0x5732ab);_0x4daff1&&_0x4daff1['update']({'content':_0x486d02,'attributes':_0x1b12a6,'isFromAdapter':!0x0});}}),this['listenTo'](_0x1e2b77,'commentRemoved',(_0x55cbec,{commentThreadId:_0x56720a,commentId:_0x37b61c})=>{const _0x3a8511=_0x408fce['getCommentThread'](_0x56720a);if(_0x3a8511){const _0x440e20=_0x3a8511['getComment'](_0x37b61c);_0x440e20&&_0x440e20['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x37ee73);}['destroy'](){if(this['context']instanceof _0x5380b3){const _0x158234=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x158234);}}['_terminateService'](_0xfa110e){if(!this['_services']['has'](_0xfa110e))throw new _0x473271('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0xfa110e});this['_getService'](_0xfa110e)['disconnect'](),this['_services']['delete'](_0xfa110e);}async['reconnect'](){for(const _0x43d169 of this['_services']['keys']())await this['_connectService'](_0x43d169);if(this['context']instanceof _0x5380b3){const _0xf8b453=this['context']['config']['get']('collaboration.channelId'),_0x180a22=this['context']['plugins']['get'](i);_0x180a22['unregister'](_0xf8b453);const _0x33ed4a=await this['_services']['get'](_0xf8b453)['getConnectedSessions']();_0x180a22['register'](_0xf8b453,_0x33ed4a);}}async['_connectService'](_0x2feb6c){const {connection:_0x3715a4}=this['context']['plugins']['get'](n),_0x5575fc=this['context']['plugins']['get']('CommentsRepository'),_0x5eab8d=this['_services']['get'](_0x2feb6c),_0xb490ad=await _0x5eab8d['connect'](_0x3715a4);await this['_fetchMissingUsersForThreads'](_0xb490ad);const _0x528a0a=new Set(Array['from'](_0x5575fc['getCommentThreads']({'channelId':_0x2feb6c}),_0x4a606a=>_0x4a606a['id']));for(const _0x951347 of _0xb490ad)_0x951347['deletedAt']||_0x528a0a['delete'](_0x951347['commentThreadId']);for(const _0x6affe5 of _0x528a0a)_0x5575fc['getCommentThread'](_0x6affe5)['remove']({'isFromAdapter':!0x0});for(const _0x3dff19 of _0xb490ad){let _0x4e85ad=_0x5575fc['getCommentThread'](_0x3dff19['commentThreadId']);const {commentThreadId:_0x427667,context:_0x4c3fbc,attributes:_0x4f1868,resolvedBy:_0x13ac01,resolvedAt:_0x2c262c,unlinkedAt:_0x54564c,deletedAt:_0x4ee3ad}=_0x3dff19;if(_0x4ee3ad)continue;_0x4e85ad||(_0x4e85ad=_0x5575fc['addCommentThread']({'channelId':_0x2feb6c,'threadId':_0x427667,'context':_0x4c3fbc,'attributes':_0x4f1868||{},'resolvedBy':_0x13ac01,'resolvedAt':_0x2c262c,'unlinkedAt':_0x54564c,'isFromAdapter':!0x0}));const _0x25967f=new Set(Array['from'](_0x4e85ad['comments'],_0x147a11=>_0x147a11['id']));for(const _0xb03dde of _0x3dff19['comments'])_0x25967f['delete'](_0xb03dde['commentId']);for(const _0x42ac50 of _0x25967f)_0x4e85ad['getComment'](_0x42ac50)['remove']({'isFromAdapter':!0x0});for(const _0x4f4bce of _0x3dff19['comments']){const _0x51d9d6=_0x4e85ad['getComment'](_0x4f4bce['commentId']);_0x51d9d6?_0x51d9d6['content']!==_0x4f4bce['content']&&_0x51d9d6['update']({'content':_0x4f4bce['content'],'isFromAdapter':!0x0}):_0x4e85ad['addComment'](Object['assign'](U(_0x4f4bce),{'isFromAdapter':!0x0}));}}}['_getService'](_0x29311a){if(!this['_services']['has'](_0x29311a))throw new _0x473271('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x29311a});return this['_services']['get'](_0x29311a);}async['_fetchMissingUsersForThreads'](_0x1a6034){const _0x5c5d70=this['context']['plugins']['get'](_0x58220),{connection:_0x113782}=this['context']['plugins']['get'](n),_0x54f9ed=new Set();for(const {resolvedBy:_0x31f2ab,comments:_0x1748b7}of _0x1a6034){_0x31f2ab&&!_0x5c5d70['getUser'](_0x31f2ab)&&_0x54f9ed['add'](_0x31f2ab);for(const {userId:_0x190fe0}of _0x1748b7)_0x5c5d70['getUser'](_0x190fe0)||_0x54f9ed['add'](_0x190fe0);}if(0x0===_0x54f9ed['size'])return;const _0x292424=await ct['getMany'](_0x113782,Array['from'](_0x54f9ed));for(const _0x42a9f4 of _0x292424)_0x5c5d70['getUser'](_0x42a9f4['id'])||_0x5c5d70['addUser'](_0x42a9f4);}}async function F(_0x5451bf){if('404'!==_0x5451bf['code'])throw _0x5451bf;}function at(_0x308882){if((_0x85c904=_0x308882)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x85c904['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x85c904['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x85c904;throw _0x308882;}function U(_0x5a0961){return{'threadId':_0x5a0961['commentThreadId'],'commentId':_0x5a0961['commentId'],'content':_0x5a0961['content'],'createdAt':_0x5a0961['createdAt'],'authorId':_0x5a0961['userId'],'attributes':_0x5a0961['attributes']||{}};}class m extends _0x56d523{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a35b4){super(_0x4a35b4);const _0x5f5cd0=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x5f5cd0);}['init'](){const _0x47db43=this['editor']['plugins']['get'](n),_0x2f9b5b=this['editor']['plugins']['get']('TrackChangesEditing');return _0x2f9b5b['adapter']={'getSuggestion':async _0xfaf607=>{await this['_waitForServiceReady']();const _0x5bcbfc=await this['_trackChangesService']['get'](_0xfaf607)['catch'](B);return await this['_fetchMissingUsersForThreads']([_0x5bcbfc]),_0x5bcbfc;},'addSuggestion':async({id:_0x1b84f8,type:_0x5063d8,data:_0x51921c,originalSuggestionId:_0x59a8f6,attributes:_0x251386})=>{await this['_waitForServiceReady']();const _0x18d318={'id':_0x1b84f8,'type':_0x5063d8,'data':_0x51921c,'originalSuggestionId':_0x59a8f6,'attributes':_0x251386},_0x5210d0=await this['_trackChangesService']['add'](_0x1b84f8,_0x5063d8,_0x51921c,_0x59a8f6,_0x251386)['catch'](_0xa2842f=>{if(ht(_0xa2842f))return new Promise(_0x49a729=>{this['_bufferedRequests']['set'](_0x1b84f8,{'resolve':_0x49a729,'suggestionData':_0x18d318});});throw _0xa2842f;});return this['_bufferedRequests']['delete'](_0x1b84f8),_0x5210d0;},'updateSuggestion':async(_0x53eb2b,_0x471ba5)=>{if(await this['_waitForServiceReady'](),'open'!==_0x471ba5['state'])return this['_trackChangesService']['update'](_0x53eb2b,_0x471ba5)['catch'](B);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x133902,_0x1f7e2d)=>{_0x2f9b5b['hasSuggestion'](_0x1f7e2d['id'])&&(_0x2f9b5b['getSuggestion'](_0x1f7e2d['id'])['attributes']=_0x1f7e2d['attributes']);}),this['_trackChangesService']['connect'](_0x47db43['connection'])['then'](_0x1e10f4=>(_0x47db43['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1e10f4)['then'](()=>{for(const _0x5b3e09 of _0x1e10f4){_0x2f9b5b['addSuggestionData'](_0x5b3e09)['_saved']=!0x0;}})));}async['reconnect'](){const _0x1ecf7f=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x154dcc}=this['editor']['plugins']['get'](n),_0x263a9e=await this['_trackChangesService']['connect'](_0x154dcc);await this['_fetchMissingUsersForThreads'](_0x263a9e);for(const {suggestionData:_0x464a54,resolve:_0x3d285b}of this['_bufferedRequests']['values']()){let _0x6c09dd=_0x263a9e['find'](_0x14bbad=>_0x14bbad['id']===_0x464a54['id']);_0x6c09dd||(_0x6c09dd=await this['_trackChangesService']['add'](_0x464a54['id'],_0x464a54['type'],_0x464a54['data'],_0x464a54['originalSuggestionId'])),_0x3d285b(_0x6c09dd);}for(const _0x2a91af of _0x263a9e)_0x1ecf7f['hasSuggestion'](_0x2a91af['id'])||_0x1ecf7f['addSuggestionData'](_0x2a91af);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x282755=>{this['listenTo'](this['_trackChangesService'],'connected',_0x495e89=>{_0x495e89['off'](),_0x282755();});});}async['_fetchMissingUsersForThreads'](_0x2a0ed0){const _0x38f399=this['editor']['plugins']['get'](_0x58220),{connection:_0x187d37}=this['editor']['plugins']['get'](n),_0x13f958=new Set();for(const {authorId:_0xa196ef}of _0x2a0ed0)_0x38f399['getUser'](_0xa196ef)||_0x13f958['add'](_0xa196ef);if(0x0===_0x13f958['size'])return;const _0x4c7d04=await ct['getMany'](_0x187d37,Array['from'](_0x13f958));for(const _0x1d2716 of _0x4c7d04)_0x38f399['getUser'](_0x1d2716['id'])||_0x38f399['addUser'](_0x1d2716);}}function B(_0x201ea9){if(ht(_0x201ea9))return new Promise(()=>{});throw _0x201ea9;}function ht(_0x3dc59f){return _0x3dc59f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3dc59f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x56d523{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 _0x3faa0e=this['editor']['plugins']['get'](n),_0xafade=this['editor']['plugins']['get']('CommentsEditing'),_0x3c6ee3=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3faa0e,'change:state',(_0x76f7e1,_0x489220,_0x498767)=>{_0xafade['isThreadsLoadingPaused']='connected'!==_0x498767;});}),this['listenTo'](_0x3faa0e,'change:state',(_0x469812,_0x59892d,_0xb52477)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xb52477);}),_0x3c6ee3['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x56d523{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 _0x56d523{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x4745a8)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x58220];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5eb064){super(_0x5eb064);const _0x4b239a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x4b239a);}async['init'](){const _0x5f5925=this['editor']['plugins']['get'](l),_0x192cb8=_0x5f5925['serverHistory'],_0x1769ef=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x192cb8,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5f5925['sessionId']});const _0x3df380=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x19fd6c=await _0x1ca6ba['isBundleUploaded'](_0x1769ef['connection'],_0x3df380);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0xc8797e})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0xc8797e)),'updateRevisions':async _0x1628bc=>{await this['_waitForServiceReady']();const _0x5b64a8=this['_revisionTracker']['currentRevision'];if(_0x19fd6c&&0x1===_0x1628bc['length']&&_0x1628bc[0x0]['id']===_0x5b64a8['id'])return _0x1628bc;for(const _0x5b4bb3 of _0x1628bc)_0x5b4bb3['id']===_0x5b64a8['id']&&(_0x5b4bb3['isEmptyCurrent']=_0x5b4bb3['fromVersion']===_0x5b4bb3['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x1628bc,this['_lastRequestId'])['then'](_0xc483aa=>(this['_lastRequestId']=_0xc483aa,_0x1628bc))['catch'](_0xd05f9b=>{if(P(_0xd05f9b)||'400'===_0xd05f9b['code']&&void 0x0!==_0xd05f9b['data']['wrongRequestId']){for(const _0x45ad2d of _0x1628bc){!this['_revisionTracker']['repository']['getRevision'](_0x45ad2d['id'])||this['_revisionTracker']['_bufferUpdate'](_0x45ad2d['id'],_0x45ad2d,!0x1);}if(P(_0xd05f9b))throw _0xd05f9b;return _0x1628bc;}throw _0xd05f9b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x47ec29,{revisionsData:_0x48df96,requestId:_0x3a619e})=>{Math['max'](..._0x48df96['map'](_0x97a947=>_0x97a947['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x48df96,_0x3a619e);}):this['_handleRevisionsUpdate'](_0x48df96,_0x3a619e);});const {revisions:_0xf083ad,requestId:_0x4aa7}=await this['_revisionHistoryService']['connect'](_0x1769ef['connection']);_0x1769ef['addToReconnectionStack'](this),this['_lastRequestId']=_0x4aa7,await this['_fetchMissingUsers'](_0xf083ad);for(const _0x21afb2 of _0xf083ad)this['_revisionTracker']['addRevisionData'](_0x21afb2);this['listenTo'](_0x5f5925,'change:_isConnected',(_0x272d55,_0x287c64,_0x10556b)=>{_0x10556b&&(this['_oldOffset']=_0x5f5925['_offset'],_0x272d55['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x1769ef,'state',_0x5ac49e=>_0x5ac49e===_0xd27bcb['CONNECTED']);}async['reconnect'](){const _0x5cbed0=this['editor']['plugins']['get'](n),_0x5f4acf=this['editor']['plugins']['get'](l),_0x4eac36=async()=>{const _0xbf67f2=this['_revisionTracker']['currentRevision'],_0x4bb905=_0xbf67f2['id'],_0x49446a=_0x4bb905!==_0x5f4acf['sessionId'];if(_0x49446a){const _0x1c3ec5=_0x5f4acf['_offset']-this['_oldOffset'],_0x52b36a=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0xbf67f2['toVersion']+_0x1c3ec5!==_0x52b36a){const _0x3474ec=_0xbf67f2['fromVersion']+_0x1c3ec5,_0xb9082d=this['editor']['plugins']['get'](_0x58220),_0x4cd060=this['_revisionTracker']['buildRevisionData']({'revision':_0xbf67f2,'from':_0x3474ec,'to':_0x52b36a});_0x4cd060['id']=_0xbf67f2['id'];const _0x5f4821=_0x4cd060['authorsIds']['map'](_0x49429d=>_0xb9082d['getUser'](_0x49429d));_0xbf67f2['_update']({..._0x4cd060,'authors':_0x5f4821},!0x0),this['_revisionTracker']['_bufferUpdate'](_0xbf67f2['id'],_0x4cd060,!0x0);}this['_revisionTracker']['_startingVersion']=_0x52b36a,(_0xbf67f2['toVersion']===_0xbf67f2['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x4bb905)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x4bb905),this['_revisionTracker']['_createCurrentRevision'](_0x52b36a));}const {revisions:_0x4c9f81,requestId:_0x2184df}=await this['_revisionHistoryService']['reconnect'](_0x5cbed0['connection'],this['_lastRequestId']);_0x49446a&&_0x4c9f81['length']>0x0?_0x5f4acf['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x4c9f81),this['_handleRevisionsUpdate'](_0x4c9f81,_0x2184df),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5f4acf['_isConnected']?_0x4eac36():new Promise((_0x53a06d,_0xbc4e06)=>{_0x5f4acf['once']('change:_isConnected',()=>{_0x4eac36()['then'](_0x53a06d)['catch'](_0xbc4e06);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5bb3fc=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3c06eb=>{_0x3c06eb['off'](),_0x5bb3fc();});});}['_getLatestVersionFromServerOperations'](){const _0x5c0c36=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x521642 of _0x5c0c36)if('marker'!==_0x521642['type']||_0x521642['affectsData'])return _0x521642['baseVersion']+0x1;}['_getLatestVersion'](){const _0xce05ec=this['editor']['plugins']['get'](l);return new Promise(_0x4d0440=>{_0xce05ec['_isPendingUpdate']?_0xce05ec['once']('change:_isPendingUpdate',()=>{_0x4d0440(this['_getLatestVersionFromServerOperations']());}):_0x4d0440(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x373615,_0x4875ad){const _0x1abc67=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x4875ad;for(const _0x4d4d15 of _0x373615){const _0x1dc90f=_0x1abc67['getRevision'](_0x4d4d15['id']);if(_0x1dc90f){if((_0x4d4d15['fromVersion']||_0x4d4d15['toVersion'])&&(_0x4d4d15['diffData']=null),_0x1dc90f===this['_revisionTracker']['currentRevision']){const _0x1b3db1=Math['max'](_0x1dc90f['toVersion'],_0x4d4d15['toVersion']),_0x149ee2=Math['max'](_0x1dc90f['fromVersion'],_0x4d4d15['fromVersion']);let _0x270069;_0x1dc90f['toVersion']===_0x4d4d15['toVersion']&&_0x1dc90f['fromVersion']===_0x4d4d15['fromVersion']?(_0x270069=!0x0,this['_preventResendingRevisionData'](_0x4d4d15)):_0x4d4d15['toVersion']===_0x1b3db1&&_0x4d4d15['fromVersion']===_0x149ee2?_0x270069=!0x1:(_0x1dc90f['toVersion']===_0x1b3db1&&_0x1dc90f['fromVersion']===_0x149ee2||this['_fixRevision']({'revision':_0x1dc90f,'from':_0x149ee2,'to':_0x1b3db1}),_0x270069=!0x0),_0x270069&&(delete _0x4d4d15['fromVersion'],delete _0x4d4d15['toVersion'],delete _0x4d4d15['diffData'],delete _0x4d4d15['createdAt'],delete _0x4d4d15['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x4d4d15),this['_preventResendingRevisionData'](_0x4d4d15);}else this['_revisionTracker']['addRevisionData'](_0x4d4d15);}const _0x17640e=_0x1abc67['getRevisions']();_0x17640e['reverse']();for(let _0x51f6b1=0x0;_0x51f6b1<_0x17640e['length']-0x1;_0x51f6b1++){const _0x14c2d7=_0x17640e[_0x51f6b1],_0x15d71d=_0x17640e[_0x51f6b1+0x1];if(_0x14c2d7['fromVersion']<_0x15d71d['toVersion']){const _0x18ec46=_0x15d71d['toVersion'],_0x2a2b49=Math['max'](_0x18ec46,_0x14c2d7['toVersion']);this['_fixRevision']({'revision':_0x14c2d7,'from':_0x18ec46,'to':_0x2a2b49});}}}['_fixRevision']({revision:_0x27bf7a,from:_0x2c3ab5,to:_0x5172fc}={}){const _0x7eeb81=this['editor']['plugins']['get'](_0x58220),_0x1186d3=this['_revisionTracker']['buildRevisionData']({'revision':_0x27bf7a,'from':_0x2c3ab5,'to':_0x5172fc});_0x1186d3['authors']=_0x1186d3['authorsIds']['map'](_0xa41601=>_0x7eeb81['getUser'](_0xa41601)),_0x27bf7a['_update'](_0x1186d3);}['_preventResendingRevisionData'](_0x4494b){const _0x1822e5={};_0x1822e5['id']=_0x4494b['id'];for(const _0x518d6f of Object['keys'](_0x4494b))'id'!==_0x518d6f&&(_0x1822e5[_0x518d6f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1822e5['id'],_0x1822e5,!0x0);}async['_fetchMissingUsers'](_0x2cf91a){const _0x1f2627=this['editor']['plugins']['get'](_0x58220),{connection:_0x12dbf7}=this['editor']['plugins']['get'](n),_0x5aaeda=new Set();for(const _0x3e9205 of _0x2cf91a){for(const _0x39baa9 of _0x3e9205['authorsIds'])_0x51795f(_0x39baa9);_0x3e9205['creatorId']&&_0x51795f(_0x3e9205['creatorId']);}if(0x0===_0x5aaeda['size'])return;const _0x177f8f=await ct['getMany'](_0x12dbf7,Array['from'](_0x5aaeda));for(const _0x362c5a of _0x177f8f)_0x1f2627['getUser'](_0x362c5a['id'])||_0x1f2627['addUser'](_0x362c5a);function _0x51795f(_0x248891){_0x1f2627['getUser'](_0x248891)||_0x5aaeda['add'](_0x248891);}}}function P(_0x5ee3ea){return _0x5ee3ea['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5ee3ea['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5ee3ea['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x56d523{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x59972a{['_collapseAt'];constructor(_0x765de4,_0x439b93=0x6){super(_0x765de4);const _0x534a5d=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x439b93,this['bind']('isHidden')['to'](this,'usersCount',_0x73d26d=>_0x73d26d<_0x439b93),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x534a5d['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':_0x534a5d['to']('usersCount',_0xca1a5=>'+'+(_0xca1a5-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x59972a{['items'];['keystrokes'];constructor(_0x1f931a){super(_0x1f931a);const _0x214682=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x58c74d(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x214682['if']('hasPopup'),'aria-expanded':_0x214682['to']('isExpanded',_0x85e12b=>this['hasPopup']&&String(_0x85e12b)),'aria-label':_0x214682['to']('hasPopup',_0x35ad45=>$(_0x1f931a,_0x35ad45?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x214682['to']('hasPopup',_0x427e8b=>!!_0x427e8b&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x214682['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x214682['to'](_0x2ef478=>{const _0x2ad1c0=_0x2ef478,_0x4042c8=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4e2f5c=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4042c8?.['contains'](_0x2ad1c0['relatedTarget'])||_0x4e2f5c?.['contains'](_0x2ad1c0['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x4437cd,_0x313571,_0x25a43d)=>{this['element']&&(_0x25a43d?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x59972a{['counterView'];['inlineListView'];constructor(_0x4bb117,_0x375d3d=0x6){super(_0x4bb117);const _0x36db9a=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x375d3d),this['inlineListView']=new is(_0x4bb117),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5a3ecf of this['inlineListView']['items'])_0x5a3ecf['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',_0x36db9a['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x59972a{['listWrapperView'];constructor(_0x127ae7,_0x4dee66){super(_0x127ae7);const _0xbb8dcc=this['bindTemplate'];this['listWrapperView']=new ut(_0x127ae7,_0x4dee66),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x127ae7,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0xbb8dcc['to'](_0x59a005=>{const _0x22d664=_0x59a005,_0x25247d=document['querySelector']('.ck-presence-list__list'),_0x1801bd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x25247d?.['contains'](_0x22d664['relatedTarget'])||_0x1801bd?.['contains'](_0x22d664['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x37a0d4{constructor(_0x38524d,_0x47f5ee){super(_0x38524d);const _0x2ef638=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x47f5ee?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x2ef638['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x2ef638['to']('role'),'aria-label':_0x2ef638['to']('ariaLabel'),'aria-labelledby':_0x2ef638['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x5948fe['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x206539=this['element'];_0x206539&&(this['_isScrollable']=Math['max'](_0x206539['scrollHeight'],_0x206539['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x2f802e,_0x288555,_0x41862d){super(_0x2f802e);const _0x7ef7af=this['bindTemplate'];this['userView']=new st(_0x2f802e,_0x288555);const _0x37eb22={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x288555['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x288555['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x288555['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x41862d&&(_0x37eb22['tag']='button',_0x37eb22['on']={'click':_0x7ef7af['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x37eb22);}['focus'](){this['element']['focus']();}}class A extends _0x59972a{['userView'];['markerView'];constructor(_0x164e4e,_0x3422b6,_0x3a5e3b){super(_0x164e4e);const _0x28c44f=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x164e4e,_0x3422b6),this['markerView']=new ot(_0x164e4e,_0x3422b6);const _0x431af2=new it(_0x164e4e);_0x431af2['template']['tag']='span',_0x431af2['text']=_0x3422b6['name'];const _0xe114a8={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x28c44f['to']('isFocusable',_0x41d7b8=>!!_0x41d7b8&&0x0),'aria-labelledby':_0x431af2['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x28c44f['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x28c44f['to']('hasTooltip',_0xe6c53e=>!_0xe6c53e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x431af2]};_0x3a5e3b&&(_0xe114a8['tag']='button',_0xe114a8['on']={'click':_0x28c44f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xe114a8);}}class ot extends _0x59972a{constructor(_0x294bfb,_0x459569){super(_0x294bfb),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x459569['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x42e0c3{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24d260){super(_0x24d260),this['context']['config']['define']('presenceList',x);const _0x594495=_0x24d260['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x594495)throw new _0x473271('presencelist-collapseat-invalid-format',this);if(_0x594495<0x1)throw new _0x473271('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x304907(),this['balloonPanelView']=new _0x415734(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0xde7afc of this['_allConnectedUsers'])this['_handleUserAdd'](_0xde7afc);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5c4d63,_0xeda75c)=>{this['_handleUserAdd'](_0xeda75c);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x4c1509,_0x438a60)=>{this['_handleUserRemove'](_0x438a60);});}['_createView'](){const _0x5f3314=this['context'],_0x37fcd2=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x1cd1fc=this['balloonPanelView'];if(!_0x3fffd7(_0x5f3314['config']['get']('presenceList.container')))throw new _0x473271('presencelist-missing-container',this);return _0x37fcd2['counterView']['bind']('usersCount')['to'](this),_0x37fcd2['bind']('isCollapsed')['to'](this,'usersCount',_0x50de55=>{const {collapseAt:_0x4b6658}=_0x5f3314['config']['get']('presenceList'),_0x44b8c5=_0x50de55>=_0x4b6658;if(_0x44b8c5&&!_0x37fcd2['inlineListView']['items']['find'](_0x381ef9=>_0x381ef9 instanceof b)){const _0xdbcec4=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0xdbcec4&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x37fcd2['inlineListView']['items']['add'](_0x37fcd2['counterView']);}return _0x44b8c5||this['hideDropdown'](),_0x44b8c5;}),_0x37fcd2['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x2c536c=>{const _0x2cecef=_0x5f3314['config']['get']('presenceList'),_0x4a10e4=new A(_0x5f3314['locale'],_0x2c536c,!!_0x2cecef['onClick']);return _0x4a10e4['bind']('hasTooltip')['to'](_0x37fcd2,'isCollapsed',_0xbf209e=>!_0xbf209e),_0x4a10e4['bind']('isFocusable')['to'](_0x37fcd2,'isCollapsed',_0x3c050d=>!_0x3c050d),_0x2cecef['onClick']&&this['listenTo'](_0x4a10e4,'execute',()=>{this['view']['isCollapsed']||_0x2cecef['onClick'](_0x2c536c,_0x4a10e4['element']);}),_0x4a10e4;}),this['listenTo'](_0x37fcd2['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x37fcd2['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x37fcd2['inlineListView']['keystrokes']['set']('Enter',(_0x4b102a,_0x4208e9)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4208e9());}),_0x37fcd2['render'](),_0x1cd1fc['render'](),_0x1679a7({'emitter':_0x37fcd2,'activator':()=>_0x1cd1fc['isVisible'],'contextElements':[_0x1cd1fc['element'],_0x37fcd2['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x5f3314['config']['get']('presenceList.container')['appendChild'](_0x37fcd2['element']),this['_bodyCollection']=new _0x474ae1(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x37fcd2;}['_handleUserAdd'](_0x3da2eb){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3da2eb['isMe'])return;const _0x503bfe=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x503bfe-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x1b75a4=_0x3da2eb['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3da2eb,_0x1b75a4);}['_handleUserRemove'](_0x4904a5){this['usersCount']--;const {collapseAt:_0x501ffc}=this['context']['config']['get']('presenceList'),_0x3b1ea4=this['usersCount']>=_0x501ffc;if(this['currentDisplayedUsers']['get'](_0x4904a5['id']))this['currentDisplayedUsers']['remove'](_0x4904a5['id']);else{if(_0x3b1ea4&&this['currentDisplayedUsers']['length']+0x1===_0x501ffc-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x3b1ea4?0x1:0x0)<this['usersCount']){for(const _0x25b86c of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x25b86c['id'])&&(this['currentDisplayedUsers']['add'](_0x25b86c,Math['min'](this['currentDisplayedUsers']['length']-(_0x3b1ea4?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x3b1ea4?0x1:0x0)===_0x501ffc-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x949abe=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x949abe['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x5c87d9}=this['presenceDropdownView'];_0x5c87d9['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3b2316=>{if(!_0x949abe['displayMe']&&_0x3b2316['isMe'])return null;const _0x51b380=new j(this['context']['locale'],_0x3b2316,!!_0x949abe['onClick']);return _0x949abe['onClick']&&this['listenTo'](_0x51b380,'execute',()=>{_0x949abe['onClick'](_0x3b2316,_0x51b380['element']);}),_0x51b380;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x5c87d9['focus'](),_0x5c87d9['checkIfScrollable']();const _0x41144f=(_0x12d844,_0x2ca0f9)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2ca0f9();};_0x5c87d9['keystrokes']['set']('Esc',_0x41144f),_0x5c87d9['keystrokes']['set']('Shift+Tab',_0x41144f),_0x5c87d9['keystrokes']['set']('Tab',(_0x44b42d,_0x449f98)=>{!function(_0x223f4e){const _0x3619fc=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x8017ac=>_0x8017ac+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x187f0e=[...document['body']['querySelectorAll'](_0x3619fc)]['filter'](_0x688ac6=>_0x688ac6===document['activeElement']||_0x688ac6['offsetWidth']+_0x688ac6['offsetHeight']>0x0)['sort']((_0x334c29,_0x4e55a7)=>(_0x334c29['tabIndex']||0x0)-(_0x4e55a7['tabIndex']||0x0)),_0x18360e=_0x187f0e['indexOf'](_0x223f4e),_0x57ea49=_0x187f0e[(_0x18360e+0x1)%_0x187f0e['length']];_0x57ea49&&_0x57ea49['focus']();}(this['view']['element']),this['hideDropdown'](),_0x449f98();}),_0x5c87d9['focusTracker']['add'](this['view']['element']),_0x5c87d9['focusTracker']['on']('change:isFocused',(_0x4c4bf5,_0x4cbc23,_0x5cdd75)=>{_0x5cdd75||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0x42e0c3{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x3214d6,Plugin as _0x1bf704,PendingActions as _0x4a177a,Context as tt}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x22bbd9,CKEditorError as _0x593b20,Collection as _0x1216b9,global as _0xfff1fd,version as ht,uid as _0x102894,KeystrokeHandler as _0x215678}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x52c10d,View as _0x16db83,ListView as _0x61da62,ListItemView as rt,LabelView as at,BalloonPanelView as _0x3afab7,clickOutsideHandler as _0x13d43c,BodyCollection as _0x168d9c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x14d445,History as _0x2339bd,NoOperation as _0x152ccf,InsertOperation as _0x3ab41f,MarkerOperation as _0x3b1e2c,RootAttributeOperation as _0x2a4541,transformOperationSets as _0x465da8,OperationFactory as _0x208794}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as dt,WEB_SOCKET_GATEWAY_STATES as _0x176d8f,CollaborativeEditingService as _0x4eb68d,User as ut,CommentsService as et,TrackChangesService as it,RevisionHistoryService as _0xdca4cc,EditorService as _0x519c59}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x501a96,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x217b10}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0xff7fb5}from'es-toolkit/compat';class n extends _0x3214d6{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x52c10d];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3255b5){super(_0x3255b5),this['set']('state',_0x176d8f['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x22bbd9())();}['init'](){const _0x549a10=this['context'],_0xc09891=_0x549a10['plugins']['get']('CloudServices'),_0x26c11f=_0x549a10['plugins']['get'](_0x52c10d);if(!_0xc09891['token'])throw new _0x593b20('websocketgateway-missing-token',this);if(!_0xc09891['webSocketUrl'])throw new _0x593b20('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'](_0xc09891['token'],_0xc09891['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x459f6e=>{if(this['connection']=_0x459f6e,this['bind']('state')['to'](_0x459f6e,'state',this,'_isBrowserOffline',(_0x431c95,_0x2c13ec)=>('connected'!==_0x431c95&&(this['_shouldPluginsReconnect']=!0x0),_0x2c13ec||_0x431c95!==_0x176d8f['CONNECTED']?_0x176d8f['DISCONNECTED']:this['state']==_0x176d8f['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x176d8f['CONNECTING']):_0x176d8f['CONNECTED'])),this['connection']['on']('error',(_0x5797e2,_0x37d29a)=>{if('limitExceeded'!==_0x37d29a['code'])throw console['error'](_0x37d29a),new _0x593b20('cloudservices-init',null,{'originalError':_0x37d29a});_0x26c11f['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'});}),!_0x459f6e['me'])return new Promise(_0x4c7b34=>_0x459f6e['on']('change:me',_0x4c7b34));})['catch'](_0x2ce3f4=>{throw console['error'](_0x2ce3f4),new _0x593b20('cloudservices-init',null,{'originalError':_0x2ce3f4});});}['addToReconnectionStack'](_0x3589a0){if('function'!=typeof _0x3589a0['reconnect'])throw new _0x593b20('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3589a0))throw new _0x593b20('websocketgateway-plugin-already-registered',this,{'name':_0x3589a0['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3589a0);}['removeFromReconnectionStack'](_0xd3eaab){this['_reconnectionStack']['delete'](_0xd3eaab);}['isInReconnectionStack'](_0x393728){return this['_reconnectionStack']['has'](_0x393728);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1dac8f=>_0x1dac8f['reconnect']())))['then'](()=>this['state']=_0x176d8f['CONNECTED'])['catch'](_0xeaaf39=>{throw console['error'](_0xeaaf39),new _0x593b20('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x176d8f['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x3214d6{['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,_0x501a96];}constructor(_0x54a4da){super(_0x54a4da),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1216b9(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x501a96);}['init'](){const _0x532808=this['context']['plugins']['get'](n);this['listenTo'](_0x532808,'change:state',(_0x1fa83d,_0x518dff,_0x1f8801)=>{if('connected'!==_0x1f8801)this['channelSessions']['forEach'](_0x2acdbc=>_0x2acdbc['clear']()),this['channelConnectedUsers']['forEach'](_0x5d0205=>_0x5d0205['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0xa51b2e,_0x4bc88e]of this['_registeredSessions'])for(const _0x179e47 of _0x4bc88e)this['_handleSessionAdd'](_0xa51b2e,_0x179e47);}}),this['_createUser'](_0x532808['connection']['me'],!0x0);}['register'](_0x3ed1ae,_0x354d8b){if(this['_registeredSessions']['has'](_0x3ed1ae))throw new _0x593b20('sessions-register-already-registered',null,{'channelId':_0x3ed1ae});this['_registeredSessions']['set'](_0x3ed1ae,_0x354d8b),this['channelSessions']['set'](_0x3ed1ae,new _0x1216b9()),this['channelConnectedUsers']['set'](_0x3ed1ae,new _0x1216b9()),this['listenTo'](_0x354d8b,'add',(_0x12cb16,_0x25acf8)=>this['_handleSessionAdd'](_0x3ed1ae,_0x25acf8)),this['listenTo'](_0x354d8b,'remove',(_0x3bb62f,_0x3add5b)=>this['_handleSessionRemove'](_0x3ed1ae,_0x3add5b));for(const _0x3f6d18 of _0x354d8b)this['_handleSessionAdd'](_0x3ed1ae,_0x3f6d18);}['unregister'](_0x32bd7c){if(!this['_registeredSessions']['has'](_0x32bd7c))throw new _0x593b20('sessions-unregister-not-exist',null,{'channelId':_0x32bd7c});const _0x9f8e5e=this['_registeredSessions']['get'](_0x32bd7c);this['stopListening'](_0x9f8e5e);for(const _0x34f8f3 of _0x9f8e5e)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x32bd7c,_0x34f8f3);this['_registeredSessions']['delete'](_0x32bd7c),this['channelSessions']['delete'](_0x32bd7c),this['channelConnectedUsers']['delete'](_0x32bd7c);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x375c98){for(const _0x8122b0 of this['channelSessions']['values']())for(const _0x3d42e9 of _0x8122b0)if(_0x3d42e9['id']===_0x375c98)return _0x3d42e9['user'];}['getUserSessions'](_0x357a83,_0x39606c){const _0xde745d=_0x39606c?[this['channelSessions']['get'](_0x39606c)]:this['channelSessions']['values'](),_0x4bf293=new Set();for(const _0x163d74 of _0xde745d)for(const _0x500ddc of _0x163d74)_0x500ddc['user']['id']===_0x357a83['id']&&_0x4bf293['add'](_0x500ddc['id']);return _0x4bf293;}['getUserRole'](_0x404379){for(const _0x2e830e of this['channelSessions']['values']())for(const _0xd5096e of _0x2e830e)if(_0xd5096e['user']===_0x404379)return _0xd5096e['role'];}['_handleSessionAdd'](_0x1ac0b7,_0x325034){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x2dd61c=_0x325034['user'],_0x273890=this['_users']['getUser'](_0x2dd61c['id'])||this['_createUser'](_0x2dd61c),_0x5ace37=Object['assign']({},_0x325034,{'user':_0x273890});if(this['channelSessions']['get'](_0x1ac0b7)['add'](_0x5ace37),!_0x2dd61c['hiddenInPresenceList']){const _0x133868=this['channelConnectedUsers']['get'](_0x1ac0b7);_0x133868['has'](_0x273890['id'])||_0x133868['add'](_0x273890),this['allConnectedUsers']['has'](_0x273890['id'])||_0x2dd61c['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x273890,_0x273890['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x1ac0b7,{'channelId':_0x1ac0b7,'session':_0x5ace37});}['_handleSessionRemove'](_0x38cc0b,_0xfb59c){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x522d5a=this['channelConnectedUsers']['get'](_0x38cc0b),_0x1ec2e1=_0xfb59c['user'];_0x1ec2e1['id']&&(this['channelSessions']['get'](_0x38cc0b)['remove'](_0xfb59c['id']),_0x522d5a['has'](_0x1ec2e1['id'])&&!this['getUserSessions'](_0x1ec2e1,_0x38cc0b)['size']&&_0x522d5a['remove'](_0x1ec2e1['id']),this['allConnectedUsers']['get'](_0x1ec2e1['id'])&&!this['getUserSessions'](_0x1ec2e1)['size']&&this['allConnectedUsers']['remove'](_0x1ec2e1['id']));}['_createUser'](_0x59a3f7,_0x5cef01){const _0x10e3ac=this['_users']['addUser'](_0x59a3f7);return _0x5cef01&&this['_users']['defineMe'](_0x59a3f7['id']),_0x10e3ac['orderNumber']=this['_uniqueUsersCount']++,_0x10e3ac;}}class H extends _0x1bf704{['_domEmitter']=new(_0x22bbd9())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3128fa=this['editor'],_0x4cf648=_0x3128fa['plugins']['get'](i);_0x3128fa['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x28d12c,{writer:_0x35213b})=>function(_0x4c190c,_0x56c4e0,_0x3b7f96,_0x4ef110){const _0x314599=_0x4c190c['markerName']['split'](':')[0x2],_0x392a7e=_0x3b7f96['getUserBySessionId'](_0x314599);if(!_0x392a7e||_0x314599===_0x3b7f96['mySessionId'])return;if(!_0x4ef110['model']['schema']['checkChild'](_0x4c190c['markerRange']['start'],'$text'))return;const _0x1dc4a2={'class':'ck-user__marker\x20'+_0x392a7e['color']['getMarkerClass'](),'data-name':_0x392a7e['name'],'data-session-id':_0x314599},_0x448d13=_0x4ef110['model']['markers']['get'](_0x4c190c['markerName']),_0x4eabcb=_0x448d13['getStart'](),_0x4bc9dd=_0x4eabcb['nodeAfter'],_0x327891=_0x4ef110['model']['schema'];if(_0x4bc9dd&&_0x327891['isObject'](_0x4bc9dd)&&_0x327891['isInline'](_0x4bc9dd)&&!_0x4ef110['model']['markers']['get']('user:range:'+_0x314599)['getRange']()['isCollapsed'])return;const _0x326257=_0x4eabcb['parent'];return _0x4ef110['model']['schema']['isLimit'](_0x326257)&&!_0x4ef110['model']['hasContent'](_0x326257)&&(_0x1dc4a2['contenteditable']=!0x1),function(_0x5325a4,_0x586cc1,_0x459b34){const _0x233b66=_0x5325a4['createUIElement']('span',_0x586cc1);return _0x5325a4['setCustomProperty']('userPositionMarker',!0x0,_0x233b66),_0x233b66['render']=function(_0x3a871){const _0x226f42=this['toDomElement'](_0x3a871),_0x203f7f=document['createElement']('span');return _0x203f7f['classList']['add']('ck-user__marker-tooltip'),_0x203f7f['setAttribute']('contenteditable','false'),_0x203f7f['setAttribute']('spellcheck','false'),_0x203f7f['textContent']=_0x459b34['name'],_0x226f42['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x203f7f['outerHTML']+'⁠',_0x226f42['addEventListener']('mouseenter',()=>{_0x226f42['classList']['add']('ck-user__marker_hovered');}),_0x226f42['addEventListener']('mouseleave',()=>{_0x226f42['classList']['remove']('ck-user__marker_hovered');}),_0x226f42;},_0x233b66['isSimilar']=function(_0x338f40){return!(!this['getCustomProperty']('userPositionMarker')||!_0x338f40['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x338f40['getAttribute']('data-session-id'));},_0x233b66;}(_0x56c4e0,_0x1dc4a2,_0x392a7e);}(_0x28d12c,_0x35213b,_0x4cf648,_0x3128fa)}),_0x3128fa['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x262eb3=>function(_0x1d5059,_0x20cd92){const _0x273bc0=_0x1d5059['markerName']['split'](':')[0x2];if(_0x273bc0===_0x20cd92['mySessionId'])return null;const _0x4d5df4=_0x20cd92['getUserBySessionId'](_0x273bc0);if(!_0x4d5df4)return{'id':_0x273bc0,'classes':[]};return{'id':_0x273bc0,'classes':['ck-user__selection',_0x4d5df4['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x273bc0},'priority':0x7d0+_0x4d5df4['orderNumber']};}(_0x262eb3,_0x4cf648)}),function(_0x26cf45){const _0x5a4b4c=_0x26cf45['model'],_0x2f9abe=new Map(),_0x1dc6e2=_0x26cf45['plugins']['get'](i);_0x5a4b4c['markers']['on']('update:user:range',(_0xa87f42,_0x13cac5,_0x22420c,_0x1a2b82)=>{if(!_0x1a2b82&&_0x2f9abe['get'](_0x13cac5['name']))return _0x2f9abe['get'](_0x13cac5['name'])['detach'](),void _0x2f9abe['delete'](_0x13cac5['name']);const _0x19151e=_0x13cac5['name']['split'](':')[0x2];if(_0x19151e===_0x1dc6e2['mySessionId'])return;const _0x1611f0='user:position:'+_0x19151e;_0x5a4b4c['markers']['has'](_0x1611f0)&&_0x26cf45['editing']['reconvertMarker'](_0x1611f0),_0x13cac5['on']('change:range',(_0x1ac616,_0x169671,_0x1f2e09)=>{if('$graveyard'!=_0x169671['root']['rootName']&&'$graveyard'==_0x13cac5['getRange']()['root']['rootName']&&!_0x2f9abe['has'](_0x13cac5['name'])){const _0xbba6f9=_0x5a4b4c['schema']['getNearestSelectionRange'](_0x1f2e09['deletionPosition']);if(_0xbba6f9){const _0x1cb3a7=_0x14d445['fromRange'](_0xbba6f9);_0x2f9abe['set'](_0x13cac5['name'],_0x1cb3a7),_0x1cb3a7['on']('change:range',(_0x10d845,_0x49b25d,_0x1ff78c)=>{if('$graveyard'==_0x1cb3a7['root']['rootName']){const _0x4cad70=_0x5a4b4c['schema']['getNearestSelectionRange'](_0x1ff78c['deletionPosition']);_0x4cad70?(_0x1cb3a7['start']=_0x4cad70['start'],_0x1cb3a7['end']=_0x4cad70['end']):(_0x2f9abe['delete'](_0x13cac5['name']),_0x1cb3a7['detach']());}});}}});}),_0x5a4b4c['document']['on']('change',()=>{_0x2f9abe['size']>0x0&&_0x5a4b4c['enqueueChange']({'isUndoable':!0x1},_0x1df919=>{for(const [_0x56776e,_0x46a50b]of _0x2f9abe)'$graveyard'==_0x5a4b4c['markers']['get'](_0x56776e)['getRange']()['root']['rootName']&&(Y(_0x56776e['split'](':')[0x2],_0x46a50b['toRange'](),_0x5a4b4c,_0x1df919),_0x46a50b['detach']());_0x2f9abe['clear']();});});}(_0x3128fa),this['_domEmitter']['listenTo'](_0xfff1fd['document'],'keydown',(_0x1e3df2,{key:_0x38e8bc})=>{'Escape'===_0x38e8bc&&function(_0x5612bb){_0x5612bb['editing']['view']['change'](_0x2c333a=>{for(const _0x56e5ba of _0x5612bb['model']['markers']){if(!_0x56e5ba['name']['startsWith']('user:position'))continue;const _0x586cff=_0x5612bb['editing']['mapper']['markerNameToElements'](_0x56e5ba['name']);if(_0x586cff){for(const _0x28dab3 of _0x586cff)_0x2c333a['removeClass']('ck-user__marker_hovered',_0x28dab3);}}});}(_0x3128fa);},{'useCapture':!0x0});}['afterInit'](){const _0x19cb04=this['editor'],_0x3da693=_0x19cb04['commands']['get']('undo');_0x3da693&&_0x19cb04['model']['on']('applyOperation',(_0x5130d1,_0x1cbcc7)=>{const _0x33a099=_0x1cbcc7[0x0];if(!_0x33a099['isDocumentOperation'])return;if('marker'!=_0x33a099['type']||!_0x33a099['name']['startsWith']('user:'))return;const _0x198e01=_0x33a099['batch'];_0x3da693['_createdBatches']['has'](_0x198e01)&&(_0x33a099['newRange']=_0x33a099['oldRange']?_0x19cb04['model']['createRange'](_0x33a099['oldRange']['start'],_0x33a099['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x40b6d5=this['editor'],_0xc72212=_0x40b6d5['model']['document'],_0x274680=_0x40b6d5['plugins']['get'](i);_0x40b6d5['model']['enqueueChange']({'isUndoable':!0x1},_0x3571ec=>{const _0x55198b='user:range:'+_0x274680['mySessionId'],_0x499380='user:position:'+_0x274680['mySessionId'],_0x1b8ddf=_0x40b6d5['model']['markers']['has'](_0x55198b);_0x40b6d5['editing']['view']['hasDomSelection']?Y(_0x274680['mySessionId'],_0xc72212['selection']['getFirstRange'](),_0x40b6d5['model'],_0x3571ec):_0x1b8ddf&&(_0x3571ec['removeMarker'](_0x55198b),_0x3571ec['removeMarker'](_0x499380));});}}function Y(_0x59befc,_0x2c6733,_0x3d5d9a,_0x597073){const _0x4a2007='user:range:'+_0x59befc,_0x335def='user:position:'+_0x59befc,_0x15a3b2=_0x2c6733['getContainedElement']();let _0x552a96=_0x2c6733['start'];if(_0x15a3b2&&_0x15a3b2['is']('element','tableCell')){const _0x2613d9=function(_0x5213ab,_0x6319a){for(const _0x375211 of _0x5213ab['getPositions']())if(_0x6319a['schema']['checkChild'](_0x375211,'$text'))return _0x375211;}(_0x2c6733,_0x3d5d9a);_0x2613d9&&(_0x552a96=_0x2613d9,_0x2c6733=_0x597073['createRange'](_0x552a96));}const _0x8b8068=_0x597073['createRange'](_0x552a96);_0x3d5d9a['markers']['has'](_0x4a2007)?(_0x597073['updateMarker'](_0x4a2007,{'range':_0x2c6733}),_0x597073['updateMarker'](_0x335def,{'range':_0x8b8068})):(_0x597073['addMarker'](_0x4a2007,{'range':_0x2c6733,'usingOperation':!0x0}),_0x597073['addMarker'](_0x335def,{'range':_0x8b8068,'usingOperation':!0x0}));}function V(_0x499ab5,_0x3832a4,_0x3a0a6d){const _0x63360c=_0x499ab5['t'],t=_0x499ab5['t'];switch(_0x3832a4){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 _0x63360c({'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'},_0x3a0a6d);default:return'';}}let q=0x1;class l extends _0x1bf704{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x4eb68d)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,H,_0x4a177a,_0x501a96,_0x52c10d];}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 _0xc9d26c=this['serverHistory']['getOperations']();for(let _0x47d351=_0xc9d26c['length']-0x1;_0x47d351>=0x0;_0x47d351--){const _0x44fec7=_0xc9d26c[_0x47d351];if(!this['_disconnectionOperations']['has'](_0x44fec7))return _0x44fec7['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x531fc4){if(super(_0x531fc4),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x2339bd(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x593b20('collaboration-missing-channelid',this);const _0x574fa7=_0x531fc4['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x574fa7,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x217b10(),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 K(this['_disconnectionOperations']);}['init'](){const _0x187df0=this['editor'],_0x2b1413=_0x187df0['plugins']['get'](_0x501a96),_0x4b6e80=_0x187df0['plugins']['get'](n);this['listenTo'](_0x2b1413,'getOperationAuthor',(_0x10b608,_0x39b0ac)=>{const _0x54595e=_0x39b0ac[0x0];_0x54595e['_authorId']&&(_0x10b608['return']=_0x2b1413['getUser'](_0x54595e['_authorId']),_0x10b608['stop']()),null===_0x54595e['_authorId']&&(_0x10b608['return']=null,_0x10b608['stop']());},{'priority':'high'}),this['listenTo'](_0x187df0['model']['document']['selection'],'change:range',(_0x519b69,_0xa9a260)=>{_0xa9a260['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x187df0['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x187df0['model']['on']('applyOperation',(_0x366165,_0x184e15)=>{const _0x321369=_0x184e15[0x0];_0x321369['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x321369),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4b6e80,'state',this,'_hasSynchronizationProblem',(_0x175eae,_0x929ea2)=>'connected'===_0x175eae&&!_0x929ea2),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x187df0['disableReadOnlyMode']('rtc-offline'):_0x187df0['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x187df0['disableReadOnlyMode']('rtc-offline'):_0x187df0['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x28d772=this['editor']['plugins']['get'](i),_0x3484f5=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x28d772['unregister'](this['_channelId']);const _0x3d09d9=await this['_service']['reconnect'](_0x3484f5['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x3d09d9)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x36428a=await this['_service']['getConnectedSessions']();_0x28d772['register'](this['_channelId'],_0x36428a),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4a897c){if(function(_0x127537){return'404'===_0x127537['code'];}(_0x4a897c)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x102014){return'409'===_0x102014['code'];}(_0x4a897c)){const _0x3702c8=V(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x3702c8);}else{if(!(_0x4a897c instanceof G))throw _0x4a897c;this['_handleReconnectionError']();}}}}['destroy'](){const _0x252cb5=this['editor']['plugins']['get'](n),_0x4a17d5=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4a17d5['channelSessions']['has'](this['_channelId'])&&_0x4a17d5['unregister'](this['_channelId']),_0x252cb5['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0xb23d6a){if(this['sessionId']!==_0xb23d6a['sessionId']&&this['_lastSyncedOperationId']!==_0xb23d6a['lastOperationId'])throw new G();return this['sessionId']=_0xb23d6a['sessionId'],this['_handleServerResponse']([],{..._0xb23d6a,'wereChangesApplied':!0x1,'data':_0xb23d6a['data']},'reconnect');}async['_connectService'](_0x41ca19,_0x82f954=!0x1){const {connection:_0x5e4dd2}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x5e4dd2,this['_channelId'])['then'](_0x4d5482=>this['_initSessionsHandling'](_0x4d5482))['catch'](_0x1806c4=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1806c4);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x147648,_0x169211)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x169211);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x16bbe8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x41ca19);this['_isPendingUpdate']=!0x0;const _0x1aac0d=await this['_service']['connect'](_0x5e4dd2,this['_compressOperations'](_0x41ca19),_0x16bbe8);if(this['sessionId']=_0x1aac0d['sessionId'],_0x82f954){if(!_0x1aac0d['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x1aac0d['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x41ca19,_0x1aac0d,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x1aac0d,_0x41ca19);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x7dcb85=this['editor']['plugins']['get'](i),_0x460b87=this['editor']['plugins']['get'](H),_0x2c3dd3=_0x7dcb85['channelSessions']['get'](this['_channelId']);_0x2c3dd3&&_0x2c3dd3['length']>0x1?_0x460b87['createUserMarkerOperations']():this['listenTo'](_0x7dcb85,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x7dcb85['channelSessions']['get'](this['_channelId'])['length']&&_0x460b87['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x568d4b,_0x27d8b3,_0x1dd4ef,_0x28a02f){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x27d8b3){const _0x2eac38=this['_decompressOperations'](_0x1dd4ef,_0x28a02f);await this['_fetchMissingUsers'](_0x2eac38),this['_handleExternalOperations'](_0x2eac38,_0x27d8b3,_0x1dd4ef['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x564034}=this['editor'];let _0x313815;try{_0x313815=await this['_service']['getDocumentDetails']();}catch{const _0x24c265=V(_0x564034,'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'](_0x24c265);}const _0x2ff4a4=_0x313815['currentDocumentSession']||_0x313815['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x2ff4a4['lastOperationId']){const _0x1e3a06=V(_0x564034,'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'](_0x1e3a06);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x22e3b2){const _0x57a1c6=this['editor']['plugins']['get'](i);this['listenTo'](_0x57a1c6,'sessionAdd:'+this['_channelId'],(_0x4fe3cd,{session:_0x149502})=>{if(_0x149502['id']===_0x57a1c6['mySessionId']){_0x4fe3cd['off']();const _0x342620=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2c987d=_0x149502['permissions'];_0x342620&&_0x342620['isEnabled']&&(_0x2c987d=_0x2c987d['filter'](_0x3bb20f=>'document:write'!==_0x3bb20f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2c987d,this['_channelId']);}}),_0x57a1c6['register'](this['_channelId'],_0x22e3b2);}['_initThrowingOnDataSet'](){const _0x331ba2=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5abdbd)=>{if(!_0x5abdbd[_0x5abdbd['length']-0x1]['suppressErrorInCollaboration'])throw new _0x593b20('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x331ba2['apply'](this['editor']['data'],_0x5abdbd);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x26816c,[_0x19bf93])=>{if(this['_document']['version'])throw new _0x593b20('realtimecollaborationclient-init-document-already-initialized',this);_0x26816c['stop'](),this['_setPendingAction']();const _0x2b13ad=this['editor']['config']['get']('rootsAttributes'),_0x2a6f73=this['_getOperationsFromInitData'](_0x19bf93,_0x2b13ad);0x0==_0x2a6f73['length']&&_0x2a6f73['push'](new _0x152ccf(0x0)),_0x26816c['return']=this['_connectService'](_0x2a6f73)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4b95a9=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4b95a9))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1c1a5c,[_0x344827,_0x125115])=>{_0x1c1a5c['stop']();const _0x3d65c5=this['editor']['model']['document']['getRoot'](_0x344827);if(!this['_knownRootNames']['has'](_0x344827)){const _0x24c7f6=_0x125115&&_0x125115['data']?_0x125115['data']:'',_0x21acf=_0x125115&&_0x125115['attributes']?_0x125115['attributes']:{};await this['_loadRoot'](_0x344827,_0x24c7f6,_0x21acf);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3d65c5['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3d65c5);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x574b61){const _0x2608ec=this['editor']['plugins']['get'](_0x501a96),{connection:_0x45bb3b}=this['editor']['plugins']['get'](n),_0x59491d=new Set();for(const _0x3ee34e of _0x574b61){const _0x4a859d=_0x3ee34e['_authorId'];_0x4a859d&&!_0x2608ec['getUser'](_0x4a859d)&&_0x59491d['add'](_0x4a859d);}if(0x0===_0x59491d['size'])return;const _0x53c06a=await ut['getMany'](_0x45bb3b,Array['from'](_0x59491d));for(const _0x1e8912 of _0x53c06a)_0x2608ec['getUser'](_0x1e8912['id'])||_0x2608ec['addUser'](_0x1e8912);}['_getOperationsFromInitData'](_0xe04b7e,_0x2b3507={}){const _0x3cf733=this['editor']['model'],_0x1f973c=[];let _0x22c218=0x0;const _0x1c8547='string'==typeof _0xe04b7e?{'main':_0xe04b7e}:_0xe04b7e;for(const _0x3b26a8 of Object['keys'](_0x1c8547)){if(!this['_document']['roots']['has'](_0x3b26a8))throw new _0x593b20('realtimecollaborationclient-init-non-existent-root',this);const _0x3407ef=this['editor']['data']['parse'](_0x1c8547[_0x3b26a8]),_0x339819=this['_document']['getRoot'](_0x3b26a8),_0x52ca31=new _0x3ab41f(_0x3cf733['createPositionAt'](_0x339819,0x0),_0x3407ef,_0x22c218++);_0x1f973c['push'](_0x52ca31);for(const [_0x5180ba,_0x3966db]of _0x3407ef['markers']){const _0x18fad2=_0x3cf733['createRange'](_0x3cf733['createPositionFromPath'](_0x339819,_0x3966db['start']['path']['slice']()),_0x3cf733['createPositionFromPath'](_0x339819,_0x3966db['end']['path']['slice']())),_0x2694f9=new _0x3b1e2c(_0x5180ba,null,_0x18fad2,_0x3cf733['markers'],!0x0,_0x22c218++);_0x1f973c['push'](_0x2694f9);}}if(_0x2b3507)for(const [_0x5045f3,_0x8b5b63]of Object['entries'](_0x2b3507)){const _0x764cb9=_0x3cf733['document']['getRoot'](_0x5045f3);if(!_0x764cb9)throw new _0x593b20('multi-root-editor-root-attributes-no-root',null);for(const [_0x14910a,_0x3e93e1]of Object['entries'](_0x8b5b63))if(null!==_0x3e93e1){const _0x4b8362=new _0x2a4541(_0x764cb9,_0x14910a,null,_0x3e93e1,_0x22c218++);_0x1f973c['push'](_0x4b8362);}}return _0x1f973c;}async['_loadRoot'](_0x54e4e1,_0x1dfa1d,_0x3597ef){this['_getOperationsFromInitData']({[_0x54e4e1]:_0x1dfa1d},{[_0x54e4e1]:_0x3597ef})['forEach']((_0x2d621f,_0x1457b4)=>{_0x2d621f['baseVersion']=this['_document']['version']+_0x1457b4,_0x2d621f['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2d621f);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x2db719,_0x4638d7){let _0x3d592e;this['_offset']=_0x2db719['offset'];const _0x34a228=_0x2db719['wereChangesApplied']&&!_0x2db719['initData'],_0x32d059=_0x34a228?0x0:_0x2db719['data']['baseVersion'];if(_0x4638d7['forEach'](_0x2c22bd=>{_0x2c22bd['_isInit']=!0x0,_0x2c22bd['createdAt']=_0x2db719['sessionCreatedAt'],_0x2c22bd['_authorId']=null;}),_0x34a228)_0x3d592e=_0x4638d7,this['_applyOperationsSet'](_0x3d592e,_0x34a228);else{if(_0x2db719['initData']){const _0xf7eedb=this['_getOperationsFromInitData'](_0x2db719['initData']);this['_document']['history']['version']=-_0xf7eedb['length'],_0xf7eedb['forEach'](_0x364f3e=>{_0x364f3e['baseVersion']-=_0xf7eedb['length'],_0x364f3e['createdAt']=_0x2db719['sessionCreatedAt'],_0x364f3e['_isInit']=!0x0,_0x364f3e['_authorId']=null;}),this['_applyOperationsSet'](_0xf7eedb,!0x0),this['serverHistory']['version']=-_0xf7eedb['length']+this['_offset'],this['_updateServerHistory'](_0xf7eedb);}this['_document']['history']['version']=_0x32d059,_0x3d592e=this['_decompressOperations'](_0x2db719['data'],_0x2db719['metadata']),await this['_fetchMissingUsers'](_0x3d592e),this['_applyOperationsSet'](_0x3d592e,_0x34a228);}_0x2db719['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3d592e,_0x2db719['lastOperationId']),this['_lastSyncedOperationId']=_0x2db719['lastOperationId']),this['serverHistory']['version']=_0x32d059+this['_offset'],this['_updateServerHistory'](_0x3d592e),_0x4638d7['filter'](_0x145438=>{const _0x57df07=this['_getAffectedRoot'](_0x145438);return _0x57df07&&!this['_knownRootNames']['has'](_0x57df07);})['forEach']((_0x564812,_0x282935)=>{_0x564812['baseVersion']=this['_document']['version']+_0x282935,this['_saveOperationInBuffer'](_0x564812);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x298e2f,_0x59cbfc){const _0x5aa5ef=_0x59cbfc&&_0x59cbfc['message'];if(_0x5aa5ef&&_0x5aa5ef['startsWith']('realtimecollaborationclient'))throw _0x59cbfc;const _0x11591e=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x11591e['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x593b20(_0x298e2f,this['editor'],_0x5aa5ef?{'originalError':_0x5aa5ef}:void 0x0);}['_saveOperationInBuffer'](_0x35e89e){this['_knownOperations']['has'](_0x35e89e)||(this['_knownOperations']['add'](_0x35e89e),this['_bufferedOperations']['push'](_0x35e89e),this['_pendingAction']||'marker'==_0x35e89e['type']&&!_0x35e89e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3febc6=!0x1){!_0x3febc6&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2a5226=>{_0x2a5226&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x412e0a=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x37567a){return _0x37567a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x37567a['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x37567a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x412e0a)||this['_crash'](_0x412e0a['message'],_0x412e0a);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x36e866=>{this['on']('change:_isPendingUpdate',()=>{_0x36e866();});});}async['_sendBufferedOperations'](){const _0x77b4ed=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x77b4ed['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2eca7e=[...this['_bufferedOperations']];for(const _0x111fa3 of _0x2eca7e)_0x111fa3['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x111fa3);const _0x30e29c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2eca7e),_0x2b1d85=q++,_0x3c49dd=this['_compressOperations'](_0x2eca7e),_0x5ce584=await this['_service']['sendOperations'](_0x3c49dd,_0x3c49dd['baseVersion'],_0x30e29c);try{return await this['_handleServerResponse'](_0x2eca7e,_0x5ce584,_0x2b1d85);}catch(_0xd09776){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0xd09776);}}async['_handleServerResponse'](_0x11c8b9,_0x4a23b7,_0x41b582){if('error'in _0x4a23b7)throw _0x4a23b7['error'];let _0x520403=!0x1;if(_0x4a23b7['wereChangesApplied']){_0x4a23b7['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4a23b7['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3659b7=>!_0x11c8b9['includes'](_0x3659b7));for(const _0x47d86c of _0x11c8b9)_0x47d86c['createdAt']='lastOperationAcceptedAt'in _0x4a23b7&&_0x4a23b7['lastOperationAcceptedAt']||void 0x0;$(_0x11c8b9,_0x4a23b7['version']-_0x11c8b9['length']),this['_updateServerHistory'](_0x11c8b9);const _0xb71f0c=_0x11c8b9['filter'](_0x359a2c=>{if(!_0x359a2c['_isInit'])return!0x1;const _0x3fe7f1=this['_getAffectedRoot'](_0x359a2c);return _0x3fe7f1&&!this['_knownRootNames']['has'](_0x3fe7f1);});$(_0xb71f0c,this['_document']['version']),this['_applyOperationsSet'](_0xb71f0c),_0x520403=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xc89a8f=this['_decompressOperations'](_0x4a23b7['data'],_0x4a23b7['metadata'])['filter'](_0xc13fc3=>_0xc13fc3['baseVersion']>=this['_lastServerVersion']);_0xc89a8f['forEach'](_0x2278ac=>this['_addKnownRoot'](_0x2278ac)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4c0a91=>!_0x4c0a91['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4c0a91))),this['_bufferedOperations']['length']&&$(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xc89a8f),_0x520403=this['_handleExternalOperations'](_0xc89a8f,_0x4a23b7['version'],_0x4a23b7['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x520403?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x31987b,_0x263b2a,_0x53da7d){try{const _0x31bfe8={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3e996f,operationsB:_0x31c985,originalOperations:_0x192b0b}=_0x465da8(_0x31987b,this['_bufferedOperations'],_0x31bfe8);$(_0x3e996f,this['_document']['version']),$(_0x31c985,_0x263b2a);for(const _0x4c4315 of _0x3e996f){const _0x316cf4=_0x192b0b['get'](_0x4c4315);_0x4c4315['_authorId']=_0x316cf4?_0x316cf4['_authorId']:null;}_0x53da7d&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x31987b,_0x53da7d),this['_lastSyncedOperationId']=_0x53da7d),this['_bufferedOperations']=[..._0x31c985],this['_applyOperationsSet'](_0x3e996f),this['_updateServerHistory'](_0x31987b);}catch(_0x50924d){return console['error'](_0x50924d),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4e59cb,_0x28f37d=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1e4279=>{for(const _0x3d5af8 of _0x4e59cb)this['_knownOperations']['add'](_0x3d5af8),this['_addKnownRoot'](_0x3d5af8),_0x1e4279['batch']['addOperation'](_0x3d5af8),this['editor']['model']['applyOperation'](_0x3d5af8);});}['_addKnownRoot'](_0xc3a70e){const _0x31b172=this['_getAffectedRoot'](_0xc3a70e);_0x31b172&&this['_knownRootNames']['add'](_0x31b172);}['_getAffectedRoot'](_0x21213d){let _0x1a51e3,_0x2e6b08;switch(_0x21213d['type']){case'insert':_0x1a51e3=_0x21213d['position']['root'];break;case'marker':if(_0x2e6b08=_0x21213d['newRange'],!_0x2e6b08)return null;_0x1a51e3=_0x2e6b08['root'];break;case'addRootAttribute':_0x1a51e3=_0x21213d['root'];break;case'addRoot':_0x1a51e3=_0x21213d['affectedSelectable'];break;case'move':_0x1a51e3=_0x21213d['targetPosition']['root'];break;default:return null;}return _0x1a51e3['rootName'];}['_updateServerHistory'](_0x505c12){_0x505c12['forEach'](_0x39200e=>{const _0x12fc2c=_0x39200e['clone']();_0x12fc2c['_authorId']=_0x39200e['_authorId'],_0x12fc2c['_isInit']=!!_0x39200e['_isInit'],_0x12fc2c['createdAt']=_0x39200e['createdAt'],_0x12fc2c['baseVersion']+=this['_offset'],_0x39200e['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x12fc2c),this['serverHistory']['addOperation'](_0x12fc2c);});}['_handleReconnectionError'](_0x25f040){const _0x4613fb=this['editor']['plugins']['get']('Notification'),_0x58b072=this['editor']['locale'];_0x25f040||(_0x25f040=V(_0x58b072,'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.')),_0x4613fb['showWarning'](_0x25f040,{'title':V(_0x58b072,'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'](_0x4a177a)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x4a177a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5d7d54){const _0x59b0c8=_0x5d7d54['map'](_0x381fd1=>_0x381fd1['toJSON']());return this['_compressor']['compress'](_0x59b0c8);}['_decompressOperations'](_0x94cbe5,_0x4258e4){return this['_compressor']['decompress'](_0x94cbe5)['map']((_0x31320d,_0x58adbc)=>{const _0x3a7f89='init'==_0x4258e4[_0x58adbc]['type'];if('InsertOperation'==_0x31320d['__className']){const _0x391a0f=_0x31320d['position']['root'];!this['_document']['getRoot'](_0x391a0f)&&(this['_document']['createRoot']('$root',_0x391a0f)['_isAttached']=!0x1);}const _0x42e965=_0x208794['fromJSON'](_0x31320d,this['_document']);return _0x42e965['wasUndone']=_0x31320d['wasUndone'],_0x42e965['_isInit']=_0x3a7f89,_0x42e965['_authorId']=_0x3a7f89?null:_0x4258e4[_0x58adbc]['userId'],_0x42e965['_isDisconnection']='cs:removeUser'===_0x4258e4[_0x58adbc]['type'],_0x42e965['createdAt']=_0x4258e4[_0x58adbc]['createdAt'],_0x42e965;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3b8d74=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3b8d74&&_0x3b8d74['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class G extends Error{}function $(_0x2e04f6,_0x3c2715){for(const _0xc8238a of _0x2e04f6)_0xc8238a['baseVersion']=_0x3c2715++;}class K{['_ignoredOperations'];['_operationToId'];constructor(_0xe66ba2){this['_ignoredOperations']=_0xe66ba2,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x2274f2){let _0xbe3704=_0x2274f2['length'];for(;_0xbe3704--;){const _0x4510f3=_0x2274f2[_0xbe3704];if(!this['_ignoredOperations']['has'](_0x4510f3)){if(!this['_operationToId']['has'](_0x4510f3)){const _0x6513a3=_0x102894()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4510f3,_0x6513a3);}return this['_operationToId']['get'](_0x4510f3);}}}['setIdForTheLastOperation'](_0x3f00f0,_0x59eb33){if(!_0x59eb33)return;let _0x148669=_0x3f00f0['length'];for(;_0x148669--;){const _0x1eaf37=_0x3f00f0[_0x148669];this['_ignoredOperations']['has'](_0x1eaf37)||this['_operationToId']['set'](_0x1eaf37,_0x59eb33);}}}class a extends _0x1bf704{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x3214d6{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>et)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x501a96];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4411eb){super(_0x4411eb),this['_services']=new Map();}async['init'](){const _0x1345bb=this['context'],_0x4bb303=_0x1345bb['plugins']['get']('CommentsRepository');if(_0x1345bb['plugins']['get'](n)['addToReconnectionStack'](this),_0x4bb303['adapter']={'addCommentThread':async({channelId:_0x5ddc28,threadId:_0x28e9b6,comments:_0x3312cb,resolvedAt:_0x3da713,resolvedBy:_0x305cc9,context:_0x4dba53,attributes:_0x52b406})=>{const _0x57f824=await this['_getService'](_0x5ddc28)['addCommentThread']({'commentThreadId':_0x28e9b6,'comments':_0x3312cb['map'](_0x429ae4=>function(_0x4259cb,_0x393f48,_0x141505){return{'commentThreadId':_0x141505,'commentId':_0x4259cb['commentId'],'userId':_0x4259cb['authorId'],'content':_0x4259cb['content'],'documentId':_0x393f48,'createdAt':_0x4259cb['createdAt'],'attributes':_0x4259cb['attributes']||{}};}(_0x429ae4,_0x5ddc28,_0x28e9b6)),'resolvedAt':_0x3da713,'resolvedBy':_0x305cc9,'context':_0x4dba53,'attributes':_0x52b406})['catch'](ft);return{'threadId':_0x57f824['commentThreadId'],'comments':_0x57f824['comments']};},'getCommentThread':async({channelId:_0x419852,threadId:_0x343b0f})=>{const _0x5d3c6d=await this['_getService'](_0x419852)['getCommentThread'](_0x343b0f)['catch'](ot)['catch'](ft);return _0x5d3c6d?_0x5d3c6d['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5d3c6d]),{'threadId':_0x5d3c6d['commentThreadId'],'comments':_0x5d3c6d['comments']['map'](st),'context':_0x5d3c6d['context'],'resolvedAt':_0x5d3c6d['resolvedAt'],'resolvedBy':_0x5d3c6d['resolvedBy'],'attributes':_0x5d3c6d['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3317f2,threadId:_0x10f685,context:_0x363694,unlinkedAt:_0x52023e,attributes:_0xbb6325})=>this['_getService'](_0x3317f2)['updateCommentThread']({'commentThreadId':_0x10f685,'context':_0x363694,'attributes':_0xbb6325,'unlinkedAt':_0x52023e})['catch'](ot)['catch'](ft),'resolveCommentThread':async({channelId:_0x2329e5,threadId:_0x5f1a5b})=>{const _0x4fe79a=await this['_getService'](_0x2329e5)['resolveCommentThread'](_0x5f1a5b)['catch'](ot)['catch'](ft);return{'threadId':_0x4fe79a['commentThreadId'],'resolvedAt':_0x4fe79a['resolvedAt'],'resolvedBy':_0x4fe79a['resolvedBy']};},'reopenCommentThread':async({channelId:_0x43651c,threadId:_0x12d8fb})=>this['_getService'](_0x43651c)['reopenCommentThread'](_0x12d8fb)['catch'](ot)['catch'](ft),'removeCommentThread':({channelId:_0x556f58,threadId:_0xa0c803})=>this['_getService'](_0x556f58)['removeCommentThread'](_0xa0c803)['catch'](ot)['catch'](ft),'addComment':({channelId:_0x3d5972,threadId:_0x386e57,commentId:_0x28a7a9,content:_0x21640d,attributes:_0x1d36aa})=>this['_getService'](_0x3d5972)['addComment'](_0x386e57,_0x28a7a9,_0x21640d,_0x1d36aa)['catch'](ft),'updateComment':({channelId:_0x4d31f3,threadId:_0x30a711,commentId:_0x556721,content:_0x1d6f6f,attributes:_0x5be196})=>this['_getService'](_0x4d31f3)['updateComment'](_0x30a711,_0x556721,_0x1d6f6f,_0x5be196)['catch'](ot)['catch'](ft),'removeComment':({channelId:_0x557491,threadId:_0x39ba7f,commentId:_0x2bf84f})=>this['_getService'](_0x557491)['removeComment'](_0x39ba7f,_0x2bf84f)['catch'](ot)['catch'](ft)},_0x1345bb instanceof tt){const _0x21af38=_0x1345bb['config']['get']('collaboration.channelId'),_0x55877a=_0x1345bb['plugins']['get'](i);await this['_setUpService'](_0x21af38);const _0x3125d0=await this['_services']['get'](_0x21af38)['getConnectedSessions']();this['listenTo'](_0x55877a,'sessionAdd:'+_0x21af38,(_0x5046a3,{session:_0x591eb8})=>{_0x591eb8['id']===_0x55877a['mySessionId']&&(_0x5046a3['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x591eb8['permissions'],_0x21af38));}),_0x55877a['register'](_0x21af38,_0x3125d0);}}async['_setUpService'](_0x462d54){if(this['_services']['has'](_0x462d54))throw new _0x593b20('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x462d54});const _0x2b7902=this['context']['plugins']['get']('CommentsRepository'),_0x198c4c=new s['CommentsService'](_0x462d54);this['_services']['set'](_0x462d54,_0x198c4c),this['listenTo'](_0x198c4c,'commentThreadAdded',(_0x359984,_0x27ad32)=>{const {commentThreadId:_0x54de31,documentId:_0x36d5d1,context:_0x175c3e,attributes:_0xf37402,resolvedAt:_0xd7c38a,resolvedBy:_0x298296,comments:_0x590909}=_0x27ad32;_0x2b7902['getCommentThread'](_0x54de31)||_0x2b7902['addCommentThread']({'threadId':_0x54de31,'channelId':_0x36d5d1,'comments':_0x590909?_0x590909['map'](st):[],'context':_0x175c3e,'attributes':_0xf37402,'resolvedAt':_0xd7c38a,'resolvedBy':_0x298296,'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadUpdated',(_0x2f63f9,{commentThreadId:_0x23b35d,documentId:_0x3b9e0f,context:_0x4ec94e,unlinkedAt:_0x152606,attributes:_0x31afbc})=>{_0x2b7902['getCommentThread'](_0x23b35d)&&_0x2b7902['updateCommentThread']({'threadId':_0x23b35d,'channelId':_0x3b9e0f,'context':_0x4ec94e,'unlinkedAt':_0x152606,'attributes':_0x31afbc,'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadResolved',(_0x92859e,{commentThreadId:_0x40d4f5,resolvedBy:_0x23c3d9,resolvedAt:_0x2a9fc3})=>{const _0x3b43a9=_0x2b7902['getCommentThread'](_0x40d4f5);_0x3b43a9&&_0x3b43a9['resolve']({'resolvedBy':_0x23c3d9,'resolvedAt':_0x2a9fc3,'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadReopened',(_0x4f4d30,{commentThreadId:_0x550896})=>{const _0x40d356=_0x2b7902['getCommentThread'](_0x550896);_0x40d356&&_0x40d356['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadRemoved',(_0x2e59b0,{commentThreadId:_0x2f74cc})=>{const _0x261565=_0x2b7902['getCommentThread'](_0x2f74cc);_0x261565&&_0x261565['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentAdded',(_0x2570d9,_0x45e658)=>{const _0x448eae=_0x45e658['commentThreadId'],_0x15cf8f=_0x2b7902['getCommentThread'](_0x448eae);_0x15cf8f&&_0x15cf8f['addComment']({...st(_0x45e658),'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentUpdated',(_0x1090e8,{commentThreadId:_0x53b136,commentId:_0x51faa4,content:_0x45f6e7,attributes:_0x486e12})=>{const _0xfcc382=_0x2b7902['getCommentThread'](_0x53b136);if(_0xfcc382){const _0x5e43ed=_0xfcc382['getComment'](_0x51faa4);_0x5e43ed&&_0x5e43ed['update']({'content':_0x45f6e7,'attributes':_0x486e12,'isFromAdapter':!0x0});}}),this['listenTo'](_0x198c4c,'commentRemoved',(_0x3a7184,{commentThreadId:_0x56994b,commentId:_0x2f0ef5})=>{const _0x17ff0b=_0x2b7902['getCommentThread'](_0x56994b);if(_0x17ff0b){const _0x58587b=_0x17ff0b['getComment'](_0x2f0ef5);_0x58587b&&_0x58587b['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x462d54);}['destroy'](){if(this['context']instanceof tt){const _0x2292e7=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x2292e7);}}['_terminateService'](_0x4663e2){if(!this['_services']['has'](_0x4663e2))throw new _0x593b20('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4663e2});this['_getService'](_0x4663e2)['disconnect'](),this['_services']['delete'](_0x4663e2);}async['reconnect'](){for(const _0x5ef6d1 of this['_services']['keys']())await this['_connectService'](_0x5ef6d1);if(this['context']instanceof tt){const _0x467a54=this['context']['config']['get']('collaboration.channelId'),_0x5239f1=this['context']['plugins']['get'](i);_0x5239f1['unregister'](_0x467a54);const _0x135db4=await this['_services']['get'](_0x467a54)['getConnectedSessions']();_0x5239f1['register'](_0x467a54,_0x135db4);}}async['_connectService'](_0x4c0e0b){const {connection:_0x3d286e}=this['context']['plugins']['get'](n),_0x4d3cb8=this['context']['plugins']['get']('CommentsRepository'),_0x55928d=this['_services']['get'](_0x4c0e0b),_0x427925=await _0x55928d['connect'](_0x3d286e);await this['_fetchMissingUsersForThreads'](_0x427925);const _0x237b70=new Set(Array['from'](_0x4d3cb8['getCommentThreads']({'channelId':_0x4c0e0b}),_0x4380f8=>_0x4380f8['id']));for(const _0x220b61 of _0x427925)_0x220b61['deletedAt']||_0x237b70['delete'](_0x220b61['commentThreadId']);for(const _0x381100 of _0x237b70)_0x4d3cb8['getCommentThread'](_0x381100)['remove']({'isFromAdapter':!0x0});for(const _0x3cf6d2 of _0x427925){let _0x158616=_0x4d3cb8['getCommentThread'](_0x3cf6d2['commentThreadId']);const {commentThreadId:_0x4cd255,context:_0x3780eb,attributes:_0x58495c,resolvedBy:_0xe1a979,resolvedAt:_0x43af6e,unlinkedAt:_0x3b3a7f,deletedAt:_0x42461d}=_0x3cf6d2;if(_0x42461d)continue;_0x158616||(_0x158616=_0x4d3cb8['addCommentThread']({'channelId':_0x4c0e0b,'threadId':_0x4cd255,'context':_0x3780eb,'attributes':_0x58495c||{},'resolvedBy':_0xe1a979,'resolvedAt':_0x43af6e,'unlinkedAt':_0x3b3a7f,'isFromAdapter':!0x0}));const _0x1d0ee3=new Set(Array['from'](_0x158616['comments'],_0x54a937=>_0x54a937['id']));for(const _0x41349f of _0x3cf6d2['comments'])_0x1d0ee3['delete'](_0x41349f['commentId']);for(const _0x4d69d3 of _0x1d0ee3)_0x158616['getComment'](_0x4d69d3)['remove']({'isFromAdapter':!0x0});for(const _0x3259b0 of _0x3cf6d2['comments']){const _0x1f74e7=_0x158616['getComment'](_0x3259b0['commentId']);_0x1f74e7?_0x1f74e7['content']!==_0x3259b0['content']&&_0x1f74e7['update']({'content':_0x3259b0['content'],'isFromAdapter':!0x0}):_0x158616['addComment'](Object['assign'](st(_0x3259b0),{'isFromAdapter':!0x0}));}}}['_getService'](_0x380e2d){if(!this['_services']['has'](_0x380e2d))throw new _0x593b20('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x380e2d});return this['_services']['get'](_0x380e2d);}async['_fetchMissingUsersForThreads'](_0x303bd5){const _0x3deadc=this['context']['plugins']['get'](_0x501a96),{connection:_0x398aac}=this['context']['plugins']['get'](n),_0xf1e08e=new Set();for(const {resolvedBy:_0x2d9187,comments:_0x7292b2}of _0x303bd5){_0x2d9187&&!_0x3deadc['getUser'](_0x2d9187)&&_0xf1e08e['add'](_0x2d9187);for(const {userId:_0x37bec1}of _0x7292b2)_0x3deadc['getUser'](_0x37bec1)||_0xf1e08e['add'](_0x37bec1);}if(0x0===_0xf1e08e['size'])return;const _0x2f8699=await ut['getMany'](_0x398aac,Array['from'](_0xf1e08e));for(const _0x14a09f of _0x2f8699)_0x3deadc['getUser'](_0x14a09f['id'])||_0x3deadc['addUser'](_0x14a09f);}}async function ot(_0x26019b){if('404'!==_0x26019b['code'])throw _0x26019b;}function ft(_0x567290){if((_0x56899b=_0x567290)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x56899b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x56899b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x56899b;throw _0x567290;}function st(_0x55c7a5){return{'threadId':_0x55c7a5['commentThreadId'],'commentId':_0x55c7a5['commentId'],'content':_0x55c7a5['content'],'createdAt':_0x55c7a5['createdAt'],'authorId':_0x55c7a5['userId'],'attributes':_0x55c7a5['attributes']||{}};}class m extends _0x1bf704{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>it)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa98cac){super(_0xa98cac);const _0x16f045=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x16f045);}['init'](){const _0x2b4e6b=this['editor']['plugins']['get'](n),_0x9c6372=this['editor']['plugins']['get']('TrackChangesEditing');return _0x9c6372['adapter']={'getSuggestion':async _0x3f38b0=>{await this['_waitForServiceReady']();const _0x3e6cf2=await this['_trackChangesService']['get'](_0x3f38b0)['catch'](nt);return await this['_fetchMissingUsersForThreads']([_0x3e6cf2]),_0x3e6cf2;},'addSuggestion':async({id:_0x4e1797,type:_0xf561d9,data:_0xba54eb,originalSuggestionId:_0x39b416,attributes:_0x2e660b})=>{await this['_waitForServiceReady']();const _0x193bc1={'id':_0x4e1797,'type':_0xf561d9,'data':_0xba54eb,'originalSuggestionId':_0x39b416,'attributes':_0x2e660b},_0x4543b2=await this['_trackChangesService']['add'](_0x4e1797,_0xf561d9,_0xba54eb,_0x39b416,_0x2e660b)['catch'](_0x1ffb56=>{if(mt(_0x1ffb56))return new Promise(_0x22d3a5=>{this['_bufferedRequests']['set'](_0x4e1797,{'resolve':_0x22d3a5,'suggestionData':_0x193bc1});});throw _0x1ffb56;});return this['_bufferedRequests']['delete'](_0x4e1797),_0x4543b2;},'updateSuggestion':async(_0x156212,_0x56c5b7)=>{if(await this['_waitForServiceReady'](),'open'!==_0x56c5b7['state'])return this['_trackChangesService']['update'](_0x156212,_0x56c5b7)['catch'](nt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x37d7a5,_0x246850)=>{_0x9c6372['hasSuggestion'](_0x246850['id'])&&(_0x9c6372['getSuggestion'](_0x246850['id'])['attributes']=_0x246850['attributes']);}),this['_trackChangesService']['connect'](_0x2b4e6b['connection'])['then'](_0x456a4d=>(_0x2b4e6b['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x456a4d)['then'](()=>{for(const _0x32339e of _0x456a4d){_0x9c6372['addSuggestionData'](_0x32339e)['_saved']=!0x0;}})));}async['reconnect'](){const _0xaa5574=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x365736}=this['editor']['plugins']['get'](n),_0x683a70=await this['_trackChangesService']['connect'](_0x365736);await this['_fetchMissingUsersForThreads'](_0x683a70);for(const {suggestionData:_0x263494,resolve:_0x28cede}of this['_bufferedRequests']['values']()){let _0x45e734=_0x683a70['find'](_0x589eb9=>_0x589eb9['id']===_0x263494['id']);_0x45e734||(_0x45e734=await this['_trackChangesService']['add'](_0x263494['id'],_0x263494['type'],_0x263494['data'],_0x263494['originalSuggestionId'])),_0x28cede(_0x45e734);}for(const _0x5396d7 of _0x683a70)_0xaa5574['hasSuggestion'](_0x5396d7['id'])||_0xaa5574['addSuggestionData'](_0x5396d7);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x45c45c=>{this['listenTo'](this['_trackChangesService'],'connected',_0x515a46=>{_0x515a46['off'](),_0x45c45c();});});}async['_fetchMissingUsersForThreads'](_0x2c1301){const _0x135119=this['editor']['plugins']['get'](_0x501a96),{connection:_0xef7fa3}=this['editor']['plugins']['get'](n),_0x486258=new Set();for(const {authorId:_0x2e35f4}of _0x2c1301)_0x135119['getUser'](_0x2e35f4)||_0x486258['add'](_0x2e35f4);if(0x0===_0x486258['size'])return;const _0x4a24cb=await ut['getMany'](_0xef7fa3,Array['from'](_0x486258));for(const _0x1dcae1 of _0x4a24cb)_0x135119['getUser'](_0x1dcae1['id'])||_0x135119['addUser'](_0x1dcae1);}}function nt(_0x5356f9){if(mt(_0x5356f9))return new Promise(()=>{});throw _0x5356f9;}function mt(_0x4fd649){return _0x4fd649['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4fd649['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1bf704{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 _0x2846a6=this['editor']['plugins']['get'](n),_0x2f689c=this['editor']['plugins']['get']('CommentsEditing'),_0x49f45c=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2846a6,'change:state',(_0x1a31b9,_0x21a359,_0x33dad9)=>{_0x2f689c['isThreadsLoadingPaused']='connected'!==_0x33dad9;});}),this['listenTo'](_0x2846a6,'change:state',(_0x48b6cc,_0x695554,_0x24f566)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x24f566);}),_0x49f45c['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class pt extends _0x1bf704{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 _0x1bf704{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0xdca4cc)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x501a96];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x270e88){super(_0x270e88);const _0x478582=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x478582);}async['init'](){const _0x3ea15b=this['editor']['plugins']['get'](l),_0x13d392=_0x3ea15b['serverHistory'],_0x18b64d=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x13d392,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x3ea15b['sessionId']});const _0x3e1350=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x817af7=await _0x519c59['isBundleUploaded'](_0x18b64d['connection'],_0x3e1350);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x205c76})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x205c76)),'updateRevisions':async _0x46c6da=>{await this['_waitForServiceReady']();const _0x1ea440=this['_revisionTracker']['currentRevision'];if(_0x817af7&&0x1===_0x46c6da['length']&&_0x46c6da[0x0]['id']===_0x1ea440['id'])return _0x46c6da;for(const _0x172b8f of _0x46c6da)_0x172b8f['id']===_0x1ea440['id']&&(_0x172b8f['isEmptyCurrent']=_0x172b8f['fromVersion']===_0x172b8f['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x46c6da,this['_lastRequestId'])['then'](_0x502645=>(this['_lastRequestId']=_0x502645,_0x46c6da))['catch'](_0x4cfc4b=>{if(P(_0x4cfc4b)||'400'===_0x4cfc4b['code']&&void 0x0!==_0x4cfc4b['data']['wrongRequestId']){for(const _0x1f639d of _0x46c6da){!this['_revisionTracker']['repository']['getRevision'](_0x1f639d['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1f639d['id'],_0x1f639d,!0x1);}if(P(_0x4cfc4b))throw _0x4cfc4b;return _0x46c6da;}throw _0x4cfc4b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x11cb14,{revisionsData:_0x4bee97,requestId:_0x55049c})=>{Math['max'](..._0x4bee97['map'](_0x22242e=>_0x22242e['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x4bee97,_0x55049c);}):this['_handleRevisionsUpdate'](_0x4bee97,_0x55049c);});const {revisions:_0x57a2bd,requestId:_0x2dafe8}=await this['_revisionHistoryService']['connect'](_0x18b64d['connection']);_0x18b64d['addToReconnectionStack'](this),this['_lastRequestId']=_0x2dafe8,await this['_fetchMissingUsers'](_0x57a2bd);for(const _0x9c7f52 of _0x57a2bd)this['_revisionTracker']['addRevisionData'](_0x9c7f52);this['listenTo'](_0x3ea15b,'change:_isConnected',(_0x3ec3b8,_0x359744,_0x51a591)=>{_0x51a591&&(this['_oldOffset']=_0x3ea15b['_offset'],_0x3ec3b8['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x18b64d,'state',_0x3658fa=>_0x3658fa===_0x176d8f['CONNECTED']);}async['reconnect'](){const _0x22a737=this['editor']['plugins']['get'](n),_0xafd203=this['editor']['plugins']['get'](l),_0x5987ec=async()=>{const _0x4f93f9=this['_revisionTracker']['currentRevision'],_0x19742a=_0x4f93f9['id'],_0x2356d1=_0x19742a!==_0xafd203['sessionId'];if(_0x2356d1){const _0x1f6868=_0xafd203['_offset']-this['_oldOffset'],_0x1e820e=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x4f93f9['toVersion']+_0x1f6868!==_0x1e820e){const _0x1dc651=_0x4f93f9['fromVersion']+_0x1f6868,_0x5f4e65=this['editor']['plugins']['get'](_0x501a96),_0x4346cf=this['_revisionTracker']['buildRevisionData']({'revision':_0x4f93f9,'from':_0x1dc651,'to':_0x1e820e});_0x4346cf['id']=_0x4f93f9['id'];const _0x2e1b21=_0x4346cf['authorsIds']['map'](_0x481799=>_0x5f4e65['getUser'](_0x481799));_0x4f93f9['_update']({..._0x4346cf,'authors':_0x2e1b21},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4f93f9['id'],_0x4346cf,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1e820e,(_0x4f93f9['toVersion']===_0x4f93f9['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x19742a)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x19742a),this['_revisionTracker']['_createCurrentRevision'](_0x1e820e));}const {revisions:_0x7a1d35,requestId:_0x479d39}=await this['_revisionHistoryService']['reconnect'](_0x22a737['connection'],this['_lastRequestId']);_0x2356d1&&_0x7a1d35['length']>0x0?_0xafd203['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x7a1d35),this['_handleRevisionsUpdate'](_0x7a1d35,_0x479d39),this['_revisionTracker']['sendBufferedUpdates']());};return _0xafd203['_isConnected']?_0x5987ec():new Promise((_0x159236,_0x3c7847)=>{_0xafd203['once']('change:_isConnected',()=>{_0x5987ec()['then'](_0x159236)['catch'](_0x3c7847);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x8e862e=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x510b66=>{_0x510b66['off'](),_0x8e862e();});});}['_getLatestVersionFromServerOperations'](){const _0x5bb2f3=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x58e172 of _0x5bb2f3)if('marker'!==_0x58e172['type']||_0x58e172['affectsData'])return _0x58e172['baseVersion']+0x1;}['_getLatestVersion'](){const _0x4cc358=this['editor']['plugins']['get'](l);return new Promise(_0x2ead9e=>{_0x4cc358['_isPendingUpdate']?_0x4cc358['once']('change:_isPendingUpdate',()=>{_0x2ead9e(this['_getLatestVersionFromServerOperations']());}):_0x2ead9e(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x17460a,_0x4e1e8c){const _0x32841c=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x4e1e8c;for(const _0x16e41f of _0x17460a){const _0x301f14=_0x32841c['getRevision'](_0x16e41f['id']);if(_0x301f14){if((_0x16e41f['fromVersion']||_0x16e41f['toVersion'])&&(_0x16e41f['diffData']=null),_0x301f14===this['_revisionTracker']['currentRevision']){const _0x33b0f6=Math['max'](_0x301f14['toVersion'],_0x16e41f['toVersion']),_0x2dcdc2=Math['max'](_0x301f14['fromVersion'],_0x16e41f['fromVersion']);let _0x57f962;_0x301f14['toVersion']===_0x16e41f['toVersion']&&_0x301f14['fromVersion']===_0x16e41f['fromVersion']?(_0x57f962=!0x0,this['_preventResendingRevisionData'](_0x16e41f)):_0x16e41f['toVersion']===_0x33b0f6&&_0x16e41f['fromVersion']===_0x2dcdc2?_0x57f962=!0x1:(_0x301f14['toVersion']===_0x33b0f6&&_0x301f14['fromVersion']===_0x2dcdc2||this['_fixRevision']({'revision':_0x301f14,'from':_0x2dcdc2,'to':_0x33b0f6}),_0x57f962=!0x0),_0x57f962&&(delete _0x16e41f['fromVersion'],delete _0x16e41f['toVersion'],delete _0x16e41f['diffData'],delete _0x16e41f['createdAt'],delete _0x16e41f['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x16e41f),this['_preventResendingRevisionData'](_0x16e41f);}else this['_revisionTracker']['addRevisionData'](_0x16e41f);}const _0x44c0db=_0x32841c['getRevisions']();_0x44c0db['reverse']();for(let _0x1c708d=0x0;_0x1c708d<_0x44c0db['length']-0x1;_0x1c708d++){const _0x201a5f=_0x44c0db[_0x1c708d],_0x3253b0=_0x44c0db[_0x1c708d+0x1];if(_0x201a5f['fromVersion']<_0x3253b0['toVersion']){const _0x4030df=_0x3253b0['toVersion'],_0x359f8e=Math['max'](_0x4030df,_0x201a5f['toVersion']);this['_fixRevision']({'revision':_0x201a5f,'from':_0x4030df,'to':_0x359f8e});}}}['_fixRevision']({revision:_0x240f94,from:_0x1be048,to:_0x19b65d}={}){const _0x252b25=this['editor']['plugins']['get'](_0x501a96),_0x4fe127=this['_revisionTracker']['buildRevisionData']({'revision':_0x240f94,'from':_0x1be048,'to':_0x19b65d});_0x4fe127['authors']=_0x4fe127['authorsIds']['map'](_0x4ee02f=>_0x252b25['getUser'](_0x4ee02f)),_0x240f94['_update'](_0x4fe127);}['_preventResendingRevisionData'](_0x477e4b){const _0x4f4e22={};_0x4f4e22['id']=_0x477e4b['id'];for(const _0x57d5f0 of Object['keys'](_0x477e4b))'id'!==_0x57d5f0&&(_0x4f4e22[_0x57d5f0]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4f4e22['id'],_0x4f4e22,!0x0);}async['_fetchMissingUsers'](_0x3b8779){const _0x3425c1=this['editor']['plugins']['get'](_0x501a96),{connection:_0x4f2174}=this['editor']['plugins']['get'](n),_0x1ba18e=new Set();for(const _0x45411e of _0x3b8779){for(const _0x443d73 of _0x45411e['authorsIds'])_0x4c0fce(_0x443d73);_0x45411e['creatorId']&&_0x4c0fce(_0x45411e['creatorId']);}if(0x0===_0x1ba18e['size'])return;const _0x323330=await ut['getMany'](_0x4f2174,Array['from'](_0x1ba18e));for(const _0x50fb4a of _0x323330)_0x3425c1['getUser'](_0x50fb4a['id'])||_0x3425c1['addUser'](_0x50fb4a);function _0x4c0fce(_0x316c3b){_0x3425c1['getUser'](_0x316c3b)||_0x1ba18e['add'](_0x316c3b);}}}function P(_0x41fff8){return _0x41fff8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x41fff8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41fff8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x1bf704{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x16db83{['_collapseAt'];constructor(_0x599dd3,_0x550bd1=0x6){super(_0x599dd3);const _0x4f2af9=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x550bd1,this['bind']('isHidden')['to'](this,'usersCount',_0x470aa0=>_0x470aa0<_0x550bd1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4f2af9['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':_0x4f2af9['to']('usersCount',_0x1bbb06=>'+'+(_0x1bbb06-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x16db83{['items'];['keystrokes'];constructor(_0x5cb08f){super(_0x5cb08f);const _0xd3408d=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x215678(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0xd3408d['if']('hasPopup'),'aria-expanded':_0xd3408d['to']('isExpanded',_0x148a29=>this['hasPopup']&&String(_0x148a29)),'aria-label':_0xd3408d['to']('hasPopup',_0x338c47=>V(_0x5cb08f,_0x338c47?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0xd3408d['to']('hasPopup',_0x92e4c9=>!!_0x92e4c9&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0xd3408d['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0xd3408d['to'](_0x199895=>{const _0x58c7ba=_0x199895,_0x222daf=document['querySelector']('.ck-presence-list__dropdown-list'),_0x2ea261=document['querySelector']('.ck-balloon-panel_with-arrow');_0x222daf?.['contains'](_0x58c7ba['relatedTarget'])||_0x2ea261?.['contains'](_0x58c7ba['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x11e6d4,_0x1e3c17,_0x58b41d)=>{this['element']&&(_0x58b41d?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x16db83{['counterView'];['inlineListView'];constructor(_0x4f427b,_0x4d12ea=0x6){super(_0x4f427b);const _0x4197c6=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x4d12ea),this['inlineListView']=new is(_0x4f427b),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x142aa8 of this['inlineListView']['items'])_0x142aa8['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',_0x4197c6['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x16db83{['listWrapperView'];constructor(_0x3dae92,_0x5269fa){super(_0x3dae92);const _0x5d0f7d=this['bindTemplate'];this['listWrapperView']=new wt(_0x3dae92,_0x5269fa),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x3dae92,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5d0f7d['to'](_0xb4cf24=>{const _0x1e31ec=_0xb4cf24,_0x3176ab=document['querySelector']('.ck-presence-list__list'),_0x51e4dd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3176ab?.['contains'](_0x1e31ec['relatedTarget'])||_0x51e4dd?.['contains'](_0x1e31ec['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x61da62{constructor(_0x3faf5a,_0x4163e3){super(_0x3faf5a);const _0x3623a2=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4163e3?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3623a2['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3623a2['to']('role'),'aria-label':_0x3623a2['to']('ariaLabel'),'aria-labelledby':_0x3623a2['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xfff1fd['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3a6f21=this['element'];_0x3a6f21&&(this['_isScrollable']=Math['max'](_0x3a6f21['scrollHeight'],_0x3a6f21['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x38ae6a,_0x48e6c7,_0x55cf52){super(_0x38ae6a);const _0x5e9d68=this['bindTemplate'];this['userView']=new ct(_0x38ae6a,_0x48e6c7);const _0x31e2a2={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x48e6c7['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x48e6c7['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x48e6c7['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x55cf52&&(_0x31e2a2['tag']='button',_0x31e2a2['on']={'click':_0x5e9d68['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x31e2a2);}['focus'](){this['element']['focus']();}}class A extends _0x16db83{['userView'];['markerView'];constructor(_0xfc8ba0,_0x39cb42,_0x320b1d){super(_0xfc8ba0);const _0x1a3fea=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0xfc8ba0,_0x39cb42),this['markerView']=new lt(_0xfc8ba0,_0x39cb42);const _0x67e9b2=new at(_0xfc8ba0);_0x67e9b2['template']['tag']='span',_0x67e9b2['text']=_0x39cb42['name'];const _0x46cd84={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1a3fea['to']('isFocusable',_0x43f426=>!!_0x43f426&&0x0),'aria-labelledby':_0x67e9b2['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1a3fea['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1a3fea['to']('hasTooltip',_0x422416=>!_0x422416),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x67e9b2]};_0x320b1d&&(_0x46cd84['tag']='button',_0x46cd84['on']={'click':_0x1a3fea['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x46cd84);}}class lt extends _0x16db83{constructor(_0x2f045a,_0x25b707){super(_0x2f045a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x25b707['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x3214d6{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39215e){super(_0x39215e),this['context']['config']['define']('presenceList',x);const _0x1aa6a1=_0x39215e['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1aa6a1)throw new _0x593b20('presencelist-collapseat-invalid-format',this);if(_0x1aa6a1<0x1)throw new _0x593b20('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1216b9(),this['balloonPanelView']=new _0x3afab7(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x3cfa57 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x3cfa57);this['listenTo'](this['_allConnectedUsers'],'add',(_0x41c440,_0x470e1d)=>{this['_handleUserAdd'](_0x470e1d);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0xfcad97,_0x3d2926)=>{this['_handleUserRemove'](_0x3d2926);});}['_createView'](){const _0x1a1e15=this['context'],_0x3834a2=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xecf69a=this['balloonPanelView'];if(!_0xff7fb5(_0x1a1e15['config']['get']('presenceList.container')))throw new _0x593b20('presencelist-missing-container',this);return _0x3834a2['counterView']['bind']('usersCount')['to'](this),_0x3834a2['bind']('isCollapsed')['to'](this,'usersCount',_0x64677c=>{const {collapseAt:_0xad7eb3}=_0x1a1e15['config']['get']('presenceList'),_0x3651e0=_0x64677c>=_0xad7eb3;if(_0x3651e0&&!_0x3834a2['inlineListView']['items']['find'](_0x5d498a=>_0x5d498a instanceof b)){const _0x1ef51b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x1ef51b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3834a2['inlineListView']['items']['add'](_0x3834a2['counterView']);}return _0x3651e0||this['hideDropdown'](),_0x3651e0;}),_0x3834a2['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x190400=>{const _0x104b77=_0x1a1e15['config']['get']('presenceList'),_0xadacba=new A(_0x1a1e15['locale'],_0x190400,!!_0x104b77['onClick']);return _0xadacba['bind']('hasTooltip')['to'](_0x3834a2,'isCollapsed',_0x44b8ec=>!_0x44b8ec),_0xadacba['bind']('isFocusable')['to'](_0x3834a2,'isCollapsed',_0x1450a3=>!_0x1450a3),_0x104b77['onClick']&&this['listenTo'](_0xadacba,'execute',()=>{this['view']['isCollapsed']||_0x104b77['onClick'](_0x190400,_0xadacba['element']);}),_0xadacba;}),this['listenTo'](_0x3834a2['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3834a2['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3834a2['inlineListView']['keystrokes']['set']('Enter',(_0x6eb1d,_0x26483d)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x26483d());}),_0x3834a2['render'](),_0xecf69a['render'](),_0x13d43c({'emitter':_0x3834a2,'activator':()=>_0xecf69a['isVisible'],'contextElements':[_0xecf69a['element'],_0x3834a2['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1a1e15['config']['get']('presenceList.container')['appendChild'](_0x3834a2['element']),this['_bodyCollection']=new _0x168d9c(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3834a2;}['_handleUserAdd'](_0x3679b0){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3679b0['isMe'])return;const _0x12297e=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x12297e-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x54e614=_0x3679b0['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3679b0,_0x54e614);}['_handleUserRemove'](_0x516c95){this['usersCount']--;const {collapseAt:_0x2c4b10}=this['context']['config']['get']('presenceList'),_0x118222=this['usersCount']>=_0x2c4b10;if(this['currentDisplayedUsers']['get'](_0x516c95['id']))this['currentDisplayedUsers']['remove'](_0x516c95['id']);else{if(_0x118222&&this['currentDisplayedUsers']['length']+0x1===_0x2c4b10-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x118222?0x1:0x0)<this['usersCount']){for(const _0x5d9c68 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5d9c68['id'])&&(this['currentDisplayedUsers']['add'](_0x5d9c68,Math['min'](this['currentDisplayedUsers']['length']-(_0x118222?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x118222?0x1:0x0)===_0x2c4b10-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x494ce4=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x494ce4['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1a27c7}=this['presenceDropdownView'];_0x1a27c7['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x456ce2=>{if(!_0x494ce4['displayMe']&&_0x456ce2['isMe'])return null;const _0x470b64=new j(this['context']['locale'],_0x456ce2,!!_0x494ce4['onClick']);return _0x494ce4['onClick']&&this['listenTo'](_0x470b64,'execute',()=>{_0x494ce4['onClick'](_0x456ce2,_0x470b64['element']);}),_0x470b64;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1a27c7['focus'](),_0x1a27c7['checkIfScrollable']();const _0x3a4a61=(_0x2e0c11,_0x477969)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x477969();};_0x1a27c7['keystrokes']['set']('Esc',_0x3a4a61),_0x1a27c7['keystrokes']['set']('Shift+Tab',_0x3a4a61),_0x1a27c7['keystrokes']['set']('Tab',(_0x2ec611,_0x1af031)=>{!function(_0x296f13){const _0x225fc2=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x7e3bdd=>_0x7e3bdd+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x5da8da=[...document['body']['querySelectorAll'](_0x225fc2)]['filter'](_0x35a3db=>_0x35a3db===document['activeElement']||_0x35a3db['offsetWidth']+_0x35a3db['offsetHeight']>0x0)['sort']((_0xb9df72,_0x250d4a)=>(_0xb9df72['tabIndex']||0x0)-(_0x250d4a['tabIndex']||0x0)),_0x19dd3e=_0x5da8da['indexOf'](_0x296f13),_0x4f95f6=_0x5da8da[(_0x19dd3e+0x1)%_0x5da8da['length']];_0x4f95f6&&_0x4f95f6['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1af031();}),_0x1a27c7['focusTracker']['add'](this['view']['element']),_0x1a27c7['focusTracker']['on']('change:isFocused',(_0x1c39d7,_0x5d2b24,_0x21b941)=>{_0x21b941||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 vt extends _0x3214d6{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,vt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,pt as 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':_0x5538c4=>0x1!=_0x5538c4}};
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':_0x6f10d7=>0x1!=_0x6f10d7}};