@ckeditor/ckeditor5-real-time-collaboration 43.3.0-alpha.10 → 43.3.0-alpha.12

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 (168) 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/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +9 -9
  148. package/src/common-translations.js +1 -1
  149. package/src/index.js +1 -1
  150. package/src/presencelist/presencelistui.js +1 -1
  151. package/src/presencelist/view/presencecounterview.js +1 -1
  152. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  153. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  154. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  155. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  156. package/src/presencelist/view/presencelistview.js +1 -1
  157. package/src/presencelist.js +1 -1
  158. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  159. package/src/realtimecollaborativecomments.js +1 -1
  160. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  161. package/src/realtimecollaborativeediting/sessions.js +1 -1
  162. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  163. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  164. package/src/realtimecollaborativeediting.js +1 -1
  165. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  166. package/src/realtimecollaborativerevisionhistory.js +1 -1
  167. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  168. 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 _0x94ed29,Plugin as _0xa7e79e,PendingActions as _0x57a4dc,Context as _0x133312}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0xe3439e,CKEditorError as _0x402bb1,Collection as _0x5e53f5,global as _0xb3f1c4,version as nt,uid as _0x13d6cb,KeystrokeHandler as _0x32bfc6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3b4d8c,View as _0x3bbe01,ListView as _0x29cf5c,ListItemView as et,LabelView as ot,BalloonPanelView as _0x3531c3,clickOutsideHandler as _0x963ce1,BodyCollection as _0x512c22}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as at,History as _0x56a29d,NoOperation as _0x1fa717,InsertOperation as _0x39b9da,MarkerOperation as _0x242c44,RootAttributeOperation as _0x353684,transformSets as _0x1f60b8,OperationFactory as _0x4c7bf3}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as _0x5c645a,CollaborativeEditingService as _0x3cc14d,User as lt,CommentsService as _0x2970dd,TrackChangesService as st,RevisionHistoryService as _0x47a496,EditorService as _0x541637}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x404f8d,UserView as rt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x75a60b}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x4e3181}from'lodash-es';class c extends _0x94ed29{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3b4d8c];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x366db1){super(_0x366db1),this['set']('state',_0x5c645a['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0xe3439e);}['init'](){const _0x5d8afd=this['context'],_0x558d9e=_0x5d8afd['plugins']['get']('CloudServices'),_0xec7e2d=_0x5d8afd['plugins']['get'](_0x3b4d8c);if(!_0x558d9e['token'])throw new _0x402bb1('websocketgateway-missing-token',this);if(!_0x558d9e['webSocketUrl'])throw new _0x402bb1('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x558d9e['token'],_0x558d9e['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x56ca25=>{if(this['connection']=_0x56ca25,this['bind']('state')['to'](_0x56ca25,'state',this,'_isBrowserOffline',(_0x3d6745,_0x570a87)=>('connected'!==_0x3d6745&&(this['_shouldPluginsReconnect']=!0x0),_0x570a87||_0x3d6745!==_0x5c645a['CONNECTED']?_0x5c645a['DISCONNECTED']:this['state']==_0x5c645a['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x5c645a['CONNECTING']):_0x5c645a['CONNECTED'])),this['connection']['on']('error',(_0x24f1d5,_0x3cf492)=>{if('limitExceeded'!==_0x3cf492['code'])throw console['error'](_0x3cf492),new _0x402bb1('cloudservices-init',null,{'originalError':_0x3cf492});_0xec7e2d['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'});}),!_0x56ca25['me'])return new Promise(_0x2cc90f=>_0x56ca25['on']('change:me',_0x2cc90f));})['catch'](_0x24fcd6=>{throw console['error'](_0x24fcd6),new _0x402bb1('cloudservices-init',null,{'originalError':_0x24fcd6});});}['addToReconnectionStack'](_0x1731a4){if('function'!=typeof _0x1731a4['reconnect'])throw new _0x402bb1('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1731a4))throw new _0x402bb1('websocketgateway-plugin-already-registered',this,{'name':_0x1731a4['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1731a4);}['removeFromReconnectionStack'](_0x3a442f){this['_reconnectionStack']['delete'](_0x3a442f);}['isInReconnectionStack'](_0xb873c1){return this['_reconnectionStack']['has'](_0xb873c1);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x46c560=>_0x46c560['reconnect']())))['then'](()=>this['state']=_0x5c645a['CONNECTED'])['catch'](_0x201ebe=>{throw console['error'](_0x201ebe),new _0x402bb1('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x5c645a['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x94ed29{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x404f8d];}constructor(_0x33a268){super(_0x33a268),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5e53f5(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x404f8d);}['init'](){const _0x2b6ce8=this['context']['plugins']['get'](c);this['listenTo'](_0x2b6ce8,'change:state',(_0x2867e1,_0x4e2166,_0x281b30)=>{if('connected'!==_0x281b30)this['channelSessions']['forEach'](_0x2298cd=>_0x2298cd['clear']()),this['channelConnectedUsers']['forEach'](_0xa9e6a4=>_0xa9e6a4['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x49fc24,_0x2cb51e]of this['_registeredSessions'])for(const _0x3c7375 of _0x2cb51e)this['_handleSessionAdd'](_0x49fc24,_0x3c7375);}}),this['_createUser'](_0x2b6ce8['connection']['me'],!0x0);}['register'](_0x295b45,_0x583de7){if(this['_registeredSessions']['has'](_0x295b45))throw new _0x402bb1('sessions-register-already-registered',null,{'channelId':_0x295b45});this['_registeredSessions']['set'](_0x295b45,_0x583de7),this['channelSessions']['set'](_0x295b45,new _0x5e53f5()),this['channelConnectedUsers']['set'](_0x295b45,new _0x5e53f5()),this['listenTo'](_0x583de7,'add',(_0x469544,_0x49d93d)=>this['_handleSessionAdd'](_0x295b45,_0x49d93d)),this['listenTo'](_0x583de7,'remove',(_0x3ecf4f,_0xc5f479)=>this['_handleSessionRemove'](_0x295b45,_0xc5f479));for(const _0x1aa97e of _0x583de7)this['_handleSessionAdd'](_0x295b45,_0x1aa97e);}['unregister'](_0x4f8e25){if(!this['_registeredSessions']['has'](_0x4f8e25))throw new _0x402bb1('sessions-unregister-not-exist',null,{'channelId':_0x4f8e25});const _0x1987fb=this['_registeredSessions']['get'](_0x4f8e25);this['stopListening'](_0x1987fb);for(const _0x3d3008 of _0x1987fb)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x4f8e25,_0x3d3008);this['_registeredSessions']['delete'](_0x4f8e25),this['channelSessions']['delete'](_0x4f8e25),this['channelConnectedUsers']['delete'](_0x4f8e25);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x1700c3){for(const _0x5b1289 of this['channelSessions']['values']())for(const _0x20fa05 of _0x5b1289)if(_0x20fa05['id']===_0x1700c3)return _0x20fa05['user'];}['getUserSessions'](_0x244bb0,_0x5b2364){const _0x1a049a=_0x5b2364?[this['channelSessions']['get'](_0x5b2364)]:this['channelSessions']['values'](),_0x2da7d0=new Set();for(const _0x253ea5 of _0x1a049a)for(const _0x4e3011 of _0x253ea5)_0x4e3011['user']['id']===_0x244bb0['id']&&_0x2da7d0['add'](_0x4e3011['id']);return _0x2da7d0;}['getUserRole'](_0x15d6a1){for(const _0x2922e8 of this['channelSessions']['values']())for(const _0x5548d2 of _0x2922e8)if(_0x5548d2['user']===_0x15d6a1)return _0x5548d2['role'];}['_handleSessionAdd'](_0x18dcc7,_0x50d6ea){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x31b5e0=_0x50d6ea['user'],_0x3108ec=this['_users']['getUser'](_0x31b5e0['id'])||this['_createUser'](_0x31b5e0),_0x57460c=Object['assign']({},_0x50d6ea,{'user':_0x3108ec});this['channelSessions']['get'](_0x18dcc7)['add'](_0x57460c);const _0x32b0ef=this['channelConnectedUsers']['get'](_0x18dcc7);_0x32b0ef['has'](_0x3108ec['id'])||_0x32b0ef['add'](_0x3108ec),this['allConnectedUsers']['has'](_0x3108ec['id'])||this['allConnectedUsers']['add'](_0x3108ec,_0x3108ec['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x18dcc7,{'channelId':_0x18dcc7,'session':_0x57460c});}['_handleSessionRemove'](_0x2e758a,_0xe02dd3){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x3799e0=this['channelConnectedUsers']['get'](_0x2e758a),_0x5898d7=_0xe02dd3['user'];_0x5898d7['id']&&(this['channelSessions']['get'](_0x2e758a)['remove'](_0xe02dd3['id']),_0x3799e0['has'](_0x5898d7['id'])&&!this['getUserSessions'](_0x5898d7,_0x2e758a)['size']&&_0x3799e0['remove'](_0x5898d7['id']),this['allConnectedUsers']['get'](_0x5898d7['id'])&&!this['getUserSessions'](_0x5898d7)['size']&&this['allConnectedUsers']['remove'](_0x5898d7['id']));}['_createUser'](_0x34bc3f,_0x3963b8){const _0x86fa68=this['_users']['addUser'](_0x34bc3f);return _0x3963b8&&this['_users']['defineMe'](_0x34bc3f['id']),_0x86fa68['orderNumber']=this['_uniqueUsersCount']++,_0x86fa68;}}class K extends _0xa7e79e{['_domEmitter']=new(_0xe3439e())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2b3d9b=this['editor'],_0x5e629b=_0x2b3d9b['plugins']['get'](i);_0x2b3d9b['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x859f64,{writer:_0xa72e75})=>function(_0x5cf948,_0x524b23,_0x4fecb4,_0x164bd3){const _0x2166d0=_0x5cf948['markerName']['split'](':')[0x2],_0x56567b=_0x4fecb4['getUserBySessionId'](_0x2166d0);if(!_0x56567b||_0x2166d0===_0x4fecb4['mySessionId'])return;if(!_0x164bd3['model']['schema']['checkChild'](_0x5cf948['markerRange']['start'],'$text'))return;const _0x53506a={'class':'ck-user__marker\x20'+_0x56567b['color']['getMarkerClass'](),'data-name':_0x56567b['name'],'data-session-id':_0x2166d0},_0x2f9afa=_0x164bd3['model']['markers']['get'](_0x5cf948['markerName']),_0x43ae1f=_0x2f9afa['getStart'](),_0x24a19e=_0x43ae1f['nodeAfter'],_0x4e42ae=_0x164bd3['model']['schema'];if(_0x24a19e&&_0x4e42ae['isObject'](_0x24a19e)&&_0x4e42ae['isInline'](_0x24a19e)&&!_0x164bd3['model']['markers']['get']('user:range:'+_0x2166d0)['getRange']()['isCollapsed'])return;const _0x156d3f=_0x43ae1f['parent'];return _0x164bd3['model']['schema']['isLimit'](_0x156d3f)&&!_0x164bd3['model']['hasContent'](_0x156d3f)&&(_0x53506a['contenteditable']=!0x1),function(_0x1d9cdf,_0x341527,_0x4b4a02){const _0x1743c2=_0x1d9cdf['createUIElement']('span',_0x341527);return _0x1d9cdf['setCustomProperty']('userPositionMarker',!0x0,_0x1743c2),_0x1743c2['render']=function(_0x525938){const _0x423a50=this['toDomElement'](_0x525938);return _0x423a50['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x4b4a02['name']+'</span>⁠',_0x423a50['addEventListener']('mouseenter',()=>{_0x423a50['classList']['add']('ck-user__marker_hovered');}),_0x423a50['addEventListener']('mouseleave',()=>{_0x423a50['classList']['remove']('ck-user__marker_hovered');}),_0x423a50;},_0x1743c2['isSimilar']=function(_0x11ed3d){return!(!this['getCustomProperty']('userPositionMarker')||!_0x11ed3d['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x11ed3d['getAttribute']('data-session-id'));},_0x1743c2;}(_0x524b23,_0x53506a,_0x56567b);}(_0x859f64,_0xa72e75,_0x5e629b,_0x2b3d9b)}),_0x2b3d9b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x53571d=>function(_0x3121c1,_0x1ea013){const _0x59b21a=_0x3121c1['markerName']['split'](':')[0x2];if(_0x59b21a===_0x1ea013['mySessionId'])return null;const _0x3f4a71=_0x1ea013['getUserBySessionId'](_0x59b21a);if(!_0x3f4a71)return{'id':_0x59b21a,'classes':[]};return{'id':_0x59b21a,'classes':['ck-user__selection',_0x3f4a71['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x59b21a},'priority':0x7d0+_0x3f4a71['orderNumber']};}(_0x53571d,_0x5e629b)}),function(_0x330b5f){const _0x5e76f7=_0x330b5f['model'],_0x381eb2=new Map(),_0xd4462b=_0x330b5f['plugins']['get'](i);_0x5e76f7['markers']['on']('update:user:range',(_0x3c2f42,_0x4fcf35,_0x2f47d5,_0x27b1e5)=>{if(!_0x27b1e5&&_0x381eb2['get'](_0x4fcf35['name']))return _0x381eb2['get'](_0x4fcf35['name'])['detach'](),void _0x381eb2['delete'](_0x4fcf35['name']);const _0x1e2068=_0x4fcf35['name']['split'](':')[0x2];if(_0x1e2068===_0xd4462b['mySessionId'])return;const _0x28461f='user:position:'+_0x1e2068;_0x5e76f7['markers']['has'](_0x28461f)&&_0x330b5f['editing']['reconvertMarker'](_0x28461f),_0x4fcf35['on']('change:range',(_0x576a8b,_0x3f4509,_0x309051)=>{if('$graveyard'!=_0x3f4509['root']['rootName']&&'$graveyard'==_0x4fcf35['getRange']()['root']['rootName']&&!_0x381eb2['has'](_0x4fcf35['name'])){const _0x5c987d=_0x5e76f7['schema']['getNearestSelectionRange'](_0x309051['deletionPosition']);if(_0x5c987d){const _0xb61f01=at['fromRange'](_0x5c987d);_0x381eb2['set'](_0x4fcf35['name'],_0xb61f01),_0xb61f01['on']('change:range',(_0x751c30,_0x391474,_0x3375ec)=>{if('$graveyard'==_0xb61f01['root']['rootName']){const _0xab8edd=_0x5e76f7['schema']['getNearestSelectionRange'](_0x3375ec['deletionPosition']);_0xab8edd?(_0xb61f01['start']=_0xab8edd['start'],_0xb61f01['end']=_0xab8edd['end']):(_0x381eb2['delete'](_0x4fcf35['name']),_0xb61f01['detach']());}});}}});}),_0x5e76f7['document']['on']('change',()=>{_0x381eb2['size']>0x0&&_0x5e76f7['enqueueChange']({'isUndoable':!0x1},_0xd10894=>{for(const [_0x5512b6,_0x545415]of _0x381eb2)'$graveyard'==_0x5e76f7['markers']['get'](_0x5512b6)['getRange']()['root']['rootName']&&(te(_0x5512b6['split'](':')[0x2],_0x545415['toRange'](),_0x5e76f7,_0xd10894),_0x545415['detach']());_0x381eb2['clear']();});});}(_0x2b3d9b),this['_domEmitter']['listenTo'](_0xb3f1c4['document'],'keydown',(_0x337aee,{key:_0x93670a})=>{'Escape'===_0x93670a&&function(_0x826405){_0x826405['editing']['view']['change'](_0xb8e787=>{for(const _0x500260 of _0x826405['model']['markers']){if(!_0x500260['name']['startsWith']('user:position'))continue;const _0x89f1cb=_0x826405['editing']['mapper']['markerNameToElements'](_0x500260['name']);if(_0x89f1cb){for(const _0x1e066c of _0x89f1cb)_0xb8e787['removeClass']('ck-user__marker_hovered',_0x1e066c);}}});}(_0x2b3d9b);},{'useCapture':!0x0});}['afterInit'](){const _0x5d58df=this['editor'],_0x4ae7b2=_0x5d58df['commands']['get']('undo');_0x4ae7b2&&_0x5d58df['model']['on']('applyOperation',(_0x293ee0,_0x3a73ca)=>{const _0x29df96=_0x3a73ca[0x0];if('marker'!=_0x29df96['type']||!_0x29df96['name']['startsWith']('user:'))return;const _0x56ebba=_0x29df96['batch'];_0x4ae7b2['_createdBatches']['has'](_0x56ebba)&&(_0x29df96['newRange']=_0x29df96['oldRange']?_0x5d58df['model']['createRange'](_0x29df96['oldRange']['start'],_0x29df96['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x302d2a=this['editor'],_0x1ebdac=_0x302d2a['model']['document'],_0x9f69e2=_0x302d2a['plugins']['get'](i);_0x302d2a['model']['enqueueChange']({'isUndoable':!0x1},_0x306bbd=>{const _0x2d0ecf='user:range:'+_0x9f69e2['mySessionId'],_0x5ecea0='user:position:'+_0x9f69e2['mySessionId'],_0x1b039d=_0x302d2a['model']['markers']['has'](_0x2d0ecf);_0x302d2a['editing']['view']['hasDomSelection']?te(_0x9f69e2['mySessionId'],_0x1ebdac['selection']['getFirstRange'](),_0x302d2a['model'],_0x306bbd):_0x1b039d&&(_0x306bbd['removeMarker'](_0x2d0ecf),_0x306bbd['removeMarker'](_0x5ecea0));});}}function te(_0x5bf343,_0x651d27,_0x4e8a9b,_0x243ea8){const _0xb6c994='user:range:'+_0x5bf343,_0x1f4785='user:position:'+_0x5bf343,_0x4543aa=_0x651d27['getContainedElement']();let _0x3a3687=_0x651d27['start'];_0x4543aa&&_0x4543aa['is']('element','tableCell')&&(_0x3a3687=function(_0x385668,_0x1b26be){for(const _0x429ef8 of _0x385668['getPositions']())if(_0x1b26be['schema']['checkChild'](_0x429ef8,'$text'))return _0x429ef8;}(_0x651d27,_0x4e8a9b),_0x651d27=_0x243ea8['createRange'](_0x3a3687));const _0xe9eb0c=_0x243ea8['createRange'](_0x3a3687);_0x4e8a9b['markers']['has'](_0xb6c994)?(_0x243ea8['updateMarker'](_0xb6c994,{'range':_0x651d27}),_0x243ea8['updateMarker'](_0x1f4785,{'range':_0xe9eb0c})):(_0x243ea8['addMarker'](_0xb6c994,{'range':_0x651d27,'usingOperation':!0x0}),_0x243ea8['addMarker'](_0x1f4785,{'range':_0xe9eb0c,'usingOperation':!0x0}));}function J(_0x16f744,_0x239e79,_0x32ab74){const _0x1423c6=_0x16f744['t'],t=_0x16f744['t'];switch(_0x239e79){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 _0x1423c6({'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'},_0x32ab74);default:return'';}}let Y=0x1;class l extends _0xa7e79e{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x3cc14d)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,K,_0x57a4dc,_0x404f8d,_0x3b4d8c];}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 _0x40961c=this['serverHistory']['getOperations']();for(let _0x122a28=_0x40961c['length']-0x1;_0x122a28>=0x0;_0x122a28--){const _0x383038=_0x40961c[_0x122a28];if(!this['_disconnectionOperations']['has'](_0x383038))return _0x383038['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x1dd9e0){if(super(_0x1dd9e0),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x56a29d(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x402bb1('collaboration-missing-channelid',this);const _0xb11e9b=_0x1dd9e0['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xb11e9b,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x75a60b(),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 it(this['_disconnectionOperations']);}['init'](){const _0x1cbadc=this['editor'],_0x5219dd=_0x1cbadc['plugins']['get'](_0x404f8d),_0x11fd23=_0x1cbadc['plugins']['get'](c);this['listenTo'](_0x5219dd,'getOperationAuthor',(_0x3924cb,_0x2b6817)=>{const _0x26cc94=_0x2b6817[0x0];_0x26cc94['_authorId']&&(_0x3924cb['return']=_0x5219dd['getUser'](_0x26cc94['_authorId']),_0x3924cb['stop']()),null===_0x26cc94['_authorId']&&(_0x3924cb['return']=null,_0x3924cb['stop']());},{'priority':'high'}),this['listenTo'](_0x1cbadc['model']['document']['selection'],'change:range',(_0x15bb6d,_0x158c7b)=>{_0x158c7b['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1cbadc['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1cbadc['model']['on']('applyOperation',(_0x41c0c4,_0x2f7d50)=>{const _0x2e9d6f=_0x2f7d50[0x0];_0x2e9d6f['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2e9d6f),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x11fd23,'state',this,'_hasSynchronizationProblem',(_0x2521fc,_0x17b74c)=>'connected'===_0x2521fc&&!_0x17b74c),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1cbadc['disableReadOnlyMode']('rtc-offline'):_0x1cbadc['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1cbadc['disableReadOnlyMode']('rtc-offline'):_0x1cbadc['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x3a2c28=this['editor']['plugins']['get'](i),_0x51aef0=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x3a2c28['unregister'](this['_channelId']);const _0x3fc00f=await this['_service']['reconnect'](_0x51aef0['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x3fc00f)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x22f618=await this['_service']['getConnectedSessions']();_0x3a2c28['register'](this['_channelId'],_0x22f618),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4f042c){if(function(_0xa52e5){return'404'===_0xa52e5['code'];}(_0x4f042c)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x6de21c){return'409'===_0x6de21c['code'];}(_0x4f042c)){const _0x586ca9=J(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'](_0x586ca9);}else{if(!(_0x4f042c instanceof Z))throw _0x4f042c;this['_handleReconnectionError']();}}}}['destroy'](){const _0x54cf10=this['editor']['plugins']['get'](c),_0x185e8b=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x185e8b['channelSessions']['has'](this['_channelId'])&&_0x185e8b['unregister'](this['_channelId']),_0x54cf10['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x504673){if(this['sessionId']!==_0x504673['sessionId']&&this['_lastSyncedOperationId']!==_0x504673['lastOperationId'])throw new Z();return this['sessionId']=_0x504673['sessionId'],this['_handleServerResponse']([],{..._0x504673,'wereChangesApplied':!0x1,'data':_0x504673['data']},'reconnect');}async['_connectService'](_0x4b1382,_0x28ccce=!0x1){const {connection:_0x2c6ae2}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2c6ae2,this['_channelId'])['then'](_0xb621e2=>this['_initSessionsHandling'](_0xb621e2))['catch'](_0x395e8e=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x395e8e);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x46e44a,_0x26ee45)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x26ee45);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3684f9=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4b1382);this['_isPendingUpdate']=!0x0;const _0x10b8aa=await this['_service']['connect'](_0x2c6ae2,this['_compressOperations'](_0x4b1382),_0x3684f9);if(this['sessionId']=_0x10b8aa['sessionId'],_0x28ccce){if(!_0x10b8aa['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x10b8aa['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4b1382,_0x10b8aa,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x10b8aa,_0x4b1382);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x19e52e=this['editor']['plugins']['get'](i),_0x47e5ca=this['editor']['plugins']['get'](K),_0x203680=_0x19e52e['channelSessions']['get'](this['_channelId']);_0x203680&&_0x203680['length']>0x1?_0x47e5ca['createUserMarkerOperations']():this['listenTo'](_0x19e52e,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x19e52e['channelSessions']['get'](this['_channelId'])['length']&&_0x47e5ca['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4331e0,_0x63ca9b,_0x5ef053,_0x43dbe8){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x63ca9b){const _0x98eb68=this['_decompressOperations'](_0x5ef053,_0x43dbe8);await this['_fetchMissingUsers'](_0x98eb68),this['_handleExternalOperations'](_0x98eb68,_0x63ca9b,_0x5ef053['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x236ba0}=this['editor'];let _0x47cdf6;try{_0x47cdf6=await this['_service']['getDocumentDetails']();}catch(_0x6067c9){const _0x468d75=J(_0x236ba0,'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'](_0x468d75);}const _0x4b0cb0=_0x47cdf6['currentDocumentSession']||_0x47cdf6['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x4b0cb0['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x5a67e2=J(_0x236ba0,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x5a67e2);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x483104){const _0x4ccbda=this['editor']['plugins']['get'](i);this['listenTo'](_0x4ccbda,'sessionAdd:'+this['_channelId'],(_0x10a1a1,{session:_0x4637b4})=>{if(_0x4637b4['id']===_0x4ccbda['mySessionId']){_0x10a1a1['off']();const _0x4e21e3=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x377f87=_0x4637b4['permissions'];_0x4e21e3&&_0x4e21e3['isEnabled']&&(_0x377f87=_0x377f87['filter'](_0x36e7ae=>'document:write'!==_0x36e7ae)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x377f87,this['_channelId']);}}),_0x4ccbda['register'](this['_channelId'],_0x483104);}['_initThrowingOnDataSet'](){const _0x4de43c=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x25cc4e)=>{if(!_0x25cc4e[_0x25cc4e['length']-0x1]['suppressErrorInCollaboration'])throw new _0x402bb1('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x4de43c['apply'](this['editor']['data'],_0x25cc4e);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x48ee91,[_0x1e56e6])=>{if(this['_document']['version'])throw new _0x402bb1('realtimecollaborationclient-init-document-already-initialized',this);_0x48ee91['stop'](),this['_setPendingAction']();const _0x244cee=this['editor']['config']['get']('rootsAttributes'),_0x3efd21=this['_getOperationsFromInitData'](_0x1e56e6,_0x244cee);0x0==_0x3efd21['length']&&_0x3efd21['push'](new _0x1fa717(0x0)),_0x48ee91['return']=this['_connectService'](_0x3efd21)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1e1237=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1e1237))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x13fd24,[_0xc1ee95,_0x480b7d])=>{_0x13fd24['stop']();const _0x9b30bc=this['editor']['model']['document']['getRoot'](_0xc1ee95);if(!this['_knownRootNames']['has'](_0xc1ee95)){const _0x8a9457=_0x480b7d&&_0x480b7d['data']?_0x480b7d['data']:'',_0x4b76c6=_0x480b7d&&_0x480b7d['attributes']?_0x480b7d['attributes']:{};await this['_loadRoot'](_0xc1ee95,_0x8a9457,_0x4b76c6);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x9b30bc['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x9b30bc);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x3e2f17){const _0x446770=this['editor']['plugins']['get'](_0x404f8d),{connection:_0x50976e}=this['editor']['plugins']['get'](c),_0x50f751=new Set();for(const _0x265174 of _0x3e2f17){const _0x60be98=_0x265174['_authorId'];_0x60be98&&!_0x446770['getUser'](_0x60be98)&&_0x50f751['add'](_0x60be98);}if(0x0===_0x50f751['size'])return;const _0x4eab33=await lt['getMany'](_0x50976e,Array['from'](_0x50f751));for(const _0x37fa05 of _0x4eab33)_0x446770['getUser'](_0x37fa05['id'])||_0x446770['addUser'](_0x37fa05);}['_getOperationsFromInitData'](_0x46b6b2,_0x47a977={}){const _0x58ae60=this['editor']['model'],_0x10dcaa=[];let _0xb019e6=0x0;const _0x5a5f4c='string'==typeof _0x46b6b2?{'main':_0x46b6b2}:_0x46b6b2;for(const _0x2aae10 of Object['keys'](_0x5a5f4c)){if(!this['_document']['roots']['has'](_0x2aae10))throw new _0x402bb1('realtimecollaborationclient-init-non-existent-root',this);const _0x5405da=this['editor']['data']['parse'](_0x5a5f4c[_0x2aae10]),_0x58eb4b=this['_document']['getRoot'](_0x2aae10),_0x3cebb5=new _0x39b9da(_0x58ae60['createPositionAt'](_0x58eb4b,0x0),_0x5405da,_0xb019e6++);_0x10dcaa['push'](_0x3cebb5);for(const [_0x3c24b3,_0x56cd48]of _0x5405da['markers']){const _0x158e60=_0x58ae60['createRange'](_0x58ae60['createPositionFromPath'](_0x58eb4b,_0x56cd48['start']['path']['slice']()),_0x58ae60['createPositionFromPath'](_0x58eb4b,_0x56cd48['end']['path']['slice']())),_0x4907c5=new _0x242c44(_0x3c24b3,null,_0x158e60,_0x58ae60['markers'],!0x0,_0xb019e6++);_0x10dcaa['push'](_0x4907c5);}}if(_0x47a977)for(const [_0x3b3f36,_0x1f9363]of Object['entries'](_0x47a977)){const _0x4fdc55=_0x58ae60['document']['getRoot'](_0x3b3f36);if(!_0x4fdc55)throw new _0x402bb1('multi-root-editor-root-attributes-no-root',null);for(const [_0x467757,_0x5a27fe]of Object['entries'](_0x1f9363))if(null!==_0x5a27fe){const _0x32b89a=new _0x353684(_0x4fdc55,_0x467757,null,_0x5a27fe,_0xb019e6++);_0x10dcaa['push'](_0x32b89a);}}return _0x10dcaa;}async['_loadRoot'](_0x18bfcd,_0x22e38c,_0x5cdf66){this['_getOperationsFromInitData']({[_0x18bfcd]:_0x22e38c},{[_0x18bfcd]:_0x5cdf66})['forEach']((_0x5d2cdf,_0x3f7c5d)=>{_0x5d2cdf['baseVersion']=this['_document']['version']+_0x3f7c5d,_0x5d2cdf['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x5d2cdf);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1cda01,_0x80e2fe){let _0x52f61c;this['_offset']=_0x1cda01['offset'];const _0x38c4b5=_0x1cda01['wereChangesApplied']&&!_0x1cda01['initData'],_0x447e1e=_0x38c4b5?0x0:_0x1cda01['data']['baseVersion'];if(_0x80e2fe['forEach'](_0x3fc2e1=>{_0x3fc2e1['_isInit']=!0x0,_0x3fc2e1['createdAt']=_0x1cda01['sessionCreatedAt'],_0x3fc2e1['_authorId']=null;}),_0x38c4b5)_0x52f61c=_0x80e2fe,this['_applyOperationsSet'](_0x52f61c,_0x38c4b5);else{if(_0x1cda01['initData']){const _0x46b6a6=this['_getOperationsFromInitData'](_0x1cda01['initData']);this['_document']['history']['version']=-_0x46b6a6['length'],_0x46b6a6['forEach'](_0x38d4cc=>{_0x38d4cc['baseVersion']-=_0x46b6a6['length'],_0x38d4cc['createdAt']=_0x1cda01['sessionCreatedAt'],_0x38d4cc['_isInit']=!0x0,_0x38d4cc['_authorId']=null;}),this['_applyOperationsSet'](_0x46b6a6,!0x0),this['serverHistory']['version']=-_0x46b6a6['length']+this['_offset'],this['_updateServerHistory'](_0x46b6a6);}this['_document']['history']['version']=_0x447e1e,_0x52f61c=this['_decompressOperations'](_0x1cda01['data'],_0x1cda01['metadata']),await this['_fetchMissingUsers'](_0x52f61c),this['_applyOperationsSet'](_0x52f61c,_0x38c4b5);}_0x1cda01['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x52f61c,_0x1cda01['lastOperationId']),this['_lastSyncedOperationId']=_0x1cda01['lastOperationId']),this['serverHistory']['version']=_0x447e1e+this['_offset'],this['_updateServerHistory'](_0x52f61c),_0x80e2fe['filter'](_0x3900b0=>{const _0x4ed5a5=this['_getAffectedRoot'](_0x3900b0);return _0x4ed5a5&&!this['_knownRootNames']['has'](_0x4ed5a5);})['forEach']((_0x2b4ce5,_0x18f6fb)=>{_0x2b4ce5['baseVersion']=this['_document']['version']+_0x18f6fb,this['_saveOperationInBuffer'](_0x2b4ce5);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x5c3735,_0x2c1239){throw this['_isPendingUpdate']=!0x0,_0x2c1239&&console['error'](_0x2c1239),new _0x402bb1(_0x5c3735,this['editor']);}['_saveOperationInBuffer'](_0x5c50d2){this['_knownOperations']['has'](_0x5c50d2)||(this['_knownOperations']['add'](_0x5c50d2),this['_bufferedOperations']['push'](_0x5c50d2),this['_pendingAction']||'marker'==_0x5c50d2['type']&&!_0x5c50d2['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x1c2b5f=!0x1){!_0x1c2b5f&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x158666=>{_0x158666&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x31b168=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x41143a){return _0x41143a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41143a['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x41143a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x31b168))throw _0x31b168;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x44084f=>{this['on']('change:_isPendingUpdate',()=>{_0x44084f();});});}async['_sendBufferedOperations'](){const _0x2beab8=this['editor']['plugins']['get'](K);if(this['_shouldSendSelectionUpdate']()&&(_0x2beab8['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x4bdfbe=[...this['_bufferedOperations']];for(const _0xc74669 of _0x4bdfbe)_0xc74669['wasUndone']=this['_document']['history']['isUndoneOperation'](_0xc74669);const _0x302aef=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4bdfbe),_0xb338cc=Y++,_0x54ebba=this['_compressOperations'](_0x4bdfbe),_0x3d8224=await this['_service']['sendOperations'](_0x54ebba,_0x54ebba['baseVersion'],_0x302aef);try{return await this['_handleServerResponse'](_0x4bdfbe,_0x3d8224,_0xb338cc);}catch(_0xebbb32){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0xebbb32);}}async['_handleServerResponse'](_0x2a21ff,_0x1a5ec5,_0x1944fc){if('error'in _0x1a5ec5)throw _0x1a5ec5['error'];let _0x36bda9=!0x1;if(_0x1a5ec5['wereChangesApplied']){_0x1a5ec5['lastOperationId']&&(this['_lastSyncedOperationId']=_0x1a5ec5['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x321945=>!_0x2a21ff['includes'](_0x321945));for(const _0xac4704 of _0x2a21ff)_0xac4704['createdAt']='lastOperationAcceptedAt'in _0x1a5ec5&&_0x1a5ec5['lastOperationAcceptedAt']||void 0x0;tt(_0x2a21ff,_0x1a5ec5['version']-_0x2a21ff['length']),this['_updateServerHistory'](_0x2a21ff);const _0x255acb=_0x2a21ff['filter'](_0x19f021=>{if(!_0x19f021['_isInit'])return!0x1;const _0x53ffd5=this['_getAffectedRoot'](_0x19f021);return _0x53ffd5&&!this['_knownRootNames']['has'](_0x53ffd5);});tt(_0x255acb,this['_document']['version']),this['_applyOperationsSet'](_0x255acb),_0x36bda9=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x16913d=this['_decompressOperations'](_0x1a5ec5['data'],_0x1a5ec5['metadata'])['filter'](_0xfb5a6e=>_0xfb5a6e['baseVersion']>=this['_lastServerVersion']);_0x16913d['forEach'](_0x5f317a=>this['_addKnownRoot'](_0x5f317a)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1e415e=>!_0x1e415e['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1e415e))),this['_bufferedOperations']['length']&&tt(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x16913d),_0x36bda9=this['_handleExternalOperations'](_0x16913d,_0x1a5ec5['version'],_0x1a5ec5['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x36bda9?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3e2c0a,_0x16fdeb,_0x31ce20){try{const _0x26f17e={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3bb965,operationsB:_0x1e2e97,originalOperations:_0x208ad7}=_0x1f60b8(_0x3e2c0a,this['_bufferedOperations'],_0x26f17e);tt(_0x3bb965,this['_document']['version']),tt(_0x1e2e97,_0x16fdeb);for(const _0x303105 of _0x3bb965){const _0x1695c0=_0x208ad7['get'](_0x303105);_0x303105['_authorId']=_0x1695c0?_0x1695c0['_authorId']:null;}_0x31ce20&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3e2c0a,_0x31ce20),this['_lastSyncedOperationId']=_0x31ce20),this['_bufferedOperations']=[..._0x1e2e97],this['_applyOperationsSet'](_0x3bb965),this['_updateServerHistory'](_0x3e2c0a);}catch(_0xbc5ece){return console['error'](_0xbc5ece),!0x1;}return!0x0;}['_applyOperationsSet'](_0x18f689,_0x195e44=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x38a7c9=>{for(const _0x45efc2 of _0x18f689)this['_knownOperations']['add'](_0x45efc2),this['_addKnownRoot'](_0x45efc2),_0x38a7c9['batch']['addOperation'](_0x45efc2),this['editor']['model']['applyOperation'](_0x45efc2);});}['_addKnownRoot'](_0x155e56){const _0x3b5763=this['_getAffectedRoot'](_0x155e56);_0x3b5763&&this['_knownRootNames']['add'](_0x3b5763);}['_getAffectedRoot'](_0x37a475){let _0x4d5f7d,_0x1d8d91;switch(_0x37a475['type']){case'insert':_0x4d5f7d=_0x37a475['position']['root'];break;case'marker':if(_0x1d8d91=_0x37a475['newRange'],!_0x1d8d91)return null;_0x4d5f7d=_0x1d8d91['root'];break;case'addRootAttribute':_0x4d5f7d=_0x37a475['root'];break;case'addRoot':_0x4d5f7d=_0x37a475['affectedSelectable'];break;case'move':_0x4d5f7d=_0x37a475['targetPosition']['root'];break;default:return null;}return _0x4d5f7d['rootName'];}['_updateServerHistory'](_0x3a634c){_0x3a634c['forEach'](_0x483605=>{const _0xde8353=_0x483605['clone']();_0xde8353['_authorId']=_0x483605['_authorId'],_0xde8353['_isInit']=!!_0x483605['_isInit'],_0xde8353['createdAt']=_0x483605['createdAt'],_0xde8353['baseVersion']+=this['_offset'],_0x483605['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xde8353),this['serverHistory']['addOperation'](_0xde8353);});}['_handleReconnectionError'](_0x28aca4){const _0x2a7211=this['editor']['plugins']['get']('Notification'),_0x284609=this['editor']['locale'];_0x28aca4||(_0x28aca4=J(_0x284609,'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.')),_0x2a7211['showWarning'](_0x28aca4,{'title':J(_0x284609,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x57a4dc)['add'](J(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x57a4dc)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x20e761){const _0x3e84df=_0x20e761['map'](_0x4fe14b=>_0x4fe14b['toJSON']());return this['_compressor']['compress'](_0x3e84df);}['_decompressOperations'](_0xbb938c,_0x40c4d3){return this['_compressor']['decompress'](_0xbb938c)['map']((_0x487212,_0x3e3855)=>{const _0x510b96='init'==_0x40c4d3[_0x3e3855]['type'];if('InsertOperation'==_0x487212['__className']){const _0x5286a0=_0x487212['position']['root'];!this['_document']['getRoot'](_0x5286a0)&&(this['_document']['createRoot']('$root',_0x5286a0)['_isAttached']=!0x1);}const _0x35be1c=_0x4c7bf3['fromJSON'](_0x487212,this['_document']);return _0x35be1c['wasUndone']=_0x487212['wasUndone'],_0x35be1c['_isInit']=_0x510b96,_0x35be1c['_authorId']=_0x510b96?null:_0x40c4d3[_0x3e3855]['userId'],_0x35be1c['_isDisconnection']='cs:removeUser'===_0x40c4d3[_0x3e3855]['type'],_0x35be1c['createdAt']=_0x40c4d3[_0x3e3855]['createdAt'],_0x35be1c;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2edc57=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2edc57&&_0x2edc57['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Z extends Error{}function tt(_0x4ac52c,_0x59e8da){for(const _0x5c9887 of _0x4ac52c)_0x5c9887['baseVersion']=_0x59e8da++;}class it{['_ignoredOperations'];['_operationToId'];constructor(_0x463b6d){this['_ignoredOperations']=_0x463b6d,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x5029ac){let _0x1b4760=_0x5029ac['length'];for(;_0x1b4760--;){const _0x13c475=_0x5029ac[_0x1b4760];if(!this['_ignoredOperations']['has'](_0x13c475)){if(!this['_operationToId']['has'](_0x13c475)){const _0x3b96e2=_0x13d6cb()['slice'](0x1,0x12);this['_operationToId']['set'](_0x13c475,_0x3b96e2);}return this['_operationToId']['get'](_0x13c475);}}}['setIdForTheLastOperation'](_0x2618d1,_0x59ea55){if(!_0x59ea55)return;let _0x4e3d44=_0x2618d1['length'];for(;_0x4e3d44--;){const _0x2bff26=_0x2618d1[_0x4e3d44];this['_ignoredOperations']['has'](_0x2bff26)||this['_operationToId']['set'](_0x2bff26,_0x59ea55);}}}class n extends _0xa7e79e{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x94ed29{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x2970dd)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x404f8d];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x54d7ad){super(_0x54d7ad),this['_services']=new Map();}async['init'](){const _0x4e14bd=this['context'],_0xcf68a9=_0x4e14bd['plugins']['get']('CommentsRepository');if(_0x4e14bd['plugins']['get'](c)['addToReconnectionStack'](this),_0xcf68a9['adapter']={'addCommentThread':async({channelId:_0x401652,threadId:_0x413386,comments:_0x1abd6b,resolvedAt:_0x2cc45b,resolvedBy:_0x4c3f2a,context:_0x357654,attributes:_0x5439dd})=>{const _0x18dfcf=await this['_getService'](_0x401652)['addCommentThread']({'commentThreadId':_0x413386,'comments':_0x1abd6b['map'](_0x497740=>function(_0x400050,_0x1f5cb5,_0x3f4620){return{'commentThreadId':_0x3f4620,'commentId':_0x400050['commentId'],'userId':_0x400050['authorId'],'content':_0x400050['content'],'documentId':_0x1f5cb5,'createdAt':_0x400050['createdAt'],'attributes':_0x400050['attributes']||{}};}(_0x497740,_0x401652,_0x413386)),'resolvedAt':_0x2cc45b,'resolvedBy':_0x4c3f2a,'context':_0x357654,'attributes':_0x5439dd})['catch'](dt);return{'threadId':_0x18dfcf['commentThreadId'],'comments':_0x18dfcf['comments']};},'getCommentThread':async({channelId:_0x19606f,threadId:_0x3acead})=>{const _0x4750fd=await this['_getService'](_0x19606f)['getCommentThread'](_0x3acead)['catch'](dt);return _0x4750fd['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x4750fd]),{'threadId':_0x4750fd['commentThreadId'],'comments':_0x4750fd['comments']['map'](S),'context':_0x4750fd['context'],'resolvedAt':_0x4750fd['resolvedAt'],'resolvedBy':_0x4750fd['resolvedBy'],'attributes':_0x4750fd['attributes']||{}});},'updateCommentThread':async({channelId:_0x48f69c,threadId:_0x1d390f,context:_0x363e2d,unlinkedAt:_0x1c42ca,attributes:_0x5c6566})=>this['_getService'](_0x48f69c)['updateCommentThread']({'commentThreadId':_0x1d390f,'context':_0x363e2d,'attributes':_0x5c6566,'unlinkedAt':_0x1c42ca})['catch'](B)['catch'](dt),'resolveCommentThread':async({channelId:_0x29dbb5,threadId:_0x3c8b73})=>{const _0x3f38e3=await this['_getService'](_0x29dbb5)['resolveCommentThread'](_0x3c8b73)['catch'](B)['catch'](dt);return{'threadId':_0x3f38e3['commentThreadId'],'resolvedAt':_0x3f38e3['resolvedAt'],'resolvedBy':_0x3f38e3['resolvedBy']};},'reopenCommentThread':async({channelId:_0x6f99f3,threadId:_0x13bde5})=>this['_getService'](_0x6f99f3)['reopenCommentThread'](_0x13bde5)['catch'](B)['catch'](dt),'removeCommentThread':({channelId:_0x3b0dcd,threadId:_0x138a48})=>this['_getService'](_0x3b0dcd)['removeCommentThread'](_0x138a48)['catch'](B)['catch'](dt),'addComment':({channelId:_0x13f538,threadId:_0x209e29,commentId:_0x3ec708,content:_0x57328d,attributes:_0x3782bf})=>this['_getService'](_0x13f538)['addComment'](_0x209e29,_0x3ec708,_0x57328d,_0x3782bf)['catch'](dt),'updateComment':({channelId:_0x53c43f,threadId:_0x334fa8,commentId:_0x1d9997,content:_0x39d0d0,attributes:_0x3d0d67})=>this['_getService'](_0x53c43f)['updateComment'](_0x334fa8,_0x1d9997,_0x39d0d0,_0x3d0d67)['catch'](B)['catch'](dt),'removeComment':({channelId:_0x438da9,threadId:_0x1b38e6,commentId:_0x3814e9})=>this['_getService'](_0x438da9)['removeComment'](_0x1b38e6,_0x3814e9)['catch'](B)['catch'](dt)},_0x4e14bd instanceof _0x133312){const _0x5189a7=_0x4e14bd['config']['get']('collaboration.channelId'),_0x10a849=_0x4e14bd['plugins']['get'](i);await this['_setUpService'](_0x5189a7);const _0x905b6c=await this['_services']['get'](_0x5189a7)['getConnectedSessions']();this['listenTo'](_0x10a849,'sessionAdd:'+_0x5189a7,(_0x524cde,{session:_0x5dcc77})=>{_0x5dcc77['id']===_0x10a849['mySessionId']&&(_0x524cde['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x5dcc77['permissions'],_0x5189a7));}),_0x10a849['register'](_0x5189a7,_0x905b6c);}}async['_setUpService'](_0x4a1811){if(this['_services']['has'](_0x4a1811))throw new _0x402bb1('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4a1811});const _0x4480db=this['context']['plugins']['get']('CommentsRepository'),_0x1e80a0=new a['CommentsService'](_0x4a1811);this['_services']['set'](_0x4a1811,_0x1e80a0),this['listenTo'](_0x1e80a0,'commentThreadAdded',(_0xf24708,_0x341b04)=>{const {commentThreadId:_0x1e3f19,documentId:_0x453a1c,context:_0x79494d,attributes:_0x521467,resolvedAt:_0x4a5b0f,resolvedBy:_0x4a597c,comments:_0xb789d0}=_0x341b04;_0x4480db['getCommentThread'](_0x1e3f19)||_0x4480db['addCommentThread']({'threadId':_0x1e3f19,'channelId':_0x453a1c,'comments':_0xb789d0?_0xb789d0['map'](S):[],'context':_0x79494d,'attributes':_0x521467,'resolvedAt':_0x4a5b0f,'resolvedBy':_0x4a597c,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e80a0,'commentThreadUpdated',(_0x4af082,{commentThreadId:_0x8e8530,documentId:_0x3cf1bc,context:_0x400e6c,unlinkedAt:_0x52d4b4,attributes:_0x352dd3})=>{_0x4480db['getCommentThread'](_0x8e8530)&&_0x4480db['updateCommentThread']({'threadId':_0x8e8530,'channelId':_0x3cf1bc,'context':_0x400e6c,'unlinkedAt':_0x52d4b4,'attributes':_0x352dd3,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e80a0,'commentThreadResolved',(_0x1bf49d,{commentThreadId:_0x13f778,resolvedBy:_0x4ba23e,resolvedAt:_0x22e976})=>{const _0x4637ff=_0x4480db['getCommentThread'](_0x13f778);_0x4637ff&&_0x4637ff['resolve']({'resolvedBy':_0x4ba23e,'resolvedAt':_0x22e976,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e80a0,'commentThreadReopened',(_0x4c6fa5,{commentThreadId:_0x34bff4})=>{const _0x818397=_0x4480db['getCommentThread'](_0x34bff4);_0x818397&&_0x818397['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e80a0,'commentThreadRemoved',(_0x3b7902,{commentThreadId:_0x55cb13})=>{const _0x416c0b=_0x4480db['getCommentThread'](_0x55cb13);_0x416c0b&&_0x416c0b['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e80a0,'commentAdded',(_0x11ba00,_0x34507a)=>{const _0x4b6ae2=_0x34507a['commentThreadId'],_0x439c7e=_0x4480db['getCommentThread'](_0x4b6ae2);_0x439c7e&&_0x439c7e['addComment']({...S(_0x34507a),'isFromAdapter':!0x0});}),this['listenTo'](_0x1e80a0,'commentUpdated',(_0x57e510,{commentThreadId:_0x101c83,commentId:_0x4d6cd9,content:_0x446ac0,attributes:_0x2e7357})=>{const _0x1cfce0=_0x4480db['getCommentThread'](_0x101c83);if(_0x1cfce0){const _0x226591=_0x1cfce0['getComment'](_0x4d6cd9);_0x226591&&_0x226591['update']({'content':_0x446ac0,'attributes':_0x2e7357,'isFromAdapter':!0x0});}}),this['listenTo'](_0x1e80a0,'commentRemoved',(_0x2b495c,{commentThreadId:_0x558996,commentId:_0x3eaf84})=>{const _0x2cb2cb=_0x4480db['getCommentThread'](_0x558996);if(_0x2cb2cb){const _0x4e0d29=_0x2cb2cb['getComment'](_0x3eaf84);_0x4e0d29&&_0x4e0d29['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4a1811);}['destroy'](){if(this['context']instanceof _0x133312){const _0x694db4=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x694db4);}}['_terminateService'](_0x7fdf94){if(!this['_services']['has'](_0x7fdf94))throw new _0x402bb1('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x7fdf94});this['_getService'](_0x7fdf94)['disconnect'](),this['_services']['delete'](_0x7fdf94);}async['reconnect'](){for(const _0x8d1f95 of this['_services']['keys']())await this['_connectService'](_0x8d1f95);if(this['context']instanceof _0x133312){const _0x333531=this['context']['config']['get']('collaboration.channelId'),_0x4998d5=this['context']['plugins']['get'](i);_0x4998d5['unregister'](_0x333531);const _0x1d37aa=await this['_services']['get'](_0x333531)['getConnectedSessions']();_0x4998d5['register'](_0x333531,_0x1d37aa);}}async['_connectService'](_0x50da06){const {connection:_0x56de7c}=this['context']['plugins']['get'](c),_0x278eea=this['context']['plugins']['get']('CommentsRepository'),_0x4bfd8a=this['_services']['get'](_0x50da06),_0x410eee=await _0x4bfd8a['connect'](_0x56de7c);await this['_fetchMissingUsersForThreads'](_0x410eee);const _0x524b4=new Set(Array['from'](_0x278eea['getCommentThreads']({'channelId':_0x50da06}),_0x51de99=>_0x51de99['id']));for(const _0x1cbf70 of _0x410eee)_0x1cbf70['deletedAt']||_0x524b4['delete'](_0x1cbf70['commentThreadId']);for(const _0x3745e of _0x524b4)_0x278eea['getCommentThread'](_0x3745e)['remove']({'isFromAdapter':!0x0});for(const _0x5255cc of _0x410eee){let _0x17bd00=_0x278eea['getCommentThread'](_0x5255cc['commentThreadId']);const {commentThreadId:_0x4e8192,context:_0x505e37,attributes:_0x1a3dcb,resolvedBy:_0x11ef8c,resolvedAt:_0x411525,unlinkedAt:_0x58be50,deletedAt:_0x3050c9}=_0x5255cc;if(_0x3050c9)continue;_0x17bd00||(_0x17bd00=_0x278eea['addCommentThread']({'channelId':_0x50da06,'threadId':_0x4e8192,'context':_0x505e37,'attributes':_0x1a3dcb||{},'resolvedBy':_0x11ef8c,'resolvedAt':_0x411525,'unlinkedAt':_0x58be50,'isFromAdapter':!0x0}));const _0x2d2593=new Set(Array['from'](_0x17bd00['comments'],_0x7a0a26=>_0x7a0a26['id']));for(const _0x34e6d1 of _0x5255cc['comments'])_0x2d2593['delete'](_0x34e6d1['commentId']);for(const _0x5ef8d5 of _0x2d2593)_0x17bd00['getComment'](_0x5ef8d5)['remove']({'isFromAdapter':!0x0});for(const _0x4fd783 of _0x5255cc['comments']){const _0x1103f7=_0x17bd00['getComment'](_0x4fd783['commentId']);_0x1103f7?_0x1103f7['content']!==_0x4fd783['content']&&_0x1103f7['update']({'content':_0x4fd783['content'],'isFromAdapter':!0x0}):_0x17bd00['addComment'](Object['assign'](S(_0x4fd783),{'isFromAdapter':!0x0}));}}}['_getService'](_0x367ea0){if(!this['_services']['has'](_0x367ea0))throw new _0x402bb1('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x367ea0});return this['_services']['get'](_0x367ea0);}async['_fetchMissingUsersForThreads'](_0x2e014f){const _0x4efef8=this['context']['plugins']['get'](_0x404f8d),{connection:_0x41a1bc}=this['context']['plugins']['get'](c),_0x543eea=new Set();for(const {resolvedBy:_0x47be9a,comments:_0x2a5ae7}of _0x2e014f){_0x47be9a&&!_0x4efef8['getUser'](_0x47be9a)&&_0x543eea['add'](_0x47be9a);for(const {userId:_0x3e5b12}of _0x2a5ae7)_0x4efef8['getUser'](_0x3e5b12)||_0x543eea['add'](_0x3e5b12);}if(0x0===_0x543eea['size'])return;const _0x8ecbff=await lt['getMany'](_0x41a1bc,Array['from'](_0x543eea));for(const _0x69d66c of _0x8ecbff)_0x4efef8['getUser'](_0x69d66c['id'])||_0x4efef8['addUser'](_0x69d66c);}}async function B(_0x1dc335){if('404'!==_0x1dc335['code'])throw _0x1dc335;}function dt(_0x28516f){if((_0x3abdf7=_0x28516f)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x3abdf7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3abdf7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x3abdf7;throw _0x28516f;}function S(_0x27524e){return{'threadId':_0x27524e['commentThreadId'],'commentId':_0x27524e['commentId'],'content':_0x27524e['content'],'createdAt':_0x27524e['createdAt'],'authorId':_0x27524e['userId'],'attributes':_0x27524e['attributes']||{}};}class f extends _0xa7e79e{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>st)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(_0x5d7887){super(_0x5d7887);const _0xe4aafe=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0xe4aafe);}['init'](){const _0x235c56=this['editor']['plugins']['get'](c),_0x2657ca=this['editor']['plugins']['get']('TrackChangesEditing');return _0x2657ca['adapter']={'getSuggestion':async _0x5b9213=>{await this['_waitForServiceReady']();const _0xc5e3ad=await this['_trackChangesService']['get'](_0x5b9213)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0xc5e3ad]),_0xc5e3ad;},'addSuggestion':async({id:_0x48918f,type:_0x51633e,data:_0x148c4a,originalSuggestionId:_0x25f5fa,attributes:_0xab72d6})=>{await this['_waitForServiceReady']();const _0x3cb1f2={'id':_0x48918f,'type':_0x51633e,'data':_0x148c4a,'originalSuggestionId':_0x25f5fa,'attributes':_0xab72d6},_0x513a2f=await this['_trackChangesService']['add'](_0x48918f,_0x51633e,_0x148c4a,_0x25f5fa,_0xab72d6)['catch'](_0x436631=>{if(ut(_0x436631))return new Promise(_0x47ea5d=>{this['_bufferedRequests']['set'](_0x48918f,{'resolve':_0x47ea5d,'suggestionData':_0x3cb1f2});});throw _0x436631;});return this['_bufferedRequests']['delete'](_0x48918f),_0x513a2f;},'updateSuggestion':async(_0x293c6b,_0x2f6751)=>{if(await this['_waitForServiceReady'](),'open'!==_0x2f6751['state'])return this['_trackChangesService']['update'](_0x293c6b,_0x2f6751)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x44b1f7,_0xec112f)=>{_0x2657ca['hasSuggestion'](_0xec112f['id'])&&(_0x2657ca['getSuggestion'](_0xec112f['id'])['attributes']=_0xec112f['attributes']);}),this['_trackChangesService']['connect'](_0x235c56['connection'])['then'](_0x247767=>(_0x235c56['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x247767)['then'](()=>{for(const _0x40b015 of _0x247767){_0x2657ca['addSuggestionData'](_0x40b015)['_saved']=!0x0;}})));}async['reconnect'](){const _0x19fc84=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x5825b9}=this['editor']['plugins']['get'](c),_0x45e8e9=await this['_trackChangesService']['connect'](_0x5825b9);await this['_fetchMissingUsersForThreads'](_0x45e8e9);for(const {suggestionData:_0x27613b,resolve:_0x215188}of this['_bufferedRequests']['values']()){let _0x411a4d=_0x45e8e9['find'](_0x128504=>_0x128504['id']===_0x27613b['id']);_0x411a4d||(_0x411a4d=await this['_trackChangesService']['add'](_0x27613b['id'],_0x27613b['type'],_0x27613b['data'],_0x27613b['originalSuggestionId'])),_0x215188(_0x411a4d);}for(const _0x32e428 of _0x45e8e9)_0x19fc84['hasSuggestion'](_0x32e428['id'])||_0x19fc84['addSuggestionData'](_0x32e428);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x4fc7f5=>{this['listenTo'](this['_trackChangesService'],'connected',_0x139ed2=>{_0x139ed2['off'](),_0x4fc7f5();});});}async['_fetchMissingUsersForThreads'](_0x534e85){const _0xc75b98=this['editor']['plugins']['get'](_0x404f8d),{connection:_0x5ad502}=this['editor']['plugins']['get'](c),_0x31ee2b=new Set();for(const {authorId:_0x5d92a1}of _0x534e85)_0xc75b98['getUser'](_0x5d92a1)||_0x31ee2b['add'](_0x5d92a1);if(0x0===_0x31ee2b['size'])return;const _0x23c587=await lt['getMany'](_0x5ad502,Array['from'](_0x31ee2b));for(const _0x37f537 of _0x23c587)_0xc75b98['getUser'](_0x37f537['id'])||_0xc75b98['addUser'](_0x37f537);}}function R(_0x532633){if(ut(_0x532633))return new Promise(()=>{});throw _0x532633;}function ut(_0x39d433){return _0x39d433['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x39d433['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0xa7e79e{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5a785e=this['editor']['plugins']['get'](c),_0x1b8566=this['editor']['plugins']['get']('CommentsEditing'),_0x4fa67a=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x5a785e,'change:state',(_0x4b7250,_0xd77208,_0x50b7a6)=>{_0x1b8566['isThreadsLoadingPaused']='connected'!==_0x50b7a6;});}),this['listenTo'](_0x5a785e,'change:state',(_0xd68782,_0x29b1eb,_0x4d003c)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x4d003c);}),_0x4fa67a['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0xa7e79e{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0xa7e79e{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x47a496)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x404f8d];}constructor(_0x140dd2){super(_0x140dd2);const _0xcaa01c=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0xcaa01c);}async['init'](){const _0x4e9e8d=this['editor']['plugins']['get'](l),_0xf26150=_0x4e9e8d['serverHistory'],_0x4e435e=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0xf26150,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4e9e8d['sessionId']});const _0x85b3cd=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x1659f0=await _0x541637['isBundleUploaded'](_0x4e435e['connection'],_0x85b3cd);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x1d6ea8})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1d6ea8)),'updateRevisions':async _0x2c4175=>{await this['_waitForServiceReady']();const _0x357c92=this['_revisionTracker']['currentRevision'];if(_0x1659f0&&0x1===_0x2c4175['length']&&_0x2c4175[0x0]['id']===_0x357c92['id'])return _0x2c4175;for(const _0x5b0c28 of _0x2c4175)_0x5b0c28['id']===_0x357c92['id']&&(_0x5b0c28['isEmptyCurrent']=_0x5b0c28['fromVersion']===_0x5b0c28['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x2c4175,this['_lastRequestId'])['then'](_0x1c4e21=>(this['_lastRequestId']=_0x1c4e21,_0x2c4175))['catch'](_0x1456db=>{if(P(_0x1456db)||'400'===_0x1456db['code']&&void 0x0!==_0x1456db['data']['wrongRequestId']){for(const _0x57c186 of _0x2c4175){!this['_revisionTracker']['repository']['getRevision'](_0x57c186['id'])||this['_revisionTracker']['_bufferUpdate'](_0x57c186['id'],_0x57c186,!0x1);}if(P(_0x1456db))throw _0x1456db;return _0x2c4175;}throw _0x1456db;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x627ff0,{revisionsData:_0x53d7b2,requestId:_0x536027})=>{Math['max'](..._0x53d7b2['map'](_0x5bb22c=>_0x5bb22c['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x53d7b2,_0x536027);}):this['_handleRevisionsUpdate'](_0x53d7b2,_0x536027);});const {revisions:_0x55f2b4,requestId:_0x78dc8b}=await this['_revisionHistoryService']['connect'](_0x4e435e['connection']);_0x4e435e['addToReconnectionStack'](this),this['_lastRequestId']=_0x78dc8b,await this['_fetchMissingUsers'](_0x55f2b4);for(const _0xf4605 of _0x55f2b4)this['_revisionTracker']['addRevisionData'](_0xf4605);this['listenTo'](_0x4e9e8d,'change:_isConnected',(_0x1832ea,_0x15888f,_0x3dfe85)=>{_0x3dfe85&&(this['_oldOffset']=_0x4e9e8d['_offset'],_0x1832ea['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4e435e,'state',_0x118750=>_0x118750===_0x5c645a['CONNECTED']);}async['reconnect'](){const _0x897dcd=this['editor']['plugins']['get'](c),_0x20af9a=this['editor']['plugins']['get'](l),_0x19f568=async()=>{const _0x54519b=this['_revisionTracker']['currentRevision'],_0x22fab4=_0x54519b['id'],_0x30f162=_0x22fab4!==_0x20af9a['sessionId'];if(_0x30f162){const _0x352c22=_0x20af9a['_offset']-this['_oldOffset'],_0x33c955=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x54519b['toVersion']+_0x352c22!==_0x33c955){const _0xc9473c=_0x54519b['fromVersion']+_0x352c22,_0x3db28c=this['editor']['plugins']['get'](_0x404f8d),_0x434c2e=this['_revisionTracker']['buildRevisionData']({'revision':_0x54519b,'from':_0xc9473c,'to':_0x33c955});_0x434c2e['id']=_0x54519b['id'];const _0x119315=_0x434c2e['authorsIds']['map'](_0x107e73=>_0x3db28c['getUser'](_0x107e73));_0x54519b['_update']({..._0x434c2e,'authors':_0x119315},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x54519b['id'],_0x434c2e,!0x0);}this['_revisionTracker']['_startingVersion']=_0x33c955,(_0x54519b['toVersion']===_0x54519b['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x22fab4)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x22fab4),this['_revisionTracker']['_createCurrentRevision'](_0x33c955));}const {revisions:_0x448746,requestId:_0x3cba74}=await this['_revisionHistoryService']['reconnect'](_0x897dcd['connection'],this['_lastRequestId']);_0x30f162&&_0x448746['length']>0x0?_0x20af9a['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x448746),this['_handleRevisionsUpdate'](_0x448746,_0x3cba74),this['_revisionTracker']['sendBufferedUpdates']());};return _0x20af9a['_isConnected']?_0x19f568():new Promise((_0x45b308,_0x11c032)=>{_0x20af9a['once']('change:_isConnected',()=>{_0x19f568()['then'](_0x45b308)['catch'](_0x11c032);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x139234=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x181fdd=>{_0x181fdd['off'](),_0x139234();});});}['_getLatestVersionFromServerOperations'](){const _0x34ddea=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3914db of _0x34ddea)if('marker'!==_0x3914db['type']||_0x3914db['affectsData'])return _0x3914db['baseVersion']+0x1;}['_getLatestVersion'](){const _0x57f476=this['editor']['plugins']['get'](l);return new Promise(_0x23e73e=>{_0x57f476['_isPendingUpdate']?_0x57f476['once']('change:_isPendingUpdate',()=>{_0x23e73e(this['_getLatestVersionFromServerOperations']());}):_0x23e73e(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3782cd,_0x4fea65){const _0x37f54e=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x4fea65;for(const _0x418ffe of _0x3782cd){const _0x324c3b=_0x37f54e['getRevision'](_0x418ffe['id']);if(_0x324c3b){if((_0x418ffe['fromVersion']||_0x418ffe['toVersion'])&&(_0x418ffe['diffData']=null),_0x324c3b===this['_revisionTracker']['currentRevision']){const _0x259787=Math['max'](_0x324c3b['toVersion'],_0x418ffe['toVersion']),_0xcf5601=Math['max'](_0x324c3b['fromVersion'],_0x418ffe['fromVersion']);let _0x576ded;_0x324c3b['toVersion']===_0x418ffe['toVersion']&&_0x324c3b['fromVersion']===_0x418ffe['fromVersion']?(_0x576ded=!0x0,this['_preventResendingRevisionData'](_0x418ffe)):_0x418ffe['toVersion']===_0x259787&&_0x418ffe['fromVersion']===_0xcf5601?_0x576ded=!0x1:(_0x324c3b['toVersion']===_0x259787&&_0x324c3b['fromVersion']===_0xcf5601||this['_fixRevision']({'revision':_0x324c3b,'from':_0xcf5601,'to':_0x259787}),_0x576ded=!0x0),_0x576ded&&(delete _0x418ffe['fromVersion'],delete _0x418ffe['toVersion'],delete _0x418ffe['diffData'],delete _0x418ffe['createdAt'],delete _0x418ffe['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x418ffe),this['_preventResendingRevisionData'](_0x418ffe);}else this['_revisionTracker']['addRevisionData'](_0x418ffe);}const _0x2d77d8=_0x37f54e['getRevisions']();_0x2d77d8['reverse']();for(let _0x19ffc0=0x0;_0x19ffc0<_0x2d77d8['length']-0x1;_0x19ffc0++){const _0x2a83c6=_0x2d77d8[_0x19ffc0],_0x3652cd=_0x2d77d8[_0x19ffc0+0x1];if(_0x2a83c6['fromVersion']<_0x3652cd['toVersion']){const _0x5e1a47=_0x3652cd['toVersion'],_0x25cf08=Math['max'](_0x5e1a47,_0x2a83c6['toVersion']);this['_fixRevision']({'revision':_0x2a83c6,'from':_0x5e1a47,'to':_0x25cf08});}}}['_fixRevision']({revision:_0xf13936,from:_0x43c850,to:_0x2c60fb}={}){const _0x4854ae=this['editor']['plugins']['get'](_0x404f8d),_0x3e875d=this['_revisionTracker']['buildRevisionData']({'revision':_0xf13936,'from':_0x43c850,'to':_0x2c60fb});_0x3e875d['authors']=_0x3e875d['authorsIds']['map'](_0x3c97da=>_0x4854ae['getUser'](_0x3c97da)),_0xf13936['_update'](_0x3e875d);}['_preventResendingRevisionData'](_0x35f720){const _0xb32647={};_0xb32647['id']=_0x35f720['id'];for(const _0x5b4c33 of Object['keys'](_0x35f720))'id'!==_0x5b4c33&&(_0xb32647[_0x5b4c33]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xb32647['id'],_0xb32647,!0x0);}async['_fetchMissingUsers'](_0x4fd922){const _0x32d2a8=this['editor']['plugins']['get'](_0x404f8d),{connection:_0x88ec4e}=this['editor']['plugins']['get'](c),_0x296313=new Set();for(const _0x512834 of _0x4fd922){for(const _0x397790 of _0x512834['authorsIds'])_0x64b5ca(_0x397790);_0x512834['creatorId']&&_0x64b5ca(_0x512834['creatorId']);}if(0x0===_0x296313['size'])return;const _0x1ac6cb=await lt['getMany'](_0x88ec4e,Array['from'](_0x296313));for(const _0x411251 of _0x1ac6cb)_0x32d2a8['getUser'](_0x411251['id'])||_0x32d2a8['addUser'](_0x411251);function _0x64b5ca(_0x401c7c){_0x32d2a8['getUser'](_0x401c7c)||_0x296313['add'](_0x401c7c);}}}function P(_0x590860){return _0x590860['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x590860['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x590860['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0xa7e79e{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x3bbe01{constructor(_0x3f8605){super(_0x3f8605);const _0x13f3b2=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x13f3b2['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x13f3b2['to']('usersCount',_0x58475d=>J(_0x3f8605,'CONNECTED_USERS',_0x58475d))}]});}}class es extends _0x3bbe01{['items'];['keystrokes'];constructor(_0x45d754){super(_0x45d754);const _0xbc5c9e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x32bfc6(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0xbc5c9e['if']('hasPopup'),'aria-expanded':_0xbc5c9e['to']('isExpanded',_0x561d53=>this['hasPopup']&&String(_0x561d53)),'aria-label':_0xbc5c9e['to']('hasPopup',_0x3e8d1f=>J(_0x45d754,_0x3e8d1f?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0xbc5c9e['to']('hasPopup',_0x344935=>!!_0x344935&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0xbc5c9e['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x116036,_0x1a5ffc,_0x402968)=>{this['element']&&(_0x402968?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 L extends _0x3bbe01{['counterView'];['inlineListView'];constructor(_0x4a38c9){super(_0x4a38c9);const _0x3f5ec9=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x4a38c9),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x36bbf3 of this['inlineListView']['items'])_0x36bbf3['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',_0x3f5ec9['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x3bbe01{['listWrapperView'];constructor(_0x2de8aa,_0x21f77c){super(_0x2de8aa),this['listWrapperView']=new ft(_0x2de8aa,_0x21f77c),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':J(_0x2de8aa,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class ft extends _0x29cf5c{constructor(_0x3ef8a5,_0x531f4b){super(_0x3ef8a5);const _0x2d7cfc=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x531f4b?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x2d7cfc['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x2d7cfc['to']('role'),'aria-label':_0x2d7cfc['to']('ariaLabel'),'aria-labelledby':_0x2d7cfc['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xb3f1c4['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x53cf2f=this['element'];_0x53cf2f&&(this['_isScrollable']=Math['max'](_0x53cf2f['scrollHeight'],_0x53cf2f['clientHeight'])>0.8*window['innerHeight']);}}class k extends et{['userView'];constructor(_0x1e3bd6,_0x20a7e6,_0x307701){super(_0x1e3bd6);const _0x5e7358=this['bindTemplate'];this['userView']=new rt(_0x1e3bd6,_0x20a7e6);const _0x3a88c4={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x20a7e6['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x20a7e6['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x20a7e6['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x307701&&(_0x3a88c4['tag']='button',_0x3a88c4['on']={'click':_0x5e7358['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3a88c4);}['focus'](){this['element']['focus']();}}class y extends _0x3bbe01{['userView'];['markerView'];constructor(_0x5b4499,_0x520220,_0x4664ae){super(_0x5b4499);const _0xe8fcdb=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new rt(_0x5b4499,_0x520220),this['markerView']=new ct(_0x5b4499,_0x520220);const _0x5c665b=new ot(_0x5b4499);_0x5c665b['template']['tag']='span',_0x5c665b['text']=_0x520220['name'];const _0x557b9d={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0xe8fcdb['to']('isFocusable',_0x2143d1=>!!_0x2143d1&&0x0),'aria-labelledby':_0x5c665b['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0xe8fcdb['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0xe8fcdb['to']('hasTooltip',_0x3901f1=>!_0x3901f1),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x5c665b]};_0x4664ae&&(_0x557b9d['tag']='button',_0x557b9d['on']={'click':_0xe8fcdb['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x557b9d);}}class ct extends _0x3bbe01{constructor(_0x2e22ea,_0x3a8eac){super(_0x2e22ea),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3a8eac['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x94ed29{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x5b4797){super(_0x5b4797),this['context']['config']['define']('presenceList',A);const _0x2c7965=_0x5b4797['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2c7965)throw new _0x402bb1('presencelist-collapseat-invalid-format',this);if(_0x2c7965<0x1)throw new _0x402bb1('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5e53f5(),this['balloonPanelView']=new _0x3531c3(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x22f178 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x22f178);this['listenTo'](this['_allConnectedUsers'],'add',(_0x48e039,_0x41a650)=>{this['_handleUserAdd'](_0x41a650);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x4291f9,_0x5e5ad2)=>{this['_handleUserRemove'](_0x5e5ad2);});}['_createView'](){const _0x4b17f8=this['context'],_0x227832=new L(this['context']['locale']),_0x52d0f1=this['balloonPanelView'];if(!_0x4e3181(_0x4b17f8['config']['get']('presenceList.container')))throw new _0x402bb1('presencelist-missing-container',this);return _0x227832['counterView']['bind']('usersCount')['to'](this),_0x227832['bind']('isCollapsed')['to'](this,'usersCount',_0x1c3915=>{const {collapseAt:_0x4083cf,displayMe:_0x571d90}=_0x4b17f8['config']['get']('presenceList'),_0x221709=_0x1c3915>=_0x4083cf;return _0x227832['counterView']['isHidden']=!(0x1==_0x1c3915&&_0x571d90||_0x221709),_0x221709||this['hideDropdown'](),_0x221709;}),_0x227832['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x13606f=>{const _0x224d34=_0x4b17f8['config']['get']('presenceList'),_0x2d0f54=new y(_0x4b17f8['locale'],_0x13606f,!!_0x224d34['onClick']);return _0x2d0f54['bind']('hasTooltip')['to'](_0x227832,'isCollapsed',_0x17d486=>!_0x17d486),_0x2d0f54['bind']('isFocusable')['to'](_0x227832,'isCollapsed',_0x46ad72=>!_0x46ad72),_0x224d34['onClick']&&this['listenTo'](_0x2d0f54,'execute',()=>{this['view']['isCollapsed']||_0x224d34['onClick'](_0x13606f,_0x2d0f54['element']);}),_0x2d0f54;}),this['listenTo'](_0x227832['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x227832['inlineListView']['keystrokes']['set']('Enter',(_0x416507,_0x449e1e)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x449e1e());}),_0x227832['render'](),_0x52d0f1['render'](),_0x963ce1({'emitter':_0x227832,'activator':()=>_0x52d0f1['isVisible'],'contextElements':[_0x52d0f1['element'],_0x227832['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4b17f8['config']['get']('presenceList.container')['appendChild'](_0x227832['element']),this['_bodyCollection']=new _0x512c22(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x227832;}['_handleUserAdd'](_0x20bfa7){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x20bfa7['isMe'])return;const _0x36bddf=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x36bddf&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0xfa5080=_0x20bfa7['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x20bfa7,_0xfa5080);}['_handleUserRemove'](_0x307e18){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x307e18['id'])&&(this['currentDisplayedUsers']['remove'](_0x307e18['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x4d3b02 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4d3b02['id']))return void this['currentDisplayedUsers']['add'](_0x4d3b02,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x12ac56=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x12ac56['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x167869}=this['presenceDropdownView'];_0x167869['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x578db5=>{if(!_0x12ac56['displayMe']&&_0x578db5['isMe'])return null;const _0x107ae5=new k(this['context']['locale'],_0x578db5,!!_0x12ac56['onClick']);return _0x12ac56['onClick']&&this['listenTo'](_0x107ae5,'execute',()=>{_0x12ac56['onClick'](_0x578db5,_0x107ae5['element']);}),_0x107ae5;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x167869['focus'](),_0x167869['checkIfScrollable']();const _0x1bbda2=(_0x12e22b,_0x2ebc9c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2ebc9c();};_0x167869['keystrokes']['set']('Esc',_0x1bbda2),_0x167869['keystrokes']['set']('Shift+Tab',_0x1bbda2),_0x167869['keystrokes']['set']('Tab',(_0x15dc5c,_0x54eb84)=>{!function(_0x34fb31){const _0x55b89e=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x28b462=>_0x28b462+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x34e77e=[...document['body']['querySelectorAll'](_0x55b89e)]['filter'](_0x584937=>_0x584937===document['activeElement']||_0x584937['offsetWidth']+_0x584937['offsetHeight']>0x0)['sort']((_0x7e7488,_0x22cbcd)=>(_0x7e7488['tabIndex']||0x0)-(_0x22cbcd['tabIndex']||0x0)),_0x50c0fa=_0x34e77e['indexOf'](_0x34fb31),_0x2250a1=_0x34e77e[(_0x50c0fa+0x1)%_0x34e77e['length']];_0x2250a1&&_0x2250a1['focus']();}(this['view']['element']),this['hideDropdown'](),_0x54eb84();}),_0x167869['focusTracker']['add'](this['view']['element']),_0x167869['focusTracker']['on']('change:isFocused',(_0x42bfc5,_0x1f91c3,_0x393b33)=>{_0x393b33||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x94ed29{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
23
+ import{ContextPlugin as _0x398b21,Plugin as _0x1d59aa,PendingActions as _0x5ac87a,Context as _0x5d390a}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x58ee75,CKEditorError as _0xce1efc,Collection as _0x614065,global as _0x3a6be1,version as nt,uid as _0x391ccf,KeystrokeHandler as _0x35a206}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x418779,View as _0x57fbbb,ListView as _0x4bd207,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x30b0f6,clickOutsideHandler as _0x14a525,BodyCollection as _0x5c8e58}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x35db70,NoOperation as _0xb7977d,InsertOperation as _0x5e6cd9,MarkerOperation as _0x2e40d9,RootAttributeOperation as _0x30bb3b,transformSets as _0x29b639,OperationFactory as _0x27822e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x31dbb4,CollaborativeEditingService as _0x457671,User as dt,CommentsService as _0x36a322,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x41520f,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1b9d22}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x4ebd88}from'lodash-es';class c extends _0x398b21{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x418779];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e398c){super(_0x1e398c),this['set']('state',_0x31dbb4['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x58ee75);}['init'](){const _0x44856d=this['context'],_0x1fd7b3=_0x44856d['plugins']['get']('CloudServices'),_0x4f963d=_0x44856d['plugins']['get'](_0x418779);if(!_0x1fd7b3['token'])throw new _0xce1efc('websocketgateway-missing-token',this);if(!_0x1fd7b3['webSocketUrl'])throw new _0xce1efc('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x1fd7b3['token'],_0x1fd7b3['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x43ee32=>{if(this['connection']=_0x43ee32,this['bind']('state')['to'](_0x43ee32,'state',this,'_isBrowserOffline',(_0x5e0815,_0x9a237b)=>('connected'!==_0x5e0815&&(this['_shouldPluginsReconnect']=!0x0),_0x9a237b||_0x5e0815!==_0x31dbb4['CONNECTED']?_0x31dbb4['DISCONNECTED']:this['state']==_0x31dbb4['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x31dbb4['CONNECTING']):_0x31dbb4['CONNECTED'])),this['connection']['on']('error',(_0x43966b,_0x5b6499)=>{if('limitExceeded'!==_0x5b6499['code'])throw console['error'](_0x5b6499),new _0xce1efc('cloudservices-init',null,{'originalError':_0x5b6499});_0x4f963d['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'});}),!_0x43ee32['me'])return new Promise(_0x8d9e61=>_0x43ee32['on']('change:me',_0x8d9e61));})['catch'](_0x149c26=>{throw console['error'](_0x149c26),new _0xce1efc('cloudservices-init',null,{'originalError':_0x149c26});});}['addToReconnectionStack'](_0x1b19c4){if('function'!=typeof _0x1b19c4['reconnect'])throw new _0xce1efc('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1b19c4))throw new _0xce1efc('websocketgateway-plugin-already-registered',this,{'name':_0x1b19c4['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1b19c4);}['removeFromReconnectionStack'](_0x38b2ba){this['_reconnectionStack']['delete'](_0x38b2ba);}['isInReconnectionStack'](_0x18bf28){return this['_reconnectionStack']['has'](_0x18bf28);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x456ca6=>_0x456ca6['reconnect']())))['then'](()=>this['state']=_0x31dbb4['CONNECTED'])['catch'](_0x5244c5=>{throw console['error'](_0x5244c5),new _0xce1efc('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x31dbb4['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x398b21{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x41520f];}constructor(_0x3b32bb){super(_0x3b32bb),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x614065(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x41520f);}['init'](){const _0x18ab60=this['context']['plugins']['get'](c);this['listenTo'](_0x18ab60,'change:state',(_0x4b5bcc,_0x48a3c6,_0x45bb65)=>{if('connected'!==_0x45bb65)this['channelSessions']['forEach'](_0x1f6a64=>_0x1f6a64['clear']()),this['channelConnectedUsers']['forEach'](_0x46b74b=>_0x46b74b['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x370290,_0x81e8b1]of this['_registeredSessions'])for(const _0x5e3e40 of _0x81e8b1)this['_handleSessionAdd'](_0x370290,_0x5e3e40);}}),this['_createUser'](_0x18ab60['connection']['me'],!0x0);}['register'](_0x5c5ead,_0x462f61){if(this['_registeredSessions']['has'](_0x5c5ead))throw new _0xce1efc('sessions-register-already-registered',null,{'channelId':_0x5c5ead});this['_registeredSessions']['set'](_0x5c5ead,_0x462f61),this['channelSessions']['set'](_0x5c5ead,new _0x614065()),this['channelConnectedUsers']['set'](_0x5c5ead,new _0x614065()),this['listenTo'](_0x462f61,'add',(_0x10ce57,_0xefa6a6)=>this['_handleSessionAdd'](_0x5c5ead,_0xefa6a6)),this['listenTo'](_0x462f61,'remove',(_0x24610d,_0x469002)=>this['_handleSessionRemove'](_0x5c5ead,_0x469002));for(const _0x176a9d of _0x462f61)this['_handleSessionAdd'](_0x5c5ead,_0x176a9d);}['unregister'](_0x408bcc){if(!this['_registeredSessions']['has'](_0x408bcc))throw new _0xce1efc('sessions-unregister-not-exist',null,{'channelId':_0x408bcc});const _0x165ad7=this['_registeredSessions']['get'](_0x408bcc);this['stopListening'](_0x165ad7);for(const _0x103c25 of _0x165ad7)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x408bcc,_0x103c25);this['_registeredSessions']['delete'](_0x408bcc),this['channelSessions']['delete'](_0x408bcc),this['channelConnectedUsers']['delete'](_0x408bcc);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x201d1c){for(const _0x1ff7c3 of this['channelSessions']['values']())for(const _0xc01bb0 of _0x1ff7c3)if(_0xc01bb0['id']===_0x201d1c)return _0xc01bb0['user'];}['getUserSessions'](_0x576ca8,_0x1135cf){const _0x15957f=_0x1135cf?[this['channelSessions']['get'](_0x1135cf)]:this['channelSessions']['values'](),_0x5b7021=new Set();for(const _0x1bba7e of _0x15957f)for(const _0x479925 of _0x1bba7e)_0x479925['user']['id']===_0x576ca8['id']&&_0x5b7021['add'](_0x479925['id']);return _0x5b7021;}['getUserRole'](_0x493800){for(const _0x49ac69 of this['channelSessions']['values']())for(const _0x37674c of _0x49ac69)if(_0x37674c['user']===_0x493800)return _0x37674c['role'];}['_handleSessionAdd'](_0x4b6d9a,_0x56778e){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x1d97ff=_0x56778e['user'],_0x4d3668=this['_users']['getUser'](_0x1d97ff['id'])||this['_createUser'](_0x1d97ff),_0x4be9a7=Object['assign']({},_0x56778e,{'user':_0x4d3668});this['channelSessions']['get'](_0x4b6d9a)['add'](_0x4be9a7);const _0x14fa5f=this['channelConnectedUsers']['get'](_0x4b6d9a);_0x14fa5f['has'](_0x4d3668['id'])||_0x14fa5f['add'](_0x4d3668),this['allConnectedUsers']['has'](_0x4d3668['id'])||this['allConnectedUsers']['add'](_0x4d3668,_0x4d3668['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x4b6d9a,{'channelId':_0x4b6d9a,'session':_0x4be9a7});}['_handleSessionRemove'](_0x543be5,_0x40b9d6){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x2e4b39=this['channelConnectedUsers']['get'](_0x543be5),_0x3339c9=_0x40b9d6['user'];_0x3339c9['id']&&(this['channelSessions']['get'](_0x543be5)['remove'](_0x40b9d6['id']),_0x2e4b39['has'](_0x3339c9['id'])&&!this['getUserSessions'](_0x3339c9,_0x543be5)['size']&&_0x2e4b39['remove'](_0x3339c9['id']),this['allConnectedUsers']['get'](_0x3339c9['id'])&&!this['getUserSessions'](_0x3339c9)['size']&&this['allConnectedUsers']['remove'](_0x3339c9['id']));}['_createUser'](_0x3de8f7,_0x39aeb9){const _0x2b466d=this['_users']['addUser'](_0x3de8f7);return _0x39aeb9&&this['_users']['defineMe'](_0x3de8f7['id']),_0x2b466d['orderNumber']=this['_uniqueUsersCount']++,_0x2b466d;}}class H extends _0x1d59aa{['_domEmitter']=new(_0x58ee75())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3689c9=this['editor'],_0x532fb1=_0x3689c9['plugins']['get'](i);_0x3689c9['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x2c4fbf,{writer:_0x177139})=>function(_0x2c0a3b,_0x3a0bf6,_0x39ff1a,_0x622e60){const _0x38a7d8=_0x2c0a3b['markerName']['split'](':')[0x2],_0x4b8ab3=_0x39ff1a['getUserBySessionId'](_0x38a7d8);if(!_0x4b8ab3||_0x38a7d8===_0x39ff1a['mySessionId'])return;if(!_0x622e60['model']['schema']['checkChild'](_0x2c0a3b['markerRange']['start'],'$text'))return;const _0x29a3b5={'class':'ck-user__marker\x20'+_0x4b8ab3['color']['getMarkerClass'](),'data-name':_0x4b8ab3['name'],'data-session-id':_0x38a7d8},_0x4eded8=_0x622e60['model']['markers']['get'](_0x2c0a3b['markerName']),_0x51193a=_0x4eded8['getStart'](),_0x43fb32=_0x51193a['nodeAfter'],_0xe34aa9=_0x622e60['model']['schema'];if(_0x43fb32&&_0xe34aa9['isObject'](_0x43fb32)&&_0xe34aa9['isInline'](_0x43fb32)&&!_0x622e60['model']['markers']['get']('user:range:'+_0x38a7d8)['getRange']()['isCollapsed'])return;const _0x3aed5c=_0x51193a['parent'];return _0x622e60['model']['schema']['isLimit'](_0x3aed5c)&&!_0x622e60['model']['hasContent'](_0x3aed5c)&&(_0x29a3b5['contenteditable']=!0x1),function(_0x1b44a0,_0x569427,_0xd8a57){const _0x3253e6=_0x1b44a0['createUIElement']('span',_0x569427);return _0x1b44a0['setCustomProperty']('userPositionMarker',!0x0,_0x3253e6),_0x3253e6['render']=function(_0xc979d2){const _0x1a894a=this['toDomElement'](_0xc979d2);return _0x1a894a['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0xd8a57['name']+'</span>⁠',_0x1a894a['addEventListener']('mouseenter',()=>{_0x1a894a['classList']['add']('ck-user__marker_hovered');}),_0x1a894a['addEventListener']('mouseleave',()=>{_0x1a894a['classList']['remove']('ck-user__marker_hovered');}),_0x1a894a;},_0x3253e6['isSimilar']=function(_0x161ef8){return!(!this['getCustomProperty']('userPositionMarker')||!_0x161ef8['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x161ef8['getAttribute']('data-session-id'));},_0x3253e6;}(_0x3a0bf6,_0x29a3b5,_0x4b8ab3);}(_0x2c4fbf,_0x177139,_0x532fb1,_0x3689c9)}),_0x3689c9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1b9fe5=>function(_0x5ed0c8,_0x6856fd){const _0x5064cd=_0x5ed0c8['markerName']['split'](':')[0x2];if(_0x5064cd===_0x6856fd['mySessionId'])return null;const _0x51af34=_0x6856fd['getUserBySessionId'](_0x5064cd);if(!_0x51af34)return{'id':_0x5064cd,'classes':[]};return{'id':_0x5064cd,'classes':['ck-user__selection',_0x51af34['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x5064cd},'priority':0x7d0+_0x51af34['orderNumber']};}(_0x1b9fe5,_0x532fb1)}),function(_0x39d8d7){const _0x229f04=_0x39d8d7['model'],_0x21baf2=new Map(),_0x5c06b9=_0x39d8d7['plugins']['get'](i);_0x229f04['markers']['on']('update:user:range',(_0x1c0287,_0x564a8c,_0x2f9ab6,_0x386c0e)=>{if(!_0x386c0e&&_0x21baf2['get'](_0x564a8c['name']))return _0x21baf2['get'](_0x564a8c['name'])['detach'](),void _0x21baf2['delete'](_0x564a8c['name']);const _0x568c07=_0x564a8c['name']['split'](':')[0x2];if(_0x568c07===_0x5c06b9['mySessionId'])return;const _0x21fc59='user:position:'+_0x568c07;_0x229f04['markers']['has'](_0x21fc59)&&_0x39d8d7['editing']['reconvertMarker'](_0x21fc59),_0x564a8c['on']('change:range',(_0x9cdaca,_0x5ed22f,_0x2b95bc)=>{if('$graveyard'!=_0x5ed22f['root']['rootName']&&'$graveyard'==_0x564a8c['getRange']()['root']['rootName']&&!_0x21baf2['has'](_0x564a8c['name'])){const _0x2924f5=_0x229f04['schema']['getNearestSelectionRange'](_0x2b95bc['deletionPosition']);if(_0x2924f5){const _0x12591f=ht['fromRange'](_0x2924f5);_0x21baf2['set'](_0x564a8c['name'],_0x12591f),_0x12591f['on']('change:range',(_0x4906eb,_0x5f0624,_0x2a23e4)=>{if('$graveyard'==_0x12591f['root']['rootName']){const _0x5d79e1=_0x229f04['schema']['getNearestSelectionRange'](_0x2a23e4['deletionPosition']);_0x5d79e1?(_0x12591f['start']=_0x5d79e1['start'],_0x12591f['end']=_0x5d79e1['end']):(_0x21baf2['delete'](_0x564a8c['name']),_0x12591f['detach']());}});}}});}),_0x229f04['document']['on']('change',()=>{_0x21baf2['size']>0x0&&_0x229f04['enqueueChange']({'isUndoable':!0x1},_0x5c30fb=>{for(const [_0x4096ae,_0x285974]of _0x21baf2)'$graveyard'==_0x229f04['markers']['get'](_0x4096ae)['getRange']()['root']['rootName']&&(re(_0x4096ae['split'](':')[0x2],_0x285974['toRange'](),_0x229f04,_0x5c30fb),_0x285974['detach']());_0x21baf2['clear']();});});}(_0x3689c9),this['_domEmitter']['listenTo'](_0x3a6be1['document'],'keydown',(_0x5bf6a8,{key:_0x4f09e1})=>{'Escape'===_0x4f09e1&&function(_0x285586){_0x285586['editing']['view']['change'](_0x263385=>{for(const _0x17d522 of _0x285586['model']['markers']){if(!_0x17d522['name']['startsWith']('user:position'))continue;const _0x4234d8=_0x285586['editing']['mapper']['markerNameToElements'](_0x17d522['name']);if(_0x4234d8){for(const _0x5362c3 of _0x4234d8)_0x263385['removeClass']('ck-user__marker_hovered',_0x5362c3);}}});}(_0x3689c9);},{'useCapture':!0x0});}['afterInit'](){const _0xdc6b4a=this['editor'],_0x2f2637=_0xdc6b4a['commands']['get']('undo');_0x2f2637&&_0xdc6b4a['model']['on']('applyOperation',(_0x307868,_0x5730fb)=>{const _0x5ae825=_0x5730fb[0x0];if('marker'!=_0x5ae825['type']||!_0x5ae825['name']['startsWith']('user:'))return;const _0x9548=_0x5ae825['batch'];_0x2f2637['_createdBatches']['has'](_0x9548)&&(_0x5ae825['newRange']=_0x5ae825['oldRange']?_0xdc6b4a['model']['createRange'](_0x5ae825['oldRange']['start'],_0x5ae825['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x1bddd7=this['editor'],_0x3807ae=_0x1bddd7['model']['document'],_0x5ccd65=_0x1bddd7['plugins']['get'](i);_0x1bddd7['model']['enqueueChange']({'isUndoable':!0x1},_0x411a4c=>{const _0x310c68='user:range:'+_0x5ccd65['mySessionId'],_0x2f6297='user:position:'+_0x5ccd65['mySessionId'],_0x4ad82f=_0x1bddd7['model']['markers']['has'](_0x310c68);_0x1bddd7['editing']['view']['hasDomSelection']?re(_0x5ccd65['mySessionId'],_0x3807ae['selection']['getFirstRange'](),_0x1bddd7['model'],_0x411a4c):_0x4ad82f&&(_0x411a4c['removeMarker'](_0x310c68),_0x411a4c['removeMarker'](_0x2f6297));});}}function re(_0x17dea5,_0x55b6c1,_0x4d8739,_0x3857fb){const _0x132cb7='user:range:'+_0x17dea5,_0x38cd4c='user:position:'+_0x17dea5,_0x423d42=_0x55b6c1['getContainedElement']();let _0x22d71c=_0x55b6c1['start'];_0x423d42&&_0x423d42['is']('element','tableCell')&&(_0x22d71c=function(_0x3b0930,_0x399deb){for(const _0x305ea1 of _0x3b0930['getPositions']())if(_0x399deb['schema']['checkChild'](_0x305ea1,'$text'))return _0x305ea1;}(_0x55b6c1,_0x4d8739),_0x55b6c1=_0x3857fb['createRange'](_0x22d71c));const _0x13167e=_0x3857fb['createRange'](_0x22d71c);_0x4d8739['markers']['has'](_0x132cb7)?(_0x3857fb['updateMarker'](_0x132cb7,{'range':_0x55b6c1}),_0x3857fb['updateMarker'](_0x38cd4c,{'range':_0x13167e})):(_0x3857fb['addMarker'](_0x132cb7,{'range':_0x55b6c1,'usingOperation':!0x0}),_0x3857fb['addMarker'](_0x38cd4c,{'range':_0x13167e,'usingOperation':!0x0}));}function q(_0x5355da,_0x2f5a15,_0x35f5f4){const _0x314ffb=_0x5355da['t'],t=_0x5355da['t'];switch(_0x2f5a15){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 _0x314ffb({'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'},_0x35f5f4);default:return'';}}let K=0x1;class l extends _0x1d59aa{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x457671)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,H,_0x5ac87a,_0x41520f,_0x418779];}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 _0x5978d4=this['serverHistory']['getOperations']();for(let _0x2f7111=_0x5978d4['length']-0x1;_0x2f7111>=0x0;_0x2f7111--){const _0x3d5629=_0x5978d4[_0x2f7111];if(!this['_disconnectionOperations']['has'](_0x3d5629))return _0x3d5629['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2e3060){if(super(_0x2e3060),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x35db70(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0xce1efc('collaboration-missing-channelid',this);const _0x4b5152=_0x2e3060['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x4b5152,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1b9d22(),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 X(this['_disconnectionOperations']);}['init'](){const _0x3f96a7=this['editor'],_0x3875ce=_0x3f96a7['plugins']['get'](_0x41520f),_0x4c4f46=_0x3f96a7['plugins']['get'](c);this['listenTo'](_0x3875ce,'getOperationAuthor',(_0x44c04a,_0x288bc2)=>{const _0x41b950=_0x288bc2[0x0];_0x41b950['_authorId']&&(_0x44c04a['return']=_0x3875ce['getUser'](_0x41b950['_authorId']),_0x44c04a['stop']()),null===_0x41b950['_authorId']&&(_0x44c04a['return']=null,_0x44c04a['stop']());},{'priority':'high'}),this['listenTo'](_0x3f96a7['model']['document']['selection'],'change:range',(_0x1e4da6,_0x5342ef)=>{_0x5342ef['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3f96a7['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3f96a7['model']['on']('applyOperation',(_0xcf0751,_0x1f7e6e)=>{const _0x4d7a3f=_0x1f7e6e[0x0];_0x4d7a3f['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4d7a3f),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4c4f46,'state',this,'_hasSynchronizationProblem',(_0x3bf26b,_0x174372)=>'connected'===_0x3bf26b&&!_0x174372),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3f96a7['disableReadOnlyMode']('rtc-offline'):_0x3f96a7['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3f96a7['disableReadOnlyMode']('rtc-offline'):_0x3f96a7['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x2ec563=this['editor']['plugins']['get'](i),_0x38fd12=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x2ec563['unregister'](this['_channelId']);const _0x4aadd1=await this['_service']['reconnect'](_0x38fd12['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4aadd1)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x5ca3a8=await this['_service']['getConnectedSessions']();_0x2ec563['register'](this['_channelId'],_0x5ca3a8),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xe54870){if(function(_0x1f6a63){return'404'===_0x1f6a63['code'];}(_0xe54870)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x1ae424){return'409'===_0x1ae424['code'];}(_0xe54870)){const _0x412f49=q(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'](_0x412f49);}else{if(!(_0xe54870 instanceof J))throw _0xe54870;this['_handleReconnectionError']();}}}}['destroy'](){const _0x4f6740=this['editor']['plugins']['get'](c),_0x43e65d=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x43e65d['channelSessions']['has'](this['_channelId'])&&_0x43e65d['unregister'](this['_channelId']),_0x4f6740['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x23dbb2){if(this['sessionId']!==_0x23dbb2['sessionId']&&this['_lastSyncedOperationId']!==_0x23dbb2['lastOperationId'])throw new J();return this['sessionId']=_0x23dbb2['sessionId'],this['_handleServerResponse']([],{..._0x23dbb2,'wereChangesApplied':!0x1,'data':_0x23dbb2['data']},'reconnect');}async['_connectService'](_0x48a43f,_0xb6a6c7=!0x1){const {connection:_0x9969f1}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x9969f1,this['_channelId'])['then'](_0x47594d=>this['_initSessionsHandling'](_0x47594d))['catch'](_0x4a8887=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4a8887);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x430018,_0x3b7db3)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x3b7db3);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x394141=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x48a43f);this['_isPendingUpdate']=!0x0;const _0x43b58b=await this['_service']['connect'](_0x9969f1,this['_compressOperations'](_0x48a43f),_0x394141);if(this['sessionId']=_0x43b58b['sessionId'],_0xb6a6c7){if(!_0x43b58b['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x43b58b['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x48a43f,_0x43b58b,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x43b58b,_0x48a43f);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x7d6b18=this['editor']['plugins']['get'](i),_0x4471ae=this['editor']['plugins']['get'](H),_0x5ce01d=_0x7d6b18['channelSessions']['get'](this['_channelId']);_0x5ce01d&&_0x5ce01d['length']>0x1?_0x4471ae['createUserMarkerOperations']():this['listenTo'](_0x7d6b18,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x7d6b18['channelSessions']['get'](this['_channelId'])['length']&&_0x4471ae['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x103b71,_0x1818ba,_0x22ea71,_0x2a567e){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1818ba){const _0x44477d=this['_decompressOperations'](_0x22ea71,_0x2a567e);await this['_fetchMissingUsers'](_0x44477d),this['_handleExternalOperations'](_0x44477d,_0x1818ba,_0x22ea71['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x25b5f5}=this['editor'];let _0x18a429;try{_0x18a429=await this['_service']['getDocumentDetails']();}catch(_0x252b9b){const _0x59fdff=q(_0x25b5f5,'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'](_0x59fdff);}const _0x15e54c=_0x18a429['currentDocumentSession']||_0x18a429['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x15e54c['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x1a15c3=q(_0x25b5f5,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x1a15c3);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x3901e3){const _0x28a61e=this['editor']['plugins']['get'](i);this['listenTo'](_0x28a61e,'sessionAdd:'+this['_channelId'],(_0x32306e,{session:_0x5a8ec5})=>{if(_0x5a8ec5['id']===_0x28a61e['mySessionId']){_0x32306e['off']();const _0x5f2293=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x168261=_0x5a8ec5['permissions'];_0x5f2293&&_0x5f2293['isEnabled']&&(_0x168261=_0x168261['filter'](_0x5d158c=>'document:write'!==_0x5d158c)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x168261,this['_channelId']);}}),_0x28a61e['register'](this['_channelId'],_0x3901e3);}['_initThrowingOnDataSet'](){const _0x50d75b=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1505c0)=>{if(!_0x1505c0[_0x1505c0['length']-0x1]['suppressErrorInCollaboration'])throw new _0xce1efc('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x50d75b['apply'](this['editor']['data'],_0x1505c0);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x17ec5d,[_0x57a0ba])=>{if(this['_document']['version'])throw new _0xce1efc('realtimecollaborationclient-init-document-already-initialized',this);_0x17ec5d['stop'](),this['_setPendingAction']();const _0x2d6f72=this['editor']['config']['get']('rootsAttributes'),_0x3a001a=this['_getOperationsFromInitData'](_0x57a0ba,_0x2d6f72);0x0==_0x3a001a['length']&&_0x3a001a['push'](new _0xb7977d(0x0)),_0x17ec5d['return']=this['_connectService'](_0x3a001a)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3ff488=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3ff488))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x579f4d,[_0x35d8f4,_0x8bc608])=>{_0x579f4d['stop']();const _0x55b525=this['editor']['model']['document']['getRoot'](_0x35d8f4);if(!this['_knownRootNames']['has'](_0x35d8f4)){const _0x584b18=_0x8bc608&&_0x8bc608['data']?_0x8bc608['data']:'',_0x1f2a0b=_0x8bc608&&_0x8bc608['attributes']?_0x8bc608['attributes']:{};await this['_loadRoot'](_0x35d8f4,_0x584b18,_0x1f2a0b);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x55b525['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x55b525);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xb07757){const _0x1dbe5c=this['editor']['plugins']['get'](_0x41520f),{connection:_0x3fcfcb}=this['editor']['plugins']['get'](c),_0x944b39=new Set();for(const _0x152e26 of _0xb07757){const _0x18126c=_0x152e26['_authorId'];_0x18126c&&!_0x1dbe5c['getUser'](_0x18126c)&&_0x944b39['add'](_0x18126c);}if(0x0===_0x944b39['size'])return;const _0x489098=await dt['getMany'](_0x3fcfcb,Array['from'](_0x944b39));for(const _0x536420 of _0x489098)_0x1dbe5c['getUser'](_0x536420['id'])||_0x1dbe5c['addUser'](_0x536420);}['_getOperationsFromInitData'](_0x4b6dbb,_0x14b109={}){const _0x51c5a4=this['editor']['model'],_0x4d93e9=[];let _0x38b6f2=0x0;const _0x998773='string'==typeof _0x4b6dbb?{'main':_0x4b6dbb}:_0x4b6dbb;for(const _0x488b5f of Object['keys'](_0x998773)){if(!this['_document']['roots']['has'](_0x488b5f))throw new _0xce1efc('realtimecollaborationclient-init-non-existent-root',this);const _0x1b0524=this['editor']['data']['parse'](_0x998773[_0x488b5f]),_0x352b1f=this['_document']['getRoot'](_0x488b5f),_0x156d47=new _0x5e6cd9(_0x51c5a4['createPositionAt'](_0x352b1f,0x0),_0x1b0524,_0x38b6f2++);_0x4d93e9['push'](_0x156d47);for(const [_0x5e5601,_0x274ae3]of _0x1b0524['markers']){const _0x588f75=_0x51c5a4['createRange'](_0x51c5a4['createPositionFromPath'](_0x352b1f,_0x274ae3['start']['path']['slice']()),_0x51c5a4['createPositionFromPath'](_0x352b1f,_0x274ae3['end']['path']['slice']())),_0x5b5173=new _0x2e40d9(_0x5e5601,null,_0x588f75,_0x51c5a4['markers'],!0x0,_0x38b6f2++);_0x4d93e9['push'](_0x5b5173);}}if(_0x14b109)for(const [_0x13e4d7,_0x597f18]of Object['entries'](_0x14b109)){const _0x1f7da3=_0x51c5a4['document']['getRoot'](_0x13e4d7);if(!_0x1f7da3)throw new _0xce1efc('multi-root-editor-root-attributes-no-root',null);for(const [_0x381323,_0x4f5540]of Object['entries'](_0x597f18))if(null!==_0x4f5540){const _0x1ff437=new _0x30bb3b(_0x1f7da3,_0x381323,null,_0x4f5540,_0x38b6f2++);_0x4d93e9['push'](_0x1ff437);}}return _0x4d93e9;}async['_loadRoot'](_0x4ca82e,_0x4576be,_0x436c17){this['_getOperationsFromInitData']({[_0x4ca82e]:_0x4576be},{[_0x4ca82e]:_0x436c17})['forEach']((_0x2dca9a,_0x9dc88a)=>{_0x2dca9a['baseVersion']=this['_document']['version']+_0x9dc88a,_0x2dca9a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2dca9a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0xe504b,_0x1ab60a){let _0x5e371c;this['_offset']=_0xe504b['offset'];const _0x20c49f=_0xe504b['wereChangesApplied']&&!_0xe504b['initData'],_0xb6773e=_0x20c49f?0x0:_0xe504b['data']['baseVersion'];if(_0x1ab60a['forEach'](_0xf8a449=>{_0xf8a449['_isInit']=!0x0,_0xf8a449['createdAt']=_0xe504b['sessionCreatedAt'],_0xf8a449['_authorId']=null;}),_0x20c49f)_0x5e371c=_0x1ab60a,this['_applyOperationsSet'](_0x5e371c,_0x20c49f);else{if(_0xe504b['initData']){const _0x9b76cc=this['_getOperationsFromInitData'](_0xe504b['initData']);this['_document']['history']['version']=-_0x9b76cc['length'],_0x9b76cc['forEach'](_0x5c24ea=>{_0x5c24ea['baseVersion']-=_0x9b76cc['length'],_0x5c24ea['createdAt']=_0xe504b['sessionCreatedAt'],_0x5c24ea['_isInit']=!0x0,_0x5c24ea['_authorId']=null;}),this['_applyOperationsSet'](_0x9b76cc,!0x0),this['serverHistory']['version']=-_0x9b76cc['length']+this['_offset'],this['_updateServerHistory'](_0x9b76cc);}this['_document']['history']['version']=_0xb6773e,_0x5e371c=this['_decompressOperations'](_0xe504b['data'],_0xe504b['metadata']),await this['_fetchMissingUsers'](_0x5e371c),this['_applyOperationsSet'](_0x5e371c,_0x20c49f);}_0xe504b['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5e371c,_0xe504b['lastOperationId']),this['_lastSyncedOperationId']=_0xe504b['lastOperationId']),this['serverHistory']['version']=_0xb6773e+this['_offset'],this['_updateServerHistory'](_0x5e371c),_0x1ab60a['filter'](_0x50b2a5=>{const _0x310acf=this['_getAffectedRoot'](_0x50b2a5);return _0x310acf&&!this['_knownRootNames']['has'](_0x310acf);})['forEach']((_0x409c53,_0x1f3f7f)=>{_0x409c53['baseVersion']=this['_document']['version']+_0x1f3f7f,this['_saveOperationInBuffer'](_0x409c53);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2411f5,_0x682cc8){throw this['_isPendingUpdate']=!0x0,_0x682cc8&&console['error'](_0x682cc8),new _0xce1efc(_0x2411f5,this['editor']);}['_saveOperationInBuffer'](_0x1f0c87){this['_knownOperations']['has'](_0x1f0c87)||(this['_knownOperations']['add'](_0x1f0c87),this['_bufferedOperations']['push'](_0x1f0c87),this['_pendingAction']||'marker'==_0x1f0c87['type']&&!_0x1f0c87['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x26872b=!0x1){!_0x26872b&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x16c01d=>{_0x16c01d&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3b99cf=>{if(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,!function(_0x511993){return _0x511993['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x511993['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x511993['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3b99cf))throw _0x3b99cf;});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x27c409=>{this['on']('change:_isPendingUpdate',()=>{_0x27c409();});});}async['_sendBufferedOperations'](){const _0x56ef09=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x56ef09['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x219cc5=[...this['_bufferedOperations']];for(const _0x397245 of _0x219cc5)_0x397245['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x397245);const _0x2418f0=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x219cc5),_0x39c4bf=K++,_0x5e1794=this['_compressOperations'](_0x219cc5),_0x5ed548=await this['_service']['sendOperations'](_0x5e1794,_0x5e1794['baseVersion'],_0x2418f0);try{return await this['_handleServerResponse'](_0x219cc5,_0x5ed548,_0x39c4bf);}catch(_0x4f003c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4f003c);}}async['_handleServerResponse'](_0x5def2f,_0x3b7dcc,_0x2479f9){if('error'in _0x3b7dcc)throw _0x3b7dcc['error'];let _0x323453=!0x1;if(_0x3b7dcc['wereChangesApplied']){_0x3b7dcc['lastOperationId']&&(this['_lastSyncedOperationId']=_0x3b7dcc['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3679cd=>!_0x5def2f['includes'](_0x3679cd));for(const _0x4d2e9c of _0x5def2f)_0x4d2e9c['createdAt']='lastOperationAcceptedAt'in _0x3b7dcc&&_0x3b7dcc['lastOperationAcceptedAt']||void 0x0;Q(_0x5def2f,_0x3b7dcc['version']-_0x5def2f['length']),this['_updateServerHistory'](_0x5def2f);const _0x5787a2=_0x5def2f['filter'](_0x57f42d=>{if(!_0x57f42d['_isInit'])return!0x1;const _0x5e056a=this['_getAffectedRoot'](_0x57f42d);return _0x5e056a&&!this['_knownRootNames']['has'](_0x5e056a);});Q(_0x5787a2,this['_document']['version']),this['_applyOperationsSet'](_0x5787a2),_0x323453=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x1683b1=this['_decompressOperations'](_0x3b7dcc['data'],_0x3b7dcc['metadata'])['filter'](_0x2d28f4=>_0x2d28f4['baseVersion']>=this['_lastServerVersion']);_0x1683b1['forEach'](_0x504b03=>this['_addKnownRoot'](_0x504b03)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xbf4bdc=>!_0xbf4bdc['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xbf4bdc))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x1683b1),_0x323453=this['_handleExternalOperations'](_0x1683b1,_0x3b7dcc['version'],_0x3b7dcc['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x323453?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2ee8a2,_0x3ddafe,_0x5d061b){try{const _0x3e8d35={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1cf758,operationsB:_0x512ccf,originalOperations:_0x2d7aca}=_0x29b639(_0x2ee8a2,this['_bufferedOperations'],_0x3e8d35);Q(_0x1cf758,this['_document']['version']),Q(_0x512ccf,_0x3ddafe);for(const _0xb16886 of _0x1cf758){const _0xa7d302=_0x2d7aca['get'](_0xb16886);_0xb16886['_authorId']=_0xa7d302?_0xa7d302['_authorId']:null;}_0x5d061b&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2ee8a2,_0x5d061b),this['_lastSyncedOperationId']=_0x5d061b),this['_bufferedOperations']=[..._0x512ccf],this['_applyOperationsSet'](_0x1cf758),this['_updateServerHistory'](_0x2ee8a2);}catch(_0x4cc775){return console['error'](_0x4cc775),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3f9648,_0x30a78c=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x27d009=>{for(const _0x1e0625 of _0x3f9648)this['_knownOperations']['add'](_0x1e0625),this['_addKnownRoot'](_0x1e0625),_0x27d009['batch']['addOperation'](_0x1e0625),this['editor']['model']['applyOperation'](_0x1e0625);});}['_addKnownRoot'](_0x10bdfc){const _0x4b36a3=this['_getAffectedRoot'](_0x10bdfc);_0x4b36a3&&this['_knownRootNames']['add'](_0x4b36a3);}['_getAffectedRoot'](_0x2fda3f){let _0x1f9f91,_0x580095;switch(_0x2fda3f['type']){case'insert':_0x1f9f91=_0x2fda3f['position']['root'];break;case'marker':if(_0x580095=_0x2fda3f['newRange'],!_0x580095)return null;_0x1f9f91=_0x580095['root'];break;case'addRootAttribute':_0x1f9f91=_0x2fda3f['root'];break;case'addRoot':_0x1f9f91=_0x2fda3f['affectedSelectable'];break;case'move':_0x1f9f91=_0x2fda3f['targetPosition']['root'];break;default:return null;}return _0x1f9f91['rootName'];}['_updateServerHistory'](_0xa402c5){_0xa402c5['forEach'](_0x468a95=>{const _0x1c5ad8=_0x468a95['clone']();_0x1c5ad8['_authorId']=_0x468a95['_authorId'],_0x1c5ad8['_isInit']=!!_0x468a95['_isInit'],_0x1c5ad8['createdAt']=_0x468a95['createdAt'],_0x1c5ad8['baseVersion']+=this['_offset'],_0x468a95['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x1c5ad8),this['serverHistory']['addOperation'](_0x1c5ad8);});}['_handleReconnectionError'](_0x335e5e){const _0x5d44eb=this['editor']['plugins']['get']('Notification'),_0x37c80c=this['editor']['locale'];_0x335e5e||(_0x335e5e=q(_0x37c80c,'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.')),_0x5d44eb['showWarning'](_0x335e5e,{'title':q(_0x37c80c,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x5ac87a)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x5ac87a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x4a1818){const _0x47dc7e=_0x4a1818['map'](_0x5181b8=>_0x5181b8['toJSON']());return this['_compressor']['compress'](_0x47dc7e);}['_decompressOperations'](_0x189049,_0x20eac0){return this['_compressor']['decompress'](_0x189049)['map']((_0x4c9b15,_0x48a6c4)=>{const _0x20d8fe='init'==_0x20eac0[_0x48a6c4]['type'];if('InsertOperation'==_0x4c9b15['__className']){const _0x1436e6=_0x4c9b15['position']['root'];!this['_document']['getRoot'](_0x1436e6)&&(this['_document']['createRoot']('$root',_0x1436e6)['_isAttached']=!0x1);}const _0x5aa82a=_0x27822e['fromJSON'](_0x4c9b15,this['_document']);return _0x5aa82a['wasUndone']=_0x4c9b15['wasUndone'],_0x5aa82a['_isInit']=_0x20d8fe,_0x5aa82a['_authorId']=_0x20d8fe?null:_0x20eac0[_0x48a6c4]['userId'],_0x5aa82a['_isDisconnection']='cs:removeUser'===_0x20eac0[_0x48a6c4]['type'],_0x5aa82a['createdAt']=_0x20eac0[_0x48a6c4]['createdAt'],_0x5aa82a;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x10fd8a=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x10fd8a&&_0x10fd8a['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x1a983b,_0x3a4897){for(const _0x51de52 of _0x1a983b)_0x51de52['baseVersion']=_0x3a4897++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x5bfe31){this['_ignoredOperations']=_0x5bfe31,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x25012c){let _0x16001b=_0x25012c['length'];for(;_0x16001b--;){const _0xa25286=_0x25012c[_0x16001b];if(!this['_ignoredOperations']['has'](_0xa25286)){if(!this['_operationToId']['has'](_0xa25286)){const _0x403e00=_0x391ccf()['slice'](0x1,0x12);this['_operationToId']['set'](_0xa25286,_0x403e00);}return this['_operationToId']['get'](_0xa25286);}}}['setIdForTheLastOperation'](_0x3d64d4,_0x4902d5){if(!_0x4902d5)return;let _0x520698=_0x3d64d4['length'];for(;_0x520698--;){const _0x38a3fd=_0x3d64d4[_0x520698];this['_ignoredOperations']['has'](_0x38a3fd)||this['_operationToId']['set'](_0x38a3fd,_0x4902d5);}}}class n extends _0x1d59aa{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x398b21{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x36a322)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x41520f];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ea9d5){super(_0x2ea9d5),this['_services']=new Map();}async['init'](){const _0x31ef29=this['context'],_0x5d8902=_0x31ef29['plugins']['get']('CommentsRepository');if(_0x31ef29['plugins']['get'](c)['addToReconnectionStack'](this),_0x5d8902['adapter']={'addCommentThread':async({channelId:_0x3fbf3d,threadId:_0x12fe76,comments:_0x53c4e5,resolvedAt:_0x598424,resolvedBy:_0x55f5f8,context:_0x4a0139,attributes:_0x239c22})=>{const _0x29af10=await this['_getService'](_0x3fbf3d)['addCommentThread']({'commentThreadId':_0x12fe76,'comments':_0x53c4e5['map'](_0x4d4143=>function(_0x5b28ed,_0x4d55d6,_0x398824){return{'commentThreadId':_0x398824,'commentId':_0x5b28ed['commentId'],'userId':_0x5b28ed['authorId'],'content':_0x5b28ed['content'],'documentId':_0x4d55d6,'createdAt':_0x5b28ed['createdAt'],'attributes':_0x5b28ed['attributes']||{}};}(_0x4d4143,_0x3fbf3d,_0x12fe76)),'resolvedAt':_0x598424,'resolvedBy':_0x55f5f8,'context':_0x4a0139,'attributes':_0x239c22})['catch'](ut);return{'threadId':_0x29af10['commentThreadId'],'comments':_0x29af10['comments']};},'getCommentThread':async({channelId:_0x15d5c8,threadId:_0x4eac02})=>{const _0x26a25e=await this['_getService'](_0x15d5c8)['getCommentThread'](_0x4eac02)['catch'](ut);return _0x26a25e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x26a25e]),{'threadId':_0x26a25e['commentThreadId'],'comments':_0x26a25e['comments']['map'](b),'context':_0x26a25e['context'],'resolvedAt':_0x26a25e['resolvedAt'],'resolvedBy':_0x26a25e['resolvedBy'],'attributes':_0x26a25e['attributes']||{}});},'updateCommentThread':async({channelId:_0x300393,threadId:_0x1e7e60,context:_0xb64a39,unlinkedAt:_0x581440,attributes:_0x4292e5})=>this['_getService'](_0x300393)['updateCommentThread']({'commentThreadId':_0x1e7e60,'context':_0xb64a39,'attributes':_0x4292e5,'unlinkedAt':_0x581440})['catch'](y)['catch'](ut),'resolveCommentThread':async({channelId:_0x398a51,threadId:_0x16a76a})=>{const _0x190a7e=await this['_getService'](_0x398a51)['resolveCommentThread'](_0x16a76a)['catch'](y)['catch'](ut);return{'threadId':_0x190a7e['commentThreadId'],'resolvedAt':_0x190a7e['resolvedAt'],'resolvedBy':_0x190a7e['resolvedBy']};},'reopenCommentThread':async({channelId:_0x7edafd,threadId:_0x1cb948})=>this['_getService'](_0x7edafd)['reopenCommentThread'](_0x1cb948)['catch'](y)['catch'](ut),'removeCommentThread':({channelId:_0x40252b,threadId:_0x41cc65})=>this['_getService'](_0x40252b)['removeCommentThread'](_0x41cc65)['catch'](y)['catch'](ut),'addComment':({channelId:_0x3a07ff,threadId:_0x205cb1,commentId:_0x12b631,content:_0xa8b9e8,attributes:_0x2a01e9})=>this['_getService'](_0x3a07ff)['addComment'](_0x205cb1,_0x12b631,_0xa8b9e8,_0x2a01e9)['catch'](ut),'updateComment':({channelId:_0x27af59,threadId:_0x33f20f,commentId:_0x25ec8a,content:_0x556163,attributes:_0x3705d5})=>this['_getService'](_0x27af59)['updateComment'](_0x33f20f,_0x25ec8a,_0x556163,_0x3705d5)['catch'](y)['catch'](ut),'removeComment':({channelId:_0x587cf9,threadId:_0x1fef65,commentId:_0x7ca871})=>this['_getService'](_0x587cf9)['removeComment'](_0x1fef65,_0x7ca871)['catch'](y)['catch'](ut)},_0x31ef29 instanceof _0x5d390a){const _0x21e123=_0x31ef29['config']['get']('collaboration.channelId'),_0x1a62e7=_0x31ef29['plugins']['get'](i);await this['_setUpService'](_0x21e123);const _0x5f00c3=await this['_services']['get'](_0x21e123)['getConnectedSessions']();this['listenTo'](_0x1a62e7,'sessionAdd:'+_0x21e123,(_0x2bfe1a,{session:_0x4791a5})=>{_0x4791a5['id']===_0x1a62e7['mySessionId']&&(_0x2bfe1a['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4791a5['permissions'],_0x21e123));}),_0x1a62e7['register'](_0x21e123,_0x5f00c3);}}async['_setUpService'](_0x4a7263){if(this['_services']['has'](_0x4a7263))throw new _0xce1efc('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4a7263});const _0x23acfc=this['context']['plugins']['get']('CommentsRepository'),_0x29f0a9=new a['CommentsService'](_0x4a7263);this['_services']['set'](_0x4a7263,_0x29f0a9),this['listenTo'](_0x29f0a9,'commentThreadAdded',(_0x260278,_0x577267)=>{const {commentThreadId:_0x450661,documentId:_0x240d63,context:_0x23e666,attributes:_0x56ef6c,resolvedAt:_0x295999,resolvedBy:_0x16e80e,comments:_0x306126}=_0x577267;_0x23acfc['getCommentThread'](_0x450661)||_0x23acfc['addCommentThread']({'threadId':_0x450661,'channelId':_0x240d63,'comments':_0x306126?_0x306126['map'](b):[],'context':_0x23e666,'attributes':_0x56ef6c,'resolvedAt':_0x295999,'resolvedBy':_0x16e80e,'isFromAdapter':!0x0});}),this['listenTo'](_0x29f0a9,'commentThreadUpdated',(_0x6bdca4,{commentThreadId:_0x1742fa,documentId:_0x2a5644,context:_0x5c9c61,unlinkedAt:_0xabfe2b,attributes:_0x3b8974})=>{_0x23acfc['getCommentThread'](_0x1742fa)&&_0x23acfc['updateCommentThread']({'threadId':_0x1742fa,'channelId':_0x2a5644,'context':_0x5c9c61,'unlinkedAt':_0xabfe2b,'attributes':_0x3b8974,'isFromAdapter':!0x0});}),this['listenTo'](_0x29f0a9,'commentThreadResolved',(_0x238639,{commentThreadId:_0x40ca8a,resolvedBy:_0x2d483e,resolvedAt:_0x1d5cee})=>{const _0x18c375=_0x23acfc['getCommentThread'](_0x40ca8a);_0x18c375&&_0x18c375['resolve']({'resolvedBy':_0x2d483e,'resolvedAt':_0x1d5cee,'isFromAdapter':!0x0});}),this['listenTo'](_0x29f0a9,'commentThreadReopened',(_0xf8f256,{commentThreadId:_0x11e45b})=>{const _0x4ae41b=_0x23acfc['getCommentThread'](_0x11e45b);_0x4ae41b&&_0x4ae41b['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x29f0a9,'commentThreadRemoved',(_0x15f4c1,{commentThreadId:_0x368eb2})=>{const _0x20fa3c=_0x23acfc['getCommentThread'](_0x368eb2);_0x20fa3c&&_0x20fa3c['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x29f0a9,'commentAdded',(_0x3e0b0c,_0x234474)=>{const _0x2af15f=_0x234474['commentThreadId'],_0x5076ec=_0x23acfc['getCommentThread'](_0x2af15f);_0x5076ec&&_0x5076ec['addComment']({...b(_0x234474),'isFromAdapter':!0x0});}),this['listenTo'](_0x29f0a9,'commentUpdated',(_0xe417c3,{commentThreadId:_0x56733c,commentId:_0x44709f,content:_0x32326f,attributes:_0xcdc361})=>{const _0xeff6a6=_0x23acfc['getCommentThread'](_0x56733c);if(_0xeff6a6){const _0x505316=_0xeff6a6['getComment'](_0x44709f);_0x505316&&_0x505316['update']({'content':_0x32326f,'attributes':_0xcdc361,'isFromAdapter':!0x0});}}),this['listenTo'](_0x29f0a9,'commentRemoved',(_0x231caa,{commentThreadId:_0x9d2e71,commentId:_0x538553})=>{const _0x31647c=_0x23acfc['getCommentThread'](_0x9d2e71);if(_0x31647c){const _0x4ce8cb=_0x31647c['getComment'](_0x538553);_0x4ce8cb&&_0x4ce8cb['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4a7263);}['destroy'](){if(this['context']instanceof _0x5d390a){const _0x3834a9=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3834a9);}}['_terminateService'](_0x3a69f9){if(!this['_services']['has'](_0x3a69f9))throw new _0xce1efc('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x3a69f9});this['_getService'](_0x3a69f9)['disconnect'](),this['_services']['delete'](_0x3a69f9);}async['reconnect'](){for(const _0x2bdbfb of this['_services']['keys']())await this['_connectService'](_0x2bdbfb);if(this['context']instanceof _0x5d390a){const _0x456b03=this['context']['config']['get']('collaboration.channelId'),_0x960c3f=this['context']['plugins']['get'](i);_0x960c3f['unregister'](_0x456b03);const _0x215042=await this['_services']['get'](_0x456b03)['getConnectedSessions']();_0x960c3f['register'](_0x456b03,_0x215042);}}async['_connectService'](_0x3780c2){const {connection:_0x4dfa8c}=this['context']['plugins']['get'](c),_0x9205ed=this['context']['plugins']['get']('CommentsRepository'),_0x276e31=this['_services']['get'](_0x3780c2),_0x3e1979=await _0x276e31['connect'](_0x4dfa8c);await this['_fetchMissingUsersForThreads'](_0x3e1979);const _0x4b64f5=new Set(Array['from'](_0x9205ed['getCommentThreads']({'channelId':_0x3780c2}),_0x334eb8=>_0x334eb8['id']));for(const _0x13416b of _0x3e1979)_0x13416b['deletedAt']||_0x4b64f5['delete'](_0x13416b['commentThreadId']);for(const _0x52ace6 of _0x4b64f5)_0x9205ed['getCommentThread'](_0x52ace6)['remove']({'isFromAdapter':!0x0});for(const _0x340bc7 of _0x3e1979){let _0x58b7a6=_0x9205ed['getCommentThread'](_0x340bc7['commentThreadId']);const {commentThreadId:_0x36c800,context:_0x23435f,attributes:_0xf07d1a,resolvedBy:_0x3cbd4a,resolvedAt:_0x447140,unlinkedAt:_0x221a7e,deletedAt:_0x4cfcb7}=_0x340bc7;if(_0x4cfcb7)continue;_0x58b7a6||(_0x58b7a6=_0x9205ed['addCommentThread']({'channelId':_0x3780c2,'threadId':_0x36c800,'context':_0x23435f,'attributes':_0xf07d1a||{},'resolvedBy':_0x3cbd4a,'resolvedAt':_0x447140,'unlinkedAt':_0x221a7e,'isFromAdapter':!0x0}));const _0x272c43=new Set(Array['from'](_0x58b7a6['comments'],_0x548d2e=>_0x548d2e['id']));for(const _0x2c837f of _0x340bc7['comments'])_0x272c43['delete'](_0x2c837f['commentId']);for(const _0x39b1c5 of _0x272c43)_0x58b7a6['getComment'](_0x39b1c5)['remove']({'isFromAdapter':!0x0});for(const _0x424ad5 of _0x340bc7['comments']){const _0x5c83fe=_0x58b7a6['getComment'](_0x424ad5['commentId']);_0x5c83fe?_0x5c83fe['content']!==_0x424ad5['content']&&_0x5c83fe['update']({'content':_0x424ad5['content'],'isFromAdapter':!0x0}):_0x58b7a6['addComment'](Object['assign'](b(_0x424ad5),{'isFromAdapter':!0x0}));}}}['_getService'](_0xc4af6a){if(!this['_services']['has'](_0xc4af6a))throw new _0xce1efc('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xc4af6a});return this['_services']['get'](_0xc4af6a);}async['_fetchMissingUsersForThreads'](_0xbde271){const _0x444825=this['context']['plugins']['get'](_0x41520f),{connection:_0x1494a2}=this['context']['plugins']['get'](c),_0x518d2d=new Set();for(const {resolvedBy:_0x48f80d,comments:_0x44c21a}of _0xbde271){_0x48f80d&&!_0x444825['getUser'](_0x48f80d)&&_0x518d2d['add'](_0x48f80d);for(const {userId:_0x36d349}of _0x44c21a)_0x444825['getUser'](_0x36d349)||_0x518d2d['add'](_0x36d349);}if(0x0===_0x518d2d['size'])return;const _0x49f962=await dt['getMany'](_0x1494a2,Array['from'](_0x518d2d));for(const _0x4832d8 of _0x49f962)_0x444825['getUser'](_0x4832d8['id'])||_0x444825['addUser'](_0x4832d8);}}async function y(_0xaa356d){if('404'!==_0xaa356d['code'])throw _0xaa356d;}function ut(_0x3152f1){if((_0x139bd7=_0x3152f1)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x139bd7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x139bd7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x139bd7;throw _0x3152f1;}function b(_0x435e66){return{'threadId':_0x435e66['commentThreadId'],'commentId':_0x435e66['commentId'],'content':_0x435e66['content'],'createdAt':_0x435e66['createdAt'],'authorId':_0x435e66['userId'],'attributes':_0x435e66['attributes']||{}};}class f extends _0x1d59aa{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}constructor(_0x58cb00){super(_0x58cb00);const _0x574685=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x574685);}['init'](){const _0x135b32=this['editor']['plugins']['get'](c),_0x4e2e0b=this['editor']['plugins']['get']('TrackChangesEditing');return _0x4e2e0b['adapter']={'getSuggestion':async _0x5a878b=>{await this['_waitForServiceReady']();const _0x238962=await this['_trackChangesService']['get'](_0x5a878b)['catch'](w);return await this['_fetchMissingUsersForThreads']([_0x238962]),_0x238962;},'addSuggestion':async({id:_0x4528d3,type:_0x295f70,data:_0x1319f2,originalSuggestionId:_0x1220b4,attributes:_0x295fcc})=>{await this['_waitForServiceReady']();const _0x2e57ce={'id':_0x4528d3,'type':_0x295f70,'data':_0x1319f2,'originalSuggestionId':_0x1220b4,'attributes':_0x295fcc},_0x8bb60b=await this['_trackChangesService']['add'](_0x4528d3,_0x295f70,_0x1319f2,_0x1220b4,_0x295fcc)['catch'](_0x2f0d9f=>{if(ft(_0x2f0d9f))return new Promise(_0x2e6af1=>{this['_bufferedRequests']['set'](_0x4528d3,{'resolve':_0x2e6af1,'suggestionData':_0x2e57ce});});throw _0x2f0d9f;});return this['_bufferedRequests']['delete'](_0x4528d3),_0x8bb60b;},'updateSuggestion':async(_0x1b3dc4,_0x15e37c)=>{if(await this['_waitForServiceReady'](),'open'!==_0x15e37c['state'])return this['_trackChangesService']['update'](_0x1b3dc4,_0x15e37c)['catch'](w);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x57a6d1,_0x5a85b3)=>{_0x4e2e0b['hasSuggestion'](_0x5a85b3['id'])&&(_0x4e2e0b['getSuggestion'](_0x5a85b3['id'])['attributes']=_0x5a85b3['attributes']);}),this['_trackChangesService']['connect'](_0x135b32['connection'])['then'](_0x356925=>(_0x135b32['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x356925)['then'](()=>{for(const _0x102836 of _0x356925){_0x4e2e0b['addSuggestionData'](_0x102836)['_saved']=!0x0;}})));}async['reconnect'](){const _0x1cd268=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x4785b0}=this['editor']['plugins']['get'](c),_0xa7728c=await this['_trackChangesService']['connect'](_0x4785b0);await this['_fetchMissingUsersForThreads'](_0xa7728c);for(const {suggestionData:_0x500846,resolve:_0x3cc71b}of this['_bufferedRequests']['values']()){let _0x30530d=_0xa7728c['find'](_0x38d297=>_0x38d297['id']===_0x500846['id']);_0x30530d||(_0x30530d=await this['_trackChangesService']['add'](_0x500846['id'],_0x500846['type'],_0x500846['data'],_0x500846['originalSuggestionId'])),_0x3cc71b(_0x30530d);}for(const _0x2c3449 of _0xa7728c)_0x1cd268['hasSuggestion'](_0x2c3449['id'])||_0x1cd268['addSuggestionData'](_0x2c3449);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x4f999e=>{this['listenTo'](this['_trackChangesService'],'connected',_0x4694c5=>{_0x4694c5['off'](),_0x4f999e();});});}async['_fetchMissingUsersForThreads'](_0x43bdd2){const _0x1305a9=this['editor']['plugins']['get'](_0x41520f),{connection:_0x55907f}=this['editor']['plugins']['get'](c),_0x3d9167=new Set();for(const {authorId:_0x3348cf}of _0x43bdd2)_0x1305a9['getUser'](_0x3348cf)||_0x3d9167['add'](_0x3348cf);if(0x0===_0x3d9167['size'])return;const _0x56e2cd=await dt['getMany'](_0x55907f,Array['from'](_0x3d9167));for(const _0x574bc1 of _0x56e2cd)_0x1305a9['getUser'](_0x574bc1['id'])||_0x1305a9['addUser'](_0x574bc1);}}function w(_0xfc67a2){if(ft(_0xfc67a2))return new Promise(()=>{});throw _0xfc67a2;}function ft(_0x12110d){return _0x12110d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x12110d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x1d59aa{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3133b4=this['editor']['plugins']['get'](c),_0x5e1b1d=this['editor']['plugins']['get']('CommentsEditing'),_0x22395b=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3133b4,'change:state',(_0x461371,_0x250268,_0x2976db)=>{_0x5e1b1d['isThreadsLoadingPaused']='connected'!==_0x2976db;});}),this['listenTo'](_0x3133b4,'change:state',(_0x49b83d,_0x36b3bb,_0x3c6290)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x3c6290);}),_0x22395b['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x1d59aa{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x1d59aa{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x41520f];}constructor(_0x4aa92f){super(_0x4aa92f);const _0x312ae8=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x312ae8);}async['init'](){const _0xe6768=this['editor']['plugins']['get'](l),_0x15b237=_0xe6768['serverHistory'],_0x5236f8=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x15b237,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xe6768['sessionId']});const _0x41fadd=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x358347=await tt['isBundleUploaded'](_0x5236f8['connection'],_0x41fadd);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x318eb3})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x318eb3)),'updateRevisions':async _0x463377=>{await this['_waitForServiceReady']();const _0x3355cc=this['_revisionTracker']['currentRevision'];if(_0x358347&&0x1===_0x463377['length']&&_0x463377[0x0]['id']===_0x3355cc['id'])return _0x463377;for(const _0x2228ab of _0x463377)_0x2228ab['id']===_0x3355cc['id']&&(_0x2228ab['isEmptyCurrent']=_0x2228ab['fromVersion']===_0x2228ab['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x463377,this['_lastRequestId'])['then'](_0x406276=>(this['_lastRequestId']=_0x406276,_0x463377))['catch'](_0x418f7b=>{if(st(_0x418f7b)||'400'===_0x418f7b['code']&&void 0x0!==_0x418f7b['data']['wrongRequestId']){for(const _0xa12a48 of _0x463377){!this['_revisionTracker']['repository']['getRevision'](_0xa12a48['id'])||this['_revisionTracker']['_bufferUpdate'](_0xa12a48['id'],_0xa12a48,!0x1);}if(st(_0x418f7b))throw _0x418f7b;return _0x463377;}throw _0x418f7b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x55c07c,{revisionsData:_0x417f8a,requestId:_0x5c77a7})=>{Math['max'](..._0x417f8a['map'](_0x167e20=>_0x167e20['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x417f8a,_0x5c77a7);}):this['_handleRevisionsUpdate'](_0x417f8a,_0x5c77a7);});const {revisions:_0x1d7334,requestId:_0x27e70e}=await this['_revisionHistoryService']['connect'](_0x5236f8['connection']);_0x5236f8['addToReconnectionStack'](this),this['_lastRequestId']=_0x27e70e,await this['_fetchMissingUsers'](_0x1d7334);for(const _0x15732f of _0x1d7334)this['_revisionTracker']['addRevisionData'](_0x15732f);this['listenTo'](_0xe6768,'change:_isConnected',(_0x1d83b1,_0x2600a4,_0xf51d9b)=>{_0xf51d9b&&(this['_oldOffset']=_0xe6768['_offset'],_0x1d83b1['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5236f8,'state',_0x348549=>_0x348549===_0x31dbb4['CONNECTED']);}async['reconnect'](){const _0x3b5c07=this['editor']['plugins']['get'](c),_0x1a7155=this['editor']['plugins']['get'](l),_0x2baa1e=async()=>{const _0x115447=this['_revisionTracker']['currentRevision'],_0x1c0cf8=_0x115447['id'],_0x4d48b5=_0x1c0cf8!==_0x1a7155['sessionId'];if(_0x4d48b5){const _0xfa6992=_0x1a7155['_offset']-this['_oldOffset'],_0x56f91e=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x115447['toVersion']+_0xfa6992!==_0x56f91e){const _0x43ea87=_0x115447['fromVersion']+_0xfa6992,_0x153be9=this['editor']['plugins']['get'](_0x41520f),_0xec6943=this['_revisionTracker']['buildRevisionData']({'revision':_0x115447,'from':_0x43ea87,'to':_0x56f91e});_0xec6943['id']=_0x115447['id'];const _0x1a122b=_0xec6943['authorsIds']['map'](_0x2fc5f5=>_0x153be9['getUser'](_0x2fc5f5));_0x115447['_update']({..._0xec6943,'authors':_0x1a122b},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x115447['id'],_0xec6943,!0x0);}this['_revisionTracker']['_startingVersion']=_0x56f91e,(_0x115447['toVersion']===_0x115447['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x1c0cf8)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x1c0cf8),this['_revisionTracker']['_createCurrentRevision'](_0x56f91e));}const {revisions:_0x11ba5d,requestId:_0x5b6c3c}=await this['_revisionHistoryService']['reconnect'](_0x3b5c07['connection'],this['_lastRequestId']);_0x4d48b5&&_0x11ba5d['length']>0x0?_0x1a7155['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x11ba5d),this['_handleRevisionsUpdate'](_0x11ba5d,_0x5b6c3c),this['_revisionTracker']['sendBufferedUpdates']());};return _0x1a7155['_isConnected']?_0x2baa1e():new Promise((_0x4e0240,_0x30583f)=>{_0x1a7155['once']('change:_isConnected',()=>{_0x2baa1e()['then'](_0x4e0240)['catch'](_0x30583f);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x122e41=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0xbb4924=>{_0xbb4924['off'](),_0x122e41();});});}['_getLatestVersionFromServerOperations'](){const _0x497df5=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x23aeb of _0x497df5)if('marker'!==_0x23aeb['type']||_0x23aeb['affectsData'])return _0x23aeb['baseVersion']+0x1;}['_getLatestVersion'](){const _0x340aa8=this['editor']['plugins']['get'](l);return new Promise(_0x429724=>{_0x340aa8['_isPendingUpdate']?_0x340aa8['once']('change:_isPendingUpdate',()=>{_0x429724(this['_getLatestVersionFromServerOperations']());}):_0x429724(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3186a3,_0x2f486c){const _0x185a2d=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2f486c;for(const _0x378ff4 of _0x3186a3){const _0x459f10=_0x185a2d['getRevision'](_0x378ff4['id']);if(_0x459f10){if((_0x378ff4['fromVersion']||_0x378ff4['toVersion'])&&(_0x378ff4['diffData']=null),_0x459f10===this['_revisionTracker']['currentRevision']){const _0x5e3cc5=Math['max'](_0x459f10['toVersion'],_0x378ff4['toVersion']),_0x104ee3=Math['max'](_0x459f10['fromVersion'],_0x378ff4['fromVersion']);let _0x1ec41a;_0x459f10['toVersion']===_0x378ff4['toVersion']&&_0x459f10['fromVersion']===_0x378ff4['fromVersion']?(_0x1ec41a=!0x0,this['_preventResendingRevisionData'](_0x378ff4)):_0x378ff4['toVersion']===_0x5e3cc5&&_0x378ff4['fromVersion']===_0x104ee3?_0x1ec41a=!0x1:(_0x459f10['toVersion']===_0x5e3cc5&&_0x459f10['fromVersion']===_0x104ee3||this['_fixRevision']({'revision':_0x459f10,'from':_0x104ee3,'to':_0x5e3cc5}),_0x1ec41a=!0x0),_0x1ec41a&&(delete _0x378ff4['fromVersion'],delete _0x378ff4['toVersion'],delete _0x378ff4['diffData'],delete _0x378ff4['createdAt'],delete _0x378ff4['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x378ff4),this['_preventResendingRevisionData'](_0x378ff4);}else this['_revisionTracker']['addRevisionData'](_0x378ff4);}const _0x262897=_0x185a2d['getRevisions']();_0x262897['reverse']();for(let _0x16753d=0x0;_0x16753d<_0x262897['length']-0x1;_0x16753d++){const _0xa09fab=_0x262897[_0x16753d],_0x44e981=_0x262897[_0x16753d+0x1];if(_0xa09fab['fromVersion']<_0x44e981['toVersion']){const _0x571676=_0x44e981['toVersion'],_0x16257a=Math['max'](_0x571676,_0xa09fab['toVersion']);this['_fixRevision']({'revision':_0xa09fab,'from':_0x571676,'to':_0x16257a});}}}['_fixRevision']({revision:_0x16408,from:_0x21fd49,to:_0x5da47c}={}){const _0x541b06=this['editor']['plugins']['get'](_0x41520f),_0x5c2ffa=this['_revisionTracker']['buildRevisionData']({'revision':_0x16408,'from':_0x21fd49,'to':_0x5da47c});_0x5c2ffa['authors']=_0x5c2ffa['authorsIds']['map'](_0x36a558=>_0x541b06['getUser'](_0x36a558)),_0x16408['_update'](_0x5c2ffa);}['_preventResendingRevisionData'](_0x488504){const _0x5c4e4e={};_0x5c4e4e['id']=_0x488504['id'];for(const _0x29cea8 of Object['keys'](_0x488504))'id'!==_0x29cea8&&(_0x5c4e4e[_0x29cea8]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5c4e4e['id'],_0x5c4e4e,!0x0);}async['_fetchMissingUsers'](_0x5eb847){const _0xeef44a=this['editor']['plugins']['get'](_0x41520f),{connection:_0x3954e4}=this['editor']['plugins']['get'](c),_0x56af0a=new Set();for(const _0x305011 of _0x5eb847){for(const _0x334e7a of _0x305011['authorsIds'])_0x3ae328(_0x334e7a);_0x305011['creatorId']&&_0x3ae328(_0x305011['creatorId']);}if(0x0===_0x56af0a['size'])return;const _0xd16bf1=await dt['getMany'](_0x3954e4,Array['from'](_0x56af0a));for(const _0x426990 of _0xd16bf1)_0xeef44a['getUser'](_0x426990['id'])||_0xeef44a['addUser'](_0x426990);function _0x3ae328(_0xa1bc4d){_0xeef44a['getUser'](_0xa1bc4d)||_0x56af0a['add'](_0xa1bc4d);}}}function st(_0x2ecb36){return _0x2ecb36['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x2ecb36['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2ecb36['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1d59aa{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x57fbbb{constructor(_0x3d306d){super(_0x3d306d);const _0x2ace39=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x2ace39['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x2ace39['to']('usersCount',_0x45c794=>q(_0x3d306d,'CONNECTED_USERS',_0x45c794))}]});}}class es extends _0x57fbbb{['items'];['keystrokes'];constructor(_0x3430fb){super(_0x3430fb);const _0x458e4b=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x35a206(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x458e4b['if']('hasPopup'),'aria-expanded':_0x458e4b['to']('isExpanded',_0x2a4678=>this['hasPopup']&&String(_0x2a4678)),'aria-label':_0x458e4b['to']('hasPopup',_0x3d43dc=>q(_0x3430fb,_0x3d43dc?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x458e4b['to']('hasPopup',_0x45aa6d=>!!_0x45aa6d&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x458e4b['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x3c3c3c,_0x1b1b86,_0xd13964)=>{this['element']&&(_0xd13964?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 _ extends _0x57fbbb{['counterView'];['inlineListView'];constructor(_0x1c6790){super(_0x1c6790);const _0x389688=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x1c6790),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x16e0c2 of this['inlineListView']['items'])_0x16e0c2['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',_0x389688['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class M extends _0x57fbbb{['listWrapperView'];constructor(_0x3edeb2,_0x1f0968){super(_0x3edeb2),this['listWrapperView']=new mt(_0x3edeb2,_0x1f0968),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x3edeb2,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x4bd207{constructor(_0x3a0aa3,_0x5d6828){super(_0x3a0aa3);const _0x578764=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x5d6828?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x578764['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x578764['to']('role'),'aria-label':_0x578764['to']('ariaLabel'),'aria-labelledby':_0x578764['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3a6be1['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x2d82c0=this['element'];_0x2d82c0&&(this['_isScrollable']=Math['max'](_0x2d82c0['scrollHeight'],_0x2d82c0['clientHeight'])>0.8*window['innerHeight']);}}class E extends rt{['userView'];constructor(_0x28d325,_0x2a2be9,_0x48d4b9){super(_0x28d325);const _0x51a47b=this['bindTemplate'];this['userView']=new ct(_0x28d325,_0x2a2be9);const _0x2678ca={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x2a2be9['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x2a2be9['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2a2be9['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x48d4b9&&(_0x2678ca['tag']='button',_0x2678ca['on']={'click':_0x51a47b['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2678ca);}['focus'](){this['element']['focus']();}}class T extends _0x57fbbb{['userView'];['markerView'];constructor(_0x1078c0,_0x3a3203,_0x5908a4){super(_0x1078c0);const _0x336ac7=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x1078c0,_0x3a3203),this['markerView']=new at(_0x1078c0,_0x3a3203);const _0x4094b6=new ot(_0x1078c0);_0x4094b6['template']['tag']='span',_0x4094b6['text']=_0x3a3203['name'];const _0x5e85ac={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x336ac7['to']('isFocusable',_0x31ae74=>!!_0x31ae74&&0x0),'aria-labelledby':_0x4094b6['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x336ac7['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x336ac7['to']('hasTooltip',_0x4486f0=>!_0x4486f0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4094b6]};_0x5908a4&&(_0x5e85ac['tag']='button',_0x5e85ac['on']={'click':_0x336ac7['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5e85ac);}}class at extends _0x57fbbb{constructor(_0x55195b,_0x36f8a3){super(_0x55195b),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x36f8a3['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const D={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x398b21{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x555dd2){super(_0x555dd2),this['context']['config']['define']('presenceList',D);const _0x4c9252=_0x555dd2['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4c9252)throw new _0xce1efc('presencelist-collapseat-invalid-format',this);if(_0x4c9252<0x1)throw new _0xce1efc('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x614065(),this['balloonPanelView']=new _0x30b0f6(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x1c603b of this['_allConnectedUsers'])this['_handleUserAdd'](_0x1c603b);this['listenTo'](this['_allConnectedUsers'],'add',(_0xa2934e,_0x5d9765)=>{this['_handleUserAdd'](_0x5d9765);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x578175,_0xb5267e)=>{this['_handleUserRemove'](_0xb5267e);});}['_createView'](){const _0x56fb53=this['context'],_0x5b2774=new _(this['context']['locale']),_0x18ad24=this['balloonPanelView'];if(!_0x4ebd88(_0x56fb53['config']['get']('presenceList.container')))throw new _0xce1efc('presencelist-missing-container',this);return _0x5b2774['counterView']['bind']('usersCount')['to'](this),_0x5b2774['bind']('isCollapsed')['to'](this,'usersCount',_0x43bb38=>{const {collapseAt:_0x4e1cc9,displayMe:_0xd1db70}=_0x56fb53['config']['get']('presenceList'),_0x3275e5=_0x43bb38>=_0x4e1cc9;return _0x5b2774['counterView']['isHidden']=!(0x1==_0x43bb38&&_0xd1db70||_0x3275e5),_0x3275e5||this['hideDropdown'](),_0x3275e5;}),_0x5b2774['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x4c5368=>{const _0x47b7b5=_0x56fb53['config']['get']('presenceList'),_0xd81225=new T(_0x56fb53['locale'],_0x4c5368,!!_0x47b7b5['onClick']);return _0xd81225['bind']('hasTooltip')['to'](_0x5b2774,'isCollapsed',_0x2c1b77=>!_0x2c1b77),_0xd81225['bind']('isFocusable')['to'](_0x5b2774,'isCollapsed',_0x4ccd95=>!_0x4ccd95),_0x47b7b5['onClick']&&this['listenTo'](_0xd81225,'execute',()=>{this['view']['isCollapsed']||_0x47b7b5['onClick'](_0x4c5368,_0xd81225['element']);}),_0xd81225;}),this['listenTo'](_0x5b2774['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x5b2774['inlineListView']['keystrokes']['set']('Enter',(_0x15ddf4,_0x5ae4a4)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x5ae4a4());}),_0x5b2774['render'](),_0x18ad24['render'](),_0x14a525({'emitter':_0x5b2774,'activator':()=>_0x18ad24['isVisible'],'contextElements':[_0x18ad24['element'],_0x5b2774['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x56fb53['config']['get']('presenceList.container')['appendChild'](_0x5b2774['element']),this['_bodyCollection']=new _0x5c8e58(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5b2774;}['_handleUserAdd'](_0x2eff65){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2eff65['isMe'])return;const _0x3f2e0c=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x3f2e0c&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x413757=_0x2eff65['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2eff65,_0x413757);}['_handleUserRemove'](_0x300ca3){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x300ca3['id'])&&(this['currentDisplayedUsers']['remove'](_0x300ca3['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x236cc5 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x236cc5['id']))return void this['currentDisplayedUsers']['add'](_0x236cc5,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x51a95a=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new M(this['context']['locale'],!!_0x51a95a['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x224cd1}=this['presenceDropdownView'];_0x224cd1['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x11af8e=>{if(!_0x51a95a['displayMe']&&_0x11af8e['isMe'])return null;const _0x50d5bc=new E(this['context']['locale'],_0x11af8e,!!_0x51a95a['onClick']);return _0x51a95a['onClick']&&this['listenTo'](_0x50d5bc,'execute',()=>{_0x51a95a['onClick'](_0x11af8e,_0x50d5bc['element']);}),_0x50d5bc;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x224cd1['focus'](),_0x224cd1['checkIfScrollable']();const _0x3e26a9=(_0x315ab2,_0x51ce7e)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x51ce7e();};_0x224cd1['keystrokes']['set']('Esc',_0x3e26a9),_0x224cd1['keystrokes']['set']('Shift+Tab',_0x3e26a9),_0x224cd1['keystrokes']['set']('Tab',(_0x48d8ad,_0x261031)=>{!function(_0x47f47f){const _0x597c6d=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x275b4b=>_0x275b4b+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x545e4a=[...document['body']['querySelectorAll'](_0x597c6d)]['filter'](_0x507dca=>_0x507dca===document['activeElement']||_0x507dca['offsetWidth']+_0x507dca['offsetHeight']>0x0)['sort']((_0x27006c,_0x30cc72)=>(_0x27006c['tabIndex']||0x0)-(_0x30cc72['tabIndex']||0x0)),_0x3a0f28=_0x545e4a['indexOf'](_0x47f47f),_0xcea90b=_0x545e4a[(_0x3a0f28+0x1)%_0x545e4a['length']];_0xcea90b&&_0xcea90b['focus']();}(this['view']['element']),this['hideDropdown'](),_0x261031();}),_0x224cd1['focusTracker']['add'](this['view']['element']),_0x224cd1['focusTracker']['on']('change:isFocused',(_0x5907cc,_0x520e29,_0x2f5a79)=>{_0x2f5a79||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x398b21{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
@@ -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':_0x3a7a18=>0x1!=_0x3a7a18}};
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':_0x383353=>0x1!=_0x383353}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x3914c2=>{const {af:{dictionary:_0x1db8aa,getPluralForm:_0x2f2274}}={'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':_0x373ead=>0x1!=_0x373ead}};_0x3914c2['af']||={'dictionary':{},'getPluralForm':null},_0x3914c2['af']['dictionary']=Object['assign'](_0x3914c2['af']['dictionary'],_0x1db8aa),_0x3914c2['af']['getPluralForm']=_0x2f2274;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x550fdd=>{const {af:{dictionary:_0x41dd5a,getPluralForm:_0x263e04}}={'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':_0x2e5cc0=>0x1!=_0x2e5cc0}};_0x550fdd['af']||={'dictionary':{},'getPluralForm':null},_0x550fdd['af']['dictionary']=Object['assign'](_0x550fdd['af']['dictionary'],_0x41dd5a),_0x550fdd['af']['getPluralForm']=_0x263e04;})(window['CKEDITOR_TRANSLATIONS']||={});